potentialpaper

0-CLIP: Training-free Anomaly Detection Hidden in CLIP's Projection

Anonymous authors

ICLR 2027

Edit this page

Or clone it with git

Run in a terminal:

Needs Git LFS. To push, use an API key from your profile as the password.

Or let your agent set it up

It checks and sets up everything: signing in, git, the clone, credentials and an SSH key.

TL;DR. Training-free Anomaly Detection Hidden in CLIP's Projection

Abstract. CLIP-based zero-shot anomaly detection commonly improves dense discriminability through prompts or adapters trained on auxiliary data. However, reliable transfer to unseen domains remains a practical challenge. This motivates a closer examination of how much anomaly information is already present in CLIP itself. Our preliminary experiments show that CLIP's frozen visual projector \proj\proj contains useful dense anomaly structure, but its patch-level scores tend to rank normal and anomalous regions in the wrong order. Based on this observation, we introduce \textbf{0-CLIP}, a training-free method that converts \proj\proj into a patch-to-text anomaly operator. The construction reverses the normal--abnormal score polarity, forms a compact operator from the principal singular directions of \proj\proj, and selectively recovers lower-energy directions using a separation criterion computed on the first unlabeled test image of each category. Without any labeled data, the resulting operator yields both pixel-level anomaly maps and image-level anomaly scores. Across industrial and medical benchmarks, 0-CLIP achieves performance competitive with training-based methods, and ablation studies show the effectiveness of the proposed method. These results suggest that substantial dense anomaly discriminability is already latent in CLIP's frozen visual projector and can be exposed without training. Our code is available in the Supplementary Material.

Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.

Claim this paper
How does this paper connect to your work? Write how you built on it, compared with it or reproduced it, or add a summary, a critique or errata.
Or make it interactive:
Start writing

edit · history

DateVersionSubmitted toPDFEvidence
27 Aug 2026ICLR 2027submittedICLR 2027Under reviewreviews ↓[1]PDF[1]
Missing a version?

ICLR 2027

Under review · 3 reviews · OpenReview

Updated 25 Nov 2026, 10:35 UTC.

Reviewer nuAqOpenReview ↗
Rating
3/4
Confidence
4/4
Soundness
2/3
Presentation
3/3
Informativeness
2/3
Read review
Summary

The paper proposes a new approach to continual zero-shot anomaly detection, called 0-CLIP. The main hypothesis is that CLIP already has normality and abnormality baked into its projection layer. To check this, they construct a “new” projection layer from the existing one by performing an SVD and gradually building it using the first test sample. The method is evaluated across multiple standard industrial and medical datasets, on which it achieves good results.

Strengths
  • The overall idea is quite simple
  • The paper is well written and easy to follow.
Weaknesses

Major Weaknesses:

  • The method is not compared to the current state of the art for continual zero-shot anomaly detection, ReMem [1]. This method outperforms it on the two datasets they test. It is unclear how it works on others. Since they have released the code publicly, I do not see a reason why 0-CLIP shouldn’t be compared to it. This might overturn the claim about SOTA results.
  • The method works only with the final-layer features of the vision encoder, neglecting information from earlier layers.

Minor Weaknesses:

  • How does the method work when using a 0-shot method that also fine-tunes the projection head? For example, AdaCLIP?
  • How are the std’s for the 5 runs calculated? The way it is calculated might underestimate the actual performance jumps based on the first image in the test stream.
  • I would mention the latest language-free zero-shot methods [2,3] in the related work, as they also achieve better results on some datasets.

Remarks:

  • A mistake in the citations: DRAEM: A discriminatively trained model for surface anomaly detection -> DRÆM – A discriminatively trained reconstruction embedding for surface anomaly detection

[1] Yi, L., Chen, Z., Wu, G., Ding, J., Wang, X., & Ning, Z. (2026). ReMem: A Dynamic Memory Evolution Detector for Zero-Shot Anomaly Detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Findings (pp. 7697-7705).

[2] Fučka, M., et al. (2026). AnomalyVFM--Transforming Vision Foundation Models into Zero-Shot Anomaly Detectors. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (pp. 35555-35566).

[3] Hou, Y., et al. (2026). VisualAD: Language-Free Zero-Shot Anomaly Detection via Vision Transformer. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (pp. 21346-21356).

Questions for the authors
  • How does 0-CLIP perform in comparison to ReMem on datasets besides MVTec AD and VisA?
  • Could the method be expanded to work with earlier layers as well?
  • How does the method work when applied to a 0-shot model that tunes the projection head, e.g. AdaCLIP?
  • How are the Standard Deviations for the multiple seed runs calculated?
6 comments
Authors · CommentOpenReview ↗

W1/Q1. How does 0-CLIP perform in comparison to ReMem on datasets besides MVTec AD and VisA?

Thank you for pointing us to ReMem. In short, ReMem is stronger on MVTec-AD and VisA, while 0-CLIP$^\dagger$ is higher on most other datasets and on average.

We ran its official code, here are results (pixel P-AUROC / PRO; image I-AUROC / I-AP):

Dataset ReMem pixel 0-CLIP$^\dagger$ pixel ReMem image 0-CLIP$^\dagger$ image
MVTec-AD 98.4 / 95.5 97.8 / 94.0 98.7 / 99.5 98.2 / 99.3
VisA 98.2 / 94.7 98.9 / 93.7 94.3 / 94.5 92.9 / 93.7
BTAD 97.1 / 74.3 98.0 / 83.9 93.6 / 97.3 96.5 / 97.9
MPDD 85.0 / 79.4 97.5 / 93.5 71.1 / 74.6 73.3 / 77.5
DTD-Syn 98.3 / 95.4 98.3 / 95.2 97.6 / 99.2 98.0 / 99.3
SDD 91.3 / 66.0 93.5 / 77.8 68.2 / 41.2 85.6 / 76.2
DAGM 96.4 / 91.0 98.2 / 96.4 99.4 / 97.4 99.6 / 96.7
KSDD2 98.3 / 93.3 98.5 / 96.2 89.0 / 74.8 96.4 / 91.8
Real-IAD 91.5 / 69.3 97.4 / 88.6 63.3 / 57.2 80.8 / 79.0
Brain MRI 89.7 / 64.2 96.9 / 81.2 60.9 / 85.3 74.0 / 91.1
Liver CT 96.3 / 82.0 97.5 / 92.0 – –
Retina RESC 93.3 / 75.7 95.1 / 81.7 – –
TN3K 71.7 / 36.7 80.0 / 57.9 – –
Br35H – – 93.7 / 88.7 89.5 / 83.8
Retina OCT – – 64.6 / 85.8 88.1 / 95.9
Average 92.7 / 78.3 96.0 / 87.1 82.9 / 83.0 89.4 / 90.2

Two differences in setting between 0-CLIP and ReMem:

  • ReMem uses a DINOv2 backbone, while all methods in our tables use CLIP.
  • ReMem sees the whole test set in advance and scores it several times, while our online variant uses only past images.

Revision: Added as Table 8 (Appendix E.3).

Authors · CommentOpenReview ↗

W2/Q2. Could the method be expanded to work with earlier layers as well?

Thank you for your question. 0-CLIP already uses earlier layers: it takes patch tokens from layers 12, 16, 20 and 24 (Eq. (1) and Sec. 4.1) and builds a separate operator for each layer.

We compared this default with the final layer alone (P-AUROC / PRO / I-AUROC / I-AP):

Layers MVTec-AD VisA
12/16/20/24 (default) 95.2 / 88.1 / 94.7 / 97.3 95.3 / 86.1 / 85.1 / 87.0
final layer (24 only) 92.2 / 82.6 / 93.6 / 96.8 92.1 / 82.7 / 82.9 / 85.7

Using only the final layer lowers all eight metrics. Combining multiple layers is therefore highly beneficial and indispensable to 0-CLIP.

Revision: Sec. 3.1 now states explicitly that 0-CLIP constructs these operators for each layer.

W3/Q3. How does the method work when applied to a 0-shot model that tunes the projection head, e.g. AdaCLIP?

Using AdaCLIP's official code and weights, we applied our construction to its trained patch heads and kept everything else unchanged (P-AUROC / PRO / I-AUROC / I-AP):

AdaCLIP patch heads MVTec-AD VisA
Original 86.8 / 33.8 / 92.0 / 96.4 95.1 / 71.3 / 83.0 / 84.9
With our construction 43.9 / 12.8 / 76.8 / 88.2 57.3 / 32.1 / 62.9 / 68.9

The second row is our run of the official code with only the patch heads changed. AdaCLIP's heads are new layers trained on labeled data, and this training has already aligned their polarity and singular-value weights with AD. Flipping and reweighting them therefore undoes what training learned. 0-CLIP is meant to replace this training.

Revision: Added as Table 11 (Appendix E.6) and noted in the Discussion (Sec. 5).

Authors · CommentOpenReview ↗

W4/Q4. How are the Standard Deviations for the multiple seed runs calculated?

Each seed shuffles the test stream of every class, which changes the calibration image. For each seed we average the metrics over classes, and report the mean and standard deviation over the 5 seeds (Sec. 4.1 and Appendix E.7). Below we also compute the standard deviation over the 5 seeds for each class first and then average over classes (mean ± dataset std / per-class std; identical on 1-class datasets):

Dataset (#cls) Setting P-AUROC PRO I-AUROC I-AP
MVTec-AD (15) 0-CLIP$^\dagger$ 97.83 ± 0.25 / 0.46 93.95 ± 0.21 / 0.57 98.22 ± 0.12 / 0.60 99.34 ± 0.07 / 0.26
0-CLIP 94.91 ± 0.20 / 0.47 87.30 ± 0.47 / 0.66 94.44 ± 0.32 / 0.69 97.35 ± 0.21 / 0.48
VisA (12) 0-CLIP$^\dagger$ 98.90 ± 0.03 / 0.08 93.73 ± 0.23 / 0.47 92.92 ± 0.31 / 0.67 93.73 ± 0.23 / 0.58
0-CLIP 95.32 ± 0.10 / 0.19 86.16 ± 0.04 / 0.26 85.29 ± 0.16 / 0.33 86.98 ± 0.11 / 0.27
BTAD (3) 0-CLIP$^\dagger$ 98.03 ± 0.03 / 0.09 83.89 ± 0.78 / 0.99 96.54 ± 0.36 / 0.60 97.90 ± 0.30 / 0.42
0-CLIP 96.48 ± 0.23 / 0.26 81.74 ± 0.57 / 0.66 94.98 ± 0.64 / 1.15 94.59 ± 0.35 / 0.65
MPDD (6) 0-CLIP$^\dagger$ 97.47 ± 0.36 / 0.51 93.54 ± 0.68 / 1.02 73.27 ± 2.12 / 5.18 77.48 ± 1.60 / 3.32
0-CLIP 96.17 ± 0.07 / 0.11 91.10 ± 0.19 / 0.28 76.79 ± 0.26 / 0.70 81.84 ± 0.13 / 0.44
DTD-Syn (12) 0-CLIP$^\dagger$ 98.33 ± 0.01 / 0.14 95.19 ± 0.10 / 0.34 98.03 ± 0.14 / 0.47 99.25 ± 0.03 / 0.21
0-CLIP 97.99 ± 0.05 / 0.10 93.99 ± 0.17 / 0.27 98.01 ± 0.05 / 0.24 99.28 ± 0.01 / 0.07
SDD (1) 0-CLIP$^\dagger$ 93.51 ± 0.27 77.84 ± 0.64 85.56 ± 0.89 76.24 ± 1.98
0-CLIP 91.88 ± 0.24 77.97 ± 0.26 84.52 ± 0.16 78.41 ± 0.29
DAGM (10) 0-CLIP$^\dagger$ 98.19 ± 0.03 / 0.13 96.38 ± 0.07 / 0.19 99.56 ± 0.08 / 0.08 96.72 ± 0.23 / 0.29
0-CLIP 96.91 ± 0.05 / 0.08 94.08 ± 0.12 / 0.17 99.53 ± 0.02 / 0.07 98.30 ± 0.12 / 0.24
KSDD2 (1) 0-CLIP$^\dagger$ 98.52 ± 0.29 96.17 ± 0.32 96.42 ± 0.18 91.78 ± 0.23
0-CLIP 97.28 ± 0.30 94.81 ± 0.25 95.48 ± 0.09 89.57 ± 0.15
Real-IAD (30) 0-CLIP$^\dagger$ 97.38 ± 0.05 / 0.14 88.59 ± 0.24 / 0.58 80.84 ± 0.06 / 0.39 78.99 ± 0.11 / 0.48
0-CLIP 95.34 ± 0.05 / 0.12 87.37 ± 0.08 / 0.29 76.29 ± 0.12 / 0.21 74.23 ± 0.11 / 0.25
Liver CT (1) 0-CLIP$^\dagger$ 97.53 ± 0.13 92.01 ± 0.54 – –
0-CLIP 95.85 ± 0.07 90.87 ± 0.17 – –
Brain MRI (1) 0-CLIP$^\dagger$ 96.88 ± 0.06 81.16 ± 0.36 73.96 ± 0.71 91.13 ± 0.14
0-CLIP 93.74 ± 0.06 76.28 ± 0.18 80.42 ± 0.21 94.72 ± 0.05
Retina RESC (1) 0-CLIP$^\dagger$ 95.11 ± 0.24 81.66 ± 0.80 – –
0-CLIP 87.36 ± 0.14 59.01 ± 0.63 – –
TN3K (1) 0-CLIP$^\dagger$ 80.01 ± 0.45 57.87 ± 0.34 – –
0-CLIP 82.44 ± 0.18 52.99 ± 1.04 – –
Br35H (1) 0-CLIP$^\dagger$ – – 89.49 ± 0.73 83.75 ± 0.79
0-CLIP – – 96.06 ± 0.05 94.59 ± 0.05
Retina OCT (1) 0-CLIP$^\dagger$ – – 88.07 ± 1.32 95.92 ± 0.45
0-CLIP – – 79.29 ± 0.16 91.99 ± 0.06

For offline 0-CLIP, even the per-class std stays small across datasets (mostly below 0.7%), showing minimal sensitivity to the calibration image. Larger online fluctuations such as on MPDD come from stream order in RareCLIP's memory.

We also tested the two extreme cases of the first image directly. In each seed's shuffled test stream, we calibrated every class once on its first normal image and once on its first anomalous image, and then scored the whole stream as usual.

Dataset Calibration image P-AUROC PRO I-AUROC I-AP
MVTec-AD First image (default) 94.91 ± 0.20 / 0.47 87.30 ± 0.47 / 0.66 94.44 ± 0.32 / 0.69 97.35 ± 0.21 / 0.48
Normal 94.92 ± 0.14 / 0.50 87.41 ± 0.28 / 0.52 94.40 ± 0.33 / 0.65 97.34 ± 0.23 / 0.48
Anomalous 94.91 ± 0.20 / 0.47 87.28 ± 0.47 / 0.66 94.41 ± 0.33 / 0.69 97.33 ± 0.22 / 0.49
VisA First image (default) 95.32 ± 0.10 / 0.19 86.16 ± 0.04 / 0.26 85.29 ± 0.16 / 0.33 86.98 ± 0.11 / 0.27
Normal 95.25 ± 0.11 / 0.19 86.08 ± 0.09 / 0.25 85.25 ± 0.20 / 0.38 86.96 ± 0.14 / 0.31
Anomalous 95.33 ± 0.11 / 0.16 86.19 ± 0.09 / 0.25 85.31 ± 0.16 / 0.30 87.00 ± 0.10 / 0.23

In both cases, all metrics stay within 0.15 points of the default. Eq. (7) averages prototype contrast over all patches of the calibration image. Even in an anomalous image, most patches are normal, so defects barely affect which directions are selected.

Revision: The calibration-image comparison is added as Table 13 (Appendix E.8) and referenced in the ablation study (Sec. 4.3).

Reviewer R6mYOpenReview ↗
Rating
3/4
Confidence
4/4
Soundness
2/3
Presentation
3/3
Informativeness
2/3
Read review
Summary

The paper presents a training-free, zero-shot anomaly detection approach for CLIP, which specifically leverages CLIP's visual projector to extract anomaly patch-level representations.

The authors propose to extract patch level information from selected CLIP visual encoder layers by using CLIP's visual projector on their respective patch tokens and by applying thin SVD to retain more important directions. Then, they propose to invert the polarity of the projector, as they empirically find that normal-abnormal scores tend to be inverted. Finally, they inversely reweight the most important directions to balance their contributions, and they use a single-image calibration step to recover lower-energy directions useful for the task. The resulting per-layer anomaly scores obtained by using the calibrated projectors on the selected layers' patch tokens are then aggregated to get both localized and global anomaly scores.

Authors also propose an additional online inference mode that leverages RareCLIP (a prior work) to build a memory from previous images to better identify anomalies.

Strengths
  1. The paper is overall well written and easy to read.

  2. The fact that CLIP’s pretrained projection alone contains useful information for localized anomaly detection appears both novel and useful to me, as avoiding to tune different model components and just leveraging one can be useful for practical applications.

  3. The empirical finding of the need for polarity inversion is very interesting and may motivate further research using this approach, in the context of anomaly detection.

  4. The proposed method is training-free. Still, its performance is competitive with methods that require auxiliary training labeled data, which is also a very practical strong point.

Weaknesses
  1. The finding of needing polarity inversion is quite important in the paper, but it is supported only empirically and lacks a principled or intuitive explanation. Since this operation is core to the proposed method, the authors should explain better why this happens.

  2. The analysis regarding the number of lower-energy directions to be scanned may also require more clarification: the authors set the percentage of these directions (pep_e) to 0.1, but if the recovery objective is reliable, there should be no need to limit their number. Also, in Figure 5, it seems that average performance across metrics is maximized at pp = 0.8, meaning that, when prp_r is set to 0.6 (the optimal hyperparameter used in the experiments), pep_e should be larger that 0.1 (the other optimal hyperparameter) if my understanding is correct.

Nonetheless, the aforementioned flaws are not major and do not compromise the overall quality of the approach, hence my judgement stays broadly positive.

Questions for the authors
  1. What motivates the polarity inversion beyond working well empirically? An intuitive explanation, not only based on results or observations, would better help clarify this point.
  2. Could the authors clarify why it is necessary to limit the number of lower-energy directions to be scanned? Why all the remaining directions cannot be swept using the Sep objective?
3 comments
Authors · CommentOpenReview ↗

Q1. Why is polarity inversion needed?

We appreciate this question. CLIP trains P\mathbf{P} only on the global [CLS] token to match image captions and never constrains individual patch tokens. As prior studies (CLIP Surgery, CLIP-AD) observed, projecting raw ViT patch tokens directly through P\mathbf{P} produces inverted similarity maps: for example, given an image of a cat, [CLS] has high cosine similarity to the prompt "cat", whereas the cat patches themselves get lower similarity to "cat" than background patches. While prior training-free works modify ViT attention layers to fix this inside the encoder, negating P\mathbf{P} directly flips the sign of every patch-to-text cosine similarity at the output without changing the encoder.

The same inversion occurs in anomaly detection, where each patch is scored by its cosine similarity to the "abnormal" prompt minus that to the "normal" prompt (Eq. (2)). Averaged over all test images of the 13 datasets with pixel masks, this difference under P\mathbf{P} is:

Similarity ("abnormal" − "normal") under P\mathbf{P} Layer 12 Layer 16 Layer 20 Layer 24
Normal patches −0.005 −0.004 −0.010 −0.003
Anomalous patches −0.012 −0.018 −0.027 −0.008

On all 13 datasets and in all four layers, anomalous patches score lower than normal ones under P\mathbf{P}. Under −P-\mathbf{P}, every sign flips, so anomalous patches score higher than normal ones.

Revision: Added as Table 5 (Appendix D).

Q2. Why limit the number of scanned directions?

Thank you for your question. Scanning slightly further (ρe=0.2\rho_e=0.2) helps on both datasets (MVTec-AD, VisA), whereas scanning too far hurts (P-AUROC / PRO / I-AUROC / I-AP):

ρe\rho_e MVTec-AD VisA
0 (no recovery) 92.5 / 82.9 / 94.1 / 97.2 91.1 / 81.0 / 84.1 / 86.3
0.1 (default) 95.2 / 88.1 / 94.7 / 97.3 95.3 / 86.1 / 85.1 / 87.0
0.2 95.7 / 89.5 / 95.1 / 97.5 96.5 / 87.8 / 85.6 / 87.5
0.3 94.8 / 81.0 / 94.3 / 97.0 96.9 / 85.6 / 84.0 / 86.8
0.4 (all remaining) 92.3 / 69.1 / 93.0 / 96.5 95.7 / 77.9 / 82.3 / 85.4

Although every candidate uses the same selection rule, scanning too far into the tail hurts for two reasons:

  1. Label-free selection is imperfect, and tail candidates are weaker. Because Eq. (7) uses no anomaly labels, testing many extra tail candidates inevitably admits some false acceptances. As shown below, candidate quality peaks in the default window (ρe=0.1\rho_e=0.1, directions 461–536), where recovery clearly separates helpful directions from harmful ones, but drops back in the remaining tail (537–768).
  2. Inverse weighting (1/σk1/\sigma_k) amplifies false acceptances in the tail. While σk\sigma_k stays moderate across the default window, it shrinks toward zero in the tail. Because each accepted direction is weighted by 1/σk1/\sigma_k, tail directions receive disproportionately large weights, so even a few false acceptances heavily distort the operator. Conversely, under CLIP's original weights σk\sigma_k, directions with near-zero σk\sigma_k would barely affect the operator.

We verify both points across all test images of the 13 datasets with pixel masks by projecting every patch feature onto each of the 768 singular directions of P\mathbf{P} alone, using the response as the anomaly score, and computing patch AUROC:

Role in 0-CLIP Directions of P\mathbf{P} Count σk\sigma_k range Single-direction AUROC Directions with AUROC > 50
Retained (ρr=0.6\rho_r=0.6) 1–460 460 1.24–0.47 51.2 53%
Candidate pool (ρe=0.1\rho_e=0.1) 461–536 (all, before recovery) 76 0.46–0.44 54.1 59%
↳ Recovered Selected from 461–536 42 (avg.) 0.46–0.44 59.5 71%
↳ Rejected Excluded from 461–536 34 (avg.) 0.46–0.44 47.5 44%
Unused tail (ρe>0.1\rho_e > 0.1) 537–768 232 0.44–0.00 51.8 53%

We therefore use a single conservative default (ρe=0.1\rho_e=0.1) across all 15 datasets without per-dataset tuning.

Revision: The single-direction analysis is added as Table 9 (Appendix E.4).


Reviewer R6mY · CommentOpenReview ↗

Response to the Authors

Thank you for the detailed response and for the new results. The new analysis on pep_e mostly addresses my concern on limiting the number of scanned directions.

However, my main concern about providing an explanation about the need of polarity inversion stays mostly unresolved.

I understand that CLIP is not trained to align the individual patch tokens with text embeddings. However, I still lack an explanation about why this particularly results into an inversion. Why should CLIP specifically produce inverted scores, and not just noisy, non-inverted scores for instance? The authors did not answer this question.

For this reason, I am keeping my score of Weak Acceptance.

Authors · CommentOpenReview ↗

Thank you for the follow-up. Below is a small experiment that points to a possible cause.

The global ([CLS]) token gets all of its image content as an attention-weighted sum of the patch tokens' attention readouts, i.e., the patch tokens passed through the layer's value and output projections. A patch token and its readout in the next layer have negative cosine similarity for over 98% of patches in every setting (mean −0.23 to −0.51). As no attention layer follows the last layer, layer 23 replaces 24 (11 replaces 12 for ViT-B/16):

Backbone Dataset Layers 1st 2nd 3rd 4th
ViT-L/14-336 (paper) MVTec-AD 12/16/20/23 99.6% (−0.51) 99.5% (−0.28) 99.4% (−0.37) 100.0% (−0.37)
ViT-L/14-336 (paper) VisA 12/16/20/23 99.6% (−0.51) 99.5% (−0.28) 99.5% (−0.37) 100.0% (−0.38)
ViT-B/16 MVTec-AD 6/8/10/11 100.0% (−0.38) 99.2% (−0.24) 99.3% (−0.28) 98.2% (−0.39)
ViT-B/16 VisA 6/8/10/11 100.0% (−0.38) 99.2% (−0.23) 99.2% (−0.28) 98.2% (−0.40)

The global token thus receives patch content with a largely reversed sign. Because P\mathbf{P} is trained only on the global token, it is fitted to this reversed content; applied directly to patch tokens, it would then give inverted rather than random scores.

Consistent with this, feeding the attention readouts instead of the patch tokens to the original +P+\mathbf{P} removes the inversion: P-AUROC rises from 14.4 / 15.9 (Table 3(a)) to 85.6 / 85.5 on MVTec-AD / VisA. It still trails −P-\mathbf{P} on patch tokens, however (both without truncation or recovery; P-AUROC / PRO / I-AUROC / I-AP):

Operator MVTec-AD VisA
−P-\mathbf{P} on patch tokens (Table 3(a)) 85.7 / 84.2 / 92.7 / 96.7 84.1 / 79.3 / 84.2 / 86.7
+P+\mathbf{P} on attention readouts 85.6 / 72.6 / 83.0 / 92.2 85.5 / 66.7 / 73.3 / 77.3

P-AUROC is similar, but PRO drops by about 12 points and the image-level metrics also drop, possibly because the readout, being a transformed patch token, loses part of the patch's local information.

Why CLIP's value and output projections produce readouts with negative cosine to the patch tokens remains unclear, we leave this to future work.

Reviewer XUknOpenReview ↗
Rating
3/4(+1)
Confidence
3/4
Soundness
2/3
Presentation
2/3
Informativeness
2/3
Read review
Summary

The authors argue that existing CLIP-based zero-shot anomaly detection methods often rely on auxiliary training data for patch-level alignment, which can limit generalization to unseen domains.They claim that CLIP's frozen visual projector already contains anomaly-relevant information that can be exploited without additional training. To this end, they propose 0-CLIP, which constructs a patch-to-text anomaly operator through polarity reversal, singular-direction re-weighting, and selective direction recovery using an unlabeled test image.

Strengths

Training-free approach with broad empirical evaluation.

The paper presents a training-free approach that constructs an anomaly detection operator from CLIP's frozen projector using spectral decomposition. It demonstrates promising results across diverse industrial and medical benchmarks, although the comparison with relevant state-of-the-art methods could be more comprehensive.

Weaknesses

1. Limited Explanation of the Spectral Transformation.

The proposed spectral transformations achieve promising results, and Table 3 provides useful ablations. However, the relationship between the projector's singular directions and anomaly-relevant information remains insufficiently explained. In particular, it is unclear why inverse singular-value weighting should consistently improve anomaly discrimination rather than amplify directions containing irrelevant variation. A more direct analysis of the selected directions and their responses to normal and anomalous patches would strengthen the conceptual justification of the method.

2. Insufficient justification of the direction-recovery objective.

The direction-recovery criterion in Eq. (7) maximizes the average abnormal–normal text similarity margin over patches from a single unlabeled calibration image. However, increasing this margin does not necessarily improve the separation between normal and anomalous patches, particularly when the calibration image contains only normal regions.

Although Table 3(c) compares alternative objectives and demonstrates the empirical benefit of the proposed criterion, it remains unclear how the recovered directions depend on the anomaly content of the calibration image. An analysis separating normal-only and anomaly-containing calibration images would help establish the reliability of this design choice.

Additional concern (Reference accuracy).

Some references contain incorrect paper titles. For example, DRAEM (Zavrtanik et al., 2021) is cited with "Reconstruction Model" instead of "Reconstruction Embedding." Additionally, some papers are cited as arXiv preprints despite having been formally published, suggesting that the bibliographic information could be updated.

Questions for the authors

1. Interpretation of the Spectral Directions. Could the authors explain why inverse singular-value weighting improves anomaly discrimination? In particular, how do the retained and recovered directions differ in their responses to normal and anomalous patches?

2. Reliability of Unlabeled Calibration. How sensitive is the direction-recovery procedure to whether the first unlabeled calibration image is normal or anomalous? Could the authors report the performance separately for these two conditions?

3. Evaluation of Small Anomalies. Could the authors additionally report pixel-level AUPR and F1-max? Given the patch-based nature of CLIP features, these metrics would help assess fine-grained localization performance, particularly for small anomalies where false positives may significantly affect precision.

Minor comments on presentation.

Some figures could benefit from clearer explanations and annotations. In particular, Figure 1 could more clearly distinguish the training and inference procedures of the compared methods. Figures 3 and 4 would also benefit from more explicit descriptions of the text anchors, heatmap colors, and plot axes to improve readability.

4 comments
Authors · CommentOpenReview ↗

W1/Q1. Why does 1/σk1/\sigma_k help, and how do retained and recovered directions respond to normal and anomalous patches?

Thank you for this question. In short, σk\sigma_k measures how strongly CLIP uses a direction for global image–caption matching, not how useful it is for anomaly detection:

  • Why 1/σk1/\sigma_k helps: In P\mathbf{P}, the top 5% of directions (1–38) carry the largest weights σk\sigma_k yet slightly hurt detection (mean AUROC < 50), whereas the remaining retained directions (39–460) help on average. Replacing σk\sigma_k with 1/σk1/\sigma_k downweights this harmful leading group and upweights the helpful remainder. Because we already drop the tail where σk\sigma_k is near zero, 1/σk1/\sigma_k stays moderate and does not amplify noise.
  • Retained vs. recovered: Recovered directions (from 461–536) separate normal and anomalous patches much more clearly than retained ones, and recovery filters out candidates that hurt detection.

We verify both points first per direction on all test images of the 13 datasets with pixel masks, and then as a combined operator on MVTec-AD and VisA.

1. Individual directions. For each of the 768 singular directions of P\mathbf{P}, we score patches by their projection onto that direction alone and compute patch AUROC:

Role in 0-CLIP Directions of P\mathbf{P} Count σk\sigma_k range Single-direction AUROC Directions with AUROC > 50
Retained (top 5%) 1–8 8 1.24–0.65 48.8 46%
Retained (top 5%) 9–38 30 0.64–0.60 48.9 48%
Retained (rest) 39–76 38 0.60–0.58 51.3 52%
Retained (rest) 77–230 154 0.58–0.53 51.4 53%
Retained (rest) 231–460 230 0.53–0.47 51.5 53%
Candidate pool 461–536 (all, before recovery) 76 0.46–0.44 54.1 59%
↳ Recovered Selected from 461–536 42 (avg.) 0.46–0.44 59.5 71%
↳ Rejected Excluded from 461–536 34 (avg.) 0.46–0.44 47.5 44%
Unused tail 537–768 232 0.44–0.00 51.8 53%

Grouping all 768 directions into 12 equal bins shows the overall trend across the spectrum:

Directions 1–64 65–128 129–192 193–256 257–320 321–384 385–448 449–512 513–576 577–640 641–704 705–768
σk\sigma_k 1.24–0.58 0.58–0.56 0.56–0.54 0.54–0.52 0.52–0.50 0.50–0.49 0.49–0.47 0.47–0.45 0.45–0.42 0.42–0.08 0.07–0.02 0.02–0.00
Mean AUROC 49.8 50.6 52.1 50.6 51.8 51.8 52.2 53.1 51.4 51.7 52.5 52.7

This confirms both points: among retained directions, only the top 5% average below 50; recovered directions score well above retained ones, whereas rejected candidates fall below chance.

2. Combined operator. We then combine directions into a single operator as in 0-CLIP, varying only the direction set or weights (P-AUROC / PRO on MVTec-AD and VisA, seed 0):

Direction set Weights MVTec-AD VisA
Retained + recovered σk\sigma_k 94.0 / 84.9 91.7 / 82.0
Retained + recovered equal 94.8 / 87.1 93.9 / 84.4
Retained + recovered (0-CLIP) 1/σk1/\sigma_k 95.2 / 87.8 95.4 / 86.2
↳ drop top 5% σk\sigma_k 95.1 / 87.4 94.1 / 84.0
↳ drop top 5% 1/σk1/\sigma_k 95.4 / 88.0 96.3 / 86.9
Retained only 1/σk1/\sigma_k 92.5 / 82.9 91.1 / 81.0
Retained + random* 1/σk1/\sigma_k 93.6 / 85.6 92.6 / 83.0
Retained + rejected 1/σk1/\sigma_k 89.2 / 79.8 83.1 / 75.5

*Count-matched from 461–536.

  • Downweighting the harmful leading group: Under σk\sigma_k weights, dropping the top 5% brings a large gain, confirming that these dominant directions drag the operator down. Rather than adding a separate cutoff hyperparameter, 1/σk1/\sigma_k achieves an even larger gain smoothly.
  • Upweighting the helpful remainder: Even without the top 5%, 1/σk1/\sigma_k still beats σk\sigma_k on both metrics by giving larger weights to the more informative lower-σk\sigma_k directions. Together, the two effects explain the steady gain across σk→equal→1/σk\sigma_k \to \text{equal} \to 1/\sigma_k (consistent with Table 3(b)).
  • Effect of recovery: Adding recovered directions substantially improves over retained ones alone and beats count-matched random candidates, whereas adding rejected ones hurts.

In summary, 0-CLIP turns CLIP's P\mathbf{P} into an effective anomaly operator by combining many weak directions: 1/σk1/\sigma_k rebalances the spectrum and recovery adds informative ones from a single unlabeled image, with no masks or training.

Revision: Sec. 4.3 now states this conclusion, with the single-direction and combined-operator results in Table 9 (Appendix E.4).


Authors · CommentOpenReview ↗

W2/Q2. Does recovery depend on whether the calibration image is normal or anomalous?

Thank you. It doesn't. In each seed's shuffled test stream, we calibrated every class once on its first normal image and once on its first anomalous image, then scored the entire stream as usual (5 seeds mean):

Dataset Calibration image P-AUROC PRO I-AUROC I-AP
MVTec-AD First image (default) 94.91±0.20 87.30±0.47 94.44±0.32 97.35±0.21
MVTec-AD Normal 94.92±0.14 87.41±0.28 94.40±0.33 97.34±0.23
MVTec-AD Anomalous 94.91±0.20 87.28±0.47 94.41±0.33 97.33±0.22
VisA First image (default) 95.32±0.10 86.16±0.04 85.29±0.16 86.98±0.11
VisA Normal 95.25±0.11 86.08±0.09 85.25±0.20 86.96±0.14
VisA Anomalous 95.33±0.11 86.19±0.09 85.31±0.16 87.00±0.10

Recovery keeps a candidate direction only if adding it raises the calibration patches' average cosine margin between the abnormal and normal prompts (Eq. (7)). Even on a normal image, directions carrying irrelevant variation or the wrong polarity reduce this cosine margin and get filtered out, matching W1 where recovered directions reach 59.5% AUROC versus 47.5% for rejected ones. Moreover, because this margin averages over all patches and most patches are normal even in an anomalous image, defects barely affect which directions are selected.

Revision: Added as Table 13 (Appendix E.8) and referenced in the ablation study (Sec. 4.3).


Q3. Pixel AUPR and F1-max.

Thank you for the suggestion. Below are pixel AUPR / F1-max (%) across all 13 datasets with pixel masks (†^\dagger online; ‡^\ddagger labeled memory bank):

Dataset AnomCLIP AA-CLIP RareCLIP$^\dagger$ MRAD$^\ddagger$ FB-CLIP WinCLIP 0-CLIP 0-CLIP$^\dagger$
MVTec-AD 34.5 / 39.1 46.9 / 47.9 66.6 / 64.6 43.3 / 45.3 44.6 / 46.0 18.1 / 24.9 41.8 / 47.1 65.7 / 64.0
VisA 21.3 / 28.3 23.9 / 29.0 47.4 / 51.0 25.6 / 32.1 28.4 / 35.4 5.4 / 9.1 23.6 / 30.4 47.0 / 50.7
BTAD 45.5 / 49.7 52.5 / 54.8 63.2 / 61.5 43.7 / 47.7 46.5 / 50.8 8.4 / 12.7 47.9 / 52.6 63.7 / 62.1
MPDD 28.9 / 34.2 26.4 / 28.5 36.1 / 38.0 34.8 / 39.3 30.5 / 33.9 13.4 / 15.0 27.4 / 34.0 34.0 / 36.0
DTD-Syn 63.8 / 63.1 62.5 / 61.0 79.8 / 74.6 62.3 / 61.7 63.8 / 60.8 15.9 / 23.5 56.0 / 56.9 78.8 / 73.7
SDD 41.0 / 42.5 17.6 / 33.8 28.4 / 35.5 38.6 / 42.4 31.8 / 38.1 8.6 / 14.6 42.3 / 44.6 41.8 / 46.0
DAGM 56.5 / 58.9 55.2 / 56.9 59.9 / 60.5 53.7 / 55.8 55.0 / 55.7 8.3 / 15.0 60.7 / 62.0 68.6 / 67.6
KSDD2 57.0 / 59.8 63.8 / 63.1 68.1 / 66.4 60.8 / 60.8 66.3 / 65.3 15.5 / 23.6 44.9 / 52.8 67.0 / 66.0
Real-IAD 28.0 / 35.3 29.8 / 35.4 33.0 / 39.3 26.5 / 33.8 28.3 / 34.3 3.5 / 8.1 26.0 / 33.7 33.7 / 40.3
Liver CT 3.6 / 6.9 11.1 / 20.3 6.9 / 13.2 5.7 / 10.5 7.4 / 13.6 6.1 / 12.8 4.5 / 8.8 7.0 / 13.7
Brain MRI 57.1 / 53.1 41.9 / 43.2 43.1 / 52.0 53.5 / 50.7 51.4 / 49.6 11.9 / 20.3 31.1 / 36.7 41.6 / 51.8
Retina RESC 48.4 / 47.1 64.6 / 58.4 59.9 / 55.7 46.2 / 44.6 51.8 / 48.7 17.1 / 24.5 22.5 / 28.3 54.7 / 52.7
TN3K 45.7 / 47.8 36.5 / 41.5 40.0 / 45.4 42.3 / 43.7 39.0 / 42.2 22.8 / 32.0 36.4 / 42.6 34.9 / 41.5
Average 40.9 / 43.5 41.0 / 44.1 48.6 / 50.6 41.3 / 43.7 41.9 / 44.2 11.9 / 18.1 35.8 / 40.8 49.1 / 51.2

Overall, 0-CLIP$^\dagger$ achieves the highest average AUPR and F1-max (49.1 / 51.2), while offline 0-CLIP triples training-free WinCLIP in AUPR (35.8 vs. 11.9). Together with its high PRO (82.6, Table 1), offline 0-CLIP recalls small defects well, while its lower AUPR comes from mild background responses that supervised baselines suppress with ground-truth mask training and 0-CLIP$^\dagger$ suppresses with unlabeled online rarity.

Revision: Added as Table 7 (Appendix E.2) and referenced in Sec. 4.2.


Figures & References.

Thank you for the careful reading. Revision:

  • Fig. 1: Clearly separates training from inference.
  • Fig. 3: Explicitly defines ta\mathbf{t}_a in the caption as the averaged CLIP text embedding of the "abnormal" prompts.
  • Fig. 4: Added a colorbar and y-axis.
  • References: Corrected the DRAEM title and updated arXiv preprints to their published venue versions.

Reviewer XUkn · CommentOpenReview ↗

Thank you for the detailed rebuttal and additional experiments. My main concerns have been partially addressed, so I have updated my recommendation to Weak Accept.

A few concerns remain:

  1. I agree with R6mY that the necessity of polarity inversion remains insufficiently explained.
  2. It would be helpful to include category-wise quantitative results.
  3. Although Figure 4 has been revised, it remains difficult to read without substantial zooming (around 500%). Further improvements would enhance the presentation.
Authors · CommentOpenReview ↗

Thank you for reading our rebuttal carefully. Below we address the remaining points:

1. Necessity of polarity inversion.

As we also shared in our follow-up response to Reviewer R6mY, below is a small experiment that points to a possible cause.

The global ([CLS]) token gets all of its image content as an attention-weighted sum of the patch tokens' attention readouts, i.e., the patch tokens passed through the layer's value and output projections. A patch token and its readout in the next layer have negative cosine similarity for over 98% of patches in every setting (mean −0.23 to −0.51). As no attention layer follows the last layer, layer 23 replaces 24 (11 replaces 12 for ViT-B/16):

Backbone Dataset Layers 1st 2nd 3rd 4th
ViT-L/14-336 (paper) MVTec-AD 12/16/20/23 99.6% (−0.51) 99.5% (−0.28) 99.4% (−0.37) 100.0% (−0.37)
ViT-L/14-336 (paper) VisA 12/16/20/23 99.6% (−0.51) 99.5% (−0.28) 99.5% (−0.37) 100.0% (−0.38)
ViT-B/16 MVTec-AD 6/8/10/11 100.0% (−0.38) 99.2% (−0.24) 99.3% (−0.28) 98.2% (−0.39)
ViT-B/16 VisA 6/8/10/11 100.0% (−0.38) 99.2% (−0.23) 99.2% (−0.28) 98.2% (−0.40)

The global token thus receives patch content with a largely reversed sign. Because P\mathbf{P} is trained only on the global token, it is fitted to this reversed content; applied directly to patch tokens, it would then give inverted rather than random scores.

Consistent with this, feeding the attention readouts instead of the patch tokens to the original +P+\mathbf{P} removes the inversion: P-AUROC rises from 14.4 / 15.9 (Table 3(a)) to 85.6 / 85.5 on MVTec-AD / VisA. It still trails −P-\mathbf{P} on patch tokens, however (both without truncation or recovery; P-AUROC / PRO / I-AUROC / I-AP):

Operator MVTec-AD VisA
−P-\mathbf{P} on patch tokens (Table 3(a)) 85.7 / 84.2 / 92.7 / 96.7 84.1 / 79.3 / 84.2 / 86.7
+P+\mathbf{P} on attention readouts 85.6 / 72.6 / 83.0 / 92.2 85.5 / 66.7 / 73.3 / 77.3

P-AUROC is similar, but PRO drops by about 12 points and the image-level metrics also drop, possibly because the readout, being a transformed patch token, loses part of the patch's local information.

Why CLIP's value and output projections produce readouts with negative cosine to the patch tokens remains unclear, we leave this to future work.

2. Category-wise quantitative results.

Thank you for the suggestion. We have added the five-seed per-category results (mean ± std across P-AUROC, PRO, I-AUROC, and I-AP for both offline 0-CLIP and online 0-CLIP$^\dagger$) on MVTec-AD (Table 14) and VisA (Table 15) in Appendix E.9 of the revised manuscript.

3. Readability of Figure 4.

Thank you for pointing this out. We have further simplified Figure 4 in the revised manuscript by keeping a single visual example in the top row, making the anomaly maps, colorbar, and plot labels readable at normal viewing scale.

Comments on the paper

1 comment
Authors · CommentOpenReview ↗

Dear Reviewers, ACs, SACs and PCs,

We sincerely appreciate the time and effort you have dedicated to reviewing and handling our manuscript, and we thank the ICLR 2027 Program Committee for organizing the review process.

We propose 0-CLIP, which turns CLIP's frozen visual projector directly into patch-to-text operators for zero-shot anomaly detection via polarity reversal, spectral reweighting, and single-image calibration. As the reviewers highlighted, the paper is well-written and easy to follow (R2, R3), leveraging the frozen projector alone is novel and useful (R2), and the method is simple (R3), training-free (R1, R2), competitive with auxiliary-trained methods (R2), and broadly evaluated across industrial and medical benchmarks (R1, R3).

We greatly appreciate your constructive feedback. In response, we have carefully revised the manuscript as follows (with new results in the appendix and brief pointers in the main text):

  • Spectral directions (R1, R2). A single-direction analysis on 13 datasets and a combined-operator analysis on MVTec-AD and VisA explain why 1/σk1/\sigma_k weighting and direction recovery help, and why the scan range is limited (Table 9, Appendix E.4; Sec. 4.3).
  • Polarity inversion (R2). Under CLIP's original P\mathbf{P}, anomalous patches have a lower mean prototype margin than normal ones on all 13 datasets and four layers (Table 5, Appendix D).
  • Calibration image (R1, R3). Calibrating on a normal or an anomalous image changes all metrics on MVTec-AD and VisA by less than 0.15 points (Table 13, Appendix E.8; Sec. 4.3).
  • ReMem (R3). Comparison on 15 datasets, where 0-CLIP$^\dagger$ is higher on average (Table 8, Appendix E.3).
  • Pixel AUPR and F1-max (R1). Results on 13 datasets (Table 7, Appendix E.2; Sec. 4.2).
  • AdaCLIP (R3). Applying our construction to its trained patch heads lowers performance, as they already have the correct polarity (Table 11, Appendix E.6; Sec. 5).
  • Clarifications. Per-layer operators in Sec. 3.1 (R3); AnomalyVFM, VisualAD and FoundAD in the Introduction (R3); clearer Figs. 1, 3 and 4 (R1); corrected references (R1, R3).

We sincerely hope these updates address your concerns and help better convey the findings of 0-CLIP to the ICLR community. We look forward to further discussion.

Thank you very much,
The Authors


From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Missing a submission?

Loading the discussion…

This paper is under review