Emergence of Shape Bias in Convolutional Neural Networks through Activation Sparsity

Tianqin Li, Ziqi Wen, Yangfan Li, Tai Sing Lee

Introduction

Standard deep learning models are notorious "texture hounds." If you show a Convolutional Neural Network (CNN) a picture of an elephant covered in a cat’s fur pattern, the model will likely classify it as a cat. In contrast, human visual systems possess a strong shape bias; we recognize the elephant by its structure regardless of its "skin."

This discrepancy is a major hurdle for model robustness. Texture bias leads to misclassifications when lighting, style, or patterns change. While previous research has attempted to fix this using massive data augmentation (like training on "stylized" versions of every image), this paper asks a more fundamental question: Can we change the architecture of the network to favor shape, inspired by the sparse coding principles of the human primary visual cortex (V1)?

By introducing a simple "Top-K" sparsity constraint—mimicking how the human brain only fires a few "specialist" neurons at a time—researchers have found a way to shift CNNs from being obsessed with texture to focusing on shape. This architectural tweak not only makes models more robust to visual distractions but also allows generative models to synthesize more coherent, part-based objects.

Methods: The Spatial Top-K Layer

To introduce sparsity, the authors propose a Spatial Top-K Layer. The mechanism is deceptively simple:

  1. Selection: For a given feature map (internal representation), the layer identifies the "K" strongest absolute neuronal responses across all spatial locations in each channel.
  2. Sparsification: It keeps these Top-K responses and zeros out everything else.
  3. Inference and Training: This operation can be applied to pre-trained models during inference or integrated directly into the training loop.

To understand why this works, the researchers used Texture Synthesis and Image Reconstruction techniques. By isolating the Top-K activations versus the discarded "weak" activations, they could visualize exactly what information each group carries. They also tested a "Mean Replacement" variant, where Top-K values were replaced by their average to see if the position of the activation was more important than its precise value.

Key Insights: Sparsity Equals Structure

  • Sparsity Encodes Structure: The most significant finding is that "strong" neuronal responses (Top-K) naturally encode structural parts and subparts (like a wheel or a leg), while the "weak" distributed responses carry the texture and color information.
  • Position over Precision: Through their "Mean Replacement" experiments, the authors discovered that the spatial map (the occupancy map of where neurons fire) is more critical for shape recognition than the precise numerical values of those activations.
  • Emergent Decomposition: Even though the Top-K operation is non-differentiable, training with it forces the network to "relocate" its activation mass. Over time, neurons naturally group together to represent connected, meaningful object parts.
Texture synthesis visualization showing that non-Top-K activations carry texture while Top-K activations carry structure.

Key Results

The study evaluated this approach across several benchmarks, including ImageNet-1k, the Cue-Conflict Benchmark, Stylized-ImageNet, and Few-shot Synthesis Datasets.

  • Human-like Bias: In the cue-conflict benchmark, sparse CNNs pushed the "frontier" of shape bias significantly toward human levels. Remarkably, simply "silencing" the weak activations in a standard pre-trained VGG16 or AlexNet during inference immediately increases its shape bias, bringing it closer to human-level performance without any additional training.
  • Recognition Robustness: On the Stylized-ImageNet test, a ResNet-18 trained with Top-K sparsity improved Top-1 accuracy from 49.3% to 55.4% (on subset IN-S1) and 52.4% to 59.7% (on subset IN-S2) compared to the baseline.
  • Generative Coherence: In few-shot image synthesis (FastGAN), adding Top-K sparsity led to a 21.1% improvement in FID scores for the Jeep category. The synthesized images showed much clearer global structures rather than just "texture blobs."
Scatter plot demonstrating that CNNs with Top-K sparsity shift significantly closer to human-level shape bias compared to baseline models.

Limitations and Future Work

The primary limitation of this approach is the sensitivity of the Top-K Hyperparameter. The optimal value of $K$ (the degree of sparsity) depends on the specific layer, the complexity of the scene, and the size of the object parts being learned. Choosing the wrong $K$ can lead to "over-sparsification," where essential structural details are lost.

Future work suggests exploring dynamic spatial Top-K selection—where the network learns to adjust its own sparsity level—and applying these constraints to broader architectures like the Vision Transformer (ViT) family to see if the benefits of biological sparsity are universal across all deep learning paradigms.

Summary updated

BibTeX
@inproceedings{li2023emergence,
  author = {Tianqin Li and Ziqi Wen and Yangfan Li and Tai Sing Lee},
  title = {{Emergence of Shape Bias in Convolutional Neural Networks through Activation Sparsity}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=QzcZb3fWmW},
}
Figure