This repository showcases a Vue.js frontend and a Python(flask) backend for detecting plant diseases using a Convolutional Neural Network (CNN). The frontend allows users to upload images of plant leaves, while the backend handles inference using a trained model.
- Goal: Detect plant diseases from leaf images using a trained CNN model.
- Frontend: Built with Vue.js (Vite as the build tool).
- Backend: Python (Flask in
app.py) for model inference. - Machine Learning: A Jupyter Notebook (
model.ipynb) for training the CNN model.
-
AI_plant_disease_detection ├── node_modules/ # Node.js dependencies ├── src/ │ ├── components/ │ │ └── PlantDiseaseDetection.vue # Vue component for disease detection UI │ ├── App.vue # Root Vue component │ ├── index.html # Main HTML template for Vite │ └── main.js # Entry point for Vue application ├── app.py # Python backend for model inference ├── model.ipynb # Jupyter notebook for training the CNN model ├── package.json # Node.js project configuration ├── package-lock.json # Auto-generated file for exact dependency versions ├── Procfile.txt # Deployment configuration (e.g., Heroku) ├── README.md # Project documentation (this file) ├── requirements.txt # Python dependencies └── vite.config.js # Vite configuration
To train or retrain the CNN model, you need a labeled dataset of plant leaf images. One popular dataset is available on Kaggle. Steps:
Download the dataset from Kaggle.
Unzip and place the images in a suitable directory (e.g., data/) at the project root.
Update any file paths in model.ipynb as needed.
Note: The dataset is not included in this repository. You must download it separately from Kaggle.
Node.js (version 14+ recommended)
Python 3.7+
pip (Python package manager)
Virtual environment tool (optional but recommended)
- Clone the Repository
git clone https://github.com/vara-prasad-07/ AI_plant_disease_detection.git
- Install Node.js Dependencies
npm install
- Install Python Dependencies
pip install -r requirements.txt
- running frontend:
npx vite
This starts a local development server. By default, open http://localhost:5173 (or the URL shown in the console) in your browser.
-
Ensure your virtual environment is active (if used).
-
start python server:
python app.py
This will run a Flask (or similar) app on a local port (e.g., http://127.0.0.1:5000).
- Check API Endpoints (if any):
For instance, POST /predict might be where images are sent from the frontend.
Architecture: Convolutional Neural Network (CNN) with multiple convolution, pooling, and dense layers.

Frameworks:
-
Python: TensorFlow/Keras (or PyTorch, depending on your setup)
-
Vue: Composition API or Options API (depending on your preference)
-
Training:
Use model.ipynb to train or fine-tune the CNN.
Hyperparameters (learning rate, batch size, epochs) can be modified in the notebook.