File size: 2,056 Bytes
0bd37ca
 
ecebc42
0bd37ca
 
 
ecebc42
0bd37ca
 
 
 
 
ecebc42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
---
title: Bean Plant Health ViT Classifier
emoji: 🌱📸🩺
colorFrom: green
colorTo: green
sdk: gradio
sdk_version: 4.41.0
app_file: app.py
pinned: false
license: afl-3.0
---

# Bean Plant Health Predictor

This application is designed to help farmers quickly identify the health of bean plants by analyzing images of their leaves. The app uses a Vision Transformer (ViT) model to classify images into three categories: **angular_leaf_spot**, **bean_rust**, and **healthy**. This tool can be deployed on a drone for real-time monitoring of crops, enabling timely treatment of diseased plants.

## Use Case

Farmers need to monitor the health of their bean plants regularly to prevent the spread of diseases. This app provides a machine learning-based solution to automate the identification of plant diseases, which can be particularly useful when integrated with drone technology.

## Features

- **Image Classification**: Upload an image of a bean leaf, and the app will classify it into one of the following categories:
  - Angular Leaf Spot
  - Bean Rust
  - Healthy

## Model Details

- **Model Used**: [Vision Transformer (ViT) - base-sized model](https://huggingface.co/google/vit-base-patch16-224) fine-tuned on the [Beans dataset](https://huggingface.co/datasets/beans).
- **Image Processor**: The app uses the `ViTImageProcessor` for preparing images before classification.
- **Labels**: The possible outcomes are `angular_leaf_spot`, `bean_rust`, and `healthy`.

## How to Use

1. **Upload an Image**: Click on the image input field and upload a photo of a bean leaf.
2. **Get Results**: The app will classify the image and display the probabilities for each category.
3. **Interpret the Results**: The app shows the confidence levels for each label, helping farmers identify whether the plant is healthy or requires treatment.

## Technology Stack

- **Gradio**: Used to create the user interface.
- **PyTorch**: Utilized for running the model inference.
- **Hugging Face Transformers**: Provides the pre-trained Vision Transformer model.