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.
Recent knowledge distillation (KD) methods for semantic segmentation introduce increasingly complex hand-crafted objectives, yet are typically evaluated under fixed iteration schedules. These objectives substantially increase per-iteration cost, meaning equal iteration counts do not correspond to equal training budgets. It is therefore unclear whether reported gains reflect stronger distillation signals or simply greater compute. We show that iteration-based comparisons are misleading: when wall-clock compute is matched, canonical logit- and feature-based KD outperform recent segmentation-specific methods. Under extended training, feature-based distillation achieves state-of-the-art ResNet-18 performance on Cityscapes and ADE20K. A PSPNet ResNet-18 student closely approaches its ResNet-101 teacher despite using only one quarter of the parameters, reaching 99% of the teacher's mIoU on Cityscapes (79.0 vs 79.8) and 92% on ADE20K. Our results challenge the prevailing assumption that KD for segmentation requires task-specific mechanisms and suggest that scaling, rather than complex hand-crafted objectives, should guide future method design.
Muhammad Ali, Kevin Alexander Laube, Madan Ravi Ganesh +3
University of Freiburg · Bosch Center for Artificial Intelligence · Aleph Alpha Research +1
Large-scale vision foundation models have driven substantial gains on dense prediction tasks such as semantic segmentation, but their size makes deployment impractical in resource-constrained settings, motivating knowledge distillation as a means of transferring their capabilities to lightweight student networks. However, modern foundation teachers are predominantly transformer-based that encode global context, whereas efficient students are typically convolutional networks with locally biased receptive fields. Existing distillation methods largely assume architectural homogeneity and rely on direct feature mimicry, which fails to bridge this representational gap and neglects the structured spatial dependencies and discriminative organization required for accurate semantic segmentation. In this paper, we propose SWARD, a knowledge distillation framework that addresses this gap through two complementary mechanisms. First, we introduce a Multi-Scale Windowed Attention Distillation (MWAD) module that aligns teacher-student attention-based relations within stochastically shifted window partitions whose offsets are randomly resampled at every training iteration. This removes window boundary bias, and, combined with the multi-scale design, captures both short- and long-range spatial dependencies. Second, we introduce Prototype Discriminative Regularization (PDR), a loss that helps shape the student's feature distribution by enforcing inter-class separation and intra-class compactness, further sharpening the discriminative structure beyond what feature mimicry alone can produce under the student's reduced capacity. Experiments across different vision applications (i.e., urban scene parsing and medical image segmentation) show that SWARD achieves state-of-the-art performance.
Aditya Makineni, Qing Tian
Department of Computer Science University of Alabama at Birmingham Birmingham, US
Knowledge distillation (KD) has been widely applied in semantic segmentation to compress large models, but conventional approaches primarily preserve in-domain accuracy while neglecting out-of-domain generalization, which is essential under distribution shifts. This limitation becomes more severe with the emergence of vision foundation models (VFMs): although VFMs exhibit strong robustness on unseen data, distilling them with conventional KD often compromises this ability. We propose Generalizable Knowledge Distillation (GKD), a multi-stage framework that explicitly enhances generalization. GKD decouples representation learning from task learning. In the first stage, the student acquires domain-agnostic representations through selective feature distillation, and in the second stage, these representations are frozen for task adaptation, thereby mitigating overfitting to visible domains. To further support transfer, we introduce a query-based soft distillation mechanism, where student features act as queries to teacher representations to selectively retrieve transferable spatial knowledge from VFMs. Extensive experiments on five domain generalization benchmarks demonstrate that GKD consistently outperforms existing KD methods, achieving average gains of +1.9% in foundation-to-foundation (F2F) and +10.6% in foundation-to-local (F2L) distillation. The code will be available at https://github.com/Younger-hua/GKD.
Chonghua Lv, Dong Zhao, Shuang Wang +4
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