REVIEW 3 major objections 5 minor 60 references
Learning to Detect Multi-class Anomalies with Just One Normal Image Prompt
T0 review · 3 major / 5 minor · reviewed 2026-08-15 · deepseek-v4-flash
Pith's one-line read A unified anomaly detector that uses one normal image per class as a visual prompt reports large gains over prior multi-class models on three industrial benchmarks.
desk verdict Strong gains on unified anomaly detection, but the test-time prompt selection is unmeasured and could be an oracle; deserves a serious referee. read the letter →
The pith
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
The reading
What carries the argument
The load-bearing object is the normal image prompt paired with a bidirectional cross-attention decoder. For a target feature $x_d^i$ and a prompt feature $p_d^i$, each decoder block first updates the prompt as $p_d^{i+1} = \operatorname{softmax}(p_d^i x_d^{i\top}/\sqrt{c}) x_d^i$ and then updates the target as $x_d^{i+1} = \operatorname{softmax}(x_d^i p_d^{i+1\top}/\sqrt{c}) p_d^{i+1}$, so neither side stays static. This machinery lets the reconstruction use context from within the target and global structure from a reference normal image. The restoration stream uses the same decoder to map pseudo-anomaly features (generated by CutPaste and DRAEM corruptions) back to the normal features, and the supervised refiner upsamples the absolute reconstruction error with transposed convolutions under a Dice loss.
What would settle it
Run OneNIP on a dataset whose classes share similar geometry, or deliberately supply a wrong-class normal prompt (as in the paper's MetaNut-for-Screw experiment) and measure the drop in I-ROC and P-PR; the paper's own Table 4d shows the drop it expects, so a configuration where performance stays high under wrong-prompt assignment would contradict the central claim.
Extended reading notes
Core claim
OneNIP claims that to reconstruct normal features under a unified multi-class model, the reconstruction should be guided by a normal image prompt, not just by the target feature's own context. The central discovery is that replacing the learned query embedding of a reconstruction transformer with features from a single normal image, and letting both prompt and target features update each other through bidirectional cross-attention, avoids the identity shortcut and enables detection of both ordinary and camouflaged anomalies. Adding a restoration objective on pseudo-anomalies and a supervised refiner that regresses reconstruction errors from 1/16 to 1/4 resolution brings pixel-level precision-recall to 63.7% on MVTec, 56.8% on BTAD, and 43.3% on VisA under the one-model-for-all-classes protocol.
Load-bearing premise
The one load-bearing premise is that a single normal image per class, selected at test time by cosine similarity, provides enough reference information and that the class of the test image is correctly identified; the paper shows that using a wrong prompt collapses pixel-level precision-recall from 39.8% to 2.3% for the Screw class.
Editorial extensions
If this is right
- One model trained on all classes can improve pixel-level precision-recall on MVTec from 44.7% to 63.7%, and on a merged 30-class dataset from 39.1% to 52.4%.
- OneNIP reaches a given performance level in far fewer training epochs than the prior unified baseline, so the prompt and refiner speed convergence.
- The restoration stream is removed at inference, meaning deployment cost stays close to the base reconstruction model plus a small refiner.
- Anomaly localization becomes accurate enough to catch camouflaged defects where the abnormal region blends into its context.
Reading between the lines
- The per-class prompt pool can be extended at test time without retraining, so adding a new product class may reduce to supplying one normal reference image; the paper does not test this continual-class scenario.
- Because the refiner is trained on synthetic anomalies such as CutPaste and DRAEM corruptions, its localization gains are likely to be largest for defects that resemble those corruptions, and other defect types may not benefit as much.
- The cosine-similarity prompt selection is a classifier-like step inside an otherwise unsupervised pipeline; a natural extension is to measure how many reference images per class are needed to keep selection robust under pose, lighting, or surface variation.
Signed reviews
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper proposes OneNIP, a unified (single-model, multi-class) anomaly detection method that uses one normal image as a visual prompt to guide transformer-based feature reconstruction and restoration, and adds a lightweight supervised refiner for pixel-level segmentation. The method is evaluated on MVTec, BTAD, and VisA under the unified setting, reporting substantial improvements over UniAD, e.g., pixel-level P-PR from 44.7% to 63.7% on MVTec. The paper includes ablations of the prompt mechanism, restoration stream, refiner, and several hyperparameters, and the authors state that code and models will be released.
Significance. If the reported results hold, OneNIP represents a meaningful advance in unified anomaly detection, roughly doubling the pixel-level P-PR of the prior state-of-the-art on MVTec and improving all three benchmarks. The ablation study is thorough and clearly attributes the gains to each component, and the implementation details are specific enough to be reproduced from the text. The central novelty, using a normal image as a dynamic visual prompt, is well motivated by predictive coding and is shown to accelerate convergence. However, the paper's main claim rests on an unmeasured test-time prompt selection mechanism and on hyperparameters that appear to be tuned on the test set, which limits the current evidence for the reported state-of-the-art numbers.
major comments (3)
- [Sec. 3.5, Eq. (10)] The paper never reports the accuracy of the test-time cosine-similarity prompt selection, nor does it state whether the results in Table 1 were obtained with automatic selection or with ground-truth class labels. Because Table 4d shows that feeding a MetaNut prompt to Screw images collapses P-PR from 39.8% to 2.3%, the claimed state-of-the-art gains rest on an unmeasured component; please report selection accuracy, a confusion matrix, and results with automatic selection.
- [Sec. 4.3, Eq. (8), Eq. (10), Table 4c] The fusion weight α is selected by evaluating on the test set: Table 4c shows P-PR varies from 48.3% (α=0) to 63.7% (α=0.5), yet no validation protocol is described, and λ in Eq. (8) is fixed at 0.5 without sensitivity analysis. Please specify how these hyperparameters are chosen and provide results with a validation-based selection or an analysis over a range of values.
- [Tables 1-3 and Table 4d] The main comparisons in Tables 1-3 are single runs without error bars, while Table 4d reports standard deviations for the proposed method over 10 random seeds (e.g., P-PR 63.71±0.01). Given that prompt sampling at training and testing is random, please report mean±std over multiple seeds for the main tables, at least for OneNIP, so that the reader can assess the stability of the claimed improvements.
minor comments (5)
- [Sec. 5 (Limitation)] The limitation paragraph refers to 'OneIP' instead of 'OneNIP'; please correct the typo.
- [Sec. 4.3] In the discussion of prompt modes, 'Srew' should be 'Screw'.
- [Related Work] Reference [58] is cited as 'omniNAL' in the text but the reference entry lists 'OmniAL'; please make the citation consistent.
- [Table 4a caption] The abbreviations 'Res.' and 'Ref.' in the table header are not expanded in the caption; please define them as 'Restoration' and 'Refiner'.
- [Abstract] The phrase 'for the first time to reconstruct or restore anomalies with just one normal image prompt' is a strong claim; please soften it or state precisely what is meant (e.g., 'to our knowledge, the first' in a limited scope).
Circularity Check
No significant circularity found: the training objectives and final anomaly score are not derived from their own outputs or from the reported test results.
full rationale
The derivation chain is self-contained and does not reduce to its own inputs. The reconstruction loss (Eq. 4), restoration loss (Eq. 5), and segmentation loss (Eq. 7) are computed against normal training features, pseudo-anomaly features synthesized from normal training images, and synthetic pixel-level masks; none of these quantities are constructed from the reported test metrics or from ground-truth test labels. The final anomaly score in Eq. 10 is a fixed weighted combination of the reconstruction error map and the supervised refiner output, and the weights are selected by ablation rather than fitted to the benchmark numbers. The test-time prompt selection in Sec. 3.5 builds a prompt pool from normal training images and chooses a prompt by cosine similarity with the test feature; it does not use the test class label, and the paper explicitly reports the failure mode of an incorrect prompt in Table 4d, disclosing the fragility rather than hiding it. There are no load-bearing self-citations, no uniqueness theorem imported from the authors' prior work, and no equation that is equal to another by construction. The possible concerns about prompt-selection accuracy, hyperparameter tuning, and the use of synthetic anomalies are empirical robustness or generalization issues, not circularity.
Assumptions & free parameters
free parameters (2)
- alpha (fusion weight) =
0.5
- lambda (loss weight) =
0.5
assumptions (4)
- domain assumption Offline features from pre-trained EfficientNet-b4 contain sufficient discriminative information for anomaly detection.
- domain assumption Pseudo-anomalies generated by CutPaste and DRAEM, with probability 0.5, are representative enough of real anomalies for both restoration training and supervised refinement.
- domain assumption Reconstruction error is a valid anomaly score.
- domain assumption A single normal image prompt per class is representative and can be selected by cosine similarity at test time.
Cite this review
Pith. "Pith review of Learning to Detect Multi-class Anomalies with Just One Normal Image Prompt." pith.science (2026). https://pith.science/paper/U6TAUYGH
@misc{pith2026250509264,
author = {Pith},
title = {Pith review of: Learning to Detect Multi-class Anomalies with Just One Normal Image Prompt},
year = {2026},
howpublished = {\url{https://pith.science/paper/U6TAUYGH}},
note = {Machine review of arXiv:2505.09264}
}
read the original abstract
Unsupervised reconstruction networks using self-attention transformers have achieved state-of-the-art performance for multi-class (unified) anomaly detection with a single model. However, these self-attention reconstruction models primarily operate on target features, which may result in perfect reconstruction for both normal and anomaly features due to high consistency with context, leading to failure in detecting anomalies. Additionally, these models often produce inaccurate anomaly segmentation due to performing reconstruction in a low spatial resolution latent space. To enable reconstruction models enjoying high efficiency while enhancing their generalization for unified anomaly detection, we propose a simple yet effective method that reconstructs normal features and restores anomaly features with just One Normal Image Prompt (OneNIP). In contrast to previous work, OneNIP allows for the first time to reconstruct or restore anomalies with just one normal image prompt, effectively boosting unified anomaly detection performance. Furthermore, we propose a supervised refiner that regresses reconstruction errors by using both real normal and synthesized anomalous images, which significantly improves pixel-level anomaly segmentation. OneNIP outperforms previous methods on three industry anomaly detection benchmarks: MVTec, BTAD, and VisA. The code and pre-trained models are available at https://github.com/gaobb/OneNIP.
Figures
Reference graph
Works this paper leans on
-
[1]
Ahuja, N.A., Ndiour, I.J., Kalyanpur, T., Tickoo, O.: Probabilistic modeling of deep features for out-of-distribution and adversarial detection. In: NeurIPSW (2019)
work page 2019
-
[2]
Bengio, Y., Yao, L., Alain, G., Vincent, P.: Generalized denoising auto-encoders as generative models. In: NeurIPS (2013)
work page 2013
-
[3]
Bergmann,P.,Batzner,K.,Fauser,M.,Sattlegger,D.,Steger,C.:Beyonddentsand scratches: Logical constraints in unsupervised anomaly detection and localization. IJCV 130(4) (2022)
work page 2022
-
[4]
Bergmann, P., Fauser, M., Sattlegger, D., Steger, C.: MVTec AD: A comprehensive real-world dataset for unsupervised anomaly detection. In: CVPR (2019)
work page 2019
-
[5]
Bergmann, P., Fauser, M., Sattlegger, D., Steger, C.: Uninformed Students: Student-teacher anomaly detection with discriminative latent embeddings. In: CVPR (2020)
work page 2020
-
[6]
Bergmann, P., Löwe, S., Fauser, M., Sattlegger, D., Steger, C.: Improving unsu- pervised defect segmentation by applying structural similarity to autoencoders. In: VISIGRAPP (2019)
work page 2019
-
[7]
Cao, Y., Xu, X., Sun, C., Cheng, Y., Du, Z., Gao, L., Shen, W.: Segment any anomaly without training via hybrid prompt regularization. arXiv:2305.10724 (2023)
arXiv 2023
-
[8]
Chiu,L.L.,Lai,S.H.:Self-supervisednormalizingflowsforimageanomalydetection and localization. In: ICCV (2023)
work page 2023
Show all 60 references
-
[9]
In: ICML (2006)
Davis, J., Goadrich, M.: The relationship between precision-recall and roc curves. In: ICML (2006)
2006
-
[10]
In: ICPR (2021)
Defard, T., Setkov, A., Loesch, A., Audigier, R.: PaDim: A patch distribution modeling framework for anomaly detection and localization. In: ICPR (2021)
2021
-
[11]
In: CVPR (2022)
Deng, H., Li, X.: Anomaly detection via reverse distillation from one-class embedding. In: CVPR (2022)
2022
-
[12]
In: CVPR (2022)
Du, Y., Wei, F., Zhang, Z., Shi, M., Gao, Y., Li, G.: Learning to prompt for open- vocabulary object detection with vision-language model. In: CVPR (2022)
2022
-
[13]
In: CVPR (2021)
Georgescu, M.I., Barbalau, A., Ionescu, R.T., Khan, F.S., Popescu, M., Shah, M.: Anomaly detection in video via self-supervised and multi-task learning. In: CVPR (2021)
2021
-
[14]
In: ICCV (2019)
Gong, D., Liu, L., Le, V., Saha, B., Mansour, M.R., Venkatesh, S., Hengel, A.v.d.: Memorizing Normality to Detect Anomaly: Memory-augmented deep autoencoder for unsupervised anomaly detection. In: ICCV (2019)
2019
-
[15]
In: AAAI (2024)
Gu, Z., Zhu, B., Zhu, G., Chen, Y., Tang, M., Wang, J.: AnomalyGPT: detecting industrial anomalies using large vision-language models. In: AAAI (2024)
2024
-
[16]
In: ICCV (2021)
Hou, J., Zhang, Y., Zhong, Q., Xie, D., Pu, S., Zhou, H.: Divide-and-Assemble: Learning block-wise memory for unsupervised anomaly detection. In: ICCV (2021)
2021
-
[17]
In: CVPR (2024)
Huang, C., Jiang, A., Feng, J., Zhang, Y., Wang, X., Wang, Y.: Adapting visual- language models for generalizable anomaly detection in medical images. In: CVPR (2024)
2024
-
[18]
In: CVPR (2023)
Jeong, J., Zou, Y., Kim, T., Zhang, D., Ravichandran, A., Dabeer, O.: WinCLIP: Zero-/few-shot anomaly classification and segmentation. In: CVPR (2023)
2023
-
[19]
npj Digit
Kim, D.Y., Lee, S.J., Kim, E.K., Kang, E., Heo, C.Y., Jeong, J.H., Myung, Y., Kim, I.A., Jang, B.S.: Feasibility of anomaly score detected with deep learning in irradiated breast cancer patients with reconstruction. npj Digit. Med.5(1) (2022) 16 B.-B. Gao
2022
-
[20]
IEEE Access10 (2022)
Lee, S., Lee, S., Song, B.C.: CFA: Coupled-hypersphere-based feature adaptation for target-oriented anomaly localization. IEEE Access10 (2022)
2022
-
[21]
IEEE Access10 (2022)
Lee, Y., Kang, P.: AnoViT: Unsupervised anomaly detection and localization with vision transformer-based encoder-decoder. IEEE Access10 (2022)
2022
-
[22]
In: CVPR (2023)
Lei, J., Hu, X., Wang, Y., Liu, D.: PyramidFlow: High-resolution defect contrastive localization using pyramid normalizing flow. In: CVPR (2023)
2023
-
[23]
In: CVPR (2021)
Li, C.L., Sohn, K., Yoon, J., Pfister, T.: CutPaste: Self-supervised learning for anomaly detection and localization. In: CVPR (2021)
2021
-
[24]
In: CVPR (2023)
Liu, W., Chang, H., Ma, B., Shan, S., Chen, X.: Diversity-measurable anomaly detection. In: CVPR (2023)
2023
-
[25]
In: CVPR (2023)
Liu, Z., Zhou, Y., Xu, Y., Wang, Z.: SimpleNet: A simple network for image anomaly detection and localization. In: CVPR (2023)
2023
-
[26]
In: SIE (2021)
Mishra, P., Verk, R., Fornasier, D., Piciarelli, C., Foresti, G.L.: VT-ADL: A vision transformer network for image anomaly detection and localization. In: SIE (2021)
2021
-
[27]
In: ICLR (2023)
Mou, S., Gu, X., Cao, M., Bai, H., Huang, P., Shan, J., Shi, J.: RGI: Robust gan-inversion for mask-free image inpainting and unsupervised pixel-wise anomaly detection. In: ICLR (2023)
2023
-
[28]
In: CVPR (2020)
Park, H., Noh, J., Ham, B.: Learning memory-guided normality for anomaly detection. In: CVPR (2020)
2020
-
[29]
In: CVPR (2019)
Perera, P., Nallapati, R., Xiang, B.: OCGAN: One-class novelty detection using GANs with constrained latent representations. In: CVPR (2019)
2019
-
[30]
ACMSCG19(3) (2005)
Perlin, K.: An image synthesizer. ACMSCG19(3) (2005)
2005
-
[31]
In: ICML (2021)
Radford, A., Kim, J.W., Hallacy, C., Ramesh, A., Goh, G., Agarwal, S., Sastry, G., Askell, A., Mishkin, P., Clark, J., et al.: Learning transferable visual models from natural language supervision. In: ICML (2021)
2021
-
[32]
Nature Neuroscience 2(1) (1999)
Rao, R.P., Ballard, D.H.: Predictive coding in the visual cortex: a functional interpretation of some extra-classical receptive-field effects. Nature Neuroscience 2(1) (1999)
1999
-
[33]
In: CVPR (2021)
Reiss, T., Cohen, N., Bergman, L., Hoshen, Y.: PANDA: Adapting pretrained features for anomaly detection and segmentation. In: CVPR (2021)
2021
-
[34]
In: ICPR (2021)
Rippel, O., Mertens, P., Merhof, D.: Modeling the distribution of normal data in pretrained deep features for anomaly detection. In: ICPR (2021)
2021
-
[35]
In: CVPR (2022)
Ristea, N.C., Madan, N., Ionescu, R.T., Nasrollahi, K., Khan, F.S., Moeslund, T.B., Shah, M.: Self-supervised predictive convolutional attentive block for anomaly detection. In: CVPR (2022)
2022
-
[36]
In: CVPR (2022)
Rombach, R., Blattmann, A., Lorenz, D., Esser, P., Ommer, B.: High-resolution image synthesis with latent diffusion models. In: CVPR (2022)
2022
-
[37]
In: CVPR (2022)
Roth, K., Pemula, L., Zepeda, J., Schölkopf, B., Brox, T., Gehler, P.: Towards total recall in industrial anomaly detection. In: CVPR (2022)
2022
-
[38]
In: WACV (2022)
Rudolph, M., Wehrbein, T., Rosenhahn, B., Wandt, B.: Fully convolutional cross- scale-flows for image-based defect detection. In: WACV (2022)
2022
-
[39]
In: CVPR (2021)
Salehi, M., Sadjadi, N., Baselizadeh, S., Rohban, M.H., Rabiee, H.R.: Multiresolu- tion knowledge distillation for anomaly detection. In: CVPR (2021)
2021
-
[40]
In: CVPR (2018)
Sultani, W., Chen, C., Shah, M.: Real-world anomaly detection in surveillance videos. In: CVPR (2018)
2018
-
[41]
In: ICML (2019)
Tan, M., Le, Q.: EfficientNet: Rethinking model scaling for convolutional neural networks. In: ICML (2019)
2019
-
[42]
In: CVPR (2023) OneNIP 17
Tien, T.D., Nguyen, A.T., Tran, N.H., Huy, T.D., Duong, S., Nguyen, C.D.T., Truong, S.Q.: Revisiting reverse distillation for anomaly detection. In: CVPR (2023) OneNIP 17
2023
-
[43]
In: NeurIPS (2017)
Vaswani,A.,Shazeer,N.,Parmar,N.,Uszkoreit,J.,Jones,L.,Gomez,A.N.,Kaiser, Ł., Polosukhin, I.: Attention is all you need. In: NeurIPS (2017)
2017
-
[44]
In: ICML (2008)
Vincent, P., Larochelle, H., Bengio, Y., Manzagol, P.A.: Extracting and composing robust features with denoising autoencoders. In: ICML (2008)
2008
-
[45]
BMVC (2021)
Wang, G., Han, S., Ding, E., Huang, D.: Student-teacher feature pyramid matching for anomaly detection. BMVC (2021)
2021
-
[46]
In: CVPR (2021)
Wang, S., Wu, L., Cui, L., Shen, Y.: Glancing at the patch: Anomaly localization with global and local feature comparison. In: CVPR (2021)
2021
-
[47]
In: ICPR (2021)
Wei, Q., Li, X., Yu, W., Zhang, X., Zhang, Y., Hu, B., Mo, B., Gong, D., Chen, N., Ding, D., et al.: Learn to segment retinal lesions and beyond. In: ICPR (2021)
2021
-
[48]
In: CVPR (2023)
Xiang, T., Lu, Y., Yuille, A.L., Zhang, C., Cai, W., Zhou, Z.: SQUID: Deep feature in-painting for unsupervised anomaly detection. In: CVPR (2023)
2023
-
[49]
In: AAAI (2021)
Yan, X., Zhang, H., Xu, X., Hu, X., Heng, P.A.: Learning semantic context from normal samples for unsupervised anomaly detection. In: AAAI (2021)
2021
-
[50]
In: ICCV (2023)
Yao, X., Li, R., Qian, Z., Luo, Y., Zhang, C.: Focus the Discrepancy: Intra-and inter-correlation learning for image anomaly detection. In: ICCV (2023)
2023
-
[51]
In: CVPR
Yao, X., Li, R., Zhang, J., Sun, J., Zhang, C.: Explicit boundary guided semi- push-pull contrastive learning for supervised anomaly detection. In: CVPR. pp. 24490–24499 (2023)
2023
-
[52]
In: NeurIPS (2022)
You, Z., Cui, L., Shen, Y., Yang, K., Lu, X., Zheng, Y., Le, X.: A unified model for multi-class anomaly detection. In: NeurIPS (2022)
2022
-
[53]
In: CVPR (2020)
Zaheer, M.Z., Lee, J.h., Astrid, M., Lee, S.I.: Old is Gold: Redefining the adversarially learned one-class classifier training paradigm. In: CVPR (2020)
2020
-
[54]
In: ICCV (2021)
Zavrtanik, V., Kristan, M., Skočaj, D.: DRAEM: A discriminatively trained reconstruction embedding for surface anomaly detection. In: ICCV (2021)
2021
-
[55]
PR112 (2021)
Zavrtanik, V., Kristan, M., Skočaj, D.: Reconstruction by inpainting for visual anomaly detection. PR112 (2021)
2021
-
[56]
In: CVPR (2023)
Zhang, H., Wu, Z., Wang, Z., Chen, Z., Jiang, Y.G.: Prototypical residual networks for anomaly detection and localization. In: CVPR (2023)
2023
-
[57]
In: CVPR (2023)
Zhang, X., Li, S., Li, X., Huang, P., Shan, J., Chen, T.: Destseg: Segmentation guided denoising student-teacher for anomaly detection. In: CVPR (2023)
2023
-
[58]
In: CVPR (2023)
Zhao, Y.: OmniAL: A unified cnn framework for unsupervised anomaly localiza- tion. In: CVPR (2023)
2023
-
[59]
In: ICLR (2024)
Zhou, Q., Pang, G., Tian, Y., He, S., Chen, J.: AnomalyCLIP: Object-agnostic prompt learning for zero-shot anomaly detection. In: ICLR (2024)
2024
-
[60]
In: ECCV (2022) OneNIP 1 A Implementation Details For fair comparisons, we maintain the same hyper-parameters as in UniAD [52]
Zou, Y., Jeong, J., Pemula, L., Zhang, D., Dabeer, O.: Spot-the-difference self- supervised pre-training for anomaly detection and segmentation. In: ECCV (2022) OneNIP 1 A Implementation Details For fair comparisons, we maintain the same hyper-parameters as in UniAD [52]. All ...
2022
Reviewed August 15, 2026 · model on record in the stance chip above.
Discussion (0). Continue with ORCID to comment.