Abstract
Recognizing precise geometrical configurations of groups of objects is a key capability of human spatial cognition, yet little studied in the deep learning literature so far. In particular, a fundamental problem is how a machine can learn and compare classes of geometric spatial configurations that are invariant to the point of view of an external observer. In this paper we make two key contributions. First, we propose SpatialSim (Spatial Similarity), a novel geometrical reasoning benchmark, and argue that progress on this benchmark would pave the way towards a general solution to address this challenge in the real world. This benchmark is composed of two tasks: Identification and Comparison, each one instantiated in increasing levels of difficulty. Secondly, we study how relational inductive biases exhibited by fully-connected message-passing Graph Neural Networks (MPGNNs) are useful to solve those tasks, and show their advantages over less relational baselines such as Deep Sets and unstructured models such as Multi-Layer Perceptrons. Finally, we highlight the current limits of GNNs in these tasks.
Introduction
Humans possess a remarkable ability for allocentric spatial representation, allowing us to recognize configurations of objects—such as facial features or room layouts—regardless of our viewpoint, distance, or orientation. In contrast, standard deep learning models often treat data as unstructured vectors or pixel grids, requiring them to learn relational concepts from scratch. While existing benchmarks like CLEVR test coarse linguistic relations, they lack the precision needed for geometric similarity. This work introduces the SpatialSim benchmark to evaluate whether machines can achieve viewpoint-invariant recognition of spatial configurations.
The SpatialSim Benchmark
The SpatialSim benchmark is designed to test geometric reasoning through two primary tasks:
- Identification: Given a reference arrangement, the model must identify matching configurations that have undergone translation, rotation, or scaling.
- Comparison: A more challenging task where the model compares two novel configurations to determine if they are geometrically identical.
The dataset utilizes 2D objects (squares, circles, triangles) represented by 10-dimensional feature vectors. To facilitate learning rotation invariance, a curriculum learning strategy was employed, gradually increasing the rotation range during training.
Methods and Architectures
We evaluate architectures with varying relational inductive biases:
- Message-Passing Graph Neural Networks (MPGNN): A fully connected graph where every object interacts with every other object, explicitly computing pairwise relationships.
- Recurrent Deep Set (RDS): A "star-shaped" communication model where objects contribute to a global summary vector.
- Deep Sets: A model where objects are processed independently before aggregation.
- MLP Baseline: A standard unstructured Multi-Layer Perceptron.
Key Insights: The Role of Relationality
Our analysis reveals that relational computation is essential for viewpoint invariance. Unstructured models (MLPs) and independent models (Deep Sets) fail as object counts increase. While RDS performs well in sparse scenes, it struggles in crowded environments where global summaries lose fine-grained inter-object geometry.
Visualization through heatmaps shows that RDS models often rely on simple radial symmetry. In contrast, MPGNNs learn more sophisticated symmetries based on the principal axes of the object distribution, though they still face challenges with highly complex configurations.
Experimental Results
- Identification Task: MPGNNs achieved near-perfect performance (~98% accuracy) across all object counts (3 to 30). RDS accuracy declined from 91% to 78% as object density increased.
- Comparison Task: This task proved significantly more difficult. MPGNN accuracy dropped from 89% (small sets) to 71% (large sets), while RDS performance fell to near-chance levels (52%).
- Generalization: Models trained on small object sets (3-8) did not generalize well to larger scenes, indicating that learned geometric functions do not automatically scale to higher complexity.
Limitations and Future Directions
Current GNN architectures face several hurdles:
- Scalability: Fully connected MPGNNs have $O(n^2)$ complexity, limiting their use in dense scenes.
- Robustness: The addition of "distractor" objects significantly degrades performance, suggesting a need for better attention mechanisms.
- Universal Similarity: The performance gap in the Comparison task suggests that current models lack the robust inductive biases required for human-like geometric understanding.
By releasing the SpatialSim benchmark, we aim to provide a foundation for developing models that truly grasp the fundamental principles of spatial geometry.
Summary updated