Structured Knowledge Distillation for Semantic Segmentation

Yifan Liu, Ke Chen, Chris Liu, Zengchang Qin, Zhenbo Luo, Jingdong Wang

Abstract

Semantic segmentation is a critical yet computationally expensive task, particularly for real-time applications on edge devices. While compact architectures like ENet and ESPNet offer efficiency, they often sacrifice significant accuracy compared to large-scale models. This paper introduces Structured Knowledge Distillation, a framework designed to bridge this performance gap. Unlike traditional distillation that focuses on independent pixel-wise labels, this approach captures the complex spatial dependencies inherent in segmentation. By integrating pixel-wise, pair-wise, and holistic distillation—the latter utilizing an adversarial training scheme—the proposed method enables small student networks to achieve state-of-the-art accuracy on benchmarks like Cityscapes and ADE20K without any additional computational overhead during inference.

Introduction

Semantic segmentation involves assigning a category label to every pixel in an image, a process vital for autonomous driving and mobile vision. Large models such as PSPNet achieve high accuracy but are too slow for real-time use. Conversely, compact networks are fast but less accurate. Knowledge Distillation (KD) is typically used to transfer knowledge from a "teacher" to a "student," but standard KD treats pixels as independent entities. This paper argues that because segmentation is a structured prediction problem, capturing spatial relationships (e.g., the proximity of "car" pixels) is essential.

Methodology

The authors propose a three-pronged distillation strategy to capture different levels of structural information:

  1. Pixel-wise Distillation: The student mimics the teacher's class probability distribution for each pixel using Kullback-Leibler (KL) divergence.
  2. Pair-wise Distillation: This captures local structure by forcing the student to replicate the similarity between pairs of pixels. If the teacher identifies two pixels as highly similar (belonging to the same object), the student learns this relationship via a similarity map based on feature vector dot products.
  3. Holistic Distillation: To capture global consistency, the framework employs a Generative Adversarial Network (GAN). A discriminator learns to distinguish between teacher-generated and student-generated segmentation maps. The student is then optimized to produce maps that are globally consistent and indistinguishable from the teacher's high-quality outputs.
Overview of the Structured Knowledge Distillation framework, showing (a) pair-wise, (b) pixel-wise, and (c) holistic distillation components.

The final objective function combines standard cross-entropy loss with these three distillation terms, weighted to balance their contributions.

Experimental Results

The framework was evaluated on three major benchmarks: Cityscapes, CamVid, and ADE20K. The results demonstrate significant accuracy gains across various compact architectures.

Accuracy (mIoU %) vs. Number of Parameters (M) on the Cityscapes dataset. Red triangles indicate models trained with the proposed structured distillation.

Key performance improvements include:

  • MobileNetV2Plus: mIoU increased from 68.9% to 74.0% on Cityscapes.
  • ResNet18 (0.5 width): mIoU jumped from 55.37% to 61.63%.
  • ESPNet: Improved from 60.3% to 62.0% mIoU.

Crucially, these gains come at no cost to inference speed, as the distillation components are only active during the training phase.

Discussion and Insights

The study highlights that segmentation accuracy is not just about individual pixel labels but about the manifold of the output. Holistic distillation via GANs helps the student learn high-order consistencies that pixel-wise losses miss. Furthermore, the three types of distillation are complementary; combining them yields the best results.

Structured distillation is particularly effective for large, structured objects like buses or trucks, helping the model maintain shape integrity. Additionally, the framework shows promise for semi-supervised learning, where the teacher provides "soft targets" for unlabeled data, leading to substantial mIoU gains (e.g., +13.5% on CamVid).

Limitations

While effective, the approach introduces training-time complexity due to the GAN framework and the $O(N^2)$ computational cost of calculating pair-wise similarities for high-resolution images. The student's performance is also inherently bounded by the quality of the teacher network.

Conclusion

Structured Knowledge Distillation provides a robust "free lunch" for compact semantic segmentation models. By teaching students to respect both local and global spatial structures, the framework significantly narrows the accuracy gap between efficient and cumbersome networks, making high-quality real-time segmentation more accessible for resource-constrained applications.

Summary updated

BibTeX
@inproceedings{liu2019structured,
  author = {Yifan Liu and Ke Chen and Chris Liu and Zengchang Qin and Zhenbo Luo and Jingdong Wang},
  title = {{Structured Knowledge Distillation for Semantic Segmentation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2019},
  doi = {10.1109/cvpr.2019.00271},
}
Figure