Learning Lightweight Lane Detection CNNs by Self Attention Distillation

Yuenan Hou, Zheng Ma, Chunxiao Liu, Chen Change Loy

Abstract

Training deep models for lane detection is challenging due to the very subtle and sparse supervisory signals inherent in lane annotations. Without learning from much richer context, these models often fail in challenging scenarios, e.g., severe occlusion, ambiguous lanes, and poor lighting conditions. In this paper, we present a novel knowledge distillation approach, i.e., Self Attention Distillation (SAD), which allows a model to learn from itself and gains substantial improvement without any additional supervision or labels. Specifically, we observe that attention maps extracted from a model trained to a reasonable level would encode rich contextual information. The valuable contextual information can be used as a form of 'free' supervision for further representation learning through performing top-down and layer-wise attention distillation within the network itself. SAD can be easily incorporated in any feedforward convolutional neural networks (CNN) and does not increase the inference time. We validate SAD on three popular lane detection benchmarks (TuSimple, CULane and BDD100K) using lightweight models such as ENet, ResNet-18 and ResNet-34. The lightest model, ENet-SAD, performs comparatively or even surpasses existing algorithms. Notably, ENet-SAD has 20x fewer parameters and runs 10x faster compared to the state-of-the-art SCNN, while still achieving compelling performance in all benchmarks.

Introduction

Lane detection is a cornerstone of autonomous driving, yet it is notoriously difficult for AI due to the "sparse supervision" problem. Lanes are long and thin, occupying very few pixels compared to the background, which provides a weak signal for neural networks to learn from. Previous strategies to combat this, such as Message Passing (MP) or Multi-Task Learning (MTL), either introduced significant computational overhead or required expensive additional manual labeling.

The authors introduce Self-Attention Distillation (SAD), a training technique that allows networks to learn from their own internal representations. By distilling knowledge from deeper layers down to shallower ones, they enable models to capture richer context without any extra labels or inference-time speed penalties.

Methodology

In a standard Convolutional Neural Network (CNN), deeper layers typically capture global semantic context, while shallower layers focus on local details like edges. SAD exploits this hierarchy through a top-down distillation process:

  1. Attention Extraction: The model generates "attention maps" from its own internal blocks, highlighting regions of importance.
  2. Top-Down Distillation: During training, the model is forced to make the attention maps of its lower layers mimic those of its higher layers.
  3. Self-Learning: The model acts as its own teacher, refining its feature extraction through this internal feedback loop.
The SAD architecture: attention maps from deeper blocks act as targets for shallower blocks during training.

Crucially, these distillation paths are only active during training. Once deployed, the model retains the accuracy boost with zero increase in inference time.

Key Results and Insights

The researchers validated SAD on three major benchmarks: TuSimple, CULane, and BDD100K. The resulting ENet-SAD model demonstrated exceptional efficiency, running at ~75 FPS (13.4ms) with only 0.98 million parameters. In comparison, the previous state-of-the-art (SCNN) was 10x slower and 20x larger while achieving lower accuracy on several benchmarks.

Visualizations confirm that SAD helps the network "refine its focus." Before SAD, lower layers often focus on irrelevant noise like road curbs. After SAD, these layers learn to focus specifically on lane-relevant regions much earlier in the network.

Comparison of attention maps with and without SAD across different network blocks. SAD helps the model focus on lane-relevant features earlier.

The authors also noted that distilling between adjacent blocks (e.g., Block 3 to Block 2) is more effective than distilling across the entire network, as the semantic gap between distant layers is harder to bridge.

Conclusion

Self-Attention Distillation provides a powerful, label-free method for enhancing lane detection. By helping the network use the information it has already extracted more effectively, SAD allows lightweight models to achieve state-of-the-art performance. This "self-distillation" logic holds promise for other fine-grained computer vision tasks, such as image matting or saliency detection.

Summary updated

Abstract

Training deep models for lane detection is challenging due to the very subtle and sparse supervisory signals inherent in lane annotations. Without learning from much richer context, these models often fail in challenging scenarios, e.g., severe occlusion, ambiguous lanes, and poor lighting conditions. In this paper, we present a novel knowledge distillation approach, i.e., Self Attention Distillation (SAD), which allows a model to learn from itself and gains substantial improvement without any additional supervision or labels. Specifically, we observe that attention maps extracted from a model trained to a reasonable level would encode rich contextual information. The valuable contextual information can be used as a form of 'free' supervision for further representation learning through performing topdown and layer-wise attention distillation within the network itself. SAD can be easily incorporated in any feedforward convolutional neural networks (CNN) and does not increase the inference time. We validate SAD on three popular lane detection benchmarks (TuSimple, CULane and BDD100K) using lightweight models such as ENet, ResNet-18 and ResNet-34. The lightest model, ENet-SAD, performs comparatively or even surpasses existing algorithms. Notably, ENet-SAD has 20 x fewer parameters and runs 10 x faster compared to the state-of-the-art SCNN, while still achieving compelling performance in all benchmarks. Our code is available at https://github.com/cardwing/Codes-for-Lane-Detection.
BibTeX
@inproceedings{hou2019learning,
  author = {Yuenan Hou and Zheng Ma and Chunxiao Liu and Chen Change Loy},
  title = {{Learning Lightweight Lane Detection CNNs by Self Attention Distillation}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2019},
  doi = {10.1109/iccv.2019.00110},
}
Figure