acceptodds
Under review as a conference paper at ICLR 2027

TPA: Test-Time Prototype Adaptation for Industrial Inspection

Abstract

Few-shot industrial inspection methods adapt to new tasks from a small set of normal samples, but most hold their normal reference fixed after deployment, so valid batch-to-batch variation in material, finish, or illumination is scored as deviation. Methods that do update a reference online index it by feature proximity, which discards the positional correspondence that fixed-viewpoint acquisition already provides. Test-time prototype adaptation (TPA) keeps the feature encoder frozen and maintains one normal prototype token and one update counter per spatial location. Dual anomaly scoring (DS) combines normalized feature distance with spatial-context consistency and admits only the lowest-scoring patches; adaptive prototype update (AP) writes each admitted patch back to its own location under a counter-weighted mean; and dynamic attention weighting (DAW) reweights the anomaly map by the consistency each location has shown across the stream. Indexing by location is what makes contamination bounded per location, and it is also what ties the method to an approximate spatial alignment assumption. Across three anomaly detection benchmarks and one few-shot segmentation benchmark, adaptation adds 0.09 ms per image and 11 GFLOPs over the frozen reference while recovering 5.6 points of image-level AUROC over the static configuration, and image-level AUROC varies by at most 0.7 points across five test-stream orders. The counter-weighted mean converges as the update count grows, so it favors stability over long-horizon tracking; evidence for the regime beyond the evaluated stream lengths is not established here.

Primary area:
applications to computer vision, audio, language, and other modalities
Keywords:
Industrial Inspectionm, Anomaly Detection, Test-Time Adaptation, Prototype Learning, Few-Shot Learning

Reviews

Among:
Shape:
1234this paper, Top 49%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 2.33 over 3 reviews, above 51% of the others.
Reviewer_Ge9tOpenReview ↗
Rating
3
Confidence
3
Informativeness
3
Presentation
3
Soundness
2
Read review
Paper summary

This paper proposes Test-Time Prototype Adaptation (TPA), a gradient-free online adaptation mechanism for few-shot industrial anomaly detection and segmentation. Unlike existing methods that either keep normal references fixed (suffering from batch-to-batch domain shifts) or update them based on global feature proximity (risking widespread prototype contamination), TPA indexes prototypes strictly by dense spatial location. Using a frozen vision transformer (DINOv3), TPA employs Dual Anomaly Scoring (DS) to gate incoming patches, Adaptive Prototype Update (AP) to apply counter-weighted running-mean updates to admitted patches at their specific locations, and Dynamic Attention Weighting (DAW) to reweight the anomaly map based on historical consistency. Evaluated on three IAD benchmarks and one IFSS benchmark, TPA demonstrates significant improvements (e.g., +5.6 image-AUROC over static references) with negligible computational overhead (+0.09 ms per image, +11 GFLOPs).

Critical strengths
  1. Computational Efficiency and Practicality: The gradient-free nature of TPA makes it remarkably efficient. The addition of just 0.09 ms and 11 GFLOPs per image over a frozen baseline makes this approach highly viable for high-throughput, edge-deployed industrial inspection pipelines.
  2. Elegant Handling of Contamination via Spatial Indexing: By indexing prototypes by location and using a local counter, the method ensures that any false admissions (contamination) remain localized and undiluted, rather than polluting a global class prototype. This elegantly exploits the fixed-viewpoint prior inherent to most industrial inspection setups.
Critical weaknesses
  1. Vulnerability to Spatial Misalignment: As explicitly acknowledged in the supplementary material (S3.3), the method fundamentally relies on strict spatial alignment (fixed-viewpoint acquisition). Under moderate object pose, scale, or viewpoint shifts, the dense spatial correspondence breaks, rendering the local prototype tokens and the spatial-context score (Es) invalid.
  2. Inability to Perform Infinite-Horizon Tracking: The Adaptive Prototype Update (AP) relies on a strict counter-weighted mean (1/n1/n). As nn grows, the effective learning rate approaches zero, meaning the estimator converges and stops adapting to long-term drift. While this protects against early contamination, it limits the method's claim as a continuous test-time adaptation framework for long-running deployment streams.
Questions for authors
  1. Regarding spatial alignment: While Table 8 ablates the spatial term, how significantly does the entire TPA pipeline degrade if applied to a dataset with inherent geometric variations (e.g., slight rotational or translational jitter of the target object)?
  2. Regarding the counter-weighted mean: You noted the trade-off between early stability and long-horizon tracking. Have you experimented with a hybrid decay scheme (e.g., switching to a small, fixed Exponential Moving Average once the counter reaches a certain threshold) to allow continuous infinite-horizon adaptation without risking early collapse?
Reviewer_CzMcOpenReview ↗
Rating
2
Confidence
3
Informativeness
2
Presentation
2
Soundness
3
Read review
Paper summary

This paper presents TPA, a test-time prototype adaptation framework for few-shot industrial anomaly inspection, built upon a frozen pretrained feature encoder. The method designs dual anomaly scoring, adaptive prototype update and dynamic attention weighting to mitigate false‑alarm issues induced by valid batch-wise normal variations in real-world industrial streams, under the assumption of fixed-viewpoint image acquisition. However, there are some very important concerns that need to be solved, so I tend to weak reject. If the author can solve these concerns well, I will consider improving my score.

Critical strengths

The motivation is clear. Existing few‑shot industrial anomaly detection approaches either retain static normal prototypes after deployment, or conduct online prototype updates via feature-nearest indexing that discards the valuable spatial positional correspondence offered by fixed-view acquisition. To address these issues, TPA maintains spatially-aligned prototype tokens. It adopts dual anomaly scoring to filter trustworthy normal patches eligible for updating. The adaptive prototype update refines these spatial prototypes via a counter-weighted running-mean strategy. Meanwhile, dynamic attention weighting leverages temporal historical consistency to refine the anomaly response maps.

Critical weaknesses

Firstly, this work compares against only one test-time adaptive baseline, TT4AS, alongside a collection of static few-shot and zero-shot anomaly detection methods, without comparisons with other existing test-time adaptive anomaly detection methods for industrial anomaly detection. Therefore, it is difficult to separate the performance gain brought by the spatially-aligned prototype design from the general benefit of online test-time adaptation. It would be valuable to include more test-time adaptive anomaly detection baselines in the revision to better validate the unique advantage of the proposed spatially-aligned prototype design.

Secondly, the core motivation of this work builds upon the spatial consistency assumption, where prototypes are tightly bound to fixed spatial positions within images. While the method is intended for scenarios without large spatial transformations, real captured industrial images may still contain subtle positional shifts or minor spatial variance. We wonder how the performance of the proposed spatially-aligned prototype paradigm will be affected under such slight misalignment. Supplementary evaluation under mild spatial perturbation would help verify the robustness of the core spatial consistency assumption.

Questions for authors

Firstly, as shown in Table 1, I wonder why the reported average performance of the proposed method on IAD is not the arithmetic mean. For example, (92.4 + 87.2 + 94.5) / 3 = 91.4, which is inconsistent with the reported 91.0.

Secondly, Eq. (6) selects patches based on discrepancy relative to the old prototype. I wonder whether typical normal target-domain patches with large source-prototype deviations become indistinguishable from anomalies and are excluded from prototype updates.

Correspondingly, when a batch is dominated by anomalous patches, a fixed fraction of these anomalies will still be selected for prototype updates and contaminate the prototype. Given the above two risks, could the authors explain why they adopt such top-K-based selection instead of a feature-distance threshold?

Lastly, could the authors provide the additional experiments requested above to demonstrate both the effectiveness of the proposed method against other test-time adaptive baselines and its robustness to minor positional disturbances?

Reviewer_5YZzOpenReview ↗
Rating
2
Confidence
3
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

This paper proposes Test-Time Prototype Adaptation (TPA) for few-shot industrial anomaly detection and segmentation. The method freezes the feature encoder and maintains spatially aligned normal prototypes. At test time, it combines feature distance and neighborhood distance to select low-anomaly patches, updates the corresponding prototype tokens using a running average, and reweights anomaly maps using a history-dependent attention mechanism. The general idea is simple and potentially useful for fixed-view industrial inspection. However, the current submission does not provide sufficiently clear or controlled evidence that the reported gains result from reliable test-time adaptation under distribution shift. In particular, the online protocol is ambiguous, several baseline comparisons mix incompatible settings, and the claimed industrial drift scenario is not adequately represented by the main benchmarks.

Critical strengths
  1. The method is computationally simple and does not require gradient-based optimization at test time.
  2. Maintaining prototypes by spatial position is a reasonable prior for industrial inspection systems with fixed cameras and approximately aligned products.
Critical weaknesses
  1. The causal online evaluation protocol is not sufficiently specified. Eq. (1) defines the input as a batch of images, and Eq. (6) selects the lowest-scoring patches jointly from all patches in that batch. However, lines 216-218 describe one test step as one incoming image, while Table 3 report a default batch size of 12. The paper does not state whether each image is scored before or after its batch contributes to the prototype update, nor how multiple updates to the same spatial token are aggregated. Therefore, it is not possible to determine whether the reported evaluation is strictly causal online adaptation or batch-level transductive adaptation. Results with batch size one and an explicit predict-then-update protocol are needed.
  2. The main experiments do not directly validate the claimed adaptation to temporal distribution drift. The motivation concerns changes in material, finish, illumination, and production batches (lines 44-53). However, the principal results in Table 1 use the standard MVTec AD, VisA, and BTAD test sets. TPA is initialized with only two normal support images per class (lines 255-256), so the gains may reflect enrichment of a sparse normal reference rather than adaptation to temporal drift. The additional shift experiment in Section 3.2.1 uses synthetic corruptions and reports results aggregated across heterogeneous shift families. Per-shift results and experiments with an explicitly time-varying normal distribution would be necessary to substantiate the paper’s central deployment claim.
  3. The industrial anomaly-detection comparison does not isolate the contribution of TPA. Table 1 compares methods using zero-shot, two-shot, full-data, and wrapper-based regimes. Moreover, its caption states that only cells marked with a dagger were rerun by the authors, while the remaining baseline results were quoted from prior work. Differences in support data, encoder, resolution, and evaluation implementation can therefore confound the comparison. This concern is also implicitly acknowledged by the authors when they exclude RareCLIP from Table 1 because it uses a different encoder and protocol. A convincing comparison should evaluate static prototypes, simple EMA/running-mean updates, memory-bank updates, and relevant TTA baselines using the same backbone, support images, preprocessing, and test order.
  4. The FSSD-12 comparison lacks a sufficiently precise task and supervision specification. Section 2.1 defines the method using a normal support set, and Section 2.5 states that the resulting anomaly map is directly treated as the IFSS segmentation score. However, the FSSD-12 results in Table 1 do not explain whether TPA receives normal images, defective support images, support masks, or category labels. Consequently, it is unclear whether TPA and the listed few-shot segmentation baselines receive equivalent supervision or solve the same task. The authors should define the FSSD-12 episode construction and list the exact supervision available to each method.
Questions for authors

Please address the concerns raised in the critical weaknesses above.

1 comment

I thank the authors for a thorough, candid rebuttal. The B=1 predict-then-update control (−0.2/−0.4), the matched component ladder (R4), and the nested-support drift interaction are the right experiments, and I credit the disclosure of adverse results (Noise −0.2, EMA above TPA, contract-A below QGNet). However, although revision is permitted, the manuscript's structure and presentation remain inadequate, and the authors have not submitted a revised version addressing the review comments. The stated changes exist only in the rebuttal, not in the paper. I therefore maintain my original score.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.