Code underlying the publication: Efficient Sequential Neural Network based on Spatial-Temporal Attention and Linear LSTM for Robust Lane Detection Using Multi-Frame Images

DOI:10.4121/4619cab6-ae4a-40d5-af77-582a77f3d821.v1
The DOI displayed above is for this specific version of this dataset, which is currently the latest. Newer versions may be published in the future. For a link that will always point to the latest version, please use
DOI: 10.4121/4619cab6-ae4a-40d5-af77-582a77f3d821
Datacite citation style:
Dong, Yongqi; Patil, Sandeep; Haneen Farah; Hellendoorn, Hans (2025): Code underlying the publication: Efficient Sequential Neural Network based on Spatial-Temporal Attention and Linear LSTM for Robust Lane Detection Using Multi-Frame Images. Version 1. 4TU.ResearchData. dataset. https://doi.org/10.4121/4619cab6-ae4a-40d5-af77-582a77f3d821.v1
Other citation styles (APA, Harvard, MLA, Vancouver, Chicago, IEEE) available at Datacite

Dataset

This is the source code of the paper:

Patil, S.#, Dong, Y.#,*, Farah, H, & Hellendoorn, J. (2024). Efficient Sequential Neural Network Based on Spatial-Temporal Attention and Linear LSTM for Robust Lane Detection Using Multi-Frame Images (Under Review)


How to use the codes

(1) Download tvtLANE Dataset:

You can download this **dataset** from the link in the '**Dataset-Description-v1.2.pdf**' file. 

BaiduYun:https://pan.baidu.com/s/1lE2CjuFa9OQwLIbi-OomTQ  passcodes:tf9x

Or 

Google Drive: https://drive.google.com/drive/folders/1MI5gMDspzuV44lfwzpK6PX0vKuOHUbb_?usp=sharing   

 

The **pretrained model** is also provided in the "/model" folder, named as 98.48263448061671_RAd_lr0.001_batch70_FocalLoss_poly_alpha0.25_gamma2.0_Attention_UNet_LSTM.pth .

 

(2) Set up

## Requirements

PyTorch 0.4.0 

Python 3.9 

CUDA 8.0 

## Preparation

### Data Preparation

The dataset contains 19383 continuous driving scenes image sequences, and 39460 frames of them are labeled. The size of images is 128*256.

The training set contains 19096 image sequences. Each 13th and 20th frame in a sequence are labeled, and the image and their labels are in “clips_13(_truth)” and “clips_20(_truth)”. All images are contained in “clips_all”. 

Sequences in “0313”, “0531” and “0601” subfolders are constructed on TuSimple lane detection dataset, containing scenes in American highway. The four “weadd” folders are added images in rural road in China. 

The testset has two parts: Testset #1 (270 sequences, each 13th and 20th image is labeled) for testing the overall performance of algorithms. The Testset #2 (12 kinds of hard scenes, all frames are labeled) for testing the robustness of algorithms.  

To input the data, we provide three index files(train_index, val_index, and test_index). Each row in the index represents for a sequence and its label, including the former 5 input images and the last ground truth (corresponding to the last frame of 5 inputs).

The dataset needs to be put into a folder with regards to the location in index files, (i.e., txt files in "./data/". The index files should also be modified add cording to your local computer settings. If you want to use your own data, please refer to the format of our dataset and indexes.

 

(3) Training

Before training, change the paths including "train_path"(for train_index.txt), "val_path"(for val_index.txt), "pretrained_path" in config_Att.py to adapt to your environment. 

Choose the models (UNet_ConvLSTM | SCNN_UNet_ConvLSTM | SCNN_UNet_Attention) as the default one which is also indicated by default='UNet-ConvLSTM' thus you do not need to make change for this. And adjust the arguments such as class weights (now the weights are set to fit the tvtLANE dataset), batch size, learning rate, and epochs in config_Att.py. You can also adjust other settings, e.g., optimizer, check in the codes for details.

Then simply run: train.py. If running successfully, there will be model files saved in the "./model" folder. The validating results will also be printed.

 

(4) Test

To evaluate the performance of a trained model, please select the trained model or put your own models into the "./model/" folder and change "pretrained_path" in test.py according to the local setting, then change "test_path" to the location of test_index.txt, and "save_path" for the saved results.

Choose the right model that would be evaluated, and then simply run: test.py.

 

The quantitative evaluations of Accuracy, Precision, Recall, and F1 measure would be printed, and the lane detection segmented results will be saved in the "./save/" folder as pictures.

 


 Authors

Yongqi Dong ([email protected]), Sandeep Patil, Haneen Farah, Hans Hellendoorn


History

  • 2025-02-20 first online, published, posted

Publisher

4TU.ResearchData

Format

py; txt; csv; jpg; pth; pdf

Funding

  • Safe and efficient operation of AutoMated and human drivEN vehicles in mixed traffic (grant code 17187) [more info...] Applied and Technical Sciences (TTW), a subdomain of the Dutch Institute for Scientific Research (NWO)

Organizations

TU Delft, Faculty of Civil Engineering and Geosciences, Department of Transport and Planning
TU Delft, Faculty of Mechanical Engineering, Department of Cognitive robotics

DATA

Files (3)