Organizations: Institute of Computing Technology, Chinese Academy of Sciences, Beijing 100190, China · Institute of Computing Technology, Chinese Academy of Sciences, Beijing 100190, China, and also with University of Chinese Academy of Sciences, Beijing 100049, China · Institute of Automation, Chinese Academy of Sciences, Beijing 100190, China, and also with University of Chinese Academy of Sciences, Beijing 100049, China · Institute of Artificial Intelligence, Beihang University, Beijing, China · the Department of Electrical Engineering, The City College, and the Department of Computer Science, the Graduate Center, the City University of New York, New York, NY, 10031 · the School of Computer Science and Control Engineering, Shenzhen University of Advanced Technology, Shenzhen 518107, China · the School of Automation, Chongqing University, Chongqing 400044, China
Existing Knowledge Distillation (KD) methods for semantic segmentation often guide the student to mimic the teacher's structured information generated from an individual image. However, they ignore the global semantic relations across various images that are valuable for KD. This paper proposes Cross-Image Relational KD V2 (CIRKDV2), which focuses on transferring structured pixel-to-pixel, pixel-to-region, and channel-to-channel relations modeled from global images in the dataset. A large teacher network often constructs a well-structured feature space in terms of global contextual dependencies. CIRKDV2 makes the student mimic the better structured semantic relations of the teacher, thus improving the feature representational capability. Beyond relational distillation, we further propose contextual feature distillation by using context aggregation to augment student pixel embeddings to match the semantic level with the teacher. This avoids the semantic gap problem between the teacher and student occurred in traditional feature distillation studies. Experimental results on Cityscapes, ADE20K, Pascal VOC, and COCO-Stuff-164K demonstrate that CIRKDV2 outperforms the state-of-the-art semantic segmentation distillation methods by large margins across various network architectures. Our code and pre-trained models are publicly available at https://github.com/winycg/CIRKD.
Figures & tables
Fig. 1: Overview of intra-image ( left ) and our proposed cross-image relational distillation ( right ). The circles with the same color denote pixel embeddings from the same image. ti and si represent the pixel embeddings of the i -th pixel location tagged in an image from the teacher and student, respectively. The dotted line shows the similarity relationship between two pixels. The circles and lines construct a relational graph.
Fig. 2: Overview of our proposed CIRKDV2.
Fig. 3: Overview of our proposed pixel-to-pixel and pixel-to-region distillation.
Fig. 4: Visualization of channel semantics over DeepLabV3 on Cityscapes. Each heatmap corresponds to one channel.
Fig. 5: Overview of our proposed channel and feature distillation.
Fig. 6: Illustration of individual class IoU scores over the student network DeepLabV3-MobileNetV3-Small with baseline (W/O distillation), the state-of-the-art LAD and our proposed CIRKDV2 on Cityscapes test set. Our CIRKDV2 can consistently improve individual class IoU scores compared to the baseline and LAD, especially for those challenging classes with low IoU scores.
Method
Params
FLOPs
mIoU (%)
T: DeepLabV3-ResNet-101
79.1M
3228.5G
78.30
S: DeepLabV3-ResNet-18
22.8M
972.4G
73.56
+SKD [ 17 ]
74.21
+IFVD [ 19 ]
74.35
+CWD [ 20 ]
74.28
+DSD [ 37 ]
74.05
TABLE I: Performance comparison with the state-of-the-art distillation methods over various CNN-based segmentation networks on Cityscapes.
Method
Params
FLOPs
mIoU (%)
T: DeepLabV3-ResNet-101
79.1M
3228.5G
78.30
S: DeepLabV3-MobileViT-XXS
2.4M
473.6G
66.24
+SKD [ 17 ]
67.45
+IFVD [ 19 ]
67.13
+CWD [ 20 ]
67.89
+DSD [ 37 ]
67.34
TABLE II: Performance comparison with the state-of-the-art distillation methods over various MobileViT-based segmentation networks on Cityscapes.
Method
Params
FLOPs
mIoU (%)
T: SegFormer-MiT-B4
64.0M
1,229.8G
80.38
S: SegFormer-MiT-B0
3.7M
121.7G
74.12
+SKD [ 17 ]
74.35
+IFVD [ 19 ]
74.18
+CWD [ 20 ]
73.86
+DSD [ 37 ]
74.70
TABLE III: Performance comparison with the state-of-the-art distillation methods over SegFormer networks on Cityscapes.
Fig. 7: Qualitative segmentation results on the validation set of Cityscapes using the DeepLabV3-MobileNetV3-Large network: (a) raw images, (b) the original student network without KD, (c) LAD, (d) our CIRKDV2, (e) Teacher, and (f) ground truth.
Fig. 8: T-SNE visualization of learned feature embeddings on the validation set of Cityscapes over the DeepLabV3-ResNet18 network trained with LAD ( left ) and our proposed CIRKDV2 ( right ).
Method
Params
FLOPs
mIoU (%)
T: DeepLabV3-ResNet-101
79.2M
575.0G
43.83
S: DeepLabV3-ResNet-18
22.8M
167.5G
36.92
+SKD [ 17 ]
38.12
+IFVD [ 19 ]
37.67
+CWD [ 20 ]
38.96
+DSD [ 37 ]
38.53
TABLE IV: Performance comparison with the state-of-the-art distillation methods over various segmentation networks on ADE20K.
Method
Params
FLOPs
mIoU (%)
T: DeepLabV3-ResNet-101
79.2M
575.0G
77.80
S: DeepLabV3-MobileNetV3-Small
3.3M
28.1G
62.45
+SKD [ 17 ]
63.49
+IFVD [ 19 ]
63.33
+CWD [ 20 ]
63.67
+DSD [ 37 ]
63.51
TABLE V: Performance comparison with the state-of-the-art distillation methods over various segmentation networks on Pascal VOC.
Fig. 9: Qualitative segmentation results on the validation set of ADE20K using the DeepLabV3-MobileNetV3-Large network: (a) raw images, (b) the original student network without KD, (c) LAD, (d) our CIRKDV2, (e) Teacher, and (f) ground truth.
Fig. 10: Qualitative segmentation results on the validation set of Pascal VOC using the DeepLabV3-MobileNetV3-Large network: (a) raw images, (b) the original student network without KD, (c) LAD, (d) our CIRKDV2, (e) Teacher, and (f) ground truth.
Method
Params
FLOPs
mIoU (%)
T: DeepLabV3-ResNet-101
79.2M
575.0G
38.48
S: DeepLabV3-ResNet-18
22.8M
167.5G
32.65
+SKD [ 17 ]
33.27
+IFVD [ 19 ]
33.30
+CWD [ 20 ]
33.81
+DSD [ 37 ]
33.26
TABLE VI: Performance comparison with the state-of-the-art distillation methods over various segmentation networks on COCO-Stuff-164K.
Fig. 11: Qualitative segmentation results on the validation set of COCO-Stuff-164K using the DeepLabV3-MobileNetV3-Large network: (a) raw images, (b) the original student network without KD, (c) LAD, (d) our CIRKDV2, (e) Teacher, and (f) ground truth.
Method
mIoU (%)
T: SAM-ViT-Large
42.82
S: SAM-ViT-Tiny
27.64
+MobileSAM [ 56 ]
28.91
+CIRKDV2
30.80
TABLE VII: Distillation experiments on SAM model on COCO-Stuff-164K.
Method
Time
GPU Memory
mIoU (%)
+Af-DCD [ 22 ]
16s
9.8GB
39.21
+LAD [ 23 ]
12s
8.5GB
39.37
+CIRKDV2 (Ours)
17s
11.7GB
39.82
TABLE VIII: Comparison of training efficiency over DeepLabV3-ResNet18 on ADE20K.
Student: SegFormer
B0
B0
B1
Dataset
Citys
ADE20K
ADE20K
W/O Distillation
74.12
33.83
38.12
+Contextual FD(W/O Nonlinear Branch)
74.67
35.18
38.73
+Contextual FD
74.75
35.39
38.94
+Channel FD
74.48
34.56
38.40
+mini-batch C2C
74.76
35.89
39.34
TABLE IX: Ablation study of Contextual FD and C2C distillation on SegFormer.
Loss
Ltask
Various distillation loss combinations of CIRKDV2
Lkd
-
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
Lbatch_p2p
-
-
✓
-
-
-
✓
-
-
-
-
-
-
✓
Lbatch_c2c
-
-
-
✓
-
✓
✓
-
-
-
-
-
-
✓
Lmemory_p2p
-
-
-
-
-
-
-
✓
-
-
-
✓
-
✓
Lmemory_p2r
-
-
-
-
-
-
-
-
✓
-
-
✓
-
✓
Lmemory_c2c
-
-
-
-
-
-
-
-
-
✓
✓
✓
-
✓
TABLE X: Ablation study of distillation loss terms on ADE20K.
Table 22
Queue size Np
20K
15K
10K
5K
Enqueue size Vp
16
24
32
40
Cityscapes mIoU (%)
75.26
75.18
75.12
75.04
ADE20K mIoU (%)
38.77
38.68
38.57
38.35
TABLE XIV: Analysis of pixel queue size with update frequency on DeepLabV3-ResNet-18.
Queue size Np
20K
15K
10K
5K
Enqueue size Vp
16
24
32
40
Cityscapes mIoU (%)
75.35
75.34
75.26
75.18
ADE20K mIoU (%)
36.52
36.50
36.42
36.27
TABLE XV: Analysis of pixel queue size with update frequency on SegFormer-MiT-B0.
Fig. 12: Impact of (a) the temperature τ , (b) the number of contrastive pixel embeddings Kp , (c) the number of contrastive region embeddings Kr , and (d) the number of contrastive channel embeddings Kc on ADE20K.
Fig. 13: Sensitivity analyses of (a) mini-batch-based distillation loss weight α , (b) memory-based distillation loss weight β , (c) channel distillation loss weight γ , and (d) contextual distillation loss weight λ on ADE20K.
School of Artificial Intelligence, Xidian University, China · Department of Information Engineering and Computer Science, University of Trento, Italy · Department of Automation, Tsinghua University, China +1