Instructions to use ksumara/cloud-classifier-resnet18 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ksumara/cloud-classifier-resnet18 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="ksumara/cloud-classifier-resnet18") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# pip install -U transformers accelerate # Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("ksumara/cloud-classifier-resnet18") model = AutoModelForImageClassification.from_pretrained("ksumara/cloud-classifier-resnet18", device_map="auto") - Notebooks
- Google Colab
- Kaggle
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
- Train the model using Google Colab.
- Track experiments and metrics using MLflow.
- Publish the winning model to Hugging Face Hub.
- Deploy inference using Hugging Face Spaces.
- Integrate the Space with FastAPI and PostgreSQL.
Repository
Hugging Face Model: https://huggingface.co/ksumara/cloud-classifier-resnet18
- Downloads last month
- -