/ Модель

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

Лицензия
CC BY-SA 4.0
Опубликована
6 авг 2026

cropguard-models

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

Классификатор ResNet50 определяет болезни и здоровое состояние листьев 14 культур по одному снимку на однородном фоне.

0скачиваний за 30 дней0лайковвеса обновлены6 авг 2026

Бенчмарки

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

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

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

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

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

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

CropGuard — это классификатор болезней сельскохозяйственных культур, разработанный как часть MLOps-проекта CropGuard. Модель ResNet50 дообучена на датасете PlantVillage и опубликована в формате ONNX; в репозитории есть версии fp32 и статически квантованная INT8. Модель принимает изображение одного листа размером 224×224 и выбирает один из 38 классов для 14 культур. Она предназначена для снимков листьев на однородном фоне, сделанных в условиях, похожих на протокол съёмки PlantVillage.

На тестовой выборке из 8 125 изображений с разбиением по листьям версия fp32 показала accuracy 0,9911 и macro-F1 0,9865. В описании сообщается, что статическая INT8-квантизация почти не изменила качество на отдельной подвыборке, но скорость зависит от процессора и его поддержки VNNI. Модель выдаёт логиты; для калиброванных вероятностей требуется применить температурное масштабирование с T=0,591. Лицензия — CC BY-SA 4.0.

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

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

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

Ограничения

Модель обучена на отдельных листьях на однородном фоне и не оценивалась на полевых снимках; вне 38 классов она всё равно выдаёт один из известных классов. ONNX-граф выдаёт логиты, поэтому для откалиброванных вероятностей нужно применить температурное масштабирование с T=0,591.

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

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

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

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

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

Открыть на Hugging Face

CropGuard - Crop Disease Classifier (38 classes)

ResNet50 fine-tuned on PlantVillage, exported to ONNX and dynamically quantised to INT8 for CPU-only serving. Part of CropGuard, an end-to-end MLOps pipeline.

Results (held-out test set, n=8,125)

ModelAccuracyMacro-F1Note
fp320.99110.9865reference
INT8 (dynamic)not evaluatednot evaluatednot served - see below

Macro-F1 is the metric to read here, not accuracy: the dataset is imbalanced ~36x, so accuracy is dominated by the largest classes.

cropguard.onnx (fp32) is the model that serves traffic. cropguard.static-int8.onnx is published alongside it for comparison; the dynamic INT8 build is deliberately not published.

Dynamic quantization was the wrong tool here. quantize_dynamic rewrites every Conv into ConvInteger, which ONNX Runtime's CPU backend has no optimized kernel for: measured on an Intel Alder Lake CPU it ran at 1567 ms/image against 19 ms for fp32, a 75x regression in exchange for 4x less disk. It suits MatMul-dominated models (Transformers, RNNs), not CNNs.

Static quantization with a calibration set emits the optimized QLinearConv instead, and is 78 ms/image - 20x faster than dynamic and accuracy-neutral (0.9897 vs 0.9893 on a 3,000 image subset, 9 disagreements). It is still 3.2x slower than fp32 on the machine it was measured on, and the reason is hardware rather than the graph: that CPU has no VNNI instructions, without which ONNX Runtime emulates each INT8 multiply-accumulate in several AVX2 instructions. Server CPUs usually do have VNNI, where the ranking may reverse - which is exactly why both files are here to be benchmarked on whatever hardware you are running.

The split is grouped by leaf, and that matters

PlantVillage contains 54,305 images of only ~7,600 distinct physical leaves - roughly 7 photographs of each. A standard per-image stratified split scatters those near-duplicates across train and test, so a model can score well by memorising leaf identity rather than learning disease morphology. Measured on this dataset, a naive split leaves 74.2% of test images sharing a leaf with training.

This model was trained on a leaf-grouped split instead:

Naive stratifiedGrouped (used here)
test images sharing a leaf with train74.2%0.0%
train / val / test-38,008 / 8,172 / 8,125

So the accuracy above is measured on a holdout with no leaf overlap. Note that it is not much lower than typically published PlantVillage figures - the honest reading is that this dataset is genuinely easy, not that leakage was inflating everything.

Intended use

Identifying disease on single leaves photographed against a plain background, matching the PlantVillage capture protocol.

Limitations - read before deploying this

  • Lab images, not field images. Every training image is a detached leaf on a uniform background under controlled lighting. Real photographs from a farm - variable lighting, occlusion, multiple leaves, soil backgrounds - are a different distribution, and published work on this dataset reports large drops there. This model has not been evaluated on field photographs.
  • Per-class metrics for rare classes are noisy. Eight classes have fewer than 100 test images; the smallest (Potato___healthy) has 24. A recall of 0.833 there is 4 mistakes, and its confidence interval spans roughly +/-15 points. Do not read those per-class numbers as precise.
  • The raw softmax is not calibrated. Training used label smoothing (0.1), which caps achievable confidence at (1-eps) + eps/K = 0.9026 and leaves the model systematically under-confident. Temperature scaling fitted on the validation split (T = 0.591) cuts expected calibration error from 0.0895 to 0.0036 and is applied in the serving path, but the ONNX graph published here emits logits - apply the temperature yourself, or the probabilities you compute from it will understate.
  • uncertainty is predictive entropy, not epistemic uncertainty. It cannot distinguish an ambiguous input from one far outside the training distribution - an out-of-distribution image can produce confidently wrong output with low entropy.
  • 38 classes across 14 crops only. Anything outside that set is silently forced into one of them.

Training

ResNet50 (timm, ImageNet-pretrained), 224x224, batch 64, AdamW (lr 3e-4, weight decay 1e-4), cosine schedule, label smoothing 0.1, medium augmentation, 12 epochs, mixed precision. Checkpoint selected on val_f1_macro.

Usage

import numpy as np, onnxruntime as ort
from huggingface_hub import hf_hub_download

path = hf_hub_download("Abhi542Dev/cropguard-models", "cropguard.onnx")
session = ort.InferenceSession(path, providers=["CPUExecutionProvider"])

# Preprocessing must match training: resize short side to 256, centre-crop 224,
# scale to [0,1], normalise with ImageNet mean/std, NCHW.
logits = session.run(["logits"], {"input": batch})[0]

cropguard.serving.model_loader in the repo implements exactly that preprocessing.

Citation

Dataset: Mohanty, Hughes & Salathe (2016), Using deep learning for image-based plant disease detection, Frontiers in Plant Science.

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

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

GPU в ailist

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

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

В репозитории нет весов в формате PyTorch/safetensors.

Ревизия весов
43b35ac

0 моделей