|
1 | 1 | <!DOCTYPE html>
|
2 | 2 | <html>
|
3 | 3 | <head><meta charset="utf-8" />
|
4 |
| -<title>Traffic_Sign_Classifier</title><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script> |
| 4 | +<title>Traffic_Sign_Classifier</title><script src="https:// unpkg.com/[email protected].*/dist/embed.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script> |
5 | 5 | <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
|
6 | 6 |
|
7 | 7 | <style type="text/css">
|
@@ -11864,6 +11864,7 @@ <h2 id="Step-1:-Load-The-Data">Step 1: Load The Data<a class="anchor-link" href=
|
11864 | 11864 | </div>
|
11865 | 11865 | <div class="inner_cell">
|
11866 | 11866 | <div class="text_cell_render border-box-sizing rendered_html">
|
| 11867 | +<p>Download the dataset from <a href="https://d17h27t6h515a5.cloudfront.net/topher/2017/February/5898cd6f_traffic-signs-data/traffic-signs-data.zip">here</a>. This is a pickled dataset in which we've already resized the images to 32x32.</p> |
11867 | 11868 | <p>We already have three <code>.p</code> files of 32x32 resized images:</p>
|
11868 | 11869 | <ul>
|
11869 | 11870 | <li><code>train.p</code>: The training set.</li>
|
@@ -16306,7 +16307,7 @@ <h2 id="Step-5:-Testing-the-Model-using-the-Test-Set">Step 5: Testing the Model
|
16306 | 16307 | </div>
|
16307 | 16308 | <div class="cell border-box-sizing code_cell rendered">
|
16308 | 16309 | <div class="input">
|
16309 |
| -<div class="prompt input_prompt">In [29]:</div> |
| 16310 | +<div class="prompt input_prompt">In [42]:</div> |
16310 | 16311 | <div class="inner_cell">
|
16311 | 16312 | <div class="input_area">
|
16312 | 16313 | <div class=" highlight hl-ipython3"><pre><span></span><span class="k">with</span> <span class="n">tf</span><span class="o">.</span><span class="n">Session</span><span class="p">()</span> <span class="k">as</span> <span class="n">sess</span><span class="p">:</span>
|
@@ -16624,7 +16625,7 @@ <h2 id="Step-6:-Testing-the-Model-on-New-Images">Step 6: Testing the Model on Ne
|
16624 | 16625 | <div class="input_area">
|
16625 | 16626 | <div class=" highlight hl-ipython3"><pre><span></span><span class="n">plt</span><span class="o">.</span><span class="n">figure</span><span class="p">(</span><span class="n">figsize</span><span class="o">=</span><span class="p">(</span><span class="mi">15</span><span class="p">,</span> <span class="mi">16</span><span class="p">))</span>
|
16626 | 16627 | <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">new_test_images</span><span class="p">)):</span>
|
16627 |
| - <span class="n">plt</span><span class="o">.</span><span class="n">subplot</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="n">i</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> |
| 16628 | + <span class="n">plt</span><span class="o">.</span><span class="n">subplot</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="n">i</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> |
16628 | 16629 | <span class="n">plt</span><span class="o">.</span><span class="n">imshow</span><span class="p">(</span><span class="n">new_test_images</span><span class="p">[</span><span class="n">i</span><span class="p">])</span>
|
16629 | 16630 | <span class="n">plt</span><span class="o">.</span><span class="n">xlabel</span><span class="p">(</span><span class="n">signs</span><span class="p">[</span><span class="n">new_IDs</span><span class="p">[</span><span class="n">i</span><span class="p">]])</span>
|
16630 | 16631 | <span class="n">plt</span><span class="o">.</span><span class="n">ylabel</span><span class="p">(</span><span class="s2">"New testing image"</span><span class="p">)</span>
|
@@ -17171,6 +17172,17 @@ <h2 id="Step-6:-Testing-the-Model-on-New-Images">Step 6: Testing the Model on Ne
|
17171 | 17172 | </div>
|
17172 | 17173 | </div>
|
17173 | 17174 |
|
| 17175 | +</div> |
| 17176 | +<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt"> |
| 17177 | +</div> |
| 17178 | +<div class="inner_cell"> |
| 17179 | +<div class="text_cell_render border-box-sizing rendered_html"> |
| 17180 | +<p>These test images include some easy to predict signs, and other signs are considered hard for the model to predict.</p> |
| 17181 | +<p>For instance, we have easy to predict signs like the "Stop" and the "No entry". The two signs are clear and belong to classes where the model can predict with high accuracy.</p> |
| 17182 | +<p>On the other hand, we have signs belong to classes where has poor accuracy, like the "Speed limit" sign, because as stated above it turns out that the various speed limits are sometimes misclassified among themselves, and the "Pedestrians" sign, because traffic signs with traingular shape are misclassified among themselves.</p> |
| 17183 | + |
| 17184 | +</div> |
| 17185 | +</div> |
17174 | 17186 | </div>
|
17175 | 17187 | <div class="cell border-box-sizing code_cell rendered">
|
17176 | 17188 | <div class="input">
|
@@ -18338,6 +18350,9 @@ <h2 id="Step-6:-Testing-the-Model-on-New-Images">Step 6: Testing the Model on Ne
|
18338 | 18350 | </div>
|
18339 | 18351 | <div class="inner_cell">
|
18340 | 18352 | <div class="text_cell_render border-box-sizing rendered_html">
|
| 18353 | +<p>As we can notice from the top 5 softmax probabilities, the model has very high confidence (100%) when it comes to predict simple signs, like the "Stop" and the "No entry" sign, and even high confidence when predicting simple triangular signs in a very clear image, like the "Yield" sign.</p> |
| 18354 | +<p>On the other hand, the model's confidence slightly reduces with more complex triangular sign in a "pretty noisy" image, in the "Pedestrian" sign image, we have a triangular sign with a shape inside it, and the images copyrights adds some noise to the image, the model was able to predict the true class, but with 80% confidence.</p> |
| 18355 | +<p>And in the "Speed limit" sign, we can observe that the model accurately predicted that it's a "Speed limit" sign, but was somehow confused between the different speed limits. However, it predicted the true class at the end.</p> |
18341 | 18356 | <p>The VGGNet model was able to predict the right class for each of the 5 new test images. Test Accuracy = 100.0%.
|
18342 | 18357 | In all cases, the model was very certain (80% - 100%).</p>
|
18343 | 18358 |
|
|
0 commit comments