Overview
- Tasks
- 4
- Images
- 17,467
- Benchmark
- 16
- Paired test
- 100.0%
20 / 19 / 5 / 8 classes
across four task datasets
experiments · four backbones
Macro-F1 · n = 387
The 100.0% result is population-specific; see Scope and Limitations.
Abstract
Mango variety and disease recognition are usually studied one view at a time. This thesis benchmarks four classification tasks, selects a common backbone from 16 validation experiments, and compares six unimodal and fusion conditions on documented pairs. The final model, MF-06, reaches 100.0% accuracy and Macro-F1 on a locked 387-pair, 19-class test set; the gain over fruit-only is not statistically significant at α = 0.05.
The four task datasets contain 17,467 images: 6,497 fruit-variety images across 20 classes, 3,070 leaf-variety images across 19 classes, 1,500 fruit-disease images across 5 classes, and 6,400 leaf-disease images across 8 classes. The variety images are primary field data collected in Naogaon, Rajshahi; the disease resources are treated separately. The 16-experiment benchmark selects EfficientNetV2-S as the common backbone, with a mean validation Macro-F1 of 0.97128 and a worst-task value of 0.94211. The multimodal study uses the 19 varieties shared by both variety datasets, with 2,203 training, 385 validation, and 387 held-out pairs.
MF-06 uses frozen EfficientNetV2-S fruit and leaf encoders, 512-dimensional projections, eight-head bidirectional cross-attention, and a 19-class classifier. On the held-out test, fruit-only reaches 98.79% Macro-F1 and leaf-only 92.45%, while MF-06 reaches 100.00%. The improvement over leaf-only is strongly supported; the improvement over fruit-only is not significant at α = 0.05. Under validation-only robustness testing, the worst condition—simultaneous JPEG-50 compression of both modalities—reached 0.990293 Macro-F1 (99.03% retention), and Grad-CAM/Grad-CAM++ analysis covers 19 representative validation cases, one per class. The 100% result is specific to the evaluated 387-pair, 19-class population and is not evidence of unrestricted field performance.
Keywords: Mango variety classification · Mango disease classification · Dual-modality learning · EfficientNetV2-S · Multimodal fusion · Cross-attention · Macro-F1 · Explainable AI · Robustness · Agricultural computer vision
Author contribution: Jakariya Abbas carried out the field dataset collection and the multimodal fusion pipeline.
Datasets
| Task | Classes | Images | Train / Val / Test |
|---|---|---|---|
| Fruit variety | 20 | 6,497 | 4,548 / 977 / 972 |
| Leaf variety | 19 | 3,070 | 2,243 / 419 / 408 |
| Fruit disease | 5 | 1,500 | 1,050 / 226 / 224 |
| Leaf disease | 8 | 6,400 | 4,469 / 954 / 977 |
Task datasets total 17,467 images. The paired multimodal population contains 2,203 training pairs, 385 validation pairs, and 387 held-out test pairs across the 19 varieties shared by both variety datasets.
Variety images are primary field data from Naogaon, Rajshahi. The disease resources are separate; MangoFruitBD is a four-class detection resource and was not substituted into the five-class fruit-disease benchmark.
Methodology
MF-06 uses frozen EfficientNetV2-S fruit and leaf encoders. Each 1280×7×7 feature map is projected to 512 dimensions; the two 49-token sequences are fused with eight-head bidirectional cross-attention (dropout 0.20), mean-pooled, and passed through a 1024 → 512 → 19 classifier. The fusion head has 3,949,587 trainable parameters; the end-to-end model has approximately 44.30M. No post-selection backbone fine-tuning was performed.
Scroll to view the full figure, or open it full size.
Backbone Benchmark
Sixteen validation experiments crossed four tasks with four backbones. EfficientNetV2-S was selected by mean validation Macro-F1, with worst-task Macro-F1 as a secondary criterion. The selection is cross-task rather than universal: EfficientNetV2-S leads both variety tasks, while ConvNeXt V2-Tiny leads both disease tasks.
| Backbone | Mean val Macro-F1 | Worst-task Macro-F1 | Role |
|---|---|---|---|
| EfficientNetV2-S | 0.97128 | 0.94211 | Selected; leads both variety tasks |
| ConvNeXt V2-Tiny | 0.96511 | 0.92024 | Leads both disease tasks |
| DINOv3 ViT-B/16 | 0.95717 | 0.89628 | Third by aggregate |
| MobileNetV4-Medium | 0.93879 | 0.85830 | Fourth by aggregate |
Fusion Results
Validation ablation
Six conditions were compared on the 385-pair validation population. MF-06 was selected before the held-out test was opened.
| ID | Method | Macro-F1 | Fusion params |
|---|---|---|---|
| MF-01 | Fruit-only | 0.993134 | 0 |
| MF-02 | Leaf-only | 0.952770 | 0 |
| MF-03 | Feature concatenation | 0.994579 | 1,848,339 |
| MF-04 | Weighted fusion (0.5 / 0.5) | 0.997074 | 1,586,195 |
| MF-05 | Attention fusion | 0.955549 | 1,849,109 |
| MF-06 | Bidirectional cross-attention | 1.000000 | 3,949,587 |
MF-06 improves over fruit-only by 0.006866 Macro-F1 and over leaf-only by 0.047230.
Locked paired test
The final test population contains 387 pairs across 19 varieties. MF-06 was frozen before evaluation.
| Model | Accuracy | Macro-F1 | 95% CI (Macro-F1) | Errors |
|---|---|---|---|---|
| Fruit-only | 98.7080% | 98.7925% | [97.6776, 99.7576] | 5 |
| Leaf-only | 92.7649% | 92.4524% | [89.6748, 94.9914] | 28 |
| MF-06 (fusion) | 100.0000% | 100.0000% | [100.0000, 100.0000] | 0 |
95% bootstrap CIs from 5,000 stratified iterations. The [1.000000, 1.000000] interval reflects zero observed errors in 387 cases; it should not be read as a guarantee of perfect performance.
Scroll to view the full figure, or open it full size.
Paired statistics
| Comparison | Δ Macro-F1 | McNemar p | Permutation p | Interpretation |
|---|---|---|---|---|
| MF-06 vs fruit-only | +0.012075 | 0.0625 | ≈ 0.05739 | Not significant at α = 0.05 |
| MF-06 vs leaf-only | +0.075476 | ≈ 7.45 × 10⁻⁹ | ≈ 0.00020 | Strongly supported |
The gain over fruit-only is not statistically significant at α = 0.05.
The observed 100% error reduction is not the same as statistical significance. The result applies to the 387-pair, 19-class held-out population under the frozen protocol, not to unrestricted field performance.
Explainability
Grad-CAM and Grad-CAM++ were run on 19 representative validation cases, one per class, all correctly classified. The figure shows the fruit and leaf views for one Amrapali pair. These maps are localization diagnostics, not causal modality-contribution percentages.
Scroll to view the full figure, or open it full size.
Robustness
Robustness testing was validation-only. The strongest degradation occurred under simultaneous JPEG-50 compression of both modalities, where Macro-F1 was 0.990293 and retention was 99.03%. Clean, brightness, blur, and zoom conditions remained near or at 1.0. These are predefined synthetic perturbations; they do not establish robustness to uncontrolled field conditions.
Scope and Limitations
- The 100.0000% result is specific to the 387-pair, 19-class held-out population under the frozen protocol. It is not evidence of unrestricted field performance.
- The variety data are geographically localized to Naogaon, Rajshahi, with a finite number of source groups; external validity is limited.
- The multimodal study is restricted to the 19 varieties shared by both datasets; Lakh_Fazli is excluded from fusion.
- The backbones were frozen during fusion training; the results do not establish gains from end-to-end fine-tuning.
- Robustness tests use predefined synthetic perturbations, not uncontrolled field conditions.
- The 16-experiment benchmark is validation-based. Clean post-freeze task-specific four-task test results remain outstanding in the thesis record; the final held-out test reported here is the paired 19-class evaluation.
Citation and Materials
Galib, A. A., Abbas, J., & Bashir, A. (2026). A Deep Learning Framework for Mango Variety and Disease Classification Using Fruit and Leaf Images: Cross-Task Benchmarking and Multimodal Fusion for Variety Recognition [Bachelor's thesis]. Manarat International University.
Thesis PDF, code, and result artifacts: available on request. Researcher-collected variety data: available on request. Public disease resources: cited in the thesis.


