Downloads · 30 days
0
gperdrizet/CIFAR10
CIFAR10 is a image classification model from gperdrizet. Use it when you need a label for an image. The card lists the license as gpl-3.0.
This repository contains a collection of PyTorch models trained on the CIFAR-10 dataset, demonstrating progressive improvements in image classification through different architectures and training techniques.
Downloads · 30 days
0
Access
Public
Updated Feb 23, 2026
Repo size
46 MB
Likes
0
Public
Click a slice to open those files.
.pth57.4 MB · 87%
From the Hugging Face model README
This repository contains a collection of PyTorch models trained on the CIFAR-10 dataset, demonstrating progressive improvements in image classification through different architectures and training techniques.
| Model | Architecture | Test Accuracy | Parameters |
|---|---|---|---|
| DNN | Fully-connected | ~45% | 1.4M |
| CNN | Basic CNN | ~65% | 122K |
| RGB CNN | CNN with color | ~70% | 370K |
| Optimized CNN | Optuna-tuned architecture | ~75% | Variable |
| Augmented CNN | Optimized + augmentation | ~78% | Variable |
| ResNet50 | Transfer learning | ~85%+ | 23.5M |
Note: Exact accuracies may vary slightly between training runs
File: dnn.pth
A baseline fully-connected neural network operating on grayscale CIFAR-10 images.
Architecture:
Training:
File: cnn.pth
Basic convolutional architecture to exploit spatial relationships in images.
Architecture:
Training:
File: rgb_cnn.pth
CNN modified to process full RGB color information.
Architecture:
Training:
File: architecture_optimized_cnn.pth
Architecture optimized using Optuna hyperparameter search.
Optimized Parameters:
Training:
File: training_optimized_cnn.pth
Further optimization of training hyperparameters.
Optimized Parameters:
File: augmented_cnn.pth
Combines optimized architecture with data augmentation.
Data Augmentation:
Training:
File: resnet50.pth
Transfer learning using pre-trained ResNet50.
Architecture:
Training:
CIFAR-10 consists of 60,000 32×32 color images in 10 classes:
Split:
import torch
# Load a model
model = torch.load('dnn.pth', map_location='cpu')
model.eval()
# Or download from Hugging Face Hub
from huggingface_hub import hf_hub_download
model_path = hf_hub_download(
repo_id='YOUR_USERNAME/CIFAR10',
filename='dnn.pth'
)
model = torch.load(model_path, map_location='cpu')
from torchvision import transforms
from PIL import Image
# Preprocessing for grayscale models (DNN, CNN)
transform = transforms.Compose([
transforms.Grayscale(num_output_channels=1),
transforms.ToTensor(),
transforms.Normalize((0.5,), (0.5,))
])
# Preprocessing for RGB models
transform = transforms.Compose([
transforms.ToTensor(),
transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))
])
# For ResNet50 (224x224 input)
transform = transforms.Compose([
transforms.Resize(256),
transforms.CenterCrop(224),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406],
std=[0.229, 0.224, 0.225])
])
# Load and preprocess image
image = Image.open('path/to/image.jpg')
input_tensor = transform(image).unsqueeze(0)
# Make prediction
with torch.no_grad():
output = model(input_tensor)
probabilities = torch.softmax(output, dim=1)
predicted_class = output.argmax(dim=1).item()
classes = ['airplane', 'automobile', 'bird', 'cat', 'deer',
'dog', 'frog', 'horse', 'ship', 'truck']
print(f'Predicted: {classes[predicted_class]}')
All models were trained with:
Models 4-6 used Optuna for automated hyperparameter tuning:
Each model includes:
See the companion notebooks for detailed performance analysis.
CIFAR10/
├── notebooks/ # Jupyter notebooks for each model
├── models/ # Saved model files (.pth)
├── src/ # image-classification-tools package
└── data/ # CIFAR-10 dataset (auto-downloaded)
Install the companion tools package:
pip install image-classification-tools
Or clone the repository for full notebooks:
git clone https://github.com/YOUR_USERNAME/CIFAR10.git
cd CIFAR10
If you use these models or code, please cite:
@software{cifar10_tutorial,
author = {Your Name},
title = {CIFAR-10 Image Classification Tutorial},
year = {2026},
url = {https://github.com/YOUR_USERNAME/CIFAR10}
}
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
Last updated: February 2026