Add classifier metadata and model card
Browse filesDocument the frozen EfficientNet-B3 architecture, exact preprocessing, 39-class index mapping, raw-softmax inference contract, evaluation metrics, and checkpoint checksum.
- FROZEN_MODEL.md +13 -0
- README.md +51 -0
- SHA256SUMS +1 -0
- class_to_idx.json +41 -0
- model_config.json +16 -0
FROZEN_MODEL.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Frozen EfficientNet-B3 V7 SupCon Model
|
| 2 |
+
|
| 3 |
+
- Frozen: 2026-07-23
|
| 4 |
+
- Classes: 39
|
| 5 |
+
- Training: SupCon (10 epochs), cross-entropy, TrivialAugment, batch size 64
|
| 6 |
+
- Source run: `outputs/efficientnet_b3_40class_v7/efficientnet_b3_v7_supcon_apricot_plum_batch64`
|
| 7 |
+
- Validation macro F1: 0.9334550210
|
| 8 |
+
- Test macro F1: 0.9294910622
|
| 9 |
+
- Test macro recall: 0.9306576725
|
| 10 |
+
- Test accuracy: 0.9315465831
|
| 11 |
+
- Test top-3 accuracy: 0.9814363615
|
| 12 |
+
|
| 13 |
+
This is a read-only frozen model snapshot. Do not use it as a training or evaluation output directory.
|
README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: pytorch
|
| 3 |
+
pipeline_tag: image-classification
|
| 4 |
+
tags:
|
| 5 |
+
- efficientnet
|
| 6 |
+
- efficientnet-b3
|
| 7 |
+
- plant-classification
|
| 8 |
+
- agriculture
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# Plant Classifier — EfficientNet-B3, 39 classes
|
| 12 |
+
|
| 13 |
+
Frozen PyTorch checkpoint for plant/crop classification. The model was trained with supervised contrastive pretraining, cross-entropy fine-tuning, and TrivialAugment.
|
| 14 |
+
|
| 15 |
+
## Intended use
|
| 16 |
+
|
| 17 |
+
The model predicts the plant identity before a crop-specific disease detector and recommendation system. It is a plant classifier, not a disease classifier.
|
| 18 |
+
|
| 19 |
+
## Input preprocessing
|
| 20 |
+
|
| 21 |
+
- Convert the image to RGB.
|
| 22 |
+
- Resize the longest side to 380 pixels while preserving aspect ratio.
|
| 23 |
+
- Pad to 380 × 380 with black pixels.
|
| 24 |
+
- Normalize with ImageNet mean `(0.485, 0.456, 0.406)` and standard deviation `(0.229, 0.224, 0.225)`.
|
| 25 |
+
- Do not apply training augmentation during inference.
|
| 26 |
+
|
| 27 |
+
The checkpoint contains `model` and `class_to_idx`. Reconstruct `torchvision.models.efficientnet_b3(weights=None)`, replace the final classifier with a 39-output linear layer, and load `checkpoint["model"]`.
|
| 28 |
+
|
| 29 |
+
For confidence scores, apply softmax directly to the logits. The deployed API intentionally uses raw, uncalibrated probabilities.
|
| 30 |
+
|
| 31 |
+
## Frozen evaluation
|
| 32 |
+
|
| 33 |
+
| Metric | Result |
|
| 34 |
+
|---|---:|
|
| 35 |
+
| Validation macro F1 | 0.933455 |
|
| 36 |
+
| Test macro F1 | 0.929491 |
|
| 37 |
+
| Test macro recall | 0.930658 |
|
| 38 |
+
| Test accuracy | 0.931547 |
|
| 39 |
+
| Test top-3 accuracy | 0.981436 |
|
| 40 |
+
|
| 41 |
+
## Files
|
| 42 |
+
|
| 43 |
+
- `model.pt`: frozen EfficientNet-B3 checkpoint.
|
| 44 |
+
- `class_to_idx.json`: authoritative output-index mapping.
|
| 45 |
+
- `model_config.json`: architecture and preprocessing contract.
|
| 46 |
+
- `SHA256SUMS`: checkpoint integrity checksum.
|
| 47 |
+
- `FROZEN_MODEL.md`: frozen-run provenance and metrics.
|
| 48 |
+
|
| 49 |
+
## Limitations
|
| 50 |
+
|
| 51 |
+
Predictions outside the 39 supported classes are not reliable. Confidence values are not calibrated and should not be interpreted as guaranteed probabilities. Validate performance on the intended camera, geography, crop stage, and image composition before production use.
|
SHA256SUMS
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
fb317e79f1944a992ce278967618373d82eb8d25e27b0b6ae7a240b43a6ffd82 model.pt
|
class_to_idx.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"tomato": 0,
|
| 3 |
+
"potato": 1,
|
| 4 |
+
"pepper": 2,
|
| 5 |
+
"grapevine": 3,
|
| 6 |
+
"citrus": 4,
|
| 7 |
+
"olive": 5,
|
| 8 |
+
"wheat": 6,
|
| 9 |
+
"fig": 7,
|
| 10 |
+
"aloe_vera": 8,
|
| 11 |
+
"apricot": 9,
|
| 12 |
+
"areca_palm": 10,
|
| 13 |
+
"basil": 11,
|
| 14 |
+
"bay_laurel": 12,
|
| 15 |
+
"bougainvillea": 13,
|
| 16 |
+
"cactus": 14,
|
| 17 |
+
"camellia_japonica": 15,
|
| 18 |
+
"chamomile": 16,
|
| 19 |
+
"hibiscus": 17,
|
| 20 |
+
"lavender": 18,
|
| 21 |
+
"lemon_balm": 19,
|
| 22 |
+
"mint": 20,
|
| 23 |
+
"monstera": 21,
|
| 24 |
+
"mulberry": 22,
|
| 25 |
+
"oleander": 23,
|
| 26 |
+
"orchid": 24,
|
| 27 |
+
"peace_lily": 25,
|
| 28 |
+
"peperomia": 26,
|
| 29 |
+
"plum": 27,
|
| 30 |
+
"pomegranate": 28,
|
| 31 |
+
"rose": 29,
|
| 32 |
+
"rosemary": 30,
|
| 33 |
+
"rubber_plant": 31,
|
| 34 |
+
"scented_geranium": 32,
|
| 35 |
+
"snake_plant": 33,
|
| 36 |
+
"spider_plant": 34,
|
| 37 |
+
"strawberry": 35,
|
| 38 |
+
"thyme": 36,
|
| 39 |
+
"tulip": 37,
|
| 40 |
+
"zz_plant": 38
|
| 41 |
+
}
|
model_config.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architecture": "torchvision.models.efficientnet_b3",
|
| 3 |
+
"checkpoint_file": "model.pt",
|
| 4 |
+
"state_dict_key": "model",
|
| 5 |
+
"class_mapping_key": "class_to_idx",
|
| 6 |
+
"num_classes": 39,
|
| 7 |
+
"image_size": 380,
|
| 8 |
+
"resize": "longest_side",
|
| 9 |
+
"preserve_aspect_ratio": true,
|
| 10 |
+
"padding": "center_black_to_square",
|
| 11 |
+
"color_mode": "RGB",
|
| 12 |
+
"normalization_mean": [0.485, 0.456, 0.406],
|
| 13 |
+
"normalization_std": [0.229, 0.224, 0.225],
|
| 14 |
+
"confidence": "raw_softmax",
|
| 15 |
+
"calibrated": false
|
| 16 |
+
}
|