Enhancing swarms' durability to threats via graph signal processing and graph-neural-network-based generative modeling

Jonathan Karin, Zoe Piran, Mor Nitzan

TL;DR

This paper applies Graph Signal Processing (GSP) to swarm intelligence, uncovering a fundamental "detectability-durability trade-off": compact swarms are harder for predators to detect but easier to wipe out once compromised, whereas spread-out swarms face the opposite fate. To resolve this tension, the authors introduce SWAGEN, a generative Graph Neural Network (GNN) that optimizes swarm geometry, discovering a novel, highly resilient "kite" configuration that excels at both evading detection and surviving attacks.

What Problem Does This Paper Address?

Whether it's a school of fish evading a shark or a fleet of military drones navigating a hostile airspace, swarms rely on collective behavior to survive. While traditional swarm models focus heavily on local interaction rules (like avoiding collisions or matching a neighbor's velocity), they often overlook how the global spatial configuration impacts resilience against external threats.

The authors address this gap by asking a crucial question: How can we mathematically model and optimize a swarm's physical shape to maximize its durability against sequential external perturbations, such as predation or targeted adversarial attacks?

Methods

The authors bridge the gap between geometry and survival by modeling the swarm as an unweighted, undirected unit disk graph, where agents are nodes and edges represent proximity within a specific interaction range.

They frame predation as a two-stage process using Graph Signal Processing (GSP):

  1. The Detection Phase: Modeled via the Domain of Danger (DOD)—the total area covered by the union of sensing disks around each agent. A larger DOD increases the mathematical probability that a randomly moving predator will spot the swarm.
  2. The Predation Phase: Once an agent is detected, the predator moves sequentially from one prey to the next closest prey. The authors elegantly model this threat propagation as a diffusible signal flowing through the graph using a heat kernel filter.
Abstract visualization of the GSP approach used to model swarm behavior, including the Domain of Danger and diffusion mechanics.

To optimize these conflicting properties, they present SWAGEN (Swarm Generative Network), a task-specific generative model. SWAGEN processes swarm graphs through GraphSAGE layers, maps them to a Variational Autoencoder (VAE)-style latent space, and outputs optimized agent coordinates.

Overview of the SWAGEN model architecture and its multi-component loss function.

Because geometric area and graph diffusion are inherently non-differentiable, the authors designed a novel, fully differentiable loss function:

  • DOD Term: Approximated using a continuous grid-wide summation of sigmoid functions.
  • Diffusion Term: Evaluated using the coefficient of variation (CV) of the heat-filtered signal across the nodes. Maximizing this variation impedes the predator's ability to easily diffuse through the network.

Datasets

The paper evaluates its framework using custom-generated, simulated environments rather than static real-world datasets:

  • Training Set: 1,000 simulated swarm configurations generated on a $1000 \times 1000$ pixel 2D grid, with the number of agents ($N$) randomly sampled between 40 and 50.
  • Baseline Configurations: Classic biological formations including the V-formation (90° angle), arrow (right triangle), and rectangle, alongside completely random initializations.

Key Insights and Ideas

  • The Detectability-Durability Trade-off: The paper proves an inherent contradiction in swarm geometry. Compact shapes (like rectangles) have a small DOD, making them stealthy but highly vulnerable to total extinction once a predator penetrates their dense network. Conversely, loose shapes (like the V-formation) are easy to spot but highly resilient to cascading attacks because the predator struggles to "diffuse" across the sparse graph.
  • Viable Co-optimization: Skeptics might assume optimizing two contradictory terms would result in deadlocks. However, gradient analysis revealed that while the DOD and diffusion gradients are strongly negatively correlated (-0.82), they do not completely cancel out, leaving mathematical room for simultaneous optimization.
Scatter plot showing that the gradients of the DOD term and diffusion term are negatively correlated but do not fully cancel each other out.
  • Discovery of the "Kite" Motif: Instead of simply tweaking standard shapes, SWAGEN generated a completely unique spatial configuration: a dense rectangular block of agents at the front with a curved, trailing line of agents behind it. This "kite" structure successfully breaks the traditional trade-off barrier.

Key Results

  • Mathematical Optimization: SWAGEN successfully pushed random initializations toward the optimal top-right corner of the DOD-diffusion plane. The mean normalized DOD score improved from 0.364 to 0.496, and the diffusion score skyrocketed from 0.074 to 0.446.
  • Superior Survival Rates: In explicit predation simulations (250 runs), the discovered kite motif achieved a 71.14% agent survival rate, decisively outperforming the rectangle (67.61%), V-formation (66.50%), and arrow (64.42%).
  • Stochastic Robustness: The kite's defensive advantages held up even when deterministic constraints were relaxed to include stochastic predation probabilities, variable predator speeds, and fluctuating agent interaction ranges.

Limitations and Future Work

While highly promising for aerospace and robotic engineering, the authors note a few limitations:

  • Static Initializations: The model currently optimizes the initial static layout of the swarm. In reality, swarms are highly dynamic and constantly shifting.
  • Future Directions: The authors point toward extending this framework to dynamic graph environments. This would allow artificial swarms to leverage real-time GNN learning to dynamically morph their shapes in response to live threats, mimicking the highly responsive evasive maneuvers seen in natural schools of fish.

Summary updated

BibTeX
@inproceedings{karin2025enhancing,
  author = {Jonathan Karin and Zoe Piran and Mor Nitzan},
  title = {{Enhancing swarms' durability to threats via graph signal processing and graph-neural-network-based generative modeling}},
  booktitle = {Physical},
  year = {2025},
  doi = {10.1103/f495-8ddd},
}
Figure