Improving Network Robustness against Adversarial Attacks with Compact Convolution

Rajeev Ranjan, Swami Sankaranarayanan, Carlos Domingo Castillo, Rama ChellappaarXiv 2017

Abstract

Though Convolutional Neural Networks (CNNs) have surpassed human-level performance on tasks such as object classification and face verification, they can easily be fooled by adversarial attacks. These attacks add a small perturbation to the input image that causes the network to misclassify the sample. In this paper, we focus on neutralizing adversarial attacks by compact feature learning. In particular, we show that learning features in a closed and bounded space improves the robustness of the network. We explore the effect of $L_2$-Softmax Loss, that enforces compactness in the learned features, thus resulting in enhanced robustness to adversarial perturbations. Additionally, we propose compact convolution, a novel method of convolution that when incorporated in conventional CNNs improves their robustness. Compact convolution ensures feature compactness at every layer such that they are bounded and close to each other. Extensive experiments show that Compact Convolutional Networks (CCNs) neutralize multiple types of attacks, and perform better than existing methods in defending adversarial attacks, without incurring any additional training overhead compared to CNNs.

The Vulnerability of Unbounded Feature Spaces

Standard Convolutional Neural Networks (CNNs) are notoriously fragile. An attacker can add a tiny, human-imperceptible amount of noise—an adversarial perturbation—to an image, causing a state-of-the-art model to misclassify it with high confidence. This vulnerability exists because standard CNNs learn features in an unbounded Euclidean space. In such a space, an adversarial perturbation can push a feature vector very far from its original position, easily crossing class boundaries.

Adversarial images crafted for standard CNNs (middle) are nearly identical to the original (top), while those crafted for CCNs (bottom) require significantly more visible noise to succeed.

The challenge is to design a network where the "distance" a feature can move due to noise is strictly limited. By constraining features to lie within a closed and bounded space (specifically a hypersphere), we can mathematically reduce the sensitivity of the network to small input perturbations.

Methodology: Enforcing Feature Compactness

We propose two primary mechanisms to enforce compactness—the mathematical property of being closed and bounded:

1. $L_2$-Softmax Loss

Instead of using a standard softmax, we normalize the final feature vectors to a fixed radius ($\alpha$) on a hypersphere before classification. This ensures that features are bounded and forces intra-class samples to cluster tightly, reducing the "wiggle room" available to an adversary.

2. Compact Convolution

While $L_2$-Softmax only constrains the final layer, Compact Convolution applies this logic to every layer. Before a convolutional kernel is applied, every input patch is $L_2$-normalized and scaled. Traditional convolution is defined as $y = W^T x$, whereas compact convolution is defined as:

$$\tilde{y} = W^T \frac{\alpha x}{\|x\|_2 + \delta}$$

The Compact Convolution process: input patches are normalized and scaled before the kernel is applied, ensuring bounded activations at every layer.

To maintain computational efficiency, we utilize a "Compact Convolution Module." This module uses a dual-branch approach: one for standard convolution and another that uses a fixed "all-ones" kernel to efficiently calculate the local $L_2$-norms of all patches simultaneously, avoiding the overhead of individual patch normalization.

Theoretical Insights

A key theoretical insight of this work is the sub-linear growth of noise. In standard networks, the change in activation caused by noise grows linearly with the input dimension ($n$). By introducing normalization, we demonstrate that this change grows only at the rate of $\sqrt{n}$. This mathematically "desensitizes" the network to high-dimensional noise. Furthermore, through ablation studies, we found that enforcing compactness in deeper layers (closer to the output) has a significantly more profound impact on robustness than doing so in the initial layers.

Experimental Results

We evaluated Compact Convolutional Networks (CCNs) on MNIST, CIFAR10, and ImageNet. The results showed dramatic improvements across multiple attack types without requiring expensive adversarial training:

  • White-Box Attacks (FGSM): On MNIST ($\epsilon=0.3$), the baseline model's accuracy plummeted to 31.76%, while the CCN+LS (Label Smoothing) model maintained 89.73%. On CIFAR10, the improvement was even more stark: 71.38% accuracy for CCN+LS vs. 8.57% for the baseline.
  • Iterative Attacks (DeepFool): CCNs required significantly larger perturbations to be fooled. On CIFAR10, the robustness score (average perturbation needed to cause a mistake) for CCN+LS was 0.625, compared to just 0.014 for the baseline.
  • Black-Box Attacks: The defense remained effective even when the attacker lacked access to the model's internal weights, proving that the robustness is a fundamental change in the feature manifold rather than simple gradient masking.

Conclusion

CCNs offer a robust alternative to standard CNNs by enforcing feature compactness at every layer. By restricting features to a bounded hypersphere, we achieve state-of-the-art resistance to adversarial noise with zero additional training overhead. While future work will focus on improving clean-image accuracy on massive datasets like ImageNet and pursuing provable robustness guarantees, CCNs represent a significant step toward more reliable deep learning systems.

Summary updated

BibTeX
@misc{ranjan2017improving,
  author = {Rajeev Ranjan and Swami Sankaranarayanan and Carlos Domingo Castillo and Rama Chellappa},
  title = {{Improving Network Robustness against Adversarial Attacks with Compact Convolution}},
  year = {2017},
  eprint = {1712.00699},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1712.00699},
}
Figure