Skip to content

Repository files navigation

CloudMorph Lens: Cloud Classification & Segmentation Platform

Overview

CloudMorph Lens is a robust, production-ready deep learning platform for automated cloud type classification and segmentation from satellite or aerial imagery. Leveraging state-of-the-art computer vision models (ResNet50 for classification, U-Net for segmentation), StratoVision provides both a Python API and a Flask-based web interface for rapid experimentation, integration, and deployment.


Features

  • Multi-label Cloud Classification
    Accurately predicts the presence of multiple cloud types (cirrus, cumulus, stratus, nimbus, altostratus) in a single image.

  • Cloud Segmentation
    Generates pixel-level masks to delineate cloudy vs. non-cloudy regions.

  • Explainability
    Integrated Grad-CAM visualizations for model interpretability.

  • RESTful API
    Exposes endpoints for classification, segmentation, and overlay generation.

  • Web UI
    User-friendly interface for uploading images and visualizing results.

  • Synthetic Data Pipeline
    Includes utilities for generating and visualizing synthetic MODIS-like cloud images for rapid prototyping.


Directory Structure

model-2/
│
├── app.py                  # Flask application (API + UI)
├── cloud_model.pth         # Trained classification model weights
├── cloud_seg_model.pth     # Trained segmentation model weights
├── m2_StratoHack_Cloud.ipynb # End-to-end Jupyter notebook (training, inference, API)
├── requirements.txt        # Python dependencies
├── snap-1.png              # Example image
├── templates/
│   └── index.html          # Jinja2 template for web UI
└── uploads/
    └── ...                 # Uploaded images (runtime)

Quick Start

1. Clone the Repository

git clone https://github.com/your-org/stratovision.git
cd stratovision/model-2

2. Install Dependencies

It is recommended to use a virtual environment:

python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt

3. Run the Flask App

python app.py

Visit http://localhost:5000 in your browser.


API Endpoints

POST /predict_class

  • Description: Predict cloud type probabilities for an uploaded image.
  • Request:
    multipart/form-data with a file field (image).
  • Response:
    JSON with class probabilities.

POST /predict_mask

  • Description: Generate a binary cloud mask for an uploaded image.
  • Request:
    multipart/form-data with a file field (image).
  • Response:
    PNG image (cloud mask).

POST /cloud_map

  • Description: Overlay predicted cloud mask on the original image.
  • Request:
    multipart/form-data with a file field (image).
  • Response:
    PNG image (overlay).

Model Details

  • Classification:

    • Architecture: ResNet50 (multi-label head)
    • Output: Probability for each cloud type
  • Segmentation:

    • Architecture: U-Net
    • Output: Binary mask (cloud vs. non-cloud)
  • Explainability:

    • Grad-CAM for visualizing model attention

Training & Experimentation

All training, evaluation, and API code is available in m2_StratoHack_Cloud.ipynb.
The notebook is fully self-contained and can be run end-to-end for reproducibility.


Example Usage

Python (requests)

import requests

with open("snap-1.png", "rb") as f:
    files = {"file": f}
    response = requests.post("http://localhost:5000/predict_class", files=files)
    print(response.json())

cURL

curl -X POST -F "file=@snap-1.png" http://localhost:5000/predict_class

Contributing

Contributions are welcome! Please open issues or submit pull requests for improvements, bug fixes, or new features.


License

This project is licensed under the MIT License.


Contact

For questions, support, or collaboration, please contact atharvklhare18@gmail.com.


About

Automated Cloud Classification & Segmentation

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages