[Paper Review] TransKD: Transformer Knowledge Distillation for Efficient Semantic Segmentation
TransKD distills both transformer patch embeddings and feature maps from a large teacher to a compact student to achieve efficient semantic segmentation with substantially reduced FLOPs while maintaining competitive accuracy.
Semantic segmentation benchmarks in the realm of autonomous driving are dominated by large pre-trained transformers, yet their widespread adoption is impeded by substantial computational costs and prolonged training durations. To lift this constraint, we look at efficient semantic segmentation from a perspective of comprehensive knowledge distillation and aim to bridge the gap between multi-source knowledge extractions and transformer-specific patch embeddings. We put forward the Transformer-based Knowledge Distillation (TransKD) framework which learns compact student transformers by distilling both feature maps and patch embeddings of large teacher transformers, bypassing the long pre-training process and reducing the FLOPs by >85.0%. Specifically, we propose two fundamental modules to realize feature map distillation and patch embedding distillation, respectively: (1) Cross Selective Fusion (CSF) enables knowledge transfer between cross-stage features via channel attention and feature map distillation within hierarchical transformers; (2) Patch Embedding Alignment (PEA) performs dimensional transformation within the patchifying process to facilitate the patch embedding distillation. Furthermore, we introduce two optimization modules to enhance the patch embedding distillation from different perspectives: (1) Global-Local Context Mixer (GL-Mixer) extracts both global and local information of a representative embedding; (2) Embedding Assistant (EA) acts as an embedding method to seamlessly bridge teacher and student models with the teacher's number of channels. Experiments on Cityscapes, ACDC, NYUv2, and Pascal VOC2012 datasets show that TransKD outperforms state-of-the-art distillation frameworks and rivals the time-consuming pre-training method. The source code is publicly available at https://github.com/RuipingL/TransKD.
Motivation & Objective
- Motivate efficient semantic segmentation with transformers by reducing dependence on lengthy pre-training.
- Develop a comprehensive distillation framework that leverages transformer-specific patch embeddings and feature maps.
- Bridge teacher-student gaps through novel modules enabling multi-source knowledge transfer.
- Show that distilling patch embeddings alongside feature maps improves hard-example segmentation.
Proposed method
- Distill both patch embeddings and feature maps from teacher to student across four transformer stages.
- Introduce Patch Embedding Alignment (PEA) with a learnable projection to align channel dimensions for embeddings.
- Use Global-Local Context Mixer (GL-Mixer) to capture global and local context in embeddings for distillation.
- Apply Cross Selective Fusion (CSF) to fuse cross-stage feature maps via channel attention for relation-based feature map distillation.
- Incorporate Embedding Assistant (EA) to bridge teacher and student channels by forming a pseudo assistant model without extra training stages.
- Combine patch embedding distillation (PEA/GL-Mixer/EA) with feature map distillation (CSF) into a unified loss with cross-entropy.
- Evaluate TransKD variants on Cityscapes, ACDC, NYUv2, and Pascal VOC2012 to demonstrate improvements over KD baselines and competitiveness with pre-training.
Experimental results
Research questions
- RQ1How can knowledge be transferred from large transformer teachers to compact student transformers for semantic segmentation?
- RQ2Does incorporating transformer-specific patch embedding distillation improve performance beyond feature-map distillation alone?
- RQ3Can cross-stage feature fusion and embedding alignment bridge the teacher-student gap effectively without lengthy pre-training?
- RQ4How do TransKD variants perform across diverse datasets (Cityscapes, ACDC, NYUv2, Pascal VOC2012) and backbone models?
Key findings
- TransKD reduces FLOPs by more than 85% while maintaining competitive accuracy.
- TransKD-Base improves mIoU over KR-based distillation by 5.18% with only 0.21M extra training parameters.
- On Cityscapes, TransKD improves non-pretrained SegFormer-B0 mIoU by 13.12% and pre-trained by 2.09%.
- TransKD consistently boosts accuracy across multiple transformer architectures and datasets.
- The best TransKD variant achieves 75.74% mIoU with 3.72M parameters.
- TransKD rivals time-consuming pre-training approaches in performance while being more efficient.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.