Downloads Β· 30 days
0
UncertainPrinciple/SimpsonsKnower-v1
SimpsonsKnower-v1 is a machine learning model from UncertainPrinciple. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads Β· 30 days
0
Access
Public
Updated Dec 12, 2025
Repo size
51.6 MB
Likes
1
Public
Click a slice to open those files.
.h551.6 MB Β· 100%
From the Hugging Face model README
<<<<<<< HEAD
A deep learning and Computer Vision project that identifies Simpsons characters from images using Convolutional Neural Networks (CNN)
This project uses deep learning to classify images of Simpsons characters. Built with TensorFlow/Keras and deployed with a Flask web interface, it can identify the top 10 most common Simpsons characters with high accuracy.
The model uses a Convolutional Neural Network (CNN) architecture trained on thousands of images to recognize distinctive features of each character.
python train_model.py # Train the model
python test_model.py # Test on sample images
python app.py
# Open http://localhost:5000

Input Layer (80x80x1 Grayscale Image)
β
βββββββββββββββββββββββββββββββββββ
β Convolutional Block 1 β
β - Conv2D (32 filters, 3x3) β
β - Conv2D (32 filters, 3x3) β
β - MaxPooling2D (2x2) β
β - Dropout (0.2) β
βββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββ
β Convolutional Block 2 β
β - Conv2D (64 filters, 3x3) β
β - Conv2D (64 filters, 3x3) β
β - MaxPooling2D (2x2) β
β - Dropout (0.2) β
βββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββ
β Convolutional Block 3 β
β - Conv2D (256 filters, 3x3) β
β - Conv2D (256 filters, 3x3) β
β - MaxPooling2D (2x2) β
β - Dropout (0.2) β
βββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββ
β Fully Connected Layers β
β - Flatten β
β - Dropout (0.5) β
β - Dense (1024 neurons, ReLU) β
β - Dense (10 neurons, Softmax) β
βββββββββββββββββββββββββββββββββββ
β
Output (10 Character Probabilities)
The Simpsons Characters Dataset from Kaggle
1. Homer Simpson ~2,200 images
2. Ned Flanders ~1,500 images
3. Moe Szyslak ~1,200 images
4. Lisa Simpson ~1,100 images
5. Bart Simpson ~1,000 images
6. Marge Simpson ~990 images
7. Mr. Burns ~950 images
8. Principal Skinner ~820 images
9. Krusty ~800 images
10. Maggie Simpson ~500 images
git clone https://github.com/yourusername/simpsons-classifier.git
cd simpsons-classifier
# Windows
python -m venv env
.\env\Scripts\activate
# Linux/Mac
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
# Option 1: Manual download
# Download from: https://www.kaggle.com/datasets/alexattia/the-simpsons-characters-dataset
# Extract to: ./data/simpsons_dataset/
# Option 2: Using Kaggle API
pip install kaggle
kaggle datasets download -d alexattia/the-simpsons-characters-dataset
unzip the-simpsons-characters-dataset.zip -d ./data/
python train_model.py
Configuration Options:
# In train_model.py
IMG_SIZE = (80, 80) # Image dimensions
BATCH_SIZE = 32 # Batch size for training
EPOCHS = 10 # Number of training epochs
Expected Output:
Epoch 1/10 - loss: 2.1234, acc: 0.4567, val_loss: 1.8901, val_acc: 0.5234
Epoch 2/10 - loss: 1.5678, acc: 0.6234, val_loss: 1.3456, val_acc: 0.6789
...
Epoch 10/10 - loss: 0.4321, acc: 0.8901, val_loss: 0.5234, val_acc: 0.8567
Model saved to: models/simpsons_classifier.h5
python test_model.py --image path/to/test_image.jpg
Example Output:
Loading model...
Preprocessing image...
Making prediction...
Predicted Character: Homer Simpson
Confidence: 94.23%
All Predictions:
1. Homer Simpson 94.23%
2. Bart Simpson 3.45%
3. Marge Simpson 1.23%
...
python app.py
Then open your browser to: http://localhost:5000
# Hyperparameters
LEARNING_RATE = 0.001
MOMENTUM = 0.9
DECAY = 1e-7
BATCH_SIZE = 32
EPOCHS = 10
# Optimizer
optimizer = SGD(
learning_rate=LEARNING_RATE,
decay=DECAY,
momentum=MOMENTUM,
nesterov=True
)
# Loss Function
loss = 'binary_crossentropy'
# Metrics
metrics = ['accuracy']
# Implemented augmentations:
- Random rotation (Β±15Β°)
- Width shift (Β±10%)
- Height shift (Β±10%)
- Horizontal flip
- Zoom (Β±10%)
For Better Performance:
Prevent Overfitting:
# Main page
GET /
Returns: HTML interface
# Prediction endpoint
POST /predict
Content-Type: multipart/form-data
Body: image file
Response:
{
"character": "homer_simpson",
"confidence": "94.23%",
"all_predictions": {
"homer_simpson": "94.23%",
"bart_simpson": "3.45%",
...
}
}
Change Theme Colors:
/* In app.py HTML template */
body {
background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
}
Modify Port:
# In app.py
app.run(debug=True, port=8080) # Change from 5000 to 8080
simpsons-classifier/
β
βββ data/
β βββ simpsons_dataset/ # Dataset directory
β βββ homer_simpson/
β βββ bart_simpson/
β βββ ...
β
βββ models/
β βββ simpsons_classifier.h5 # Trained model
β
βββ src/
β βββ train_model.py # Model training script
β βββ test_model.py # Testing script
β βββ preprocessing.py # Image preprocessing utilities
β
βββ web/
β βββ app.py # Flask web application
β βββ static/ # Static files (CSS, JS)
β βββ templates/ # HTML templates
β
βββ notebooks/
β βββ exploratory_analysis.ipynb # Data exploration
β
βββ assets/
β βββ demo_screenshot.png # Project screenshots
β
βββ requirements.txt # Python dependencies
βββ README.md # This file
βββ LICENSE # Project license
βββ .gitignore # Git ignore rules
| Metric | Training | Validation |
|---|---|---|
| Accuracy | 89.01% | 85.67% |
| Loss | 0.4321 | 0.5234 |
| Character | Accuracy | Common Misclassifications |
|---|---|---|
| Homer Simpson | 92% | Occasionally confused with Ned |
| Bart Simpson | 88% | Sometimes confused with Lisa |
| Marge Simpson | 90% | High accuracy due to distinctive hair |
| Lisa Simpson | 85% | Occasionally confused with Bart |
| Mr. Burns | 91% | High accuracy due to distinctive features |
| ... | ... | ... |
Homer Bart Marge Lisa ...
Homer 184 3 2 1 ...
Bart 2 176 1 9 ...
Marge 1 0 180 0 ...
Lisa 0 8 1 170 ...
...

Contributions are welcome! Here's how you can help:
Fork the repository
Create a feature branch
git checkout -b feature/amazing-feature
Commit your changes
git commit -m "Add amazing feature"
Push to the branch
git push origin feature/amazing-feature
Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2024 [Your Name]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction...
Project Maintainer: [Your Name]
If you use this project in your research or work, please cite:
@misc{simpsons_classifier_2024,
author = {Your Name},
title = {Simpsons Character Classifier using CNN},
year = {2024},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/yourusername/simpsons-classifier}}
}
A deep learning and Computer Vision project that identifies Simpsons characters from images using Convolutional Neural Networks (CNN)
This project uses deep learning to classify images of Simpsons characters. Built with TensorFlow/Keras and deployed with a Flask web interface, it can identify the top 10 most common Simpsons characters with high accuracy.
The model uses a Convolutional Neural Network (CNN) architecture trained on thousands of images to recognize distinctive features of each character.
python train_model.py # Train the model
python test_model.py # Test on sample images
python app.py
# Open http://localhost:5000

Input Layer (80x80x1 Grayscale Image)
β
βββββββββββββββββββββββββββββββββββ
β Convolutional Block 1 β
β - Conv2D (32 filters, 3x3) β
β - Conv2D (32 filters, 3x3) β
β - MaxPooling2D (2x2) β
β - Dropout (0.2) β
βββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββ
β Convolutional Block 2 β
β - Conv2D (64 filters, 3x3) β
β - Conv2D (64 filters, 3x3) β
β - MaxPooling2D (2x2) β
β - Dropout (0.2) β
βββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββ
β Convolutional Block 3 β
β - Conv2D (256 filters, 3x3) β
β - Conv2D (256 filters, 3x3) β
β - MaxPooling2D (2x2) β
β - Dropout (0.2) β
βββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββ
β Fully Connected Layers β
β - Flatten β
β - Dropout (0.5) β
β - Dense (1024 neurons, ReLU) β
β - Dense (10 neurons, Softmax) β
βββββββββββββββββββββββββββββββββββ
β
Output (10 Character Probabilities)
The Simpsons Characters Dataset from Kaggle
1. Homer Simpson ~2,200 images
2. Ned Flanders ~1,500 images
3. Moe Szyslak ~1,200 images
4. Lisa Simpson ~1,100 images
5. Bart Simpson ~1,000 images
6. Marge Simpson ~990 images
7. Mr. Burns ~950 images
8. Principal Skinner ~820 images
9. Krusty ~800 images
10. Maggie Simpson ~500 images
git clone https://github.com/yourusername/simpsons-classifier.git
cd simpsons-classifier
# Windows
python -m venv env
.\env\Scripts\activate
# Linux/Mac
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
# Option 1: Manual download
# Download from: https://www.kaggle.com/datasets/alexattia/the-simpsons-characters-dataset
# Extract to: ./data/simpsons_dataset/
# Option 2: Using Kaggle API
pip install kaggle
kaggle datasets download -d alexattia/the-simpsons-characters-dataset
unzip the-simpsons-characters-dataset.zip -d ./data/
python train_model.py
Configuration Options:
# In train_model.py
IMG_SIZE = (80, 80) # Image dimensions
BATCH_SIZE = 32 # Batch size for training
EPOCHS = 10 # Number of training epochs
Expected Output:
Epoch 1/10 - loss: 2.1234, acc: 0.4567, val_loss: 1.8901, val_acc: 0.5234
Epoch 2/10 - loss: 1.5678, acc: 0.6234, val_loss: 1.3456, val_acc: 0.6789
...
Epoch 10/10 - loss: 0.4321, acc: 0.8901, val_loss: 0.5234, val_acc: 0.8567
Model saved to: models/simpsons_classifier.h5
python test_model.py --image path/to/test_image.jpg
Example Output:
Loading model...
Preprocessing image...
Making prediction...
Predicted Character: Homer Simpson
Confidence: 94.23%
All Predictions:
1. Homer Simpson 94.23%
2. Bart Simpson 3.45%
3. Marge Simpson 1.23%
...
python app.py
Then open your browser to: http://localhost:5000
# Hyperparameters
LEARNING_RATE = 0.001
MOMENTUM = 0.9
DECAY = 1e-7
BATCH_SIZE = 32
EPOCHS = 10
# Optimizer
optimizer = SGD(
learning_rate=LEARNING_RATE,
decay=DECAY,
momentum=MOMENTUM,
nesterov=True
)
# Loss Function
loss = 'binary_crossentropy'
# Metrics
metrics = ['accuracy']
# Implemented augmentations:
- Random rotation (Β±15Β°)
- Width shift (Β±10%)
- Height shift (Β±10%)
- Horizontal flip
- Zoom (Β±10%)
For Better Performance:
Prevent Overfitting:
# Main page
GET /
Returns: HTML interface
# Prediction endpoint
POST /predict
Content-Type: multipart/form-data
Body: image file
Response:
{
"character": "homer_simpson",
"confidence": "94.23%",
"all_predictions": {
"homer_simpson": "94.23%",
"bart_simpson": "3.45%",
...
}
}
Change Theme Colors:
/* In app.py HTML template */
body {
background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
}
Modify Port:
# In app.py
app.run(debug=True, port=8080) # Change from 5000 to 8080
simpsons-classifier/
β
βββ data/
β βββ simpsons_dataset/ # Dataset directory
β βββ homer_simpson/
β βββ bart_simpson/
β βββ ...
β
βββ models/
β βββ simpsons_classifier.h5 # Trained model
β
βββ src/
β βββ train_model.py # Model training script
β βββ test_model.py # Testing script
β βββ preprocessing.py # Image preprocessing utilities
β
βββ web/
β βββ app.py # Flask web application
β βββ static/ # Static files (CSS, JS)
β βββ templates/ # HTML templates
β
βββ notebooks/
β βββ exploratory_analysis.ipynb # Data exploration
β
βββ assets/
β βββ demo_screenshot.png # Project screenshots
β
βββ requirements.txt # Python dependencies
βββ README.md # This file
βββ LICENSE # Project license
βββ .gitignore # Git ignore rules
| Metric | Training | Validation |
|---|---|---|
| Accuracy | 89.01% | 85.67% |
| Loss | 0.4321 | 0.5234 |
| Character | Accuracy | Common Misclassifications |
|---|---|---|
| Homer Simpson | 92% | Occasionally confused with Ned |
| Bart Simpson | 88% | Sometimes confused with Lisa |
| Marge Simpson | 90% | High accuracy due to distinctive hair |
| Lisa Simpson | 85% | Occasionally confused with Bart |
| Mr. Burns | 91% | High accuracy due to distinctive features |
| ... | ... | ... |
Homer Bart Marge Lisa ...
Homer 184 3 2 1 ...
Bart 2 176 1 9 ...
Marge 1 0 180 0 ...
Lisa 0 8 1 170 ...
...

Contributions are welcome! Here's how you can help:
Fork the repository
Create a feature branch
git checkout -b feature/amazing-feature
Commit your changes
git commit -m "Add amazing feature"
Push to the branch
git push origin feature/amazing-feature
Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2024 [Your Name]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction...
Project Maintainer: [Your Name]
If you use this project in your research or work, please cite:
@misc{simpsons_classifier_2024,
author = {Your Name},
title = {Simpsons Character Classifier using CNN},
year = {2024},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/yourusername/simpsons-classifier}}
}
β Star this repo if you find it helpful!
c0f8356393cf0dd42b306eb133e2f07070df0306