Skip to content

ankit-prabhavak/TomatoLeafAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TomatoLeafAI

TomatoLeafAI is a deep learning image classifier to detect diseases in tomato plant leaves. It uses a custom Convolutional Neural Network (CNN) to classify images into Early Blight, Late Blight, or Healthy categories. This project is a part of Project Kisan – an AI initiative to assist farmers with crop disease detection and other services.

Features

  • Detects:
    • Early Blight
    • Late Blight
    • Healthy Leaves
  • CNN model trained with high accuracy
  • Deployment-ready for mobile (TensorFlow Lite) and cloud (Firebase)
  • Simple Python code for learning and customization

Tech Stack

  • Python 3
  • TensorFlow / Keras
  • OpenCV
  • tqdm
  • Flask

Folder Structure

project-kisan-disease/
├── raw_tomato_dataset/
│   ├── Tomato___Early_blight/
│   ├── Tomato___Late_blight/
│   └── Tomato___healthy/
├── dataset/
│   ├── train/
│   └── val/
├── test_images/
│   └── test_image.jpg
├── images/
│   └── tomatoleafai_workflow.jpg
├── static/
│   ├── uploads/
│   └── style.css
├── templates/
│   └── index.html
├── app.py
├── plant_disease_model.py
├── test_prediction.py
├── plant_disease_model.keras
├── requirements.txt
└── split_dataset.py

Here’s how the TomatoLeafAI detection page looks in action:

Web Page Screenshot

How It Works

  1. Upload an image of a tomato leaf using the web interface.
  2. The model predicts the disease class.
  3. Displays the result and treatment info (if available).

Getting Started

Clone the Repo

git clone https://github.com/yourusername/TomatoLeafAI.git
cd TomatoLeafAI

Install Requirements

pip install -r requirements.txt

Prepare Dataset

Download and place folders inside raw_tomato_dataset/:

  • Tomato___Early_blight/
  • Tomato___Late_blight/
  • Tomato___healthy/

Then run:

python split_dataset.py

Train the Model

python plant_disease_model.py

Start the Flask App

python app.py

Go to http://127.0.0.1:5000 in your browser.

Optional: Test Prediction from CLI

Add a leaf image in test_images/, update path in test_prediction.py, and run:

python test_prediction.py

Contact

About

TomatoLeafAI is a deep learning-based plant disease detection system built using TensorFlow and Flask. It classifies tomato leaf images into Early Blight, Late Blight, or Healthy using a custom-trained CNN model.

Resources

Stars

10 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors