Welcome to the Natural Scenes Image Classification project — a deep learning-based image classifier built from scratch using a custom ResNet9 architecture in PyTorch. This model was trained on Intel dataset of over 14,000+ natural scene images and achieved an impressive ~91% accuracy.
- 🔍 Task: Multi-class image classification of natural scenes (e.g., forests, deserts, mountains, etc.)
- 🧠 Model: Custom-built ResNet9 architecture
- 📦 Framework: PyTorch (built from scratch, no pre-trained weights)
- 🔁 Data Augmentation: Applied transformations for robustness
- 🎯 Accuracy Achieved: ~91% on validation/test set
- 🗂️ Dataset: Intel Image dataset of 17,000+ labeled images across multiple natural categories
The dataset used contains 14,000+ high-quality labeled images of various natural scenes, such as:
- Forest
- Mountain
- Sea
- Glacier
- Buildings
- Streets
The data is organized in folders by class and split into training and validation sets.
Unlike standard deep CNNs, ResNet9 is a compact and efficient architecture that stacks 9 layers with residual connections. It balances computational efficiency and accuracy, making it ideal for moderate-sized datasets.
- Convolutional layers with BatchNorm and ReLU
- Skip connections for residual learning
- MaxPooling and AdaptiveAvgPooling
- Fully connected (Linear) classification head
📌 Built entirely from scratch using torch.nn modules.
To improve generalization and prevent overfitting, the following transformations were applied using torchvision.transforms:
- Random Horizontal Flip
- Random Rotation
- Random Crop / Resize
- Normalization with dataset-specific mean and std
- Optimizer:
Adam - Loss Function:
CrossEntropyLoss - Epochs: 20+
- Batch Size: 64
- Learning Rate: 1e-3 (with scheduling)
- Hardware: Trained on GPU (CUDA)
| Metric | Score |
|---|---|
| Accuracy | ~91% |
| Model Size | Lightweight |
| Generalization | Excellent |
| Overfitting | Minimal due to augmentation |
📉 Training and validation accuracy/loss plots included in the notebook.
- 👨💻 Created with 💡 and PyTorch by Rikin Pithadia
- 🔬 Data Science & AI Enthusiast | Building AI that sees the world