SAAIL Lab SAAIL Lab
ETRI Journal 48(5) · 2026 SCI Q2 · IF 1.6 1+ Citations Published · Q2 SCI · Vol. 48(5)

Explainable AI for clove quality grading: Benchmarking post hoc XAI and compositional interpretability under domain shift

1School of Engineering and Science, Indian Institute of Technology Madras Zanzibar, Tanzania
2Wadhwani School of Data Science and AI (WSDSAI), Indian Institute of Technology Madras, Chennai, India
ETRI Journal, Vol. 48, No. 5, pp. 911-923 (Wiley / ETRI) (Oct 2026)
Explainable AI for clove quality grading: Benchmarking post hoc XAI and compositional interpretability under domain shift

Summary: Compositional vs. post hoc XAI evaluation framework on 4,603 ZSTC clove images: U-Net foreground segmentation (Dice = 0.9505) coupled with ResNet-18 attribute grading yields 99.45% macro-F1 and 100% Explanation Evidence Ratio (EER) by architectural design.

Abstract

Reliable agricultural commodity grading requires accuracy and explanations that match regulatory criteria. Using 4,603 expert-graded clove images across four Zanzibar State Trading Corporation (ZSTC) quality grades, we benchmark post hoc explainable artificial intelligence (XAI) methods including Grad-CAM, LIME, and GradientSHAP across eight CNN and Vision Transformer architectures and compare them with a compositional segmentation-classification pipeline. All eight monolithic architectures achieve 99.48% to 99.85% test F1-score, yet their Explanation Evidence Ratio (EER) varies sharply from 33.4% to 82.4%, while domain-shift F1 drops range from 6.7 to 86.5 percentage points. By isolating clove foregrounds prior to attribute grading via U-Net segmentation (Dice 0.9505) and ZSTC mpeta percentage rules, the compositional pipeline achieves 99.45% F1 with 100% EER by design and receives unanimous preference from three certified ZSTC inspectors.

Keywords: explainable AIclove quality gradingZSTCcompositional interpretabilityExplanation Evidence Ratiodomain shiftETRI Journal

Key Findings & Contributions

99.45%
Compositional F1
100% EER by design
33.4-82.4%
Post Hoc EER Range
High accuracy hides shift risk
86.5 pp
Max Shift F1 Drop
EfficientNet-B0 on bg shift
3/3
ZSTC Expert Preference
Unanimous certified graders
  1. Introduced the Explanation Evidence Ratio (EER) to measure what fraction of a visual attribution heatmap actually falls inside annotated clove foreground masks rather than spurious tray background.
  2. Benchmarked eight deep architectures (ResNet-18/50, DenseNet-121/201, EfficientNet-B0/B2, DeiT-Base, Swin-Base) across 4,603 ZSTC images, proving that >99.4% clean F1 masks severe EER spread (33.4% DeiT Grad-CAM to 81.9% Swin SHAP) and runtime bottlenecks (up to 26.1 s/image for SHAP).
  3. Quantified background domain-shift robustness across all eight monolithic backbones, uncovering F1 collapses of 53.7 pp (EfficientNet-B2) to 86.5 pp (EfficientNet-B0) despite near-100% in-domain scores.
  4. Built and validated a compositional U-Net (Dice 0.9505) + ResNet-18 rule-aligned grading pipeline achieving 99.45% F1, guaranteed 100% EER, and unanimous approval from three certified ZSTC clove graders.

Key Empirical Figure

Correlation between Explanation Evidence Ratio (EER) and classification F1 retention under acquisition domain shift across eight deep architectures.
Correlation between Explanation Evidence Ratio (EER) and classification F1 retention under acquisition domain shift across eight deep architectures.

Benchmark Results

In-Domain Clove Grading Classification Benchmark (N = 4,603 Images, 4 ZSTC Grades)

ArchitectureParams (M)F1 (%)Precision (%)Recall (%)
DenseNet-20120.099.8599.8499.86
Swin-Base88.099.7999.7699.81
DenseNet-1218.099.7699.7799.75
ResNet-5025.699.7499.7599.73
DeiT-Base86.699.7099.7099.70
ResNet-1811.799.5899.5899.59
EfficientNet-B05.399.5399.5599.50
EfficientNet-B29.299.4899.4899.47
Compositional (U-Net + ResNet-18)13.299.4599.4599.45

Post Hoc XAI Faithfulness (EER %) & Inference Time per Image (s)

ArchitectureGrad-CAM EER (%)Grad-CAM Time (s)LIME EER (%)LIME Time (s)SHAP EER (%)SHAP Time (s)
Swin-Base73.60.02881.15.881.926.1
DeiT-Base33.40.00782.45.365.424.1
DenseNet-12165.70.04974.42.066.05.1
ResNet-5071.20.02071.62.064.54.8
ResNet-1869.40.00957.91.766.83.2
DenseNet-20162.90.08956.22.370.06.8
EfficientNet-B260.30.03748.51.960.44.5
EfficientNet-B043.80.02941.91.861.43.7

BibTeX

@article{nyalala2026etri_clove_xai,
  title={Explainable AI for clove quality grading: Benchmarking post hoc XAI and compositional interpretability under domain shift},
  author={Nyalala, Innocent and Ndowo, Patrick Vincent},
  journal={ETRI Journal},
  volume={48},
  number={5},
  pages={911--923},
  year={2026},
  doi={10.4218/etrij.2026-0225}
}
APA Citation

Nyalala, I., & Ndowo, P. V. (2026). Explainable AI for clove quality grading: Benchmarking post hoc XAI and compositional interpretability under domain shift. ETRI Journal, 48(5), 911-923. https://doi.org/10.4218/etrij.2026-0225