Explainable VGG16 transfer learning with SHAP and grad-CAM for wax moth pest and infestation detection in honeybee apiaries using imaging data

This study presents an adaptive framework for the incipient detection of wax moth (Galleria mellonella) outbreaks in honeybee hives by integrating deep learning and machine learning within smart farming systems. A custom dataset of 3252 high-resolution images collected from honey bee apiaries in Rahim Yar Khan, Pakistan (May–August 2024) encompasses labeled samples of healthy hives and infestation, further categorized into stages (Larva, Pupa, and Adult), enabling hierarchical classification as Main and Subclass. Features were extracted incorporating Transfer Learning with a pre-trained VGG16 network, followed by training classical and ensemble machine learning classifiers, comprising Random Forest, Logistic Regression, Support Vector Machine, K-Nearest Neighbours, and advanced Voting and Stacking ensembles. Performance was evaluated utilizing quantitative measures, notably accuracy, precision, recall, F1-score, specificity, MCC, and ROC AUC, with validation via ten-fold cross-validation. For Main class, the proposed XAI-HoneyNet ensemble attained test accuracy of 0.99, ROC AUC of 0.9994, and mean tenfold cross-validation accuracy of 0.9892. Alongside this, Cohen’s Kappa was 0.9719, the one-sample t-test yielded $$t = 225.8625$$ ($$p < 0.0001$$), and the ANOVA comparing Voting and Stacking classifiers reported $$F = 0.0184$$ ($$p = 0.8936$$). For subclass categorization, XAI-PestNet secured 96% accuracy with strong MCC and ROC AUC scores. To ensure model transparency and interpretability, SHapley Additive exPlanations (SHAP) and Gradient-weighted Class Activation Mapping (Grad-CAM) were employed, showcasing critical features and visual cues that drove predictions. To conclude, the proposed XAI-HoneyNet and XAI-PestNet offer a smart hybrid explainable AI framework for hierarchical infestation detection and pest classification in precision agriculture.

Authors

Institutions

Publication Details

Journal
Scientific Reports
Published
2026-03-17
DOI
https://doi.org/10.1038/s41598-026-43455-2
Primary Topic
Insect and Pesticide Research
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Explainable VGG16 transfer learning with SHAP and grad-CAM for wax moth pest and infestation detection in honeybee apiaries using imaging data

Muhammad Umair Majid, Syed Rizwan hassan, Syed Ali Jafar Zaidi, Attia Ghafoor et al.
Scientific Reports
Insect and Pesticide Research
article

Explainable VGG16 transfer learning with SHAP and grad-CAM for wax moth pest and infestation detection in honeybee apiaries using imaging data

Muhammad Umair Majid, Syed Rizwan hassan, Syed Ali Jafar Zaidi, Attia Ghafoor, Madiha Amjad, Kashif Munir, Mohamad Khairi Ishak, Muhammad Wajid
article en

Abstract

This study presents an adaptive framework for the incipient detection of wax moth (Galleria mellonella) outbreaks in honeybee hives by integrating deep learning and machine learning within smart farming systems. A custom dataset of 3252 high-resolution images collected from honey bee apiaries in Rahim Yar Khan, Pakistan (May–August 2024) encompasses labeled samples of healthy hives and infestation, further categorized into stages (Larva, Pupa, and Adult), enabling hierarchical classification as Main and Subclass. Features were extracted incorporating Transfer Learning with a pre-trained VGG16 network, followed by training classical and ensemble machine learning classifiers, comprising Random Forest, Logistic Regression, Support Vector Machine, K-Nearest Neighbours, and advanced Voting and Stacking ensembles. Performance was evaluated utilizing quantitative measures, notably accuracy, precision, recall, F1-score, specificity, MCC, and ROC AUC, with validation via ten-fold cross-validation. For Main class, the proposed XAI-HoneyNet ensemble attained test accuracy of 0.99, ROC AUC of 0.9994, and mean tenfold cross-validation accuracy of 0.9892. Alongside this, Cohen’s Kappa was 0.9719, the one-sample t-test yielded $$t = 225.8625$$ ($$p < 0.0001$$), and the ANOVA comparing Voting and Stacking classifiers reported $$F = 0.0184$$ ($$p = 0.8936$$). For subclass categorization, XAI-PestNet secured 96% accuracy with strong MCC and ROC AUC scores. To ensure model transparency and interpretability, SHapley Additive exPlanations (SHAP) and Gradient-weighted Class Activation Mapping (Grad-CAM) were employed, showcasing critical features and visual cues that drove predictions. To conclude, the proposed XAI-HoneyNet and XAI-PestNet offer a smart hybrid explainable AI framework for hierarchical infestation detection and pest classification in precision agriculture.

Scientific Reports
Gachon University (KR), University of Sharjah (AE), Khwaja Fareed University of Engineering and Information Technology (PK)
Zero hunger
Openalex Percentile: Top 25%
Insect and Pesticide Research
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.