Traffic Sign Classification
This project, using the German Traffic Sign Dataset is to train and validate a model so it can classify traffic sign images. After the model is trained, new German traffic signs on the web are classified.
Read data using pickle Read classified sign maes along with label from csv and store in classID_signnames signnames_df = pd.read_csv(signnames_file) classID_signames = list(signnames_df['SignName'])
The goals / steps of this project are the following:
- preprocess data (normalization)
- Explore, summarize and visualize the data set (planned to add gray scale but currently not applied)
- Design, train and test a model architecture - described in Model Architecure in detail
- Use the model to make predictions on new images : downloaded 8 images (32x32x3) and uploaded in downloads folder
- Analyze the softmax probabilities of the new images
- Summarize the results with a written report
- Training Accuracy = 0.937
- Validation Accuracy = 0.934
Implement the LeNet-5(http://yann.lecun.com/exdb/lenet/) neural network architecture data is 32323 (RGB) not a gray scale so that I modified MNIST LeNet5 to apply RGB scale image data LeNet-5 Architecture will be discussed in detail in Model Architecture With hyper parater tuning (BATCHsize =128, EPOCH=100) I obtained 93~95% training accuracy
The LeNet architecture accepts a 32X32XC as input, where C is the number of color channels(Gray scale C is in, RGB color C is 3).
Activation: choice of activation function is ReLu. Pooling: The output shape should be 14X14X6.
Activation: ReLu again, Pooling: The output shape should be 5X5X16. *Flatten: Flatten the output shape of the final pooling layer such that its 1D instead of 3D, The easiest way to do is by using tensorflow.contrib.layers.flatten, which is imported, the output is 400.
Activation: ReLu again.
Activation: ReLu gain.
Return the resell of 2nd fully connected layer.
Evaluate how well the loss and accuracy of the model for a given dataset. (EPOCHS, BATCH_SIZE) --> (100,128):93.9%, previous expriment (20,32):82% (20,64):90.9%,(20,128):89.9% For the validation set , accuracy goes up to 93.9% to 95%. for the test accuracy was similar to accuracy of validation set around 93%
Applied training model to newly downloaded 8 images under downloads folder. Got 87.5% accuracy Applied top 5 Softmax predicted signs and listed each probabilities along with predected sign name in the bar chart One failed example, 80speed limit showed 30 speed limit with 100% probabilities. Outstading issues are row resolution images.I only used data normalization by divining 255. However, I could experiment gray scale and apply gausian filter or other filters to extract more distintive features before applying CNN in LeNet-5 architecture.
Applied LeNet-5 Architecture , Hyperparameter tuning by exploreing BATCH_SIZE and EPOCH , and achieved 93.9% ~ 95% training set accuracy and around 93% validation accuracy. That was pretty good since two accuracies are balanced. For future work, I can apply more image data preprossing technique(RGB2Gray, applying gausian filter or Rotations, translations and scaling for data augmentation , etc) Even for normazliation, I could find min and max or RGB data and normalize data by dividing the difference between min-max instead of divining by 255. For more advanced technique, Contrast-limited Adaptive Histogram Equalization, CLAHE, is other normalization method I can try.