/ Модель

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

Параметры
28,3 млн
Лицензия
CC BY-NC-SA 4.0
Архитектура
videomae · dense
Базовая модель
videomae-small-finetuned-kinetics
Библиотека
transformers
Опубликована
19 ноя 2026

khoroos_action_videomae_small

Классификация видеоВидео → label3 профессии

Модель Khoroos на основе VideoMAE классифицирует поведение отдельной курицы в коротких видеоклипах по 15 классам.

34скачиваний за 30 дней0лайковвеса обновлены26 ноя 2026

Бенчмарки

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

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

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

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

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

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

Khoroos Action VideoMAE Small — модель на основе VideoMAE, разработанная для набора инструментов Khoroos. Она классифицирует поведение отдельной курицы в коротком видеоклипе и выдаёт вероятности для 15 классов: от питья, кормления и отдыха до бега, ходьбы и взмахов крыльями. Модель принимает 16 RGB-кадров размером 224×224. Её размер — 28,3 млн параметров; доступны веса SafeTensors и варианты ONNX, включая FP16, INT8 и 4-битный формат.

Модель дообучена на ChickenAct — 15 250 клипах с одной птицей, снятых на пяти фермах. На тестовой выборке, включавшей клипы со всех ферм, указаны accuracy 0,899 и macro-F1 0,864. При проверке на фермах, полностью исключённых из обучения, качество заметно ниже; авторы рекомендуют ориентироваться на эти результаты при переносе на новую ферму. В данных также остались близкие дубликаты клипов, а результаты получены с одним случайным seed.

Модель предназначена для анализа поведения птиц на фермерском видео и интеграции в Khoroos. Предсказания описывают только поведение и не являются оценкой благополучия животных. Лицензия CC BY-NC-SA 4.0 разрешает использование с указанием авторства и на некоммерческих условиях, с распространением производных материалов на тех же условиях.

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

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

Ограничения

На фермах, не встречавшихся при обучении, качество заметно снижается; тестовая выборка содержит близкие дубликаты клипов, а обучение проведено с одним seed. Модель классифицирует поведение и не оценивает благополучие птиц.

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

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

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

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

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

Открыть на Hugging Face

khoroos_action_videomae_small

VideoMAE Small fine-tuned to classify the behavior of an individual chicken in a short video clip. It is one of the action models trained for Khoroos, a toolkit for analyzing chicken behavior in farm video.

  • Base model: MCG-NJU/videomae-small-finetuned-kinetics (revision 1bf2b82), VideoMAE pretrained with masked autoencoding and fine-tuned on Kinetics-400.
  • Fine-tuning data: the ChickenAct dataset, 15,250 single-bird clips covering 15 behaviors on 5 farms.
  • Input: 16 RGB frames at 224×224 pixels.
  • Output: probabilities for the 15 behaviors below.

Results

Unseen farms (leave one farm out)

Each row is a separate model trained with one farm held out entirely and tested on that farm. This is the best estimate of performance on a farm the model has never seen. These checkpoints are not this export; this export is trained on all five farms. Farm IDs are those of the ChickenVerse paper (the released clip file names use different prefixes). F01 and F05 are research pens, F02 a commercial-scale research house, F03 a commercial broiler breeder farm and F04 a commercial broiler house. Macro-F1 averages the behaviors present on the held-out farm (F02 has no feeding clips). Pooled scores all held-out clips together.

Held-out farmMacro-F1AccuracyBalanced accuracy
F010.6790.7560.698
F020.6230.7180.657
F030.5100.6050.590
F040.6300.7040.664
F050.6360.7260.711
Mean ± SD0.616 ± 0.0630.702
Pooled0.6640.703

All-farm test set

This model was trained on about 80% of the clips from all five farms, selected on a 10% validation split (best validation macro-F1 0.867 at epoch 13), and tested on the remaining 10% (1529 clips).

AccuracyMacro-F1Balanced accuracyWeighted F1
0.8990.8640.8620.898
BehaviorPrecisionRecallF1Test clips
body_shaking0.8570.8570.85735
drinking0.9110.8980.904137
dust_bathing0.9440.9440.94454
feeding0.9410.9840.962193
head_scratching0.8540.8200.83750
litter_pecking0.8330.7560.79386
litter_scratching0.8690.8980.88359
pooping0.6820.5560.61227
preening0.9520.9320.942192
resting0.9420.9460.944242
running0.8770.7940.83363
standing0.7530.7270.74088
stretching0.9200.9580.939120
walking0.8810.9270.903151
wing_flapping0.8110.9380.87032

These scores may be slightly optimistic: the dataset contains some near-duplicate clips that were not removed before splitting. Use the unseen-farm scores to judge deployment on a new farm.

Available formats

Every format was evaluated on the same 1,529-clip all-farm test set. Agreement is the share of clips whose predicted behavior matches the FP32 PyTorch model. Times are model-only on an NVIDIA GB10 (DGX Spark; GPU, and its 20-core Arm CPU), excluding video decoding and preprocessing.

FileFormatSize (MB)Macro-F1AccuracyAgreementGPU ms/clip (batch 1)CPU ms/clip (batch 1)
model.safetensorsFP32 weights, FP32 compute (TF32 disabled)880.8650.901100.0%18–
model.safetensorsFP32 weights, BF16 autocast (Khoroos default)880.8650.90199.9%6.7–
model.fp16.safetensorsFP16 weights and compute440.8650.901100.0%6.0–
onnx/model.onnxONNX FP32920.8650.901100.0%61378
onnx/model_fp16.onnxONNX FP16 weights and compute, FP32 inputs/outputs470.8650.901100.0%24798
onnx/model_int8.onnxONNX dynamic INT8 quantization (per-channel weights, MatMul)250.8680.90198.7%161290
onnx/model_q4.onnxONNX 4-bit weight-only quantization (MatMulNBits, block 32, symmetric)200.8540.89096.4%61380

Download only the files you need, for example:

hf download amirivojdan/khoroos_action_videomae_small config.json video_preprocessor_config.json onnx/model_int8.onnx

PyTorch FP16 on a GPU:

model = AutoModelForVideoClassification.from_pretrained(
    repo_id, variant="fp16", dtype=torch.float16
).to("cuda").eval()
inputs = processor([sample(video)], return_tensors="pt").to("cuda", torch.float16)

ONNX Runtime; the graph takes preprocessed pixel_values shaped (batch, 16, 3, 224, 224):

import onnxruntime as ort
from huggingface_hub import hf_hub_download

session = ort.InferenceSession(hf_hub_download(repo_id, "onnx/model_int8.onnx"))
pixel_values = processor([sample(video)], return_tensors="pt")["pixel_values"].numpy()
logits = session.run(None, {"pixel_values": pixel_values})[0]

Which file to use: on a GPU, model.fp16.safetensors with PyTorch is the fastest and matches FP32 accuracy; with ONNX Runtime, use onnx/model_fp16.onnx. On a CPU, use onnx/model_int8.onnx, or onnx/model_q4.onnx for the smallest download. The INT8 and 4-bit files are slow on GPUs, and the FP16 ONNX file is slow on CPUs.

Classes in output order

  1. body_shaking
  2. drinking
  3. dust_bathing
  4. feeding
  5. head_scratching
  6. litter_pecking
  7. litter_scratching
  8. pooping
  9. preening
  10. resting
  11. running
  12. standing
  13. stretching
  14. walking
  15. wing_flapping

Preprocessing

Inference must match training:

  1. Sample 16 frame indices uniformly across the clip, rounding numpy.linspace(0, n - 1, 16). If the clip has fewer than 16 frames, use every frame and repeat the last one.
  2. Resize the shorter side to 256 pixels, center-crop 224×224, scale to [0, 1] and normalize with ImageNet mean and standard deviation. The saved video processor does this step.

Usage

import numpy as np
import torch
from transformers import AutoModelForVideoClassification, AutoVideoProcessor

repo_id = "amirivojdan/khoroos_action_videomae_small"
processor = AutoVideoProcessor.from_pretrained(repo_id)
model = AutoModelForVideoClassification.from_pretrained(repo_id).eval()

def sample(video, num_frames=model.config.frames_per_clip):
    # video: uint8 tensor of shape (T, C, H, W)
    t = video.shape[0]
    if t >= num_frames:
        idx = np.round(np.linspace(0, t - 1, num_frames)).astype(int)
    else:
        idx = np.concatenate([np.arange(t), np.full(num_frames - t, t - 1)])
    return video[torch.as_tensor(idx)]

inputs = processor([sample(video)], return_tensors="pt")
with torch.inference_mode():
    probs = model(**inputs).logits.softmax(-1)[0]
print(model.config.id2label[int(probs.argmax())])

In Khoroos, select this model with --action-model videomae-small or KHOROOS_ACTION_MODEL=videomae-small; --action-format chooses the weight format. Khoroos downloads only that format and handles frame sampling and preprocessing.

Training

Full fine-tuning in BF16 on one NVIDIA GB10: AdamW, backbone learning rate 3e-05 (classifier ×10), weight decay 0.05, effective batch size 32, 15 epochs with 3 warmup epochs and cosine decay, gradient clipping at 1, seed 42. Augmentation: temporal jitter around the inference frame positions, random scale (about ±12.5%), random crop, horizontal flip and color jitter, applied identically across frames. No class weighting. The checkpoint with the best validation macro-F1 was kept. Data: 12,192 training, 1,529 validation and 1,529 test clips, stratified by farm and behavior. Activation checkpointing at 2 clips per step (16 accumulation steps); peak GPU memory 0.5 GiB. This fit took 2.0 h; the six fits of this size (all farms and five leave-one-farm-out) averaged 1.8 h.

Limitations

  • Trained on single-bird clips from five farms. Accuracy drops on farms not seen in training, by about 25 macro-F1 points on average in the leave-one-farm-out results.
  • Results come from one training seed.
  • Predictions describe behavior only. They are not welfare assessments.

License

Released under CC BY-NC-SA 4.0. The base VideoMAE checkpoint is CC BY-NC 4.0 and the ChickenVerse training data is CC BY-NC-SA 4.0. Non-commercial use only; adaptations must be shared under the same license.

Citation

@inproceedings{tong2022videomae,
  title     = {VideoMAE: Masked Autoencoders are Data-Efficient Learners for
               Self-Supervised Video Pre-Training},
  author    = {Tong, Zhan and Song, Yibing and Wang, Jue and Wang, Limin},
  booktitle = {Advances in Neural Information Processing Systems},
  year      = {2022}
}

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
VideoMAEForVideoClassification
Ревизия весов
8b03061

0 моделей