Views
No views yet
| 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 |
1import tensorflow as tf
2import numpy as np
3from tensorflow.keras.preprocessing import image
4# Load model
5model = tf.keras.models.load_model("last_40_layers_dense_batchnorm.keras")
6class_names = ['Aloe Vera', 'Neem', 'Tulsi'] # alphabetical order
7def predict(img_path):
8 img = image.load_img(img_path, target_size=(224, 224))
9 img_array = image.img_to_array(img)
10 img_array = np.expand_dims(img_array, axis=0) # shape: (1, 224, 224, 3)
11 pred = model.predict(img_array)[0]
12 pred_class = class_names[np.argmax(pred)]
13 confidence = float(np.max(pred))
14 return pred_class, confidence
15label, conf = predict("your_leaf_image.jpg")
16print(f"Prediction: {label} ({conf:.2%} confidence)")GlobalAveragePooling2D → Dropout(0.2) → Dense(3, softmax) + BatchNorm variant