CropCheckUp

AI-assisted crop leaf disease detection.

CropCheckUp analyzes a leaf image, removes the background, prepares the image for a TensorFlow Lite model, and shows the predicted crop condition with confidence and management information.

68
crop and condition labels
224 x 224
image input prepared for inference
0-255
RGB tensor range handled by the model

How It Works

The app is intentionally narrow: one leaf image goes through segmentation, model-ready preprocessing, TensorFlow Lite inference, then a readable diagnosis summary.

01

Capture or upload

The user captures a live camera frame or selects an image from the gallery.

CropCheckUp starts with one visible leaf. A clean single-subject image gives the downstream segmentation and classifier less irrelevant texture to absorb.

  • Camera or gallery input
  • Single leaf only
  • Visible disease area
02

Remove background

The app isolates the leaf so the classifier focuses on the plant area.

Background removal reduces noise from soil, hands, pots, shadows, and neighboring plants before the model sees the image.

  • Leaf mask extracted
  • Non-leaf pixels suppressed
  • Transparent pixels handled later
03

Resize image

The processed image is resized to 224 x 224 pixels.

Every image is normalized to the same square input size, matching the TensorFlow Lite model shape used during training and export.

  • Consistent input shape
  • Aspect handled before tensor conversion
  • Model-ready dimensions
04

Run inference

A TensorFlow Lite model predicts the most likely crop condition.

The app converts the resized RGB image into a tensor, runs local inference, and reads the top-scoring label from the output vector.

  • RGB tensor generated
  • 0-255 value range
  • Highest score selected
05

Show diagnosis

The app displays crop name, condition, confidence, symptoms, causes, and management guidance.

Raw model labels are translated into readable names and paired with the supporting context a user needs before deciding what to inspect next.

  • Readable crop and condition
  • Confidence percentage
  • Symptoms and next steps

Processing Pipeline

The landing page exposes the exact assumptions that matter for this app: input size, color channel handling, label conversion, and what happens to transparent background pixels.

Camera / Gallery

Raw leaf photo enters from the mobile capture flow.

Background removal

Leaf pixels are isolated so the model sees less surrounding scene noise.

224 x 224 image

The isolated image is resized to the model's expected square input.

RGB tensor

Pixels are packed as RGB values before inference.

TensorFlow Lite inference

The on-device model returns a score vector across the label file.

Diagnosis result

The top label is converted into crop, condition, confidence, and guidance.

Preprocessing contract

The model receives a 224 x 224 RGB image. Pixel values are passed in the 0-255 range because preprocessing is included inside the model.

Transparent background pixels are treated as black during tensor conversion.

The highest scoring label is resolved against the app's label file before the result screen is rendered.

Model Output

The classifier returns one top label and a score. The app turns that raw model output into a result a grower can scan quickly: crop, condition, confidence, symptoms, causes, management guidance, and the processed leaf preview.

Readable Classification

The classifier returns the highest-scoring label from the model output. Labels follow a crop and condition format such as Crop___Disease or Crop___healthy.

The app converts raw labels into readable crop and disease names, keeps the confidence percentage visible, and separates advisory content from the model prediction.

Label file: The current label file contains 68 crop and condition labels.

Example Diagnosis

Raw Label Tomato___Late_blight
Displayed Result Tomato - Late blight

Output Information

Crop name
Disease or healthy status
Confidence percentage
Symptoms
Possible causes
Management guidance
Processed leaf preview

Resources & Datasets

The model development workflow is documented in the Kaggle notebook. The dataset used for CropCheckUp experiments and training is available on Kaggle.

Source Dataset Attribution

  • PlantVillage: Licensed under CC-BY-NC-SA-4.0
  • Mango Leaf Disease: Licensed under CC-BY-NC-4.0

CropCheckUp derived dataset and bundled model artifacts are licensed CC-BY-NC-SA-4.0 for non-commercial use.

Important Limitations

CropCheckUp is an AI-assisted screening tool. Results depend on image quality, lighting, leaf visibility, and whether the condition exists in the trained labels.

Use a clear image of one leaf. Keep the leaf in focus, fill the frame with the relevant surface, and avoid mixing multiple plants in one capture.

Avoid blur, shadows, and cluttered backgrounds. Harsh light, dark shadows, soil texture, hands, and pots can make segmentation and classification less reliable.

The app can only classify supported labels. Unknown crops, new diseases, mixed symptoms, pests, nutrient stress, or water damage may still map to the nearest known label.