Cassava leaf disease classification using Deep neural network in Pytorch
Project description
Cassava leaf disease classification
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
Swagger documentation for API
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.
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
-
Training data can be found on the Kaggle competition page
-
Streamlit app code can be found here.
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.
-
Vladimir Iglovikov for his wonderful article "I trained a model. What is next?" — archived copy
-
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bcfc43f82107ebff182c0d256ea68ed7e2d865c397334956fb445308dfc6866b
|
|
| MD5 |
907558a24908f4de1a78d5d69ff63543
|
|
| BLAKE2b-256 |
4136e58128597e3773642c1428127ea783fd8d56e13a5ea059c362489b512ec8
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cassava_classifier-0.0.4.tar.gz -
Subject digest:
bcfc43f82107ebff182c0d256ea68ed7e2d865c397334956fb445308dfc6866b - Sigstore transparency entry: 1438603556
- Sigstore integration time:
-
Permalink:
p-s-vishnu/cassava-leaf-disease-classification@c375c9ddd5870efbe0332ae0e41f7e877ffbcee4 -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/p-s-vishnu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c375c9ddd5870efbe0332ae0e41f7e877ffbcee4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cassava_classifier-0.0.4-py3-none-any.whl.
File metadata
- Download URL: cassava_classifier-0.0.4-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f97c2093d101ae535a41dfaf8ebefe3d502605fa495ae1ac23001be8436f298d
|
|
| MD5 |
cbcee2f90035006aefd976c9a08142e8
|
|
| BLAKE2b-256 |
04c3898e774694e8c0eef57703385f9adfd9b9947daaae53102412f30af4e59d
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cassava_classifier-0.0.4-py3-none-any.whl -
Subject digest:
f97c2093d101ae535a41dfaf8ebefe3d502605fa495ae1ac23001be8436f298d - Sigstore transparency entry: 1438603567
- Sigstore integration time:
-
Permalink:
p-s-vishnu/cassava-leaf-disease-classification@c375c9ddd5870efbe0332ae0e41f7e877ffbcee4 -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/p-s-vishnu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c375c9ddd5870efbe0332ae0e41f7e877ffbcee4 -
Trigger Event:
push
-
Statement type: