DAC-Grad-CAM: Defect-aware explainable AI for automated mango quality classification

Deep learning models achieve high fruit classification accuracy but lack interpretability; standard Grad-CAM produces diffuse attention without defect-specific localization. Existing explainable AI (XAI) methods for fruit grading rely on qualitative visual inspection, offering no quantitative validation of defect alignment, thereby limiting trust and regulatory acceptance in commercial quality control. This study presents an explainable mango classification framework that integrates classification performance with quantitative interpretability analysis through Defect-Aware Contrastive Grad-CAM (DAC-Grad-CAM). A new method that multiplicatively fuses gradient-based attention with an unsupervised LAB color-space bruise prior. A two-stage pipeline combining YOLO-11n detection with four classification architectures (ResNet18, MobileNetV3, VGG16, and a custom CNN). Evaluated on a three-class mango dataset (premium, class 1, class 2). Transfer-learning architectures substantially outperformed the custom CNN (ResNet18: 97.8%, VGG16: 97.6%, MobileNetV3: 96.5% vs 75.4%), a 22–23 percentage-point gap, with premium-class precision > 0.995. DAC-Grad-CAM produced the most concentrated explanations (entropy 10.02 versus 10.27 for Grad-CAM and 10.18 for SHAP). Validated against 50 manually annotated pixel-level bruise masks, it improved peak localization over standard Grad-CAM (pointing-game accuracy 0.561 versus 0.439) and, on the transfer-learning backbones, exceeded SHAP (0.659 versus 0.615) while requiring 34 ms per region against 4220 ms, a 124-fold reduction in cost. The Defect Focus Score (DFS) enabled task-specific validation, and the agreement between gradient and perturbation-based explanations (r = 0.68–0.75, p < 0.001) confirmed that the localized features are task-genuine rather than method-specific artifacts. Under controlled perturbations emulating varied lighting, resolution, defocus, compression, and occlusion, defect-focused attention remained stable while classification accuracy degraded, and end-to-end throughput reached 17.4 fruit s⁻ 1 . The framework supports a confidence-based human-AI workflow (margin > 0.95, DFS > 0.37, r > 0.60) for trustworthy automated quality control in post-harvest operations.

Authors

Institutions

Publication Details

Journal
Computers and Electronics in Agriculture
Published
2026-09-21
DOI
https://doi.org/10.1016/j.compag.2026.112443
Primary Topic
Smart Agriculture and AI
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
article

DAC-Grad-CAM: Defect-aware explainable AI for automated mango quality classification

Zhanjiang Zhu, Shahram Hamza Manzoor, Mustafa Mhamed, Rashed Ahmed et al.
Computers and Electronics in Agriculture
Smart Agriculture and AI
article

DAC-Grad-CAM: Defect-aware explainable AI for automated mango quality classification

Zhanjiang Zhu, Shahram Hamza Manzoor, Mustafa Mhamed, Rashed Ahmed, Noor Gul, Arshed Ahmed, Zhao Zhang, Ming Li, Bing Liu, Mahmoud A. Abdelhamid
article en

Abstract

Deep learning models achieve high fruit classification accuracy but lack interpretability; standard Grad-CAM produces diffuse attention without defect-specific localization. Existing explainable AI (XAI) methods for fruit grading rely on qualitative visual inspection, offering no quantitative validation of defect alignment, thereby limiting trust and regulatory acceptance in commercial quality control. This study presents an explainable mango classification framework that integrates classification performance with quantitative interpretability analysis through Defect-Aware Contrastive Grad-CAM (DAC-Grad-CAM). A new method that multiplicatively fuses gradient-based attention with an unsupervised LAB color-space bruise prior. A two-stage pipeline combining YOLO-11n detection with four classification architectures (ResNet18, MobileNetV3, VGG16, and a custom CNN). Evaluated on a three-class mango dataset (premium, class 1, class 2). Transfer-learning architectures substantially outperformed the custom CNN (ResNet18: 97.8%, VGG16: 97.6%, MobileNetV3: 96.5% vs 75.4%), a 22–23 percentage-point gap, with premium-class precision > 0.995. DAC-Grad-CAM produced the most concentrated explanations (entropy 10.02 versus 10.27 for Grad-CAM and 10.18 for SHAP). Validated against 50 manually annotated pixel-level bruise masks, it improved peak localization over standard Grad-CAM (pointing-game accuracy 0.561 versus 0.439) and, on the transfer-learning backbones, exceeded SHAP (0.659 versus 0.615) while requiring 34 ms per region against 4220 ms, a 124-fold reduction in cost. The Defect Focus Score (DFS) enabled task-specific validation, and the agreement between gradient and perturbation-based explanations (r = 0.68–0.75, p < 0.001) confirmed that the localized features are task-genuine rather than method-specific artifacts. Under controlled perturbations emulating varied lighting, resolution, defocus, compression, and occlusion, defect-focused attention remained stable while classification accuracy degraded, and end-to-end throughput reached 17.4 fruit s⁻ 1 . The framework supports a confidence-based human-AI workflow (margin > 0.95, DFS > 0.37, r > 0.60) for trustworthy automated quality control in post-harvest operations.

Computers and Electronics in AgricultureVol. 256
Ain Shams University (EG), University of Peshawar (PK), Inner Mongolia Academy of Agricultural & Animal Husbandry Sciences (CN), Xinjiang Academy of Agricultural Sciences (CN), Sanya University (CN), China Agricultural University (CN)
Openalex Percentile: Top 13%
Smart Agriculture and AI
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.