Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- image-classification
|
| 4 |
+
- agriculture
|
| 5 |
+
- plant-disease
|
| 6 |
+
- efficientnet
|
| 7 |
+
- human-in-the-loop
|
| 8 |
+
- uncertainty-quantification
|
| 9 |
+
datasets:
|
| 10 |
+
- plantvillage
|
| 11 |
+
metrics:
|
| 12 |
+
- accuracy
|
| 13 |
+
- f1
|
| 14 |
+
license: cc-by-nc-sa-4.0
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# HITL-CNN: Human-in-the-Loop Crop Disease Diagnosis Model
|
| 18 |
+
|
| 19 |
+
An EfficientNet-B4-based convolutional neural network for crop disease
|
| 20 |
+
classification, combined with Monte Carlo Dropout uncertainty
|
| 21 |
+
quantification and a confidence-threshold-based Human-in-the-Loop (HITL)
|
| 22 |
+
referral mechanism. Developed as part of an MRes dissertation at the
|
| 23 |
+
University of Greater Manchester.
|
| 24 |
+
|
| 25 |
+
**Live demo:** hitl-crop-diagnosis.streamlit.app
|
| 26 |
+
**Code:** [repository link]
|
| 27 |
+
|
| 28 |
+
## Model Description
|
| 29 |
+
|
| 30 |
+
- **Architecture:** EfficientNet-B4, ImageNet-pretrained backbone
|
| 31 |
+
- **Input:** 224×224 RGB leaf images
|
| 32 |
+
- **Output:** 38-class disease/healthy classification across 14 crop species
|
| 33 |
+
- **Uncertainty quantification:** Monte Carlo Dropout (T=50 stochastic
|
| 34 |
+
passes, p=0.1), with post-hoc temperature scaling for calibration
|
| 35 |
+
- **Referral mechanism:** predictions with entropy above a calibrated
|
| 36 |
+
threshold (θ=0.45 bits) are flagged for expert review rather than
|
| 37 |
+
auto-classified
|
| 38 |
+
|
| 39 |
+
## Training Data
|
| 40 |
+
|
| 41 |
+
Trained on the [PlantVillage dataset](https://www.kaggle.com/datasets/emmarex/plantdisease)
|
| 42 |
+
(Hughes and Salathé, 2015), 54,305 images across 38 classes, licensed
|
| 43 |
+
CC BY-NC-SA 4.0. Split 70/15/15 (train/val/test), stratified, seed=42.
|
| 44 |
+
|
| 45 |
+
## Training Procedure
|
| 46 |
+
|
| 47 |
+
Two-stage fine-tuning: Stage 1 trains the classification head only
|
| 48 |
+
(Adam, lr=1e-3, 2 epochs); Stage 2 fine-tunes the full network (Adam,
|
| 49 |
+
lr=1e-4, ReduceLROnPlateau scheduler, early stopping patience=5).
|
| 50 |
+
Training converged at epoch 19 (best checkpoint epoch 14).
|
| 51 |
+
|
| 52 |
+
## Evaluation Results
|
| 53 |
+
|
| 54 |
+
Evaluated on a held-out test set of 8,146 images.
|
| 55 |
+
|
| 56 |
+
| Metric | Value |
|
| 57 |
+
|---|---|
|
| 58 |
+
| Accuracy | 99.69% |
|
| 59 |
+
| Macro F1 | 0.9943 |
|
| 60 |
+
| Macro Precision | 0.9946 |
|
| 61 |
+
| Macro Recall | 0.9941 |
|
| 62 |
+
| AUC-ROC (macro) | 1.0000 |
|
| 63 |
+
| ECE (post-calibration) | 0.0025 |
|
| 64 |
+
| HITL Referral Rate | 2.6% |
|
| 65 |
+
| Error Capture Rate | 88.0% |
|
| 66 |
+
|
| 67 |
+
A controlled, protocol-matched comparison against a self-trained
|
| 68 |
+
ResNet-50 baseline found ResNet-50 achieved marginally but statistically
|
| 69 |
+
significantly higher accuracy (99.84% vs. 99.69%, McNemar's p=0.0227).
|
| 70 |
+
This model's contribution is not claimed to rest on superior raw
|
| 71 |
+
accuracy, but on the combination of near-ceiling accuracy with the
|
| 72 |
+
calibrated HITL referral mechanism described above.
|
| 73 |
+
|
| 74 |
+
## Limitations
|
| 75 |
+
|
| 76 |
+
- Trained and evaluated exclusively on laboratory-condition images;
|
| 77 |
+
no field-condition accuracy figure has been obtained
|
| 78 |
+
- The Monte Carlo Dropout uncertainty pass (T=50) requires
|
| 79 |
+
approximately 10 seconds per prediction on CPU, a real constraint
|
| 80 |
+
for real-time or low-connectivity
|