File size: 1,707 Bytes
5125faf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
library_name: pytorch
pipeline_tag: image-classification
tags:
  - efficientnet
  - efficientnet-b3
  - plant-classification
  - agriculture
---

# Plant Classifier — EfficientNet-B3, 39 classes

Frozen PyTorch checkpoint for plant/crop classification. The model was trained with supervised contrastive pretraining, cross-entropy fine-tuning, and TrivialAugment.

## Intended use

The model predicts the plant identity before a crop-specific disease detector and recommendation system. It is a plant classifier, not a disease classifier.

## Input preprocessing

- Convert the image to RGB.
- Resize the longest side to 380 pixels while preserving aspect ratio.
- Pad to 380 × 380 with black pixels.
- Normalize with ImageNet mean `(0.485, 0.456, 0.406)` and standard deviation `(0.229, 0.224, 0.225)`.
- Do not apply training augmentation during inference.

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"]`.

For confidence scores, apply softmax directly to the logits. The deployed API intentionally uses raw, uncalibrated probabilities.

## Frozen evaluation

| Metric | Result |
|---|---:|
| Validation macro F1 | 0.933455 |
| Test macro F1 | 0.929491 |
| Test macro recall | 0.930658 |
| Test accuracy | 0.931547 |
| Test top-3 accuracy | 0.981436 |

## Files

- `model.pt`: frozen EfficientNet-B3 checkpoint.
- `class_to_idx.json`: authoritative output-index mapping.
- `model_config.json`: architecture and preprocessing contract.
- `SHA256SUMS`: checkpoint integrity checksum.
- `FROZEN_MODEL.md`: frozen-run provenance and metrics.