Abstract
Deep neural networks have provided a computational framework for understanding object recognition, grounded in the neurophysiology of the primate ventral stream, but fail to account for how we process relational aspects of a scene. For example, deep neural networks fail at problems that involve enumerating the number of elements in an array, a problem that in humans relies on parietal cortex. Here, we build a 'dual-stream' neural network model which, equipped with both dorsal and ventral streams, can generalise its counting ability to wholly novel items ('zero-shot' counting). In doing so, it forms spatial response fields and lognormal number codes that resemble those observed in macaque posterior parietal cortex. We use the dual-stream network to make successful predictions about behavioural studies of the human gaze during similar counting tasks.
Introduction: The Gap Between Recognition and Numerosity
Modern deep neural networks (DNNs) excel at identifying objects within complex images. However, their ability to understand the relational structure of a scene—such as the number of objects present—remains limited. While a Convolutional Neural Network (CNN) can reliably detect a "cat," it often struggles to count multiple cats, particularly when those objects differ in appearance from the training data.
In the primate brain, this functional divide is handled by two distinct pathways: the ventral stream (the "what" pathway) for object identity and the dorsal stream (the "where" pathway) for spatial reasoning and numerosity. Standard AI architectures typically attempt to process both identity and quantity within a single stream, leading to poor generalization.
Architecture: The Dual-Stream Recurrent Neural Network
To address this, we propose a biologically inspired dual-stream recurrent neural network (RNN). The model's design incorporates several key neurophysiological principles:
- Sequential Glimpsing: Rather than processing the entire scene in a single pass, the model employs a sequence of 12 "glimpses," mimicking human saccadic eye movements.
- Foveated Vision: Each glimpse undergoes a log-polar transform, providing high resolution at the center of the gaze and blurring the periphery, consistent with primate retinal architecture.
- Functional Factorization:
- Ventral Module: A CNN processes the visual content of each glimpse.
- Dorsal Module: Receives the $(x, y)$ coordinates of the current glimpse.
- Integration in the "PPC": An RNN serves as a proxy for the posterior parietal cortex (PPC), integrating "what" and "where" signals over time to maintain an internal spatial map of targets.
Experimental Results and Zero-Shot Generalization
The model was trained on synthetic grayscale images containing 1–5 target items (letters {B, C, D, E}). To evaluate "zero-shot" counting—the ability to count novel items—we tested the model on Out-of-Distribution (OOD) sets featuring novel shapes ({F, G, H, J}) and luminance levels.
The results demonstrate that factorization is critical for robust numerosity. While a standard CNN's accuracy plummeted to approximately 25% when faced with novel shapes and distractors, the dual-stream RNN maintained a high accuracy of ~95%. By separating identity from location, the model learns that counting is a spatial process independent of object appearance.
Biological Mimicry and Human Behavior
A striking emergent property of the dual-stream RNN is its spontaneous development of neural signatures found in the primate brain. Without explicit programming, the internal units developed "log-normal" tuning curves—where numerical representations become less precise as the count increases—and spatial response fields matching recordings from macaque PPC.
Furthermore, the model successfully predicted human behavioral patterns. In eye-tracking experiments with 24 participants, we found that preventing eye movements (fixed gaze) significantly impaired the ability to count amidst distractors. The dual-stream model accurately replicated this impairment, suggesting that numerosity is an active, enactive process tied to spatial attention.
Conclusion and Future Directions
The dual-stream architecture provides a powerful framework for understanding how the brain separates "what" from "where" to achieve flexible cognition. While currently limited to small numbers (1–5) and 2D stimuli, this approach suggests that moving away from monolithic processing streams is essential for building AI that truly understands the structure of the world. Future work will explore scaling these principles to complex 3D naturalistic scenes and investigating the role of covert attention.
Summary updated