Downloads · 30 days
58
30% of all-time downloads
Shaq2/chashibhai-corn-disease-cls
chashibhai-corn-disease-cls is a image classification model from Shaq2. Use it when you need a label for an image. It is set up for ultralytics. The card lists the license as mit.
Disease ID in ChashiBhAI always runs on-device. Gemini / KrishokChat generate advisory text only and never see the photo.
Downloads · 30 days
58
30% of all-time downloads
All-time downloads
196
Public
Repo size
60.3 MB
Likes
0
Public
Click a slice to open those files.
.tflite71.2 MB · 87%
From the Hugging Face model README
| Author | Shaq2 (Shakil Ahmed) |
| Crop | corn (ভুট্টা) |
| Task | Image classification (leaf disease) |
| Architecture | YOLO26-cls → TFLite FP16 |
| Input | [1, 640, 640, 3] NHWC RGB /255.0 |
| Output | [1, 4] softmax probabilities (nms: false) |
| Status | production-demo |
| App | ChashiBhAI (Expo / React Native, on-device diagnosis) |
| Code | GitHub |
| Collection | ChashiBhAI on-device classifiers |
Disease ID in ChashiBhAI always runs on-device. Gemini / KrishokChat generate advisory text only and never see the photo.
| File | Role |
|---|---|
model.tflite | On-device graph used by the Android app (~10.93 MB) |
labels.json | Canonical class names and preprocess contract |
best.pt | Ultralytics source weights (export parent) |
| Label | English | Bangla |
|---|---|---|
Common_Rust | Common Rust | কমন রাস্ট |
Gray_Leaf_Spot | Gray Leaf Spot | ধূসর পাতা দাগ |
Healthy | Healthy | সুস্থ |
Northern_Leaf_Blight | Northern Leaf Blight | নর্দার্ন লিফ ব্লাইট |
Do not letterbox. Letterbox disagreed with the .pt on non-square photos.
imgsz = 640, keep aspect ratio.640×640.float32 / 255.0.labels.json is the source of truth (preprocess: centercrop).
| Check | Result |
|---|---|
Preprocess verified vs .pt | yes (variant C; independent machine test pass) |
| FP16 vs FP32 top-1 agreement | 1.0 |
| FP16 vs FP32 max softmax diff | 1.19209e-07 |
| Independent machine test | pass (August 2026) |
| Bundled in APK | no — Model Manager download |
Independent test on a separate machine (August 2026) confirmed this TFLite export loads and classifies correctly with the variant-C contract in labels.json. Rice, brassica, and corn all passed the same check.
Out of scope: detection / bounding boxes, crop auto-routing, chemical dosage (handled by a separate advisory stack with a refuse gate).
Four-class corn head. Downloaded on demand in the app (not bundled). Not a plant-pathologist substitute. Retake if confidence is low or the leaf is not centred.
import json
from pathlib import Path
import numpy as np
from PIL import Image
import tensorflow as tf
def preprocess_centercrop(path: str, imgsz: int = 640) -> np.ndarray:
im = Image.open(path).convert("RGB")
w, h = im.size
scale = imgsz / min(w, h)
nw, nh = int(round(w * scale)), int(round(h * scale))
im = im.resize((nw, nh), Image.BILINEAR)
left, top = (nw - imgsz) // 2, (nh - imgsz) // 2
im = im.crop((left, top, left + imgsz, top + imgsz))
return (np.asarray(im, dtype=np.float32) / 255.0)[None, ...]
labels = json.loads(Path("labels.json").read_text(encoding="utf-8"))
it = tf.lite.Interpreter(model_path="model.tflite")
it.allocate_tensors()
inp, out = it.get_input_details()[0], it.get_output_details()[0]
it.set_tensor(inp["index"], preprocess_centercrop("leaf.jpg", labels["imgsz"]))
it.invoke()
p = it.get_tensor(out["index"])[0]
i = int(p.argmax())
print(labels["names"][i], float(p[i]))
KrishokChat Bengali advisory LLM / RAG is not this classifier. See RaiyanKhaan/KrishokChat-Advisory-System and arXiv:2606.29243 (Reza & Shahid).
@software{ahmed2026chashibhai_corn_cls,
author = {Ahmed, Shakil},
title = {ChashiBhAI Corn Disease Classifier},
year = {2026},
url = {https://huggingface.co/Shaq2/chashibhai-corn-disease-cls}
}
MIT (see LICENSE). Ultralytics remains under its own license. This pack redistributes weights, not training images.