ashish-soni08 commited on
Commit
61c3a4b
Β·
verified Β·
1 Parent(s): 330bca7

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +113 -23
README.md CHANGED
@@ -4,41 +4,131 @@ emoji: πŸŒ±πŸ“ΈπŸ©Ί
4
  colorFrom: green
5
  colorTo: green
6
  sdk: gradio
7
- sdk_version: 4.41.0
8
  app_file: app.py
9
  pinned: false
10
- license: afl-3.0
11
  ---
12
 
13
- # Bean Plant Health Predictor
14
 
15
- 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.
16
 
17
- ## Use Case
18
 
19
- 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.
20
 
21
- ## Features
22
 
23
- - **Image Classification**: Upload an image of a bean leaf, and the app will classify it into one of the following categories:
24
- - Angular Leaf Spot
25
- - Bean Rust
26
- - Healthy
27
 
28
- ## Model Details
 
 
 
29
 
30
- - **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).
31
- - **Image Processor**: The app uses the `ViTImageProcessor` for preparing images before classification.
32
- - **Labels**: The possible outcomes are `angular_leaf_spot`, `bean_rust`, and `healthy`.
33
 
34
- ## How to Use
 
 
 
35
 
36
- 1. **Upload an Image**: Click on the image input field and upload a photo of a bean leaf.
37
- 2. **Get Results**: The app will classify the image and display the probabilities for each category.
38
- 3. **Interpret the Results**: The app shows the confidence levels for each label, helping farmers identify whether the plant is healthy or requires treatment.
39
 
40
- ## Technology Stack
41
 
42
- - **Gradio**: Used to create the user interface.
43
- - **PyTorch**: Utilized for running the model inference.
44
- - **Hugging Face Transformers**: Provides the pre-trained Vision Transformer model.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  colorFrom: green
5
  colorTo: green
6
  sdk: gradio
7
+ sdk_version: 5.31.0
8
  app_file: app.py
9
  pinned: false
10
+ license: apache-2.0
11
  ---
12
 
13
+ # Bean Plant Health ViT Classifier πŸŒ±πŸ“ΈπŸ©Ί
14
 
15
+ A web-based agricultural AI tool that helps farmers identify bean plant diseases using computer vision. Built with Vision Transformer (ViT) model and Gradio for real-time crop health monitoring and disease detection.
16
 
17
+ ![Demo Screenshot](bean-plant-health-logo.png)
18
 
19
+ ## πŸš€ Live Demo
20
 
21
+ Try the app: [Bean-Plant-Health-Classifier](https://huggingface.co/spaces/ashish-soni08/Bean-plant-health-ViT-classifier)
22
 
23
+ ## ✨ Features
 
 
 
24
 
25
+ - **Disease Detection**: Automatically identify angular leaf spot, bean rust, and healthy plants
26
+ - **Real-time Analysis**: Get instant classification results with confidence scores
27
+ - **Drone-Ready**: Designed for integration with drone technology for field monitoring
28
+ - **Clean Interface**: Intuitive web UI built with Gradio for farmers and agricultural professionals
29
 
30
+ ## πŸ› οΈ Technology Stack
 
 
31
 
32
+ - **Backend**: Python, Hugging Face Transformers
33
+ - **Frontend**: Gradio
34
+ - **Model**: [Vision Transformer (ViT-base)](https://huggingface.co/google/vit-base-patch16-224) fine-tuned on [Beans dataset](https://huggingface.co/datasets/beans)
35
+ - **Deployment**: Hugging Face Spaces
36
 
37
+ ## πŸƒβ€β™‚οΈ Quick Start
 
 
38
 
39
+ ### Prerequisites
40
 
41
+ ```bash
42
+ Python 3.8+
43
+ pip
44
+ ```
45
+
46
+ ### Installation
47
+
48
+ 1. Clone the repository:
49
+ ```bash
50
+ git clone https://github.com/Ashish-Soni08/bean-plant-health-classifier.git
51
+ cd bean-plant-health-vit-classifier
52
+ ```
53
+
54
+ 2. Install dependencies:
55
+ ```bash
56
+ pip install -r requirements.txt
57
+ ```
58
+
59
+ 3. Run the application:
60
+ ```bash
61
+ python app.py
62
+ ```
63
+
64
+ 4. Open your browser and navigate to `http://localhost:7860`
65
+
66
+ ## πŸ“‹ Usage
67
+
68
+ 1. **Upload Image**: Click the image input field and upload a photo of a bean leaf
69
+ 2. **Get Classification**: The app automatically analyzes the image and provides predictions
70
+ 3. **View Results**: Check confidence scores for each disease category to make informed decisions
71
+
72
+ ### Disease Categories
73
+
74
+ - **Angular Leaf Spot**: Fungal disease causing angular brown spots on leaves
75
+ - **Bean Rust**: Fungal disease creating rust-colored pustules on leaf surface
76
+ - **Healthy**: No visible signs of disease or infection
77
+
78
+ ### Example
79
+
80
+ **Input Image:**
81
+ ```
82
+ [Photo of bean leaf with brown spots]
83
+ ```
84
+
85
+ **Output:**
86
+ ```
87
+ Angular Leaf Spot: 87.5%
88
+ Bean Rust: 8.2%
89
+ Healthy: 4.3%
90
+ ```
91
+
92
+ ## 🧠 Model Information
93
+
94
+ This app uses **Vision Transformer (ViT-base)** fine-tuned for agricultural disease detection:
95
+
96
+ - **Architecture**: Vision Transformer with 16x16 patches, 224x224 input resolution
97
+ - **Parameters**: ~86.6 million parameters
98
+ - **Training Data**: Beans dataset with 1,034 field images of bean leaves
99
+ - **Classes**: 3 categories (Angular Leaf Spot, Bean Rust, Healthy)
100
+ - **Base Model**: Pre-trained on ImageNet-21k, fine-tuned on beans disease dataset
101
+
102
+ ## πŸ“ Project Structure
103
+
104
+ ```
105
+ bean-plant-health-vit-classifier/
106
+ β”œβ”€β”€ app.py # Main Gradio application
107
+ β”œβ”€β”€ requirements.txt # Python dependencies
108
+ β”œβ”€β”€ README.md # Project documentation
109
+ └── images/ # Sample bean leaf images for testing
110
+ ```
111
+
112
+ ## 🌾 Agricultural Impact
113
+
114
+ This tool helps farmers:
115
+ - **Early Disease Detection**: Identify problems before they spread
116
+ - **Reduce Crop Loss**: Take timely action to treat diseased plants
117
+ - **Optimize Treatment**: Focus resources on affected areas only
118
+ - **Scale Monitoring**: Use with drones for large-field surveillance
119
+
120
+ ## πŸ“„ License
121
+
122
+ This project is licensed under the Apache License 2.0
123
+
124
+ ## πŸ™ Acknowledgments
125
+
126
+ - [Hugging Face](https://huggingface.co/) for the Transformers library and model hosting
127
+ - [Gradio](https://gradio.app/) for the web interface framework
128
+ - [Google Research](https://github.com/google-research/vision_transformer) for the Vision Transformer architecture
129
+
130
+ ## πŸ“ž Contact
131
+
132
+ Ashish Soni - [email protected]
133
+
134
+ Project Link: [github](https://github.com/Ashish-Soni08/bean-plant-health-classifier)