Downloads · 30 days
0
poojan-s/mobilenetv3-medicinal-laef-classification
mobilenetv3-medicinal-laef-classification is a image classification model from poojan-s. Use it when you need a label for an image. It is set up for tf-keras. The card lists the license as mit.
A fine-tuned MobileNetV3Large model that classifies images of medicinal plant leaves into 3 categories: Aloe Vera, Neem, and Tulsi. ⚠️ Important: Class order is alphabetical — ['Aloe Vera', 'Neem', 'Tulsi']. Use this…
Downloads · 30 days
0
Access
Public
Updated Jul 19, 2026
Repo size
336 MB
Likes
0
Public
Click a slice to open those files.
.keras193 MB · 57%
From the Hugging Face model README
A fine-tuned MobileNetV3Large model that classifies images of medicinal plant leaves into 3 categories: Aloe Vera, Neem, and Tulsi.
| Property | Value |
|---|---|
| Base Model | MobileNetV3Large (ImageNet weights) |
| Framework | TensorFlow / Keras |
| Input Size | 224 × 224 × 3 |
| Output Classes | 3 (Aloe Vera, Neem, Tulsi) |
| Format | .keras (Keras native) |
| Index | Class |
|---|---|
| 0 | Aloe Vera |
| 1 | Neem |
| 2 | Tulsi |
⚠️ Important: Class order is alphabetical —
['Aloe Vera', 'Neem', 'Tulsi']. Use this exact order when decoding predictions.
| Model Variant | Accuracy |
|---|---|
last_40_dense_batchnorm ⭐ | 99% |
last_100_layers_more_layers ⭐ | 99% |
last_20 | 88% |
last_40_d05 | 88% |
last_100_d05 | 86% |
last_40 | 85% |
Best model (last_40_dense_batchnorm) — classification report: | |
| Class | Precision |
| ------- | ----------- |
| Aloe Vera | 1.00 |
| Neem | 0.99 |
| Tulsi | 1.00 |
| Overall | 0.99 |
import tensorflow as tf
import numpy as np
from tensorflow.keras.preprocessing import image
# Load model
model = tf.keras.models.load_model("last_40_layers_dense_batchnorm.keras")
class_names = ['Aloe Vera', 'Neem', 'Tulsi'] # alphabetical order
def predict(img_path):
img = image.load_img(img_path, target_size=(224, 224))
img_array = image.img_to_array(img)
img_array = np.expand_dims(img_array, axis=0) # shape: (1, 224, 224, 3)
pred = model.predict(img_array)[0]
pred_class = class_names[np.argmax(pred)]
confidence = float(np.max(pred))
return pred_class, confidence
label, conf = predict("your_leaf_image.jpg")
print(f"Prediction: {label} ({conf:.2%} confidence)")
GlobalAveragePooling2D → Dropout(0.2) → Dense(3, softmax) + BatchNorm variant