Skip to content

xAsmodeus/Weather-Image-Classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

138 Commits
 
 
 
 
 
 

Repository files navigation

Weather Image Classification


📑 Table of Contents


🧭 Overview

This program uses Python and the Tensorflow / Keras modules to classify Weather Images from a Kaggle dataset.


🗂️ Dataset

Download from KAGGLE.


🛠️ Approach

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.


🧩 Classes

The pictures are divided into 11 classes:

  1. dew

  2. fog/smog

  3. frost

  4. glaze

  5. hail

  6. lightning

  7. rain

  8. rainbow

  9. rime

  10. sandstorm

  11. snow


⚙️ Setup

  1. Create a Google Drive folder named Colab Notebooks

  2. Upload the .zip dataset into the folder

  3. Make sure Google Drive mount is successful:

from google.colab import drive
drive.mount('/content/drive')
  1. Verify the folder exists:
!ls "/content/drive/My Drive/Colab Notebooks/"
  1. Unzip the dataset:
!unzip -o "/content/drive/My Drive/Colab Notebooks/archive.zip" -d "/usr/local/dataset"

📊 Results

Variation Characteristics Plots
Base Model Pre trained: MobileNetV2
Optimizer: Adam
Learning Rate: 0.001
Dropout: 0.3
image
Variation #1 Pre trained: MobileNetV2
Optimizer: Adam
Learning Rate: 0.001
Dropout: 0.5
var1
Variation #2 Pre trained: MobileNetV2
Optimizer: AdamW
Learning Rate: 0.001
Dropout: 0.5
var2
Variation #3 Pre trained: ResNet152V2
Optimizer: AdamW
Learning Rate: 0.001
Dropout: 0.5
var3
Variation #4 (base model + extra Data Aug):
rotation_range = 30
width_shift_range = 0.2
height_shift_range = 0.2
brightness_range = (0.5, 1.5)
var4

Image Test:

  1. Feed a path to the model
img_path = '/usr/local/dataset/dataset/fogsmog/4075.jpg'
  1. Evaluate the prediction
image

🥇 Best Performing Model

Variation #4 (Base Model + Data Augmentation) achieved the best overall performance. The curves are very smooth indicating not much overfitting to the dataset.


🧰 Technology Stack

  • Language: Python 3.12.12
  • Modules: Tensorflow/Keras, Numpy, Matplotlib (& other)
  • Platform: Google Colab

🛡️ Licence

MIT License


🙌 Credits

Sources
https://www.youtube.com/watch?v=oHGVDtgGbGo
https://www.youtube.com/watch?v=FXKMmilL70w
https://community.deeplearning.ai/t/include-top-parameter-and-usage-of-custom-model-for-transfer-learning/260359/3
https://www.youtube.com/watch?v=F8uFAkHfK18
https://www.geeksforgeeks.org/top-pre-trained-models-for-image-classification/
https://chatgpt.com
https://gemini.google.com

About

Classification of Weather Conditions using Python and Google Colab

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published