Table of Contents
Fetching ...

Source-Free Test-Time Adaptation For Online Surface-Defect Detection

Yiran Song, Qianyu Zhou, Lizhuang Ma

TL;DR

This work tackles surface-defect detection under domain shifts by introducing a source-free, online test-time adaptation framework. It combines a parameter-frozen supervisor to filter unreliable samples, augmented mean prediction to generate robust pseudo-labels, and a dynamically-balancing loss to jointly optimize classification and segmentation during inference, with a simple online loss balance that shifts emphasis over time via $L_{total} = \lambda_{class} L_{class} + (1 - \lambda_{class}) L_{seg}$ and $\lambda_{class} = 1 - t/N$. Empirical results on DAGM 2007 and KolektorSDD show improved target-domain accuracy and real-time performance without offline retraining, outperforming state-of-the-art TTA baselines. This approach enables rapid, resource-efficient adaptation for industrial inspection where new defect types can appear at test time, enhancing robustness across unseen textures and anomalies.

Abstract

Surface defect detection is significant in industrial production. However, detecting defects with varying textures and anomaly classes during the test time is challenging. This arises due to the differences in data distributions between source and target domains. Collecting and annotating new data from the target domain and retraining the model is time-consuming and costly. In this paper, we propose a novel test-time adaptation surface-defect detection approach that adapts pre-trained models to new domains and classes during inference. Our approach involves two core ideas. Firstly, we introduce a supervisor to filter samples and select only those with high confidence to update the model. This ensures that the model is not excessively biased by incorrect data. Secondly, we propose the augmented mean prediction to generate robust pseudo labels and a dynamically-balancing loss to facilitate the model in effectively integrating classification and segmentation results to improve surface-defect detection accuracy. Our approach is real-time and does not require additional offline retraining. Experiments demonstrate it outperforms state-of-the-art techniques.

Source-Free Test-Time Adaptation For Online Surface-Defect Detection

TL;DR

This work tackles surface-defect detection under domain shifts by introducing a source-free, online test-time adaptation framework. It combines a parameter-frozen supervisor to filter unreliable samples, augmented mean prediction to generate robust pseudo-labels, and a dynamically-balancing loss to jointly optimize classification and segmentation during inference, with a simple online loss balance that shifts emphasis over time via and . Empirical results on DAGM 2007 and KolektorSDD show improved target-domain accuracy and real-time performance without offline retraining, outperforming state-of-the-art TTA baselines. This approach enables rapid, resource-efficient adaptation for industrial inspection where new defect types can appear at test time, enhancing robustness across unseen textures and anomalies.

Abstract

Surface defect detection is significant in industrial production. However, detecting defects with varying textures and anomaly classes during the test time is challenging. This arises due to the differences in data distributions between source and target domains. Collecting and annotating new data from the target domain and retraining the model is time-consuming and costly. In this paper, we propose a novel test-time adaptation surface-defect detection approach that adapts pre-trained models to new domains and classes during inference. Our approach involves two core ideas. Firstly, we introduce a supervisor to filter samples and select only those with high confidence to update the model. This ensures that the model is not excessively biased by incorrect data. Secondly, we propose the augmented mean prediction to generate robust pseudo labels and a dynamically-balancing loss to facilitate the model in effectively integrating classification and segmentation results to improve surface-defect detection accuracy. Our approach is real-time and does not require additional offline retraining. Experiments demonstrate it outperforms state-of-the-art techniques.
Paper Structure (24 sections, 3 equations, 4 figures, 6 tables, 1 algorithm)

This paper contains 24 sections, 3 equations, 4 figures, 6 tables, 1 algorithm.

Figures (4)

  • Figure 1: Visualization of the domain discrepancy in cross-domain surface defect detection. $f$ represents the optimal parameters that can be learned. Our goal is to find a path that can span the difference between the source and target domains.
  • Figure 2: Architecture of our proposed method -- We initialize all modules using the parameters trained on the source domain. Each sample on the target domain is fed to the supervisor to get a score, and only reliable samples are used. The augmented samples are fed into the supervisor to obtain prediction results, which are combined with the results inferred from the model to generate the pseudo label. We use the pseudo label to update the model with a dynamically-balancing loss.
  • Figure 3: Visualization of images, labels and segmentations on the DAGM The green box shows the effect of segmentation within the source domain. The red boxes show the segmentation of the new classes that emerged during the test-time.
  • Figure 4: Examples of predictions from the KolektorSDD