Note: This project was developed as a assignment for the Youth AI Initiative. It demonstrates the application of advanced Deep Learning techniques (Transfer Learning and Stacking Ensembles) to solve meteorological classification problems.
Overview
This project implements a robust Ensemble Learning model to classify images of clouds into 7 distinct meteorological categories. By leveraging the power of Transfer Learning, we combine three state-of-the-art Convolutional Neural Networks (ResNet50, VGG16, and InceptionV3) to extract features, which are then fed into a Meta-Learner (Neural Network) to make the final prediction.
This "Stacked Generalization" approach achieves higher accuracy and stability compared to using individual models alone, effectively handling the visual complexity and ambiguity often found in cloud formations.
Objectives
To classify cloud types from images with high accuracy.
To mitigate the issue of limited training data using Data Augmentation and Transfer Learning.
To address class imbalance using Weighted Loss Functions.
To demonstrate the effectiveness of stacking multiple weak(er) learners to create a strong meta-learner.
Dataset
The dataset consists of 960 images divided into 7 classes. The data was split into Training (70%), Validation (15%), and Testing (15%) sets.
Classes:
cirriform clouds
clear sky
cumulonimbus clouds
cumulus clouds
high cumuliform clouds
stratiform clouds
stratocumulus clouds
Model Architecture
The solution uses a Stacking Ensemble architecture:
Level 0: Base Learners
Three pre-trained models (weights from ImageNet) were used as feature extractors. The top layers were removed and replaced with a custom classification head:
ResNet50 (Input: 224x224)
VGG16 (Input: 224x224)
InceptionV3 (Input: 299x299)
Custom Head Structure:
GlobalAveragePooling2D
Dense(256, activation='relu') with L2 Regularization (0.01)
Dropout(0.6) (To prevent overfitting)
Dense(7, activation='softmax')
Level 1: Meta-Learner
The predictions (probability vectors) from the three base models are concatenated to form a meta-input vector (size 21). This is fed into a dense neural network:
Input: Concatenated Predictions
Hidden Layer: Dense(16, relu) + Dropout(0.4)
Output: Final Classification
Technical Implementation Details
Data Preprocessing
To handle the small dataset size and prevent overfitting, aggressive Data Augmentation was applied during training:
Rotation range: 40°
Width/Height shift: 0.25
Shear/Zoom: 0.25 / 0.3
Horizontal & Vertical Flips
Brightness adjustment: [0.7, 1.3]
Class Balancing
Class weights were computed using sklearn.utils.class_weight to penalize the model more for misclassifying rare classes (e.g., Cumulonimbus which had a weight of ~5.33).
Hyperparameters
Optimizer: Adam (Learning Rate: 0.0001 for base, 0.001 for meta)
Loss Function: Categorical Crossentropy
Batch Size: 64
Epochs: 75 (with Early Stopping and ReduceLROnPlateau)
Results
The Ensemble Meta-Model outperformed the individual base models on the test set.