Downloads · 30 days
0
FarmGuard/tomato-variant-a-efficientnet-v2-s
tomato-variant-a-efficientnet-v2-s is a image classification model from FarmGuard. Use it when you need a label for an image. It is set up for pytorch. The card lists the license as mit.
A 7-class tomato leaf disease image classification model trained with PyTorch and torchvision.
Downloads · 30 days
0
Access
Public
Updated Sep 10, 2026
Repo size
81.7 MB
Likes
0
Public
Click a slice to open those files.
.pt81.7 MB · 100%
From the Hugging Face model README
A 7-class tomato leaf disease image classification model trained with PyTorch and torchvision.
efficientnet_v2_s_seed42_20260910-042630| ID | Class |
|---|---|
| 0 | Early_blight |
| 1 | Healthy |
| 2 | Late_blight |
| 3 | Leaf Miner |
| 4 | Magnesium Deficiency |
| 5 | Nitrogen Deficiency |
| 6 | Spotted Wilt Virus |
| Metric | Score |
|---|---|
| Test Accuracy | 97.87% |
| Test Macro F1 | 97.20% |
| Test Macro Precision | 96.87% |
| Test Macro Recall | 97.58% |
| Test Weighted F1 | 97.88% |
| Best Validation Accuracy | 95.95% |
| Best Validation Macro F1 | 94.80% |
Dataset ID: tomato_variant_a_multiclass
The dataset uses pre-existing train/validation/test splits. No random re-split was performed.
The Pottassium Deficiency class was removed before this final 7-class training run. Older 8-class checkpoints are incompatible with this class mapping.
Validation and test:
Resize(256)
CenterCrop(224)
ToTensor()
Normalize(
mean=(0.485, 0.456, 0.406),
std=(0.229, 0.224, 0.225)
)
Training used online augmentation including random resized crops, flips, rotation, affine transforms, color jitter, and random grayscale.
1e-40.050.0542Install dependencies:
pip install torch torchvision pillow
Run inference:
python inference.py path/to/tomato_leaf.jpg
Example output:
Prediction: Healthy
Confidence: 93.45%
| Class | Recall |
|---|---|
| Early_blight | 100.0% |
| Healthy | 95.1% |
| Late_blight | 98.4% |
| Leaf Miner | 97.1% |
| Magnesium Deficiency | 100.0% |
| Nitrogen Deficiency | 100.0% |
| Spotted Wilt Virus | 92.5% |
The weakest test-set class was Spotted Wilt Virus, with approximately 92.5% recall.
The main observed confusions were Spotted Wilt Virus with Late_blight and Leaf Miner, and Healthy with Leaf Miner.
The model was trained and evaluated on a specific tomato leaf image dataset. Performance may differ under different cameras, lighting conditions, cultivars, field environments, image quality, or unseen diseases.
This model is intended for research and experimental use and should not be treated as a definitive agricultural diagnosis.
Original training run:
efficientnet_v2_s_seed42_20260910-042630
Framework:
PyTorch + torchvision
The repository contains the trained checkpoint, class mapping, metadata, and inference script.
MIT