Skip to main content

Cassava leaf disease classification using Deep neural network in Pytorch

Project description

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).

Web app

Open Web App in Streamlit inference

Swagger documentation for API

API Link inference

Installation

pip install cassava-classifier

Inference example

from 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 either on google colab or kaggle.

Open In Colab Kaggle

Development Setup

Pre-commit hooks

This project uses pre-commit to run linting, formatting, and type-checking automatically before each commit.

# Install pre-commit
uv tool install pre-commit

# Install the git hooks
pre-commit install

# (Optional) Run against all files manually
pre-commit run --all-files

The hooks include:

  • ruff — linting with auto-fix + formatting (replaces black, isort, flake8)
  • pre-commit-hooks — YAML/JSON validation, merge conflict detection, trailing whitespace
  • mypy — static type checking

Other details

Github discussion forum

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. Vladimir Iglovikov for his wonderful article "I trained a model. What is next?"archived copy

  2. Y. Nakama for the baseline code.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cassava_classifier-0.0.4.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cassava_classifier-0.0.4-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file cassava_classifier-0.0.4.tar.gz.

File metadata

  • Download URL: cassava_classifier-0.0.4.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cassava_classifier-0.0.4.tar.gz
Algorithm Hash digest
SHA256 bcfc43f82107ebff182c0d256ea68ed7e2d865c397334956fb445308dfc6866b
MD5 907558a24908f4de1a78d5d69ff63543
BLAKE2b-256 4136e58128597e3773642c1428127ea783fd8d56e13a5ea059c362489b512ec8

See more details on using hashes here.

Provenance

The following attestation bundles were made for cassava_classifier-0.0.4.tar.gz:

Publisher: publish.yml on p-s-vishnu/cassava-leaf-disease-classification

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cassava_classifier-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for cassava_classifier-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f97c2093d101ae535a41dfaf8ebefe3d502605fa495ae1ac23001be8436f298d
MD5 cbcee2f90035006aefd976c9a08142e8
BLAKE2b-256 04c3898e774694e8c0eef57703385f9adfd9b9947daaae53102412f30af4e59d

See more details on using hashes here.

Provenance

The following attestation bundles were made for cassava_classifier-0.0.4-py3-none-any.whl:

Publisher: publish.yml on p-s-vishnu/cassava-leaf-disease-classification

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page