[论文解读] TransKD: Transformer Knowledge Distillation for Efficient Semantic Segmentation
TransKD 将来自大型教师的 transformer patch 嵌入和特征图同时蒸馏给紧凑的学生,以实现高效的语义分割,在显著降低 FLOPs 的同时保持具有竞争力的精度。
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.
研究动机与目标
- 通过降低对冗长预训练的依赖,推动使用 Transformer 的高效语义分割。
- 开发一个综合蒸馏框架,利用 transformer 特定的 patch embedding 和特征图。
- 通过新颖模块实现多源知识传递,弥合教师-学生之间的差距。
- 表明将 patch embeddings 与特征图一并蒸馏能够提升难例分割的性能。
提出的方法
- 在四个 Transformer 阶段中,将教师的 patch embedding 和特征图同时蒸馏给学生。
- 引入 Patch Embedding Alignment (PEA),通过可学习的投影对齐嵌入的通道维度。
- 使用 Global-Local Context Mixer (GL-Mixer) 在嵌入中捕捉全局与局部上下文以用于蒸馏。
- 应用 Cross Selective Fusion (CSF) 通过通道注意力融合跨阶段的特征图,以进行基于关系的特征图蒸馏。
- 引入 Embedding Assistant (EA) 通过形成一个伪助手模型来连接教师和学生的通道,无需额外的训练阶段。
- 将 patch embedding 蒸馏(PEA/GL-Mixer/EA)与特征图蒸馏(CSF)结合成一个带有交叉熵的统一损失。
- 在 Cityscapes、ACDC、NYUv2 和 Pascal VOC2012 上评估 TransKD 变体,以证明相较于 KD 基线的改进以及与预训练的竞争力。
实验结果
研究问题
- RQ1如何将来自大型 Transformer 教师的知识传递给紧凑的学生 Transformer,以进行语义分割?
- RQ2将 transformer 特定的 patch embedding 蒸馏纳入是否能在单独的特征图蒸馏基础上提升性能?
- RQ3跨阶段特征融合和嵌入对齐是否能够在无需冗长预训练的情况下有效弥合教师-学生差距?
- RQ4TransKD 变体在多样数据集(Cityscapes、ACDC、NYUv2、Pascal VOC2012)和不同骨干模型上的表现如何?
主要发现
- TransKD 将 FLOPs 降低超过 85%,同时保持具竞争力的精度。
- TransKD-Base 在 KR 基于蒸馏的 mIoU 上提升 5.18%,仅额外增加 0.21M 个训练参数。
- 在 Cityscapes 上,TransKD 将未预训练的 SegFormer-B0 的 mIoU 提升 13.12%,预训练的提升 2.09%。
- TransKD 在多种 Transformer 架构和数据集上持续提升精度。
- 最佳 TransKD 变体在 3.72M 参数下达到 75.74% 的 mIoU。
- TransKD 在性能上与耗时的预训练方法相媲美,同时更高效。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。