ποΈ ResNet18 Intel Image Classifier
π A ResNet18-based image classification model trained on the Intel Image Classification dataset, capable of recognizing six types of natural scenes. The model was fine-tuned using PyTorch, optimized for reproducibility and deployment in educational and practical scenarios.
π·οΈ Classes
- Buildings
- Forest
- Glacier
- Mountain
- Sea
- Street
π§° Training Procedure
- Loaded a pretrained ResNet18 model from
torchvision.models
.
- Replaced the final classification layer with a 6-unit fully connected layer.
- Resized all input images to 224x224 and applied ImageNet normalization.
- Used
ImageFolder
and random_split()
to divide the dataset:
- 70% Training
- 15% Validation
- 15% Testing
- Training setup:
- Optimizer: Adam
- Loss Function: CrossEntropyLoss
- Batch size: 32
- Learning rate: 0.001
- Epochs: 5
- Saved the final model as
pytorch_model.bin
.
π Performance
Metric |
Value |
Final Train Accuracy |
90.08% |
Final Val Accuracy |
88.74% |
βοΈ Framework & Environment
- Python: 3.10.12
- PyTorch: 2.0.1+cu118
- Torchvision: 0.15.2+cu118
- Platform: Google Colab (GPU enabled, CUDA support)
π§ͺ Hyperparameters
Parameter |
Value |
Epochs |
5 |
Batch Size |
32 |
Optimizer |
Adam |
Learning Rate |
0.001 |
Loss Function |
CrossEntropy |
Image Size |
224x224 |
Data Split |
70% Train / 15% Val / 15% Test |