Abstract: Systematic error, which is not determined by chance, often refers to the inaccuracy (involving either the observation or measurement process) inherent to a system. In this paper, we exhibit some long-neglected but frequent-happening adversarial examples caused by systematic error. More specifically, we find the trained neural network classifier can be fooled by inconsistent implementations of image decoding and resize. This tiny difference between these implementations often causes an accuracy drop from training to deployment. To benchmark these real-world adversarial examples, we propose ImageNet-S dataset, which enables researchers to measure a classifier's robustness to systematic error. For example, we find a normal ResNet-50 trained on ImageNet can have 1%-5% accuracy difference due to the systematic error. Together our evaluation and dataset may aid future work toward real-world robustness and practical generalization.
Introduction: The Deployment Gap
In the idealized environment of computer vision research, an image is often treated as a static, immutable tensor. However, in production environments, the pipeline from a raw JPEG file to a model-ready tensor is fraught with subtle variations. Different software libraries—such as Pillow, OpenCV, FFmpeg, and NVIDIA DALI—implement fundamental operations like image decoding and interpolation slightly differently.
These sub-pixel discrepancies are known as systematic noise. While virtually invisible to the human eye, these errors can cause a standard ResNet-50 to suffer an accuracy drop of 1% to 5% simply because the deployment environment uses a different library than the training environment. This research highlights that while the community often focuses on intentional adversarial attacks, we are overlooking a frequent, "natural" source of error that degrades model performance in the real world.
Systematic Characterization
The authors break down the image preprocessing pipeline into two critical stages: Image Decoding (converting raw files to RGB tensors) and Image Resizing (scaling resolution).
- Image Decoding: Most decoders rely on the Inverse Discrete Cosine Transform (iDCT). However, different libraries use different rounding mechanisms and iDCT implementations. For example, NVIDIA DALI was found to have a moderately different decoding process than CPU-based libraries, causing a consistent ~1% accuracy shift.
- Image Resizing: This stage involves interpolation algorithms like bilinear or bicubic resizing. The impact here is even more pronounced than in decoding. The gap between libraries often stems from simple differences in rounding mechanisms (e.g., how a library handles a pixel value of 127.5).
The ImageNet-S Benchmark
To quantify this phenomenon, the researchers introduced ImageNet-S, a new benchmark designed to measure robustness to systematic noise. It evaluates models across:
- 3 Decoder types: Pillow, OpenCV, and FFmpeg.
- 6 Resize types: Nearest, Bilinear, and Bicubic implementations from both Pillow and OpenCV.
- Hardware Acceleration: Support for NVIDIA’s DALI library, common in high-performance inference.
Key Insights and Results
The study revealed several counter-intuitive findings regarding model architecture and noise:
- Resize vs. Decoder Noise: The impact of switching decoders is relatively small (<0.01% difference between Pillow and OpenCV), but different resize implementations cause significant "accuracy jitter" (up to 2%).
- Complexity and Robustness: As shown in the benchmarking of ResNet, MobileNetV2, and RegNetX, larger models (higher FLOPs) within the same architecture family generally show better robustness to resizing noise. However, this trend of "scaling for robustness" does not hold for decoder noise.
- Adversarial Training: Models trained to be robust against $L_p$ adversarial attacks show improved resilience to resizing noise. However, they remain sensitive to decoder noise, suggesting that systematic noise represents a unique category of perturbation that doesn't perfectly map to standard adversarial models.
Proposed Solution: Mix Training
To mitigate these effects, the authors propose a "mix training" strategy. Instead of using a fixed preprocessing pipeline during training, they randomly sample different decoders and resize functions for each training batch. This simple augmentation forces the network to learn features that are invariant to the specific implementation details of the library used.
In testing, this strategy reduced the standard deviation of accuracy across different libraries by nearly 6x (from 0.36 to 0.0653 on decoder tests) while maintaining high overall top-1 accuracy. This approach effectively bridges the gap between training and deployment environments without requiring specialized model architectures.
Conclusion
Systematic noise is a pervasive but often ignored factor in machine learning deployment. By identifying the root causes in decoding and resizing implementations and providing the ImageNet-S benchmark, this work offers a path toward more reliable real-world AI. Future research may extend these findings to more complex tasks like object detection or semantic segmentation, where sub-pixel shifts could impact spatial coordinates even more severely.
Summary updated