INP-Former
An anomaly detection model that takes its prototypes of normal appearance from the test image itself.
Segmentation · 670 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Task
- Segmentation
- Parameters
- 155.1M
- Operations
- 670
- Framework
- PyTorch
- Recurrent
- No
- Published
- CVPR 2025
- Cited by
- 63 (as of 24 October 2026)
- Authors
- Wei Luo, Yunkang Cao, Haiming Yao and others
- Source
- GitHub: luow23/INP-Former
- License
- MIT
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m17507
- Graph hash
- ff1ff17255b6942a864ba51ffd09702595527440a9a6c491f721e9ef79831fad
- Skeleton hash
- beae26ebcefd69de719e881a2a2fd7fb7fc2183b6b6692f1c2b70ae950d20f60
- Architecture hash
- 4c4fdd9e99946f2a55f41e6fb8a5d4829b1e683ddc284b0a35ff72b55ccc0c6e
- Diagram SHA-256
- 87ad05aa5aa342302a112545b4677af3d613aa945f2b56f971816cfb898f1f5b
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
INP-Former is an anomaly detection method that extracts Intrinsic Normal Prototypes (INPs) directly from the test image. The paper explains why: when test images are compared to normal references from a training set, variations in appearance and positioning often complicate the alignment of those references with the test image. The authors observe that most anomalies are local variations, so that even an anomalous image still contains valuable normal information.
The model follows a feature reconstruction design with four modules: a fixed pre-trained encoder, an INP Extractor, a bottleneck and an INP-Guided Decoder. The INP Extractor uses cross attention between the pre-trained features and a set of learnable tokens to aggregate the features into prototypes. These prototypes then guide the decoder to reconstruct only normal tokens, and the reconstruction errors serve as anomaly scores. An INP Coherence Loss is added so that the prototypes faithfully represent normality for the test image. A Soft Mining Loss prioritizes hard-to-optimize samples during training.
By default the paper uses a ViT-Base/14 encoder with DINO2-R weights and six prototypes, which is the configuration of this model. For multi-class anomaly detection on MVTec-AD, the paper reports image-level metrics of 99.7/99.9/99.2. The official repository states that INP-Former is built upon Dinomaly.
Key idea. INP-Former extracts Intrinsic Normal Prototypes directly from the test image and uses them to guide a decoder that reconstructs only normal tokens, with reconstruction errors serving as anomaly scores.
- INP-Former
- intrinsic normal prototypes
- anomaly detection
- industrial anomaly detection
- universal anomaly detection
- few-shot anomaly detection
- multi-class anomaly detection
- MVTec-AD
- VisA
- Real-IAD
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{luo2025exploringintrinsicnormalprototypes,
title={Exploring Intrinsic Normal Prototypes within a Single Image for Universal Anomaly Detection},
author={Wei Luo and Yunkang Cao and Haiming Yao and Xiaotian Zhang and Jianan Lou and Yuqi Cheng and Weiming Shen and Wenyong Yu},
year={2025},
eprint={2503.02424},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2503.02424},
}