cassava-classifier

Cassava leaf disease classification using Deep neural network in Pytorch


Keywords
image, classification, leaf, disease, classifier, pytorch, leaf-diseases
License
MIT
Install
pip install cassava-classifier==0.0.1

Documentation

Cassava leaf disease classification

PyPI version shields.io Downloads

The idea of this project is to build an image classifier to find out healthy and diseased cassava leaves.

There are 4 different classes of leaf diseases namely - Cassava Bacterial Blight (CBB),Cassava Brown Streak Disease (CBSD),Cassava Green Mottle (CGM) and Cassava Mosaic Disease (CMD) .

inference

Github discussion forum

Installation

pip install cassava-classifier

Inference example

import PIL import Image
from cassava.pretrained import get_model

image = Image.open("<insert your image path here>")

# Use cassava.list_models() to list of available trained models
model = get_model(name:str)
model.predict_as_json(image: np.array)
>> {"class_name":str, "confidence": np.float}

Try out the inference code on either google colab or kaggle.

Open In Colab Kaggle

Training pipeline

1.Model Architecture - Efficeientnet-B4 , Noisy Weights
2.Image Size         - 512
3.Optimizer          - Adam
4.Scheduler          - GradualWarumUpScheduler
5.Loss               - Focal Cosine Loss
6.Augmentations      - Hard Augmentations
7.Epochs             - 10
8.Early Stopping     - No
9.Mixed Precision    - Yes

Blog

[Medium link]

Acknowledgements

We would like to thank Kaggle community as a whole for providing an avenue to learn and discuss latest data science/machine learning advancements but a hat tip to whose code was used / who inspired us.

  1. Teranus
  2. Nakama