Visual Anomaly Detection (VAD) is crucial for industrial inspection, yet most existing methods are limited to single-category scenarios, failing to address the multi-class and continual learning demands of real-world environments. While Teacher-Student (TS) architectures are efficient, they remain unexplored for the Continual Setting. To bridge this gap, we propose AdapTS, a unified TS framework designed for multi-class and continual settings, optimized for edge deployment. AdapTS eliminates the need for two different architectures by utilizing a single shared frozen backbone and injecting lightweight trainable adapters into the student pathway. Training is enhanced via a segmentation-guided objective and synthetic Perlin noise, while a prototype-based task identification mechanism dynamically selects adapters at inference with 99% accuracy. Experiments on MVTec AD and VisA demonstrate that AdapTS matches the performance of existing TS methods across multi-class and continual learning scenarios, while drastically reducing memory overhead. Our lightest variant, AdapTS-S, requires only 8 MB of additional memory, 13x less than STFPM (95 MB), 48x less than RD4AD (360 MB), and 149x less than DeSTSeg (1120 MB), making it a highly scalable solution for edge deployment in complex industrial environments.
Figures & tables
Figure 1: Comparison of the methods in terms of Image ROC on the MVTec dataset in the Multi-Class scenario, Model Memory (MB) required by each VAD method, and Inference VRAM peak represented by the size of the circles.
Figure 2: Overview of AdapTS architecture . (a) Main Block of the method with frozen weights (blue blocks), trainable weights (yellow blocks), and difference feature maps output (blue arrow). (b) During training, synthetic anomalies are introduced alongside a segmentation network to guide learning and separability. (c) In the inference phase, the segmentation network is discarded for efficient anomaly detection.
Image
Pixel
Mem (MB)
FLOPs (G)
VRAM (MB)
Scenario
Model
I-ROC
P-ROC
P-F1
AP
Tot
Add
Inf
Tr
Inf
Tr
Single
AdapTS-L
0.88
0.94
0.50
0.46
105
10
44
90
169
358
AdapTS-M
0.86
0.94
0.49
0.46
97
3
44
90
161
350
AdapTS-S
0.82
0.91
0.40
0.37
16
1
34
69
80
172
STFPM
0.88
0.96
0.54
0.51
190
95
37
74
335
604
RD4AD
0.97
0.97
0.60
0.58
615
360
48
147
970
1242
Table 1: Comparison of anomaly detection models. Bold indicates the best result per scenario. Inf: Inference, Tr Training, Tot: Total, Add: Additional.
Image-level
Pixel-level
Memory (MB)
Model
I-ROC
P-ROC
P-F1
AP
Total
Add
AdapTS-L (our)
0.83
0.96
0.35
0.27
245
150
AdapTS-M (our)
0.82
0.96
0.34
0.26
132
37
AdapTS-S (our)
0.79
0.93
0.33
0.25
23
7
STFPM (BMVC 2021)
0.79
0.95
0.36
0.23
190
95
RD4AD (CVPR 2022)
0.85
0.93
0.37
0.26
615
360
Table 2: Comparison of anomaly detection models in the Multi-Class scenario on the VisA dataset. Bold values indicate the best result per metric, computed separately for the top and bottom sections. Add: Additional Memory, Total: backbone and Additional Memory.
Image-level
Pixel-level
Memory [MB]
Model
I-ROC
P-ROC
P-F1
AP
Normal
Quantized
Linear
0.86
0.93
0.46
0.44
10.54
2.64
BN25
0.77
0.89
0.32
0.26
2.67
0.68
BN50
0.78
0.90
0.35
0.30
5.30
1.33
Expansion
0.87
0.94
0.46
0.43
21.07
5.28
Linear Seg
0.87
0.94
0.49
0.45
10.54
2.64
Table 3: Performance comparison of different adapter architectures attached to layers 1, 2, and 3 on the MVTec dataset. Bold values indicate the best result per metric.
Image-level
Pixel-level
Memory [MB]
Layers
I-ROC
P-ROC
P-F1
AP
Normal
Quantized
1-2-3
0.87
0.94
0.49
0.45
10.54
2.64
1-2
0.78
0.90
0.36
0.30
2.51
0.63
2-3
0.88
0.94
0.50
0.46
10.03
2.51
2
0.82
0.91
0.40
0.37
2.01
0.50
Table 4: Performance comparison when applying adapters to different feature extraction layer combinations using LinearSeg Adapters on the MVTec dataset. Bold values indicate the best result per metric.
Figure 3: AdapTS anomaly detection examples on the MVTec Dataset. The first row contains an anomalous image per category, the second row the ground-truth anomaly mask and the third row the anomaly heatmap produced by AdapTS.