Need help with deep-learning-traffic-lights?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

461 Stars 168 Forks BSD 2-Clause "Simplified" License 4 Commits 4 Opened issues


Code and files of the deep learning model used to win the Nexar Traffic Light Recognition challenge

Services available


Need anything else?

Contributors list

# 79,139
4 commits

Recognizing Traffic Lights with Deep Learning

This repo contains the files used to train and run the classifier described in this blog post. This was done during a challenge by Nexar to recognize traffic lights based on images taken by their dashcam app.


Caffe with python bindings.

Directory contents:

: contain a caffe deploy.prototxt file and three weights files. The three weights files are used together in a model ensemble.

: has jupyter notebook files that run the model and perform the weighted average.

: contains the files needed to train the model (except the training data)

Training the model

The images were first converted to lmdb format and resized to 256x256 using this command:

GLOG_logtostderr=1 ~/caffe/build/tools/convert_imageset \
    --resize_height=256 --resize_width=256 --shuffle  \
    ~/nexar/images/ \
    ~/nexar/labels_test.txt \

Each model has a directory in

with some or all of the following files:
solver.prototxt   caffe solver file
solver_p2.prototxt  caffe solver file with lower base learning rate
train_val.prototxt  network training file   python caffe layer for data augmentation with rotation

was training from scratch. The other two models were fine-tuning from weights trained on ImageNet. The weights file is named

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.