On the relationship between class selectivity, dimensionality, and robustness

Matthew L. Leavitt, Ari S. MorcosarXiv 2020

Abstract

While the relative trade-offs between sparse and distributed representations in deep neural networks (DNNs) are well-studied, less is known about how these trade-offs apply to representations of semantically-meaningful information. Class selectivity, the variability of a unit's responses across data classes or dimensions, is one way of quantifying the sparsity of semantic representations. Given recent evidence showing that class selectivity can impair generalization, we sought to investigate whether it also confers robustness (or vulnerability) to perturbations of input data. We found that mean class selectivity predicts vulnerability to naturalistic corruptions; networks regularized to have lower levels of class selectivity are more robust to corruption, while networks with higher class selectivity are more vulnerable to corruption, as measured using Tiny ImageNetC and CIFAR10C. In contrast, we found that class selectivity increases robustness to multiple types of gradient-based adversarial attacks. To examine this difference, we studied the dimensionality of the change in the representation due to perturbation, finding that decreasing class selectivity increases the dimensionality of this change for both corruption types, but with a notably larger increase for adversarial attacks. These results demonstrate the causal relationship between selectivity and robustness and provide new insights into the mechanisms of this relationship.

Introduction

Deep Neural Networks (DNNs) are notoriously brittle. A bit of rain on a camera lens (natural corruption) or a few carefully calculated pixel tweaks (adversarial attack) can cause a state-of-the-art model to fail. Researchers have discovered a fundamental trade-off in how neural networks represent information: making neurons less specialized (more "distributed") makes a network resilient to random noise and natural corruptions, but simultaneously leaves it more vulnerable to targeted adversarial attacks. This suggests that "robustness" isn't a single trait, and optimizing for one type of reliability might actively undermine another.

Methods

The authors, Matthew Leavitt and Ari Morcos, actively manipulated networks using a class selectivity regularizer—a specific term added to the loss function during training—to either force neurons to be highly specialized or force them to share the workload (distributed representation).

To measure the impact, they looked at three key metrics:

  1. Class Selectivity Index: A score from 0 to 1 measuring how much a neuron's response varies across different classes.
  2. Input-Output Jacobian: A mathematical way to measure "stability." If a small change in input leads to a massive change in output, the Jacobian is large, indicating instability.
  3. Dimensionality (via PCA): They used Principal Component Analysis to see how many "dimensions" of activity the network was actually using to represent data and how those dimensions shifted when the input was corrupted.

The study utilized standard computer vision benchmarks: CIFAR10 and Tiny ImageNet, along with their corrupted counterparts (CIFAR10C, Tiny ImageNetC) and adversarial variants generated via FGSM and PGD.

Results

Corruption Robustness and the "Dilution" Effect

When representations are distributed (low selectivity), the "damage" caused by random noise is spread across many neurons. This effectively dilutes the error, allowing the network to maintain higher accuracy despite the noise. Reducing class selectivity improved mean test accuracy on corrupted images by as much as 4% on Tiny ImageNetC.

Impact of class selectivity on corruption robustness across different regularization scales.

Adversarial Vulnerability and the "Stability" Paradox

Conversely, sparse, highly selective networks are more robust to adversarial attacks. The authors found that selective networks have smaller input-output Jacobians, meaning they are fundamentally more stable. Reducing selectivity consistently increased vulnerability to both FGSM and PGD attacks across all tested models.

Test accuracy under adversarial attack as a function of perturbation intensity for different regularization scales.

Dimensionality as a Vulnerability

Distributed representations occupy a higher-dimensional space in the network's early layers. While this helps with general noise, it provides more "directions" for an adversarial attack to push the representation off-course. The dimensionality of the change caused by perturbations was significantly higher in the early layers of low-selectivity networks, especially under adversarial attack.

Conclusion

These findings highlight a "zero-sum" game regarding selectivity. Robustness is not a monolithic property; there is a causal trade-off where tuning a network to be "average-case" robust (corruptions) or "worst-case" robust (adversarial) involves adjusting selectivity in opposite directions. Future work might investigate whether other forms of regularization could break this trade-off, or how these representations evolve in deeper layers of larger models like Transformers.

Summary updated

BibTeX
@misc{leavitt2020relationship,
  author = {Matthew L. Leavitt and Ari S. Morcos},
  title = {{On the relationship between class selectivity, dimensionality, and robustness}},
  year = {2020},
  eprint = {2007.04440},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2007.04440},
}
Figure