Skip to content

A SegNet model trained for segmentation of Lanes suitable for driving for automobiles.

Notifications You must be signed in to change notification settings

Moddy2024/Lane-Detection

Repository files navigation

Lane-Detection

Lane-Detection system used to predict the lane in which a car will be able to drive. In this project, I use a deep learning-based approach using a fully convolutional network to output an image of a predicted lane. This architecture is based on SegNet an Encoder-Decoder Architecture for Image Segmentation. The model first predicts the Lane after which it is drawn in Green color on a blank image then it is merged with the original image.

Architecture

SegNet is a semantic segmentation model. This core trainable segmentation architecture consists of an encoder network, a corresponding decoder network followed by a pixel-wise classification layer.

This is the visualization of the architecture of the CNN model that is being used for Lane Detection.

Software requirements

To be able to run this you need to have installed

Key Files

  • lane-detection.ipynb - In this file it shows how the data has been normalized, the training of the model is also present here and you can see the CNN that has been used here.
  • models - This directory consists the trained models in different formats. They are available in h5,tar and pth format.
  • model-prediction.ipynb - Using any one of the trained model files from the above folder and an input video, this predicts the lane, and returns the original video with predicted lane lines drawn onto it.
  • model-visualization.ipynb - Using visualkeras to visualize the SegNet architecture.
  • Results - Here I have added some of the results that has been predicted.

Training and Validation Image Statistics

The images were collected from a mix of different times of day, weather, traffic, and road curvatures.

  • Some are from clear night driving, some are from rainy morning driving, and rest from cloudy afternoon driving.
  • The roads also contain difficult areas such as construction and intersections.
  • Some are straight or mostly straight roads, some are a mix or moderate curves, and most are very curvy roads.
  • Finally, horizontal flips of each and every road image and its corresponding label were added, so at the end a total of 12,764 images are present in the dataset.

Dataset

The full set of images used are here and the full set of labels (which are just the 'G' channel from an RGB image of a re-drawn lane) here