Back to leaf checker
BEHIND THE LEAF

A closer look at
how it works.

A small tool for exploring plant health, built around an existing image-classification model. Here’s what happens to your photo—and what a result can tell you.

01

You bring the leaf.

Upload one clear JPEG or PNG. The server validates the file, corrects its orientation, and converts it to RGB at 256 × 256 pixels. Transparent backgrounds are composited onto white.

02

We look for patterns.

A ResNet9 model processes the image. The hosted demo uses a shared GPU queue; the local version runs on a CPU. Pixel values are scaled from 0–255 to 0–1, using the same scaling as the 38-class reference notebook. No new training takes place.

03

You get a starting point.

The highest-scoring category is shown with its softmax score. This score is not a calibrated probability that the plant has a disease. Your photo is processed in memory and is not saved.

WHAT’S IN THE GARDEN

14 plants.
38 leaf categories.

Each category combines a plant with a condition or a healthy-leaf label. Coverage differs by plant.

Loading supported plants…

A result needs context.

The reference training data uses mostly isolated leaves under controlled conditions. Field photos, unusual lighting, several leaves, and busy backgrounds can reduce reliability. The model always chooses from its known categories; it cannot reliably reject unrelated images or identify every plant disease.

Use LeafLens to explore possibilities. Confirm important plant-care decisions with a qualified local expert. No field accuracy or independent evaluation of this checkpoint is claimed.

BUILT WITH OPEN TOOLS

The roots
of LeafLens.

Model & data provenance

The supplied checkpoint has 38 outputs and is compatible with the ResNet9 architecture in the reference notebook by Atharva Ingle . That notebook uses the augmented PlantVillage-derived dataset. Original dataset information is available from PlantVillage .

The exact training history of the supplied weights is not independently verified. A separate 14-class notebook in the original project does not describe the deployed checkpoint. Source attribution is retained; notebook accuracy figures are not presented as LeafLens performance.

The application

A React and TypeScript interface connects to a FastAPI service running PyTorch. The original model weights and category order are preserved. The app adds validated uploads, fixed-size preprocessing, accessible interaction states, and inference with bounded concurrency.

The demo runs on Hugging Face’s free ZeroGPU tier, with a shared queue and daily usage limits. Its first start can take longer. Uploaded photos are neither persisted nor used for training.

Explore the source