firstoff's picture
Update README.md
0af22a4 verified
|
Raw
History Blame Contribute Delete
4.66 kB
---
library_name: transformers
license: apache-2.0
base_model: google/vit-base-patch16-224
tags:
- generated_from_trainer
- image-classification
- cat
- animal-health
- animalmind
- vit
metrics:
- accuracy
model-index:
- name: animalmind-cat-classifier
results:
- task:
type: image-classification
name: Image Classification
metrics:
- type: accuracy
value: 0.9417
name: Accuracy
- type: loss
value: 0.1195
name: Loss
---
# animalmind-cat-classifier
**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.
This model is a fine-tuned version of [google/vit-base-patch16-224](https://huggingface.co/google/vit-base-patch16-224).
It achieves the following results on the evaluation set:
- **Loss:** 0.1195
- **Accuracy:** 0.9417 (94.17%)
## Model Description
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.
The model processes 224x224 pixel images and outputs classification probabilities across the trained categories.
- **Model type:** Vision Transformer (ViT) - Image Classification
- **Architecture:** `google/vit-base-patch16-224`
- **Parameters:** 85.8M
- **Tensor type:** F32
- **License:** Apache 2.0
## Intended Uses & Limitations
### Intended Uses
- **Primary use:** Cat image classification within the AnimalMind pet health monitoring platform.
- **Secondary use:** General cat image recognition tasks and research on animal health monitoring using computer vision.
- Integration with the AnimalMind backend API for real-time inference on user-submitted pet photos.
### Limitations
- This model is trained specifically for **cats** and is not intended for other animal species.
- Performance may degrade on low-quality, blurry, or heavily occluded images.
- The model should not be used as a replacement for professional veterinary diagnosis.
- Results may vary depending on lighting conditions, camera angle, and image resolution.
## Training and Evaluation Data
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.
- **Preprocessing:** Images resized to 224x224, normalized with ImageNet mean and std.
- **Augmentation:** Random horizontal flip, color jitter, random crop.
- **Split:** Training / Validation split used during fine-tuning.
## Training Procedure
### Training Hyperparameters
The following hyperparameters were used during training:
- **Learning rate:** 2e-05
- **Train batch size:** 16
- **Eval batch size:** 16
- **Optimizer:** AdamW with betas=(0.9, 0.999) and epsilon=1e-08
- **LR scheduler type:** Linear
- **Number of epochs:** 5
- **Mixed precision training:** No
### Framework Versions
- Transformers 4.x
- PyTorch 2.x
- Datasets 2.x
- Tokenizers 0.x
## How to Use
```python
from transformers import AutoFeatureExtractor, AutoModelForImageClassification
from PIL import Image
import torch
# Load model and feature extractor
extractor = AutoFeatureExtractor.from_pretrained("firstoff/animalmind-cat-classifier")
model = AutoModelForImageClassification.from_pretrained("firstoff/animalmind-cat-classifier")
# Load your image
image = Image.open("cat.jpg").convert("RGB")
# Preprocess and predict
inputs = extractor(images=image, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
predicted_class = logits.argmax(-1).item()
print(f"Predicted class: {model.config.id2label[predicted_class]}")
```
## About AnimalMind
**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.
- **Space:** [firstoff/animalmind-backend](https://huggingface.co/spaces/firstoff/animalmind-backend)
- **License:** Apache 2.0
## Citation
If you use this model in your research or application, please cite:
```bibtex
@misc{animalmind-cat-classifier,
author = {firstoff},
title = {AnimalMind Cat Classifier},
year = {2024},
publisher = {Hugging Face},
url = {https://huggingface.co/firstoff/animalmind-cat-classifier}
}
```