Building a 6 7 image classifier with fast.ai

I recently took Fast.ai’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 digits). Using fast.ai’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.

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.

With fast.ai, paperspace, and huggingface, ML classification is accessible.