animals10-efficientnetv2s
animal image classification
2 min readupdated
The model classifies photographs by identifying one of 10 animals: a butterfly, cat, chicken, cow, dog, elephant, horse, sheep, spider, or squirrel. It is based on the EfficientNetV2-S architecture (a highly efficient convolutional AI model) pre-trained on the ImageNet dataset. Transfer learning (an approach where a pre-trained model is used for a new task) achieved high accuracy with minimal resource consumption. The model is useful for developers and researchers looking to quickly integrate animal recognition into apps or photo galleries.
Key features
- Trained on the Animals-10 dataset consisting of 26,177 high-quality photos.
- Achieves a high accuracy of 0.983 on an independent test set.
- Uses the Keras library with a PyTorch backend for stable operation.
- Training took just 16.5 minutes on an NVIDIA RTX 5060 Laptop GPU.
What you can do
- Automatically sort domestic and wild animal photos into categories within galleries.
- Build a Telegram bot that recognizes animals in photos sent by users.
- Use as a ready-to-use component for computer vision educational projects.
Example
import os
os.environ["KERAS_BACKEND"] = "torch"
import json, keras, numpy as np
from huggingface_hub import snapshot_download
from PIL import Image
path = snapshot_download("jramduran/animals10-efficientnetv2s")
model = keras.saving.load_model(f"{path}/model.keras")
img = Image.open("cat.jpg").convert("RGB").resize((224, 224))
print(model.predict(np.asarray(img, dtype="float32")[None], verbose=0)[0].argmax())
Read more
DetailsAccuracy: 0.983
F1 macro: 0.980
Training: 8 epochs on an NVIDIA RTX 5060 Laptop GPU
Dataset size: 26,177 images








Comments