Reproducing INP-Former: The Real Efficacy of Prototype Mechanisms in Industrial Anomaly Detection

INP-Former reproduction confirms the INP mechanism works, but default hyperparameters fail on harder data.
A systematic reproduction report on INP-Former validated the method's core claims, successfully reproducing original performance on MVTec AD and VisA (image AUROC 99.7 on MVTec AD) and confirming the reproducibility of extracting intrinsic normal prototypes from test images to guide reconstruction without a memory bank. However, extending to the harder MVTec AD 2 caused image AUROC to drop sharply to 63.4, exposing a clear cross-dataset generalization gap. Five-seed ablation shows performance mainly comes from the INP mechanism, with two auxiliary losses having small and metric-dependent effects. More critically, the default six prototypes underperform a single prototype on MVTec AD 2 (AU-PRO, both public and hidden splits), showing the default is not universally applicable. The report also measured resolution, backbone size, training length, and LoRA adaptation trade-offs, and open-sourced the code as a reusable benchmark.
Industrial Anomaly Detection has seen many reconstruction-based methods emerge in recent years, among which INP-Former has attracted considerable attention with its concept of "Intrinsic Normal Prototypes" (INPs). A recent reproduction report systematically verified INP-Former's core claims, not only reproducing the original paper's performance on MVTec AD and VisA but also extending evaluation to the harder MVTec AD 2 dataset. The reproduction results reveal a key finding: the INP mechanism is indeed the main source of performance, but some default hyperparameters do not transfer to harder data.

INP-Former's Core Mechanism: Reconstruction Without a Memory Bank
The core idea of INP-Former is to extract intrinsic normal prototypes (INPs) from each test image and use these prototypes to guide the decoder in reconstructing normal features. Unlike traditional methods, it does not require storing a memory bank, which reduces memory overhead and improves inference efficiency. The reproduction work used the code released by the authors and successfully reproduced the reported performance on MVTec AD and VisA, validating the method's reproducibility.
Memory Bank is a core component of a classic class of industrial anomaly detection methods (such as PatchCore and PaDiM): during training, features are extracted from normal samples and stored as an explicit feature set, and at inference time nearest-neighbor retrieval is used to determine whether test features deviate from that set. Its advantage is strong discriminability and sufficient coverage of normal patterns, but the cost is that storage overhead grows linearly with the training set size, and the retrieval process introduces additional inference latency. The "no memory bank" emphasized by INP-Former targets exactly this bottleneck: it does not save any copy of training features, but instead infers normal prototypes from the current image itself at test time, shifting the "normality reference" from offline storage to online estimation, thereby decoupling memory usage from the training set size.
Cross-Dataset Generalization: The Performance Cliff on MVTec AD 2
The most valuable finding of the reproduction comes from the extended evaluation on MVTec AD 2. Under default settings, the image AUROC on MVTec AD 2 is only 63.4, whereas on MVTec AD it is as high as 99.7. This huge gap shows that INP-Former still has substantial room for improvement on difficult data closer to real industrial scenarios. Rather than avoiding this gap, the reproduction report makes it a focus of analysis, discussing the method's performance under different defect sizes and lighting conditions, as well as performance changes under the stricter AU-PRO constraint.

MVTec AD 2 is the successor benchmark to MVTec AD, released in 2024 and specifically designed for more challenging conditions in real industrial scenarios. Compared with the original version, it contains more small defects that are hard to detect, more complex lighting variations (such as strong reflections, shadows, and overexposure), as well as misalignment and background interference commonly seen on real production lines, and it introduces hidden test sets to prevent overfitting. In terms of metrics, beyond the conventional image-level/pixel-level AUROC, MVTec AD 2 places more emphasis on AU-PRO (Area Under the Per-Region Overlap curve): it computes overlap by connected defect regions rather than individual pixels, making it more sensitive to small and scattered defects and closer to the judgment logic in actual quality inspection where "missing one region counts as failure." Therefore, the gap between AUROC and AU-PRO on this dataset often exposes a method's true weaknesses more effectively than on the original MVTec AD.
Ablation Study: The INP Mechanism Is the Main Contributor
A five-seed ablation on MVTec AD shows that most of the performance improvement comes from the INP mechanism itself, while the two auxiliary losses bring small changes whose direction depends on the specific metric. On MVTec AD 2, paired comparisons that simultaneously disable both auxiliary losses further confirm the benefit of INP. This indicates that in INP-Former's design, prototype extraction and guided reconstruction are the core, while the auxiliary losses are more of a bonus than a decisive factor.
Five-seed ablation means repeating training and evaluation for each configuration with five different random seeds, then reporting the mean and variance. The performance of anomaly detection models is relatively sensitive to initialization, data splits, and sampling order; a metric difference in a single experiment may be merely noise. Multiple seed repetitions can estimate the fluctuation range of metrics, thereby determining whether the gap between two configurations is statistically meaningful. The statement that the direction of the auxiliary losses "depends on the specific metric" precisely suggests that their effect size may fall within the between-seed variance—without multi-seed comparison, it is easy to misread random fluctuation as methodological improvement. This is also a point where the reproduction work is more convincing than the original paper: it supports conclusions with variance rather than single values.
The Default Number of Prototypes: Failing on Harder Data
The original paper uses six prototypes by default. The reproduction finds that this setting performs well on MVTec AD and VisA, with performance plateauing after more than four prototypes. However, on MVTec AD 2, a single prototype actually outperforms six prototypes on the AU-PRO metric, and this conclusion holds on both the public split and two hidden test splits. This suggests that the choice of the number of prototypes needs to be adjusted according to data complexity, and the default value is not universally applicable.

Practical Trade-offs: Resolution, Backbone, and Training Strategy
The reproduction also measured practical trade-offs such as resolution, backbone size, training length, and LoRA adaptation. In real deployment, these factors often affect the final outcome more than algorithmic details. The report does not give a simple "best configuration," but instead provides performance trends under different conditions to help practitioners make trade-offs according to their own scenarios. For example, increasing resolution may improve small-defect detection but increases computational cost; a larger backbone is not always better and needs to match the amount of training data.
LoRA (Low-Rank Adaptation) is a parameter-efficient fine-tuning technique: it freezes the original weights of a pretrained backbone and injects low-rank decomposition matrices (the product of two small matrices) alongside specific layers to learn task-related incremental updates. Since the number of trainable parameters is usually only a very small fraction of the original model, LoRA significantly reduces memory usage and training cost, and lowers the risk of overfitting caused by full fine-tuning on small-scale industrial datasets. In anomaly detection, the quality of backbone features directly determines the upper bound of reconstruction and discrimination, so "whether to adapt, which layers to adapt, and what rank to use" become practical variables affecting final performance—which also explains why the reproduction report lists LoRA adaptation alongside resolution and backbone size as trade-offs requiring empirical measurement.
Implications for Industrial Anomaly Detection Practice
The value of this reproduction work lies in going beyond simply "getting the code to run" and instead stress-testing the method's core assumptions. Several key conclusions deserve attention: the effectiveness of the INP mechanism is confirmed, but the role of the auxiliary losses is limited; the default number of prototypes needs to be re-examined on harder data; and cross-dataset generalization remains a major challenge for reconstruction-based methods. For industrial deployment, this means one should not blindly apply the paper's default configuration, but should tune for the specific production line and defect types. The reproduction code has been open-sourced, providing a reusable benchmark for subsequent research.
Overall, INP-Former's idea—dynamically extracting normal prototypes from test images—is inspiring, but the reproduction results also remind us that there is still a gap between excellent performance on academic benchmarks and robustness in real industrial scenarios. This reproduction report provides a more honest perspective for method evaluation in the field.
One-line Summary
INP-Former reproduction confirms the INP mechanism works, but default hyperparameters fail on harder data.
Paragraph Summary
A systematic reproduction report on INP-Former validated the method's core claims. Using the authors' code, the reproduction successfully reproduced the original paper's performance on MVTec AD and VisA (image AUROC reaching 99.7 on MVTec AD), confirming the reproducibility of the idea of extracting intrinsic normal prototypes from test images to guide reconstruction without a memory bank. However, after extending evaluation to the harder MVTec AD 2, image AUROC dropped sharply to 63.4, exposing a clear weakness in cross-dataset generalization. Five-seed ablation shows that performance mainly comes from the INP mechanism itself, while the two auxiliary losses have small effects whose direction varies with the metric. More critically, the default six prototypes perform worse than a single prototype on MVTec AD 2 (on the AU-PRO metric, holding on both public and hidden splits), indicating that the default value is not universally applicable. The report also measured practical trade-offs such as resolution, backbone size, training length, and LoRA adaptation, and open-sourced the code as a reusable benchmark.
Related articles
Tech FrontiersMuJoCo: An Analysis of DeepMind's Open-Source General-Purpose Physics Simulator
An in-depth analysis of Google DeepMind's open-source physics simulator MuJoCo: high-performance C++ kernel, MJCF modeling format, contact solving principles, MJX GPU acceleration, and robot reinforcement learning use cases.
Tech FrontiersClaude API Quick Start: The Official Quickstarts Project Collection
Anthropic's official claude-quickstarts project collection helps developers quickly build deployable apps with the Claude API. Nearly 20k stars, Python-based, great for beginners and prototyping.
Tech FrontiersAI Agents Connecting Directly to APIs: Which Calls Can Be Safely Allowed?
AI agents can call any API, but the real challenge is deciding which calls can be safely allowed. This article analyzes allowance decisions from three dimensions—intent matching, least privilege, and controllable impact—and argues that the control layer should sit outside the agent, combined with audit traceability to build a trustworthy API call governance mechanism.