TL;DR
ReACT-CLIP introduces a training-free, test-time defense for CLIP models that dynamically adapts its correction strength to the severity of an adversarial attack on a per-sample basis. By analyzing how an input's features drift under different noise levels and spatial augmentations, it effectively counters unknown attack budgets at inference time while preserving high clean accuracy.
What Problem Does This Paper Address?
Contrastive Language-Image Pre-training (CLIP) models are widely used as frozen backbones for downstream multimodal tasks like classification, retrieval, and object detection. However, this widespread reuse concentrates adversarial risk: a tiny, imperceptible perturbation can corrupt the shared visual representation and cause cascading failures across multiple applications.
Existing test-time defenses try to fix this adversarial feature displacement at inference time without retraining the model. However, they rely on globally fixed hyperparameters (such as fixed noise scales or optimization step sizes) tuned for a specific attack budget ($\epsilon$). In real-world deployment, the attacker's budget is completely unknown. This mismatch causes existing defenses to fail catastrophically: a mild correction undershoots strong attacks, while a strong correction overshoots weak attacks and corrupts clean images.
Methods
ReACT-CLIP operates entirely at inference time without model or prompt tuning. It breaks the defense down into two input-specific decisions: how strongly to correct and whether to intervene.
-
Response-Conditioned Correction Strength: The model probes each input image with low- and high-magnitude Gaussian noise, measuring the resulting visual-feature drifts ($d_{low}$ and $d_{high}$). It computes the relative cross-noise drift: $$r(x) = \frac{d_{high}(x) - d_{low}(x)}{d_{low}(x)}$$ This relative drift serves as a sample-specific proxy for correction demand. ReACT-CLIP maps $r(x)$ linearly to a tailored anchor-noise scale ($\sigma_{corr}$), which is used to construct a stable, noise-averaged feature anchor. The original visual feature is then extrapolated past this anchor to counteract the adversarial displacement.
-
Selective Defensive Intervention: To prevent unnecessary corrections on clean images, ReACT-CLIP measures prediction stability. Clean images retain stable class-probability distributions under weak spatial augmentations, whereas adversarial inputs fluctuate wildly. ReACT-CLIP quantifies this using a prediction-instability score $J(x)$ via Jensen–Shannon divergence. It combines relative drift and prediction instability into a unified defensive intervention score ($s_{int} = r(x) + J(x)$). Correction is only activated if this score clears a predefined threshold $\tau$.
Datasets
The authors evaluate ReACT-CLIP across a robust suite of benchmarks:
- 12 Downstream Datasets: Caltech101, Caltech256, CIFAR10, CIFAR100, STL10, OxfordPets, Flowers102, Food101, StanfordCars, FGVC-Aircraft, DTD, and EuroSAT.
- ImageNet Suite: ImageNet and four distribution-shifted/out-of-distribution variants (ImageNet-A, ImageNet-V2, ImageNet-R, and ImageNet-Sketch).
Key Insights and Ideas
- Relative Over Absolute Drift: Absolute feature drift under noise doesn't cleanly sort attack strengths because adversarial features can exhibit "false stability" under weak noise. However, the relative change between low- and high-noise regimes scales beautifully with attack severity.
- Complementary Error Signals: Relative drift excels at identifying moderate-to-strong attacks but blurs the line between clean and weak attacks. Prediction instability under spatial augmentations fills this exact gap, providing a highly reliable trigger mechanism for low-budget attacks.
- Exposing "Label Leakage": The authors uncover a subtle evaluation flaw in prior feature-correction literature. Previous methods evaluated defenses by attacking all samples, allowing the defense to accidentally "correct" images that the base CLIP model originally misclassified anyway. ReACT-CLIP enforces a strict, leakage-free protocol by only evaluating samples correctly classified when clean.
Key Results
- Stable Performance Across Budgets: While baseline defenses degrade sharply as attacks strengthen, ReACT-CLIP maintains a stable ~60% robust accuracy across PGD-10 attack budgets from $\epsilon = 1/255$ to $16/255$.
- Massive Gains Against Strong Attacks: At a high attack budget ($\epsilon = 16/255$), ReACT-CLIP outperforms the strongest test-time baseline by 46.50% on average across the 12 downstream datasets.
- Preserving Clean Accuracy: ReACT-CLIP incurs a negligible clean accuracy drop of only 0.76% compared to undefended zero-shot CLIP, significantly outperforming other aggressive defenses that heavily trade off clean performance for robustness.
Limitations and Future Work
- Weak Attack Ambiguity: Performance is slightly lower at very weak attack budgets ($\epsilon = 1/255$) because distinguishing extremely subtle adversarial perturbations from clean, natural variations remains inherently difficult.
- Inference Overhead: ReACT-CLIP requires 14 forward passes through the visual encoder per image (2 for noise probes, 10 for anchor views, and 1 for spatial augmentation). While it is entirely optimization-free (requiring no backward passes or gradient steps), this multi-pass requirement increases test-time latency. Future work could focus on distilling or optimizing the number of required anchor views to reduce computational overhead.
Summary updated