All Projects → yukitsuji → Traffic_Signs_Recognition_cnn

yukitsuji / Traffic_Signs_Recognition_cnn

Licence: other
Traffic Sign Recognition by Convolutional Neural Network (TensorFlow)

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Traffic Signs Recognition cnn

clinicadl
Framework for the reproducible processing of neuroimaging data with deep learning methods
Stars: ✭ 114 (+714.29%)
Mutual labels:  convolutional-neural-network
sentiment-analysis-of-tweets-in-russian
Sentiment analysis of tweets in Russian using Convolutional Neural Networks (CNN) with Word2Vec embeddings.
Stars: ✭ 51 (+264.29%)
Mutual labels:  convolutional-neural-network
deepcurator
A convolutional neural network trained to recognize good* electronic music
Stars: ✭ 38 (+171.43%)
Mutual labels:  convolutional-neural-network
Keras-MultiClass-Image-Classification
Multiclass image classification using Convolutional Neural Network
Stars: ✭ 48 (+242.86%)
Mutual labels:  convolutional-neural-network
SimpNet-Tensorflow
A Tensorflow Implementation of the SimpNet Convolutional Neural Network Architecture
Stars: ✭ 16 (+14.29%)
Mutual labels:  convolutional-neural-network
Preprocessing-Method-for-STEMI-Detection
Official source code of "Preprocessing Method for Performance Enhancement in CNN-based STEMI Detection from 12-lead ECG"
Stars: ✭ 12 (-14.29%)
Mutual labels:  convolutional-neural-network
DeepBind-with-PyTorch
CNN architecture for predicting DNA binding sites for Transcription Factors
Stars: ✭ 36 (+157.14%)
Mutual labels:  convolutional-neural-network
Face.evolve.pytorch
🔥🔥High-Performance Face Recognition Library on PaddlePaddle & PyTorch🔥🔥
Stars: ✭ 2,719 (+19321.43%)
Mutual labels:  convolutional-neural-network
minirocket
MINIROCKET: A Very Fast (Almost) Deterministic Transform for Time Series Classification
Stars: ✭ 166 (+1085.71%)
Mutual labels:  convolutional-neural-network
Cat-Dog-CNN-Classifier
Convolutional Neural Network to classify images as either cat or dog, along with using attention heatmaps for localization. Written in python with keras.
Stars: ✭ 17 (+21.43%)
Mutual labels:  convolutional-neural-network
PolyphonicPianoTranscription
Recurrent Neural Network for generating piano MIDI-files from audio (MP3, WAV, etc.)
Stars: ✭ 146 (+942.86%)
Mutual labels:  convolutional-neural-network
DeTraC COVId19
Classification of COVID-19 in chest X-ray images using DeTraC deep convolutional neural network
Stars: ✭ 34 (+142.86%)
Mutual labels:  convolutional-neural-network
coursera-ai-for-medicine-specialization
Programming assignments, labs and quizzes from all courses in the Coursera AI for Medicine Specialization offered by deeplearning.ai
Stars: ✭ 80 (+471.43%)
Mutual labels:  convolutional-neural-network
Hierarchical-Typing
Code and Data for all experiments from our ACL 2018 paper "Hierarchical Losses and New Resources for Fine-grained Entity Typing and Linking"
Stars: ✭ 44 (+214.29%)
Mutual labels:  convolutional-neural-network
yapic
Yet Another Pixel Classifier (based on deep learning)
Stars: ✭ 24 (+71.43%)
Mutual labels:  convolutional-neural-network
deep-explanation-penalization
Code for using CDEP from the paper "Interpretations are useful: penalizing explanations to align neural networks with prior knowledge" https://arxiv.org/abs/1909.13584
Stars: ✭ 110 (+685.71%)
Mutual labels:  convolutional-neural-network
DSMSCN
[MultiTemp 2019] Official Tensorflow implementation for Change Detection in Multi-temporal VHR Images Based on Deep Siamese Multi-scale Convolutional Neural Networks.
Stars: ✭ 63 (+350%)
Mutual labels:  convolutional-neural-network
cartoon-gan
Implementation of cartoon GAN [Chen et al., CVPR18] with pytorch
Stars: ✭ 55 (+292.86%)
Mutual labels:  convolutional-neural-network
Neural Style Tf
TensorFlow (Python API) implementation of Neural Style
Stars: ✭ 2,943 (+20921.43%)
Mutual labels:  convolutional-neural-network
Image-Denoising-with-Deep-CNNs
Use deep Convolutional Neural Networks (CNNs) with PyTorch, including investigating DnCNN and U-net architectures
Stars: ✭ 54 (+285.71%)
Mutual labels:  convolutional-neural-network

Traffic Sign Recognition by CNN

Traffic Sign Recognition by Convolutional Neural Network.
Datasets is German Traffic Sign Dataset. Finally I get 97.8% accuracy(Test sets).

prerequirement

python3 / tensorflow / numpy / opencv2

Step 0: Load The Data

import pickle

training_file = './train.p'
testing_file = './test.p'

with open(training_file, mode='rb') as f:
    train = pickle.load(f)
with open(testing_file, mode='rb') as f:
    test = pickle.load(f)
    
X_train, y_train = train['features'], train['labels']
X_test, y_test = test['features'], test['labels']

Step 1: Dataset Summary & Exploration

The pickled data is a dictionary with 4 key/value pairs:

  • 'features' is a 4D array containing raw pixel data of the traffic sign images, (num examples, width, height, channels).
  • 'labels' is a 2D array containing the label/class id of the traffic sign. The file signnames.csv contains id -> name mappings for each id.
  • 'sizes' is a list containing tuples, (width, height) representing the the original width and height the image.
  • 'coords' is a list containing tuples, (x1, y1, x2, y2) representing coordinates of a bounding box around the sign in the image. THESE COORDINATES ASSUME THE ORIGINAL IMAGE. THE PICKLED DATA CONTAINS RESIZED VERSIONS (32 by 32) OF THESE IMAGES
n_train = './train.p'
n_test = './test.p'
image_shape = X_train.shape[1:]  # (32, 32, 3)
n_classes = len(set(y_train))    #  43

png

Step2: final architecture (Type of model, layers, sizes, connectivity, etc.)


I made a multi-scale convolutional network.

inputs data : [batch, 32, 32, 3] YUV data
------------------------1st stage-------------------------
input = inputs data

conv1 + ReLU : kernel size = 5, layer width = 108
channel Y connect 100 kernel.
channnel UV connect 8 kernel.

max pooling : kernel size = 2
Batch Normalization

output = "conv1"
------------------------2st stage-------------------------
input = "conv1"

conv2 + ReLU : kernel size = 3, layer width = 200
max pooling : kernel size = 2
Batch Normalization

output = "conv2"

------------------------3st stage-------------------------
combine "conv1(flatten)" with "conv2(flatten)"
input = concat "conv1(flatten)" and "conv2(flatten)"

fully network + ReLU : layer width = 300
Batch Normalization

output = "fc1"
------------------------4st stage-------------------------
input = "fc1

out : layer width = 43

・About below images
"BP" means the flow of layer "conv -> Batch Normalization -> Max Pooling" "PB" means the flow of layer "conv -> Max Pooling -> Batch Normalization"

"No Fully Layer" means there is no fully layer. In other words, This network don't have 3st stage
"One Fully Layer" means this architecrue is same to final architecture.
"Two Fully Layer" means add Fully layer2 to final architecture. layer width = 100

Step 3: Hyper Parameter

**Type of optimizer : Adam **
Adam itself does a learning rate decay, so I don't use learning decay.

learning rate = 0.0005
batch size : 378
epochs : 200

Step 4: How to preprocess the data. The process I choose that technique


Like this paper : http://yann.lecun.com/exdb/publis/pdf/sermanet-ijcnn-11.pdf,

RGB to YUV conversion
the reason image/video codecs are YUV is so they can reduce the resolution of the U and V channels while keeping Y at full resolution, because luminance is more important than color.

But, I don't think YUV by itself would be a big advantage over RGB.

And, If you can reduce the resolution of U and V in a way that's compatible with convolutional nets, your net should be half the size and therefore twice as fast, without much loss of accuracy.

However, blow image shows that "Y" and "Y_100, UV_8" are better than RGB datasets.
So I choose YUV conversion

"Y_100, UV_8" means Y channle connect 100 kernel and UV channle connect 8 kernel.

data scale [0, 1] : X_train / 255
This is for activate function.

Step 5: How to set up the training, validation and testing data for the model.

Like this paper : http://yann.lecun.com/exdb/publis/pdf/sermanet-ijcnn-11.pdf,

The dataset "GTSRB" were extracted from 1-second video sequences which each track has 30 samples. in other words, Every 30 images is from a single sign traffic.

So, I ensure the validation set would have at least one image per traffic sign, per 30 images.

So I separate each track to two segments.
One is training sets that have about 27 or 28 images per track.
The other is validation sets that have 2 or 3 images per track

That means one of the images in X_train[:30] will go into validation set, as well as one image from X_train[30:60]

2 : How did you generate the data?

I tried to generate additional data by "blur original images".
Generally, by building a jittered dataset, the models would probably increase robustness.

But there is no differences between original datasets and new datasets in terms of accuracy(test).
So I don't add new data to original datasets, and I use original datasets.

Below image is comparison with "New Datasets" and "Original Datasets"
"378" and "776" means Batch Size

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].