{"id":2474,"date":"2025-12-09T05:09:22","date_gmt":"2025-12-09T10:09:22","guid":{"rendered":"https:\/\/www.rexfeng.com\/blog\/?p=2474"},"modified":"2025-12-09T05:09:22","modified_gmt":"2025-12-09T10:09:22","slug":"building-a-6-7-image-classifier-with-fast-ai","status":"publish","type":"post","link":"https:\/\/www.rexfeng.com\/blog\/2025\/12\/building-a-6-7-image-classifier-with-fast-ai\/","title":{"rendered":"Building a 6 7 image classifier with fast.ai"},"content":{"rendered":"\n<p>I recently took Fast.ai&#8217;s <a href=\"https:\/\/course.fast.ai\/\">Practical Deep Learning for Coders<\/a> (part 1) course. As practice, I used transfer learning to build an image classifer. Given a handwritten number image, <a href=\"https:\/\/huggingface.co\/spaces\/xtapal\/six-seven-classifier\">the model will classify it as a 6, a 7, or neither<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"540\" height=\"302\" src=\"https:\/\/www.rexfeng.com\/blog\/wp-content\/uploads\/2025\/12\/Screenshot-2025-12-09-at-2.06.01-AM-540x302.png\" alt=\"\" class=\"wp-image-2475\" srcset=\"https:\/\/www.rexfeng.com\/blog\/wp-content\/uploads\/2025\/12\/Screenshot-2025-12-09-at-2.06.01-AM-540x302.png 540w, https:\/\/www.rexfeng.com\/blog\/wp-content\/uploads\/2025\/12\/Screenshot-2025-12-09-at-2.06.01-AM-300x168.png 300w, https:\/\/www.rexfeng.com\/blog\/wp-content\/uploads\/2025\/12\/Screenshot-2025-12-09-at-2.06.01-AM-150x84.png 150w, https:\/\/www.rexfeng.com\/blog\/wp-content\/uploads\/2025\/12\/Screenshot-2025-12-09-at-2.06.01-AM-768x430.png 768w, https:\/\/www.rexfeng.com\/blog\/wp-content\/uploads\/2025\/12\/Screenshot-2025-12-09-at-2.06.01-AM-1536x860.png 1536w, https:\/\/www.rexfeng.com\/blog\/wp-content\/uploads\/2025\/12\/Screenshot-2025-12-09-at-2.06.01-AM-2048x1146.png 2048w, https:\/\/www.rexfeng.com\/blog\/wp-content\/uploads\/2025\/12\/Screenshot-2025-12-09-at-2.06.01-AM-624x349.png 624w\" sizes=\"auto, (max-width: 540px) 100vw, 540px\" \/><\/figure>\n\n\n\n<p>With transfer learning, I was able to fine tune resnet18 against the MNIST database (handwritten digits). Using fast.ai&#8217;s library on paperspace, it was easy to create DataLoaders, fine tune the pretrained model, and evaluate the model loss. With gradio, I was able to deploy this to huggingface spaces to easily run inference.<\/p>\n\n\n\n<p>Testing out the gradio app, I find the prediction itself to not be very reliable. This is ok since I wanted practice with the end to end process, and the image dataset can be expanded to gather more images of 6 and 7 digits for better fine tuning.<\/p>\n\n\n\n<p>With fast.ai, paperspace, and huggingface, ML classification is accessible.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently took Fast.ai&#8217;s Practical Deep Learning for Coders (part 1) course. As practice, I used transfer learning to build an image classifer. Given a handwritten number image, the model will classify it as a 6, a 7, or neither. With transfer learning, I was able to fine tune resnet18 against the MNIST database (handwritten [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1029,7],"tags":[1520,1518,1515,1516,1519,954,1517],"class_list":["post-2474","post","type-post","status-publish","format-standard","hentry","category-programming","category-tech","tag-ai","tag-dataloaders","tag-fast-ai","tag-fastai","tag-gradio","tag-ml","tag-mnist"],"_links":{"self":[{"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/posts\/2474","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/comments?post=2474"}],"version-history":[{"count":1,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/posts\/2474\/revisions"}],"predecessor-version":[{"id":2476,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/posts\/2474\/revisions\/2476"}],"wp:attachment":[{"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/media?parent=2474"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/categories?post=2474"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/tags?post=2474"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}