- Clone our repo and create conda environment.
git clone https://github.com/Debrove/RMRKD.git && cd RMRKD
conda create -n rmrkd python=3.8
conda activate rmrkd
- Install Pytorch and other dependencies Please refer MMSegmentation for detail installation.
pip install torch==1.12.0+cu116 torchvision==0.13.0+cu116 --extra-index-url https://download.pytorch.org/whl/cu116
pip install openmim
mim install mmcv-full==1.7.0
mim install mmsegmentation==0.29.1
pip install -r requirements.txt
Please follow MMSegmentation to prepare datasets.
#single GPU
python tools/train.py configs/distillers/rmrkd/psp_r101_distill_psp_r18_40k_512x512_city.py
#multi GPU
bash tools/dist_train.sh configs/distillers/rmrkd/psp_r101_distill_psp_r18_40k_512x512_city.py 8
# Tansfer the RMRKD model into mmseg model
python pth_transfer.py --mgd_path $ckpt --output_path $new_mmseg_ckpt
#single GPU
python tools/test.py configs/pspnet/pspnet_r18-d8_512x512_40k_cityscapes.py $new_mmseg_ckpt --eval mIoU
#multi GPU
bash tools/dist_test.sh configs/pspnet/pspnet_r18-d8_512x512_40k_cityscapes.py $new_seg_ckpt 8 --eval mIoU
| Teacher | Student | Baseline(mIoU) | +RMRKD(mIoU) | config |
|---|---|---|---|---|
| PspNet-R101 | PspNet-R18 | 69.37 | 75.72 | config |
| PspNet-R101 | DeepLabV3-R18 | 73.37 | 76.72 | config |
| DeepLabV3 plus-R101 | MobileNetV2 | 73.76 | 76.87 | config |
| DeepLabV3-R101 | MobileNetV2 | 73.11 | 76.32 | config |
| Teacher | Student | Baseline(mIoU) | +RMRKD(mIoU) | config |
|---|---|---|---|---|
| PspNet-R101 | PspNet-R18 | 70.52 | 74.64 | config |
| PspNet-R101 | DeepLabV3-R18 | 71.60 | 74.97 | config |
Our code is based on MMSegmentation, MGD, CIRKD. Many thanks to these great works and open-source codebases.
@article{zheng2025region,
title={Region-aware mutual relational knowledge distillation for semantic segmentation},
author={Zheng, Haowen and Lin, Xuxin and Liang, Hailun and Zhou, Benjia and Liang, Yanyan},
journal={Pattern Recognition},
volume={161},
pages={111319},
year={2025},
publisher={Elsevier}