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.
Release files for cassava-classifier 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cassava_classifier-0.0.4.tar.gz | 18.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cassava_classifier-0.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.2 kB
Release files / cassava_classifier-0.0.4.tar.gz
| Download URL | cassava_classifier-0.0.4.tar.gz |
|---|---|
| Size | 18.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bcfc43f82107ebff182c0d256ea68ed7e2d865c397334956fb445308dfc6866b
|
|
BLAKE2b-256 checksum How to use checksums |
4136e58128597e3773642c1428127ea783fd8d56e13a5ea059c362489b512ec8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 4, 2026.
Transparency logRelease files / cassava_classifier-0.0.4-py3-none-any.whl
| Download URL | cassava_classifier-0.0.4-py3-none-any.whl |
|---|---|
| Size | 15.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f97c2093d101ae535a41dfaf8ebefe3d502605fa495ae1ac23001be8436f298d
|
|
BLAKE2b-256 checksum How to use checksums |
04c3898e774694e8c0eef57703385f9adfd9b9947daaae53102412f30af4e59d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 4, 2026.
Transparency log