Distributed Swarm Morphogenesis with Neural Cellular Automata
Swarm morphogenesis requires robots to assemble desired shapes through local interactions. We present a modular framework integrating neural cellular automata (NCA) with existing site selection and collision-aware control.
From the abstract. Our summary is in progress.
Full paper
Distributed Swarm Morphogenesis with Neural Cellular Automata
Published under CC BY 4.0. Reproduced with attribution; original at arXiv:2610.31900 (PDF).
Abstract
Swarm morphogenesis requires robots to assemble desired shapes through local interactions. We present a modular framework integrating neural cellular automata (NCA) with existing site selection and collision-aware control. Within this framework, we introduce a decentralized attachment-site discovery mechanism. Robots already in the formation update and share local NCA states to identify new attachment sites, enabling progressive growth without a predefined list of sites during deployment. To bridge the mismatch between conventional NCA growth and gradual physical assembly, we additionally propose offline sparse-retention fine-tuning that simulates partial attachment, together with a false-positive loss that penalizes invalid site activations. Simulations demonstrate formation of diverse lattice morphologies, scaling to several hundred robots, and substantial improvements in morphology accuracy from the proposed fine-tuning. Experiments with Crazyflie quadrotors validate the integrated execution pipeline using robot-relative observations reconstructed from external tracking.
Index Terms:
Swarm Robotics, Multi-Robot Systems, Morphogenesis, Formation Control, Neural Networks.
I Introduction
Swarm morphogenesis aims to generate large-scale physical structures through local interactions among robots. Applications include coordinated aerial displays, distributed inspection, search, surveillance, and defence, where formations may need to scale or adapt across environments. Reliance on GPS, motion capture, or centralized estimation can limit applicability where signals or infrastructure are unavailable, including GNSS-denied environments; relative-sensing approaches instead use onboard vision [1], ranging and odometry [2], or distance-only measurements [3, 4]. Here, we consider local-relative sensing without globally referenced robot poses.
Distributed task-allocation methods assign tasks to robots [5], while assignment-based shape-formation methods allocate or dynamically select robot goals [6, 7]. Assignment-free methods guide robots to fill specified shapes without explicit robot-to-site assignments [8, 9]. These approaches differ in how robots occupy the shape, but both assume its geometry is supplied beforehand. We instead consider distributed attachment-site discovery.Essentially, we determine which physical attachment sites should exist as the morphology develops, so that a global structure can emerge from a local developmental rule trained offline, rather than a stored goal list. Existing assignment and control methods then coordinate robots to occupy these sites.
NCAs suit distributed attachment-site discovery because local computations generate global structure without a central coordinator. Each cell updates its state from neighbors, enabling pattern growth and regeneration [10], with extensions to graphs and higher-resolution generation [11, 12, 13]. We use these states to discover physical attachment sites, establishing a first step toward neural swarm morphogenesis.
The framework separates NCA attachment-site generation from assignment and control, allowing independent replacement. These methods can be replaced without altering NCA attachment-site generation. We use the artificial-light-field assignment and constrained controller of [7].
Standard Growing NCAs train on virtual grids without assembly constraints. During deployment, the NCA should instead evolve using local states of a gradually and asynchronously assembled formation. This mismatch can impair attachment-site predictions, motivating offline fine-tuning.
We propose an NCA-based framework for distributed swarm morphogenesis with three main contributions:
- Modular lattice-morphogenesis framework. We couple developmental attachment-site generation, distributed assignment, and collision-aware control.
- Distributed attachment-site discovery method. Robots in the formation exchange and update local NCA states to identify candidate attachment sites to occupy. This allows the formation to develop progressively without providing robots with a complete list of attachment sites.
- Offline fine-tuning adapts a pretrained NCA to physical assembly using simulated partial attachment. An additional false-positive loss penalizes activation outside the desired morphology.
The attachment-site discovery layer is modular with respect to assignment and control; the reported implementation uses the artificial-light-field assignment and constrained controller in [7].
II Background and Related Work
Three aspects frame swarm morphogenesis: a) spatial representation and localization, b) robot coordination and assembly, and c) local developmental mechanisms. They address how desired structures are represented and sensed, occupied by robots, and generated through local rules.
Formation-control methods vary in geometric representation and spatial-information requirements [14]. GPS or indoor positioning systems have been used in [15]; relative approaches use vision, ranging, odometry, or distance measurements [1, 2, 3, 4]. Shapes can be represented as continuous regions or density fields [16], or discrete lattices [17]. We adopt lattices for their well-defined attachment sites during progressive assembly.
Distributed task allocation provides coordination mechanisms [5]. Shape-formation methods use task swapping or dynamic assignment [6, 7], assignment-free strategies [8, 9], or learned decentralized control [18]. Progressive self-assembly methods incorporate robots incrementally into a developing formation [19, 20, 21]. Although these approaches differ in how robots join or occupy a shape, they rely on prescribed geometry or designed assembly rules rather than learned local attachment-site generation.
Graph Neural Networks (GNNs) enable learned decentralized interactions through neighborhood message passing [18]. Our NCA follows a similar principle but operates on a regular lattice rather than a general graph. Its shared symbolic frame preserves neighbor directions, allowing spatially ordered updates without permutation-invariant aggregation or explicit edge features. We therefore formulate progressive attachment-site generation using the simpler NCA setting, without requiring the general GNN framework.
Morphogenetic approaches generate structure through local rules, including gene-regulatory models [22] and reaction–diffusion dynamics demonstrated in robot swarms [23]. NCAs use learned local updates to generate and regenerate patterns [10], with extensions to graph-based interactions [11, 12]. NCAs have regenerated simulated soft robots [24] and classified shapes in physical modular robot systems [25]. To the best of our knowledge: i) NCAs have not been established for morphogenesis in swarms of independently mobile robots, and ii) no existing method uses learned NCAs for distributed attachment-site discovery in mobile robot swarms. Unlike methods requiring predefined geometry, our approach generates candidate sites incrementally during deployment. Consequently, these methods provide no directly comparable baseline for learned local attachment-site generation under incremental physical assembly.
t_{k}, Advertisers maintain local NCA state around their occupied symbolic cells, assemble a 5\times 5 neighborhood patch from observed attached neighbors, apply an NCA update, and advertise neighbouring unoccupied foreground cells as candidate attachment sites. Joiners can then occupy these advertised cells and become Advertisers, so the set of attached cells grows progressively toward the desired morphology.III Methodology
The methodology has two phases: offline training and deployment. During offline training, an NCA is trained for each desired morphology to reconstruct its reference image and then fine-tuned with sparse retention to account for gradual robot assembly. During deployment, NCA weights remain fixed while local cell states evolve. At each control step, each robot uses only current local observations and received broadcasts. An attachment cycle proceeds as follows. The seed robot occupies symbolic cell (0,0) and its local NCA predicts cell (1,0) as foreground. The seed advertises that cell and its predicted NCA state. A nearby Joiner receives the advertisement, maps (1,0) into its own body frame using the local lattice estimate, and selects it through distributed assignment. The controller moves the Joiner to the site; once attachment succeeds, it also becomes an Advertiser that can generate further candidate sites based on its own NCA state. The remainder formalizes estimation, discovery, assignment, and control for this cycle.
III-A Problem Setting
We consider N homogeneous holonomic robots progressively assembling a desired formation using only local sensing and communication. One robot is designated the initial seed and remains stationary throughout assembly.
We describe local interactions through two representative roles: an Advertiser is an attached robot that updates local NCA states and advertises candidate attachment sites, while a Joiner is unattached and discovers and approaches locally advertised sites. These roles are temporary: after attachment, a Joiner becomes an Advertiser.
We represent possible attachment positions on a symbolic square lattice. The seed is assigned lattice coordinate (0,0). Adjacent lattice positions correspond to prescribed physical robot spacing \ell_{space}. The desired morphology is a finite connected set of cells \mathcal{T}\subseteq\mathbb{Z}^{2} containing the seed, with at most one robot per cell and |\mathcal{T}|\leq N. This symbolic lattice specifies the robots’ relative arrangement. The complete desired morphology is available during offline training but not to robots during deployment. Each robot can measure its speed and sensed neighbors’ relative positions. Robots broadcast symbolic cells, NCA states, and advertised sites.
The NCA operates decentrally on Advertiser-maintained cell-state patches rather than a shared global formation representation. An Advertiser can announce only unoccupied cells adjacent to its occupied position. Joiners discover sites through nearby Advertisers, and attachment requires a site reachable by the controller.
III-B Local Lattice-Frame Estimation
An Advertiser specifies attachment sites on the symbolic lattice, whereas a Joiner observes positions in its body frame. Lattice frame estimation connects these descriptions by estimating a rigid transform between the Joiner’s body frame and symbolic coordinates using nearby attached Advertisers as references. Let \mathcal{A}_{i}(t)\subseteq\mathcal{N}_{i}(t) denote the neighboring Advertisers observed by robot i at time t. For each attached robot k\in\mathcal{A}_{i}(t), let p_{k}\in\mathbb{R}^{2} be its observed body-frame position and let c_{k}\in\mathbb{Z}^{2} be its symbolic lattice cell. For lattice spacing \ell_{\mathrm{space}}, the scaled coordinate is q_{k}=\ell_{\mathrm{space}}c_{k}.
Robot i estimates a rotation R_{i}\in SO(2) and translation t_{i}\in\mathbb{R}^{2} aligning scaled lattice coordinates with observed neighbour positions. This yields the rigid least-squares problem
(R_{i},t_{i})=\underset{{R\in SO(2),\,t\in\mathbb{R}^{2}}}{\operatorname{argmin}}\sum_{k\in\mathcal{A}_{i}(t)}\left\|p_{k}-(Rq_{k}+t)\right\|_{2}^{2}.This transform maps symbolic cell c into the observing robot’s body frame,
g_{i}(c)=R_{i}\!\left(\ell_{\mathrm{space}}c\right)+t_{i}.Initially, fewer than two attached robots may provide insufficient anchors to determine Eq. (1). The first robot that attaches to a seed-advertised neighboring cell therefore uses its local body-frame to define the initial lattice axis and join the seed, after which, the rigid transform can be estimated. This estimator maps symbolic to local coordinates for assignment and control, assuming sufficient sensing range to observe three adjacent robots.
III-C Distributed NCA Attachment-Site Discovery
We use a Growing Neural Cellular Automaton (NCA) as the learned developmental model [10]. Each symbolic lattice cell c has a state x(c)\in\mathbb{R}^{C} containing red, green, blue, and alpha (RGBA) channels and additional internal channels. RGB represents appearance, while alpha predicts whether the cell belongs to the morphology. The shared local update rule \mathcal{F}_{\theta} evolves these states using each cell’s 3\times 3 neighborhood; its architecture and offline training are described in Section III-E. Weights \theta remain fixed during deployment.
Each Advertiser maintains a persistent 5\times 5 NCA-state patch centered on its occupied cell c_{i}. Let X_{i}^{t} denote this patch at control step t and x(c)\in X_{i}^{t} be an NCA cell state in the patch. The patch provides 3\times 3 context to update the occupied center and adjacent candidate sites. Figure 1 illustrates this local discovery process.
At each control step, the Advertiser refreshes X_{i}^{t} with nearby occupied-cell states received from Advertisers broadcasting their symbolic coordinates and NCA states. It then performs an NCA update on the patch
{X}_{i}^{t+1}=\mathcal{F}_{\theta}({X}_{i}^{t}),It examines the four cardinally adjacent cells of c_{i}. It advertises a cell c only if the cell is locally known to be unoccupied and its updated alpha value x^{alpha}(c)>\theta_{\alpha}, where \theta_{\alpha} is the foreground threshold. Each advertisement contains the candidate’s symbolic coordinate and updated NCA state.
A Joiner j selects an advertised unoccupied cell c_{j} and approaches it. For duplicate advertisements, it averages alpha values to evaluate the site and deterministically selects one full NCA state to initialize X_{j}^{t} upon attachment. It becomes an Advertiser and advertises new candidate sites.
III-D Assignment and Control
Once candidate attachment sites are advertised, Joiners use the distributed artificial-light-field (ALF) assignment of Li et al. [7] to select candidates. The ALF assigns intensities from locally observed robot positions and favors lower-intensity candidates, corresponding to nearby cells with low robot density.
The constrained controller of [7] converts weighted goals into velocity commands, balancing goal tracking, collision avoidance, and velocity smoothing under speed and safety constraints. Both modules are replaceable components of the NCA attachment-site discovery framework.
III-E NCA Training and Fine-Tuning
We train the local operator \mathcal{F}_{\theta} offline on the complete desired morphology. A standard Growing NCA first learns to reconstruct the reference image; sparse-retention fine-tuning then adapts its weights to gradual assembly and irreversible simulated attachment. The learned weights remain fixed during deployment (Section III-C).
III-E1 Growing NCA Training
The operator \mathcal{F}_{\theta} follows Growing NCA [10]: at each step, a convolution extracts features from each cell’s 3\times 3 neighborhood, a shared network predicts a state change, and that change is added to the current state. A stochastic per-cell update mask emulates asynchronous updates during training. The same operator is used during deployment in Eq. (3). Starting from one living seed, training unrolls H sampled steps and optimizes weights by backpropagation through time. For reference RGBA image y of morphology \mathcal{T}, the final-state reconstruction loss is
\mathcal{L}_{\mathrm{RGBA}}=\operatorname{MSE}\left(x_{H}^{\mathrm{RGBA}},y\right).III-E2 Sparse-Retention Fine-Tuning
Ordinary NCA growth permits cells to activate temporarily or grow ahead of the structure. During physical assembly, however, only NCA states at occupied robot cells are used to predict adjacent attachment sites, where each Advertiser updates only a local patch around its occupied cell as robots gradually join. Applying this restriction to a standard NCA may therefore expose it to unfamiliar developmental dynamics, and may produce unsuitable predictions from such partial, irregular states. Sparse-retention fine-tuning exposes the model to this restricted regime so it can form the target progressively from the occupied frontier, improving deployment-time predictions.
Sparse-retention rollouts emulate gradual assembly: update virtual state, identify foreground cells adjacent to the occupied morphology, randomly retain some as newly attached, and prune unsupported state before continuing. Let x_{n} be the state at step n, and A_{n}\subseteq\mathbb{Z}^{2} the occupied lattice sites representing Advertisers. With \operatorname{Adj}(A_{n}) denoting cardinally adjacent cells, the unoccupied frontier and eligible candidates are
\displaystyle\mathcal{F}_{n} \\ \displaystyle=\operatorname{Adj}(A_{n})\setminus A_{n}, \\ \displaystyle\mathcal{C}_{n} \\ \displaystyle=\{c\in\mathcal{F}_{n}:x_{n}^{\mathrm{alpha}}(c)\geq\theta_{\alpha}\},where \theta_{\alpha} is the foreground retention threshold. To model slow, intermittent, and non-uniform arrivals, a subset of candidates is sampled from the retention distribution \Pi_{\mathrm{ret}}:
K_{n}\sim\Pi_{\mathrm{ret}}(\cdot\mid\mathcal{C}_{n}),\qquad A_{n+1}=A_{n}\cup K_{n},where K_{n}\subseteq\mathcal{C}_{n} contains the newly retained candidates.
To enforce the limited spatial extent of NCA state during physical assembly, virtual states outside occupied cells and their adjacent cells are removed after retention:
x_{n}(c)\leftarrow 0\quad\forall c\notin A_{n+1}\cup\operatorname{Adj}(A_{n+1}).This permits nearby predictions while pruning distant activity, exposing the NCA to partial, irregular assemblies. Sparse-retention rollouts are also mixed with ordinary NCA rollouts to preserve unconstrained developmental dynamics.
False positive
Because adjacency alone cannot exclude invalid sites, we additionally penalize foreground activation outside the desired morphology. Let T(c)\in\{0,1\} indicate membership in the desired morphology and \mathcal{M}=\{c:T(c)=0\} be background cells. Alpha above threshold \tau_{\mathrm{fp}} incurs
\mathcal{L}_{\mathrm{FP},n}=\left\langle\left[x^{\mathrm{alpha}}_{n}(c)-\tau_{\mathrm{fp}}\right]_{+}^{2}\right\rangle_{c\in\mathcal{M}},where \left\langle\cdot\right\rangle_{\mathcal{M}} is the average over \mathcal{M}. Combining this penalty across the rollout with final RGBA reconstruction gives
\mathcal{L}_{\mathrm{SR}}=\frac{\lambda_{\mathrm{FP}}}{H}\sum_{n=1}^{H}\mathcal{L}_{\mathrm{FP},n}+\lambda_{\mathrm{RGBA}}\mathcal{L}_{\mathrm{RGBA}}.Thus fine-tuning encourages local physical growth while suppressing false-positive sites.
IV Results
For each desired morphology, we train a dedicated NCA offline. We then conduct two simulation studies: (i) formation progression and scaling, to evaluate the framework’s ability to assemble different morphologies and accommodate increasing swarm sizes; and (ii) a fine-tuning ablation, to assess the effects of sparse retention and false-positive loss on deployment accuracy. We also perform physical quadrotor experiments are presented in Section IV-B.
For offline training, a Growing NCA first learns to reconstruct a reference image and is subsequently fine-tuned using sparse retention. For an N robot experiment, the reference image is scaled so that its foreground-cell count is closest to N. For fine-tuning, the retention distribution \Pi_{ret} selects no candidate sites with probability 0.15, all with probability 0.10, and otherwise retains candidates independently with probability \rho_{n}\sim\mathcal{U}(0.1,0.6).
For all simulations, NCA weights remain fixed and robot-local updates are asynchronous. Initial robot positions are sampled uniformly in the arena. Results are computed over 30 random seeds. Experimental parameters are reported in Table I.
- State channels C
- 16
- Foreground threshold \theta_{\alpha}
- 0.5
- Training Rollout horizon H
- [64,96) steps
- False-activation threshold \tau_{\mathrm{fp}}
- 0.2
- Loss weights (\lambda_{\mathrm{FP}},\lambda_{\mathrm{RGBA}})
- (2.0,4.0)
- Lattice spacing \ell_{\mathrm{space}}
- 0.5
We measure morphology accuracy by the F1 score (Dice overlap) between the expected and occupied cells. Let \mathcal{T} denote the foreground cells of the desired morphology and \mathcal{A}(t) the cells occupied by robots at time t:
F_{1}(t)=\frac{2|\mathcal{A}(t)\cap\mathcal{T}|}{|\mathcal{A}(t)|+|\mathcal{T}|}.F1 equals 1 when the occupied cells exactly match the desired morphology, and decreases when cells are missing or incorrectly occupied.
For an episode ending at time T, saturation time is the earliest time from which the F_{1} score remains close to the final value:
\displaystyle t_{\mathrm{sat}}=\min_{t\in[0,T]:}\big\{|F_{1}(\tau)-F_{1}(T)|\leq\varepsilon_{\mathrm{sat}}~;~\forall\tau\in[t,T]\big\}.with \epsilon_{sat} such that the F1 score at t_{\mathrm{sat}} is within 5\% of its terminal value.
IV-A Simulation Results
250 robots at 0\%, 30\%, 60\%, and 100\% progression, with reference images and corresponding F1 accuracy trajectories over time. Right: saturation time and final F1 versus robot count for Tree morphology; shaded regions denote one standard deviation.Formation and Scaling
We evaluate four morphologies (Lizard, Tree, Pretzel, and Hand-heart) using 250 robots, and vary the robot count for Tree. Figure 2 contains representative formation rollouts and scaling results. Dark colored robots denote Advertisers, while light colored robots denote Joiners. Formations are rotated and scaled for visualization.
The rollouts show that the local developmental mechanisms can form branched, compact, and holed lattice morphologies without a deployment-time goal list. Morphologies that expand broadly in multiple directions, such as Tree, form faster, whereas those with narrow paths or constrained branches, such as Lizard and Hand-heart, require longer formation times. Nonetheless, these runs converge towards F1 values close to 1, confirming that the assembled formations increasingly match their desired morphologies. In the scaling study, t_{\mathrm{sat}} grows approximately linearly with robot count, while the final F1 score only decreases slowly, indicating that morphologies remain stable across scale. The shaded regions show one standard deviation.
Ablation Study
To evaluate the proposed developmental attachment-site generation mechanism independently of the assignment and control components, we use standard Growing NCA as the baseline and progressively introduce the proposed sparse-retention and false-positive suppression mechanisms. Table II reports the deployment F1 score at t_{sat} for these configurations on the Tree morphology with 250 robots.
Sparse-retention increases the final F1 score relative to standard Growing NCA, demonstrating the benefit of training on partial assembly states. Adding the false-positive loss further improves mean F1 and significantly reduces variation across runs. The ablation thereby provides direct empirical justification for the proposed fine-tuning procedure, that significantly increases both performance and consistency.
- Standard Growing NCA
- 0.583
- 0.107
- + Sparse-retention fine-tuning
- 0.764
- 0.141
- + False-positive loss
- \mathbf{0.988}
- \mathbf{0.004}
IV-B Hardware Validation
For hardware validation, we use eight Crazyflie quadrotors to assemble two desired lattice morphologies, E and 4. Since the platform lacks the required relative-position sensing, Lighthouse tracking and centralized computation are used as an experimental interface to provide robot positions and reconstruct local-frame observations. These local observations are consumed by the proposed framework and return body-frame velocity commands. This setup preserves the algorithm’s local information structure despite the platform’s sensing limitations.
Figure 3 shows overhead snapshots and corresponding lattice-state visualizations during the formation of E and 4. The sequences illustrate progressive attachment-site discovery and robot recruitment, resulting in the desired formations. These experiments demonstrate the execution of the proposed pipeline on physical robots despite localization noise, actuation error, and asynchronous motion
V Conclusion
We presented a modular NCA-based framework for distributed swarm morphogenesis, integrating learned attachment-site discovery with existing assignment and collision-aware control. Robots progressively assemble desired formations without a predefined list of attachment sites during deployment. The ablation demonstrates that fine-tuning substantially improves morphology accuracy over standard Growing NCA, while the additional false-positive loss achieves high accuracy with consistent results. Simulations demonstrate diverse morphologies and scalability to large swarms, while Crazyflie experiments validate the integrated pipeline on physical robots.