firstoff commited on
Commit
05473f7
·
verified ·
1 Parent(s): 0af22a4

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +50 -138
README.md CHANGED
@@ -1,138 +1,50 @@
1
- ---
2
- library_name: transformers
3
- license: apache-2.0
4
- base_model: google/vit-base-patch16-224
5
- tags:
6
- - generated_from_trainer
7
- - image-classification
8
- - cat
9
- - animal-health
10
- - animalmind
11
- - vit
12
- metrics:
13
- - accuracy
14
- model-index:
15
- - name: animalmind-cat-classifier
16
- results:
17
- - task:
18
- type: image-classification
19
- name: Image Classification
20
- metrics:
21
- - type: accuracy
22
- value: 0.9417
23
- name: Accuracy
24
- - type: loss
25
- value: 0.1195
26
- name: Loss
27
- ---
28
-
29
- # animalmind-cat-classifier
30
-
31
- **AnimalMind Cat Classifier** is a fine-tuned Vision Transformer (ViT) model for cat health and behavior image classification. It is part of the [AnimalMind](https://huggingface.co/spaces/firstoff/animalmind-backend) platform — an AI-powered pet health monitoring application.
32
-
33
- This model is a fine-tuned version of [google/vit-base-patch16-224](https://huggingface.co/google/vit-base-patch16-224).
34
-
35
- It achieves the following results on the evaluation set:
36
- - **Loss:** 0.1195
37
- - **Accuracy:** 0.9417 (94.17%)
38
-
39
- ## Model Description
40
-
41
- This model uses the Vision Transformer (ViT) architecture, fine-tuned specifically to classify cat images for health and behavioral monitoring purposes. It is integrated into the AnimalMind backend to help pet owners identify potential health indicators from photos of their cats.
42
-
43
- The model processes 224x224 pixel images and outputs classification probabilities across the trained categories.
44
-
45
- - **Model type:** Vision Transformer (ViT) - Image Classification
46
- - **Architecture:** `google/vit-base-patch16-224`
47
- - **Parameters:** 85.8M
48
- - **Tensor type:** F32
49
- - **License:** Apache 2.0
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)