[Re] Boosting the Visual Interpretability of CLIP via Adversarial Fine-Tuning
Organizations: University of Amsterdam
Abstract
This paper presents a reproducibility study of ``Boosting the Visual Interpretability of CLIP via Adversarial Fine-Tuning'', published at ICLR 2025, which proposes an unsupervised adversarial fine-tuning (AFT) method with norm regularisation to enhance the visual interpretability of CLIP's image encoder. We attempt to reproduce the key claims regarding improved saliency map quality, increased concept alignment, transferability to out-of-distribution datasets, and the trade-off with zero-shot accuracy. Beyond reproduction, we propose a saliency-guided regularisation extension that introduces an Energy Pointing Game loss, directly supervising the spatial alignment of Simple Gradient saliency maps with target objects. We evaluate our extension across a range of saliency-loss weights and show that explicit saliency supervision \rev{substantially} improves localisation metrics at a modest cost: the reduction in zero-shot accuracy and adversarial robustness is small at the lowest saliency-loss weight () and moderate at the strongest setting (). We restructure the codebase for configurable, systematic experimentation.
Figures & tables
| Saliency | CLIP | Zero-shot classification | Linear probing | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| PG | E-PG | AP | PA | IoU | PG | E-PG | AP | PA | IoU | ||
| w/o AFT | 25.26 | 29.21 | 31.65 | 61.15 | 12.19 | 28.05 | 30.95 | 33.10 | 61.96 | 13.37 | |
| SG | w/ AFT 4 (ours) | 56.55 | 46.22 | 49.95 | 68.71 | 24.43 | 57.83 | 46.99 | 50.67 | 68.97 | 24.87 |
| w/ AFT 4 (original) | 56.61 | 46.09 | 49.98 | 68.75 | 24.47 | 57.87 | 46.84 | 50.68 | 69.00 | 24.90 | |
| w/o AFT | 26.56 | 27.16 | 31.58 | 59.29 | 10.53 | 67.10 | 59.45 | 61.56 | 69.97 | 31.46 | |
| GC | w/ AFT 4 (ours) | 57.57 | 49.59 | 54.22 | 67.29 | 26.35 | 68.68 | 61.39 | 64.81 | 68.90 | 32.85 |
| w/o AFT | w/ AFT 1 | w/ AFT 4 | ||||
|---|---|---|---|---|---|---|
| Metric | Mean | Median | Mean | Median | Mean | Median |
| Soft-WPMI | 0.2264 | 0.2023 | 0.2610 | 0.2307 | 0.2817 | 0.2558 |
| Cos | 0.2852 | 0.4437 | 0.3046 | 0.4726 | 0.3065 | 0.4996 |
| Cos-cubed | 0.2369 | 0.2205 | 0.3051 | 0.2853 | 0.3289 | 0.3124 |
| Model | Detectors | % neurons |
|---|---|---|
| CLIP w/o AFT | 160/768 | 20.8% |
| AFT 1 (ours) | 279/768 | 36.3% |
| AFT 4 (ours) | 390/768 | 50.8% |
| AFT 4 (original) | 390/768 | 50.8% |
| ISIC (zero-shot) | Kvasir-SEG (zero-shot) | COCO linear probe | |||||||
| Model | SG PG | GE PG | SG IoU | SG PG | GE PG | SG IoU | SG PG | GC PG | SG IoU |
| ImageNet fine-tuning only | |||||||||
| CLIP (w/o AFT) | 0.107 | 0.397 | 0.091 | 0.058 | 0.085 | 0.062 | 0.140 | 0.226 | 0.076 |
| AFT 4 (original) | 0.428 | 0.460 | 0.282 | 0.051 | 0.020 | 0.121 | 0.333 | 0.244 | 0.145 |
| AFT 1 (ours) | 0.457 | 0.469 | 0.249 | 0.072 | 0.043 | 0.137 | 0.324 | 0.230 | 0.139 |
| AFT 4 (ours) | 0.424 | 0.426 | 0.274 | 0.056 | 0.028 | 0.127 | 0.328 | 0.239 | 0.144 |
| Model | CIFAR-10 | STL-10 | EuroSAT | FGVC Air. | Imagenette | Average | |
|---|---|---|---|---|---|---|---|
| clean | CLIP | 89.4 | 98.1 | 40.5 | 22.0 | 99.58 | 69.92 |
| AFT 1 (ours) | 86.4 | 97.7 | 9.5 | 21.4 | 99.26 | 62.85 | |
| AFT 4 (ours) | 66.2 | 91.4 | 10.5 | 12.2 | 98.60 | 55.78 | |
| AFT 4 (original) | 63.2 | 90.4 | 11.9 | 12.0 | 98.22 | 55.14 | |
| COCO AFT ( ) | 55.7 | 83.4 | 8.3 | 13.7 | 95.20 | 51.26 | |
| 2/255 | CLIP | 0.0 | 0.0 | 0.0 | 0.0 | 0.00 | 0.00 |
| Claim | Verdict | Primary source of discrepancy |
|---|---|---|
| 1a: Simple Gradient | Directional | Protocol choices shift absolute values; none reorder models |
| 1b: Grad-CAM | Inconclusive | Unstable on CLIP ViT-B/16 ( grid); metrics still improve |
| 2: Concept alignment | Trend | Detector counts set by undocumented IoU threshold ( range) |
| 3: Transferability | Directional | Quantitative in 2/3 settings; Kvasir-SEG uninformative |
| 4: Accuracy trade-off | Reproduced ∗ | EuroSAT at chance for all AFT models |
Appendix figures & tables13 assets
Supplementary material from the paper’s appendix.
Appendix
| Dataset | Usage | #images |
| ImageNet 2012 | Adversarial fine-tuning | 1.28M |
| COCO 2017 | Saliency-guided fine-tuning, linear probing, EPG evaluations | 118K |
| ImageNet-S | Saliency localisation evaluation | 12.4K |
| Caltech256 | ROAR analysis | 30.6K |
| Flickr30k | Retrieval evaluation | 31K |
| ISIC 2024 | OOD saliency evaluation | 401K |
| Model | Background | Foreground | BG/FG | |
|---|---|---|---|---|
| AFT 4 (no EPG) | 2/255 | 0.0036 | 0.0029 | 1.253 |
| + EPG | 2/255 | 0.0074 | 0.0079 | 0.936 |
| + EPG | 2/255 | 0.0070 | 0.0088 | 0.787 |
| + EPG | 2/255 | 0.0066 | 0.0097 | 0.677 |
| AFT 4 (no EPG) | 4/255 | 0.0123 | 0.0095 | 1.293 |
| + EPG | 4/255 | 0.0175 | 0.0188 | 0.933 |
| Simple Gradient | Grad-CAM | Grad-ECLIP | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| radius | clip | base | ours | gap | clip | base | ours | gap | clip | base | ours | gap |
| 0 | 0.261 | 0.556 | 0.559 | 0.270 | 0.595 | 0.571 | 0.667 | 0.655 | 0.661 | |||
| 5 | 0.294 | 0.660 | 0.663 | 0.341 | 0.713 | 0.685 | 0.781 | 0.767 | 0.779 | |||
| 15 | 0.388 | 0.783 | 0.783 | 0.463 | 0.856 | 0.829 | 0.908 | 0.902 | 0.906 | |||
| Model | IoU 0.02 | IoU 0.04 | IoU 0.06 |
|---|---|---|---|
| ImageNet fine-tuning only | |||
| CLIP (w/o AFT) | 572 | 160 | 64 |
| AFT 1 (ours) | 662 | 279 | 122 |
| AFT 4 (ours) | 721 | 390 | 183 |
| AFT 4 (original) | 721 | 390 | 197 |
| COCO fine-tuning | |||
| Model | CIFAR-10 | STL-10 | EuroSAT | FGVC Air. | Imagenette | |
|---|---|---|---|---|---|---|
| clean | AFT 4 (original) | 64.08 1.58 | 89.96 0.73 | 10.88 0.89 | 12.84 0.98 | 98.22 0.36 |
| AFT 1 (ours) | 87.56 0.90 | 97.38 0.32 | 10.50 1.18 | 20.82 1.78 | 99.26 0.17 | |
| AFT 4 (ours) | 65.80 1.45 | 90.88 0.59 | 10.88 0.89 | 12.26 0.90 | 98.60 0.18 | |
| COCO AFT ( ) | 55.74 1.71 | 83.42 1.08 | 8.26 0.60 | 13.68 1.40 | 95.20 0.28 | |
| + EPG | 52.96 1.75 | 82.12 1.09 | 5.36 0.52 | 14.20 1.32 | 95.10 0.33 | |
| + EPG | 51.26 0.99 | 80.22 1.01 | 5.20 0.80 | 13.70 1.20 | 94.86 0.41 |
| T I (%) | I T (%) | ||||
|---|---|---|---|---|---|
| Vision Encoder | R@1 | R@5 | R@1 | R@5 | |
| clean | CLIP baseline | 24.95 | 45.37 | 44.41 | 68.61 |
| AFT 1 ( ours ) | 27.20 | 48.52 | 43.02 | 67.09 | |
| AFT 4 ( original ) | 19.53 | 37.50 | 26.38 | 47.54 | |
| AFT 4 ( ours ) | 19.53 | 37.46 | 26.33 | 47.78 | |
| 2/255 | CLIP baseline | 1.83 | 4.74 | 2.25 | 5.66 |
| Simple Gradient | Grad-CAM | Grad-ECLIP | ||||||||||||||
| Model | PG | E-PG | AP | PA | IoU | PG | E-PG | AP | PA | IoU | PG | E-PG | AP | PA | IoU | |
| ISIC | ImageNet fine-tuning only | |||||||||||||||
| CLIP (w/o AFT) | 0.107 | 0.238 | 0.253 | 0.609 | 0.091 | 0.190 | 0.261 | 0.286 | 0.622 | 0.103 | 0.397 | 0.308 | 0.425 | 0.663 | 0.196 | |
| AFT 4 (original) | 0.428 | 0.441 | 0.523 | 0.714 | 0.282 | 0.346 | 0.367 | 0.386 | 0.464 | 0.281 | 0.460 | 0.395 | 0.537 | 0.700 | 0.272 | |
| AFT 1 (ours) | 0.457 | 0.401 | 0.484 | 0.699 | 0.249 | 0.382 | 0.352 | 0.373 | 0.550 | 0.223 | 0.469 | 0.364 | 0.498 | 0.691 | 0.246 | |
| AFT 4 (ours) | 0.424 | 0.436 | 0.511 | 0.709 | 0.274 | 0.290 | 0.344 | 0.372 | 0.558 | 0.246 | 0.426 | 0.377 | 0.516 | 0.691 | 0.255 | |
| Simple Gradient | Grad-CAM | |||||||||
| Model | PG | E-PG | AP | PA | IoU | PG | E-PG | AP | PA | IoU |
| ImageNet fine-tuning only | ||||||||||
| CLIP (w/o AFT) | 0.140 | 0.156 | 0.166 | 0.701 | 0.076 | 0.226 | 0.212 | 0.243 | 0.666 | 0.119 |
| AFT 4 (original) | 0.333 | 0.241 | 0.261 | 0.738 | 0.145 | 0.244 | 0.228 | 0.254 | 0.656 | 0.128 |
| AFT 1 (ours) | 0.324 | 0.227 | 0.254 | 0.735 | 0.139 | 0.230 | 0.216 | 0.250 | 0.654 | 0.120 |
| AFT 4 (ours) | 0.328 | 0.240 | 0.260 | 0.738 | 0.144 | 0.239 | 0.227 | 0.257 | 0.680 | 0.129 |
| Imagenette | ImageNet-val | |||
| Model | Del gap | Ins gap | Del gap | Ins gap |
| ImageNet fine-tuning only | ||||
| AFT 4 (original) | ||||
| AFT 1 (ours) | ||||
| AFT 4 (ours) | ||||
| COCO fine-tuning with EPG supervision | ||||
VLM Interpretability
Vision-language model interpretability explains how image and language representations shape predictions, evidence use, and multimodal reasoning.
See all 268 papers