CIRKDV2: Cross-Image Relational Knowledge Distillation with Contextual Modeling for Efficient Semantic Segmentation

August 29, 2025 ยท View on GitHub

This repository contains the source code of CIRKDV2 and implementations of semantic segmentation distillation methods on popular datasets.

Requirement

Ubuntu 22.04 LTS

Python 3.9 (Anaconda is recommended)

CUDA 12.4

Install python packages:

pip install -r requirements.txt

Backbones pretrained on ImageNet-1K:

TypeBackbonePretrained
CNNResNet-101Download
CNNResNet-18Download
CNNMobileNetV3-SmallDownload
CNNMobileNetV3-LargeDownload
TransformerMobileViT-XXSDownload
TransformerMiT-B0Download
TransformerMiT-B4Download

Supported datasets:

DatasetTrain SizeVal SizeTest SizeClassLink
Cityscapes2975500152519Download
Pascal VOC Aug105821449--21Download
CamVid36710123311Download
ADE20K202102000--150Download
COCO-Stuff-164K1182875000--182Download

Distillation performance on Cityscapes

RoleNetworkMethodTest mIoUPretrainedScript
TeacherDeepLabV3-ResNet101-78.30Download-
StudentDeepLabV3-ResNet18Baseline73.56-Train|Eval
StudentDeepLabV3-ResNet18CIRKDV275.60DownloadTrain|Eval
StudentUperNet-ResNet18Baseline68.90-Train|Eval
StudentUperNet-ResNet18CIRKDV272.11DownloadTrain|Eval
StudentDeepLabV3-MobileNetV3-SmallBaseline65.05-Train|Eval
StudentDeepLabV3-MobileNetV3-SmallCIRKDV267.62DownloadTrain|Eval
StudentPSPNet-MobileNetV3-SmallBaseline62.78-Train|Eval
StudentPSPNet-MobileNetV3-SmallCIRKDV265.42DownloadTrain|Eval
StudentDeepLabV3-MobileViT-XXSBaseline66.24-Train|Eval
StudentDeepLabV3-MobileViT-XXSCIRKDV268.91DownloadTrain|Eval
StudentPSPNet-MobileViT-XXSBaseline65.48-Train|Eval
StudentPSPNet-MobileViT-XXSCIRKDV268.45DownloadTrain|Eval
RoleNetworkMethodTest mIoUPretrainedScript
TeacherSegFormer-MiT-B4-80.38Download-
StudentSegFormer-MiT-B0Baseline74.12-Train|Eval
StudentSegFormer-MiT-B0CIRKDV275.52DownloadTrain|Eval

You can zip the resulting images and submit it to the Cityscapes test server to obtain the test mIoU.

Distillation performance on ADE20K

RoleNetworkMethodVal mIoUPretrainedScript
TeacherDeepLabV3-ResNet101-43.83Download
StudentDeepLabV3-ResNet18Baseline36.92-Train|Eval
StudentDeepLabV3-ResNet18CIRKDV239.82DownloadTrain|Eval
StudentUperNet-ResNet-18Baseline34.37-Train|Eval
StudentUperNet-ResNet-18CIRKDV236.87DownloadTrain|Eval
StudentDeepLabV3-MobileNetV3-LargeBaseline32.83-Train|Eval
StudentDeepLabV3-MobileNetV3-LargeCIRKDV236.14DownloadTrain|Eval
StudentPSPNet-MobileNetV3-LargeBaseline33.63-Train|Eval
StudentPSPNet-MobileNetV3-LargeCIRKDV236.01DownloadTrain|Eval

Distillation performance on Pascal VOC

RoleNetworkMethodVal mIoUPretrainedScript
TeacherDeepLabV3-ResNet101-77.80Download
StudentDeepLabV3-MobileNetV3-SmallBaseline62.45-Train|Eval
StudentDeepLabV3-MobileNetV3-SmallCIRKDV264.67DownloadTrain|Eval
StudentDeepLabV3-MobileNetV3-LargeBaseline69.33-Train|Eval
StudentDeepLabV3-MobileNetV3-LargeCIRKDV271.90DownloadTrain|Eval
StudentPSPNet-MobileNetV3-SmallBaseline61.92-Train|Eval
StudentPSPNet-MobileNetV3-SmallCIRKDV263.84DownloadTrain|Eval
StudentPSPNet-MobileNetV3-LargeBaseline68.77-Train|Eval
StudentPSPNet-MobileNetV3-LargeCIRKDV271.55DownloadTrain|Eval

Distillation performance on COCO-Stuff-164K

RoleNetworkMethodVal mIoUPretrainedScript
TeacherDeepLabV3-ResNet101-38.48Download
StudentDeepLabV3-ResNet-18Baseline32.65-Train|Eval
StudentDeepLabV3-ResNet-18CIRKDV234.42DownloadTrain|Eval
StudentPSPNet-MobileNetV3-SmallBaseline26.48-Train|Eval
StudentPSPNet-MobileNetV3-SmallCIRKDV228.28DownloadTrain|Eval
StudentDeepLabV3-MobileNetV3-SmallBaseline26.04-Train|Eval
StudentDeepLabV3-MobileNetV3-SmallCIRKDV227.66DownloadTrain|Eval
StudentDeepLabV3-MobileNetV3-LargeBaseline30.31-Train|Eval
StudentDeepLabV3-MobileNetV3-LargeCIRKDV232.14DownloadTrain|Eval

Visualization of segmentation mask using pretrained models

DatasetColor PalleteBlendScripts
Pascal VOCtop1top1sh
Cityscapestop1top1sh
ADE20Ktop1top1sh
COCO-Stuff-164Ktop1top1sh

Citation

We would appreciate it if you could give this repo a star or cite our paper!

@inproceedings{yang2022cross,
  title={Cross-image relational knowledge distillation for semantic segmentation},
  author={Yang, Chuanguang and Zhou, Helong and An, Zhulin and Jiang, Xue and Xu, Yongjun and Zhang, Qian},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={12319--12328},
  year={2022}
}

@article{yang2023online,
    title={CIRKDV2: Cross-Image Relational Knowledge Distillation with Contextual Modeling for Efficient Semantic Segmentation},
    author={Yang, Chuanguang and Wang, Yu and Yu, Chengqing and Yu, Xinqiang and Feng, Weilun and Li, Yuqi and An, Zhulin and Huang, Libo and Diao, Boyu and Wang, Fei and Zhuang, Fuzhen and Xu, Yongjun and Tian, Yingli and Huang, Tingwen and Song, Yongduan},
    journal={Technical Report},
    pages={1--17},
    year={2025}
}