File size: 3,209 Bytes
1cc51d9
 
 
5a02685
02aad15
1cc51d9
 
 
02aad15
 
 
 
 
 
5a02685
 
02aad15
 
e1706f7
 
 
 
 
 
 
02aad15
5a02685
 
1cc51d9
02aad15
5a02685
02aad15
 
 
1cc51d9
02aad15
5a02685
02aad15
 
 
 
 
1cc51d9
02aad15
 
 
 
1cc51d9
5a02685
02aad15
276643c
e1706f7
5a02685
 
e1706f7
e053ae7
02aad15
 
 
b08bec0
02aad15
95ba7d7
b08bec0
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
license: gpl-3.0
---

# Potato & Tomato Disease Classification Web Application

This project is a web application developed using Flask that allows users to upload images of potato or tomato leaves and receive predictions regarding potential diseases. The application utilizes two deep learning models: one trained to classify potato leaf diseases and another for tomato leaf diseases. Both models were trained using convolutional neural networks (CNNs) and implemented using PyTorch.

## Features

- Image Upload: Users can upload images of potato or tomato leaves.
- Disease Prediction: The application predicts whether the leaf is healthy or affected by specific diseases.
- Dynamic Background: The background image of the web page dynamically changes based on whether the user selects potato or tomato.
- Probability Display: The probability of the predicted class is displayed as a percentage.


## Technologies

- **Python:** Core programming language used for model development and Flask backend.
- **Flask:** Web framework for developing the web application.
- **PyTorch:** Deep learning framework used to develop and train the models.
- **HTML/CSS:** For creating the frontend of the web application.
- **PIL (Pillow):** For image processing.
- **OpenCV:** For image display and preprocessing.
- **Torchvision:** For image transformation utilities.
## Models

- **Potato Disease Classification Model**

  - **Classes:** Potato Early Blight, Potato Late Blight, Potato Healthy
   - **Techniques Used:**
     - Convolutional layers for feature extraction.
     - Batch normalization and max pooling for enhanced training stability and performance.
     - Dropout layers to prevent overfitting.

- **Tomato Disease Classification Model**

  -  **Classes:** Tomato Early Blight, Tomato Late Blight, Tomato Healthy
  - **Techniques Used:**
    - Similar architecture to the potato model with appropriate adjustments for tomato disease classification.
    - Batch normalization, max pooling, and dropout layers are also used here.
## Usage

- Install the required dependencies using `pip install -r requirements.txt`.
- Download the pre-trained model weights and place them in the `models/` directory.
- Run the Flask web application using `python app.py`.
- Access the application in your web browser at `http://localhost:5000`.


## Outcome

- **Performance**
  - **Potato Model:** Achieved an accuracy of 98% on the validation set, with strong performance in classifying Early Blight, Late Blight, and Healthy leaves.
  - **Tomato Model:** Achieved an accuracy of 97% on the validation set, effectively distinguishing between Early Blight, Late Blight, and Healthy leaves.
- **Benefits**
  - **Disease Detection:** Helps farmers and agriculturists detect diseases in potato and tomato plants early, potentially preventing crop losses.
   - **User-Friendly Interface:** The web application provides a simple interface for non-technical users to diagnose plant diseases.

## App
![App Screenshot](https://huggingface.co/datasets/hassaanik/Plant_Disease_App_Images/resolve/main/Potato.png)


![App Screenshot](https://huggingface.co/datasets/hassaanik/Plant_Disease_App_Images/resolve/main/Tomato.png)