Skip to content

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Weather Image Classification with Keras

Weather phenomenon recognition notably affects many aspects of our daily lives, for example, weather forecast, road condition monitoring, transportation, agriculture, forestry management, and the detection of the natural environment. In contrast, few studies aim to classify actual weather phenomenon images, usually relying on visual observations from humans.

In this project we propose a study weather classification from images using Convolutional Neural Networks (CNNs) with Keras+Tensorflow. We present a dataset with 3348 images with six weather conditions (rain, shine, sunrise, fogsmog, snow, cloudy) obtaining a precision of 90% in the validation data and 87% in test data. Realizing the automatic and high-quality classification of weather phenomena images can provide a reference for future research on weather image classification and weather forecasting.

Required Libraries:

  • Tensorflow
  • Keras
  • PIL
  • Seaborn
  • pandas
  • numpy
  • matplotlib
  • os

Importing Datasets

Multi-class weather dataset(MWD) for image classification is a valuable dataset used in the research paper entitled “Multi-class weather recognition from still image using heterogeneous ensemble method”. The dataset provides a platform for outdoor weather analysis by extracting various features for recognizing different weather conditions.

URL: https://www.kaggle.com/mauricioarancibia/weatherimgclass/download

Upload arhive.zip file to colab. Unzip archive.zip

Data Exploration Analysis (EDA)

In this section we will proceed to perform the exploration and analysis of the data.

Training Dataset Distribution

image

Validation Dataset Distribution

image

Test Dataset Distribution

image

Image Samples

Cloudy

image

Rain

image

Sunrise

image

Image processing and Data Augmentation

At this stage we are going to generate images using Keras Generator, in this way we can see how the Data Augmentation strategy is working. We disable rescaling so that images can be easily viewed.

image image

Model Implementation

The strategy for this work is to make two models from scratch and one using transfer learning, in this way we can see the behavior and performance of each one.

Model 1

image

Model 2

image

Model 3 with Transfer Learning

image image

Scores

Model 1

image

Model 2

image

Model 3

image

Final results

image

Medium Blog Post

https://urvog.medium.com/weather-image-classification-with-keras-4eee9468ff2f

License

This project is published in 2021 under MIT license.

About

Many industries have the need to identify current and past weather conditions. The data helps them plan, organize, and/or optimize their operations. For example, farmers might look at the current weather to decide if the sprinklers should be turned on or off. Ski resort operators might choose to enable snowmaking machines based on varying weather…

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages