/ Модель

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

Лицензия
Apache 2.0
Архитектура
efficientnet · dense
Базовая модель
efficientnet-b2
Опубликована
24 сен 2023

Birds-Classifier-EfficientNetB2

Классификация изображенийИзображение → label3 профессии

Дообученный EfficientNet-B2 классифицирует изображения по 525 видам птиц.

378скачиваний за 30 дней24лайкавеса обновлены27 мая 2024

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

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

Модель dennisjooo/Birds-Classifier-EfficientNetB2 разработана автором репозитория как дообученная версия EfficientNet-B2 от Google. Она классифицирует изображения птиц по 525 видам и предназначена для распознавания видов на фотографиях. Обучение проводилось на наборе gpiosenka/100-bird-species с изображениями RGB размером 224 × 224; в README указаны точность 98,6% на валидационной выборке и 99,1% на тестовой.

Модель принимает изображения и выдаёт метки классов с оценками классификации. Она основана на свёрточной архитектуре EfficientNet и доступна в форматах PyTorch, Safetensors и ONNX. Лицензия — Apache-2.0. Результаты относятся к указанному набору данных; качество на других видах птиц, ракурсах и условиях съёмки может отличаться.

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

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

Ограничения

Модель настроена на 525 видов из использованного набора данных, поэтому может ошибаться на других видах и при изображениях, отличающихся от обучающих условий. Заявленные метрики получены на выборках этого набора и не гарантируют такое же качество в реальном использовании.

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

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

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

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

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

Открыть на Hugging Face

Bird Classifier EfficientNet-B2

Model Description

Have you look at a bird and said "Boahh if only I know what bird that is". Unless you're an avid bird spotter (or just love birds in general), it's hard to differentiate some species of birds. Well you're in luck, turns out you can use a image classifier to identify bird species!

This model is a fine-tuned version of google/efficientnet-b2 on the gpiosenka/100-bird-species dataset available on Kaggle. The dataset used to train the model was taken on September 24th, 2023.

The original model itself was trained on ImageNet-1K, thus it might still have some useful features for identifying creatures like birds.

In theory, the accuracy for a random guess on this dataset is 0.0019047619 (essentially 1/525). The model performed significantly well on all three sets with result being:

  • Training: 0.999480
  • Validation: 0.985904
  • Test: 0.991238

Intended Uses

You can use the raw model for image classification. Here is an example of the model in action using a picture of a bird

# Importing the libraries needed
import torch
import urllib.request
from PIL import Image
from transformers import EfficientNetImageProcessor, EfficientNetForImageClassification

# Determining the file URL
url = 'some url'

# Opening the image using PIL
img = Image.open(urllib.request.urlretrieve(url)[0])

# Loading the model and preprocessor from HuggingFace
preprocessor = EfficientNetImageProcessor.from_pretrained("dennisjooo/Birds-Classifier-EfficientNetB2")
model = EfficientNetForImageClassification.from_pretrained("dennisjooo/Birds-Classifier-EfficientNetB2")

# Preprocessing the input
inputs = preprocessor(img, return_tensors="pt")

# Running the inference
with torch.no_grad():
    logits = model(**inputs).logits

# Getting the predicted label
predicted_label = logits.argmax(-1).item()
print(model.config.id2label[predicted_label])

Or alternatively you can streamline it using Huggingface's Pipeline

# Importing the libraries needed
import torch
import urllib.request
from PIL import Image
from transformers import pipeline

# Determining the file URL
url = 'some url'

# Opening the image using PIL
img = Image.open(urllib.request.urlretrieve(url)[0])

# Loading the model and preprocessor using Pipeline
pipe = pipeline("image-classification", model="dennisjooo/Birds-Classifier-EfficientNetB2")

# Running the inference
result = pipe(img)[0]

# Printing the result label
print(result['label'])

Training and Evaluation

Data

The dataset was taken from gpiosenka/100-bird-species on Kaggle. It contains a set of 525 bird species, with 84,635 training images, 2,625 each for validation and test images. Every image in the dataset is a 224 by 224 RGB image.

The training process used the same split provided by the author. For more details, please refer to the author's Kaggle page.

Training Procedure

The training was done using PyTorch on Kaggle's free P100 GPU. The process also includes the usage of Lightning and Torchmetrics libraries.

Preprocessing

Each image is preprocessed according to the the orginal author's config.

The training set was also augmented using:

  • Random rotation of 10 degrees with probability of 50%
  • Random horizontal flipping with probability of 50%

Training Hyperparameters

The following are the hyperparameters used for training:

  • Training regime: fp32
  • Loss: Cross entropy
  • Optimizer: Adam with default betas (0.99, 0.999)
  • Learning rate: 1e-3
  • Learning rate scheduler: Reduce on plateau which monitors validation loss with patience of 2 and decay rate of 0.1
  • Batch size: 64
  • Early stopping: Monitors validation accuracy with patience of 10

Results

The image below is the result of the training process both on the training and validation set:

Training results

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

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

GPU в ailist

Универсальный рантайм · image-classification

Можно запустить

Подбираем GPU…

Класс архитектуры
EfficientNetForImageClassification
Ревизия весов
4748f6d

0 моделей