This project presents a multi-class image classification pipeline built on the Multi-class Weather Dataset (MWD) using advanced deep learning methods. It compares simple feedforward classifiers with tuned dense networks, convolutional architectures, and transfer learning using MobileNet.
Key challenges addressed include:
- Handling image resizing and channel correction
- Preventing overfitting through dropout and augmentation
- Improving model generalization on confusing weather conditions like "cloudy"
- 📦 Source: Multi-class Weather Dataset (Mendeley)
- 📸 Classes:
cloudy,rain,shine,sunrise - 🖼️ Images: 1,125 JPG files (~280 per class)
- 📊 Data Format: CSV-based partitioning into training, validation, and test splits
- Random partition into
my_training.csv,my_validation.csv,my_test.csv - Label count visualization and distribution checks
- Resizing to 230x230x3
- Normalization (pixel values to [0,1])
- Data pipeline using
tf.data.TextLineDataset
- Simple Flatten → Softmax model
- Custom Dense NN (512 → 128) + Dropout
- Hyperparameter tuning using
keras-tuner
- ConvNet: 2×Conv2D + MaxPooling + Dropout
- MobileNet Transfer Learning:
- Pretrained on ImageNet
- Frozen base layers
- Fine-tuned classification head
| Model | Architecture | Accuracy | Notable Insight |
|---|---|---|---|
| Task 2.1 | Flatten + Dense | ~77% | Strong generalization with minimal overfitting |
| Task 2.2 | Dense + Dropout (tuned) | ~73% | Lower accuracy but better confidence (low loss) |
| Task 3.1 | Custom ConvNet | 83.43% | Best performer; struggles with "cloudy" class |
| Task 3.2 | MobileNet (frozen) | 66.27% | Struggles with data adaptation |
Despite the strong ConvNet performance, cloudy images remained most difficult due to visual similarity with rainy and low-light sunrise scenes.
- Targeted Augmentation: Add fog, blur, and gray-shade filters
- Class Weighting: Penalize cloudy misclassifications during training
- Attention Layers: Apply CBAM or SE blocks for fine-grained feature extraction
- Task 2.1 generalizes well with simple architectures and clean data
- Dropout and tuning help regularize dense models
- ConvNets outperform transfer learning when dataset is small and highly specific
- Cloudy images require specialized treatment due to ambiguity
# Clone the repository
git clone https://github.com/your-username/WeatherNet-Multi-Class-Weather-Image-Classification.git
cd WeatherNet-Multi-Class-Weather-Image-Classification
# Install requirements
pip install tensorflow keras pandas matplotlib numpy
# Launch the notebook
jupyter notebook WeatherNet-Multi-Class-Weather-Image-Classification.ipynbWeatherNet-Multi-Class-Weather-Image-Classification/
├── WeatherNet-Multi-Class-Weather-Image-Classification.ipynb
├── training.csv
├── validation.csv
├── test.csv
├── dataset2/
│ ├── cloudyXXX.jpg
│ ├── shineXXX.jpg
│ └── ...
├── README.md
└── requirements.txt
Gishor Thavakumar 🔗 LinkedIn 💻 Portfolio 📬 GitHub
This project is licensed under the MIT License. See the LICENSE file for more details.
"This case study serves as a strong baseline for environmental AI classification tasks. The techniques here are extensible to other small-scale image recognition challenges involving weather, emotion, and scene classification."