Instructions to use firstoff/animalmind-cat-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use firstoff/animalmind-cat-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="firstoff/animalmind-cat-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("firstoff/animalmind-cat-classifier") model = AutoModelForImageClassification.from_pretrained("firstoff/animalmind-cat-classifier", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,138 +1,50 @@
|
|
| 1 |
-
---
|
| 2 |
-
|
| 3 |
-
license:
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
-
|
| 7 |
-
-
|
| 8 |
-
-
|
| 9 |
-
-
|
| 10 |
-
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
-
|
| 46 |
-
-
|
| 47 |
-
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
## Intended Uses & Limitations
|
| 52 |
-
|
| 53 |
-
### Intended Uses
|
| 54 |
-
|
| 55 |
-
- **Primary use:** Cat image classification within the AnimalMind pet health monitoring platform.
|
| 56 |
-
- **Secondary use:** General cat image recognition tasks and research on animal health monitoring using computer vision.
|
| 57 |
-
- Integration with the AnimalMind backend API for real-time inference on user-submitted pet photos.
|
| 58 |
-
|
| 59 |
-
### Limitations
|
| 60 |
-
|
| 61 |
-
- This model is trained specifically for **cats** and is not intended for other animal species.
|
| 62 |
-
- Performance may degrade on low-quality, blurry, or heavily occluded images.
|
| 63 |
-
- The model should not be used as a replacement for professional veterinary diagnosis.
|
| 64 |
-
- Results may vary depending on lighting conditions, camera angle, and image resolution.
|
| 65 |
-
|
| 66 |
-
## Training and Evaluation Data
|
| 67 |
-
|
| 68 |
-
The model was fine-tuned on a curated dataset of cat images covering various health states, breeds, and behaviors. The dataset was preprocessed and augmented to improve generalization.
|
| 69 |
-
|
| 70 |
-
- **Preprocessing:** Images resized to 224x224, normalized with ImageNet mean and std.
|
| 71 |
-
- **Augmentation:** Random horizontal flip, color jitter, random crop.
|
| 72 |
-
- **Split:** Training / Validation split used during fine-tuning.
|
| 73 |
-
|
| 74 |
-
## Training Procedure
|
| 75 |
-
|
| 76 |
-
### Training Hyperparameters
|
| 77 |
-
|
| 78 |
-
The following hyperparameters were used during training:
|
| 79 |
-
|
| 80 |
-
- **Learning rate:** 2e-05
|
| 81 |
-
- **Train batch size:** 16
|
| 82 |
-
- **Eval batch size:** 16
|
| 83 |
-
- **Optimizer:** AdamW with betas=(0.9, 0.999) and epsilon=1e-08
|
| 84 |
-
- **LR scheduler type:** Linear
|
| 85 |
-
- **Number of epochs:** 5
|
| 86 |
-
- **Mixed precision training:** No
|
| 87 |
-
|
| 88 |
-
### Framework Versions
|
| 89 |
-
|
| 90 |
-
- Transformers 4.x
|
| 91 |
-
- PyTorch 2.x
|
| 92 |
-
- Datasets 2.x
|
| 93 |
-
- Tokenizers 0.x
|
| 94 |
-
|
| 95 |
-
## How to Use
|
| 96 |
-
|
| 97 |
-
```python
|
| 98 |
-
from transformers import AutoFeatureExtractor, AutoModelForImageClassification
|
| 99 |
-
from PIL import Image
|
| 100 |
-
import torch
|
| 101 |
-
|
| 102 |
-
# Load model and feature extractor
|
| 103 |
-
extractor = AutoFeatureExtractor.from_pretrained("firstoff/animalmind-cat-classifier")
|
| 104 |
-
model = AutoModelForImageClassification.from_pretrained("firstoff/animalmind-cat-classifier")
|
| 105 |
-
|
| 106 |
-
# Load your image
|
| 107 |
-
image = Image.open("cat.jpg").convert("RGB")
|
| 108 |
-
|
| 109 |
-
# Preprocess and predict
|
| 110 |
-
inputs = extractor(images=image, return_tensors="pt")
|
| 111 |
-
with torch.no_grad():
|
| 112 |
-
outputs = model(**inputs)
|
| 113 |
-
logits = outputs.logits
|
| 114 |
-
predicted_class = logits.argmax(-1).item()
|
| 115 |
-
|
| 116 |
-
print(f"Predicted class: {model.config.id2label[predicted_class]}")
|
| 117 |
-
```
|
| 118 |
-
|
| 119 |
-
## About AnimalMind
|
| 120 |
-
|
| 121 |
-
**AnimalMind** is an AI-powered pet health monitoring platform that uses computer vision and machine learning to help pet owners track and understand their pets' health and behavior. This model is a core component of the AnimalMind cat analysis pipeline.
|
| 122 |
-
|
| 123 |
-
- **Space:** [firstoff/animalmind-backend](https://huggingface.co/spaces/firstoff/animalmind-backend)
|
| 124 |
-
- **License:** Apache 2.0
|
| 125 |
-
|
| 126 |
-
## Citation
|
| 127 |
-
|
| 128 |
-
If you use this model in your research or application, please cite:
|
| 129 |
-
|
| 130 |
-
```bibtex
|
| 131 |
-
@misc{animalmind-cat-classifier,
|
| 132 |
-
author = {firstoff},
|
| 133 |
-
title = {AnimalMind Cat Classifier},
|
| 134 |
-
year = {2024},
|
| 135 |
-
publisher = {Hugging Face},
|
| 136 |
-
url = {https://huggingface.co/firstoff/animalmind-cat-classifier}
|
| 137 |
-
}
|
| 138 |
-
```
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: pt
|
| 3 |
+
license: mit
|
| 4 |
+
tags:
|
| 5 |
+
- image-classification
|
| 6 |
+
- vit
|
| 7 |
+
- pytorch
|
| 8 |
+
- animalmind
|
| 9 |
+
- biology
|
| 10 |
+
- pawra
|
| 11 |
+
datasets:
|
| 12 |
+
- oxford-iiit-pet
|
| 13 |
+
metrics:
|
| 14 |
+
- accuracy
|
| 15 |
+
- ece
|
| 16 |
+
library_name: transformers
|
| 17 |
+
---
|
| 18 |
+
# animalmind-cat-classifier
|
| 19 |
+
|
| 20 |
+
Modelo fine-tuned para o ecossistema Pawra (AnimalMind) para identificar raças de gatos.
|
| 21 |
+
|
| 22 |
+
## 🚀 Desempenho
|
| 23 |
+
|
| 24 |
+
| Métrica | Valor |
|
| 25 |
+
|---------|-------|
|
| 26 |
+
| **Acurácia** | Em treino |
|
| 27 |
+
| **ECE** | - |
|
| 28 |
+
| **Temperatura (T)** | - |
|
| 29 |
+
|
| 30 |
+
## 📦 Dataset
|
| 31 |
+
|
| 32 |
+
Este modelo foi treinado no dataset: **oxford-iiit-pet**.
|
| 33 |
+
|
| 34 |
+
## 💻 Como Usar
|
| 35 |
+
|
| 36 |
+
```python
|
| 37 |
+
from transformers import pipeline
|
| 38 |
+
|
| 39 |
+
classifier = pipeline("image-classification", model="firstoff/animalmind-cat-classifier")
|
| 40 |
+
result = classifier("https://upload.wikimedia.org/wikipedia/commons/3/3a/Cat03.jpg")
|
| 41 |
+
print(result)
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
## ⚠️ Limitações
|
| 45 |
+
- Apenas reconhece as raças/vocalizações presentes no dataset de treino.
|
| 46 |
+
- Não substitui avaliação veterinária profissional.
|
| 47 |
+
- Os resultados são estimativas, não diagnósticos médicos.
|
| 48 |
+
|
| 49 |
+
## 🔗 Links
|
| 50 |
+
- [Pawra - App](https://animalmind.vercel.app)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|