This project predicts tire classes (e.g., damaged vs. normal) using Transfer Learning with a pretrained ResNet50 architecture from PyTorch. It demonstrates a modern deep learning pipeline including:
- 🧠 Pretrained ResNet50 backbone from ImageNet for feature extraction
- 🧩 Custom Fully Connected (FC) Classifier Head with Batch Normalization, ReLU, and Dropout
- ⚖️ Cross-Entropy Loss for binary classification
- 🚀 Adam optimizer for efficient training
- 🔒 Frozen ResNet backbone to leverage pre-learned visual features
- 🧰 Modular design — easily switch between saving only the FC head or the full model
- 🎨 Interactive Gradio Interface for real-time image classification visualization
Below is a preview of the Gradio Interface used for real-time classification:
- PyTorch – model, training, and inference
- torchvision – pretrained ResNet50 weights
- pandas, numpy – data handling
- matplotlib – loss visualization
- pickle – saving/loading normalization params and trained model
- Gradio — interactive web interface for real-time model demos
- Python 3.13+
- Recommended editor: VS Code
- Clone the repository
git clone https://github.com/hurkanugur/ResNet-Tire-Classifier.git- Navigate to the
ResNet-Tire-Classifierdirectory
cd ResNet-Tire-Classifier- Install dependencies
pip install -r requirements.txtView → Command Palette → Python: Create Environment- Choose Venv and your Python version
- Select requirements.txt to install dependencies
- Click OK
- Download Dataset: 🔗 Click here to download
- Unzip
data.zipinto the project directory - The
datafolder should be on the same hierarchy assrcandmodel.
assets/
└── app_screenshot.png # Screenshot of the application
data/
├── defective # Defective tire images
└── good # Good tire images
src/
├── config.py # Paths, hyperparameters, split ratios
├── dataset.py # Data loading & preprocessing
├── device_manager.py # Selects and manages compute device
├── train.py # Training pipeline
├── inference.py # Inference pipeline
├── model.py # Neural network definition
└── visualize.py # Training/validation plots
main/
├── main_train.py # Entry point for training
└── main_inference.py # Entry point for inference
requirements.txt # Python dependenciesResNet50 (Pretrained on ImageNet)
↓
[Feature Extractor] # All convolutional layers (frozen)
↓
Custom Classifier Head:
→ Linear(in_features, 1024)
→ BatchNorm1d(1024)
→ ReLU
→ Dropout(0.5)
→ Linear(1024, 2)
→ Softmax(Output)Navigate to the project directory:
cd ResNet-Tire-ClassifierRun the training script:
python -m main.main_trainor
python3 -m main.main_trainNavigate to the project directory:
cd ResNet-Tire-ClassifierRun the app:
python -m main.main_inferenceor
python3 -m main.main_inference