One-to-Normal: Anomaly Personalization for Few-shot Anomaly Detection

Traditional Anomaly Detection (AD) methods have predominantly relied on unsupervised learning from extensive normal data. Recent AD methods have evolved with the advent of large pre-trained vision-language models, enhancing few-shot anomaly detection capabilities. However, these latest AD methods still exhibit limitations in accuracy improvement. One contributing factor is their direct comparison of a query image's features with those of few-shot normal images. This direct comparison often leads to a loss of precision and complicates the extension of these techniques to more complex domains--an area that remains underexplored in a more refined and comprehensive manner. To address these limitations, we introduce the anomaly personalization method, which performs a personalized one-to-normal transformation of query images using an anomaly-free customized generation model, ensuring close alignment with the normal manifold. Moreover, to further enhance the stability and robustness of prediction results, we propose a triplet contrastive anomaly inference strategy, which incorporates a comprehensive comparison between the query and generated anomaly-free data pool and prompt information. Extensive evaluations across eleven datasets in three domains demonstrate our model's effectiveness compared to the latest AD methods. Additionally, our method has been proven to transfer flexibly to other AD methods, with the generated image data effectively improving the performance of other AD methods.

Paper

References (45)

Scroll for more · 33 remaining

Similar papers

Peer review

Reviewer WVvk7/10 · confidence 3/52024-07-01

Summary

This paper provides a novel method to tackle the issue of precision loss in more complex domains. They introduce an anomaly personalization method with a diffusion model to utilize the diffusions to obtain the normal sample distribution and exchange the anomaly image into normal ones. Finally, a triplet contrastive strategy is designed to obtain the score. Their approach obtains a SOTA result compared to the recent methods.

Strengths

1. This paper provides novel approaches that utilize the diffusion model for both distribution modeling and recovering the anomaly images into the real one for comparison. 2. The triplet contrastive strategy introduces a multi-level way to obtain the anomaly map from different views which is more robust than the previous methods. 3. The experiments are comprehensive and the result is SOTA compared to the recent methods.

Weaknesses

1. Will the utilize of the diffusion model bring a long inference time, which may not be effective for real-time application? 2. Will the choice of the text influence the result? Is there any comparison result with different prompt choices?

Questions

See Weakness.

Rating

7

Confidence

3

Soundness

3

Presentation

3

Contribution

3

Limitations

The authors have address the limitations in zero-shot scenarios.

Reviewer oVNv5/10 · confidence 3/52024-07-07

Summary

This paper proposes a new few-shot anomaly detection method based on one-to-normal personalization of query images using a diffusion model and a triplet contrastive inference process. It leverages a diffusion-based generation model to transform a query image into a personalized image towards the distribution of normal images, for use in the triplet contrastive inference. Experimental results on datasets from industrial, medical, and semantic domains demonstrate that the proposed method outperforms existing models.

Strengths

- Unlike common augmentation-based methods that generate pseudo-anomalies for AD, this approach transforms a query image towards the normal distribution, which is interesting and effective. The proposed triplet contrastive inference is compelling. - Experiments conducted across various domains show its state-of-the-art performance in few-shot scenarios.

Weaknesses

- Details about the experimental settings are not fully provided, which limits reproducibility. For instance, there is no information on the selection of hyperparameters such as alpha and beta for A_score in the implementation details. It raises concerns about the model's performance. If alpha and beta were optimized based on test data, the claim of state-of-the-art performance is questionable. Details about the memory bank M such as its size and sensitivity of the performance to its hyperparameters are also missing. - The paper lacks theoretical analysis, relying solely on empirical evidence. - Figure 1 does not provide sufficient information about the overall process. Particularly, it omits the training process of the diffusion model and the composition of the anomaly-free pool, which can cause confusion before reading the detailed explanations in the main text. - The definition of S_text in Sec 3.4 is unclear. It does not seem logical to apply the softmax function directly to the paired feature of F_q,l and F^T_text. - The lack of equation numbers in the Method section makes it difficult to follow. - There is no discussion of Table 3 in the paper.

Questions

- Can you provide visualizations or information about the distribution of the individual anomaly scores (S_n, S_p, S_text)? It would be helpful to understand whether these scores focus on different parts or the same regions. - The sensitivity of the model to text prompts should be further explored. Specifically, I would like to know the number of selected text prompts when generating personalized image and the rationale or justification for setting physical-level text prompts in the chosen template. - In Table 4, using all the scores does not always correspond to the highest performance. A discussion on the possible reasons for this would be valuable. - Could you provide results from InCTRL in Figure 4, and also add lines or bars to compare each performance against the performance of the proposed model? - Why is the performance on MVTec-AD different in Table 5 (96.8) and Table 4 (96.2)? Minor issues: - In Table 4, the top value for AFID is 85.2, not 84.7 as bold-faced. - Tables 4 and 5 lack information on the few-shot setting. - Typo: "semantice" should be "semantic" in the caption of Table 3.

Rating

5

Confidence

3

Soundness

3

Presentation

3

Contribution

3

Limitations

- As mentioned in the paper, the method is not applicable in zero-shot scenarios. - The theoretical exploration is lacking; there is only empirical evidence. - The computational cost is likely to be high, which may not be suitable for real-world scenarios - The approach depends on the performance of the generative model. And it is limited if the generated images are abnormal (potentially vulnerable to attacks).

Reviewer tpYi5/10 · confidence 3/52024-07-10

Summary

This paper addresses the issue of few-shot anomaly detection, which introduces an anomaly personalization method by using an anomaly-free customized generation model and performing a triplet contrastive anomaly inference strategy. Experiment evaluations across eleven datasets in three domains demonstrate its superior performance compared to the latest AD methods.

Strengths

1. The paper is generally well-organized and well-written. 2. The ideas of anomaly personalization and triplet contrastive anomaly inference are well-motivated with solid theoretical support. 3. The superior performances on various evaluations demonstrate the effectiveness of the proposed method.

Weaknesses

- There is a lack of discussion of the computation cost and inference speed of the proposed method since there are many generation steps. And the explicit description and exact number of prompts and images for generation are not clearly stated. - The method introduces several hyperparameters (e.g., α, β) which require careful tuning. It's unclear how sensitive the results are to these hyperparameters and whether the paper provides sufficient guidance on setting them. Regarding the process of multi-level feature comparison, it would be better to clarify the effect of the number of multi-feature extraction blocks. - The equations are not numbered and the line numbers are incomplete which makes it hard to reference.

Questions

1. What are the exact components of $C_0$ and $\overline{C_0}$? As for the normal state prompts, is the number of $n$ below Line125 13? And what is the number of the memory bank $M$? 2. The "Triplet Contrastive Anomaly Inference" seems to work as a weighted prediction from three comparison aspects during testing. Where can it reflect the concept of "contrastive"? What is the full training objective? 3. Does $S_{text}$ reflect the degree of anomaly score? It seems that there are two types (both normal and abnormal) objects in the text prompts. How do they work in the same way as the equations of $S_{text}$ and $A_{score}$? 4. Is there any limitation for the proposed method to handle the open-vocabulary scenarios? And what is the computation cost and inference cost of the proposed method compared with other methods since there are many images for generation?

Rating

5

Confidence

3

Soundness

3

Presentation

3

Contribution

3

Limitations

The authors provide a brief discussion of the limitations on zero-shot anomaly detection.

Reviewer Ljby5/10 · confidence 5/52024-07-11

Summary

The paper focuses on a practical yet challenging anomaly detection in a few-shot-normal-image setting. Instead of directly matching features between the query image and a few normal reference images, the core insight is to replace the reference image with a personalized normal image generated by an anomaly-free custom model. The authors also propose a triplet contrastive anomaly inference strategy, incorporating the original/generated anomaly-free samples and text prompts. Extensive experiments are extensively conducted across 11 datasets.

Strengths

1. The paper is well-writing and easy to follow. 2. State-of-the-art results are achieved across 11 datasets.

Weaknesses

1. It is essentially a memory-augmented reconstruction-based anomaly detection (AD) method [1], which attempts to reconstruct the query image to its most similar anomaly-free counterpart. However, the reconstruction-based AD method also explores the Stable Diffusion (SD) denoising network [1]. Could you clarify the differences? If I understand correctly, the core difference is the inputs to SD, which are pairs of object text prompts and few-shot normal images. 2. Though Figure 4 demonstrates the effectiveness of the generated anomaly-free samples on three AD methods, how do these generated samples enhance the authors’ method? Can we use more or fewer generated normal samples instead of 100? An ablation study is required here. [1] Gong et al. Memorizing normality to detect anomaly: memory-augmented deep autoencoder for unsupervised anomaly detection. In ICCV, 2019. [2] He et al. Diad: A diffusion-based framework for multi-class anomaly detection. In AAAI, 2024.

Questions

1. Which data augmentations are used to augment few-shot normal images? Do these data augmentations vary across different categories? 2. It would be interesting to investigate how text prompts affect the anomaly-free customized model. For example, what if a specific category name (e.g., “cable”) is used to replace "object"? 3. How are \alpha and \beta determined in the final prediction? How about the ratio of the t-step? 4. It would be favorable to report F1-max, AP and PRO along with AUROC. 5. What about the one-shot setting?

Rating

5

Confidence

5

Soundness

3

Presentation

4

Contribution

2

Limitations

The limitations are adequately addressed.

Authorsrebuttal2024-08-08

For your convenience, we provide the experimental results mentioned in **the uploaded PDF** here to facilitate your review. We hope these supporting data address any concerns or questions you may have. If there is any confusion or if any part of our work requires further clarification, please do not hesitate to comment. We are more than willing to provide additional explanations and engage in further discussions. *** >W#2: Can we use more or fewer generated normal samples instead of 100? An ablation study is required here. **A#1:** Yes, we attempted to generate samples ranging from 10 to 300 to validate the effectiveness of the proposed method. We have placed the results here in the following table. Increasing the number of generated samples continues to enhance the results, likely because a larger sample set better represents the distribution of normal samples. However, for computational efficiency, we do not recommend generating too many samples (e.g., exceeding 200). | Datasets | 10 | 30 | 50 | 100 | 150 | 200 | 300 | |----------|------|------|------|------|------|------|------| | MVTec-AD | 95.9 | 96.2 | 96.3 | 96.4 | 96.5 | 96.6 | 96.6 | | RESC | 94.7 | 95.2 | 95.4 | 95.6 | 95.6 | 95.7 | 95.9 | | CIFAR | 94.2 | 94.9 | 95.2 | 95.5 | 95.6 | 95.6 | 95.7 | *** *** >Q#3: How are alpha and beta determined in the final prediction? **A#2:** We set the parameters $\alpha$ and $\beta$ for $A_{score}$ to 1 and 0.5, respectively, this configuration remains consistent across all datasets. This choice was informed by our preliminary experiments, which demonstrated satisfactory performance across the majority of datasets under this setting. We provide more results in the following table below, demonstrating the robustness of our method to different choices of $\alpha$ and $\beta$. | $\alpha$ | $\beta$ | MVTec | VisA | KSDD | AFID | ELPV | OCT2017 | BrainMRI | HeadCT | RESC | MNIST | CIFAR-10 | Average| |:--------:|:-------:|:-----:|:----:|:----:|:----:|:----:|:-------:|:--------:|:------:|:----:|:-----:|:--------:|:--------:| | 1 | 0.5 | 96.2 | 89.9 | 98.4 | 84.7 | 90.6 | 99.3 | 98.6 | 94.8 | 95.2 | 93.6 | 94.9 | **94.2** | | 0.5 | 1 | 95.7 | 89.3 | 98.0 | 84.2 | 90.1 | 99.1 | 98.3 | 94.6 | 95.1 | 93.2 | 94.6 | **93.9** | | 1 | 1 | 95.9 | 89.5 | 98.1 | 84.1 | 90.2 | 99.4 | 98.5 | 95.1 | 95.0 | 93.4 | 94.7 | **94.0** | | 0.5 | 0.5 | 96.1 | 89.7 | 98.3 | 84.6 | 90.8 | 99.0 | 98.1 | 94.5 | 95.3 | 93.8 | 94.3 | **94.1** | | 2 | 1 | 96.0 | 89.8 | 98.5 | 84.0 | 90.0 | 99.2 | 98.3 | 94.3 | 94.8 | 93.2 | 94.6 | **93.9** | | 1 | 2 | 95.7 | 89.1 | 97.8 | 83.5 | 89.7 | 99.2 | 98.7 | 94.5 | 95.0 | 93.4 | 94.7 | **93.8** | | 2 | 2 | 95.9 | 89.3 | 97.9 | 83.2 | 89.9 | 99.1 | 98.5 | 95.3 | 94.8 | 93.1 | 94.8 | **93.8** | *** *** >Q#5: What about the one-shot setting? **A#3:** In the one-shot setting, we have calculated the performance of our method and compared it with recent methods. The table below presents the AUROC comparison results, showing that our method maintains optimal performance on most datasets. | | Datasets | WinCLIP | InCTRL | Ours | |:-----------------:|:---------------:|:-------------------------:|:------------------------:|:--------------------------:| | **Industrial field** | **MVTec** | 92.5±2.3 | 93.2±1.7 | **94.8±0.7** | | | **VisA** | 83.6±2.5 | 84.2±2.5 | **87.0±1.7** | | | **KSDD** | 94.0±0.5 | **96.6±2.8** | 96.5±1.6 | | | **AFID** | 72.3±4.2 | 76.0±3.2 | **77.6±1.5** | | | **ELPV** | 72.2±2.5 | 82.8±1.2 | **85.2±0.8** | | **Medical field** | **OCT2017** | 90.7±2.6 | 93.0±2.3 | **95.8±1.6** | | | **BrainMRI** | 93.1±1.5 | 96.7±2.4 | **96.9±1.3** | | | **HeadCT** | 91.7±1.8 | 92.3±2.0 | **93.7±1.2** | | | **RESC** | 85.7±2.6 | 87.6±2.9 | **92.4±1.2** | | **Semantic field** | **MNIST** | 76.3±1.7 | 87.7±2.3 | **91.8±0.6** | | | **CIFAR-10** | 92.3±0.2 | 93.2±0.9 | **93.6±0.5** | ***

Authorsrebuttal2024-08-08

*** >Q#4: It would be favorable to report F1-max, AP and PRO along with AUROC? **A#4:** Following your suggestion, we have included the results of AUROC, F1-max, AP, AUPRC, and PRO on MVTec dataset in the table below for a more comprehensive comparison, where our method consistently outperforms the baselines on all metrics. | | Methods | AUROC | F1-max | AP | AUPRC | PRO | |:--------------:|:---------:|:-------:|:--------:|:------:|:-------:|:------:| | **2-shot** | WinCLIP | 93.1 | 93.3 | 95.9 | 96.5 | 88.2 | | | InCTRL | 94.0 | - | - | 96.9 | - | | | VAND | 92.4 | 92.6 | 96 | - | 91.3 | | | Ours | **95.1**| **94.3** |**96.5**|**97.3** |**92.1**| | **4-shot** | WinCLIP | 94.0 | 93.5 | 96.2 | 96.8 | 88.5 | | | InCTRL | 94.5 | **-** | - | 97.2 | - | | | VAND | 92.8 | 92.8 | 96.3 | - | 91.8 | | | Ours | **95.6**| **94.8** | **97** |**97.8** |**92.6**| | **8-shot** | WinCLIP | 94.7 | 93.8 | 96.5 | 95.3 | 89.1 | | | InCTRL | 95.3 | - | - | 97.7 | - | | | VAND | 93.0 | 93.1 | 96.5 | - | 92.2 | | | Ours | **96.2**| **95.1** |**97.4**|**98.9** |**93.1**| ***

Reviewer Ljby2024-08-11

I highly appreciate the authors' helpful feedback. I agree with explanations on the differences between the diffusion model-based reconstruction and memory-based one. All other questions are well-solved through additional experiments so I would like to increase my rating and recommend a borderline acceptance.

Authorsrebuttal2024-08-12

We sincerely appreciate you taking the time to review our rebuttal and for your positive feedback. We are very glad that our response has addressed your concerns.

Authorsrebuttal2024-08-12

We sincerely appreciate you taking the time to review our rebuttal and helpful feedback on our work. We are very glad that our response has addressed your concerns.

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC