Learning the essential in less than 2k additional weights - a simple approach to improve image classification stability under corruptions

Kai Bäuerle, Patrick Müller, Syed Muhammad Kazim, Ivo Ihrke, Margret KeuperTMLR 2024

Abstract

The performance of image classification on well-known benchmarks such as ImageNet is remarkable, but in safety-critical situations, the accuracy often drops significantly under adverse conditions. To counteract these performance drops, we propose a very simple modification to the models: we pre-pend a single, dimension preserving convolutional layer with a large linear kernel whose purpose it is to extract the information that is essential for image classification. We show that our simple modification can increase the robustness against common corruptions significantly, especially for corruptions of high severity. We demonstrate the impact of our channel-specific layers on ImageNet-100 and ImageNette classification tasks and show an increase of up to 30% accuracy on corrupted data in the top1 accuracy. Further, we conduct a set of designed experiments to qualify the conditions for our findings. Our main result is that a data- and network-dependent linear subspace carries the most important classification information (the essential), which our proposed pre-processing layer approximately identifies for most corruptions, and at very low cost.

Introduction

Deep Neural Networks (DNNs) are world-class at identifying objects in pristine, high-resolution images. However, they are notoriously brittle. In safety-critical applications like autonomous driving or medical imaging, adverse conditions such as fog, lens blur, or sensor noise can cause accuracy to plummet. Current solutions, such as extensive data augmentation or adversarial training, are often computationally expensive and may only protect against specific, pre-defined corruptions. This research proposes a "low-cost" architectural modification to bake robustness directly into the network without needing to anticipate specific environmental noise.

Proposed Method: Learning the "Essential"

The authors propose a deceptively simple architectural tweak: pre-pending a single, large-kernel depth-wise convolutional layer to the start of any existing model. This layer acts as a dimension-preserving filter that extracts the most important features for classification before the image reaches the main network.

The proposed architecture pre-pends a single, large-kernel depth-wise convolutional layer to a standard CNN.

Key technical details of this layer include:

  • Dimension Preserving: It maintains the input image size and number of channels.
  • Depth-wise Convolution: It applies independent filters to each color channel (RGB) independently, avoiding cross-channel mixing at this stage.
  • Large Linear Kernel: A $25 \times 25$ linear kernel (without non-linearities like ReLU) allows the model to capture wide spatial context.
  • Subspace Projection: When trained on clean data, this layer naturally learns to act as a subspace projection, effectively "zeroing out" non-essential high-frequency noise that often leads to model vulnerability.

Experimental Results

The approach was evaluated across standard benchmarks (ImageNet-1k, ImageNet-100) and specialized datasets like OpticsBench, which focuses on realistic optical aberrations like astigmatism and coma.

Accuracy gains (Ours - Baseline) across various corruption types for different model architectures, demonstrating the generalizability of the approach.

The results demonstrate that this simple modification provides a significant robustness boost across a wide range of architectures, from AlexNet to modern Vision Transformers (ViT) and Swin Transformers.

  • Significant Accuracy Gains: On ImageNette, a ResNet50 with the added layer saw a 9.3% improvement on optical aberrations. In high-severity corruption scenarios, accuracy increased by as much as 30% compared to the baseline.
  • Extreme Efficiency: For a ResNet50, the modification adds only 1,875 weights—a negligible 0.008% overhead in terms of parameters.
  • Architecture Agnostic: The method consistently improves performance regardless of the backbone architecture, as shown in the comparative analysis across ResNet, DenseNet, and Transformers.
  • Complementary to Augmentation: The method is not just an alternative to data augmentation; using this layer alongside techniques like AugMix resulted in the best overall performance.

Discussion and Limitations

While highly effective for spatial and noise-based corruptions, the depth-wise nature of the layer means it provides less benefit for "color corruptions" (like saturation or brightness changes) because it cannot learn to re-combine color information across channels. Additionally, while modern architectures like Swin Transformers maintained performance on clean data, some smaller models exhibited a slight drop in clean-data accuracy, illustrating a minor robustness-accuracy trade-off.

Conclusion

Adding a single, large-kernel linear layer is a remarkably efficient way to improve the stability of image classifiers. By learning to project the input into an "essential" subspace, models become significantly more robust to real-world corruptions with minimal computational and memory overhead.

Summary updated

BibTeX
@article{bauerle2024learning,
  author = {Kai Bäuerle and Patrick Müller and Syed Muhammad Kazim and Ivo Ihrke and Margret Keuper},
  title = {{Learning the essential in less than 2k additional weights - a simple approach to improve image classification stability under corruptions}},
  journal = {Accepted by TMLR},
  year = {2024},
  url = {https://openreview.net/forum?id=i2SuGWtIIm},
}
Figure