Skip to content

freddyfavour/fagro-detect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

FagroDetect: Quantum-Enhanced Tomato Leaf Disease Detection

FagroDetect is an academic research prototype that investigates the application of quantum machine learning to the classification of tomato leaf diseases. The system performs binary classification (Healthy vs. Diseased) using hand-crafted image features derived from established plant pathology indicators and a Variational Quantum Classifier (VQC) implemented with Qiskit.

This project serves as an educational and exploratory study into the feasibility of quantum-enhanced classifiers for agricultural image analysis.

Abstract

Early and accurate detection of foliar diseases in tomato crops (Solanum lycopersicum) is essential for effective disease management and yield preservation. This work presents a lightweight pipeline combining classical computer vision techniques for feature extraction with a small-scale quantum variational classifier. Hand-crafted features are selected based on known visual symptoms of common tomato pathogens, including chlorophyll degradation, lesion formation, and textural anomalies. Performance is evaluated against a classical Support Vector Machine baseline.

Dataset

The model is trained and validated on the publicly available New Plant Diseases Dataset (Augmented version) hosted on Kaggle:

  • Reference: https://www.kaggle.com/datasets/vipoooool/new-plant-diseases-dataset
  • Structure:
    • train/: Augmented training images
    • valid/: Original, non-augmented validation images
  • Classes:
    • Healthy: Tomato___healthy
    • Diseased (9 classes): Bacterial spot, Early blight, Late blight, Leaf Mold, Septoria leaf spot, Two-spotted spider mite, Target Spot, Tomato Yellow Leaf Curl Virus, Tomato mosaic virus

Methodology

Feature Engineering

Eight discriminative features are extracted from each RGB leaf image, grounded in plant pathology and remote sensing literature:

  • Mean green channel intensity
  • Mean red channel intensity
  • Excess Green Index (ExG = 2G − R − B)
  • Red-to-Green ratio
  • HSV saturation (masked to leaf regions via ExG thresholding)
  • Texture standard deviation (grayscale)
  • Laplacian-based spot detection (mean absolute second derivative)
  • Sobel edge magnitude (mean gradient strength)

These features effectively capture:

  • Chlorophyll loss and discoloration
  • Necrotic lesion boundaries
  • Surface texture irregularities
  • Moisture-related saturation changes

Classification Models

  1. Quantum Model

    • Variational Quantum Classifier (VQC) from Qiskit Machine Learning
    • Feature map: ZZFeatureMap (repetitions: 1–3)
    • Ansatz: RealAmplitudes (repetitions: 1)
    • Optimizer: COBYLA
    • Qubit count: equal to feature dimension (6–8)
  2. Classical Baseline

    • Support Vector Machine with RBF kernel (scikit-learn)

Experimental Results (January 2026)

Configuration Training Samples Training Accuracy Balanced Validation Accuracy
VQC (6 features, 270 samples) 135 healthy + 135 diseased 75–85% 78–88%
SVM (same features, 270 samples) 135 healthy + 135 diseased 82–90% 85–92%

Target: Achieve ≥90% balanced validation accuracy through increased sample size and hyperparameter refinement.

Usage Instructions

Requirements

  • Python ≥ 3.9
  • Jupyter Notebook or Google Colab

Environment Setup

pip install numpy matplotlib scipy \
            qiskit qiskit-machine-learning qiskit-algorithms \
            scikit-learn

Dataset Preparation

  1. Download the dataset from the Kaggle link above.
  2. Extract to the project root maintaining the nested folder structure:
    New Plant Diseases Dataset(Augmented)/
    └── New Plant Diseases Dataset(Augmented)/
        ├── train/
        └── valid/
    
  3. Alternatively, mount Google Drive and adjust paths accordingly.

Execution

Launch Model0.2.0.ipynb (or the latest version) and execute all cells sequentially.

For resource-constrained devices (e.g., 4 GB RAM systems):

  • Limit training samples to 100–200
  • Use ZZFeatureMap(reps=1)
  • Set maxiter ≤ 50

Discussion & Limitations

  • The current prototype demonstrates proof-of-concept performance on modest hardware.
  • Quantum advantage remains limited by small dataset size and simulator noise.
  • Classical baselines consistently outperform the quantum model under identical conditions, highlighting the need for larger feature spaces or hybrid approaches.

Future Work

  • Scale training to ≥1,000 samples per class
  • Incorporate data augmentation pipelines
  • Explore CNN-derived feature embeddings with quantum classification
  • Extend to multi-class disease identification
  • Develop a deployable mobile/web application for field use

License

MIT License — free to use, modify, and distribute.

Author

Favour Alfred
Research Interest: Artificial Intelligence Applications in Agriculture and Sustainable Food Systems


FagroDetect — Advancing precision agriculture through quantum-inspired machine learning.

About

FagroDetect is an academic research prototype that investigates the application of quantum machine learning to the classification of tomato leaf diseases.This project serves as an educational and exploratory study into the feasibility of quantum-enhanced classifiers for agricultural image analysis.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors