Model card: refresh against the re-run evaluation and fix the video link
Browse files
README.md
CHANGED
|
@@ -1,169 +1,182 @@
|
|
| 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 |
-
- **
|
| 31 |
-
- **
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
|
| 37 |
-
|
|
| 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 |
-
|
| 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 |
-
|
| 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 (GitHub mirror):** https://github.com/simoswish02/Multi-Agent-Systems-Project
|
| 30 |
+
- **Code (course repository, GitLab):** https://dvcs.apice.unibo.it/pika-lab/courses/ai-ethics/projects/rimondi2526-mas
|
| 31 |
+
- **Report (49 pp.):** [`Rimondi-MultiDroneSearch-MAS.pdf`](https://github.com/simoswish02/Multi-Agent-Systems-Project/blob/main/report/Rimondi-MultiDroneSearch-MAS.pdf)
|
| 32 |
+
- **Video walkthrough (~4 min):** https://youtu.be/8dnRG6ZneP8
|
| 33 |
+
|
| 34 |
+
## Files
|
| 35 |
+
|
| 36 |
+
| File | Description |
|
| 37 |
+
|---|---|
|
| 38 |
+
| `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. |
|
| 39 |
+
| `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.4 GB in total. |
|
| 40 |
+
|
| 41 |
+
## Usage
|
| 42 |
+
|
| 43 |
+
```bash
|
| 44 |
+
git clone https://github.com/simoswish02/Multi-Agent-Systems-Project
|
| 45 |
+
cd Multi-Agent-Systems-Project
|
| 46 |
+
conda env create -f environment.yaml && conda activate rl-drone
|
| 47 |
+
|
| 48 |
+
# download the checkpoint into checkpoints/
|
| 49 |
+
hf download simoswish/MAS_MultiDroneExploration \
|
| 50 |
+
mas_50k_dr_faults_ep50000.pt --local-dir checkpoints/
|
| 51 |
+
|
| 52 |
+
# watch it fly
|
| 53 |
+
python main.py --mode eval --checkpoint checkpoints/mas_50k_dr_faults_ep50000.pt \
|
| 54 |
+
--fault-prob 0.003
|
| 55 |
+
|
| 56 |
+
# reproduce the experiments of Section 7
|
| 57 |
+
python testing/evaluate_policy.py --axis all --seeds 500 \
|
| 58 |
+
--checkpoint checkpoints/mas_50k_dr_faults_ep50000.pt
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
Loading it directly:
|
| 62 |
+
|
| 63 |
+
```python
|
| 64 |
+
import torch
|
| 65 |
+
ckpt = torch.load("mas_50k_dr_faults_ep50000.pt", map_location="cpu")
|
| 66 |
+
state_dict = ckpt["q_net"] # 22.4M parameters
|
| 67 |
+
# the file also carries optimizer / scheduler / epsilon state, so training
|
| 68 |
+
# can be resumed with `python main.py --mode train --resume <file>`
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
+
## Model
|
| 72 |
+
|
| 73 |
+
**Architecture** (`agents/networks.py`, report Section 4.4):
|
| 74 |
+
|
| 75 |
+
- **Global trunk** over six 32Γ32 belief planes (Visited, Obstacle, Trajectory,
|
| 76 |
+
Target, Own\_Position, Broken): a ConvNeXt-style CNN, stages of width
|
| 77 |
+
96 β 192 β 384 at resolutions 32 β 16 β 8, with per-stage FiLM conditioning,
|
| 78 |
+
followed by a 3-layer / 8-head Transformer over the 8Γ8 = 64 spatial tokens
|
| 79 |
+
plus a CLS token and a context token.
|
| 80 |
+
- **Local trunk** over a 13Γ13 egocentric crop with five channels: three
|
| 81 |
+
stride-1 ConvNeXt blocks at width 96 (the middle one dilated) β 384.
|
| 82 |
+
- **Fusion and head:** concat (1024 + 384 + 5) β FC 1536 β 768 β 384 β dueling
|
| 83 |
+
head, `Q = V + A β mean(A)`, over 4 actions (up / down / left / right).
|
| 84 |
+
- 22,445,183 parameters, float32.
|
| 85 |
+
|
| 86 |
+
**Context vector** (`CTX_DIM = 5`), rebuilt every round for every drone:
|
| 87 |
+
`[vision_radius, comm_range, n_agents, agent_id, n_alive_belief]`, each
|
| 88 |
+
normalized by the domain-randomization maxima (6, 12, 4, 4, 4). `agent_id`
|
| 89 |
+
breaks the parameter-sharing symmetry so co-located drones split up from step 0;
|
| 90 |
+
`n_alive_belief` is that drone's *own* belief about how many teammates remain β
|
| 91 |
+
decentralized, and possibly stale.
|
| 92 |
+
|
| 93 |
+
## Training
|
| 94 |
+
|
| 95 |
+
Parameter-sharing Dueling Double DQN: one shared network trained on the pooled
|
| 96 |
+
experience of the whole team, in a single phase of 50,000 episodes. Adam, weight
|
| 97 |
+
decay 1e-6, gradient clip 1.0, Ξ³ = 0.97, 3-step returns, Huber loss, uniform
|
| 98 |
+
replay of 2Β·10β΅ transitions, batch 16, one gradient step every 4 agent-turns,
|
| 99 |
+
hard target sync every 500 steps. Ξ΅ decays 1.0 β 0.05 (Γ0.9995/episode, floor at
|
| 100 |
+
episode 5,990); the learning rate warms up over the first 10% of episodes to
|
| 101 |
+
5Β·10β»β΄, then anneals cosine-wise to 10β»βΆ.
|
| 102 |
+
|
| 103 |
+
Per-episode domain randomization: vision radius β [1, 6], communication range
|
| 104 |
+
β [2, 12], team size β [1, 4], obstacle density β [0.10, 0.30], per-turn fault
|
| 105 |
+
probability β [0, 0.003]. The grid size (32) is the one constant.
|
| 106 |
+
|
| 107 |
+
## Results
|
| 108 |
+
|
| 109 |
+
At the reference operating point (N = 3, r_vis = 3, r_comm = 5, Ο = 0.2,
|
| 110 |
+
T = 200, no faults), 500 seeded instances, greedy (Ξ΅ = 0):
|
| 111 |
+
|
| 112 |
+
| | |
|
| 113 |
+
|---|---|
|
| 114 |
+
| Success rate | **97.6%** (Wilson CI [95.9, 98.6]) |
|
| 115 |
+
| Map coverage | 53.4% |
|
| 116 |
+
| SPL | 0.715 |
|
| 117 |
+
| Time to find | 53.9 rounds |
|
| 118 |
+
|
| 119 |
+
Generalization (success %, endpoints of each sweep, 500 seeds per point):
|
| 120 |
+
|
| 121 |
+
| Axis | In-distribution | OOD probe |
|
| 122 |
+
|---|---|---|
|
| 123 |
+
| Team size N | 79.0 (N=1) β 97.6 (N=4) | 98.8, 99.0 (N = 5, 6) |
|
| 124 |
+
| Vision r_vis | 80.2 (r=1) β 96.6 (r=6) | 96.4, 95.6 (r = 7, 8) |
|
| 125 |
+
| Comm. r_comm | 96.8 (r=2) β 98.0 (r=12) | 95.6, 98.2, 98.8 (r = 0, 14, 16) |
|
| 126 |
+
| Density Ο | 99.0 (Ο=0.10) β 83.6 (Ο=0.30) | 99.2, 80.0, 86.0 (Ο = 0, 0.35, 0.40) |
|
| 127 |
+
|
| 128 |
+
No axis shows a cliff, in or out of distribution, including beyond the trained
|
| 129 |
+
maxima of team size, vision and communication. Obstacle density is the one
|
| 130 |
+
factor that genuinely governs difficulty, costing 15 points across its trained
|
| 131 |
+
range alone.
|
| 132 |
+
|
| 133 |
+
Fault robustness β the project's headline result:
|
| 134 |
+
|
| 135 |
+
| p_fault | 0 | 0.001 | 0.002 | 0.003 | 0.005 | 0.010 |
|
| 136 |
+
|---|---|---|---|---|---|---|
|
| 137 |
+
| Success [%] | 97.6 | 96.0 | 93.6 | 91.0 | 85.4 | 72.6 |
|
| 138 |
+
| SPL | 0.715 | 0.695 | 0.682 | 0.666 | 0.631 | 0.536 |
|
| 139 |
+
| Drones lost (mean) | 0.00 | 0.16 | 0.30 | 0.48 | 0.78 | 1.37 |
|
| 140 |
+
|
| 141 |
+
Across the entire trained fault range (0 β 0.003) success falls by under seven
|
| 142 |
+
points while the team sheds, on average, close to half a drone; at more than
|
| 143 |
+
triple the trained maximum it still completes nearly three missions in four,
|
| 144 |
+
with no cliff. Conditioning on survivors instead: a team that finishes intact
|
| 145 |
+
succeeds 98.7% of the time, losing one drone costs six points (92.5%), and even
|
| 146 |
+
a lone survivor still finds the target in 65.9% of episodes.
|
| 147 |
+
|
| 148 |
+
## Limitations
|
| 149 |
+
|
| 150 |
+
- Simulation only: 4-connected grid moves, noiseless sensing, instantaneous
|
| 151 |
+
range-limited fusion. No sim-to-real transfer is claimed or tested.
|
| 152 |
+
- Faults are i.i.d. across drones and turns and produce inert, non-blocking
|
| 153 |
+
wrecks. Correlated failures, passage-blocking wrecks and an adversary
|
| 154 |
+
choosing whom to disable are outside the model.
|
| 155 |
+
- Above Ο β 0.30 the density sweep stops measuring the same task. The target is
|
| 156 |
+
always drawn from the spawn's connected component, and at high clutter the
|
| 157 |
+
free space fragments until that component holds under a quarter of the free
|
| 158 |
+
cells, so the apparent rebound at Ο = 0.40 is a structurally shorter mission
|
| 159 |
+
rather than a better policy (Section 7.3 of the report).
|
| 160 |
+
- Statistical, not formal, evidence: confidence intervals bound sampling error,
|
| 161 |
+
not worst-case behaviour on an unseen instance.
|
| 162 |
+
|
| 163 |
+
Section 8 of the report discusses the dual-use profile of the capability, its
|
| 164 |
+
treatment under the GDPR and the EU AI Act, and why this specific system would
|
| 165 |
+
be unacceptable as an autonomous weapon.
|
| 166 |
+
|
| 167 |
+
## Citation
|
| 168 |
+
|
| 169 |
+
```bibtex
|
| 170 |
+
@misc{rimondi2026multidrone,
|
| 171 |
+
author = {Rimondi, Simone},
|
| 172 |
+
title = {Multi-Drone Cooperative Search with Random Faults},
|
| 173 |
+
year = {2026},
|
| 174 |
+
note = {Multi-Agent Systems project, MSc Artificial Intelligence,
|
| 175 |
+
University of Bologna},
|
| 176 |
+
url = {https://github.com/simoswish02/Multi-Agent-Systems-Project}
|
| 177 |
+
}
|
| 178 |
+
```
|
| 179 |
+
|
| 180 |
+
## License
|
| 181 |
+
|
| 182 |
+
MIT.
|