While nowadays visual anomaly detection algorithms use deep neural networks to extract salient features from images, the high dimensionality of extracted features makes it difficult to apply those algorithms to large data with 1000s of images. To address this issue, we present an incremental dimension reduction algorithm to reduce the extracted features. While our algorithm essentially computes truncated singular value decomposition of these features, other than processing all vectors at once, our algorithm groups the vectors into batches. At each batch, our algorithm updates the truncated singular values and vectors that represent all visited vectors, and reduces each batch by its own singular values and vectors so they can be stored in the memory with low overhead. After processing all batches, we re-transform these batch-wise singular vectors to the space spanned by the singular vectors of all features. We show that our algorithm can accelerate the training of state-of-the-art anomaly detection algorithm with close accuracy.
Figures & tables
Figure 1: Overview of the algorithm that use a batch of vectors Xb to update the singular values S1,b and vectors U1,b . The variables in the dashed boxes will be released after the corresponding operation.
Figure 2: Rotation of all projected Vb to the final space of U1,B . The variables in the dashed boxes will be released after the corresponding operation.
WideResNet50 [ 11 ]
ResNet18 [ 5 ]
Update parameter
k
N/A
128
256
N/A
128
256
nb
N/A
16K
32K
All
16K
32K
All
N/A
16K
32K
All
16K
32K
All
Image AUROC
All
99.1
98.9
98.9
98.9
99.1
99.1
99.0
97.3
96.9
97.1
96.9
97.2
97.2
97.1
Texture
99.3
98.9
99.1
99.0
99.3
99.2
99.2
97.9
96.7
96.9
96.3
97.5
97.3
97.1
Object
99.0
98.9
98.9
98.9
99.0
99.0
99.0
97.0
97.1
97.2
97.1
97.0
97.2
97.1
Pixel AUTOC
All
97.9
97.7
97.7
97.7
97.8
97.8
97.8
96.9
96.6
96.6
96.5
96.8
96.8
96.8
Table 1: Average AUROC on MVTec AD [ 1 ] . Different numbers ( k ) of singular values and batch sizes ( nb ) were tested when using dimension reduction.
k
N/A
128
256
nb
N/A
16K
32K
All
16K
32K
All
carpet
99.3
98.0
98.1
98.1
98.7
98.8
98.9
grid
99.3
98.9
99.5
99.0
99.5
99.1
99.2
leather
100.0
100.0
100.0
100.0
100.0
100.0
100.0
tile
99.3
99.3
99.5
99.4
99.3
99.2
99.3
wood
98.9
98.4
98.3
98.5
98.8
98.8
98.8
Table 2: Category-wise Image AUROC (%) on MVTec AD [ 1 ] with WideResNet50 [ 11 ] . Different numbers ( k ) of singular values and batch sizes ( nb ) were tested when using dimension reduction.
k
N/A
128
256
nb
N/A
16K
32K
All
16K
32K
All
GPU
130
39
38
37
53
51
51
CPU
23998
3333
2991
2965
5314
5073
4947
Table 3: Training time (seconds) on category hazelnut of MVTec AD [ 1 ] with WideResNet50 [ 11 ] . Please refer to the caption of Table 2 for the meaning of k and nb .
k
N/A
128
256
nb
N/A
16K
32K
All
16K
32K
All
GPU
128
37
36
35
50
49
48
CPU
26473
2979
2975
2795
4952
4792
4841
Table 4: Training time (seconds) on category hazelnut of MVTec AD [ 1 ] with ResNet18 [ 5 ] . Please refer to the caption of Table 2 for the meaning of k and nb .
AUROC
Method
L
Can.C.
Cho.C.
Cho.P.
Confet.
Gum.B.
Haz.T.
Lic.S.
Lollip.
Marsh.
Pep.C.
Avg.
Image
Ours
All
53.1
95.0
77.0
87.8
80.9
69.9
87.4
68.6
96.5
88.2
80.4
Ours
0
51.8
96.3
79.7
89.3
76.1
71.0
83.8
67.7
96.0
85.9
79.8
PaDiM
0
47.2
93.6
71.2
87.7
86.5
69.9
86.2
67.3
96.2
84.5
79.0
Pixel
Ours
All
91.6
97.3
86.6
98.2
93.5
85.7
94.1
96.3
97.0
97.3
93.8
Ours
0
89.8
97.0
86.2
98.2
93.6
86.1
93.6
96.4
96.6
96.3
93.4
PaDiM
0
92.7
96.6
87.1
97.6
93.9
88.1
93.7
96.8
97.5
97.0
94.1
Table 5: AUROC on the dataset Eyecandies [ 2 ] with PaDiM [ 4 ] and ours, which used k=128 and nb=32 K. We used WideResNet50 [ 11 ] as the feature extractor for both. The values were measured on the test images captured under lighting condition 0, whereas column L means lighting conditions of training images.