A Brain-Inspired Regularizer for Adversarial Robustness

Elie Attias, Cengiz Pehlevan, Dina Obeid · DOI

Introduction

Convolutional Neural Networks (CNNs) have achieved remarkable success in computer vision but remain notoriously "brittle." Small, imperceptible adversarial perturbations can lead to confident misclassifications, a vulnerability that poses significant risks for real-world deployment. Recent research has suggested that biological visual systems possess an inherent robustness that artificial models lack. Specifically, training CNNs to mimic the internal representational similarity patterns of the mouse primary visual cortex (V1) has been shown to enhance adversarial robustness. However, the reliance on expensive and non-scalable neural recordings presents a significant barrier to widespread adoption. This work investigates whether the benefits of neural regularization can be achieved using only image-derived metrics, effectively bypassing the need for biological data.

Methodology

The authors propose a "neural regularizer" that replaces biological data with a data-driven alternative. The core mechanism is a similarity loss term added to the standard classification objective. This term encourages the network to ensure that if two images are "similar" in the input space, their internal representations in the network should also be similar.

A key discovery driving this approach is the high correlation between neural representational similarity and simple pixel-level metrics. As shown in Figure 2, similarity matrices derived from mouse V1 recordings correlate strongly (Pearson’s $r = 0.83$) with pixel-level cosine similarity. This suggests that the complex V1-based regularizers used in previous work were likely just a high-quality way of enforcing basic pixel-level consistency.

Correlation between predictive neural models and pixel similarity.

Building on this, the authors introduced Thresholded Pixel Similarity ($S^{Th}$). Instead of using raw pixel similarity, they introduced a thresholding function. If two images are very similar (above a threshold $Th$), the target similarity is set to 1 (aligned). If they are very different (below $-Th$), it is set to -1. If they are intermediate, the target is 0 (orthogonal). This thresholding is crucial; by forcing representations of "somewhat similar" images to be orthogonal, the network learns to better separate different inputs, preventing small perturbations from "bleeding" across representation boundaries.

Results and Discussion

The effectiveness of the $S^{Th}$ regularizer was evaluated against various adversarial attacks and common image corruptions across several standard benchmarks, including CIFAR-10, CIFAR-100, and MNIST. On the CIFAR-10 dataset, models regularized with $S^{Th}$ demonstrated robustness comparable to those trained with actual neural data.

Accuracy of ResNet18 on CIFAR-10 under transfer FGSM attacks for different regularization strategies.

As illustrated in Figure 5, the $S^{Th}$ regularizer (red) significantly outperforms the unregularized baseline (black) and even the raw pixel similarity regularizer (blue) as the strength of the adversarial attack increases. It performs nearly identically to the regularizer based on predictive neural models ($S^{neural-pred}$, green), validating the hypothesis that biological data is not strictly necessary to achieve these robustness gains.

Beyond adversarial attacks, the method improved performance on the CIFAR-10-C benchmark, which includes 15 types of common image corruptions like blur and noise. Analysis of the Fourier spectra of adversarial perturbations revealed that the regularizer primarily protects against high-frequency noise, suggesting that "brain-like" representations encourage the model to ignore fine-grained jitter and focus on stable, low-frequency structures.

Conclusion

This research demonstrates that the robustness benefits of brain-inspired regularization can be distilled into a simple, pixel-based similarity metric. By enforcing thresholded similarity in internal representations, CNNs become more resistant to both adversarial perturbations and common corruptions. While not a "silver bullet"—the method was less effective against specific black-box query attacks like SimBA—it provides a scalable, computationally efficient "drop-in" regularizer that offers a significant robustness boost for very little cost. Future work may explore more complex, non-linear similarity metrics to further close the gap between AI and human-level visual robustness.

Summary updated

BibTeX
@misc{attias2024brain,
  author = {Elie Attias and Cengiz Pehlevan and Dina Obeid},
  title = {{A Brain-Inspired Regularizer for Adversarial Robustness}},
  year = {2024},
  eprint = {2410.03952},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.03952},
}
Figure