-
Install Python (Setup instructions)
-
Install Python packages
pip3 install -r training/requirements.txt
pip3 install -r api/requirements.txt
- Download PyCharm.
- Follow the installation instructions for your operating system.
- Open the project in PyCharm to begin development.
- Download the data from Kaggle.
- Only keep folders related to Potatoes.
- Run Jupyter Notebook in your browser.
- Open
training.ipynb
in Jupyter Notebook. - In cell #3, update the path to the dataset.
- Run all the cells one by one.
- Copy the generated model and save it with the version number in the
models
folder.
- Get inside
api
folder
cd api
- Run the FastAPI Server using uvicorn
uvicorn main:app --reload --host 0.0.0.0
- Your API is now running at `0.0.0.0:800
-
Clone the Repository: git clone https://github.com/VijayShankarSN/Potato-Disease-Prediction.git
-
Navigate to Project Directory: cd Potato-Disease-Prediction
-
Run main.py
-
Open Google Chrome or any other web browser.
-
Access Localhost: Enter the following URL in the browser address bar: http://localhost:8000
-
Click on the upload button to select and upload a potato leaf image.
-
After uploading the image, click on the "Predict" button.
-
A pop-up window will appear displaying the results of the prediction.
-
To upload another image, click on the image in the pop-up window to reopen the upload interface.
-
Repeat Steps 6-9: Repeat the process to predict diseases for additional images.
Potato Disease Prediction
Potato Disease Prediction is an innovative project aimed at revolutionizing agricultural practices by leveraging cutting-edge technology to predict and diagnose diseases in potato plants. Employing state-of-the-art machine learning techniques, this project utilizes TensorFlow, Convolutional Neural Networks (CNNs), data augmentation, and TensorFlow Dataset to accurately detect and classify various diseases affecting potato crops.
Key Features:
-
Advanced Machine Learning Algorithms: The project harnesses the power of TensorFlow, a leading machine learning framework, to develop robust models capable of accurately predicting potato diseases.
-
Convolutional Neural Networks (CNNs): CNNs are employed to effectively capture intricate patterns and features within potato plant images, enabling precise disease identification.
-
Data Augmentation: Augmenting the dataset enhances model generalization by generating variations of input images, thereby enriching the training process and improving model performance.
-
FastAPI Backend: The backend infrastructure is built using FastAPI, a modern web framework for building APIs with Python. FastAPI ensures efficient communication between the frontend and backend components, facilitating seamless data processing and prediction.
-
Model Optimization: To enhance efficiency and deploy the model on resource-constrained devices, optimization techniques such as quantization and TensorFlow Lite are implemented, reducing model size while maintaining high accuracy.
-
HTML Frontend: The frontend interface is developed using HTML, providing users with an intuitive and user-friendly platform to interact with the application, upload images, and receive disease predictions.
Project Structure:
The project is structured into distinct components for seamless integration and modularity:
Component | Description |
---|---|
Data Collection | Acquisition and preprocessing of potato plant image dataset |
Model Development | Training CNN models using TensorFlow and data augmentation |
Backend Development | Implementation of FastAPI backend for data processing |
Model Optimization | Optimization techniques like quantization and TensorFlow Lite |
Frontend Development | HTML interface for user interaction and result display |
Testing and Deployment | Evaluation of model performance and deployment on GitHub |
How to Use:
- Upload Image: Users can upload images of potato plants affected by diseases via the frontend interface.
- Prediction: The uploaded image is processed through the trained CNN model, which predicts the type of disease present.
- Display Results: The frontend displays the prediction results, providing users with actionable insights for disease management and crop protection.
Conclusion:
Potato Disease Prediction represents a significant advancement in precision agriculture, offering farmers a reliable tool for early disease detection and mitigation. By harnessing the power of machine learning and web technologies, this project contributes to enhancing crop yield, reducing losses, and promoting sustainable farming practices. Explore the repository on GitHub to learn more and contribute to the future of agricultural innovation.