Explainable AI for clove quality grading: Benchmarking post hoc XAI and compositional interpretability under domain shift
Abstract Reliable agricultural commodity grading requires accuracy and explanations that match regulatory criteria. Using 4603 expert‐graded clove images across four Zanzibar State Trading Corporation (ZSTC) quality grades, we benchmark seven post hoc explainable artificial intelligence (XAI) methods (Grad‐CAM, Grad‐CAM++, ScoreCAM, LIME, GradientSHAP, CLS‐Attention, and Chefer LRP) across eight CNN/ViT architectures and compare them with a compositional segmentation–classification pipeline that builds interpretability into the model. We propose the Explanation Energy Ratio (EER) to quantify foreground‐aligned explanations using ground‐truth masks. EER varies widely by architecture explainer, with different explainers yielding different results for the same classifier. Under a synthetic background‐replacement domain shift, robustness differs despite similar in‐domain performance. LIME performs well on transformers but is slow; SHAP is too costly for edge use. The compositional pipeline achieves 99.45% F1 with 100% EER by design and is preferred by certified ZSTC graders for regulatory auditing.
Authors
- Innocent Nyalala (ORCID: https://orcid.org/0000-0002-7969-437X)
- Patrick Vincent Ndowo
Institutions
- Indian Institute of Technology Madras (IN)
- Zanzibar University (TZ)
- Zanzibar School of Health (TZ)
Publication Details
- Journal
- ETRI Journal
- Published
- 2026-09-15
- DOI
- https://doi.org/10.4218/etrij.2026-0225
- Primary Topic
- Explainable Artificial Intelligence (XAI)
- Type
- article
- Field-Weighted Citation Impact
- 0.00