Reproducing INP-Former: Reconstructing Intrinsic Normal Prototypes for Industrial Anomaly Detection
Organizations: Faculty of Computer and Information Science University of Ljubljana
Abstract
We reproduce the central claims of INP-Former, a reconstruction-based method for multi-class industrial anomaly detection. INP-Former extracts Intrinsic Normal Prototypes (INPs) from each test image and uses them to guide a decoder that reconstructs normal features, without a stored memory bank. Using the authors' released code, we reproduce the reported performance on MVTec AD and VisA and extend the evaluation to MVTec AD 2, where image AUROC with the default settings is 63.4, compared with 99.7 on MVTec AD. On MVTec AD, a five-seed ablation shows that most of the performance comes from the INP mechanism, while the two auxiliary losses add small changes whose direction depends on the metric. A paired comparison with both losses disabled confirms the benefit of INP on MVTec AD 2. The default of six prototypes transfers less well: the plateau beyond four prototypes reproduces on MVTec AD and VisA, but on MVTec AD 2 a single prototype outperforms six in AU-PRO on the public split and on both hidden test splits. We also measure practical trade-offs in resolution, backbone size, training length, and LoRA adaptation, and examine performance by defect size, lighting condition, and a stricter AU-PRO limit. Several conclusions from the original benchmarks, including the default prototype count, do not carry over to harder data. Code: https://github.com/garasnote/Repro-INPFormer
Figures & tables
| Claim | Question | Evidence in this study |
|---|---|---|
| Claim 1 | RQ1 | Main reproduction on MVTec AD and VisA (Section 4.1 ). |
| Claim 2 | RQ1, RQ2 | Loss and module ablation on MVTec AD (Section 4.1 ); paired INP-only versus No-INP comparison on the MVTec AD 2 public split (Section 5.3 ). |
| Claim 3 | RQ1 | Five-configuration loss ablation on MVTec AD (Section 4.1 ). |
| Claim 4 | RQ1, RQ2 | Prototype-count sweeps on MVTec AD and VisA (Section 4.2 ) and on MVTec AD 2 (Section 5 ). |
| Configuration | Description |
|---|---|
| INP aggregation | learned queries cross-attend to the fused encoder features of each image, before the decoder bottleneck. |
| No-INP control | Bypasses aggregation and supplies the full pre-bottleneck encoder-feature sequence as decoder keys/values. Cross-attention remains; this is not vanilla self-attention, and equivalence to the original authors’ control is not established. |
| Soft mining | The exponent controls gradient reweighting of the cosine reconstruction objective. At , reweighting is disabled; reconstruction remains. |
| Coherence term | Mean nearest-prototype cosine distance over fused encoder features. removes its contribution to the training objective. |
| Dataset | Role in this study |
|---|---|
| MVTec AD | 15 categories of industrial products and textures; 3,629 normal training images and 1,725 test images. Original-benchmark reproduction ( Bergmann et al., 2019 ) . |
| VisA | 12 categories of complex structures; 8,659 training images and 2,162 test images. Original-benchmark reproduction ( Zou et al., 2022 ) . |
| MVTec AD 2 | 8 categories, including Fabric; models trained on the AD2 training split and evaluated on the public test split ( Heckler-Kram et al., 2026 ) . The and submissions also have official private scores. Not evaluated in the original paper. |
| Real-IAD | Not included among our reproduced training or evaluation benchmarks ( Wang et al., 2024 ) due to training cost limitations. |
| Setting | Value |
|---|---|
| Seed | 1 for both runs. |
| Loss controls | and in both runs; the reconstruction objective remains active. The two training configurations differ only in whether prototype aggregation is used. |
| Prototypes | for INP-only; the No-INP control has no aggregation step. |
| Training hardware | NVIDIA A100-SXM4-40GB for both runs. |
| Dataset | Source | I-AUROC | P-AUROC | P-AUPRO |
|---|---|---|---|---|
| MVTec AD | Original | 99.7 | 98.5 | 94.9 |
| Ours | 99.67 | 98.45 | 94.95 | |
| VisA | Original | 98.9 | 98.9 | 94.4 |
| Ours | 98.90 | 98.97 | 95.27 |
| Original | Ours | ||||||
|---|---|---|---|---|---|---|---|
| Configuration | INP | I-AUROC | P-AUPRO | I-AUROC | P-AUPRO | ||
| No INP | × | × | × | 98.59 | 92.73 | ||
| INP only | ✓ | × | × | 99.53 | 94.69 | ||
| INP + | ✓ | ✓ | × | 99.61 | 95.10 | ||
| INP + † | ✓ | × | ✓ | — | — | ||
| Full | ✓ | ✓ | ✓ | 99.67 | 94.87 | ||
| MVTec AD | VisA | |||||
|---|---|---|---|---|---|---|
| I-AUROC | P-AUROC | AU-PRO | I-AUROC | P-AUROC | AU-PRO | |
| 1 | 98.37 | 96.54 | 92.21 | 97.34 | 97.66 | 93.00 |
| 2 | 99.36 | 98.12 | 94.39 | 98.15 | 98.53 | 93.80 |
| 4 | 99.55 | 98.39 | 94.75 | 98.81 | 98.84 | 95.04 |
| 6 | 99.67 | 98.45 | 94.95 | 98.90 | 98.97 | 95.27 |
| 8 | 99.60 | 98.42 | 94.90 | 98.84 | 98.98 | 95.23 |
| [email protected] | ||||||
|---|---|---|---|---|---|---|
| I-AUROC | P-AUROC | Public | Private | Priv.-mixed | [email protected] | |
| 1 | 65.75 | 87.68 | 32.12 | 37.14 | 33.98 | 57.39 |
| 2 | 64.68 | 87.45 | 27.68 | — | — | 55.09 |
| 4 | 63.96 | 87.58 | 25.06 | — | — | 53.75 |
| 6 | 63.39 | 87.98 | 26.67 | 34.51 | 28.46 | 54.86 |
| 8 | 62.48 | 87.21 | 22.94 | — | — | 52.47 |
| Configuration | I-AUROC | P-AUROC | [email protected] | [email protected] |
|---|---|---|---|---|
| No-INP control | 59.90 | 86.08 | 18.98 | 48.20 |
| INP-only | 64.79 | 88.04 | 30.03 | 56.48 |
| (INP minus control) | +4.89 | +1.96 | +11.05 | +8.29 |
| Backbone | Input/Crop | I-AUROC | P-AUROC | P-AUPRO |
|---|---|---|---|---|
| ViT-Base/14 | 224/196 | 99.21 | 97.97 | 92.07 |
| ViT-Base/14 | 336/294 | 99.63 | 98.28 | 94.04 |
| ViT-Base/14 | 448/392 | 99.67 | 98.45 | 94.95 |
| ViT-Small/14 | 448/392 | 99.20 | 98.18 | 94.39 |
| ViT-Base/14 | 448/392 | 99.67 | 98.45 | 94.95 |
| Config | Setting | FPS | Latency (ms) |
|---|---|---|---|
| Resolution (ViT-B, =6) | 224/196 | 85.3 | 11.7 |
| 336/294 | 50.1 | 20.0 | |
| 448/392 | 25.0 | 40.0 | |
| Backbone (448/392, =6) | ViT-Small/14 | 72.6 | 13.8 |
| ViT-Base/14 | 25.0 | 40.0 | |
| INP count (ViT-B, 448/392) | =2–16 | 25.0–25.2 | 39.7–40.0 |
| Trainable (%) | MVTec AD | VisA | ||||||
|---|---|---|---|---|---|---|---|---|
| Method | Total | Adapters | I-AUROC | P-AUROC | P-AUPRO | I-AUROC | P-AUROC | P-AUPRO |
| Zero-shot | — | — | 69.15 | 79.92 | 57.17 | 51.47 | 72.60 | 31.60 |
| LoRA | 4.71 | 0.14 | 97.22 | 96.21 | 91.30 | 91.79 | 96.29 | 85.11 |
| LoRA | 4.85 | 0.29 | 97.81 | 96.62 | 91.87 | 93.17 | 96.79 | 87.55 |
| LoRA | 5.12 | 0.58 | 98.16 | 96.96 | 92.47 | 94.44 | 97.25 | 89.91 |
| Full train | — | — | 99.67 | 98.45 | 94.95 | 98.90 | 98.97 | 95.27 |
| Epoch | Loss | I-AUROC | P-AUROC | P-AUPRO | P-AUPRO |
|---|---|---|---|---|---|
| 25 | 0.163 | 99.29 | 98.07 | 94.57 | |
| 50 | 0.145 | 99.50 | 98.26 | 94.76 | |
| 100 | 0.133 | 99.55 | 98.40 | 94.90 | |
| 150 | 0.128 | 99.59 | 98.45 | 94.95 | |
| 200 | 0.126 | 99.61 | 98.48 | 94.96 | — |
| I-AUROC change | [email protected] change | ||||
|---|---|---|---|---|---|
| Condition | Categories evaluated | ||||
| overexposed | 8 | +0.73 | +1.11 | -0.28 | +0.49 |
| underexposed | 8 | -2.61 | -4.04 | -3.05 | -4.70 |
| shift_1 | 8 | -5.07 | -1.72 | -4.28 | -9.26 |
| shift_2 | 7 | -0.24 | -0.15 | +0.46 | -3.40 |
| shift_3 | 7 | -6.72 | -2.53 | -1.43 | -5.90 |
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
| Category | I-AUROC | P-AUROC | P-AUPRO |
|---|---|---|---|
| carpet | 99.88 | 99.35 | 97.89 |
| grid | 99.92 | 99.42 | 97.75 |
| leather | 100.0 | 99.42 | 98.13 |
| tile | 100.0 | 97.68 | 88.36 |
| wood | 99.91 | 97.54 | 93.84 |
| bottle | 100.0 | 99.06 | 96.90 |
| Category | I-AUROC | P-AUROC | [email protected] | [email protected] |
|---|---|---|---|---|
| can | +2.35 | +1.32 | -6.02 | -0.22 |
| fabric | +9.60 | -2.85 | +10.83 | +17.92 |
| fruit_jelly | -7.83 | +4.09 | +13.54 | +11.29 |
| rice | +3.62 | -0.56 | +13.92 | -1.77 |
| sheet_metal | +16.34 | +3.90 | +6.23 | +6.56 |
| vial | +3.37 | -0.11 | +27.42 | +14.48 |
| Category | I-AUROC | P-AUROC | [email protected] | [email protected] |
|---|---|---|---|---|
| can | 50.65 / 52.47 | 64.97 / 69.36 | 2.33 / 1.17 | 22.14 / 24.82 |
| fabric | 56.65 / 69.16 | 83.47 / 90.74 | 21.91 / 22.87 | 43.88 / 51.98 |
| fruit_jelly | 74.58 / 61.00 | 94.87 / 95.57 | 39.40 / 30.44 | 75.45 / 74.84 |
| rice | 70.42 / 68.76 | 93.93 / 93.51 | 45.85 / 37.11 | 67.05 / 60.25 |
| sheet_metal | 62.50 / 54.77 | 89.04 / 89.11 | 13.25 / 7.74 | 30.98 / 22.82 |
| vial | 91.65 / 77.39 | 90.14 / 85.76 | 65.40 / 54.72 | 89.39 / 83.30 |
| Method | Input size | Private | Private-mixed |
|---|---|---|---|
| EfficientAD-S | 30.8 | 19.2 | |
| PatchCore | 28.8 | 26.0 | |
| EfficientAD-S | 40.0 | 25.3 | |
| PatchCore | 41.9 | 35.8 | |
| INP-Former, | 37.14 | 33.98 | |
| INP-Former, | 34.51 | 28.46 |
| Condition | I-AUROC | P-AUROC | [email protected] | [email protected] | |
|---|---|---|---|---|---|
| overexposed | 1 | 69.66 / 70.39 | 88.39 / 88.08 | 34.43 / 34.15 | 58.24 / 58.21 |
| 6 | 68.21 / 69.33 | 89.98 / 89.60 | 32.75 / 33.25 | 58.16 / 58.01 | |
| underexposed | 1 | 69.66 / 67.05 | 88.39 / 87.14 | 34.43 / 31.38 | 58.24 / 56.40 |
| 6 | 68.21 / 64.18 | 89.98 / 87.42 | 32.75 / 28.06 | 58.16 / 54.46 | |
| shift_1 | 1 | 69.66 / 64.59 | 88.39 / 88.19 | 34.43 / 30.15 | 58.24 / 57.38 |
| 6 | 68.21 / 66.49 | 89.98 / 89.07 | 32.75 / 23.50 | 58.16 / 55.89 |
| Category | Condition | I-AUROC | P-AUROC | [email protected] | [email protected] | |
|---|---|---|---|---|---|---|
| can | regular | 12+15 | 51.11 / 56.11 | 65.52 / 72.00 | 0.80 / 1.45 | 20.68 / 28.21 |
| overexposed | 12+15 | 47.22 / 54.44 | 66.34 / 71.65 | 1.54 / 1.69 | 21.98 / 28.48 | |
| shift_1 | 12+15 | 56.67 / 69.44 | 66.90 / 70.67 | 5.60 / 2.11 | 27.29 / 28.54 | |
| shift_2 | 12+15 | 51.11 / 45.56 | 62.56 / 66.65 | 0.80 / 0.31 | 18.41 / 18.57 | |
| shift_3 | 12+15 | 55.56 / 53.89 | 66.48 / 69.36 | 4.33 / 0.77 | 26.54 / 23.90 | |
| underexposed | 12+15 | 42.22 / 66.11 | 62.32 / 68.78 | 0.13 / 0.86 | 17.76 / 22.79 |
Anomaly Detection
Anomaly detection finds rare or unexpected patterns in data, from defective products and system faults to fraud and security threats.
See all 681 papers