Back to Projects

Computer Vision / Deep Learning

Weather Deep Learning Classifier

Image-based weather condition recognition using transfer learning with VGG16

Image UploadFlask APIKeras PreprocessVGG16 CNNWeather Prediction

VGG16

Model Backbone

Pretrained CNN feature extractor

224px

Input Resolution

Keras image preprocessing

5

Weather Classes

Cloud, fog, rain, shine, sunrise

Docker

Deployment Path

Flask container hosted on Render

What It Does

This project is a weather image classification application. A user uploads an outdoor image, the Flask backend preprocesses it to the model input size, and a trained Keras model predicts the visible weather condition.

The classifier focuses on practical image-based recognition rather than sensor-based forecasting. It demonstrates a complete computer vision workflow: transfer learning, image preprocessing, web inference, and containerized deployment.

Why These Choices

  • VGG16 for transfer learning: A pretrained convolutional backbone provides strong visual features without requiring a massive weather-specific training dataset from scratch.

  • Keras and TensorFlow for model serving: The saved model is loaded directly in the Flask process, keeping the inference path simple and easy to deploy.

  • Flask for the web interface: A small upload-and-predict app fits the project scope and makes model behavior testable through a browser.

  • Docker for deployment: Packaging the model, dependencies, and Flask app into one container makes hosting on Render reproducible.

Architecture

Layer 1 - User Input

Browser Upload

JPG / PNG image

Flask /predict

multipart form upload

Layer 2 - Model Inference

Resize to 224 x 224

Keras image loader

Scale Pixels

x / 255 normalization

model_vgg16.h5

argmax class prediction

Layer 3 - Deployment

Dockerfile

python:3.9-slim-buster

Render

hosted Flask container

PythonTensorFlowKerasVGG16FlaskDockerRenderNumPyMatplotlib

Prediction Classes

Cloudy

Foggy

Rainy

Shine

Sunrise

Skills Demonstrated

Transfer Learning

Fine-tuned a pretrained VGG16 convolutional network for a custom weather image classification task.

Image Inference Pipeline

Implemented upload handling, image resizing, pixel normalization, batch dimension expansion, and class decoding.

Flask Model Serving

Exposed the trained Keras model through a lightweight web app with an AJAX-powered prediction endpoint.

Container Deployment

Packaged the application and dependencies with Docker for cloud deployment on Render.

Computer VisionCNNKerasFlaskDockerRender
View Source