

{"id":73369,"date":"2019-12-04T14:59:34","date_gmt":"2019-12-04T09:29:34","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=73369"},"modified":"2020-08-06T23:59:45","modified_gmt":"2020-08-06T18:29:45","slug":"python-project-traffic-signs-recognition","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/python-project-traffic-signs-recognition\/","title":{"rendered":"Python Project on Traffic Signs Recognition with 95% Accuracy using CNN &amp; Keras"},"content":{"rendered":"<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:1279,&quot;href&quot;:&quot;https:\\\/\\\/www.kaggle.com\\\/meowmeowmeowmeowmeow\\\/gtsrb-german-traffic-sign&quot;,&quot;archived_href&quot;:&quot;&quot;,&quot;redirect_href&quot;:&quot;https:\\\/\\\/www.kaggle.com\\\/datasets\\\/meowmeowmeowmeowmeow\\\/gtsrb-german-traffic-sign&quot;,&quot;checks&quot;:[],&quot;broken&quot;:false,&quot;last_checked&quot;:null,&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:1280,&quot;href&quot;:&quot;https:\\\/\\\/drive.google.com\\\/open?id=1BGDHe6qQwrBEgnl-tXTSKo6TvDj8U3wS&quot;,&quot;archived_href&quot;:&quot;&quot;,&quot;redirect_href&quot;:&quot;https:\\\/\\\/drive.google.com\\\/file\\\/d\\\/1BGDHe6qQwrBEgnl-tXTSKo6TvDj8U3wS\\\/view?usp=drive_open&quot;,&quot;checks&quot;:[],&quot;broken&quot;:false,&quot;last_checked&quot;:null,&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:196,&quot;href&quot;:&quot;https:\\\/\\\/data-flair.training\\\/python-course&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20221202094432\\\/https:\\\/\\\/data-flair.training\\\/python-course\\\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-07 05:24:18&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2025-12-10 05:34:57&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2025-12-13 06:12:26&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2025-12-16 06:21:42&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2025-12-19 06:48:48&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2025-12-22 07:16:54&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2025-12-25 08:05:05&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2025-12-28 08:49:49&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2025-12-31 09:46:45&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-01-03 10:12:54&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-01-06 10:42:33&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-01-09 10:57:01&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-01-12 11:54:23&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-01-15 12:14:26&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-01-18 13:17:10&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-21 13:52:15&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-01-24 14:11:40&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-01-27 14:14:11&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-01-30 14:16:41&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-02 14:52:55&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-05 15:01:05&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-08 16:06:39&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-11 16:11:33&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-14 16:19:45&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-17 16:28:30&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-20 17:54:17&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-23 20:19:55&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-26 20:21:47&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-01 22:14:32&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-04 23:17:20&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-07 23:32:19&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-10 23:52:41&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-14 02:20:25&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-17 03:02:13&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-20 06:41:26&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-23 07:49:18&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-26 08:11:47&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-29 09:42:35&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-01 09:56:38&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-04 11:37:14&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-07 11:40:09&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-10 13:29:08&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-13 14:18:19&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-16 15:12:43&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-19 15:52:15&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-22 15:59:16&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-25 17:16:29&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-28 17:26:04&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-01 17:59:04&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-05-04 18:22:12&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-05-07 18:32:35&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-10 19:03:53&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-05-13 19:27:05&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-05-16 20:34:56&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-05-19 22:34:22&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-22 23:36:38&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-05-26 01:26:46&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-29 03:26:33&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-06-01 04:50:36&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-06-04 05:22:51&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-06-07 05:24:39&quot;,&quot;http_code&quot;:403}],&quot;broken&quot;:true,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-07 05:24:39&quot;,&quot;http_code&quot;:403},&quot;process&quot;:&quot;done&quot;}]'><\/div>\n<p><strong>Python Project &#8211; Traffic Signs Recognition\u00a0<\/strong><\/p>\n<p>You must have heard about the self-driving cars in which the passenger can fully depend on the car for traveling. But to achieve level 5 autonomous, it is necessary for vehicles to understand and follow all traffic rules.<\/p>\n<p>In the world of Artificial Intelligence and advancement in technologies, many researchers and big companies like Tesla, Uber, Google, Mercedes-Benz, Toyota, Ford, Audi, etc are working on autonomous vehicles and self-driving cars. So, for achieving accuracy in this technology, the vehicles should be able to interpret traffic signs and make decisions accordingly.<\/p>\n<p>This is the 8th project of DataFlair&#8217;s series of 20 Python projects. I recommend you to bookmark the previous projects:<\/p>\n<ol>\n<li><a href=\"https:\/\/data-flair.training\/blogs\/advanced-python-project-detecting-fake-news\/\">Fake News Detection Python Project<\/a><\/li>\n<li><a href=\"https:\/\/data-flair.training\/blogs\/python-machine-learning-project-detecting-parkinson-disease\/\">Parkinson\u2019s Disease Detection Python Project<\/a><\/li>\n<li><a href=\"https:\/\/data-flair.training\/blogs\/project-in-python-colour-detection\/\">Color Detection Python Project<\/a><\/li>\n<li><a href=\"https:\/\/data-flair.training\/blogs\/python-mini-project-speech-emotion-recognition\/\">Speech Emotion Recognition Python Project<\/a><\/li>\n<li><a href=\"https:\/\/data-flair.training\/blogs\/project-in-python-breast-cancer-classification\/\">Breast Cancer Classification Python Project<\/a><\/li>\n<li><a href=\"https:\/\/data-flair.training\/blogs\/python-project-gender-age-detection\/\">Age and Gender Detection Python Project<\/a><\/li>\n<li><a href=\"https:\/\/data-flair.training\/blogs\/python-deep-learning-project-handwritten-digit-recognition\/\">Handwritten Digit Recognition Python Project<\/a><\/li>\n<li><a href=\"https:\/\/data-flair.training\/blogs\/python-chatbot-project\/\">Chatbot Python Project<\/a><\/li>\n<li><a href=\"https:\/\/data-flair.training\/blogs\/python-project-driver-drowsiness-detection-system\/\">Driver Drowsiness Detection Python Project<\/a><\/li>\n<li>Traffic Signs Recognition Python Project<\/li>\n<li><a href=\"https:\/\/data-flair.training\/blogs\/python-based-project-image-caption-generator-cnn\/\">Image Caption Generator Python Project<\/a><\/li>\n<\/ol>\n<h3>What is Traffic Signs Recognition?<\/h3>\n<p>There are several different types of traffic signs like speed limits, no entry, traffic signals, turn left or right, children crossing, no passing of heavy vehicles, etc. Traffic signs classification is the process of identifying which class a traffic sign belongs to.<\/p>\n<h3>Traffic Signs Recognition &#8211; About the Python Project<\/h3>\n<p>In this Python project example, we will build a\u00a0deep neural network model that can classify traffic signs present in the image into different categories. With this model, we are able to read and understand traffic signs which are a very important task for all autonomous vehicles.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/traffic-sign-recognition-project.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-74017 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/traffic-sign-recognition-project.gif\" alt=\"traffic sign recognition python project idea\" width=\"1068\" height=\"600\" \/><\/a><\/p>\n<h3>The Dataset of Python Project<\/h3>\n<p>For this project, we are using the public dataset available at Kaggle:<\/p>\n<p><a href=\"https:\/\/www.kaggle.com\/meowmeowmeowmeowmeow\/gtsrb-german-traffic-sign\">Traffic Signs Dataset<\/a><\/p>\n<p>The dataset contains more than 50,000 images of different traffic signs. It is further classified into 43 different classes. The dataset is quite varying, some of the classes have many images while some classes have few images. The size of the dataset is around 300 MB. The dataset has a train folder which contains images inside each class and a test folder which we will use for testing our model.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/Python-Project-on-Traffic-Signs-Recognition-Meme-2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-73436 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/Python-Project-on-Traffic-Signs-Recognition-Meme-2.jpg\" alt=\"Python Project on Traffic Signs Recognition Meme \" width=\"470\" height=\"400\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/Python-Project-on-Traffic-Signs-Recognition-Meme-2.jpg 470w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/Python-Project-on-Traffic-Signs-Recognition-Meme-2-150x128.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/Python-Project-on-Traffic-Signs-Recognition-Meme-2-300x255.jpg 300w\" sizes=\"auto, (max-width: 470px) 100vw, 470px\" \/><\/a><\/p>\n<h3>Prerequisites<\/h3>\n<p>This project requires prior knowledge of Keras, Matplotlib, Scikit-learn, Pandas, PIL and image classification.<\/p>\n<p>To install the necessary packages used for this Python data science project, enter the below command in your terminal:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">pip install tensorflow keras sklearn matplotlib pandas pil<\/pre>\n<p>&nbsp;<\/p>\n<p class=\"df-text-bold df-text-red\" style=\"text-align: center;\">Want to become a pro in Python?<\/p>\n<p class=\"df-text-bold\" style=\"text-align: center;\">Check out <a href=\"https:\/\/data-flair.training\/blogs\/python-tutorials-home\/\">270+ Free Python Tutorials<\/a><\/p>\n<h2>Steps to Build the Python Project<\/h2>\n<p>To get started with the project, download and unzip the file from this link &#8211; <a href=\"https:\/\/drive.google.com\/open?id=1BGDHe6qQwrBEgnl-tXTSKo6TvDj8U3wS\">Traffic Signs Recognition Zip File<\/a><\/p>\n<p>And extract the files into a folder such that you will have a train, test and a meta folder.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/dataset.png\"><img loading=\"lazy\" decoding=\"async\" class=\"img-gray-border aligncenter wp-image-73396 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/dataset.png\" alt=\"Python Project Dataset\" width=\"826\" height=\"291\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/dataset.png 826w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/dataset-150x53.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/dataset-300x106.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/dataset-768x271.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/dataset-520x183.png 520w\" sizes=\"auto, (max-width: 826px) 100vw, 826px\" \/><\/a><\/p>\n<p>Create a Python script file and name it traffic_signs.py in the project folder.<\/p>\n<p>Our approach to building this traffic sign classification model is discussed in four steps:<\/p>\n<ul>\n<li>Explore the dataset<\/li>\n<li>Build a CNN model<\/li>\n<li>Train and validate the model<\/li>\n<li>Test the model with test dataset<\/li>\n<\/ul>\n<p><strong>Step 1: Explore the dataset<\/strong><\/p>\n<p>Our \u2018train\u2019 folder contains 43 folders each representing a different class. The range of the folder is from 0 to 42. With the help of the OS module, we iterate over all the classes and append images and their respective labels in the data and labels list.<\/p>\n<p>The PIL library is used to open image content into an array.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/exploring-dataset-python-project.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-73400\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/exploring-dataset-python-project.png\" alt=\"exploring dataset in python project\" width=\"992\" height=\"657\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/exploring-dataset-python-project.png 992w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/exploring-dataset-python-project-150x99.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/exploring-dataset-python-project-300x199.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/exploring-dataset-python-project-768x509.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/exploring-dataset-python-project-520x344.png 520w\" sizes=\"auto, (max-width: 992px) 100vw, 992px\" \/><\/a><\/p>\n<p>Finally, we have stored all the images and their labels into lists (data and labels).<\/p>\n<p>We need to convert the list into numpy arrays for feeding to the model.<\/p>\n<p>The shape of data is (39209, 30, 30, 3) which means that there are 39,209 images of size 30&#215;30 pixels and the last 3 means the data contains colored images (RGB value).<\/p>\n<p>With the sklearn package, we use the train_test_split() method to split training and testing data.<\/p>\n<p>From the keras.utils package, we use to_categorical method to convert the labels present in y_train and t_test into one-hot encoding.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/splitting-dataset-python-project.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-73401\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/splitting-dataset-python-project.png\" alt=\"splitting dataset in python project\" width=\"992\" height=\"257\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/splitting-dataset-python-project.png 992w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/splitting-dataset-python-project-150x39.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/splitting-dataset-python-project-300x78.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/splitting-dataset-python-project-768x199.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/splitting-dataset-python-project-520x135.png 520w\" sizes=\"auto, (max-width: 992px) 100vw, 992px\" \/><\/a><\/p>\n<p><strong>Step 2: Build a CNN model<\/strong><\/p>\n<p>To classify the images into their respective categories, we will build a CNN model (<em><strong><a href=\"https:\/\/data-flair.training\/blogs\/convolutional-neural-networks-tutorial\/\">Convolutional Neural Network<\/a><\/strong><\/em>). CNN is best for image classification purposes.<\/p>\n<p>The architecture of our model is:<\/p>\n<ul>\n<li>2 Conv2D layer (filter=32, kernel_size=(5,5), activation=\u201drelu\u201d)<\/li>\n<li>MaxPool2D layer ( pool_size=(2,2))<\/li>\n<li>Dropout layer (rate=0.25)<\/li>\n<li>2 Conv2D layer (filter=64, kernel_size=(3,3), activation=\u201drelu\u201d)<\/li>\n<li>MaxPool2D layer ( pool_size=(2,2))<\/li>\n<li>Dropout layer (rate=0.25)<\/li>\n<li>Flatten layer to squeeze the layers into 1 dimension<\/li>\n<li>Dense Fully connected layer (256 nodes, activation=\u201drelu\u201d)<\/li>\n<li>Dropout layer (rate=0.5)<\/li>\n<li>Dense layer (43 nodes, activation=\u201dsoftmax\u201d)<\/li>\n<\/ul>\n<p>We compile the model with Adam optimizer which performs well and loss is \u201ccategorical_crossentropy\u201d because we have multiple classes to categorise.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/cnn-model-python-data-science-project.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-73403\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/cnn-model-python-data-science-project.png\" alt=\"cnn model in python data science project\" width=\"992\" height=\"350\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/cnn-model-python-data-science-project.png 992w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/cnn-model-python-data-science-project-150x53.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/cnn-model-python-data-science-project-300x106.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/cnn-model-python-data-science-project-768x271.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/cnn-model-python-data-science-project-520x183.png 520w\" sizes=\"auto, (max-width: 992px) 100vw, 992px\" \/><\/a><\/p>\n<p><strong>Steps 3: Train and validate the model<\/strong><\/p>\n<p>After building the model architecture, we then train the model using model.fit(). I tried with batch size 32 and 64. Our model performed better with 64 batch size. And after 15 epochs the accuracy was stable.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/training-project-in-python.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-73404\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/training-project-in-python.png\" alt=\"training the model in project in python\" width=\"992\" height=\"981\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/training-project-in-python.png 992w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/training-project-in-python-150x148.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/training-project-in-python-300x297.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/training-project-in-python-768x759.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/training-project-in-python-520x514.png 520w\" sizes=\"auto, (max-width: 992px) 100vw, 992px\" \/><\/a><\/p>\n<p>Our model got a 95% accuracy on the training dataset. With matplotlib, we plot the graph for accuracy and the loss.<\/p>\n<div id=\"attachment_73405\" style=\"width: 1002px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/plotting-accuracy-python-project-example.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-73405\" class=\"wp-image-73405 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/plotting-accuracy-python-project-example.png\" alt=\"plotting accuracy in python project example\" width=\"992\" height=\"349\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/plotting-accuracy-python-project-example.png 992w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/plotting-accuracy-python-project-example-150x53.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/plotting-accuracy-python-project-example-300x106.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/plotting-accuracy-python-project-example-768x270.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/plotting-accuracy-python-project-example-520x183.png 520w\" sizes=\"auto, (max-width: 992px) 100vw, 992px\" \/><\/a><p id=\"caption-attachment-73405\" class=\"wp-caption-text\">Plotting Accuracy<\/p><\/div>\n<div id=\"attachment_73406\" style=\"width: 1002px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/accuracy-loss-python-machine-learning-project.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-73406\" class=\"wp-image-73406 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/accuracy-loss-python-machine-learning-project.png\" alt=\"accuracy &amp; loss in python machine learning project\" width=\"992\" height=\"601\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/accuracy-loss-python-machine-learning-project.png 992w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/accuracy-loss-python-machine-learning-project-150x91.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/accuracy-loss-python-machine-learning-project-300x182.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/accuracy-loss-python-machine-learning-project-768x465.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/accuracy-loss-python-machine-learning-project-520x315.png 520w\" sizes=\"auto, (max-width: 992px) 100vw, 992px\" \/><\/a><p id=\"caption-attachment-73406\" class=\"wp-caption-text\">Accuracy and Loss Graphs<\/p><\/div>\n<p><strong>Step 4: Test our model with test dataset<\/strong><\/p>\n<p>Our dataset contains a test folder and in a test.csv file, we have the details related to the image path and their respective class labels. We extract the image path and labels using pandas. Then to predict the model, we have to resize our images to 30&#215;30 pixels and make a numpy array containing all image data. From the sklearn.metrics, we imported the accuracy_score and observed how our model predicted the actual labels. We achieved a 95% accuracy in this model.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/testing-accuracy-advanced-python-project.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-73407\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/testing-accuracy-advanced-python-project.png\" alt=\"testing accuracy in advanced python project\" width=\"1015\" height=\"471\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/testing-accuracy-advanced-python-project.png 1015w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/testing-accuracy-advanced-python-project-150x70.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/testing-accuracy-advanced-python-project-300x139.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/testing-accuracy-advanced-python-project-768x356.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/testing-accuracy-advanced-python-project-520x241.png 520w\" sizes=\"auto, (max-width: 1015px) 100vw, 1015px\" \/><\/a><\/p>\n<p>In the end, we are going to save the model that we have trained using the Keras model.save() function.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">model.save(\u2018traffic_classifier.h5\u2019)<\/pre>\n<p><strong>Full Source code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">import numpy as np \r\nimport pandas as pd \r\nimport matplotlib.pyplot as plt\r\nimport cv2\r\nimport tensorflow as tf\r\nfrom PIL import Image\r\nimport os\r\nfrom sklearn.model_selection import train_test_split\r\nfrom keras.utils import to_categorical\r\nfrom keras.models import Sequential, load_model\r\nfrom keras.layers import Conv2D, MaxPool2D, Dense, Flatten, Dropout\r\n\r\ndata = []\r\nlabels = []\r\nclasses = 43\r\ncur_path = os.getcwd()\r\n\r\n#Retrieving the images and their labels \r\nfor i in range(classes):\r\n    path = os.path.join(cur_path,'train',str(i))\r\n    images = os.listdir(path)\r\n\r\n    for a in images:\r\n        try:\r\n            image = Image.open(path + '\\\\'+ a)\r\n            image = image.resize((30,30))\r\n            image = np.array(image)\r\n            #sim = Image.fromarray(image)\r\n            data.append(image)\r\n            labels.append(i)\r\n        except:\r\n            print(\"Error loading image\")\r\n\r\n#Converting lists into numpy arrays\r\ndata = np.array(data)\r\nlabels = np.array(labels)\r\n\r\nprint(data.shape, labels.shape)\r\n#Splitting training and testing dataset\r\nX_train, X_test, y_train, y_test = train_test_split(data, labels, test_size=0.2, random_state=42)\r\n\r\nprint(X_train.shape, X_test.shape, y_train.shape, y_test.shape)\r\n\r\n#Converting the labels into one hot encoding\r\ny_train = to_categorical(y_train, 43)\r\ny_test = to_categorical(y_test, 43)\r\n\r\n#Building the model\r\nmodel = Sequential()\r\nmodel.add(Conv2D(filters=32, kernel_size=(5,5), activation='relu', input_shape=X_train.shape[1:]))\r\nmodel.add(Conv2D(filters=32, kernel_size=(5,5), activation='relu'))\r\nmodel.add(MaxPool2D(pool_size=(2, 2)))\r\nmodel.add(Dropout(rate=0.25))\r\nmodel.add(Conv2D(filters=64, kernel_size=(3, 3), activation='relu'))\r\nmodel.add(Conv2D(filters=64, kernel_size=(3, 3), activation='relu'))\r\nmodel.add(MaxPool2D(pool_size=(2, 2)))\r\nmodel.add(Dropout(rate=0.25))\r\nmodel.add(Flatten())\r\nmodel.add(Dense(256, activation='relu'))\r\nmodel.add(Dropout(rate=0.5))\r\nmodel.add(Dense(43, activation='softmax'))\r\n\r\n#Compilation of the model\r\nmodel.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])\r\n\r\nepochs = 15\r\nhistory = model.fit(X_train, y_train, batch_size=32, epochs=epochs, validation_data=(X_test, y_test))\r\nmodel.save(\"my_model.h5\")\r\n\r\n#plotting graphs for accuracy \r\nplt.figure(0)\r\nplt.plot(history.history['accuracy'], label='training accuracy')\r\nplt.plot(history.history['val_accuracy'], label='val accuracy')\r\nplt.title('Accuracy')\r\nplt.xlabel('epochs')\r\nplt.ylabel('accuracy')\r\nplt.legend()\r\nplt.show()\r\n\r\nplt.figure(1)\r\nplt.plot(history.history['loss'], label='training loss')\r\nplt.plot(history.history['val_loss'], label='val loss')\r\nplt.title('Loss')\r\nplt.xlabel('epochs')\r\nplt.ylabel('loss')\r\nplt.legend()\r\nplt.show()\r\n\r\n#testing accuracy on test dataset\r\nfrom sklearn.metrics import accuracy_score\r\n\r\ny_test = pd.read_csv('Test.csv')\r\n\r\nlabels = y_test[\"ClassId\"].values\r\nimgs = y_test[\"Path\"].values\r\n\r\ndata=[]\r\n\r\nfor img in imgs:\r\n    image = Image.open(img)\r\n    image = image.resize((30,30))\r\n    data.append(np.array(image))\r\n\r\nX_test=np.array(data)\r\n\r\npred = model.predict_classes(X_test)\r\n\r\n#Accuracy with the test data\r\nfrom sklearn.metrics import accuracy_score\r\nprint(accuracy_score(labels, pred))\r\n\r\nmodel.save(\u2018traffic_classifier.h5\u2019)<\/pre>\n<p><em><strong>WAIT! Have you checked our latest <a href=\"https:\/\/data-flair.training\/blogs\/opencv-python-tutorial\/\">tutorial on OpenCV &amp; Computer Vision<\/a><\/strong><\/em><\/p>\n<h3>Traffic Signs Classifier GUI<\/h3>\n<p>Now we are going to build a graphical user interface for our traffic signs classifier with Tkinter. Tkinter is a GUI toolkit in the standard python library. Make a new file in the project folder and copy the below code. Save it as gui.py and you can run the code by typing python gui.py in the command line.<\/p>\n<p>In this file, we have first loaded the trained model \u2018traffic_classifier.h5\u2019 using Keras. And then we build the GUI for uploading the image and a button is used to classify which calls the classify() function. The classify() function is converting the image into the dimension of shape (1, 30, 30, 3). This is because to predict the traffic sign we have to provide the same dimension we have used when building the model. Then we predict the class, the model.predict_classes(image) returns us a number between (0-42) which represents the class it belongs to. We use the dictionary to get the information about the class. Here\u2019s the code for the gui.py file.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">import tkinter as tk\r\nfrom tkinter import filedialog\r\nfrom tkinter import *\r\nfrom PIL import ImageTk, Image\r\n\r\nimport numpy\r\n#load the trained model to classify sign\r\nfrom keras.models import load_model\r\nmodel = load_model('traffic_classifier.h5')\r\n\r\n#dictionary to label all traffic signs class.\r\nclasses = { 1:'Speed limit (20km\/h)',\r\n            2:'Speed limit (30km\/h)', \r\n            3:'Speed limit (50km\/h)', \r\n            4:'Speed limit (60km\/h)', \r\n            5:'Speed limit (70km\/h)', \r\n            6:'Speed limit (80km\/h)', \r\n            7:'End of speed limit (80km\/h)', \r\n            8:'Speed limit (100km\/h)', \r\n            9:'Speed limit (120km\/h)', \r\n            10:'No passing', \r\n            11:'No passing veh over 3.5 tons', \r\n            12:'Right-of-way at intersection', \r\n            13:'Priority road', \r\n            14:'Yield', \r\n            15:'Stop', \r\n            16:'No vehicles', \r\n            17:'Veh &gt; 3.5 tons prohibited', \r\n            18:'No entry', \r\n            19:'General caution', \r\n            20:'Dangerous curve left', \r\n            21:'Dangerous curve right', \r\n            22:'Double curve', \r\n            23:'Bumpy road', \r\n            24:'Slippery road', \r\n            25:'Road narrows on the right', \r\n            26:'Road work', \r\n            27:'Traffic signals', \r\n            28:'Pedestrians', \r\n            29:'Children crossing', \r\n            30:'Bicycles crossing', \r\n            31:'Beware of ice\/snow',\r\n            32:'Wild animals crossing', \r\n            33:'End speed + passing limits', \r\n            34:'Turn right ahead', \r\n            35:'Turn left ahead', \r\n            36:'Ahead only', \r\n            37:'Go straight or right', \r\n            38:'Go straight or left', \r\n            39:'Keep right', \r\n            40:'Keep left', \r\n            41:'Roundabout mandatory', \r\n            42:'End of no passing', \r\n            43:'End no passing veh &gt; 3.5 tons' }\r\n\r\n#initialise GUI\r\ntop=tk.Tk()\r\ntop.geometry('800x600')\r\ntop.title('Traffic sign classification')\r\ntop.configure(background='#CDCDCD')\r\n\r\nlabel=Label(top,background='#CDCDCD', font=('arial',15,'bold'))\r\nsign_image = Label(top)\r\n\r\ndef classify(file_path):\r\n    global label_packed\r\n    image = Image.open(file_path)\r\n    image = image.resize((30,30))\r\n    image = numpy.expand_dims(image, axis=0)\r\n    image = numpy.array(image)\r\n    pred = model.predict_classes([image])[0]\r\n    sign = classes[pred+1]\r\n    print(sign)\r\n    label.configure(foreground='#011638', text=sign) \r\n\r\ndef show_classify_button(file_path):\r\n    classify_b=Button(top,text=\"Classify Image\",command=lambda: classify(file_path),padx=10,pady=5)\r\n    classify_b.configure(background='#364156', foreground='white',font=('arial',10,'bold'))\r\n    classify_b.place(relx=0.79,rely=0.46)\r\n\r\ndef upload_image():\r\n    try:\r\n        file_path=filedialog.askopenfilename()\r\n        uploaded=Image.open(file_path)\r\n        uploaded.thumbnail(((top.winfo_width()\/2.25),(top.winfo_height()\/2.25)))\r\n        im=ImageTk.PhotoImage(uploaded)\r\n\r\n        sign_image.configure(image=im)\r\n        sign_image.image=im\r\n        label.configure(text='')\r\n        show_classify_button(file_path)\r\n    except:\r\n        pass\r\n\r\nupload=Button(top,text=\"Upload an image\",command=upload_image,padx=10,pady=5)\r\nupload.configure(background='#364156', foreground='white',font=('arial',10,'bold'))\r\n\r\nupload.pack(side=BOTTOM,pady=50)\r\nsign_image.pack(side=BOTTOM,expand=True)\r\nlabel.pack(side=BOTTOM,expand=True)\r\nheading = Label(top, text=\"Know Your Traffic Sign\",pady=20, font=('arial',20,'bold'))\r\nheading.configure(background='#CDCDCD',foreground='#364156')\r\nheading.pack()\r\ntop.mainloop()<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/graphical-user-interface-project-in-python.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-73408\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/graphical-user-interface-project-in-python.png\" alt=\"graphical user interface for project in python\" width=\"678\" height=\"511\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/graphical-user-interface-project-in-python.png 678w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/graphical-user-interface-project-in-python-150x113.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/graphical-user-interface-project-in-python-300x226.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/graphical-user-interface-project-in-python-520x392.png 520w\" sizes=\"auto, (max-width: 678px) 100vw, 678px\" \/><\/a><\/p>\n<h2>Summary<\/h2>\n<p>In this Python project with source code, we have successfully classified the traffic signs classifier with 95% accuracy and also visualized how our accuracy and loss changes with time, which is pretty good from a simple CNN model.<\/p>\n<p class=\"df-text-bold df-text-red\" style=\"text-align: center;\">Time to become the next Python developer<\/p>\n<p class=\"df-text-bold\" style=\"text-align: center;\">Enroll for the <a href=\"https:\/\/data-flair.training\/python-course\/\">Python Online Course<\/a> at DataFlair now!<\/p>\n<p>If you liked the Python project on traffic signs classification, do share it on social media with your friends and colleagues. For more projects like this, keep visiting DataFlair.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python Project &#8211; Traffic Signs Recognition\u00a0 You must have heard about the self-driving cars in which the passenger can fully depend on the car for traveling. But to achieve level 5 autonomous, it is&#46;&#46;&#46;<\/p>\n","protected":false},"author":7,"featured_media":73449,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46],"tags":[21075,21083,21082,21099,21485],"class_list":["post-73369","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-advanced-python-project","tag-python-machine-learning-project","tag-python-project","tag-python-project-with-source-code","tag-traffic-signs-recognition"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Python Project on Traffic Signs Recognition with 95% Accuracy using CNN &amp; Keras - DataFlair<\/title>\n<meta name=\"description\" content=\"Python Project on Traffic Signs Recognition - Learn to build a deep neural network model for classifying traffic signs in the image into separate categories using Keras &amp; other libraries. It can be useful for autonomous vehicles.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/python-project-traffic-signs-recognition\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Project on Traffic Signs Recognition with 95% Accuracy using CNN &amp; Keras - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Python Project on Traffic Signs Recognition - Learn to build a deep neural network model for classifying traffic signs in the image into separate categories using Keras &amp; other libraries. It can be useful for autonomous vehicles.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/python-project-traffic-signs-recognition\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-12-04T09:29:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-08-06T18:29:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/python-project-on-traffic-signs-recognition4-.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"802\" \/>\n\t<meta property=\"og:image:height\" content=\"420\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python Project on Traffic Signs Recognition with 95% Accuracy using CNN &amp; Keras - DataFlair","description":"Python Project on Traffic Signs Recognition - Learn to build a deep neural network model for classifying traffic signs in the image into separate categories using Keras & other libraries. It can be useful for autonomous vehicles.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/python-project-traffic-signs-recognition\/","og_locale":"en_US","og_type":"article","og_title":"Python Project on Traffic Signs Recognition with 95% Accuracy using CNN &amp; Keras - DataFlair","og_description":"Python Project on Traffic Signs Recognition - Learn to build a deep neural network model for classifying traffic signs in the image into separate categories using Keras & other libraries. It can be useful for autonomous vehicles.","og_url":"https:\/\/data-flair.training\/blogs\/python-project-traffic-signs-recognition\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2019-12-04T09:29:34+00:00","article_modified_time":"2020-08-06T18:29:45+00:00","og_image":[{"width":802,"height":420,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/python-project-on-traffic-signs-recognition4-.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/python-project-traffic-signs-recognition\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/python-project-traffic-signs-recognition\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/beb0cab24b7aa54423a3b50e669a9dcd"},"headline":"Python Project on Traffic Signs Recognition with 95% Accuracy using CNN &amp; Keras","datePublished":"2019-12-04T09:29:34+00:00","dateModified":"2020-08-06T18:29:45+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/python-project-traffic-signs-recognition\/"},"wordCount":1244,"commentCount":121,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/python-project-traffic-signs-recognition\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/python-project-on-traffic-signs-recognition4-.jpg","keywords":["Advanced python project","Python machine learning project","Python project","python project with source code","Traffic signs recognition"],"articleSection":["Python Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/python-project-traffic-signs-recognition\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/python-project-traffic-signs-recognition\/","url":"https:\/\/data-flair.training\/blogs\/python-project-traffic-signs-recognition\/","name":"Python Project on Traffic Signs Recognition with 95% Accuracy using CNN &amp; Keras - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/python-project-traffic-signs-recognition\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/python-project-traffic-signs-recognition\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/python-project-on-traffic-signs-recognition4-.jpg","datePublished":"2019-12-04T09:29:34+00:00","dateModified":"2020-08-06T18:29:45+00:00","description":"Python Project on Traffic Signs Recognition - Learn to build a deep neural network model for classifying traffic signs in the image into separate categories using Keras & other libraries. It can be useful for autonomous vehicles.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/python-project-traffic-signs-recognition\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/python-project-traffic-signs-recognition\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/python-project-traffic-signs-recognition\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/python-project-on-traffic-signs-recognition4-.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/12\/python-project-on-traffic-signs-recognition4-.jpg","width":802,"height":420,"caption":"python data science project on traffic signs recognition"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/python-project-traffic-signs-recognition\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Python Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/python\/"},{"@type":"ListItem","position":3,"name":"Python Project on Traffic Signs Recognition with 95% Accuracy using CNN &amp; Keras"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/beb0cab24b7aa54423a3b50e669a9dcd","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c322416204232f4dd97ef3901b0a499a5d34d7ba7fe333f4bfe53a907873d293?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c322416204232f4dd97ef3901b0a499a5d34d7ba7fe333f4bfe53a907873d293?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c322416204232f4dd97ef3901b0a499a5d34d7ba7fe333f4bfe53a907873d293?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team specializes in creating clear, actionable content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Backed by industry expertise, we make learning easy and career-oriented for beginners and pros alike.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam3\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/73369","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=73369"}],"version-history":[{"count":23,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/73369\/revisions"}],"predecessor-version":[{"id":80434,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/73369\/revisions\/80434"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/73449"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=73369"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=73369"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=73369"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}