TL;DR
While OpenAI’s CLIP is celebrated for its robustness to major distribution shifts like sketches or paintings, this paper reveals a surprising "Achilles' heel": standard image compression. By using Integrated Gradients to peek under the hood, the authors show that even moderate JPEG compression significantly degrades zero-shot performance and exposes distinct "inductive biases" in how ResNet versus Vision Transformer (ViT) architectures process these artifacts.
What Problem Does This Paper Address?
Foundation models like CLIP (Contrastive Language-Image Pretraining) are trained on massive datasets (400 million image-text pairs) to learn generalizable visual concepts. Previous research suggested that this scale makes CLIP exceptionally robust to "natural" distribution shifts—for instance, recognizing a "dog" whether it's a photo, a sketch, or a cartoon.
However, the authors identified a gap: image quality degradation. In real-world deployments, images are rarely pristine; they are compressed for storage and transmission. Surprisingly, despite its vast training data, CLIP’s zero-shot classification is highly sensitive to the artifacts introduced by common algorithms like JPEG. The paper aims to quantify this vulnerability and use attribution methods to understand why the model's predictions change when pixels are squeezed.
Methods
The researchers evaluated various CLIP backbones (ResNets and ViTs) across different levels of JPEG compression. To move beyond just reporting accuracy drops, they employed Integrated Gradients (IG), an attribution method designed to explain a model's prediction by attributing it to specific input features (pixels).
Unlike simpler gradient methods, IG satisfies two important mathematical axioms:
- Sensitivity: If two inputs differ in one feature and have different outputs, that feature must have a non-zero attribution.
- Implementation Invariance: Two functionally equivalent networks should produce the same attributions.
By calculating the path integral of gradients from a "baseline" (the original high-quality image) to a "target" (the compressed image), the authors could visualize exactly which pixels were responsible for the increase in classification loss. They visualized these as "positive" (green) and "negative" (red) polarity overlays, where red indicates areas where quality loss most heavily increased the model's confusion.
Datasets
The study utilized two standard computer vision benchmarks:
- CIFAR-10: 60,000 low-resolution (32x32) images across 10 classes.
- STL-10: 13,000 labeled images (96x96), which are higher resolution than CIFAR-10.
For both datasets, the authors created four test groups based on JPEG quality settings: Original, Quality 75, Quality 50, and Quality 25.
Key Insights and Ideas
- The "Compression Gap": Even though CLIP was trained on "in-the-wild" web data that presumably contains compressed images, it hasn't learned to be invariant to compression artifacts. As quality drops, the model often flips its prediction to a completely different class.
- Architectural Inductive Biases: The Integrated Gradients visualizations revealed a fascinating difference in how models "see" noise:
- ResNet (CNN): The impact of compression is localized. The red/green attribution clusters are concentrated in specific regions of the image.
- ViT (Transformer): The impact is global and grid-like. Because ViTs process images as patches, the compression artifacts affect the model in a distinct, spread-out grid pattern across the entire frame.
- Loss Approximation: The authors demonstrated that IG isn't just a pretty visualization; it provides a mathematically sound approximation of the change in the cross-entropy loss function.
Key Results
The quantitative drop in performance is stark, particularly on CIFAR-10. As seen in Figure 1, every single CLIP image encoder tested showed a significant decline in average precision as compression increased.
- CIFAR-10 Impact: For the high-performing ViT-L/14 model, average precision plummeted from 0.9538 (Original) to 0.6129 (Quality 25).
- STL-10 Impact: While still present, the drops were less severe (e.g., ViT-L/14 dropped from 0.9924 to 0.9585), suggesting that higher-resolution starting points might offer some buffer against compression artifacts.
- Qualitative Flips: The authors highlight cases where a "truck" is correctly identified in the original image but is misclassified as an "automobile" or "airplane" once compressed, even at Quality 75.
Limitations and Future Work
The authors acknowledge that their study focuses on probing and understanding the vulnerability rather than providing an immediate fix. They also kept text prompts fixed (e.g., "This is an image of a {CLS}") to isolate the effects of the image modality, though they note that prompt engineering itself can affect robustness.
Future directions include: * Investigating data augmentation strategies (specifically including compressed images during fine-tuning) to bake-in compression robustness. * Developing more effective mitigation strategies to ensure foundation models remain reliable in bandwidth-constrained real-world environments.
Summary updated