TL;DR
This paper introduces "structured knowledge distillation" to train smaller, more efficient computer vision models for dense prediction tasks like semantic segmentation, depth estimation, and object detection. By transferring not just pixel-level information but also the structural relationships between pixels from a large "teacher" network to a compact "student" network, they achieve significant performance gains without increasing model size or computational cost.
What Problem Does This Paper Address?
Dense prediction tasks in computer vision, such as segmenting an image into different categories (semantic segmentation), estimating the distance of each pixel from the camera (depth estimation), or locating and classifying objects (object detection), are crucial for many applications. These tasks typically require large, computationally expensive neural networks to achieve high accuracy. However, deploying these models on resource-constrained devices like mobile phones necessitates smaller, more efficient "compact" models.
Knowledge distillation is a technique used to train these compact models by transferring knowledge from a larger, pre-trained "teacher" model. Existing distillation methods for dense prediction often treat each pixel independently, essentially applying image classification distillation techniques on a per-pixel basis. The authors argue that this pixel-wise approach overlooks the inherent "structured" nature of dense prediction problems, where the relationships between pixels are critical. This leads to suboptimal performance, especially for complex structures. The paper aims to bridge this gap by developing distillation methods that explicitly capture and transfer this structural information.
Methods
The core contribution of this paper is the proposal of two novel structured knowledge distillation schemes:
- Pair-wise Distillation: This method is inspired by the concept of Markov Random Fields, which are used to enforce spatial consistency in labeling. The goal here is to align the "pair-wise similarities" between different spatial locations in the compact student network and the teacher network. This is achieved by building a static "affinity graph." Nodes in this graph represent spatial locations, and connections represent their similarity. The authors explore different graph structures (connection range and granularity) to find an optimal balance between capturing structure and computational efficiency.
- Holistic Distillation: This scheme aims to capture higher-order, global structural relationships that are missed by pixel-wise and pair-wise methods. It employs adversarial training, similar to Generative Adversarial Networks (GANs). A discriminator network is trained to distinguish between the output structures of the teacher and student networks. The student network is then trained to fool the discriminator, effectively learning to produce outputs that are structurally similar to the teacher's. The authors use a Wasserstein distance loss for more stable adversarial training.
The overall objective function combines a standard task-specific loss (e.g., cross-entropy for segmentation) with these two structured distillation losses.
Datasets
The proposed methods were evaluated on several standard datasets for dense prediction tasks:
- Semantic Segmentation: Cityscapes, CamVid, and ADE20K.
- Depth Estimation: NYUD-V2.
- Object Detection: COCO.
Key Insights and Ideas
- Structure Matters: The most significant insight is that simply distilling pixel-level information is insufficient for dense prediction tasks. Explicitly transferring structural relationships (both local pair-wise and global holistic) from a teacher to a student network leads to substantial performance improvements.
- Pair-wise vs. Holistic: Both pair-wise and holistic distillation schemes offer complementary benefits. Pair-wise distillation captures local spatial consistency, while holistic distillation captures broader structural coherence. Combining them yields the best results.
- Adversarial Training for Structure: Using GANs for holistic distillation is an effective way to learn and transfer complex, high-order structural information that is difficult to capture with other methods.
- Compact Models Benefit Greatly: The structured distillation approach shows particularly significant gains when applied to smaller, more compact student networks, which are often limited by their capacity to learn complex structures on their own.
- Initialization is Key: For some tasks, pre-training the student network on datasets like ImageNet can further boost performance, but structured distillation still provides substantial improvements even without it.
Key Results
The paper demonstrates the effectiveness of their structured knowledge distillation approach across three dense prediction tasks:
- Semantic Segmentation: On the Cityscapes dataset, their method achieved significant improvements in mean IoU (mIoU) for compact networks like MobileNetV2Plus, ESPNet-C, and ESPNet. For example, MobileNetV2Plus achieved a 74.5% mIoU compared to 70.1% for the baseline without distillation. They also showed improvements for harder classes with low IoU scores, such as "bus" and "truck."
- Depth Estimation: On the NYUD-V2 dataset, their structured distillation method improved the mean absolute relative error (rel) from 0.181 to 0.173 for a baseline model, and further to 0.160 when using unlabeled data. This indicates that structured distillation is more effective than pixel-wise distillation for this task.
- Object Detection: On the COCO dataset, their method improved the mean Average Precision (mAP) for compact FCOS detectors. For instance, a MobileNetV2-based FCOS detector achieved 33.9% mAP with structured distillation, compared to 30.9% for the baseline. They also noted improvements in detecting small, occluded, and highly overlapped objects.
Limitations and Future Work
- Computational Cost of Pair-wise Graph: While the authors explore ways to manage the computational cost of the pair-wise affinity graph (e.g., by controlling connection range and granularity), constructing and processing these graphs can still add overhead.
- Hyperparameter Tuning: The effectiveness of the distillation schemes might depend on careful tuning of hyperparameters (e.g., the weights of different loss terms, graph parameters).
- Generalizability: While tested on three diverse tasks, further exploration on other dense prediction tasks and network architectures could be beneficial.
The authors suggest that their structured knowledge distillation methods are complementary to traditional pixel-wise distillation and can be further integrated with other techniques for even better performance. They also highlight the potential of using unlabeled data with their structured distillation approach.
Summary updated