Skip to content

Classifying citrus leaf images based on disease type using Convolutional Neural Networks(CNNs).

Notifications You must be signed in to change notification settings

polaternez/citrus-diseases-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Citrus Diseases Detection: Project Overview

This tool identifies diseased citrus trees by classifying citrus leaf images based on disease type.

  • Leverages the citrus_leaves dataset from TensorFlow Datasets.
  • Performs data preprocessing for standardization and label encoding.
  • Builds and evaluates a Convolutional Neural Network (CNN) on the dataset.
  • Develops a user-friendly client-facing API using Flask.

Code and Resources Used

Python Version: 3.10
Packages: numpy, pandas, matplotlib, tensorflow, tensorflow_datasets, flask, pillow
Flask API Setup:

  • pip install -r requirements.txt
  • conda env create -n <ENVNAME> -f environment.yaml (Anaconda Environment)

Dataset: https://www.tensorflow.org/datasets/catalog/citrus_leaves?hl=en

Getting Data

The project utilizes the citrus_leaves dataset from TensorFlow Datasets, containing 594 PNG images of citrus leaves categorized into four labels: Black Spot, Canker, Greening, and Healthy. The images have a resolution of 256x256 pixels.

alt text

Data Preprocessing

  • Data Split: Divides the dataset into 80% training and 20% testing data for robust model generalization.
  • Image Preprocessing: Reshapes and normalizes the images to a standard format and pixel range.
  • Label Encoding: Converts labels to one-hot encoded format for efficient processing and multi-label handling.

Model Building

Constructs a Convolutional Neural Network (CNN) with the following architecture:

alt text

Model Evaluation

Measures the model's loss using categorical cross-entropy and optimizes it with the ADAM algorithm. Achieved the following results:

alt text

Productionization

Develops a user-friendly UI using Flask. The API endpoint receives image requests and returns predicted citrus disease types for each image.

alt text

About

Classifying citrus leaf images based on disease type using Convolutional Neural Networks(CNNs).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages