Zero-shot Texture Anomaly Detection

Zero-shot Texture Anomaly Detection

  • Post by:
  • 2025-03-15
  • Comments off

In recent years, anomaly detection (AD) in images has become increasingly important in industrial inspection and quality control. In particular, detecting anomalies in texture images has encountered a challenge: conventional methods assume the availability of numerous normal images, but when the orientations of the input and normal images do not match, accuracy degrades. Existing approaches detect abnormal regions based on features extracted from large sets of normal images; however, when the image exhibits anisotropy, misalignment in orientation may cause even normal regions to be falsely classified as anomalous.

Proposed Method

This study introduces a zero-shot approach for texture anomaly detection that does not rely on any normal images. The method focuses on the local consistency of appearance—that is, the homogeneity—of the input image. Specifically, a pre-trained CNN (such as WideResnet-50-2) is used to extract local features from an intermediate layer of the image. The distances between these local features are computed, and if a certain region significantly deviates from its surroundings, it is identified as anomalous. In the feature space, the average distance from each pixel’s feature to its K nearest similar features is calculated, and the maximum value (α(I)) is used to evaluate the overall homogeneity of the input image. A lower α(I) indicates a more uniform (and thus normal) image, and this metric also serves to pre-assess the applicability of the zero-shot method.

Experiments and Discussion

The proposed approach was evaluated on standard datasets such as MVTec AD, the DTD-Synthetic dataset generated from the diverse textures of DTD, as well as on the Aitex and DAGM2007 datasets. Experimental results demonstrate that, compared to conventional methods requiring numerous normal images (e.g., PatchCore), the zero-shot approach is unaffected by orientation misalignment and achieves high detection accuracy—with AUROC values nearly reaching 100%—even under few-shot conditions. Furthermore, the method can simultaneously detect anomalies at both image and pixel levels. Through careful preprocessing (resizing, center-cropping, and Gaussian filtering), false detections at the image boundaries are effectively suppressed, confirming that the zero-shot method offers robust anomaly detection in real-world scenarios with orientation mismatches.

Conclusion

This paper presents a zero-shot method for texture anomaly detection that circumvents the issues caused by orientation mismatches by eliminating the need for normal images. A key feature of this approach is its computation of an anomaly score based on the homogeneity of local features in the input image, using the maximum score as an indicator to pre-assess the method’s applicability. Experiments show that even in few-shot settings, the proposed method achieves higher detection accuracy than conventional approaches, making it a promising solution for practical applications such as industrial inspection. Future work is expected to extend this approach to more complex patterns and non-texture images, further advancing the field of zero-shot anomaly detection.

Publication

Aota, Toshimichi, Lloyd Teh Tzer Tong, and Takayuki Okatani. “Zero-shot versus many-shot: Unsupervised texture anomaly detection.” Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision. 2023.

@inproceedings{aota2023zero,
  title={Zero-shot versus many-shot: Unsupervised texture anomaly detection},
  author={Aota, Toshimichi and Tong, Lloyd Teh Tzer and Okatani, Takayuki},
  booktitle={Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision},
  pages={5564--5572},
  year={2023}
}
Categories: Uncategorized