There are four different models of CNN network. We all used keras library to train our database, but we chose different approaches to build convolution network and sometimes use different data augmentation. Each model was evaluated and the best one was used to prepare program which recognise input picture and return name of the road sing.
Data is taken from: BelgiumTS Dataset. There are two sets: Training and Testing. Our data-sets contains 62 class of different road signs. To get realistic learning curve, the training data was split to smaller training file and validation set. The validation set do not take part in training process. It is only used to made an evaluation during learning. The Testing data-set is used to evaluate data after training. To split data use script: split_set.py or use function 'split_dataset_into_test_and_train_sets', defined here. Below are shown histograms of numerosity of each class.
Data was loaded using very handy method implemented in keras named flow_from_directory. It takes data from file and prepare labels for each classes based on names of subdirectories.
Library which helps not only to implement constitutional neural network, but also preprocess data is named: Keras: The Python Deep Learning library. The main idea of Keras approach is to implement model in easy way as a sequence of neural layers with all needed parameters able to set. Types of layer in CNN:
- convolutional - documentation
- pooling, dropout, flatten - documentation
- dense - documentation
Defining layers, which are connecting neurons, the the activation function should be pointed. Here is a description of the available activation functions in Keras.
When the model is designed, it must be compiled. There the optimizer and statistical metrics should be defined.
Here is nice tutorial about CNN concept.
Keras allows to make the image augementation, for examaple by rotating them, to increase effectiveness of learning. By setting the number of batches, the data is taken in smaller packages, so memory is seved. In that case there are to ways of setting nr of samples per epoch. First way: nr of training items/nr of batches, second way: nr_of_training_items - default. The second approach takes more time, but gives better results.
- Learning curve - shows how goes learning in each epoch. On y-axis are shown statistical metrics defined while compiling the model.
- Confusion Matrix - helps notice which examples was properly classified and how many was wrong classified, indicating false negative and false positive ones.
- Accuracy - describes difference between a result and a "true" value
- Top-n accuracy - indicates if in n numbers of results with highest probability is at least one equal to "true" value.
- Loss - error of matching, commonly used: mean squared error
name | Masopust's model | Riva's model | Gierlach's model | Torcu's model |
---|---|---|---|---|
nr of epochs | 15 | 30 | 20 | 30 |
opimizer | adam | sgd | nadam | rmsprop |
diagram | ![]() |
![]() |
![]() |
NA |
- Masopust's model
- Gierlach's model
Simple app to classifing road sign from picture input.
You need to Python 3.6, Keras and NumPy have installed. Download a model from this repository.
''' python recognize.py picture_file.jpg -m model.h5 '''
recognize.py [-h] [-m [MODEL]] file
Road sign recognition (classification) based on model created by Keras library.
Obligatory arguments:
file the name of the image file with road sign
Optional arguments:
-h, --help show this help message and exit
-m [MODEL], --model [MODEL] the name of the h5 file with the model, default value is classifier.h5
Original idea was to build also second part of project, detecting of road signs on the photo or video by YOLO library.
But finally it is not a part of our project, we want to try it on summer holiday.
- Jan Masopust - - masopust
- Gülce Torcu - - GulceTorcu
- Ewa Gierlach - - ewwx
- Christian Riva - - chririva