/ Модель

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

Параметры
7,1 млн
Лицензия
MIT
Архитектура
vit · dense
Базовая модель
vit-tiny-patch16-224
Библиотека
transformers
Опубликована
9 окт 2024

crop_leaf_diseases_vit

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

Компактная ViT-Tiny классифицирует изображения листьев кукурузы, картофеля, риса и пшеницы, выявляя болезни и здоровые растения.

497скачиваний за 30 дней12лайковвеса обновлены15 окт 2025

Бенчмарки

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

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

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

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

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

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

Модель Wambugu Kinyua — дообученная версия Vision Transformer ViT-Tiny для классификации изображений листьев сельскохозяйственных культур по состоянию и типу болезни. Она принимает RGB-изображения и выдаёт метку класса, включая здоровые растения и заболевания кукурузы, картофеля, риса и пшеницы: ржавчину, пятнистость, ожог листьев и другие категории. Компактная архитектура содержит 7,1 млн параметров и предназначена для раннего выявления болезней в точном земледелии; её можно встроить в системы мониторинга посевов или дообучить на данных конкретного региона и культуры.

В карточке заявлены метрики проверки на отложенной части датасета: accuracy 98%, precision 97%, recall 97% и F1 96%. Результаты могут быть хуже на культурах, болезнях и условиях съёмки, отсутствующих в обучающих данных; ошибки классификации способны привести к пропуску заболевания или ненужным мерам. Для данной версии метаданные указывают формат safetensors, а README также упоминает веса ONNX. Лицензия в метаданных Hugging Face — MIT.

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

Model Card for Smart Farming Disease Detection Transformer

This model is a Vision Transformer (ViT) designed to identify plant diseases in crops as part of a smart agricultural farming system. It has been trained on a diverse dataset of plant images, including different disease categories affecting crops such as corn, potato, rice, and wheat. The model aims to provide farmers and agronomists with real-time disease detection for better crop management.

Model Details

Model Description

This Vision Transformer model has been fine-tuned to classify various plant diseases commonly found in agricultural settings. The model can classify diseases in crops such as corn, potato, rice, and wheat, identifying diseases like rust, blight, leaf spots, and others. The goal is to enable precision farming by helping farmers detect diseases early and take appropriate actions.

  • Developed by: Wambugu Kinyua
  • Model type: Vision Transformer (ViT)
  • Languages (NLP): N/A (Computer Vision Model)
  • License: Apache 2.0
  • Finetuned from model: WinKawaks/vit-tiny-patch16-224
  • Input: Images of crops (RGB format)
  • Output: Disease classification labels (healthy or diseased categories)
  • ONNX weights Onnx f32 weights

Diseases from the model

CropDiseases Identified
CornCommon Rust
CornGray Leaf Spot
CornHealthy
CornLeaf Blight
-Invalid
PotatoEarly Blight
PotatoHealthy
PotatoLate Blight
RiceBrown Spot
RiceHealthy
RiceLeaf Blast
WheatBrown Rust
WheatHealthy
WheatYellow Rust

Uses

Direct Use

This model can be used directly to classify images of crops to detect plant diseases. It is especially useful for precision farming, enabling users to monitor crop health and take early interventions based on the detected disease.

Downstream Use

This model can be fine-tuned on other agricultural datasets for specific crops or regions to improve its performance or be integrated into larger precision farming systems that include other features like weather predictions and irrigation control.

Can be quantitized or deployed in full precision on edge devices due to its small parameter size without compromising on precision and accuracy.

Out-of-Scope Use

This model is not designed for non-agricultural image classification tasks or for environments with insufficient or very noisy data. Misuse includes using the model in areas with vastly different agricultural conditions from those it was trained on.

Bias, Risks, and Limitations

  • The model may exhibit bias toward the crops and diseases present in the training dataset, leading to lower performance on unrepresented diseases or crop varieties.
  • False negatives (failing to detect a disease) may result in untreated crop damage, while false positives could lead to unnecessary interventions.

Recommendations

Users should evaluate the model on their specific crops and farming conditions. Regular updates and retraining with local data are recommended for optimal performance.

How to Get Started with the Model

from PIL import Image, UnidentifiedImageError
from transformers import ViTFeatureExtractor, ViTForImageClassification
feature_extractor = ViTFeatureExtractor.from_pretrained('wambugu71/crop_leaf_diseases_vit')
model = ViTForImageClassification.from_pretrained(
    'wambugu1738/crop_leaf_diseases_vit',
    ignore_mismatched_sizes=True
)
image = Image.open('<image_path>')
inputs = feature_extractor(images=image, return_tensors="pt")
outputs = model(**inputs)
logits = outputs.logits
predicted_class_idx = logits.argmax(-1).item()
print("Predicted class:", model.config.id2label[predicted_class_idx])

Training Details

Training Data

The model was trained on a dataset containing images of various crops with labeled diseases, including the following categories:

  • Corn: Common Rust, Gray Leaf Spot, Leaf Blight, Healthy
  • Potato: Early Blight, Late Blight, Healthy
  • Rice: Brown Spot, Hispa, Leaf Blast, Healthy
  • Wheat: Brown Rust, Yellow Rust, Healthy

The dataset also includes images captured under various lighting conditions, from both controlled and uncontrolled environments and angles, to simulate real-world farming scenarios. We made use of public available datasets, and our own private data.

Training Procedure

The model was fine-tuned using a vision transformer architecture pre-trained on the ImageNet dataset. The dataset was preprocessed by resizing the images and normalizing the pixel values.

Training Hyperparameters

  • Batch size: 32
  • Learning rate: 2e-5
  • Epochs: 4
  • Optimizer: AdamW
  • Precision: fp16

Evaluation

Confusion matrix

Testing Data, Factors & Metrics

The model was evaluated using a validation set consisting of 20% of the original dataset, with the following metrics:

  • Accuracy: 98%
  • Precision: 97%
  • Recall: 97%
  • F1 Score: 96%

Environmental Impact

Carbon emissions during model training can be estimated using the Machine Learning Impact calculator.

  • Hardware Type: NVIDIA L40S
  • Hours used: 1 hours
  • Cloud Provider: Lightning AI

Technical Specifications

Model Architecture and Objective

The model uses a Vision Transformer architecture to learn image representations and classify them into disease categories. Its self-attention mechanism enables it to capture global contextual information in the images, making it suitable for agricultural disease detection.

Compute Infrastructure

Hardware

  • NVIDIA L40S GPUs
  • 48 GB RAM
  • SSD storage for fast I/O

Software

  • Python 3.9
  • PyTorch 2.4.1+cu121
  • pytorch_lightning
  • Transformers library by Hugging Face

Citation

If you use this model in your research or applications, please cite it as:

BibTeX:

@misc{kinyua2024smartfarming,
  title={Smart Farming Disease Detection Transformer},
  author={Wambugu Kinyua},
  year={2024},
  publisher={Hugging Face},
}

APA:

Kinyua, W. (2024). Smart Farming Disease Detection Transformer. Hugging Face.

Model Card Contact

For further inquiries, contact: wambugukinyua@proton.me

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
ViTForImageClassification
Ревизия весов
7d5b32b

0 моделей