Abstract
Recently, large-scale pre-trained models have shown their advantages in many tasks. However, due to the huge computational complexity and storage requirements, it is challenging to apply the large-scale model to real scenes. A common solution is knowledge distillation which regards the large-scale model as a teacher model and helps to train a small student model to obtain a competitive performance. Cross-task Knowledge distillation expands the application scenarios of the large-scale pre-trained model. Existing knowledge distillation works focus on directly mimicking the final prediction or the intermediate layers of the teacher model, which represent the global-level characteristics and are task-specific. To alleviate the constraint of different label spaces, capturing invariant intrinsic local object characteristics (such as the shape characteristics of the leg and tail of the cattle and horse) plays a key role. Considering the complexity and variability of real scene tasks, we propose a Prototype-guided Cross-task Knowledge Distillation (ProC-KD) approach to transfer the intrinsic local-level object knowledge of a large-scale teacher network to various task scenarios. First, to better transfer the generalized knowledge in the teacher model in cross-task scenarios, we propose a prototype learning module to learn from the essential feature representation of objects in the teacher model. Secondly, for diverse downstream tasks, we propose a task-adaptive feature augmentation module to enhance the features of the student model with the learned generalization prototype features and guide the training of the student model to improve its generalization ability. The experimental results on various visual tasks demonstrate the effectiveness of our approach for large-scale model cross-task knowledge distillation scenes.
Introduction
Large-scale pre-trained models, such as Vision Transformers, have set new benchmarks across various computer vision tasks. However, their massive computational and storage demands often preclude deployment on resource-constrained edge devices. Knowledge Distillation (KD) has emerged as a standard technique to address this, where a large "teacher" model guides the training of a smaller "student" model.
Traditional KD approaches typically operate under a "same-task" constraint, requiring the teacher and student to share the same label space. This limits the utility of powerful, general-purpose models when the target downstream task involves different categories or domains. Existing cross-task methods often fail because they attempt to distill global-level features that are too specific to the teacher's original training task.
Methodology: ProC-KD
To overcome these limitations, the authors propose ProC-KD (Prototype-guided Cross-task Knowledge Distillation). The core insight is that while global class labels change between tasks, intrinsic local-level characteristics—such as the shape of a leg or the texture of fur—remain invariant across different object categories. By focusing on these "prototypes," knowledge can be effectively transferred across disparate tasks.
As shown in the framework below, ProC-KD consists of two primary components:
- Prototype Learning Module: This module extracts essential, generalized feature representations from the teacher's intermediate layers. These prototypes capture universal visual concepts that are consistent across different datasets.
- Task-adaptive Feature Augmentation Module: This component uses an attention mechanism to selectively inject relevant prototype knowledge into the student model, enriching its features while filtering out task-irrelevant noise.
The training process is governed by a joint loss function that includes embedding-layer distillation for aligning hidden states, consistency loss for feature alignment, and prototype classification loss to ensure the learned prototypes remain discriminative. Notably, ProC-KD operates in a single stage, offering greater efficiency than previous multi-stage cross-task methods.
Experimental Results
The effectiveness of ProC-KD was validated across multiple challenging scenarios:
- Image Classification: On CIFAR-100, a student model distilled from a ViT-B teacher saw an accuracy boost from 78.84% to 87.46%.
- Long-tailed Learning: On the iNaturalist 2018 dataset, ProC-KD improved accuracy by nearly 2% over state-of-the-art distillation methods, demonstrating superior performance in data-scarce regimes.
- Object Detection: In urban scene detection (Cityscapes), ProC-KD achieved a Mean Average Precision (mAP) of 62.1%, significantly outperforming the student-only baseline of 47.8%.
- Robustness: Tests on FoggyCityscapes showed that prototype-guided features are more resilient to low-visibility conditions compared to standard features.
Conclusion
ProC-KD provides a robust framework for cross-task knowledge distillation by shifting the focus from task-specific global predictions to invariant local prototypes. This approach enables the efficient transfer of knowledge from massive pre-trained models to specialized downstream students, facilitating the deployment of high-performance models in diverse real-world applications.
Summary updated