Cloud Classification - ResNet-18

Model Description

This model classifies cloud images into four categories using a ResNet-18 neural network.

The model was trained in Google Colab with GPU acceleration as part of an end-to-end MLOps laboratory project.

The training process and evaluation results were tracked using MLflow.

Supported Classes

ID Class
0 Cumulus
1 Cirrus
2 Altocumulus
3 Stratocumulus

Training Information

  • Architecture: ResNet-18
  • Training environment: Google Colab
  • Number of epochs: 5
  • Experiment tracking: MLflow
  • MLflow experiment: cloud_classifier_resnet18
  • Model format: SafeTensors
  • Task: Image Classification

Dataset

The model was trained for four-class cloud image classification.

The test set contained 52 images, with 13 images for each class.

The original dataset source and its license have not been documented in this model card.

Evaluation Results

Metric Value
Test Accuracy 76.92%
Test Macro F1 0.7685

Per-Class Performance

Class Precision Recall F1 Support
Cumulus 0.88 0.54 0.67 13
Cirrus 1.00 0.85 0.92 13
Altocumulus 0.63 0.92 0.75 13
Stratocumulus 0.71 0.77 0.74 13

Usage

Install the required libraries:

pip install torch transformers pillow

Example prediction:

import torch
from PIL import Image
from transformers import (
    AutoImageProcessor,
    AutoModelForImageClassification
)

repo_id = "ksumara/cloud-classifier-resnet18"

processor = AutoImageProcessor.from_pretrained(repo_id)
model = AutoModelForImageClassification.from_pretrained(repo_id)

model.eval()

image = Image.open("cloud.jpg").convert("RGB")

inputs = processor(
    images=image,
    return_tensors="pt"
)

with torch.no_grad():
    outputs = model(**inputs)
    predicted_id = outputs.logits.argmax(-1).item()

print(model.config.id2label[predicted_id])

Limitations

  • The model recognizes only four cloud categories.
  • Evaluation was performed on a small test set.
  • Performance may decrease for images from other sources.
  • The model is experimental and is not intended for safety-critical weather applications.

MLOps Workflow

  1. Train the model using Google Colab.
  2. Track experiments and metrics using MLflow.
  3. Publish the winning model to Hugging Face Hub.
  4. Deploy inference using Hugging Face Spaces.
  5. Integrate the Space with FastAPI and PostgreSQL.

Repository

Hugging Face Model: https://huggingface.co/ksumara/cloud-classifier-resnet18

Downloads last month
-
Safetensors
Model size
11.2M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support