sudhir75 commited on
Commit
e004bd0
·
verified ·
1 Parent(s): 5c0f284

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +197 -0
README.md ADDED
@@ -0,0 +1,197 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ license: mit
4
+ library_name: keras
5
+ tags:
6
+ - image-classification
7
+ - plant-disease-detection
8
+ - agriculture
9
+ - computer-vision
10
+ - cnn
11
+ - deep-learning
12
+ datasets:
13
+ - vipoooool/new-plant-diseases-dataset
14
+ metrics:
15
+ - accuracy
16
+ - precision
17
+ - recall
18
+ - f1-score
19
+ base_model:
20
+ - tensorflow
21
+ ---
22
+
23
+ # Harimitra - Plant Disease Detection Model
24
+
25
+ ## Model Description
26
+
27
+ Harimitra is a deep learning model for automated plant disease detection and classification. Built using Convolutional Neural Networks (CNN), this model can identify 38 different plant disease classes from leaf images, helping farmers and agricultural professionals diagnose plant health issues quickly and accurately.
28
+
29
+ ## Model Details
30
+
31
+ - **Model Type**: Image Classification (CNN)
32
+ - **Framework**: Keras/TensorFlow
33
+ - **Model Size**: 31.4 MB (.keras format) / 94.2 MB (.h5 format)
34
+ - **Input**: RGB plant leaf images (256×256 pixels)
35
+ - **Output**: Classification across 38 disease classes
36
+ - **Classes**: 38 (various plant species and their diseases/healthy states)
37
+
38
+ ## Dataset
39
+
40
+ This model was trained on the **New Plant Diseases Dataset** from Kaggle:
41
+ - **Source**: [vipoooool/new-plant-diseases-dataset](https://www.kaggle.com/datasets/vipoooool/new-plant-diseases-dataset)
42
+ - **Total Images**: 87,900 leaf images
43
+ - **Resolution**: 256×256 pixels
44
+ - **Classes**: 38 unique classes (combinations of plant species and disease status)
45
+ - **Split**:
46
+ - Training: 70,295 images
47
+ - Validation: 17,572 images
48
+ - Test: 33 images
49
+
50
+ Each class represents a specific combination of plant type and disease condition (or healthy state). The dataset covers multiple plant species including tomato, potato, corn, grape, apple, and others, with various diseases such as bacterial spot, early blight, late blight, leaf mold, and healthy leaf conditions.
51
+
52
+ ## Intended Use
53
+
54
+ This model is designed to:
55
+ - Identify plant diseases from leaf images across 38 different classes
56
+ - Assist farmers in early disease detection and diagnosis
57
+ - Support agricultural decision-making and crop management
58
+ - Enable automated plant health monitoring systems
59
+ - Facilitate precision agriculture applications
60
+
61
+ ## How to Use
62
+
63
+ ### Installation
64
+ ```bash
65
+ pip install -r requirement.txt
66
+ ```
67
+
68
+ ### Quick Start
69
+ ```python
70
+ from tensorflow import keras
71
+ import numpy as np
72
+ from PIL import Image
73
+
74
+ # Load the model
75
+ model = keras.models.load_model('trained_model.keras')
76
+
77
+ # Load and preprocess image
78
+ img = Image.open('plant_leaf.jpg')
79
+ img = img.resize((256, 256)) # Dataset standard size
80
+ img_array = np.array(img) / 255.0 # Normalize to [0, 1]
81
+ img_array = np.expand_dims(img_array, axis=0)
82
+
83
+ # Make prediction
84
+ predictions = model.predict(img_array)
85
+ predicted_class = np.argmax(predictions, axis=1)
86
+
87
+ print(f"Predicted class: {predicted_class[0]}")
88
+ print(f"Confidence: {np.max(predictions)*100:.2f}%")
89
+ ```
90
+
91
+ ### Using the Main Script
92
+ ```bash
93
+ python main.py --image path/to/plant_leaf.jpg
94
+ ```
95
+
96
+ ## Training
97
+
98
+ The model was trained using the notebooks provided in this repository:
99
+ - **Training Pipeline**: `Train_plant_disease.ipynb` - Complete training workflow
100
+ - **Testing & Evaluation**: `Test_Plant_Disease.ipynb` - Model evaluation and testing
101
+ - **Training Metrics**: Available in `training_hist.json`
102
+
103
+ ### Training Configuration
104
+ - Input image size: 256×256×3
105
+ - Dataset split: ~80% train, ~20% validation
106
+ - Framework: TensorFlow/Keras
107
+
108
+ ## Files in this Repository
109
+
110
+ | File | Size | Description |
111
+ |------|------|-------------|
112
+ | `trained_model.keras` | 31.4 MB | Model in Keras format (recommended) |
113
+ | `trained_model.h5` | 94.2 MB | Model in H5 format (legacy) |
114
+ | `main.py` | 4.53 KB | Main inference script |
115
+ | `Train_plant_disease.ipynb` | 552 KB | Training notebook |
116
+ | `Test_Plant_Disease.ipynb` | 600 KB | Testing and evaluation notebook |
117
+ | `training_hist.json` | 862 B | Training metrics and history |
118
+ | `requirement.txt` | 126 B | Required dependencies |
119
+ | `home_page.jpeg` | 75.9 KB | Application interface image |
120
+
121
+ ## Performance
122
+
123
+ Training metrics and performance details are available in `training_hist.json`. The model was evaluated on multiple metrics including:
124
+ - Accuracy
125
+ - Precision
126
+ - Recall
127
+ - F1-Score
128
+
129
+ ## Supported Plant Species and Diseases
130
+
131
+ The model can classify 38 different classes including various combinations of:
132
+
133
+ **Plant Species**: Apple, Blueberry, Cherry, Corn, Grape, Orange, Peach, Pepper, Potato, Raspberry, Soybean, Squash, Strawberry, Tomato
134
+
135
+ **Disease Types**: Bacterial spot, Early blight, Late blight, Leaf blight, Leaf scorch, Leaf mold, Septoria leaf spot, Spider mites, Target spot, Tomato Yellow Leaf Curl Virus, Tomato mosaic virus, Black rot, Esca, Cedar apple rust, Powdery mildew, and Healthy conditions
136
+
137
+ ## Limitations and Considerations
138
+
139
+ - Model performance is optimal with 256×256 pixel images
140
+ - Best results achieved with clear, well-lit images of plant leaves
141
+ - Performance may vary with images taken in different environmental conditions
142
+ - Model is trained on controlled dataset images; real-world field conditions may present additional challenges
143
+ - Recommended to use as a diagnostic aid rather than sole decision-making tool
144
+
145
+ ## Use Cases
146
+
147
+ - **Smart Farming**: Integration into precision agriculture systems
148
+ - **Mobile Applications**: Disease detection apps for farmers
149
+ - **Automated Monitoring**: Greenhouse and crop monitoring systems
150
+ - **Educational Tools**: Training resources for agricultural students
151
+ - **Research**: Baseline for plant pathology research
152
+
153
+ ## Citation
154
+
155
+ If you use this model in your research or application, please cite:
156
+ ```bibtex
157
+ @misc{harimitra2025,
158
+ author = {sudhir75},
159
+ title = {Harimitra: Plant Disease Detection Model},
160
+ year = {2025},
161
+ publisher = {HuggingFace},
162
+ url = {https://huggingface.co/sudhir75/Harimitra}
163
+ }
164
+
165
+ @dataset{new_plant_diseases_dataset,
166
+ author = {vipoooool},
167
+ title = {New Plant Diseases Dataset},
168
+ year = {2020},
169
+ publisher = {Kaggle},
170
+ url = {https://www.kaggle.com/datasets/vipoooool/new-plant-diseases-dataset}
171
+ }
172
+ ```
173
+
174
+ ## License
175
+
176
+ This model is released under the MIT License.
177
+
178
+ ## Acknowledgments
179
+
180
+ - Dataset: New Plant Diseases Dataset by vipoooool on Kaggle
181
+ - Based on PlantVillage dataset methodology
182
+ - Built with TensorFlow/Keras
183
+
184
+ ## Contact & Support
185
+
186
+ For questions, issues, or contributions:
187
+ - Open an issue in this repository
188
+ - Check the training notebooks for implementation details
189
+ - Review `training_hist.json` for model performance metrics
190
+
191
+ ## Future Improvements
192
+
193
+ - Expansion to additional plant species and diseases
194
+ - Real-time inference optimization
195
+ - Mobile deployment (TensorFlow Lite conversion)
196
+ - Integration with IoT devices for automated monitoring
197
+ - Multi-language support for global agricultural use