Subitizing with Variational Autoencoders

Rijnder Wever, Tom F. H. RuniaWorkshops @ ECCV 2018

Introduction

Human cognition possesses a remarkable ability known as subitizing: the near-instantaneous perception of the number of items in a small set (typically one to four) without the need for explicit counting. While deep learning has made significant strides in object counting, most models rely on extensive supervised datasets where every object is meticulously labeled. This research investigates whether a deep hierarchical network can spontaneously develop a "visual number sense" through unsupervised learning on complex, cluttered natural scenes, mirroring how biological systems acquire this ability.

Subitizing allows for the immediate perception of 'threeness' in a scene with three salient objects.

Methodology

The researchers utilized a Variational Autoencoder (VAE), a generative model designed to compress images into a low-dimensional latent space and subsequently reconstruct them. A significant challenge with standard VAEs is the production of blurry reconstructions due to the use of Mean Squared Error (MSE) as a pixel-to-pixel distance metric. Blurriness obscures the distinct boundaries necessary for subitizing. To overcome this, the authors implemented a Feature Perceptual Loss. By comparing high-level features extracted by a pre-trained VGG-19 network rather than raw pixels, the model was forced to preserve sharp contours and the saliency of individual objects.

To determine if numerosity was encoded within the learned representations, the authors froze the VAE and trained a simple linear probe (a softmax classifier) on the latent space to predict object counts.

Datasets

The study employed two primary datasets:

  1. Salient Object Subitizing (SOS) Dataset: This dataset comprises 14,000 natural images from MS-COCO, ImageNet, and SUN, categorized by the number of salient objects (0, 1, 2, 3, or 4+).
  2. Synthetic Data: To mitigate class imbalances and provide a training baseline, 80,000 synthetic images were generated by overlaying objects from the THUS10000 dataset onto diverse backgrounds.
The SOS dataset includes natural images representing various counts of salient objects, from zero to four or more.

Key Insights and Results

The experiments yielded several critical findings:

  • Emergent Numerosity: Numerosity emerged as a statistical property of the data. Without explicit instruction to count, the model identified the number of objects as a vital feature for accurate image reconstruction.
  • Biological Alignment: The VAE developed "number neurons" similar to those found in the human parietal cortex. Specific latent dimensions (e.g., $z_{77}$) were found to correlate strongly with object count while remaining invariant to object size.
  • Performance: The unsupervised VAE achieved a 44.4% mean average precision on the SOS dataset. While this significantly exceeds chance (22.8%) and matches handcrafted feature methods, it remains below the performance of fully supervised CNNs (78.6%).

Conclusion and Future Work

This work demonstrates that a rudimentary number sense can emerge in deep networks without supervision, provided the model is encouraged to preserve object saliency. However, the latent representations remain somewhat "entangled," with single dimensions often encoding multiple features like color and number. Future research may involve using advanced disentanglement techniques, such as $\beta$-VAEs, to further isolate numerosity and extending these unsupervised methods to larger-scale estimation beyond the subitizing range.

Summary updated

BibTeX
@inproceedings{wever2018subitizing,
  author = {Rijnder Wever and Tom F. H. Runia},
  title = {{Subitizing with Variational Autoencoders}},
  booktitle = {Workshops @ ECCV},
  year = {2018},
  doi = {10.1007/978-3-030-11015-4\_47},
}
Figure