Instructions to use pawel-83748/weather-image-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use pawel-83748/weather-image-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="pawel-83748/weather-image-classifier") 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("pawel-83748/weather-image-classifier") model = AutoModelForImageClassification.from_pretrained("pawel-83748/weather-image-classifier", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Weather image classifier (convnext-tiny-224 fine-tuned)
Classifies an outdoor photo into one of 4 weather classes: Cloudy, Rain, Shine, Sunrise.
Model details
- Base model:
facebook/convnext-tiny-224(ImageNet pre-trained), fully fine-tuned. - Training data: Kaggle "Multi-class Weather Dataset" (1125 images), stratified split 787 train / 169 validation / 169 test (seed 42).
- Training: 6 epochs, batch size 32, AdamW, cosine schedule, fp16, light augmentation (random resized crop, horizontal flip, color jitter). Best epoch chosen by validation accuracy.
Results (test set, 169 images)
- Accuracy: 0.9882
- Macro-F1: 0.9888
| Class | Precision | Recall | F1 | Support |
|---|---|---|---|---|
| Cloudy | 1.000 | 1.000 | 1.000 | 45 |
| Rain | 1.000 | 1.000 | 1.000 | 33 |
| Shine | 0.950 | 1.000 | 0.974 | 38 |
| Sunrise | 1.000 | 0.962 | 0.981 | 53 |
Confusion matrix and per-class table are in the eval/ folder of this repo.
Usage
from transformers import pipeline
clf = pipeline("image-classification", model="<this-repo-id>")
clf("photo.jpg", top_k=3)
Limitations
- Small dataset (1125 images, 4 classes): not robust to night scenes, indoor photos, or unseen weather types.
- Classes are visually overlapping (e.g. Cloudy vs. Rain, Shine vs. Sunrise); expect confusion there.
- Educational project, not intended for safety-critical use.
- Downloads last month
- 4,399
Model tree for pawel-83748/weather-image-classifier
Base model
facebook/convnext-tiny-224