README.md

June 8, 2026 · View on GitHub

Adaptive Inter-Class Similarity Distillation for Semantic Segmentation

arXiv Stars Forks

This repository contains the source code of AICSD (Adaptive Inter-Class Similarity Distillation for Semantic Segmentation ).

Intra-class distributions for each class. Distributions are created by applying softmax to spatial dimension of output prediction of last layer. Similarities between each pair of intra-class distributions have good potential for distillation. Distributions are created from the PASCAL VOC 2012 dataset with 21 category classes.

Method Diagram

Overall diagram of the proposed AICSD. Network outputs are flattened into 1D vectors, followed by application of a softmax function to create intra-class distributions. KL divergence is then calculated between each distribution to create inter-class similarity matrices. An MSE loss function is then defined between the ICS matrices of the teacher and student. Also, KL divergence is calculated between the logits of the teacher and student for pixel-wise distillation. To mitigate the negative effects of teacher network, an adaptive weighting loss strategy is used to scale two distillation losses and ross-entropy loss of semantic segmentation. During training, hyperparameter α\alpha undergoes adaptive changes and progressively increases with epoch number.

Performance on PascalVOC2012

MethodmIoU(%)Params(M)
Teacher: Deeplab-V3 + (ResNet-101)77.8559.3
Student1: Deeplab-V3 + (ResNet-18)67.5016.6
Student2: Deeplab-V3 + (MobileNet-V2)63.925.9
Student1 + KD69.13 ± 0.1116.6
Student1 + AD68.95 ± 0.2616.6
Student1 + SP69.04 ± 0.1016.6
Student1 + ICKD69.13 ± 0.1716.6
Student1 + AICSD (ours)70.03 ± 0.1316.6
Student2 + KD66.39 ± 0.215.9
Student2 + AD66.27 ± 0.175.9
Student2 + SP66.32 ± 0.055.9
Student2 + ICKD67.01 ± 0.105.9
Student2 + AICSD (ours)68.05 ± 0.245.9

Performance on CityScapes

MethodmIoU(%)Accuracy(%)
T: ResNet10177.6684.05
S1: ResNet1864.0974.8
S2: MobileNet v263.0573.38
S1 + KD65.21 (+1.12)76.32 (+1.74)
S1 + AD65.29 (+1.20)76.27 (+1.69)
S1 + SP65.64 (+1.55)76.90 (+2.05)
S1 + ICKD66.98 (+2.89)77.48 (+2.90)
S1 + AICSD (ours)68.46 (+4.37)78.30 (+3.72)
S2 + KD64.03 (+0.98)75.34 (+1.96)
S2 + AD63.72 (+0.67)74.79 (+1.41)
S2 + SP64.22 (+1.17)75.28 (+1.90)
S2 + ICKD65.55 (+2.50)76.48 (+3.10)
S2 + AICSD (ours)66.53 (+3.48)76.96 (+3.58)

Visualization

How to run

For ICSD method:

python train_kd.py --backbone resnet18 --dataset pascal  --pa_lambda 9500

For AICSD method:

python train_kd.py --backbone resnet18 --dataset pascal  --pa_lambda 9500 --pi_lambda 10 --ALW

Teacher model

Download following pre-trained teacher network and put it into pretrained/ directory

measure performance on test set with Pascal VOC evaluation server.

Citation

If you use this repository for your research or wish to refer to our distillation method, please use the following BibTeX entries:


@article{mansourian2025aicsd,
  title={AICSD: Adaptive inter-class similarity distillation for semantic segmentation},
  author={Mansourian, Amir M and Ahamdi, Rozhan and Kasaei, Shohreh},
  journal={Multimedia Tools and Applications},
  pages={1--20},
  year={2025},
  publisher={Springer}
}

@inproceedings{mansourian2026enriching,
  title={Enriching knowledge distillation with cross-modal teacher fusion},
  author={Mansourian, Amir M and Babaei, Amir Mohammad and Kasaei, Shohreh},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={2893--2903},
  year={2026}
}

@inproceedings{mansourian2026attention,
  title={Attention as Geometric Transformation: Revisiting Feature Distillation for Semantic Segmentation},
  author={Mansourian, Amirmohammad and Jalali, Arya and Ahmadi, Rozhan and Kasaei, Shohreh},
  booktitle={Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision},
  pages={1287--1297},
  year={2026}
}

@article{mansourian2025a,
title={A Comprehensive Survey on Knowledge Distillation},
author={Amir M. Mansourian and Rozhan Ahmadi and Masoud Ghafouri and Amir Mohammad Babaei and Elaheh Badali Golezani and Zeynab yasamani ghamchi and Vida Ramezanian and Alireza Taherian and Kimia Dinashi and Amirali Miri and Shohreh Kasaei},
journal={Transactions on Machine Learning Research},
issn={2835-8856},
year={2025}
}

Acknowledgement

This codebase is heavily borrowed from A Comprehensive Overhaul of Feature Distillation . Thanks for their excellent work.