Exploring Intrinsic Normal Prototypes within a Single Image for Universal Anomaly Detection

Wei Luo, Yunkang Cao, Haiming Yao, Xiaotian Zhang, Jianan Lou, Yuqi Cheng, Weiming Shen, Wenyong Yu

arXiv:2503.02424 · 2026-07-27 공개 · arXiv · PDF

anomaly-detection few-shot-learning mvtec-ad visa real-iad intrinsic-normal-prototypes inp-former inp-extractor

Abstract

Anomaly detection (AD) is essential for industrial inspection, yet existing methods typically rely on “comparing” test images to normal references from a training set. However, variations in appearance and positioning often complicate the alignment of these references with the test image, limiting detection accuracy. We observe that most anomalies manifest as local variations, meaning that even within anomalous images, valuable normal information remains. We argue that this information is useful and may be more aligned with the anomalies since both the anomalies and the normal information originate from the same image. Therefore, rather than relying on external normality from the training set, we propose INP-Former, a novel method that extracts Intrinsic Normal Prototypes (INPs) directly from the test image. Specifically, we introduce the INP Extractor, which linearly combines normal tokens to represent INPs. We further propose an INP Coherence Loss to ensure INPs can faithfully represent normality for the testing image. These INPs then guide the INP-Guided Decoder to reconstruct only normal tokens, with reconstruction errors serving as anomaly scores. Additionally, we propose a Soft Mining Loss to prioritize hard-to-optimize samples during training. INP-Former achieves state-of-the-art performance in single-class, multi-class, and few-shot AD tasks across MVTec-AD, VisA, and Real-IAD, positioning it as a versatile and universal solution for AD. Remarkably, INP-Former also demonstrates some zero-shot AD capability. Code is available at: https://github.com/luow23/INPFormer.

한국어 요약

한 줄 요약

INP-Former는 단일 테스트 이미지 내부에서 추출한 INPs를 기반으로 정상성만 재구성하여 이상 탐지를 수행하는 보편적 방법이다.

핵심 기여도

핵심 아이디어

기존 이상 탐지 방법은 훈련 데이터에서 정상성을 추출하고 테스트 이미지와 비교하는 방식을 사용하지만, 이는 외부 정상성과 테스트 이미지 간의 정렬 문제로 인해 정확도가 제한된다. 본 연구는 대부분의 이상이 지역적 변이로 나타나기 때문에, 테스트 이미지 내부에도 유의미한 정상 정보가 존재함을 관찰하였다. 이 정보는 이상과 동일한 이미지에서 기인하므로, 이상과 더 잘 정렬될 수 있다는 통찰을 바탕으로, 외부 정상성 대신 테스트 이미지 내부에서 INPs를 추출하는 새로운 접근법을 제안한다. INPs는 정상 토큰의 선형 결합으로 표현되며, 이를 통해 재구성 오류를 기반으로 이상 점수를 산출한다.

기술적 접근법

주요 결과

의의 및 한계

INP-Former는 기존 방법들이 외부 정상성에 의존하는 문제를 해결하고, 테스트 이미지 내부에서 정상성을 추출함으로써 보다 정밀한 이상 탐지를 가능하게 한다. 특히, 페어샷 및 제로샷 환경에서도 우수한 성능을 보여, 보편적 이상 탐지 기법으로서의 가능성을 제시한다. 그러나, 배경 분포와 유사한 논리적 이상(logical anomaly)은 감지가 어려운 한계가 있다. 예를 들어, MVTec-AD의 Transistor 클래스에서 배경과 유사한 위치 이동 이상은 INP Extractor가 이를 정상으로 잘못 추출할 수 있다. 향후 연구에서는 저장된 프로토타입과 INPs를 결합하여 이 문제를 해결할 계획이다.

실용적 활용

INP-Former는 산업 검사, 의료 영상 이상 탐지, 자동화된 품질 검사 시스템 등에서 적용 가능하다. 특히, 훈련 데이터가 제한적일 때 페어샷 및 제로샷 환경에서도 효과적으로 작동하므로, 데이터 수집이 어려운 분야에서 유용하게 활용될 수 있다.