2D Spatial Reasoning with Adaptive Neural Cellular Automata
Organizations: Institute for Machine Learning and Analytics (IMLA), Offenburg University, Germany · University of Mannheim, Germany
Abstract
Many modern learning approaches are still struggling with spatial reasoning tasks, i.e. they lack the ability to utilize geometric information of perceived entities and their spatial relation to each other to solve problems. We introduce a novel Adaptive Neural Cellular Automata (aNCA) architecture which uses deformable convolutions to dynamically adapt the perceptive field and iteratively reason over 2D spatial relations on grid-like data structures (e.g. images). Empirical results on public benchmarks show state of the art comprehensible results with high generalization abilities for solving image based puzzles like Sudoku or finding the shortest path in a maze.
Figures & tables
| Perception | Easy [1, 27] | Medium [28, 54] | Hard [55, 81] | Param. | |||
|---|---|---|---|---|---|---|---|
| ASR | ACP | ASR | ACP | ASR | ACP | ||
| NCA w. 3x3 Conv. | 100 0 | 100 0 | 86.35 1.00 | 98.85 0.13 | 78.23 1.84 | 98.63 0.10 | 50k |
| NCA w. 5x5 Conv. | 100 0 | 100 0 | 87.47 1.65 | 98.93 0.12 | 75.03 8.38 | 96.27 4.05 | 105k |
| NCA w. 7x7 Conv. | 100 0 | 100 0 | 82.70 1.62 | 98.43 0.21 | 76.95 2.07 | 98.43 0.15 | 189k |
| NCA w. 9x9 Conv. | 100 0 | 100 0 | 71.58 18.82 | 95.88 4.41 | 39.80 37.15 | 84.95 19.71 | 300k |
| NCA w. R/C/B Conv. | 100 0 | 100 0 | 87.38 2.64 | 98.90 0.22 | 78.18 2.81 | 98.58 0.19 | 145k |
| Method | Easy | Medium | Hard | |
|---|---|---|---|---|
| [1, 27] | [28, 54] | [55, 81] | Param. | |
| Diffusion Model | 99.4 | 53.6 | 0.8 | 118M |
| SRM | 99.8 | 75.4 | 51.6 | 118M |
| Codec + NCA | ||||
| NCA 3x3 Conv. | 99.40 0.14 | 80.90 0.90 | 71.98 1.61 | 1.1M + 50k |
| NCA 5x5 Conv. | 99.13 0.50 | 79.97 1.70 | 69.00 6.63 | 1.1M + 105k |
| Method | Source | Valid Path | Valid Optimal | Param. |
|---|---|---|---|---|
| HRM | [ 6 ] | – ⋆ | 74.5% | 27M |
| ItrSA++ | [ 21 ] | – ⋆ | 78.6% | 3M |
| TRM-Att | [ 22 ] | – ⋆ | 85.3% | 7M |
| NCA w. 3x3 Conv. | Ours | 2.54 0.84 | 0.08 0.08 | 50k |
| NCA w. 5x5 Conv. | Ours | 24.78 1.68 | 10.78 1.21 | 105k |
| NCA w. Dilated Conv. | Ours | 74.26 1.07 | 64.30 1.32 | 150k |
| Perception | Source | Imbalance | Accuracy | Param. |
|---|---|---|---|---|
| Diffusion | [ 7 ] | 1.27 | 25.0% | 19.7M |
| SRM | [ 7 ] | 0.53 | 51.8% | 19.7M |
| NCA w. 3x3 Conv. | Ours | 1.13 0.17 | 26.0% 5% | 48k |
| NCA w. 5x5 Conv. | Ours | 0.07 0.06 | 95.3% 2% | 100k |
| NCA w. DCNv1 | Ours | 1.61 0.59 | 18.7% 11% | 147k |
| aNCA | Ours | 0.1 0.08 | 96.8% 3% | 152k |
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
| Category | Hyperparameter | Value |
| NCA state | Cell channels | 24 |
| Positional embeddings | yes | |
| Update network | Architecture | MLP ( Conv), 1 hidden layer, 128 channels |
| Optimization | Optimizer | AdamW |
| Learning rate | ||
| LR schedule | WSD (warmup–stable–decay) |
| Variant | Params | Train VRAM (MB) | Infer VRAM (MB) | Infer ms / puzzle |
|---|---|---|---|---|
| NCA w. 3x3 Conv. | 50k | 303.1 | 0.5 | 159.64 |
| NCA w. 5x5 Conv. | 105k | 311.9 | 0.9 | 166.38 |
| NCA w. R/C/B Conv. | 145k | 610.3 | 1.0 | 251.04 |
| NCA w. Dilated Perc. | 150k | 480.8 | 1.2 | 238.28 |
| aNCA | 165k | 1139.6 | 17.7 | 832.75 |
| Head | Row% | Col% | Box% | Union% | Enrichment |
|---|---|---|---|---|---|
| Head 1 | 20.7 | 32.6 | 47.5 | 81.0 | 3.13 |
| Head 2 | 61.1 | 59.6 | 69.6 | 86.9 | 3.35 |
| Head 3 | 53.0 | 45.8 | 54.3 | 83.5 | 3.22 |
| Random baseline | – | – | – | 25.9 | 1.00 |
| Category | Hyperparameter | Value |
| Encoder | Base channels | 32 |
| Hidden dim | 128 | |
| Decoder | Base channels | 64 |
| Hidden dim | 128 | |
| Style latent dim | 8 | |
| Optimization | Optimizer | AdamW |
| Method | Source | Easy [1, 27] | Medium [28, 54] | Hard [55, 81] | Param. | |||
| ASR | ACP | ASR | ACP | ASR | ACP | |||
| Related Work | ||||||||
| Diffusion Model | [ 7 ] | 99.4% | – ⋆ | 53.6% | – ⋆ | 0.8% | – ⋆ | 118M |
| SRM | [ 7 ] | 99.8% | – ⋆ | 75.4% | – ⋆ | 51.6% | – ⋆ | 118M |
| NCAs | ||||||||
| NCA w. 3x3 Conv. | Ours | 99.40 0.14 | 99.90 0.00 | 80.90 0.90 | 98.33 0.10 | 71.98 1.61 | 98.20 0.08 | 1.1M + 50k |
| Category | Hyperparameter | Value |
| NCA state | Cell channels | 24 |
| Positional embeddings | no | |
| Fire rate | 0.5 | |
| Update network | Architecture | MLP ( Conv), 1 hidden layer, 128 channels |
| Optimization | Optimizer | AdamW |
| Learning rate |
| Test Maze Size | Generator | Valid Path | Valid Optimal |
|---|---|---|---|
| Sapient | 98.56% | 94.18% | |
| Prim | 100% | 100% | |
| Prim | 100% | 99.4% |
| Category | Hyperparameter | Value |
| NCA state | Cell channels | 24 |
| Positional embeddings | no | |
| Fire rate | 0.5 | |
| Update network | Architecture | MLP ( Conv), 1 hidden layer, 128 channels |
| Optimization | Optimizer | AdamW |
| Learning rate |