CodesForLaneDetection : A machine learning model for detecting white lines on roads.

David Cochard
axinc-ai
Published in
3 min readMay 4, 2021

This is an introduction to「CodesForLaneDetection」, a machine learning model that can be used with ailia SDK. You can easily use this model to create AI applications using ailia SDK as well as many other ready-to-use ailia MODELS.

Overview

CodesForLaneDetection is a machine learning model released in August 2019. This model segments white lines on the road at the pixel level for an input image and can be used for applications such as automated driving.

Source: https://github.com/czming/RONELD-Lane-Detection/tree/main/example/00000.jpg
Source:https://arxiv.org/abs/1908.00821

Architecture

Lane detection is a difficult task because the lanes to be recognized might be occluded by objects, be interrupted or discontinued, and have varying lighting conditions. Lanes are also long and thin patterns, therefore the number of annotated pixels is smaller than background segmentation for example, resulting in sparse segmentation. It is possible to make the width of the lanes thicker in the annotated data to overcome the segmentation sparsity, but this will decrease the recognition accuracy.

For performing sparse segmentation, techniques called Multi Task Learning (MTL) and Message Passing (MP) are used. However, MTL requires additional annotations, while MP increases the inference time.

CodesForLaneDetection improves accuracy by using Self Attention Distillation (SAD) to train the layers closer to the input with information from the layers closer to the output. Specifically, the training is performed by adding constraints such that the output of the Attention Map of each block is close to the Attention Map of the next block.

Source:https://arxiv.org/abs/1908.00821

Since SAD acts on the training, it can be used in combination with any CNN and does not affect the inference speed.

ENet, ResNet, and ERFNet are examples of CNN Backbones. ERFNet (Efficient Residual Factorized ConvNet for Real-time Semantic Segmentation) is a model architecture for real-time segmentation that was released in December 2017.

ERFNet architecture (http://www.robesafe.uah.es/personal/eduardo.romera/pdfs/Romera17tits.pdf

CodesForLaneDetection has three models, namely ENet-TuSimple, ERFNet-CULane, and ENet-BDD100K, for each data set, respectively TuSimple, CULane, and BDD100K.

Usage

You can use the following command to detect the white lines in any video. Currently, only ERFNet-CULane is supported.

python3 codes-for-lane-detection.py --video VIDEO_PATH

Below if an output example.

ax Inc. has developed ailia SDK, which enables cross-platform, GPU-based rapid inference.

ax Inc. provides a wide range of services from consulting and model creation, to the development of AI-based applications and SDKs. Feel free to contact us for any inquiry.

--

--