Git Product home page Git Product logo

aarcosg / tsr-torch Goto Github PK

View Code? Open in Web Editor NEW
37.0 4.0 4.0 237 KB

Code for the paper entitled "Deep neural network for traffic sign recognition systems: An analysis of spatial transformers and stochastic optimisation methods".

Home Page: https://doi.org/10.1016/j.neunet.2018.01.005

License: MIT License

Lua 100.00%
gtsrb gtsrb-dataset traffic-sign-classification traffic-sign-recognition torch7 deep-learning deep-neural-networks spatial-transformer-network convolutional-neural-networks convolutional-layers

tsr-torch's Introduction

Traffic Sign Recognition

This is the code for the paper

Deep neural network for traffic sign recognition systems: An analysis of spatial transformers and stochastic optimisation methods
Álvaro Arcos-García, Juan Antonio Álvarez-García, Luis M. Soria-Morillo

The paper addresses the problem of traffic sign classification using a Deep Neural Network which comprises Convolutional layers and Spatial Transfomer Networks. The model reports an accuracy of 99.71% in the German Traffic Sign Recognition Benchmark. Model architecture

We provide:

If you find this code useful in your research, please cite:

"Deep neural network for traffic sign recognition systems: An analysis of spatial transformers and stochastic optimisation methods."
Álvaro Arcos-García, Juan A. Álvarez-García, Luis M. Soria-Morillo. Neural Networks 99 (2018) 158-165.

[link][bibtex]

Requirements

This project is implemented in Torch, and depends on the following packages: torch/torch7, torch/nn, torch/image, qassemoquab/stnbhwd, torch/cutorch, torch/cunn, cuDNN bindings for Torch and nninit.

After installing torch, you can install / update these dependencies by running the following:

luarocks install torch
luarocks install nn
luarocks install image
luarocks install cutorch
luarocks install cunn
luarocks install cudnn
luarocks install https://raw.githubusercontent.com/qassemoquab/stnbhwd/master/stnbhwd-scm-1.rockspec
luarocks install https://raw.githubusercontent.com/Kaixhin/nninit/master/rocks/nninit-scm-1.rockspec

Pretrained model

You can download a pretrained model from Google Drive. Unzip the file gtsrb_cnn3st_pretrained.zip and move its content to the folder pretrained of this project. It contains the pretrained model that obtains an accuracy of 99.71% in the German Traffic Sign Recognition Benchmark (GTSRB) and a second file with the mean and standard deviation values computed during the training process.

Running on new images

To run the model on new images, use the script run_model.lua. It will run the pretrained model on the images provided in the sample_images folder:

th run_model.lua

Training

To train and experiment with new traffic sign classification models, please follow the following steps:

  1. Use the script download_gtsrb_dataset.lua which will create a new folder called GTSRB that will include two folders: train and val.
    th download_gtsrb_dataset.lua
  2. Use the script main.lua setting the training parameters described in the file opts.lua. For example, the following options will generate the files needed to train a model with just one spatial transformer network localized at the beginning of the main network:
    th main.lua -data GTSRB -save GTSRB/checkpoints -dataset gtsrb -nClasses 43 -optimizer adam -LR 1e-4 -momentum 0 -weightDecay 0 -batchSize 50 -nEpochs 15 -weightInit default -netType cnn3st -globalNorm -localNorm -cNormConv -locnet2 '' -locnet3 '' -showFullOutput
    The next example, will create a model with three spatial transformer networks:
    th main.lua -data GTSRB -save GTSRB/checkpoints -dataset gtsrb -nClasses 43 -optimizer rmsprop -LR 1e-5 -momentum 0 -weightDecay 0 -batchSize 50 -nEpochs 15 -weightInit default -netType cnn3st -globalNorm -localNorm -cNormConv -showFullOutput

Acknowledgements

The source code of this project is mainly based on fb.resnet.torch and gtsrb.torch.

tsr-torch's People

Contributors

aarcosg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.