{"id":281,"date":"2021-05-01T06:19:00","date_gmt":"2021-05-01T06:19:00","guid":{"rendered":"https:\/\/www.andreapasotti.it\/home\/?p=281"},"modified":"2022-02-06T15:38:33","modified_gmt":"2022-02-06T14:38:33","slug":"teaching-my-pc-to-read-numbers","status":"publish","type":"post","link":"https:\/\/www.andreapasotti.it\/home\/statistics\/teaching-my-pc-to-read-numbers\/","title":{"rendered":"Teaching my PC how to read numbers"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>Neural Networks are stupid, yet extremely powerful!<\/strong><\/p><cite>~Myself   [when the model is not learning]<\/cite><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">Wow, bold statement to begin with! This said, I am indeed a &#8220;statistician&#8221; and I have to belittle my closest &#8220;competitors&#8221;, right? <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Anyway, if you are still interested in<strong> how I made my PC recognize and read House Numbers<\/strong>, at the point of becoming so good at that to <strong>passing the feared <em>mother with glasses<\/em><\/strong> <strong>test<\/strong>, just keep on reading!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"the-task-svhn-dataset\">The Task | SVHN Dataset<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">During my <strong>Erasmus <\/strong>in <strong>Portugal<\/strong>, I had the chance to attend a <strong>Machine Learning<\/strong> <strong>course <\/strong>called <strong>ADNE <\/strong>(to be fancy, <em>Aprendizagem com Dados N\u00e3o Estruturados<\/em>), that <strong>revolved <\/strong>on the basic aspects of <strong>Neural Networks<\/strong>. One of the aspects that I <strong>enjoyed <\/strong>the most about this course, was the fact that it was <strong>extremely practical<\/strong>, with several projects on real-life data.<\/p>\n\n\n\n<figure class=\"wp-block-embed aligncenter is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"But what is a neural network? | Chapter 1, Deep learning\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/aircAruvnKk?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><figcaption>As I said, I&#8217;m far from being an expert on NNs, but if you&#8217;d like to know more about it, you have to watch the following series on YouTube!<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">One of this project involved the <strong><a rel=\"noreferrer noopener\" href=\"http:\/\/ufldl.stanford.edu\/housenumbers\/\" data-type=\"URL\" data-id=\"http:\/\/ufldl.stanford.edu\/housenumbers\/\" target=\"_blank\">Street View House Numbers (SVHN)<\/a> Dataset<\/strong>, a real-world image dataset made up by <strong>more <\/strong>than <strong>600.000 images<\/strong> obtained from <strong>house numbers in Google Street View<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The task was pretty simple on theory: to <strong>build <\/strong>a <strong>Neural Network algorithm<\/strong> that is able to <strong>correctly identify <\/strong>the <strong>house number<\/strong> from any given image of the <strong>SVHN Dataset<\/strong>. <br>On a second thought, though, we need to <strong>consider <\/strong>the <strong>following points<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Not every house has the same number of digits<\/li><li>The colour and font of each house number may vary<\/li><li>Images may be taken from different angles and distances<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">This complicates the problem considerably, as it is necessary to <strong>address these issues<\/strong> when designing the algorithm.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"the-solution\">The Solution<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The solution was based on a <strong>Convolutional Neural Network<\/strong>, and I have included all the <strong>data<\/strong>, the <strong>codes <\/strong>and the <strong>weights <\/strong>of the <strong>algorithm <\/strong>in a <strong>GitHub repository<\/strong> \ud83d\ude0a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>GitHub repo: <a href=\"https:\/\/github.com\/AndreaQRabby\/svhn-cnn\" data-type=\"URL\" data-id=\"https:\/\/github.com\/AndreaQRabby\/svhn-cnn\" target=\"_blank\" rel=\"noreferrer noopener\">SVHN &#8211; CNN<\/a><\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Neural Networks are stupid, yet extremely powerful! ~Myself [when the model is not learning] Wow, bold statement to begin with! This said, I am indeed a &#8220;statistician&#8221; and I have to belittle my closest &#8220;competitors&#8221;, right? Anyway, if you are still interested in how I made my PC recognize and read House Numbers, at the point of becoming so good [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":288,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[21,23,22],"class_list":["post-281","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-statistics","tag-cnn","tag-neural-networks","tag-svhn","clearfix"],"_links":{"self":[{"href":"https:\/\/www.andreapasotti.it\/home\/wp-json\/wp\/v2\/posts\/281","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.andreapasotti.it\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.andreapasotti.it\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.andreapasotti.it\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.andreapasotti.it\/home\/wp-json\/wp\/v2\/comments?post=281"}],"version-history":[{"count":19,"href":"https:\/\/www.andreapasotti.it\/home\/wp-json\/wp\/v2\/posts\/281\/revisions"}],"predecessor-version":[{"id":342,"href":"https:\/\/www.andreapasotti.it\/home\/wp-json\/wp\/v2\/posts\/281\/revisions\/342"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.andreapasotti.it\/home\/wp-json\/wp\/v2\/media\/288"}],"wp:attachment":[{"href":"https:\/\/www.andreapasotti.it\/home\/wp-json\/wp\/v2\/media?parent=281"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.andreapasotti.it\/home\/wp-json\/wp\/v2\/categories?post=281"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.andreapasotti.it\/home\/wp-json\/wp\/v2\/tags?post=281"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}