/ Модель

Характеристики

Лицензия
Своя лицензия
Библиотека
pytorch
Опубликована
3 сен 2026

companion-animal-species-breed-classifier

Классификация изображенийИзображение → label3 профессии
0скачиваний за 30 дней0лайковвеса обновлены3 сен 2026

Описание модели

Составлено на русском по карточке модели и метаданным Hugging Face

Компактная модель MobileNetV3-Large классифицирует изображения животных по 211 видам и породам для приложений ухода, спасения и распознавания животных.

Модель классификации изображений животных разработана Mohammad Meftahi. Она основана на MobileNetV3-Large и относит изображение к одному из 211 классов, включая виды птиц, кошек и собак, а также класс unknown. Модель принимает изображения размером 224 × 224 пикселя и доступна для инференса в PyTorch и ONNX.

Модель предназначена для распознавания животных и пород в приложениях по уходу и спасению животных, а также для исследований, экспериментов и прототипирования систем компьютерного зрения. Она компактна и рассчитана на быстрый инференс при ограниченных вычислительных ресурсах. В оценке на 15 042 примерах точность составила 56,35% Top-1 и 83,48% Top-5 по 211 классам; точность определения вида — 99,45%.

Модель хуже различает визуально похожие породы, а качество неодинаково между классами из-за дисбаланса и малого числа примеров для некоторых категорий. Объекты вне обучающих классов могут быть ошибочно отнесены к известным классам, а класс unknown не обеспечивает надёжного распознавания неизвестных объектов. Не следует использовать модель как единственное основание для ветеринарных, природоохранных или юридических решений. Лицензия указана как other; конкретные условия в карточке не раскрыты.

Сценарии применения

  • определение вида животного по фотографии
  • распознавание породы кошки на изображении
  • распознавание породы собаки на изображении
  • классификация птиц, найденных или переданных под опеку
  • создание прототипа системы распознавания животных для приюта

Ограничения

Точность Top-1 по 211 классам составляет 56,35%, классы несбалансированы, а визуально похожие породы различаются ненадёжно. Неизвестные животные могут получить метку известного класса; результаты требуют проверки человеком и не подходят как единственное основание для ветеринарных или юридических решений.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Companion Animal Species & Breed Classifier

A fine-grained image classification model for identifying animal species and breeds across 211 classes, with a focus on animals commonly encountered as companion animals or animals that may come under human care.

The model is based on MobileNetV3-Large and supports both PyTorch and ONNX inference.

Model status: Research / Experimental Task: Fine-grained image classification Classes: 211 Input size: 224 × 224 pixels


Model Overview

This model performs fine-grained classification across four major animal groups, together with an unknown class:

Animal groupClasses
🐦 Birds26
🐱 Cats63
🐶 Dogs120
🐰 Rabbit1
❓ Unknown1
Total211

The bird classes intentionally include species that are not conventionally considered companion animals, such as eagles, falcons, crows, ducks, and turkeys.

Their inclusion reflects the intended broader use case of the dataset: an animal may come under human care because it was found, injured, rescued, temporarily housed, or otherwise placed under human supervision.

Therefore, "companion animal" in this project is a practical dataset scope rather than a strict biological or legal classification.


Architecture

The model uses:

MobileNetV3-Large

Input Image
    │
    ▼
Resize → 224 × 224
    │
    ▼
ImageNet Normalization
    │
    ▼
MobileNetV3-Large
    │
    ▼
211-Class Classification Head
    │
    ▼
Predicted Class

Model Configuration

ParameterValue
Architecturemobilenet_v3_large
Number of classes211
Input resolution224 × 224
FrameworkPyTorch
Export formatONNX
Validation accuracy56.38%

The model metadata specifies the following normalization parameters:

Mean = [0.485, 0.456, 0.406]
Std  = [0.229, 0.224, 0.225]

Dataset

The model was trained using the (Companion & Human-Care Animal Dataset)[https://huggingface.co/datasets/Pezhvak98/companion-human-care-animal-dataset] , a composite dataset assembled from multiple publicly available datasets and sources.

Dataset Resolution

The source dataset images were standardized to:

192 × 192 pixels

For this model, images are subsequently processed to:

224 × 224 pixels

Therefore, the dataset image resolution and model input resolution are intentionally different.


Classes

The classifier contains 211 output classes.

The class naming convention used by the original training pipeline is preserved exactly.

In particular, dog classes use the do_ prefix:

do_golden_retriever
do_german_shepherd
do_labrador_retriever
do_pomeranian
do_rottweiler
...

The model's complete class-to-index and index-to-class mappings are provided in:

class_to_idx.json
idx_to_class.json

These files should be used when converting the model's output index into a human-readable class label.


Evaluation

The model was evaluated on 15,042 samples.

Overall Results

MetricResult
Top-1 Accuracy56.35%
Top-5 Accuracy83.48%
Species-level Accuracy99.45%
Evaluation Samples15,042

The evaluation results are provided in:

evaluation_results.json

Interpreting the Results

The difference between species-level accuracy and fine-grained Top-1 accuracy is important.

The model achieves:

99.45% species-level accuracy

while achieving:

56.35% Top-1 accuracy across 211 fine-grained classes.

This indicates that the model is substantially more reliable at distinguishing broad animal groups than at distinguishing visually similar breeds or fine-grained categories.

The Top-5 accuracy of 83.48% also indicates that the correct class is frequently among the model's five highest-ranked predictions even when it is not the first prediction.


Performance and Design Considerations

This model was developed with a specific practical objective in mind: achieving a useful balance between classification performance, inference speed, and computational requirements on the target hardware.

MobileNetV3-Large was intentionally selected instead of a larger and more computationally demanding architecture to keep inference lightweight and practical for deployment on relatively resource-constrained systems.

With 56.35% Top-1 accuracy, 83.48% Top-5 accuracy, and 99.45% species-level accuracy, the model achieved the level of performance required for the intended application. At that point, further optimization or experimentation aimed solely at increasing classification accuracy was outside the project's requirements and was therefore not pursued.

As a result, this model should be considered a purpose-built practical solution rather than an accuracy-maximized benchmark model. Performance may vary depending on the dataset, image quality, hardware, and application requirements. If higher fine-grained classification accuracy is required, users may consider further training, class balancing, additional data, or a larger model architecture.


Known Dataset Characteristics

The dataset is not class-balanced.

There are substantial differences in the number of images available for different classes. For example, some cat categories contain significantly more evaluation samples than many other classes.

Consequently, overall accuracy should not be interpreted as equally representative of every class.

Per-class evaluation information is available in:

evaluation_results.json

Inference

PyTorch

The repository contains two PyTorch model variants:

best_model.pth
best_model_state_dict.pth

best_model.pth contains the saved best model, while best_model_state_dict.pth contains the model weights/state dictionary.

The exact model architecture should be recreated as MobileNetV3-Large with a 211-class output layer before loading the state dictionary.

Example preprocessing:

from PIL import Image
from torchvision import transforms

transform = transforms.Compose([
    transforms.Resize((224, 224)),
    transforms.ToTensor(),
    transforms.Normalize(
        mean=[0.485, 0.456, 0.406],
        std=[0.229, 0.224, 0.225]
    )
])

image = Image.open("image.jpg").convert("RGB")
tensor = transform(image).unsqueeze(0)

After inference, the predicted class index can be resolved using:

idx_to_class.json

ONNX

Two ONNX versions are provided:

model.onnx
model_simplified.onnx

The repository also contains:

model.onnx.data

which should be kept together with model.onnx if the ONNX model references external data.

The ONNX versions allow the model to be used independently of the PyTorch runtime with compatible ONNX Runtime environments.


Model Files

FileDescription
best_model.pthBest saved PyTorch model
best_model_state_dict.pthPyTorch model state dictionary
Last_checkpoint.pthTraining checkpoint
model.onnxONNX model
model.onnx.dataExternal ONNX model data
model_simplified.onnxSimplified ONNX model
class_to_idx.jsonClass name → numeric index mapping
idx_to_class.jsonNumeric index → class name mapping
model_metadata.jsonModel configuration and metadata
evaluation_results.jsonEvaluation and per-class results
training_curves.pngTraining curves

Intended Use

This model is intended primarily for:

  • Computer vision research
  • Machine learning experimentation
  • Animal classification
  • Fine-grained animal breed recognition
  • Companion-animal applications
  • Animal rescue and care applications
  • Educational projects
  • Prototyping image-classification systems

The model can be used as a component of a larger animal recognition pipeline.


Limitations

This model should not be treated as a definitive biological identification system.

In particular:

  1. Fine-grained classification between visually similar breeds can be difficult.
  2. Performance varies substantially between classes.
  3. The training dataset is highly imbalanced.
  4. Some classes contain relatively few samples.
  5. Images outside the represented classes may be incorrectly assigned to one of the known classes.
  6. The unknown category does not guarantee reliable open-set recognition.
  7. The model should not be used as the sole basis for veterinary, wildlife-management, legal, or animal-control decisions.
  8. The presence of a bird or other non-traditional companion animal in the dataset does not imply that the animal is legally or practically suitable as a pet.

For real-world applications, predictions should preferably be combined with confidence thresholds, human review, and additional validation.


Unknown Class

The model includes an explicit:

unknown

class.

This category was constructed using unrelated images from ImageNet-O and is intended to provide examples outside the primary animal categories.

However, this should not be interpreted as a complete open-set recognition mechanism.

A high-confidence prediction for one of the 211 classes does not necessarily prove that an input image belongs to that class.


License and Third-Party Data

This model repository contains a model trained from a composite dataset assembled from multiple third-party sources.

The underlying source images remain subject to their original licenses, copyrights, and terms.

This repository does not claim ownership of the original third-party images and does not relicense those images.

Users should independently review the licenses and usage conditions of the original datasets before using the model or redistributing materials derived from them.

For additional information, see the accompanying LICENSE file.


Citation

If you use this model in a project, research work, or publication, please cite the project as:

Companion Animal Species & Breed Classifier
Mohammad Meftahi, 2026

Hugging Face:

https://huggingface.co/Pezhvak98/companion-animal-species-breed-classifier

Dataset:

https://huggingface.co/datasets/Pezhvak98/companion-human-care-animal-dataset


Acknowledgements

This project would not have been possible without the publicly available datasets used as source material for constructing the training dataset.

The original datasets and their respective contributors are acknowledged through the dataset documentation and their original licensing terms.


Author

Mohammad Meftahi

2026

This project is part of an ongoing exploration of computer vision, machine learning, and practical animal recognition systems.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · pytorch

Нельзя запустить

Библиотека «pytorch» рантаймом не поддерживается.

Ревизия весов
aa37d5c

0 моделей