This program uses Python and the Tensorflow / Keras modules to classify Weather Images from a Kaggle dataset.
Download from KAGGLE.
The .ipynb file includes the basic model as well as 4 more variations (LR, Optimizers , Dropout Rates , Pre-trained models and Data Augmentation). The models were trained in 20 epochs, with a MobileNetV2/ResNet150V2 including early stopping for overfitting prevention. The results and the plots are being shown in the .ipynb as well as the commentary.
The pictures are divided into 11 classes:
-
dew
-
fog/smog
-
frost
-
glaze
-
hail
-
lightning
-
rain
-
rainbow
-
rime
-
sandstorm
-
snow
-
Create a Google Drive folder named Colab Notebooks
-
Upload the
.zipdataset into the folder -
Make sure Google Drive mount is successful:
from google.colab import drive
drive.mount('/content/drive')- Verify the folder exists:
!ls "/content/drive/My Drive/Colab Notebooks/"- Unzip the dataset:
!unzip -o "/content/drive/My Drive/Colab Notebooks/archive.zip" -d "/usr/local/dataset"Image Test:
- Feed a path to the model
img_path = '/usr/local/dataset/dataset/fogsmog/4075.jpg'- Evaluate the prediction
Variation #4 (Base Model + Data Augmentation) achieved the best overall performance. The curves are very smooth indicating not much overfitting to the dataset.
- Language: Python 3.12.12
- Modules: Tensorflow/Keras, Numpy, Matplotlib (& other)
- Platform: Google Colab
MIT License




