A transfer learning + interpretability project using TensorFlow, achieving 95% accuracy on real world weather imagery.
- Achieved 95% test accuracy classifying 5 weather types using MobileNetV2 with transfer learning.
- Enhanced model transparency with Grad-CAM visualizations, exposing attention maps for each prediction.
- Automated image preprocessing pipeline with data augmentation and clean train/test split generation.
- Tuned model using early stopping and learning rate scheduling to prevent overfitting.
- Visualized performance with training curves and confusion matrix for multi class error analysis.
This project simulates a lightweight real world image classifier for weather conditions—potentially applicable to travel, safety, or photo metadata tagging.
Built using TensorFlow/Keras with transfer learning via MobileNetV2, enhanced by real time data augmentation, early stopping, learning rate scheduling, and visual explanations using Grad-CAM.
- Test Accuracy: 95%
- Classes: sunny, rainy, cloudy, snowy, sunrise
- Model: MobileNetV2 (frozen base) + custom dense head
- Interpretability: Grad-CAM visualizations show model attention
- Grad-CAM revealed that the model focused on sky textures in cloudy scenes and horizon color gradients in “sunrise” images—aligning with human intuition.
This project goes beyond basic image classification. It integrates real world techniques transfer learning, data augmentation, interpretability, and evaluation—to reflect what’s expected in production ML workflows. The Grad-CAM heatmaps promote model transparency, a key concern in deploying AI systems responsibly.
- Transfer learning with MobileNetV2 (ImageNet pretraining)
- Custom dense head with dropout regularization
- Real time image augmentation: rotation, zoom, brightness, shear, etc.
- Grad-CAM overlay to interpret predictions
- Confusion matrix for error analysis
- EarlyStopping and ReduceLROnPlateau to prevent overfitting

weatherimages/ ├── raw/ # Original images by class ├── train/ # 80% training images ├── test/ # 20% test images └── weather_image_classification.ipynb
- 20 epochs
- Early stopping triggered around epoch 19
- Validation accuracy stabilized above 94%
- Loss and accuracy trends plotted over epochs
- Error patterns analyzed using a confusion matrix (scikit-learn)


The full training and test dataset (5 weather classes, ~1,000 images) is hosted on Hugging Face:
Download weatherimages.zip This dataset is shared for educational and research purposes only.
After downloading, unzip and place the folder under weatherimages/
in your project root.
- Frameworks: TensorFlow, Keras
- Tools: Google Colab, OpenCV, Matplotlib
- Languages: Python 3.11.13
- Fine tune deeper layers to boost performance beyond 95%
- Benchmark against other backbones like ResNet50 or EfficientNet
- Deploy as an interactive app (e.g., Streamlit) for real time predictions
- Export to TFLite or ONNX to enable on device inference
David Shableski — GitHub
Project created to demonstrate practical AI engineering skills for portfolio use.