Skip to content

Automated Diagnosis of Diverse Coffee Leaf Images through a Triple Deep Convolutional Neural Network

Notifications You must be signed in to change notification settings

arsyakaukabi/bangkit-coffee-ml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

Python Tensorflow

Automated Diagnosis of Diverse Coffee Leaf Images through a Triple Deep Convolutional Neural Network.

Graphical Abstract

Abstract

Fig 1 The stage-wise classification of coffee leaves with the trained backbones

DATASETS

The dataset used for this work came from the following works:

Please cite or credit their work when using it!

RoCoLe

Parraga-Alava, Jorge; Cusme, Kevin; Loor, Angélica; Santander, Esneider (2019), “RoCoLe: A robusta coffee leaf images dataset ” Mendeley Data, V2, doi: 10.17632/c5yvn32dzg.2

Inclusion:

  • Healthy
  • Coffee Leaf Rust (CLR)
  • Red Spider Mites (RSM)

BrACoL

Krohling, Renato; esgario, José; Ventura, Jose A. (2019), “BRACOL - A Brazilian Arabica Coffee Leaf images dataset to identification and quantification of coffee diseases and pests” Mendeley Data, V1, doi: 10.17632/yy2k5y8mxg.1

Esgario, J. G., Krohling, R. A., & Ventura, J. A. (2020) "Deep learning for classification and severity estimation of coffee leaf biotic stress" Computers and Electronics in Agriculture 169, 105162. doi:10.1016/j.compag.2019.105162

Inclusion:

  • Healthy
  • Coffee Leaf Rust (CLR)
  • Cercospora Leaf Spots (CLS)
  • Phoma Leaf Spots (PLS)
  • Coffee Leaf Miner (CLM)

LiCoLe

Montalbo, Francis Jesmar Perez; Hernandez, Alexander Arsenio (2020) "Classifying Barako coffee leaf diseases using deep convolutional models" International Journal of Advances in Intelligent Informatics (IJAIN) [S.l.], v. 6, n. 2, p. 197-209, july 2020. ISSN 2548-3161. doi: 10.26555/ijain.v6i2.495

Montalbo, Francis Jesmar Perez "An Optimized Classification Model for Coffea Liberica Disease using Deep Convolutional Neural Networks" n Proc. of the 2020 16th IEEE International Colloquium on Signal Processing & Its Applications (CSPA), Langkawi, Malaysia, 2020, pp. 213-218, doi: 10.1109/CSPA48992.2020.9068683.

Inclusion:

  • Healthy
  • Coffee Leaf Rust (CLR)
  • Sooty Molds (SM)

Table 1 Specification of the curated coffee leaf dataset dataset

For the readily prepared dataset used in this work refer to this link (OPTIONAL) : Google Drive Prepared Dataset

PREPARED DATASET: (7 GB)

NOTE: The following credits for the datasets still goes to their appropriate owners and collectors. please remember to cite their work when using their respective datasets.

Environment Setup

Make sure to create a new virtual environment preferably in Anaconda. Use Python 3.5+.

The SWAT-DCNN uses the tensorflow GPU. This may also require at least CUDA 10 and a cuDNN

Clone the repository:

git clone https://github.com/arsyakaukabi/Co-ffee_A.git

Activate and access the folder Co-ffee.A/ with the included requirements.txt file. Afterwards, simply enter the command in the conda CLI

pip install -r requirements.txt

Once installed, you may either train the models individually with the .ipynb notebooks found in Co-ffee.A/Models/ inside the stage1, stage2, and stage3 folders or make use of the pre-trained weights.

The Co-ffee.A/Models/TDCNN/ files does not need to re-train. However, its a must to compile and aggregate the T-DCNN stages to produce its own respective weights needed by the entire SWAT-DCNN model.

Pre-trained Weights

The pre-trained weights are the plug and play weights that can be used to skip the training and compilation of models for the TDCNN (RECOMMENDED).

For an immediate simulation without the hassle of going over the previous instructions, refer to this link. : Pre-Trained Weights

PRE-TRAINED WEIGHTS FILESIZE: (484 MB)

The filenames must not be changed for the .h5 files.

  • model1.h5
  • model2.h5
  • model3.h5

Make sure to extract the pre-trained weights in the given manner 🠊 Co-ffee_A/weights/

How to use

Training with the pre-trained weights (RECOMMENDED)

Training from scratch (May take long hours depending on your PC specs)

  1. Activate your created virtual environment and enter the main Co-ffee_A/ folder.

  2. Save the dataset folder downloaded from LINK inside the Co-ffee_A/ as Co-ffee_A/dataset/

  3. Open the .ipynb files from the Co-ffee_A/models folder and run the following in your preferred order. The Co-ffee_A/models/tdcnn/ is saved for later.

  4. Once all models from stage-1 to 3 are trained. You may now open the Co-ffee_A/models/tdcnn/ folder to build the T-DCNN models.

  5. After all T-DCNN models are built, you may now run the testing.py from the main Co-ffee_A/ folder.

  6. Follow through the given instructions and make sure to use the test sample from the provided /test/ folder

In case of any problems, don't hesitate to contact me. I'll be happy to help.

Performance Results

In Fig. 2, all models successfully trained and validated from their respective datasets, illustrated by the converged train and validation graphs.

Trainng

Fig 2 The learning progress of the selected models during training and validation

Figure 3 presents the classification results of the individual T-DCNN stages with their respective test datasets visualized

TDCNN

Fig 3 TDCNN confusion matrix results from the test data for each stage

Co-ffee Github Repo Links

Machine Learning

Classification of Coffee Leaf Diseases

Green Coffee Beans Moisture Level Detection

Cloud Computing

Disease classification API

Coffee beans Moisture level detection API

Mobile Development

Project Android Studio

Acknowledgment

Thanks to Bangkit Academy. Without its support, this work would not have become possible.

Thanks to Francis Jesmar P. Montalbo for inspires us to create this kind of model.

About

Automated Diagnosis of Diverse Coffee Leaf Images through a Triple Deep Convolutional Neural Network

Topics

Resources

Stars

Watchers

Forks