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.
Then back it, or bet against it.
Related papers
Open the market on this paper to see 7 more related papers.