Model card: document the periodic checkpoints
Browse files
README.md
CHANGED
|
@@ -1,168 +1,169 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
library_name: pytorch
|
| 4 |
-
tags:
|
| 5 |
-
- reinforcement-learning
|
| 6 |
-
- multi-agent-reinforcement-learning
|
| 7 |
-
- deep-reinforcement-learning
|
| 8 |
-
- dqn
|
| 9 |
-
- dueling-dqn
|
| 10 |
-
- multi-agent-systems
|
| 11 |
-
- drone-swarm
|
| 12 |
-
- fault-tolerance
|
| 13 |
-
- domain-randomization
|
| 14 |
-
---
|
| 15 |
-
|
| 16 |
-
# Multi-Drone Cooperative Search with Random Faults β trained policy
|
| 17 |
-
|
| 18 |
-
Trained weights for the Multi-Agent Systems course project (MSc Artificial
|
| 19 |
-
Intelligence, University of Bologna, A.Y. 2025/26).
|
| 20 |
-
|
| 21 |
-
A team of `N` drones searches a 32Γ32 occupancy grid for one hidden target under
|
| 22 |
-
partial observability, range-limited communication and a fixed time budget,
|
| 23 |
-
while **any drone can permanently break at any moment**, with no central
|
| 24 |
-
authority to announce the loss. A single Dueling Double DQN with parameter
|
| 25 |
-
sharing drives every drone; per-episode domain randomization plus a compact
|
| 26 |
-
context vector make that one policy a generalist across team size, sensing,
|
| 27 |
-
communication range, obstacle density and fault rate.
|
| 28 |
-
|
| 29 |
-
- **Code:** https://github.com/simoswish02/Multi-Agent-Systems-Project
|
| 30 |
-
- **Report (49 pp.):** [`report/main.pdf`](https://github.com/simoswish02/Multi-Agent-Systems-Project/blob/main/report/main.pdf)
|
| 31 |
-
- **Video walkthrough (~4 min):** https://youtu.be/az1LtAcZYZo
|
| 32 |
-
|
| 33 |
-
## Files
|
| 34 |
-
|
| 35 |
-
| File | Description |
|
| 36 |
-
|---|---|
|
| 37 |
-
| `mas_50k_dr_faults_ep50000.pt` | Final checkpoint of the 50,000-episode run. **Every number in Section 7 of the report comes from this file.** |
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
#
|
| 67 |
-
``
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
|
| 111 |
-
|
|
| 112 |
-
|
|
| 113 |
-
|
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
|
| 119 |
-
|
|
| 120 |
-
|
|
| 121 |
-
|
|
| 122 |
-
|
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
|
| 128 |
-
|
|
| 129 |
-
|
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
the
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
}
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
library_name: pytorch
|
| 4 |
+
tags:
|
| 5 |
+
- reinforcement-learning
|
| 6 |
+
- multi-agent-reinforcement-learning
|
| 7 |
+
- deep-reinforcement-learning
|
| 8 |
+
- dqn
|
| 9 |
+
- dueling-dqn
|
| 10 |
+
- multi-agent-systems
|
| 11 |
+
- drone-swarm
|
| 12 |
+
- fault-tolerance
|
| 13 |
+
- domain-randomization
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# Multi-Drone Cooperative Search with Random Faults β trained policy
|
| 17 |
+
|
| 18 |
+
Trained weights for the Multi-Agent Systems course project (MSc Artificial
|
| 19 |
+
Intelligence, University of Bologna, A.Y. 2025/26).
|
| 20 |
+
|
| 21 |
+
A team of `N` drones searches a 32Γ32 occupancy grid for one hidden target under
|
| 22 |
+
partial observability, range-limited communication and a fixed time budget,
|
| 23 |
+
while **any drone can permanently break at any moment**, with no central
|
| 24 |
+
authority to announce the loss. A single Dueling Double DQN with parameter
|
| 25 |
+
sharing drives every drone; per-episode domain randomization plus a compact
|
| 26 |
+
context vector make that one policy a generalist across team size, sensing,
|
| 27 |
+
communication range, obstacle density and fault rate.
|
| 28 |
+
|
| 29 |
+
- **Code:** https://github.com/simoswish02/Multi-Agent-Systems-Project
|
| 30 |
+
- **Report (49 pp.):** [`report/main.pdf`](https://github.com/simoswish02/Multi-Agent-Systems-Project/blob/main/report/main.pdf)
|
| 31 |
+
- **Video walkthrough (~4 min):** https://youtu.be/az1LtAcZYZo
|
| 32 |
+
|
| 33 |
+
## Files
|
| 34 |
+
|
| 35 |
+
| File | Description |
|
| 36 |
+
|---|---|
|
| 37 |
+
| `mas_50k_dr_faults_ep50000.pt` | Final checkpoint of the 50,000-episode run. **Every number in Section 7 of the report comes from this file.** This is the one to download for normal use. |
|
| 38 |
+
| `checkpoints/mas_50k_dr_faults_ep*.pt` | The 20 periodic snapshots taken every 2,500 episodes, including a copy of the final one. Needed only to reproduce the learning curve (`--axis epoch`), which re-evaluates each of them; ~5.1 GB in total. |
|
| 39 |
+
|
| 40 |
+
## Usage
|
| 41 |
+
|
| 42 |
+
```bash
|
| 43 |
+
git clone https://github.com/simoswish02/Multi-Agent-Systems-Project
|
| 44 |
+
cd Multi-Agent-Systems-Project
|
| 45 |
+
conda env create -f environment.yaml && conda activate rl-drone
|
| 46 |
+
|
| 47 |
+
# download the checkpoint into checkpoints/
|
| 48 |
+
huggingface-cli download simoswish/MAS_MultiDroneExploration \
|
| 49 |
+
mas_50k_dr_faults_ep50000.pt --local-dir checkpoints/
|
| 50 |
+
|
| 51 |
+
# watch it fly
|
| 52 |
+
python main.py --mode eval --checkpoint checkpoints/mas_50k_dr_faults_ep50000.pt \
|
| 53 |
+
--fault-prob 0.003
|
| 54 |
+
|
| 55 |
+
# reproduce the experiments of Section 7
|
| 56 |
+
python testing/evaluate_policy.py --axis all --seeds 500 \
|
| 57 |
+
--checkpoint checkpoints/mas_50k_dr_faults_ep50000.pt
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
Loading it directly:
|
| 61 |
+
|
| 62 |
+
```python
|
| 63 |
+
import torch
|
| 64 |
+
ckpt = torch.load("mas_50k_dr_faults_ep50000.pt", map_location="cpu")
|
| 65 |
+
state_dict = ckpt["q_net"] # 22.4M parameters
|
| 66 |
+
# the file also carries optimizer / scheduler / epsilon state, so training
|
| 67 |
+
# can be resumed with `python main.py --mode train --resume <file>`
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
## Model
|
| 71 |
+
|
| 72 |
+
**Architecture** (`agents/networks.py`, report Section 4.4):
|
| 73 |
+
|
| 74 |
+
- **Global trunk** over six 32Γ32 belief planes (Visited, Obstacle, Trajectory,
|
| 75 |
+
Target, Own\_Position, Broken): a ConvNeXt-style CNN, stages of width
|
| 76 |
+
96 β 192 β 384 at resolutions 32 β 16 β 8, with per-stage FiLM conditioning,
|
| 77 |
+
followed by a 3-layer / 8-head Transformer over the 8Γ8 = 64 spatial tokens
|
| 78 |
+
plus a CLS token and a context token.
|
| 79 |
+
- **Local trunk** over a 13Γ13 egocentric crop with five channels: three
|
| 80 |
+
stride-1 ConvNeXt blocks at width 96 (the middle one dilated) β 384.
|
| 81 |
+
- **Fusion and head:** concat (1024 + 384 + 5) β FC 1536 β 768 β 384 β dueling
|
| 82 |
+
head, `Q = V + A β mean(A)`, over 4 actions (up / down / left / right).
|
| 83 |
+
- 22.4M parameters, float32.
|
| 84 |
+
|
| 85 |
+
**Context vector** (`CTX_DIM = 5`), rebuilt every round for every drone:
|
| 86 |
+
`[vision_radius, comm_range, n_agents, agent_id, n_alive_belief]`, each
|
| 87 |
+
normalized by the domain-randomization maxima (6, 12, 4, 4, 4). `agent_id`
|
| 88 |
+
breaks the parameter-sharing symmetry so co-located drones split up from step 0;
|
| 89 |
+
`n_alive_belief` is that drone's *own* belief about how many teammates remain β
|
| 90 |
+
decentralized, and possibly stale.
|
| 91 |
+
|
| 92 |
+
## Training
|
| 93 |
+
|
| 94 |
+
Independent / parameter-sharing Dueling Double DQN, one shared network, single
|
| 95 |
+
phase of 50,000 episodes; Adam, weight decay 1e-6, gradient clip 1.0, Ξ³ = 0.97,
|
| 96 |
+
3-step returns, Huber loss, uniform replay of 2Β·10β΅ transitions, batch 16, one
|
| 97 |
+
gradient step every 4 agent-turns, hard target sync every 500 steps. Ξ΅ decays
|
| 98 |
+
1.0 β 0.05 (Γ0.9995/episode, floor at episode 5,990); the learning rate warms up
|
| 99 |
+
over the first 10% of episodes to 5Β·10β»β΄, then anneals cosine-wise to 10β»βΆ.
|
| 100 |
+
|
| 101 |
+
Per-episode domain randomization: vision radius β [1, 6], communication range
|
| 102 |
+
β [2, 12], team size β [1, 4], obstacle density β [0.10, 0.30], per-turn fault
|
| 103 |
+
probability β [0, 0.003]. The grid size (32) is the one constant.
|
| 104 |
+
|
| 105 |
+
## Results
|
| 106 |
+
|
| 107 |
+
At the reference operating point (N = 3, r_vis = 3, r_comm = 5, Ο = 0.2, T = 200,
|
| 108 |
+
no faults), 500 seeded instances, greedy:
|
| 109 |
+
|
| 110 |
+
| | |
|
| 111 |
+
|---|---|
|
| 112 |
+
| Success rate | **87.6%** (Wilson CI [84.4, 90.2]) |
|
| 113 |
+
| Map coverage | 53.7% |
|
| 114 |
+
| SPL | 0.541 |
|
| 115 |
+
|
| 116 |
+
Generalization (success %, endpoints of each sweep):
|
| 117 |
+
|
| 118 |
+
| Axis | In-distribution | OOD probe |
|
| 119 |
+
|---|---|---|
|
| 120 |
+
| Team size N | 71.0 (N=1) β 89.2 (N=4) | 89.6, 90.4 (N = 5, 6) |
|
| 121 |
+
| Vision r_vis | 70.6 β 87.2 | 87.0, 85.6 (r = 7, 8) |
|
| 122 |
+
| Comm. r_comm | 87.4 β 89.0 | 87.6, 88.0, 89.6 (r = 0, 14, 16) |
|
| 123 |
+
| Density Ο | 96.2 (0.10) β 53.4 (0.30) | 99.0, 34.6, 24.2 (Ο = 0, 0.35, 0.40) |
|
| 124 |
+
|
| 125 |
+
Fault robustness β the project's headline result:
|
| 126 |
+
|
| 127 |
+
| p_fault | 0 | 0.001 | 0.002 | 0.003 | 0.005 | 0.010 |
|
| 128 |
+
|---|---|---|---|---|---|---|
|
| 129 |
+
| Success [%] | 87.6 | 86.0 | 84.4 | 82.0 | 77.2 | 66.2 |
|
| 130 |
+
| Drones lost (mean) | 0.00 | 0.22 | 0.42 | 0.58 | 0.91 | 1.51 |
|
| 131 |
+
|
| 132 |
+
Across the entire trained fault range success falls by under six points while
|
| 133 |
+
the team loses more than half a drone on average; at more than triple the
|
| 134 |
+
trained maximum it still completes two missions in three, with no cliff.
|
| 135 |
+
|
| 136 |
+
## Limitations
|
| 137 |
+
|
| 138 |
+
- Simulation only: 4-connected grid moves, noiseless sensing, instantaneous
|
| 139 |
+
range-limited fusion. No sim-to-real transfer is claimed or tested.
|
| 140 |
+
- Faults are i.i.d. across drones and turns and produce inert, non-blocking
|
| 141 |
+
wrecks. Correlated failures, passage-blocking wrecks and an adversary
|
| 142 |
+
choosing whom to disable are outside the model.
|
| 143 |
+
- Obstacle density is the one axis whose extrapolation degrades, though a
|
| 144 |
+
breadth-first check of the evaluation instances shows most of that to be the
|
| 145 |
+
instance distribution becoming unsolvable rather than the policy failing
|
| 146 |
+
(Section 7.3 of the report).
|
| 147 |
+
- Statistical, not formal, evidence: confidence intervals bound sampling error,
|
| 148 |
+
not worst-case behaviour on an unseen instance.
|
| 149 |
+
|
| 150 |
+
Section 8 of the report discusses the dual-use profile of the capability, its
|
| 151 |
+
treatment under the GDPR and the EU AI Act, and why this specific system would
|
| 152 |
+
be unacceptable as an autonomous weapon.
|
| 153 |
+
|
| 154 |
+
## Citation
|
| 155 |
+
|
| 156 |
+
```bibtex
|
| 157 |
+
@misc{rimondi2026multidrone,
|
| 158 |
+
author = {Rimondi, Simone},
|
| 159 |
+
title = {Multi-Drone Cooperative Search with Random Faults},
|
| 160 |
+
year = {2026},
|
| 161 |
+
note = {Multi-Agent Systems project, MSc Artificial Intelligence,
|
| 162 |
+
University of Bologna},
|
| 163 |
+
url = {https://github.com/simoswish02/Multi-Agent-Systems-Project}
|
| 164 |
+
}
|
| 165 |
+
```
|
| 166 |
+
|
| 167 |
+
## License
|
| 168 |
+
|
| 169 |
+
MIT.
|