Building a TinyVGG Model from Scratch to Classify The Simpsons Characters with PyTorch 2.0

Luis Valencia
2 min readApr 6, 2023

If you’re a fan of The Simpsons and interested in deep learning, you’re in for a treat. In this portfolio project, we will be building a TinyVGG model from scratch using PyTorch to classify The Simpsons characters from images. This project will showcase how to build a custom dataset and train a model.

The Simpsons has been entertaining audiences for over 30 years, and with over 700 characters, it’s hard to keep track of them all. With the help of deep learning, we can train a model that can recognize each character in a matter of seconds. This project will demonstrate how to preprocess the data, build a custom dataset, create and train the model, and evaluate its performance.

We will dive into the details of building a TinyVGG model from scratch, a small version of the VGG model, which is known for its simplicity and effectiveness.

Throughout this project, we will use PyTorch, a popular deep learning library known for its simplicity and ease of use. We will use PyTorch’s custom dataset functionality to load and preprocess our data, and we will use its built-in optimization and loss functions to train our model.

By the end of this project, you will have a fully functional TinyVGG model that can classify The Simpsons characters with high accuracy. You will also gain valuable experience in building custom datasets, training deep learning models, and evaluating their performance. So let’s get started and build our own Simpsons character classifier using deep learning!

Show me the code

Enough talking, if you want to take a dig deep into the code, click the link below, Warning, there is a lot of code and explanations!: https://github.com/levalencia/DataScience-Portfolio/blob/main/SimpsonsClassifier/Pytorch%20-%20Simpsons%20Multi%20Classifier.ipynb

--

--