{"id":82,"date":"2015-04-30T16:45:59","date_gmt":"2015-04-30T23:45:59","guid":{"rendered":"https:\/\/ashtonchens.wordpress.com\/?post_type=jetpack-portfolio&amp;p=82"},"modified":"2015-04-30T16:45:59","modified_gmt":"2015-04-30T23:45:59","slug":"perceptron-handwriting-recognition","status":"publish","type":"jetpack-portfolio","link":"https:\/\/ashtonchen.com\/index.php\/portfolio\/perceptron-handwriting-recognition\/","title":{"rendered":"Perceptron Handwriting Recognition"},"content":{"rendered":"<p>2008<\/p>\n<ul>\n<li>Adapted the artificial neural network perceptron to implement a handwriting recognition application that recognizes stylus inputs on tablet PCs using Python with customized Graphic User Interface (GUI) written in Tkinter.<\/li>\n<li>The application can be taught to recognize inputs of numbers, letters, and characters from various languages<\/li>\n<li>Recognition process improves as the number of training session increases<\/li>\n<li>It is possible to export the same handwriting recognition application to other mobile platforms such as smartphones and tablets<\/li>\n<\/ul>\n<p><!--more--><\/p>\n<p><img data-attachment-id=\"121\" data-permalink=\"https:\/\/ashtonchen.com\/index.php\/portfolio\/perceptron-handwriting-recognition\/perceptron-interface\/#main\" data-orig-file=\"https:\/\/ashtonchen.com\/wp-content\/uploads\/2015\/05\/perceptron-interface.png\" data-orig-size=\"628,472\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Perceptron Interface\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/ashtonchen.com\/wp-content\/uploads\/2015\/05\/perceptron-interface-300x225.png\" data-large-file=\"https:\/\/ashtonchen.com\/wp-content\/uploads\/2015\/05\/perceptron-interface.png\" decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-121\" src=\"http:\/\/ashtonchen.com\/wp-content\/uploads\/2015\/05\/perceptron-interface.png\" alt=\"Perceptron Interface\" width=\"628\" height=\"472\" srcset=\"https:\/\/ashtonchen.com\/wp-content\/uploads\/2015\/05\/perceptron-interface.png 628w, https:\/\/ashtonchen.com\/wp-content\/uploads\/2015\/05\/perceptron-interface-300x225.png 300w, https:\/\/ashtonchen.com\/wp-content\/uploads\/2015\/05\/perceptron-interface-326x245.png 326w\" sizes=\"(max-width: 628px) 100vw, 628px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Technique and Description<\/strong><\/p>\n<p>This project is to demonstrate the application of AI technique using Python and TKinter. Perceptron learning technique is used to recognize a set of pre-defined images. It means that the label associates with each image must be defined in the program prior to recognition process. In this project the AI is used for hand-written characters recognition. The user can \u201cteach\u201d the perceptron to recognize his or her unique hand-writing style. The change of prototype weights of each class is showed in during the program execution.\u00a0 After multiplying the input vector by the prototype weights of a defined label and sum them up, we can acquire a score for that class. After computing the score for every defined label class, the perceptron AI pick the class with the highest score and output its label. However, if the output label is not correct, the perceptron classifier must be trained to recognize the label for that given image. Each label on the record of the perceptron AI program has its own class of prototype weights. For the class of a label which was mis-selected by the perceptron AI, its prototype weights are decremented by the input vector; for the class of a label which was not selected but supposed to, its prototype weights are incremented by the input vector. Such change in prototype weights of both labels ensures that next time, the class of right label will be more likely to get selected by the AI perceptron.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Demo<\/strong><\/p>\n<p>To use the program, one first needs to create a bmp image file with dimension of 112 x 112. Write down\u00a0 single digit or character\u00a0 and save it under the same folder as the program files. Then click interface.py file will start the program. After the program is successfully started, click \u201cLoad Input\u201d button on the graphic user interface, and the program will convert the bmp image file to a file contains a datum object and save it under the same folder. Once the datum object is created, recognition process can begin. Click on \u201cRecognize\u201d button and the program will display its guess of label in \u201cGuess Character\u201d section. If the guess is not correct, you can tell the program the correct one by click \u201cLabel Entered\u201d button and enter the label for that datum object. The value you just entered now shows up in the \u201cInput character\u201d section. Now click on \u201cTraining\u201d button, and the program starts the training session. After training is finished, click on \u201cRecognize\u201d button to show changes of the prototype weights of the user input label and pre-guessed label. If there are too many zero to see the weight change. Click on \u201cToggle\u201d to remove all the zero from the canvas. Click again to put them back.<\/p>\n<p>&nbsp;<\/p>\n<p><a title=\"Perceptron Hanwriting Recognition Project\" href=\"http:\/\/goo.gl\/gWKDcx\">Project Files<\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Reference<\/strong><\/p>\n<p><a href=\"http:\/\/effbot.org\/tkinterbook\/tkinter-events-and-bindings.htm\">http:\/\/effbot.org\/tkinterbook\/tkinter-events-and-bindings.htm<\/a><\/p>\n<p><a href=\"http:\/\/www.java2s.com\/Code\/Python\/CatalogPython.htm\">http:\/\/www.java2s.com\/Code\/Python\/CatalogPython.htm<\/a><\/p>\n<p><a href=\"http:\/\/www.pythonware.com\/library\/pil\/handbook\/image.htm\">http:\/\/www.pythonware.com\/library\/pil\/handbook\/image.htm<\/a><\/p>\n<p><a href=\"http:\/\/effbot.org\/zone\/tkinter-complex-canvas.htm\">http:\/\/effbot.org\/zone\/tkinter-complex-canvas.htm<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>2008 Adapted the artificial neural network perceptron to implement a handwriting recognition application that recognizes stylus inputs on tablet PCs using Python with customized Graphic User Interface (GUI) written in Tkinter. The application can be taught to recognize inputs of numbers, letters, and characters from various languages Recognition process improves as the number of training [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":123,"comment_status":"open","ping_status":"open","template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"jetpack-portfolio-type":[6,15],"jetpack-portfolio-tag":[5,12],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Perceptron Handwriting Recognition - Ashton Chen<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ashtonchen.com\/index.php\/portfolio\/perceptron-handwriting-recognition\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Perceptron Handwriting Recognition - Ashton Chen\" \/>\n<meta property=\"og:description\" content=\"2008 Adapted the artificial neural network perceptron to implement a handwriting recognition application that recognizes stylus inputs on tablet PCs using Python with customized Graphic User Interface (GUI) written in Tkinter. The application can be taught to recognize inputs of numbers, letters, and characters from various languages Recognition process improves as the number of training [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ashtonchen.com\/index.php\/portfolio\/perceptron-handwriting-recognition\/\" \/>\n<meta property=\"og:site_name\" content=\"Ashton Chen\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/www.ashtonchen.com\/wp-content\/uploads\/2015\/05\/biological-neural-network-1680-1050.jpg?fit=1680%2C1050&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"1680\" \/>\n\t<meta property=\"og:image:height\" content=\"1050\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ashtonchen.com\/index.php\/portfolio\/perceptron-handwriting-recognition\/\",\"url\":\"https:\/\/ashtonchen.com\/index.php\/portfolio\/perceptron-handwriting-recognition\/\",\"name\":\"Perceptron Handwriting Recognition - Ashton Chen\",\"isPartOf\":{\"@id\":\"https:\/\/ashtonchen.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/ashtonchen.com\/index.php\/portfolio\/perceptron-handwriting-recognition\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/ashtonchen.com\/index.php\/portfolio\/perceptron-handwriting-recognition\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/ashtonchen.com\/wp-content\/uploads\/2015\/05\/biological-neural-network-1680-1050.jpg\",\"datePublished\":\"2015-04-30T23:45:59+00:00\",\"dateModified\":\"2015-04-30T23:45:59+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/ashtonchen.com\/index.php\/portfolio\/perceptron-handwriting-recognition\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ashtonchen.com\/index.php\/portfolio\/perceptron-handwriting-recognition\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ashtonchen.com\/index.php\/portfolio\/perceptron-handwriting-recognition\/#primaryimage\",\"url\":\"https:\/\/ashtonchen.com\/wp-content\/uploads\/2015\/05\/biological-neural-network-1680-1050.jpg\",\"contentUrl\":\"https:\/\/ashtonchen.com\/wp-content\/uploads\/2015\/05\/biological-neural-network-1680-1050.jpg\",\"width\":1680,\"height\":1050},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ashtonchen.com\/index.php\/portfolio\/perceptron-handwriting-recognition\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/ashtonchen.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Projects\",\"item\":\"https:\/\/ashtonchen.com\/index.php\/portfolio\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Perceptron Handwriting Recognition\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ashtonchen.com\/#website\",\"url\":\"https:\/\/ashtonchen.com\/\",\"name\":\"Ashton Chen\",\"description\":\"Software Engineer\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ashtonchen.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Perceptron Handwriting Recognition - Ashton Chen","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:\/\/ashtonchen.com\/index.php\/portfolio\/perceptron-handwriting-recognition\/","og_locale":"en_US","og_type":"article","og_title":"Perceptron Handwriting Recognition - Ashton Chen","og_description":"2008 Adapted the artificial neural network perceptron to implement a handwriting recognition application that recognizes stylus inputs on tablet PCs using Python with customized Graphic User Interface (GUI) written in Tkinter. The application can be taught to recognize inputs of numbers, letters, and characters from various languages Recognition process improves as the number of training [&hellip;]","og_url":"https:\/\/ashtonchen.com\/index.php\/portfolio\/perceptron-handwriting-recognition\/","og_site_name":"Ashton Chen","og_image":[{"width":1680,"height":1050,"url":"https:\/\/i0.wp.com\/www.ashtonchen.com\/wp-content\/uploads\/2015\/05\/biological-neural-network-1680-1050.jpg?fit=1680%2C1050&ssl=1","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/ashtonchen.com\/index.php\/portfolio\/perceptron-handwriting-recognition\/","url":"https:\/\/ashtonchen.com\/index.php\/portfolio\/perceptron-handwriting-recognition\/","name":"Perceptron Handwriting Recognition - Ashton Chen","isPartOf":{"@id":"https:\/\/ashtonchen.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ashtonchen.com\/index.php\/portfolio\/perceptron-handwriting-recognition\/#primaryimage"},"image":{"@id":"https:\/\/ashtonchen.com\/index.php\/portfolio\/perceptron-handwriting-recognition\/#primaryimage"},"thumbnailUrl":"https:\/\/ashtonchen.com\/wp-content\/uploads\/2015\/05\/biological-neural-network-1680-1050.jpg","datePublished":"2015-04-30T23:45:59+00:00","dateModified":"2015-04-30T23:45:59+00:00","breadcrumb":{"@id":"https:\/\/ashtonchen.com\/index.php\/portfolio\/perceptron-handwriting-recognition\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ashtonchen.com\/index.php\/portfolio\/perceptron-handwriting-recognition\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ashtonchen.com\/index.php\/portfolio\/perceptron-handwriting-recognition\/#primaryimage","url":"https:\/\/ashtonchen.com\/wp-content\/uploads\/2015\/05\/biological-neural-network-1680-1050.jpg","contentUrl":"https:\/\/ashtonchen.com\/wp-content\/uploads\/2015\/05\/biological-neural-network-1680-1050.jpg","width":1680,"height":1050},{"@type":"BreadcrumbList","@id":"https:\/\/ashtonchen.com\/index.php\/portfolio\/perceptron-handwriting-recognition\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ashtonchen.com\/"},{"@type":"ListItem","position":2,"name":"Projects","item":"https:\/\/ashtonchen.com\/index.php\/portfolio\/"},{"@type":"ListItem","position":3,"name":"Perceptron Handwriting Recognition"}]},{"@type":"WebSite","@id":"https:\/\/ashtonchen.com\/#website","url":"https:\/\/ashtonchen.com\/","name":"Ashton Chen","description":"Software Engineer","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ashtonchen.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"}]}},"jetpack_sharing_enabled":true,"jetpack_likes_enabled":false,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/ashtonchen.com\/index.php\/wp-json\/wp\/v2\/jetpack-portfolio\/82"}],"collection":[{"href":"https:\/\/ashtonchen.com\/index.php\/wp-json\/wp\/v2\/jetpack-portfolio"}],"about":[{"href":"https:\/\/ashtonchen.com\/index.php\/wp-json\/wp\/v2\/types\/jetpack-portfolio"}],"author":[{"embeddable":true,"href":"https:\/\/ashtonchen.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ashtonchen.com\/index.php\/wp-json\/wp\/v2\/comments?post=82"}],"version-history":[{"count":0,"href":"https:\/\/ashtonchen.com\/index.php\/wp-json\/wp\/v2\/jetpack-portfolio\/82\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ashtonchen.com\/index.php\/wp-json\/wp\/v2\/media\/123"}],"wp:attachment":[{"href":"https:\/\/ashtonchen.com\/index.php\/wp-json\/wp\/v2\/media?parent=82"}],"wp:term":[{"taxonomy":"jetpack-portfolio-type","embeddable":true,"href":"https:\/\/ashtonchen.com\/index.php\/wp-json\/wp\/v2\/jetpack-portfolio-type?post=82"},{"taxonomy":"jetpack-portfolio-tag","embeddable":true,"href":"https:\/\/ashtonchen.com\/index.php\/wp-json\/wp\/v2\/jetpack-portfolio-tag?post=82"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}