Skip to main content
Scientific Reports logoLink to Scientific Reports
. 2026 Mar 17;16:13861. doi: 10.1038/s41598-026-43455-2

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

Attia Ghafoor 1,2, Muhammad Majid 3, Madiha Amjad 1, Muhammad Wajid 4, Syed Ali Jafar Zaidi 1, Kashif Munir 1, Mohamad Khairi Ishak 5,✉, Syed Rizwan Hassan 6,✉
PMCID: PMC13128917  PMID: 41844704

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 Inline graphic (Inline graphic), and the ANOVA comparing Voting and Stacking classifiers reported Inline graphic (Inline graphic). 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.

Keywords: Honey yield, Precision agriculture, Machine learning, Ensemble learning, Sustainable agriculture, Biodiversity monitoring

Subject terms: Computational biology and bioinformatics, Ecology, Ecology

Introduction

Background and motivation

The precipitous decline in pollinator populations, markedly the honey bee (Apis mellifera), has cascading impacts that disrupt ecosystem stability, agricultural productivity, and biodiversity conservation1. Apiculture faces escalating threats from parasitic infestation transmitted by wax moths, which constitute a considerable impediment to its sustainability2. The health of pollinators, particularly within managed honey bee apiaries, is indispensable for maintaining ecological balance and supporting food production, underscoring their critical role as key agents of fertilization across diverse agricultural systems worldwide3,4. As the global population continues to rise, the World Health Organization estimates that food production must increase by 70% to meet the needs of nearly 10 billion people by 20505. Despite advances in agricultural technologies, agricultural pests disease still account for 20–40% of annual crop yield losses, resulting in global economic damages of up to $290 billion each year and posing a significant threat to food security6.

Biology and lifecycle of honeybee wax moth

Honey bee populations face increasing threats from environmental stressors comprising, habitat loss, pesticide exposure, climate change, and biological invasions. Among the most damaging biological threats is the Greater Wax Moth (Galleria mellonella), a parasitic species that infiltrates and deteriorates bee colonies7. As a holometabolous insect, it undergoes four progression phases of development including egg, larva, pupa, and adult. Under optimal conditions, the greater wax moth larvae develops rapidly, molting frequently. Once the last instar larvae finish feeding, they exit the honeycomb, construct cocoons, and pupate. The pupal stage lasts from 8 to 50 days, depending on environmental conditions8,9. Adult moths, with non-functional mouthparts, cannot feed and live for 7–30 days, with males typically living longer. After mating, only the females return to the hives to lay their eggs. The full lifecycle spans approximately 30–90 days, influenced by temperature, humidity, and food availability. Further information regarding the biological study can be found in the published literature10.

Between April and September, population levels of Galleria mellonella indicate a surge followed by a gradual decline that continues until March. The larvae feed on beeswax, pollen, and other hive materials, contaminating brood combs and compromising hive structure. The adult wax moth typically targets weaker colonies, particularly those with populations below 20,000 bees, or stored combs during the night. Within the hive, females prefer to lay eggs in protected crevices and fissures of the brood box, and upon hatching, the larvae begin feeding on the wax combs11. As infestation intensifies, the threat of colony collapse becomes critical, gravely disrupting pollination services and threatening agricultural stability. The Galleria mellonella larvae are destructive in nature and feed on wax combs, leading to hive integrity breakdown and colony collapse12. They also act as carriers of pathogens that cause foulbrood diseases13. The destructive effects of these insects are intensified by climatic conditions in warmer regions, leading to the general decline in bee populations. Honey bee diseases are prevalent in agricultural regions of Pakistan. Punjab and Khyber Pakhtunkhwa, where agriculture is closely tied to beekeeping, face significant economic losses. Similarly, wax moth infestation challenges are observed internationally, causing millions of dollars in damages annually in the United States, Europe, and Africa14. Consequently, efficient early detection and management strategies are imperative to protecting pollinators worldwide.

Current challenges in detection and control

As depicted in Fig. 1, existing methods for detecting wax moth invasions heavily rely on manual checks, which are time intensive, subjective, and not always viable, presenting scalability challenges, particularly for remote beekeeping enterprises. These conventional inspection techniques can result in delayed detection, allowing invasions to grow to catastrophic proportions. This draws attention to the pressing demand for a computerized, reliable, and non-invasive detection framework that can identify early symptoms of invasion before irreversible damage occurs. This highlights a fundamental gap in apiculture technology, necessitating a scalable and adaptable detection setup for diverse natural environments and geographic regions. This study introduces an in-depth smart system, XAI-HoneyNet, that utilizes Explainable Artificial Intelligence (XAI) and an ensemble learning approach for prompt identification of infestation and categorization of wax moths in honey bee colonies. Unlike classical black-box AI models, our proposed approach integrates SHAP and Grad-CAM, with the ambition of providing transparency and interpretability to model predictions. This empowers beekeepers and agribusiness participants with the tools to translate diagnostic findings into decisive actions. Additionally, diverse ensemble models, incorporating investigator-designed Voting and Stacking Ensembles, are employed to optimize classification accuracy, robustness, and generalizability under various environmental conditions. The research highlights a novel integration of machine learning, computer vision, and model transparency in a comprehensive strategy for sustainable apiculture and pollinator community preservation.

Fig. 1.

Fig. 1

Exemplification of human-dependent hive inspection for wax moth infestation detection in honeybee apiaries. Honeybee populations remain vulnerable to wax moth infestations, compounded by the constraints of conventional observation frameworks. The figure integrates a real photograph of a honeybee frame under inspection with graphically designed visuals of flying honeybees, prepared by the authors using the Canva design platform.

Problem statement

Wax moth infestations are increasingly becoming a concern in beekeeping due to delayed detection and the lack of scalable diagnostic systems, which can lead to grave economic and ecological losses. The absence of rapid, affordable, and scalable diagnostic tools frequently allows infestations to go unnoticed until irreversible damage occurs. Furthermore, the black-box nature of conventional AI models limits user confidence and real-world adoption, particularly in field-based apicultural environments. Accordingly, there is an urgent need for an interpretable, smart system for early detection of Galleria mellonella using non-invasive imaging modalities that ensures both diagnostic precision and explainability. To the best of our knowledge, no prior study has explicitly focused on the automated detection and classification of Galleria mellonella (wax moth) infestations in honeybee hives using AI-based models. Existing systems primarily target broad-spectrum pests and do not address the specific needs of apicultural monitoring. This establishes the novelty and domain specific relevance of our proposed frameworks. In contrast to prior works, our models introduce a hierarchical classification pipeline tailored specifically for apicultural infestation scenarios. By integrating explainable AI tools encompassing SHAP and Grad-CAM, our approach provides interpretable, biologically aligned insights alongside superior predictive performance. Furthermore, statistical validation through t-tests and ANOVA supports the robustness and generalizability of our results.

Research objectives

This investigation is intended to introduce a groundbreaking, practically applicable model for monitoring wax moth infestation in honey bee (Apis mellifera) apiaries using Artificial Intelligence (AI) and an ensemble learning framework. The proposed approach makes a notable contribution to agricultural development by addressing complex environmental vulnerabilities in honey bee colonies through an integrated approach.

  • Data acquisition and augmentation: To develop a standardized image dataset comprising high-resolution images of honeycomb structures at various stages of infestation, and to apply SMOTE (Synthetic Minority Over sampling Technique) for class disparity alleviation, alongside image data augmentation techniques, to ensure effective model generalizability.

  • Automated detection approach: To introduce a novel AI-powered image analysis framework capable of two-tier classification, including binary classification to distinguish between healthy and infested honeycomb structures, and multiclass classification to accurately identify the developmental stages of wax moth infestation (larva, pupa, and adult). This hierarchical detection strategy reduces reliance on manual inspections and enables early stage, image based diagnosis of infestation.

  • Consolidated approach for designing explainable and accurate AI models: To integrate Explainable AI (XAI) methods, encompassing SHAP and Grad-CAM, to significantly boost model interpretability and facilitate beekeepers in understanding analytically driven insights, unraveling the model’s decision-making workflow. Concurrently, to utilize diverse base learners within advanced ensemble learning techniques (e.g., Voting and Stacking) to enhance reliability, generalizability, and reduce overfitting, ensuring a transparent, robust, and trustworthy system.

  • Evaluation and testing: To quantify the model efficiency of the proposed approach in tracking wax moth infestations under diverse environmental conditions. To evaluate model effectiveness using cross-validation techniques and test real world applicability to assess the proposed system’s utility in preventing colony disorders in practical beekeeping scenarios.

Fundamental research contributions

  • This is the first study to integrate explainable AI in wax moth infestation detection, offering a novel, interpretable approach to an important beekeeping problem.

  • The development of a two-tier classification system for distinguishing between healthy and infested hives and identifying infestation stages.

  • A modular AI framework that can be adapted for other pests and diseases affecting honey bees, providing scalability and broad applicability.

  • This study contributes a labeled image dataset to facilitate subsequent research initiatives and training methodologies.

  • Significant contributions to national and international bee health programs, supporting sustainable apiculture practices and mitigating global threats to pollinator populations.

Literature review

Artificial Intelligence (AI) innovations have revolutionized agriculture, particularly in beekeeping, by significantly improving the precision of pest and disease detection. Machine learning (ML) and deep learning (DL) approaches have transformed bee management practices by accurately identifying Varroa mite infestations and American Foulbrood (AFB) disease. However, despite the growing demand of research, the detection of wax moth infestations which critically undermine hive stability has not yet been comprehensively explored using AI techniques. Given its significant impact on apiculture, the lack of AI-based frameworks for wax moth detection represents a notable research gap. This study reviews the existing literature to identify these gaps and proposes promising directions for future investigation in smart beekeeping systems.

Machine learning applications for infestation and pest categorization in apiculture

Kwadha et al.15 emphasizes the scarcity of scientific research on wax moth infestation dynamics compared to major pests like Varroa destructor and Aethina tumida. Despite posing a substantial threat to apiculture’s health and sustainability, the wax moth has received relatively limited attention. This research gap necessitates focused investigations to develop effective control strategies, with Integrated Pest Management (IPM) being the preferred approach. IPM strategies typically incorporate cultural practices such as sealing hive cracks, maintaining hives, reducing pesticide use, and managing hive products. Although labor-intensive, IPM is widely recommended for its sustainable and environmentally sound outcomes. The study also advocates for large-scale apiaries or regions facing diverse pest pressures to adopt advanced trapping and biological control techniques.

Garcia et al.16 employed decision tree driven machine learning model for analysis of 179 bee colonies in Extremadura, Spain from 2020-2021 to detect contributing of colony diminish including brood abundance, pollen stores, honey storage, Varroa mite and Deformed Wing Virus prevalence. Analysis of 152 bee apiary instances with 15 variables showed substantial mortality 43% and colony disorder rates 51% and 36% in 2020 and 2021 respectively. The predictive model delivers exceptional results by attained precision 0.83%, recall 0.65%, specificity 0.98% on train data, meanwhile achieved precision 0.70%, recall 0.46% and specificity 0.93% on test dataset. These findings provide a data-driven approach to understanding and managing bee colony health, supporting targeted conservation efforts for pollinators. They also Employed SHAP analysis for interpretability analysis. They presents a data-driven framework leveraging SHAP analysis enhanced model interpretability for optimizing pollinator especially honey bee wellbeing and supporting targeted conservation initiatives for pollinators.

To combat Varroosis Mrozek et al.17 proposed an intelligent Edge IoT model that offers monitoring services for Varroa destructor in honey bee apiaries. This cutting edge framework, a hybrid cloud based architecture, integrates TPU-accelerated and pre-trained machine learning approaches to efficiently identify Varroa related disease. Through edge based processing of video feeds, the system alleviates bandwidth and storage demands, thereby streamlining data management. Image resolution variations were found to significantly compromise the real time robustness and quality of Varroosis identification in their experiments. This innovative framework represents a novel advancement in leveraging IoT for honey apiaries, offering an advanced Varroa detection technique aimed at promoting healthier colonies.

Lightweight segmentation models in agriculture and transformer based architectures for pest detection have led to the development of As a lightweight segmentation solution, TinySegformer, a compact segmentation architecture, designed for deployment in edge environments. By integrating Transformers with CNN and employing sparse attention and quantization techniques, the model enhances both segmentation accuracy and computational efficiency Zhang et al. 18. Evaluated on public and custom build datasets, TinySegformer consistently delivers superior results over DeepLab, UNet, SegNet, PSPNet, and FCN. It achieves strong results across key metrics precision (0.92), recall (0.90), accuracy (0.93), mIoU (0.85), and Dice coefficient (0.91) while delivering real time performance (32.7 FPS) on NVIDIA Jetson devices. Optimized through pruning and quantization, TinySegformer offers a robust solution for scalable pest monitoring in precision agriculture.

Ahmad et al. 19 unveiled an innovative IOT-based workflow for integrated pest management in agricultural fields. The system uses a physical prototype of a smart insect trap, capturing images of fruit flies in guava orchards, and applies machine learning techniques, including feature extraction using Haralick features, histogram of oriented gradients, Hu moments, and color histograms. Demonstrating real-world applicability, the system yielded 86.2% recall and 97.3% mAP for pest classification. It surpassed existing machine learning and deep learning models, in all key metrics, facilitated by its integrated dataset acquisition, image processing, and feature extraction workflow.

Rahman et al. 20 devised a sophisticated framework to modernizing paddy farming by integrating Internet of Things (IoT), blockchain technology, DL algorithms into a unified, automated system. The core objective is to attain real-time pest detection, crucial for protecting crops and maintaining ecological balance. By employing VGG19 model alongside ensemble classifiers, the system attained an outstanding accuracy score of 98.91%, with a specificity of 99.14% and a precision 98.21%. The IoT approach, consisting of camera modules and microprocessors, facilitate persistent monitoring of the paddy fields, while blockchain technology sssures secure and tamper proof data transmission between devices and the cloud environment. With an average cloud response time of just 1.71 seconds, the system significantly uplift the speed and effectiveness of agricultural decision-making. Overall, this integrated solution offers a transformative step towards resilient, sustainable, and technology-driven paddy farming.

Deep learning approaches for infestation and pest categorization in apiculture

An intelligent real-time pest detection model was formulated by Tang et al. 1, specifically designed to overcome challenges in agricultural image analysis, such as the tiny size and high similarity of pest species. This framework uniquely optimizes the The interplay between detection accuracy and computational cost. Their approach, termed Pest-YOLO, integrates a CNN backbone with the YOLOv4 architecture and incorporates a squeeze-and-excitation attention mechanism to selectively amplify salient image features while suppressing irrelevant background information. Optimizing small target detection, they integrated a cross stage multi feature fusion and improved feature path aggregation network architectures. Pest-YOLO, validated on a 28,000-image, 24-class pest dataset, outperformed state-of-the-art benchmarks (Faster R-CNN, prior YOLO), achieving 71.6% mAP and 83.5% recall.

Bhandari et al. 21 employed a DL model based on EfficientNetB5 and secured an average test accuracy of 99.07% for tomato leaf disease classification. To enhance interpretability, the study integrated Gradient-weighted Class Activation Mapping (Grad-CAM) and Local Interpretable Model-Agnostic Explanations (LIME), enabling visual understanding of model attention and feature contribution. This integration demonstrated the effectiveness of explainable AI techniques in improving transparency and trust in agricultural disease detection models. The present study builds upon this concept of explainability by employing a hybrid XAI framework that combines SHapley Additive exPlanations (SHAP) and Grad-CAM. While Sagar et al. focused on local interpretability using LIME, our approach extends the explanatory scope by incorporating both local and global feature attribution, providing deeper insight into the model’s decision-making process for wax moth infestation detection in honeybee apiaries.

To overcome accuracy and latency constraints of classical CNN based detectors Qi et al. 22 developed an enhanced YOLOv5 framework for real time agricultural pest detection. Their proposed model incorporates GhostNet as a lightweight backbone and introduces an efficient channel attention mechanism to enhance feature representation. High-resolution feature maps and attentional multi-receptive field fusion are integrated into the neck structure to enhance semantic richness and better localize small pests. Evaluated on the Pest24 dataset including 25,378 annotated images across 24 classes the proposed model yielded notable performance improvements, with mAP increasing from 71.5 to 74.1%, detection speed rising from 79.4 FPS to 104.2 FPS, and FLOPs and model size reduced by 42% and 39%, respectively. Despite its strong performance, the model’s effectiveness may be challenged by noisy images and class imbalance, which the authors aim to mitigate in future work through image denoising techniques and cost-sensitive learning strategies.

Qian et al. 23 design a pioneering model for the detection of pests in agricultural crops using an adaptive automatic data augmentation approach and a Res2Net backbone for improved feature extraction. Reverse feature fusion is added to Feature Pyramid Networks (FPN) to enhance the model’s fine-grained detail capturing capability, and CIoU bounding box regression and label smoothing are introduced to increase the precision of pest localization and identification. The suggested approach, validated on a 4,400-image dataset over four pest species, performs with a mean Average Precision (mAP) of 81.0%, surpassing top-performing models like YOLOv4, Faster R-CNN, and Cascade R-CNN. On top of this, application of the Test Time Augmentation (TTA) increases detection precision further, especially in the case of minor pests in crowded, complex environments.

Amrani et al. 24 suggests a Bayesian multi-task learning model for aphid detection and crop size estimation in crop crops, based on a ResNet18 backbone and a unique joint loss function. Although the model has outstanding results, with detection accuracies between 58.99% in wheat and 75.77% in corn on the AgriPest dataset, there are significant limitations. Performance is quite variable across various types of crops, suggesting generalizability is limited by crop-specific characteristics and small aphid size. Moreover, insights given through the ablation study regarding the effect of various backbones and augmentation mechanisms are useful but are concerned with scalability and efficiency due to the data dependency as well as computational expense. Despite these challenges, the model’s ability to provide uncertainty estimates is a noteworthy strength, offering potential for more reliable pest management systems. However, future research should address limitations, including improving generalization across diverse agricultural scenarios and optimizing computational requirements.

Recent advancements in real time pest detection have precipitated the creation of PestLite, a light weight YOLOv5-based model, specifically optimized for agricultural use. The model makes use of an innovative Multi-Level Spatial Pyramid Pooling (MTSPPF) module, Involution, and Efficient Channel Attention (ECA) mechanisms, coupled with the use of CARAFE for improved upsampling. Evaluated on a curated dataset of 6626 images from rice and maize crops, PestLite achieved an improved mAP50 of 90.7% while reducing the parameter size from 7.03 to 6.09 M. This approach provides an efficient benchmark for comparison with image-based disease detection models such as the one proposed in this study for wax moth detection in honey bee apiaries Dong et al. 25.

Hu et al. 26 proposed MACNet, an enhanced object detection model based on YOLOv8s, designed to address key challenges in pest detection such as species diversity, high similarity, and class imbalance. By incorporating a content-based feature sampling strategy and distribution shifting convolution, MACNet achieved improved accuracy (43.1 AP) and reduced computational load by 30% on the Pest24 dataset. Pest24 is a high-resolution, real-world agricultural pest dataset with 25,378 images and 24 pest classes, reflecting the complexity and imbalance typical of natural environments. This work highlights the practical value of lightweight deep learning models for real-time pest monitoring in precision agriculture.

Yuan et al. 27 I-YOLOv10-SC offers an upgraded model for detecting pests, specifically targeting insects with limited visibility or incomplete forms in tea plantations. By incorporating Space-to-Depth Convolution, the Convolutional Block Attention Module, and loss function optimization strategies, the model demonstrates significant performance improvements, including a 5.88% uplift in accuracy and a 4.26% increase in mAP compared to the original YOLOv10. An ablation study verifies the efficacy of these enhancements, and GradCAM visual analysis underscores the enhanced attention to pest characteristics. The I-YOLOv10-SC model offers a viable solution for accurate and effective pest monitoring in intelligent tea gardens.

Pest detection and management in traditional apiculture

Ferreira et al. 28 Unveils the efficacy and specificity of Negramina oil as a natural alternative to synthetic insect repellents in preventing wax moths (Galleria mellonella and Achroia grisella) in honey bee colonies. The oil, which is mostly a blend of Inline graphic-myrcene and 2-undecanone, shows potential insecticidal and repellent activity against wax moths with much reduced toxicity to honey bee apiaries. Yet, its residual presence is twofold in that it has the potential to undermine bee health and contaminate apiary products, causing dire effects on human health and the environment. The current study assessed the efficacy and selectivity of Negramina (Siparuna guianensis) essential oil as a novel control tactic against wax moths without killing honey bees (Apis mellifera). Surprisingly, Negramina oil is an environmentally friendly pest control agent with a selective repellent effect that repels wax moths and larvae without interfering with bee foraging behavior.

A three-year field study by Hod et al. 29 explored the potential of utilizing the red imported fire ant, Solenopsis invicta, as a natural predator of wax moths in stored apiary equipment. The authors assessed the effectiveness of temperature-controlled storage on wax moth populations, investigating fire ant impacts across regions characterized by varying fire ant population densities. Their key findings highlight that a significant reduction in wax moth populations was observed when storing comb on pallets with enhanced lighting and ventilation, particularly in areas where fire ants are abundant (Inline graphic 214 mounds per ha). Fire ant predation rates were found to be associated with colony density, indicating that predation by fire ants is directly proportional to colony density and demonstrating their efficacy in suppressing wax moth infestations. Two prominent conditions necessary for fire ant-mediated wax moth management are optimized storage environments and elevated fire ant populations. However, despite high ant densities, wax moths remained a critical factor and continued to cause significant damage in conventional beehive setups lacking adequate ventilation.

Han et al. 30 presents an innovative Bacillus thuringiensis (Bt) strain, BiotGm, and validated it as an ecological control method for the wax moth, a detrimental pest in apiaries. BiotGm exhibited significant entomocidal activity against wax moth larvae (Inline graphic < 2 Inline graphicg/g), characterized by a low-risk profile and minimal toxicity to honey bees. It demonstrated high efficacy in targeting pests, with an Inline graphic of 20598.78 Inline graphicg/mL, particularly for larvae and adults, and no dose-dependent adverse impact observed at concentrations up to 100 Inline graphicg/mL. In order to maximize its discriminatory efficacy, researchers created a novel bespoke dual-chamber trap by combining 3D printing and injection moulding, with the inclusion of a GWM bait and BiotGm, and possessing a honey bee repellent mechanism. The efficacy of the trapping device was confirmed using a nationwide large-scale field trial at 14 heterogeneous sites in China. The findings proved to contribute immensely to the establishment of evidence-based measures for the control of GWM populations. The results show the viability of Bt-based biocontrol techniques as effective tools for wax moth control.

Hosni et al. 31 examines the integration of Bacillus thuringiensis (Bt) with trapping device for controlling greater wax moth (GWM). Their results recommend that integrated method enhances management in honey bee colonies substantially elevate wax management practices. The authors deployed Maxent modeling attained outperformed accuracy AUC of 0.8 and (True Skill Statistics) TSS of 0.7 showcasing robust model performance. They forecasted climate simulations for 2050 and 2070, utilizing RCP 2.6 and 8.5 display uplifted environmental conditions in critical honey exporting and trade zones. These models showed high habitat suitability for GWM in key honey exporting and importing regions, highlighting potential risks to honeybee populations and the economic implications for the global honey industry. This study underscores the exposure of honeybee populations with associated with substantial economic ramifications for the international honey market.

Adly et al. 32 explored the importance of parasitoid Bracon hebetor to tackle Greater Wax Moth damage utilizing biocontrol agent, a detrimental pest in apiarian ecosystems. Laboratory experiments and field trials revealed that Bracon hebetor effectively paralyzed and parasitized G. mellonella larvae particularly in the 5th larval instar stage. Subsequent deployment of B. hebetor field trials demonstrated a notable boost in wax moth larval mortality versus non-treated groups in honey bee apiaries. Their results recommended that B. hebetor emerges as a well-suited biological management agent for wax moth damage in honey bee colonies, notably holding particular promise to control G. mellonella control in Egypt region.

Kabore et al. 33 highlights the widespread occurrence of G. mellonella infestation associated with the synergistic occurrence of diverse pests in the agroecosystem biodiversity. The prevalence of wax moth growth development exacerbates, compromising bee health and honey yields. The conducted study emphasizes the urgent need for prolonged investigations in multi regional research to quantify the prevalence between wax moth infestations and honey production. Furthermore, the study suggests further multifaceted inspection of apiary pest dynamics and outreach programs for beekeepers for sustainable colony management.

Deep learning techniques have proven highly effective in agricultural disease detection, particularly for tomato leaf classification. A recent study kunduracioglu et al. 34 employed a deep learning-based diagnostic framework to enhance automated detection accuracy in crop imaging systems. Similarly, numerous research have showcased the efficacy of deep learning in agricultural disease detection. Kunduracioglu and Pacal kunduracioglu et al. 35 developed a deep learning-based framework for accurate classification of grape leaves and diagnosis of grape diseases, highlighting the robustness of CNN architectures in handling complex visual features of crop diseases. Additionally, kunduraciouglu et al. 36 proposed a deep learning framework using EfficientNet architectures for detecting sugarcane leaf diseases, achieving an accuracy of around 93.4%. Their findings demonstrated that lightweight CNN models can deliver high precision in agricultural disease classification, supporting the effectiveness of deep learning approaches like the one proposed in this study.

Research gap

Notwithstanding advancements in AI-based pest detection, a significant research gap remains notably, in addressing wax moth infestations in apicultural settings. To the best of our knowledge, no prior study has explicitly targeted the automated detection and classification of Galleria mellonella (wax moth) in honeybee hives using AI based models. Active methodologies predominantly focus on broad-spectrum pests and often lack interpretability, hindering entomological insight and failing to meet the specific needs of beekeeping applications. To further contextualize the novelty of our proposed XAI-HoneyNet and XAI-PestNet models, a comparative evaluation was conducted against recent state-of-the-art frameworks. As summarized in Table 1, while models including GBiDC-PEST40, DMSAU-Net42, and Transformer based approaches43 show promising accuracy, they often prioritize generalized agricultural pest detection or mobile optimization without providing biologically interpretable outputs or hierarchical classification capabilities. While active research tends to focus on isolated pest control strategies, there is a pressing need for an integrated, explainable AI (XAI) framework that enables robust, efficient, and domain-adapted detection. In response, our proposed model introduces a hierarchical classification pipeline tailored for apicultural infestation scenarios. By incorporating XAI tools such as SHAP and Grad-CAM, the framework provides biologically meaningful interpretations alongside strong predictive performance. Statistical validation through t-tests and ANOVA further reinforces the reliability and generalizability of the results. Despite the wax moth’s long standing threat to hive health, it has received limited research attention, especially in the context of AI-based monitoring. Moreover, conventional detection methods are often slow, labor-intensive, and resource-consuming, emphasizing the demand for automated, scalable solutions. Bridging these gaps is essential to develop a resilient, adaptable, and sustainable framework for managing wax moth infestations in real-world beekeeping environments.

Table 1.

Comparative analysis of the proposed frameworks XAI-HoneyNet and XAI-PestNet against state-of-the-art pest detection approaches for honeybee colonies. The comparison includes performance metrics, interpretability methods, and data characteristics to highlight advancements in accuracy and explainability within smart apiculture systems.

Study/model Method and techniques Dataset, evaluation and performance Key contribution/research gap
Tang et al. 1 CNN + YOLOv4 with SE-Attention, Cross-Stage Feature Fusion 28,000 images; 24 pest classes; mAP: 71.6%, Recall: 83.5% Weak performance under occlusion/light variation; reduced accuracy for rare pests
Zhang et al. 18 TinySegformer: Transformer + CNN, Sparse Attention, Quantization, Pruning Public and self-collected datasets; Precision: 0.92; Recall: 0.90; Accuracy: 0.93; mIoU: 0.85; Dice: 0.91; FPS: 32.7 Requires broader validation across diverse pest types; limited generalization in real-world environments
Qi et al. 22 Res2Net + FPN with Reverse Feature Fusion, Label Smoothing 4400 images; 4 pest species; mAP: 81.0% Not tested for real-time deployment or larger pest diversity
Qian et al. 23 Enhanced YOLOv5: GhostNet, Channel Attention, Multi-Receptive Fusion Pest24; mAP: 74.1%; Speed: 104.2 FPS; − 42% FLOPs Needs real-field evaluation and cost-sensitive learning
Amrani et al. 24 Bayesian Multi-Task Learning (ResNet18); Joint Loss, Uncertainty Estimation AgriPest; Accuracy: 58.99–75.77% High computational cost and limited cross-crop generalization
Dong et al. 25 PestLite (YOLOv5 variant): Involution, ECA, MTSPPF, CARAFE 6626 images; Inline graphic: 90.7%; 6.09M parameters Evaluation under extreme environmental variations missing
Hu et al. 26 MACNet (YOLOv8s): Distribution-Shifting Convolution Pest24; AP: 43.1; − 30% computational load Reduced accuracy on visually similar pest species
Yuan et al. 27 I-YOLOv10-SC: Space-to-Depth Conv, CBAM Tea-pest dataset; Accuracy +5.88%, mAP +4.26% Limited to tea pests; generalization across other crops untested
Dhanaraj et al. 37 DMF-ResNet + Sound Analytics; Spectral Leakage Reduction IoT-based; Accuracy: 99.75%, high F1 Lacks multispecies validation; environmental resilience unproven
Vilar et al. 38 YOLOv8 generalist: Insect-class merging (IP102) 102-class dataset; Inline graphic: 0.967 Merged classes reduce pest-specific insights
Prasath et al. 39 APDC: IoT + UAV + AETC optimization Simulation-based; Accuracy gain +6.67%–9.1% (across models) Simulated setting; lacks validation in real-field deployments
Xu et al. 40 GBiDC-PEST: Lightweight YOLO, High FPS Tpest-3960; mAP: 80.1% Model size only 2.8MB, mobile-suitable; lacks real-pest multi-stage detection
Christakak et al.  58 Smartphone DSS + citizen science mobile AI Custom dataset; Inline graphic: 70.2% Community-driven system; accuracy is limited
Venkateswara et al. 41 ResNet + Augmentation + Segmentation IP102; Accuracy: 84.95% Standard ResNet; needs advanced interpretability
Wang et al. 42 DMSAU-Net: Dilated Attention + U-Net IP102; Accuracy: 92.16% No interpretable or ensemble modeling used
Gao et al. 43 Transformer + Knowledge Graph + Edge AI Cotton dataset; Accuracy: 94%; mAP: 95% Edge-ready transformer system; limited to cotton pests
Li et al. 44 APNet: YOLOv8n + Feature Fusion Modules ATZD01; Accuracy: 87.10% Detection focused; lacks hierarchical stage modeling

Proposed methodology

Dataset acquisition and description

This study utilizes a custom-built dataset comprising 3252 high-resolution images, meticulously gathered from honeybee (Apis mellifera) apiaries situated along Dhareeja Nagar Road, Rahim Yar Khan, Punjab, Pakistan (coordinates: Inline graphic N, Inline graphic E). The location, marked as HHRV + HPG Dhareja Nagar, was selected due to its active beekeeping environment and high susceptibility to wax moth infestations. Data collection occurred from May 1st to August 31st, a period typically marked by elevated ambient temperatures that promote the proliferation of wax moths. Images were captured in confined, visually noisy hive environments, introducing shadows, motion blur, and background clutter. Acquisition was performed using an Oppo F21 Pro smartphone equipped with a high-performance camera capable of capturing high-resolution images at 1080 pixels. This setup ensured the visual clarity required for precise identification and classification of wax moth infestations, consistently producing high-quality images under natural lighting conditions and across varying field environments.

No fixed distance or angle was enforced during image acquisition to preserve the natural variability present in real-world hive inspections. Instead, images were intentionally captured from multiple viewpoints employing slightly close-up, medium, and wider frames as well as from diverse orientations such as frontal, diagonal, and top-down perspectives. This variation in angle and distance was deliberately introduced to enrich dataset diversity and to enable the model to generalize effectively across practical field conditions where camera position and lighting cannot always be standardized. Multiple field visits were conducted to capture a broad range of scenarios, including differences in hive orientation, ambient lighting, and infestation severity. This approach contributed to the development of a comprehensive and diverse dataset reflective of real-world apiary conditions.

Each image generally represents an independent honeybee frame sample, collected from multiple honeybee boxes within a single apiary. This approach assured biological diversity across colonies exposed to different hive conditions. In cases of heterogeneous or severe infestations, multiple images were occasionally captured from the same frame at different zoom levels or angles to document localized variations in wax moth activity. This sampling strategy enhanced dataset representativeness by encompassing both inter-colony diversity and intra-frame variability, thereby reflecting realistic conditions encountered during field-based hive inspections.

Data annotation and categorization

To ensure biological accuracy and contextual integrity, a rigorous annotation process was implemented. Labeling was conducted under the guidance of an entomology expert, as depicted in Fig. 2, who provided critical insights into morphological and behavioral indicators of each infestation stage. Specific visual markers such as silk webbing, larval tunnels, pupal cocoons, and adult moths were identified and annotated accordingly. In addition, experienced local beekeepers and experts from the National Agricultural Research Centre (NARC) were consulted to validate the labels based on real-world hive management practices. This interdisciplinary collaboration between scientists and practitioners ensured that the labeled data was both scientifically reliable and practically applicable. The dataset was structured into two hierarchical categories, a Main Class and an Infestation Sub-Class. The Main Class comprised two categories, Healthy and Infestation. The Healthy class contained 848 images of wax moth free honeybee frames, in parallel the Infestation class included 963 images representing various progressive stages of wax moth (Galleria mellonella) activity. For a more granular classification of infestation severity, the Infestation class was further subdivided into three biologically distinct sub-categories within the Infestation Sub-Class: Larva, Pupa, and Adult, comprising 480, 482, and 492 images respectively. Although the wax moth has four developmental stages egg, larva, pupa, and adult only three were considered in this study. The egg stage was excluded due to its microscopic size, which makes it visually undetectable in standard frame images. The distribution of both the Main Class and Infestation Sub-Class is illustrated in Fig. 3.

Fig. 2.

Fig. 2

Hierarchical labeling structure of the honeybee frame dataset. In the first stage, frames are classified into two main categories: Healthy and Infestation. If a frame is identified as infested, a second-level multi-class classification is applied to determine the specific pest stage: Larva, Pupa, or Adult. This two-tiered structure enables accurate detection and categorization of wax moth infestation stages in smart apiculture systems.

Fig. 3.

Fig. 3

Hierarchical distribution of the honeybee frame dataset. The left graph shows the binary classification of frames into Healthy and Infestation classes. The right graph displays the multi-class distribution of infested frames into Larva, Pupa, and Adult stages. This two-level labeling supports hierarchical pest detection in smart apiculture systems.

Image data preprocessing

The preprocessing phase was strategically designed to standardize the image dataset and optimize it for fine tuning deep learning frameworks, predominantly convolutional neural networks (CNNs). The original high resolution all images were sclaed to a standard size format of 128 Inline graphic 128 pixels, conforming to the input configuration requirements of the VGG16 architecture. A custom image loading pipeline was employed to streamline this process by automatically reading the images, resizing them, and assigning appropriate labels. Each image was annotated with both a main class label Healthy vs Infestation and a corresponding subclass label Larva, Pupa, Adult, or None. To ensure data integrity and maintain consistency across the dataset, files identified as corrupted or unreadable were systematically flagged and excluded from subsequent analysis.

Image normalization and validation split

For consistent feature scaling and improved training efficiency, all image pixel values were converted to float32 and normalized within the [0, 1] interval using the rescale=1./255 parameter. This preprocessing facilitates smoother optimization and faster convergence. A stratified validation split of 20% was performed using TensorFlow’s ImageDataGenerator, providing a robust evaluation framework with 80% of data used for model training.

Data augmentation for training

To foster generalization and minimize the risk of overfitting, the training data underwent augmentation via diverse image transformations, which were introduced using the ImageDataGenerator class. These transformations included random rotations, translations, zoom, and flipping, as summarized in Table 2. The applied operations introduced controlled randomness to simulate real-world distortions and variability in image acquisition conditions, thereby improving the model’s robustness. The augmentation was performed dynamically through the train_datagen.flow_from_directory() method, which also handled image normalization and the automatic splitting of training and validation datasets.

Table 2.

Data augmentation strategies and training parameter settings applied during model training to improve generalization and performance.

Augmentation type Transformation Value
Rotation Maximum angle 40°
Width shift Maximum shift 20%
Height shift Maximum shift 20%
Shear Shear intensity 0.2
Zoom Random zoom Yes
Horizontal flip Random flip Yes

Validation data preprocessing

For the validation set, only normalization was applied, without any augmentation, as shown in Table 3. This ensured that validation metrics accurately reflected the model’s performance on clean, unaltered data, thereby simulating real-world inference conditions. The validation dataset was generated using the validation_datagen.flow_from_directory() function.

Table 3.

Preprocessing techniques implemented for training and validation data, including data cleaning, normalization, and augmentation, to enhance model performance and generalizability.

Preprocessing step Training data Validation data
Normalization Yes Yes
Augmentation Yes No

Feature extraction

Figure 4 demonstrates the feature extraction workflow. Transfer learning was employed using the VGG16 architecture, a deep convolutional neural network pre-trained on the ImageNet dataset. Although more recent and computationally efficient architectures such as ResNet, EfficientNet, or Transformer-based models are available, VGG16 was selected due to its proven ability to extract rich hierarchical features suitable for image-based pest and disease classification45 motivating the use of VGG16 for wax moth detection. The model’s relatively simple and sequential architecture preserves spatial relationships across layers, which enhances the interpretability of feature maps when incorporating explainable AI techniques including SHAP and Grad-CAM. The classification layers of VGG16 were removed, retaining only the convolutional base to preserve essential low- and mid-level spatial feature representations learned from ImageNet. All convolutional layers were kept frozen to maintain these representations. Each input image was passed through the pre-trained network to extract deep hierarchical features that capture spatial and textural patterns associated with wax moth infestation. The resulting feature maps were then flattened to generate two-dimensional feature vectors suitable for subsequent neural network or classical machine learning classifiers. The classification layers of the model were removed, retaining only the convolutional base to preserve essential low- and mid-level spatial feature representations learned from ImageNet. All convolutional layers were kept frozen to maintain these representations. Each input image was passed through the pre-trained network to extract deep hierarchical features that capture spatial and textural patterns associated with wax moth infestation. The resulting feature maps were then flattened to generate two-dimensional feature vectors suitable for subsequent neural network or classical machine learning classifiers.

Fig. 4.

Fig. 4

Comprehensive depiction of VGG16-based feature extraction and subsequent feature vectorization for machine learning model input for the proposed model XAI-HoneyNet and XAI-PestNet.

The feature extraction procedure followed a structured sequence of steps:

  • Model loading: The VGG16 model was loaded, with its fully connected top layers removed to retain only the convolutional layers. This architectural modification improved the model’s ability to capture hierarchical feature structures from images.

  • Image preprocessing: To ensure architectural compatibility, input images were resized to 128 Inline graphic128 pixels. Subsequently, normalization techniques, encompassing mean subtraction and scaling, were carried out following the VGG16 preprocessing conventions to maintain consistency with the original model training.

  • Feature extraction: Outputs from the last convolutional block of the VGG16 architecture were utilized to extract rich feature vectors. These representations, encoding complex spatial hierarchies, were subsequently flattened for integration into the learning pipeline.

  • Transfer learning: In order to retain the pre-trained knowledge embedded in VGG16, the model the network’s layers was frozen, thereby locking its weights during the training phase. The extracted feature vectors were subsequently used as input for downstream classifiers in the final classification stage.

Rationale for using VGG16

Despite the emergence of modern computationally efficient architectures such as ResNet, EfficientNet, or Transformer-based models, VGG16 was selected due to its proven ability to extract rich hierarchical features using convolutional layers, as demonstrated in prior CNN-based studies for plant disease classification45,46. Its relatively simple and sequential architecture preserves spatial relationships across layers, which enhances the interpretability of feature maps when incorporating explainable AI techniques such as SHAP and Grad-CAM. Furthermore, a comparative evaluation with other architectures like ResNet50, EfficientNet-B0, indicated that VGG16 provides competitive performance in terms of F1-score, accuracy, and recall while maintaining compatibility with XAI visualization tools. By leveraging transfer learning, the proposed framework utilize the representational power of the pre-trained VGG16 network for effective feature extraction, avoiding the need to train a deep model from scratch and enabling improved differentiation of complex visual patterns within honeybee datasets, making it a suitable choice for wax moth pest detection.

Handling class imbalance with SMOTE

To mitigate class imbalance, SMOTE was applied to the primary dataset, aimed at discerning between the Healthy vs Infestation Labels, as showcased in Fig. 5. The original class distribution was skewed, with the Infestation class markedly under-represented relative to the Healthy class. SMOTE mitigated this imbalance by generating synthetic minority class samples via interpolation between existing instances, thereby enriching data diversity and enabling the model to learn more generalizable decision boundaries. In addition to balancing the Main Class, SMOTE was also carried out for the Infestation Sub-Class as showcased in Fig. 6, comprising the Larva, Pupa, and Adult stages, to ensure equal representation among these biologically distinct infestation categories. As illustrated in the bar plots, the class proportions became balanced after SMOTE, yielding an equal number of samples for both main categories and sub-classes. Hive-level splitting was performed for all experiments. All frames from a given hive were assigned exclusively to one split (training, validation, or testing), ensuring that no hive contributed images to more than one subset. The splits were verified to confirm zero overlap of hive IDs across subsets. This resampling step produced a more uniform training set and ultimately supported robust, unbiased performance in the Stage 1 classification task.

Fig. 5.

Fig. 5

Main class distribution before and after SMOTE-based oversampling, highlighting the effect of balancing on training data.

Fig. 6.

Fig. 6

Sub-class distribution before and after SMOTE oversampling to address class imbalance among infestation stages.

Proposed XAI–HoneyNet workflow

Figure 7 presents our end-to-end framework for explainable honey bee health monitoring. The pipeline begins with a curated repository of high-resolution biological imagery, which undergoes standardized preprocessing and feature extraction as described in Section 3.3. The processed dataset is stratified into training and validation partitions to maintain class balance. A diverse suite of classifiers, including SVM, LR, RF, KNN, XGBoost, AdaBoost, and ExtraTrees, were optimized and benchmarked. Model performance was quantitatively assessed using accuracy, precision, Inline graphic score, recall, specificity, Matthews correlation coefficient (MCC), Cohen’s Kappa, and computational time. In addition, statistical analyses, including one-sample t-tests and ANOVA, were conducted to evaluate the significance and robustness of the results. Among individual learners, LR and SVM demonstrated superior predictive performance compared to other models. To enhance predictive accuracy across both classification levels, two ensemble strategies were developed. For the primary binary classification task (Healthy vs. Infestation), a hard-voting ensemble integrating LR and SVM, referred to as XAI-HoneyNet, was implemented. For the secondary multi-class task (Larva, Pupa, Adult), a hard-voting ensemble combining LR and ExtraTrees, designated as XAI-PestNet, was employed. These ensembles were selected for their complementary decision boundaries and robust generalization across biologically distinct categories. The architectural details of all baseline and ensemble classifiers are summarized in Table 5. To ensure transparency, SHAP was applied to LR and SVM outputs to quantify feature contributions, while Grad-CAM highlighted salient image regions for both ensembles, providing spatial explanations that complement feature-level insights. This integrated workflow combines state-of-the-art predictive accuracy with interpretability, supporting trustworthy deployment in precision apiculture.

Fig. 7.

Fig. 7

Schematic overview of the end-to-end framework for explainable detection of wax moth infestation in honeybee frames. The pipeline integrates deep learning for feature extraction, classical and ensemble machine learning for classification, and vision-based XAI techniques for interpretability.

Table 5.

Details of the machine learning models employed for the main classification task (Healthy vs. Infestation) and infestation sub-class classification (Larva, Pupa, Adult). The table outlines model types and the optimized hyperparameters used during training and evaluation.

Component Binary classification (healthy/infestation) Multi-class classification (Larva/Pupa/Adult)
Input data Model trained on resampled training features and labels; evaluated using original validation features and test labels Model trained on resampled training features and labels; evaluated using original validation and test subsets
Logistic Regression (LR) Solver: Liblinear; Maximum iterations: 1000; Random state: 42 Solver: LBFGS; Maximum iterations: 1000; Multi-class: Auto; Random state: 42
Random forest (RF) Number of estimators: 100; Criterion: Gini; Bootstrap: Enabled; Random state: 42 Number of estimators: 300; Criterion: Gini; Bootstrap: Enabled; Random state: 42
Support Vector Machine (SVM) Kernel: Linear; Probability estimates: Enabled; Random state: 42 Kernel: Radial Basis Function (RBF); Probability estimates: Enabled; Random state: 42
K-Nearest Neighbors (KNN) Number of neighbors: 5; Weight function: Uniform; Distance metric: Euclidean Number of neighbors: 5; Weight function: Uniform; Distance metric: Euclidean
XGBoost (XGB) Base classifier: XGBoost; Default parameter configuration; Random state: 42 Not utilized.
AdaBoost (ADA) Base estimator: Decision Tree Classifier; Number of estimators: 100; Random state: 42 Number of estimators: 200; Learning rate: 0.5; Random state: 42
Extra Trees Classifier Number of estimators: 100; Criterion: Gini; Bootstrap: Enabled; Random state: 42 Number of estimators: 300; Criterion: Gini; Bootstrap: Disabled; Random state: 42
Voting Classifier (Soft) Base models: LR and SVM; Voting strategy: Soft (average of predicted probabilities) Base models: LR and Extra Trees; Voting strategy: Soft (average of predicted probabilities)
Stacking Classifier Base models: LR and SVM; Final estimator: Logistic Regression; Stack method: predict_proba; Random state: 42 Base models: LR and Extra Trees; Final estimator: Logistic Regression; Stack method: predict_proba; Random state: 42

Employed classical machine learning models

We incorporated a diverse set of established machine learning classifiers to perform the classification tasks defined in this study. The selected models encompassed Random Forest (RF), K-Nearest Neighbors (KNN), Support Vector Machine (SVM), AdaBoost, Extra Trees Classifier, Logistic Regression (LR), and XGBoost, along with ensemble approaches such as Stacking and Voting classifiers. These algorithms were selected to ensure methodological diversity and to enable a comprehensive evaluation of performance across multiple metrics.

Random forest

The RF algorithm was employed to classify colony images across multiple health conditions and infestation stages using the extracted image features as input variables. These features encompassed texture, color intensity, and structural patterns that effectively represented variations in colony health status. The ensemble-based architecture of RF efficiently captured complex relationships within the image-derived features and reduced misclassification arising from overlapping visual patterns among closely related categories. Hyperparameters, including the number of trees and maximum tree depth, were optimized through cross-validation to achieve balanced accuracy across all classes. This implementation ensured robust detection performance and interpretability in evaluating colony health and the progression of wax moth infestation 47.

Formulation. The Random Forest classification and regression formulations are expressed as:

graphic file with name d33e1312.gif 1
graphic file with name d33e1316.gif 2

K-nearest neighbors

The K-Nearest Neighbors (KNN) algorithm was employed to classify colony images across varying health conditions and infestation stages using feature vectors derived from the VGG16 pre-trained model. These feature representations captured colony-specific attributes such as texture, color gradients, and structural patterns, serving as input variables for the classifier. The algorithm assigned class labels based on the majority vote among the Inline graphic-nearest neighbors in the feature space 48. Hyperparameter tuning was performed to determine the optimal value of Inline graphic through cross-validation, ensuring balanced performance across all categories. Although computationally simple, the distance-based nature of KNN effectively captured subtle variations between colony states, while the use of pre-extracted VGG16 features mitigated challenges associated with high-dimensional image data, enhancing both efficiency and classification precision.

Formulation. For classification, the prediction follows the majority vote within the Inline graphic nearest neighbors:

graphic file with name d33e1342.gif 3

Support vector machine

SVM  49 model was trained on VGG16-derived feature vectors extracted from colony images to classify varying health conditions and infestation stages. The radial basis function (RBF) kernel was employed to capture non-linear relationships within the high-dimensional feature space, while a one-vs-rest strategy was adopted to manage multi-class classification by treating each category as a separate binary problem. The robustness of SVM in high-dimensional settings, coupled with optimized hyperparameters such as the regularization parameter (C) and kernel coefficient, enabled accurate and generalizable detection of infestation patterns across colonies.

Formulation. The SVM decision function is expressed as:

graphic file with name d33e1359.gif 4

Adaptive boosting

The AdaBoost model 50 was trained using feature vectors extracted from the VGG16 pre-trained network, capturing essential visual characteristics such as texture, color distribution, and structural irregularities within hive frames. During training, AdaBoost iteratively adjusts the weights of challenging or misclassified instances, refining the model’s sensitivity to subtle visual cues that differentiate varying infestation intensities and colony health states. This adaptive weighting mechanism enhances both classification accuracy and reliability, particularly in scenarios where class boundaries are visually ambiguous.

Formulation. The final prediction is computed as:

graphic file with name d33e1373.gif 5

Extremely randomized trees

ExtraTrees51 classifier is trained on feature vectors extracted from the VGG16 pre-trained model, which encapsulate critical image-based attributes such as texture uniformity, color variations, and structural patterns of hive cells. Hyperparameters, including the number of trees and their maximum depth, are optimized through cross-validation to achieve high detection precision. Compared to Random Forest, ExtraTrees offers faster training, enhanced robustness against overfitting, and improved handling of high-dimensional visual data, making it well-suited for distinguishing subtle inter-class and intra-class variations in colony conditions.

Formulation. For regression, the prediction is given by:

graphic file with name d33e1387.gif 6

where Inline graphic denotes the total number of trees. For classification, the final output is determined by the majority vote among all trees:

graphic file with name d33e1396.gif 7

Logistic regression

LR algorithm, a linear classifier is trained on feature vectors extracted from the VGG16 pre-trained network, capturing discriminative image characteristics such as color intensity, texture smoothness, and structural regularities of hive surfaces. For multiclass handling, the one-vs-rest (OvR) strategy is implemented, while hyperparameters such as the regularization strength are optimized using cross-validation to prevent overfitting. Logistic Regression provides computational efficiency and serves as a strong baseline model due to its simplicity, interpretability, and effectiveness when the class boundaries are approximately linear. Moreover, its coefficient weights aid in understanding the contribution of each image feature toward classification decisions52.

Formulation. The logistic hypothesis function is defined as:

graphic file with name d33e1410.gif 8

Extreme gradient boosting

The XGBoost model was trained using high-resolution image feature vectors derived from the VGG16 pre-trained network, capturing critical attributes such as color gradients, texture irregularities, and structural deformations indicative of wax moth infestation. Through gradient boosting and regularization, the model effectively minimized overfitting and enhanced its capacity to distinguish subtle variations between healthy and infested colony conditions, ensuring robust and precise classification performance. Hyperparameters, including the number of trees and maximum tree depth, are optimized via cross-validation to ensure balanced accuracy and efficiency. Owing to its resilience against overfitting, capability to handle high-dimensional feature spaces, and provision of feature importance scores, XGBoost delivers high accuracy and interpretability, offering a reliable decision-support tool for beekeepers and agri-food stakeholders in monitoring colony health53.

Formulation. The XGBoost prediction model is expressed as:

graphic file with name d33e1424.gif 9

where Inline graphic denotes the space of regression trees.

Stacking

The Stacked Ensemble Learning approach, a hierarchical ensemble technique, integrates predictions from multiple baseline classifiers to construct a more robust meta-classifier54. In this study, base learners including SVM, RF, XGBoost, and KNN are trained on image feature vectors extracted from the pre-trained VGG16 model. These base classifiers capture complementary aspects of the data, such as texture, color gradients, and structural irregularities within hive images. Their output probabilities are subsequently provided as inputs to a LR meta-classifier, which performs the final prediction. This hierarchical fusion enables the ensemble to leverage the strengths of individual models combining the interpretability of LR, the robustness of RF, the nonlinearity handling of XGBoost, and the local sensitivity of KNN. The proposed stacked ensemble effectively classifies honeybee colonies into Healthy and Infested groups, and further sub-classifies infestations into Larva, Pupa, and Adult stages. By exploiting model diversity, the ensemble minimizes both bias and variance, achieving improved generalization and stability in detecting wax moth infestations.

Formulation. The stacked ensemble prediction is expressed as:

graphic file with name d33e1459.gif 10

where Inline graphic denotes the prediction from each base classifier and Inline graphic represents the meta-classifier function responsible for the final decision.

Voting ensemble

The Voting Ensemble method is a collective learning approach that aggregates predictions from multiple classifiers to enhance overall model performance55. In this study, both hard and soft voting strategies are employed to integrate the outputs of RF, XGBoost, SVM, and LR. Hard voting determines the final prediction through majority rule, selecting the class most frequently predicted by the base learners. In contrast, soft voting averages the predicted class probabilities, allowing each classifier’s confidence to influence the final outcome. This probabilistic fusion is notably effective when model outputs are well calibrated, as it provides a balanced consensus across diverse decision boundaries. By combining the complementary strengths of these classifiers, the ensemble improves robustness and accuracy in categorizing honeybee colonies as Healthy or Infested, and further sub-classifying infestations into Larva, Pupa, and Adult stages of the wax moth. The proposed voting ensemble enhances generalization, particularly in scenarios where no single model consistently dominates across all feature distributions.

Formulation. The ensemble predictions for hard and soft voting are defined as:

graphic file with name d33e1504.gif 11
graphic file with name d33e1508.gif 12

where Inline graphic denotes the probability assigned to class Inline graphic by classifier Inline graphic, and Inline graphic represents its respective voting weight.

Model evaluation parameters

A group of high performance evaluation metrics was used to assess how accurately the models recognise honey-bee hives as healthy or infested, and to identify infestation stages.

Accuracy

This metric represents the ratio of accurate predictions by the model to the total number of predictions, giving a broad picture of overall efficiency in classification tasks. Mathematically:

graphic file with name d33e1543.gif 13

Precision

The Percentage of accurate positive class categorization to the count of predicted positive predictions, valuable In applications where the implications of false positives carry serious consequences or significant costs. Mathematically:

graphic file with name d33e1551.gif 14

Recall (sensitivity)

Quantifies the ratio of positive samples detected among all actual positives, indicating the model’s capability to identify infestations. Mathematically:

graphic file with name d33e1559.gif 15

F1-score

It serves as a unified measure by incorporating both precision and recall, effectively balancing the trade-off false positives and false negatives. Mathematically:

graphic file with name d33e1567.gif 16

Specificity

The ratio of actual negatives correctly identified, reflecting the potential to identify non-infested frames. Mathematically:

graphic file with name d33e1575.gif 17

Matthews correlation coefficient (MCC)

A correlation based metric that incorporates all quadrants of the confusion matrix, making it particularly valuable when class distributions are skewed. Mathematically:

graphic file with name d33e1583.gif 18

Explainable AI for model interpretability

To increase interpretability and transparency, this study applies two strong explainability tools SHAP and Grad-CAM. Both methods provide insights into model decision processes, enabling stakeholders such as beekeepers and agricultural specialists to understand and trust predictions.

SHAP

By quantifying the marginal impact of each feature on model predictions, SHAP delivers interpretable importance, thereby assigning an importance score. By decomposing predictions into additive feature effects, it quantifies how features drive model decisions. In this work, SHAP is applied to ensemble models including RF and SVM to rank visual features that determine hive healthy and infestation stages (Larva, Pupa, Adult). It reveals how texture, colour, and structural cues in honey-bee frames influence predictions, even in complex, non-linear settings56.

Grad-CAM

Grad-CAM visualises image regions most influential to a convolutional network’s prediction by computing class-specific gradients with respect to feature maps and producing a heatmap. The computation is as follows:

graphic file with name d33e1612.gif 19
graphic file with name d33e1616.gif 20

Grad-CAM highlights discriminative areas associated with each infestation stage, validating that the model focuses on biologically relevant cues and providing intuitive visual explanations to end-users21,57.

Synergy Combining SHAP and Grad-CAM makes classifier decision processes transparent and interpretable, building stakeholder trust, supplying actionable insights, and guiding further model tuning for real-world apiculture applications.

Experimental setup

The experiments were conducted using a cloud-based computational environment (Google Colab), equipped with essential libraries for preprocessing, model training, and evaluation. Additional procedures such as feature scaling and visualization were also integrated to enhance analysis and ensure reproducibility. The experimental configuration, outlines both hardware and software components is summarized in Table 4.

Table 4.

Computational setup outlining the hardware and software environment used for model training and evaluation. Details include system specifications, programming libraries, and frameworks employed during experimentation.

Parameter Details
Experimental framework Intel(R) Core(TM) i5-6300U
Programming language Python 3.10.12
CPU 2.40 GHz–2.50 GHz
Available installed RAM 16 GB
System architecture 64-bit
Pandas version 2.2.2
NumPy version 1.26.4
TensorFlow version 2.17.0
Scikit-learn version 1.5.2

Hyperparameter setting

To enhance the performance of both main and sub-class classification models, critical hyperparameters were carefully configured. Random Forest, Extra Trees, and AdaBoost utilized tuned estimators ranging from 100 to 300. Logistic Regression was set with a maximum of 1000 iterations, KNN used five neighbors and SVM was implemented with an RBF kernel and enabled probability estimates. Soft voting strategies combined probabilistic outputs from base learners to boost classification robustness. The selected hyperparameters and architectural choices are summarized in Table 5.

Results and discussion

A rigorous analysis is presented in this section that interprets and critically analyzes the experimental findings across two classification stages: first, distinguishing comb health status as either healthy or infested; and second, further classifying the infestation through subsequent categorization of its developmental phase. A suite of evaluation metrics, namely accuracy, precision, recall, F1-score, specificity, MCC, ROC-AUC, and computational efficiency was employed to ensure robust and multidimensional performance assessment. The results offer compelling evidence of the proposed models’ predictive strength, generalization capability, and practical feasibility for real-world deployment. Each classifier’s effectiveness is critically examined, with particular emphasis on the trade-offs between diagnostic accuracy and computational complexity. The subsequent subsections delineate detailed comparative insights for both main classification and sub-class categorization tasks.

Results for main classification (healthy vs infestation)

As summarized in Table 6a, the performance of classical and ensemble machine learning classifiers was assessed utilizing features extracted from honeycomb images via a pre-trained VGG16 network. This hybrid VGG+ML approach leverages deep hierarchical feature representations, enabling classical classifiers such as LR and SVM to secure high accuracy while maintaining interpretability and computational efficiency. Among the baseline classifiers, SVM demonstrated top performance, achieving 98% accuracy, with precision, recall, and F1-score of 0.98, and the highest specificity of 0.9824. This high specificity is essential for minimizing false positives in biological systems, preventing unnecessary interventions on healthy hives. SVM also reported the highest MCC (0.9673) among base models, indicating robust performance under potential class imbalance. Its training and prediction times were 38.98 s and 0.77 s, respectively, making it slightly less suitable for time-critical applications. Logistic Regression delivered comparable performance with 98% accuracy, precision, recall, and F1-score of 0.98, specificity of 0.9765, and MCC of 0.9672, while requiring only 3.38 s for training and 0.041 s for prediction, demonstrating an excellent balance of speed and accuracy for real-time monitoring.

Table 6.

Performance evaluation of ML models for wax moth main class and subclass classification.

(a) Main class classification (healthy vs infestation)
Model Class Precision Recall F1-Score
Logistic regression Healthy 0.98 0.98 0.98
Infestation 0.98 0.98 0.98
Accuracy 0.98
Macro Avg 0.98 0.98 0.98
Weighted Avg 0.98 0.98 0.98
Specificity 0.9765
MCC 0.9672
Training time (s) 3.3790
Prediction time (s) 0.0410
Random forest Healthy 0.97 0.96 0.97
Infestation 0.97 0.97 0.97
Accuracy 0.97
Macro Avg 0.97 0.97 0.97
Weighted Avg 0.97 0.97 0.97
Specificity 0.9353
MCC 0.9345
Training time (s) 15.8807
Prediction time (s) 0.0832
Support vector machine Healthy 0.98 0.98 0.98
Infestation 0.98 0.98 0.98
Accuracy 0.98
Macro Avg 0.98 0.98 0.98
Weighted Avg 0.98 0.98 0.98
Specificity 0.9824
MCC 0.9673
Training time (s) 38.9846
Prediction time (s) 0.7701
K-nearest neighbours Healthy 0.97 0.97 0.97
Infestation 0.97 0.97 0.97
Accuracy 0.97
Macro Avg 0.97 0.97 0.97
Weighted Avg 0.97 0.97 0.97
Specificity 0.9706
MCC 0.9395
Training time (s) 0.0286
Prediction time (s) 1.1742
Extreme gradient boosting Healthy 0.96 0.97 0.96
Infestation 0.97 0.96 0.96
Accuracy 0.97
Macro Avg 0.97 0.97 0.96
Weighted Avg 0.97 0.97 0.96
Specificity 0.9588
MCC 0.9299
Training time (s) 78.2607
Prediction time (s) 0.0160
Adaptive boosting Healthy 0.96 0.97 0.97
Infestation 0.97 0.97 0.97
Accuracy 0.97
Macro Avg 0.97 0.97 0.97
Weighted Avg 0.97 0.97 0.97
Specificity 0.9765
MCC 0.9354
Training time (s) 161.5321
Prediction time (s) 0.1646
Extremely randomized trees Healthy 0.97 0.97 0.97
Infestation 0.97 0.97 0.97
Accuracy 0.97
Macro Avg 0.97 0.97 0.97
Weighted Avg 0.97 0.97 0.97
Specificity 0.9412
MCC 0.9392
Training time (s) 9.9762
Prediction time (s) 0.0451
XAI-HoneyNet Healthy 0.99 0.99 0.99
Infestation 0.99 0.99 0.99
Accuracy 0.99
Macro Avg 0.99 0.99 0.99
Weighted Avg 0.99 0.99 0.99
Specificity 0.9824
MCC 0.9719
Training time (s) 37.6849
Prediction time (s) 0.9143
Stacking ensemble (LR+SVM) Healthy 0.99 0.99 0.99
Infestation 0.99 0.99 0.99
Accuracy 0.99
Macro Avg 0.99 0.99 0.99
Weighted Avg 0.99 0.99 0.99
Specificity 0.9824
MCC 0.9719
Training time (s) 200.1834
Prediction time (s) 0.8462
(b) Subclass classification (Adult/Larva/Pupa)
Logistic regression Adult 0.94 0.97 0.95
Larva 0.95 0.92 0.93
Pupa 0.96 0.96 0.96
Accuracy 0.95
Macro Avg 0.95 0.95 0.95
Weighted Avg 0.95 0.95 0.95
Specificity 0.9671
MCC 0.9223
Training time (s) 16.6217
Prediction time (s) 0.0229
Random forest Adult 0.87 0.94 0.90
Larva 0.95 0.84 0.90
Pupa 0.92 0.96 0.94
Accuracy 0.91
Macro Avg 0.92 0.91 0.91
Weighted Avg 0.92 0.91 0.91
Specificity 0.9671
MCC 0.8717
Training time (s) 24.2517
Prediction time (s) 0.0791
Support vector machine Adult 0.87 0.97 0.92
Larva 0.94 0.88 0.91
Pupa 0.97 0.93 0.95
Accuracy 0.92
Macro Avg 0.93 0.92 0.92
Weighted Avg 0.93 0.92 0.92
Specificity 0.9671
MCC 0.8873
Training time (s) 43.1992
Prediction time (s) 2.0994
K-nearest neighbours Adult 0.76 1.00 0.86
Larva 0.80 0.81 0.80
Pupa 1.00 0.66 0.80
Accuracy 0.82
Macro Avg 0.85 0.82 0.82
Weighted Avg 0.85 0.82 0.82
Specificity 0.9671
MCC 0.7494
Training time (s) 0.0190
Prediction time (s) 0.6826
Adaptive boosting (AdaBoost) Adult 0.90 0.90 0.90
Larva 0.83 0.83 0.83
Pupa 0.90 0.90 0.90
Accuracy 0.88
Macro Avg 0.88 0.88 0.88
Weighted Avg 0.88 0.88 0.88
Average Specificity 0.9377
MCC 0.8131
Training time (s) 130.9050
Prediction time (s) 0.5286
Extremely randomized trees Adult 0.90 0.96 0.93
Larva 0.97 0.90 0.93
Pupa 0.94 0.95 0.94
Accuracy 0.93
Macro Avg 0.94 0.93 0.93
Weighted Avg 0.94 0.93 0.93
Average specificity 0.9671
MCC 0.9021
Training time (s) 7.6435
Prediction time (s) 0.0811
XAI-PestNet Adult 0.95 0.98 0.96
Larva 0.96 0.93 0.94
Pupa 0.96 0.96 0.96
Accuracy 0.96
Macro Avg 0.96 0.96 0.95
Weighted Avg 0.96 0.96 0.95
Specificity 0.9775
MCC 0.9327
Training time (s) 24.6785
Prediction time (s) 0.0865
Stacking ensemble (LR+ET) Adult 0.95 0.98 0.96
Larva 0.96 0.93 0.94
Pupa 0.96 0.96 0.96
Accuracy 0.96
Macro Avg 0.96 0.96 0.95
Weighted Avg 0.96 0.96 0.95
Specificity 0.9775
MCC 0.9327
Training time (s) 118.2391
Prediction time (s) 0.0981

Other classifiers also exhibited strong performance. KNN obtained 97% accuracy with balanced precision and recall but reported a slightly lower MCC of 0.9395. Its training and prediction times were 0.03 s and 1.17 s, respectively, making it the fastest among the base classifiers. ExtraTrees, RF, and XGBoost also reached 97% accuracy, with XGBoost incurring higher training time (78.26 s) and slightly lower MCC (0.9299). Adaptive Boosting showed moderate accuracy (97%) but required substantial training time (161.53 s), limiting practical applicability for rapid detection scenarios.

Ensemble models further enhanced classification performance. The proposed XAI-HoneyNet model attained 99% test accuracy, with precision, recall, and F1-score all at 0.99, and the highest MCC of 0.9719. Its training and prediction times were 37.68 s and 0.91 s, respectively, corresponding to a per-sample inference time of approximately 1.97 ms, making it highly suitable for real-time hive monitoring. The Stacking Ensemble (LR+SVM) also achieved 99% accuracy with similar precision, recall, specificity, and MCC; however, it required 200.18 s for training and 0.85 s for prediction, reducing its efficiency for time-critical deployments despite its high reliability. Notably, the class-wise evaluation for Healthy vs Infestation further confirmed consistent performance across both classes, highlighting the models’ reliability in distinguishing between healthy and infested hives. Collectively, XAI-HoneyNet Voting Ensemble strikes the optimal balance between classification performance and computational efficiency for the main-class Healthy vs Infestation classification, making it the most viable model for automated early detection of wax moth infestations in operational beekeeping systems.

Confusion matrix

The confusion matrix summarizes the classification results across Healthy and Infestation hive states in terms of true positives, false positives, true negatives, and false negatives. It facilitates the computation of key evaluation metrics consisting of accuracy, precision, recall, and F1-score while revealing misclassification patterns. Figure 8 presents the confusion matrices for all employed models, underscoring their diagnostic performance in the binary classification task.

Fig. 8.

Fig. 8

Confusion matrix illustrating the classification performance of the employed models on the main classes: Healthy and Infestation. The matrix presents the counts of true positives, true negatives, false positives, and false negatives, providing insight into the model’s accuracy and error distribution for binary classification of honeybee frame images.

ROC-AUC analysis

Figure 9 presents the ROC-AUC curves for all employed models in distinguishing between Healthy and Infestation classes. The top-performing model achieved a near-perfect AUC, demonstrating exceptional discriminative ability in the binary classification task. High AUC values across models indicate strong sensitivity-specificity trade-offs across various thresholds. The ROC curves validate each model’s reliability in handling complex biological imagery and support their potential application in real-time hive monitoring and pest detection.

Fig. 9.

Fig. 9

Receiver operating characteristic (ROC) curve for main-class classification of honeybee frames into Healthy and Infestation, with the Area Under the Curve (AUC) indicating the overall discriminative ability of the model.

Cross validation for main classification (healthy vs. infestation)

In the main classification of Healthy vs. Infestation comb images, models were evaluated using ten-fold cross-validation for robustness. As shown in Table 7, SVM secured the highest accuracy (0.9896 ± 0.0065), followed by Logistic Regression (0.9892 ± 0.0065) and the Voting Ensemble (0.9892 ± 0.0065). The Stacking Ensemble also performed well (0.9887 ± 0.0070). Extra Trees, Random Forest, and XGBoost yielded slightly lower accuracies (0.9840–0.9801) with increased variability. Adaptive Boosting recorded the lowest performance (0.9697 ± 0.0134). Overall, SVM based models demonstrated superior accuracy and consistency for wax moth infestation detection.

Table 7.

Accuracy comparison of machine learning models for main class classification using ten-fold cross-validation. The results reflect model stability and generalization performance in distinguishing Healthy and Infestation classes.

Models Mean CV accuracy Standard deviation
Logistic regression 0.9892 0.0065
Random forest 0.9792 0.0117
Support vector machine 0.9896 0.0065
K nearest neighbours 0.9783 0.0061
Extreme gradient boosting 0.9801 0.0110
Adaptive boosting 0.9697 0.0134
Extremely randomized trees 0.9840 0.0110
Voting ensemble (LR+SVM) 0.9892 0.0065
Stacking ensemble (LR+SVM) 0.9887 0.0070

Statistical validation of main-class classification

To rigorously validate the main-class model’s effectiveness, comprehensive statistical evaluations were performed. As shown in Table 8, the main-class classification (Healthy vs Infestation) demonstrated near-perfect agreement between predicted and true labels, with a Cohen’s Kappa coefficient of Inline graphic. The one-sample t-test confirmed the statistical significance of the model’s performance (Inline graphic, Inline graphic), and an analysis of variance (ANOVA) across ensemble models indicated no statistically significant differences among their performances (Inline graphic, Inline graphic), highlighting the consistency and robustness of the ensemble approach.

Table 8.

Statistical validation metrics for main-class classification (healthy vs infestation). Metrics include Cohen’s Kappa, one-sample t-test, and ANOVA results.

Statistical measure Value
Cohen’s Kappa (Inline graphic) 0.9719
One-sample t-test Inline graphic, Inline graphic
ANOVA (ensemble models) Inline graphic, Inline graphic

Model interpretability and visualization

SHAP and Grad-CAM analysis

To deepen the interpretive transparency and internal decision mechanisms of the classifiers, SHAP was incorporated into the top-performing base models, LR and SVM. SHAP-based feature values quantified the contribution of each input to the model’s output, with summary plots Fig. 10 visually highlighting the most influential attributes. These plots indicated that texture and color-related features of the honeycomb images played a central role in the classification process, aligning well with domain expertise and confirming the biological relevance of the extracted image representations. A quantitative analysis of the top 50 contributing features for both LR and SVM is provided in Table 9, further substantiating the interpretability claim by demonstrating which features most strongly influenced the classification decisions. To enhance interpretability further, the Grad-CAM technique was applied to the best performing ensemble model, the Voting Ensemble. The Grad-CAM visualization and its overlay with ground-truth infestation masks are presented in Fig. 11, illustrating the key spatial regions within the honeycomb images that contributed most significantly to the model’s predictions and quantifying the alignment of model attention with actual infestation areas. While these visualizations provide intuitive insights into the model’s spatial focus, certain subtle yet relevant regions remained underrepresented an inherent limitation of ensemble-based black-box architectures. Although the present study primarily emphasizes qualitative interpretability, the Grad-CAM and SHAP visualizations, supported by the quantitative feature contributions, consistently demonstrate that the model concentrates on biologically meaningful regions associated with infestation. Future work will incorporate quantitative region-based interpretability measures like focus overlap ratio once annotated infestation masks become available, further strengthening the transparency and validation of the proposed XAI framework.

Fig. 10.

Fig. 10

SHAP-based interpretation of feature importance for (a) Support Vector Machine and (b) Logistic Regression classifiers. The plots show how each feature contributes to the model’s predictions, with the magnitude indicating the strength of influence and the direction (positive or negative) indicating whether the feature increases or decreases the likelihood of honeybee frame infestation. This provides a clear understanding of which features drive the models’ decision-making.

Table 9.

Top 50 features by contribution (%) for baseline Logistic Regression (LR) and Support Vector Machine (SVM) models based on SHAP analysis of VGG16-extracted features. This quantitative analysis demonstrates the importance of input features in the classification of honeycomb images.

Rank Feature (LR) Contribution (%) Feature (SVM) Contribution (%)
1 Feature 2218 0.339 Feature 5511 0.286
2 Feature 3389 0.320 Feature 3389 0.286
3 Feature 2877 0.288 Feature 2218 0.280
4 Feature 326 0.283 Feature 4999 0.265
5 Feature 5511 0.281 Feature 326 0.253
6 Feature 170 0.281 Feature 2877 0.245
7 Feature 4999 0.267 Feature 4611 0.231
8 Feature 4611 0.244 Feature 170 0.230
9 Feature 5438 0.242 Feature 5802 0.228
10 Feature 2678 0.230 Feature 5438 0.227
11 Feature 5802 0.228 Feature 3181 0.214
12 Feature 3724 0.222 Feature 4266 0.208
13 Feature 3181 0.217 Feature 2597 0.205
14 Feature 4266 0.199 Feature 2678 0.203
15 Feature 2597 0.196 Feature 2148 0.192
16 Feature 6914 0.195 Feature 6914 0.190
17 Feature 3754 0.194 Feature 3 0.186
18 Feature 2148 0.189 Feature 5123 0.184
19 Feature 3 0.188 Feature 3724 0.180
20 Feature 2669 0.185 Feature 2669 0.177
21 Feature 838 0.185 Feature 7850 0.176
22 Feature 5772 0.183 Feature 2551 0.171
23 Feature 1706 0.179 Feature 4599 0.166
24 Feature 7850 0.178 Feature 5772 0.166
25 Feature 5260 0.177 Feature 2224 0.161
26 Feature 37 0.175 Feature 2251 0.159
27 Feature 4599 0.170 Feature 1927 0.157
28 Feature 2721 0.170 Feature 6470 0.156
29 Feature 1525 0.169 Feature 838 0.152
30 Feature 5768 0.166 Feature 37 0.151
31 Feature 5292 0.165 Feature 5595 0.149
32 Feature 2551 0.164 Feature 5768 0.148
33 Feature 5123 0.164 Feature 7338 0.143
34 Feature 2563 0.162 Feature 3212 0.143
35 Feature 7338 0.161 Feature 5260 0.142
36 Feature 6470 0.156 Feature 3587 0.141
37 Feature 6609 0.156 Feature 6644 0.139
38 Feature 2374 0.154 Feature 1525 0.138
39 Feature 5197 0.153 Feature 6766 0.137
40 Feature 2886 0.153 Feature 5197 0.137
41 Feature 2224 0.152 Feature 2563 0.135
42 Feature 3190 0.152 Feature 8071 0.133
43 Feature 3104 0.146 Feature 5635 0.133
44 Feature 2251 0.145 Feature 255 0.132
45 Feature 3212 0.145 Feature 7426 0.132
46 Feature 8071 0.144 Feature 3948 0.132
47 Feature 3693 0.143 Feature 2721 0.131
48 Feature 4489 0.143 Feature 100 0.131
49 Feature 1573 0.143 Feature 3999 0.131
50 Feature 7121 0.143 Feature 6609 0.129
Fig. 11.

Fig. 11

Grad-CAM based visual interpretations for selected honeybee frame samples from the Healthy and Infestation classes. (a) Heatmaps showing key regions influencing XAI-HoneyNet predictions. (b) Heatmaps overlaid with ground-truth masks to provide a quantitative assessment of model focus on infestation areas, enhancing interpretability.

Results for infestation sub-classification

The sub-classification task aimed to identify the developmental stages of wax moth infestation namely, Larva, Pupa, and Adult incorporating a multi-class classification framework. A holistic comparison of model performance across key metrics is presented in Table 6b, comprising accuracy, precision, recall, F1 score, specificity, MCC, and training and prediction time. Class-wise metrics for each stage (Larva, Pupa, and Adult) are also reported to provide a detailed understanding of the model’s discriminative ability. Among individual classifiers, LR illustrated the most robust performance, achieving an accuracy of 0.95, with balanced precision, recall, and F1 score (all 0.95), and a high MCC of 0.9223. It also maintained strong specificity (0.9671) and efficient training and prediction times (16.62 and 0.023 s, respectively). Extra Trees followed closely, delivering an accuracy of 0.93 and an MCC of 0.9021, while maintaining lower training and prediction times (7.64 and 0.081 s). SVM attained an accuracy of 0.92 with an MCC of 0.8873, though at higher training and prediction times (43.20 and 2.10 s). RF achieved slightly lower accuracy (0.91) and MCC (0.8717), yet remained competitive (training and prediction: 24.25 and 0.079 s). K-Nearest Neighbours exhibited the weakest performance across metrics, with an accuracy of 0.82 and the lowest MCC (0.7494), though it demonstrated the fastest prediction time (0.683 s), which may be beneficial in latency-sensitive scenarios. Adaptive Boosting produced moderate results (accuracy: 0.88; MCC: 0.8131), but its high training time (130.91 s) limits practical applicability.

Ensemble models surpassed individual classifiers in overall performance. The Voting Ensemble XAI-PestNet (LR+Extremely Randomized Trees) secured the highest classification accuracy of 0.96, along with excellent precision, recall, and F1 score (0.96, 0.96, and 0.95, respectively), and the highest MCC value (0.9327). Its specificity (0.9775) further underscores its discriminative strength, while training and prediction times (24.68 and 0.087 s) make it feasible for real-time deployment. The Stacking Ensemble matched the Voting Ensemble in predictive performance but incurred significantly higher training and prediction times (118.24 and 0.098 s), which may constrain scalability. These results substantiate the superiority of ensemble learning strategies, notably the voting classifier, in capturing complex intra-class variations. The Voting Ensemble XAI-PestNet demonstrated a strong balance between predictive accuracy, interpretability, and computational feasibility, making it highly suitable for practical implementation in automated apiculture surveillance systems.

Confusion matrix

Figure 12 displays the confusion matrix for all employed models used to subclassify the ’Infestatio’ category into Larva, Pupa, and Adult stages. The diagonal values represent correct predictions, while off-diagonal values correspond to misclassifications. The matrix reveals that the selected ensemble model surpassed other models with the highest subclassification accuracy with minimal confusion across categories. In particular, it effectively distinguished between morphologically similar stages such as Pupa and Adult, which are often misclassified by other models. This result underscores the robustness and precision of the outperforming ensemble technique in handling fine grained classification tasks within the biological domain.

Fig. 12.

Fig. 12

Confusion matrix illustrating the classification performance for infestation sub-classes: Larva, Pupa, and Adult. The matrix presents correct and misclassified instances, offering insight into the model’s capability to discriminate between developmental stages of wax moth infestation.

ROC-AUC score evaluation for infestation subclass

Figure 13 illustrates the ROC-AUC curve for all employed models in classifying the Infestation subclasses, Larva, Pupa, and Adult. The outperformed model XAI-PestNet achieved a perfect AUC score of 1.0, demonstrating exceptional discriminatory capability across all infestation stages. This high AUC value confirms the model’s robustness and precision in handling multiclass classification tasks within complex biological imagery. The clear separation between classes further highlights the reliability of the selected ensemble approach, reinforcing its suitability for accurate, subclass-level detection in automated pest monitoring systems.

Fig. 13.

Fig. 13

ROC curves illustrating the classification performance for infestation sub-classes: Larva, Pupa, and Adult. The Area Under the Curve (AUC) values indicate the discriminative capability of the model across multiple classes.

Cross validation for sub-classification (Larva, Pupa, Adult)

Following infestation detection, a sub-class classification task was conducted to identify the developmental stage of infestation Larva, Pupa, or Adult. All models were evaluated using 10-fold cross-validation, and their mean accuracies and standard deviations are summarized in Table 10. Our proposed model XAI-PetNet secured the highest accuracy of 0.9342 with the lowest standard deviation 0.0145 for sub-class, indicating strong and consistent performance. The Stacking Ensemble yielded comparable results with an accuracy of 0.9229 and a deviation of 0.0104. Among individual classifiers, Logistic Regression performed competitively 0.9334 accuracy, followed by Extremely Randomized Trees 0.9143 and Random Forest 0.9048. SVM and AdaBoost attained moderate accuracies of 0.9074 and 0.8711, respectively, while K-Nearest Neighbours lagged with the lowest accuracy 0.8147. These results underscore the advantage of ensemble strategies in handling complex multi-class classification, particularly for accurate identification of infestation stages in honeybee hives.

Table 10.

Cross-validation performance analysis for infestation sub-class classification across developmental stages: Larva, Pupa, and Adult. The results reflect model consistency and generalization capability based on 10-fold cross-validation.

Models Mean CV accuracy Standard deviation
Logistic regression 0.9334 0.0163
Random forest 0.9048 0.0180
Support vector machine 0.9074 0.0225
K nearest neighbours 0.8147 0.0260
Adaptive boosting 0.8711 0.0437
Extremely randomized trees 0.9143 0.0191
XAI-PestNet 0.9342 0.0145
Stacking ensemble (LR+extra trees) 0.9229 0.0104

Statistical validation of sub-class classification

For the sub-class classification (Infestation: Larva, Pupa, Adult) using the Voting model, Cohen’s Kappa indicated strong agreement (Inline graphic), while the one-sample t-test against a baseline of 0.5 confirmed statistical significance (Inline graphic, Inline graphic). ANOVA comparing Voting and Stacking models showed no significant differences (Inline graphic, Inline graphic), further validating the reliability of the sub-class prediction. These results are summarized in Table 11.

Table 11.

Statistical validation metrics for Infestation sub-class classification (Larva, Pupa, Adult). Metrics include Cohen’s Kappa, one-sample t-test, and ANOVA results.

Statistical measure Value
Cohen’s kappa (Inline graphic) 0.9161
One-sample t-test Inline graphic, Inline graphic
ANOVA (ensemble models) Inline graphic, Inline graphic

Model interpretability for infestation subclass

To enhance the interpretability of the outperforming Voting Ensemble model, the Grad-CAM (Gradient-weighted Class Activation Mapping) technique was applied. Although traditionally designed for convolutional neural networks, a hybrid adaptation was employed to generate activation maps based on feature importance derived from the ensemble components. As visualized in Fig. 14, the Grad-CAM heatmaps and their overlays with ground-truth infestation masks reveal the key visual regions in the honeycomb images that contributed most to subclass predictions, specifically for Larva, Pupa, and Adult. These highlighted areas aligned well with domain knowledge, emphasizing morphological traits associated with different infestation stages. However, some subtle yet relevant features remained less visible, reflecting the interpretability limitations inherent to ensemble-based architectures, which often function as black-box systems. Although the present analysis primarily emphasizes qualitative visualization, the observed activation regions consistently focus on biologically relevant infested zones. Future work will incorporate region-based quantitative measures, such as the percentage of focus overlap with annotated infestation areas, to strengthen the interpretability and reliability of the Grad-CAM analysis. Furthermore, the integration of additional post-hoc interpretation techniques, including Score-CAM or Layer-wise Relevance Propagation (LRP), could provide a more comprehensive explanation of feature relevance in future extensions of this work.

Fig. 14.

Fig. 14

Grad-CAM-based visual interpretability for the outperformed model XAI-PestNet in infestation sub-class classification of honeybee comb images. (a) Grad-CAM highlights key spatial regions contributing to classification decisions. (b) Overlay with ground-truth masks provides a quantitative assessment of model focus, enhancing explainability in the hybrid vision-based framework.

Deployment feasibility and hive integration

Our proposed model XAI-HoneyNet demonstrates both high accuracy and computational efficiency, making it suitable for real-time deployment in honeybee hives. The model contains a total of approximately [insert number] parameters, trained offline in 37.68 seconds on the full dataset. Prediction on the test set corresponding to a per-sample inference time of 1.97 milliseconds. Such low-latency inference ensures timely detection of wax moth infestations, enabling prompt intervention before colony damage occurs. The lightweight nature of the Voting Ensemble, compared to more complex approaches such as Stacking Ensembles, supports integration into low-power embedded devices or hive monitoring systems without substantial hardware overhead. This efficiency is particularly important for practical applications in confined and resource-constrained hive environments, where rapid processing of high-resolution images is necessary. Consequently, the proposed framework effectively balances predictive performance, explainability via SHAP and Grad-CAM, and deployment feasibility, supporting real-time hive monitoring and early-stage wax moth infestation management.

Limitations

Despite the high accuracy obtained by the proposed XAI-HoneyNet and XAI-PestNet frameworks, several limitations persist. Unlike dedicated pest detection frameworks such as YOLO, classical DL algorithm sometimes failed to capture specific infestation targets like larva, pupa and adult, instead emphasizing diffuse or non-informative regions, which highlights a limitation in spatial attention and localization. This may increase computational cost and reduce interpretability. Retraining with region-focused strategies is necessary to refine feature localization. Corollarily, the dataset was region-specific, which may limit generalizability across diverse environmental conditions. The reliance on image data alone also restricts the system’s ability to capture broader indicators of infestation. Explainability analysis using SHAP and Grad-CAM provided valuable insights into the behavior of the proposed VGG16-based XAI-HoneyNet model. The visual interpretations confirmed that the model performed effectively for the main classification, accurately distinguishing among categories. However, in the sub-classification of infestation stages (Larva, Pupa, and Adult), Grad-CAM revealed that the model’s attention was sometimes diverted toward background structures such as comb texture, shadows, or uneven illumination rather than the actual pest regions. This indicates that while the model generalizes well for broad classification, it exhibits limitations in fine-grained sub-class discrimination. Addressing this issue requires incorporating object detection or segmentation-based methods to better localize infestation regions and enhance interpretability.

Future outlook

Future research can build upon these findings by integrating object detection or segmentation-based frameworks such as YOLOV8 or Mask-RCNN to isolate pest regions prior to classification. This enhancement would enable more precise quantification of region-specific attention and improve the interpretability of sub-class predictions. AIncorporating sensor-driven automation for data acquisition could enable scheduled or anomaly-triggered image capture, enhancing real-time detection capabilities. Integrating environmental sensors such as temperature, humidity, and vibration may support multimodal dataset creation, fortifying robustness under diverse conditions. Future iterations may also utilize edge AI deployment on low-power devices like Raspberry Pi or Jetson Nano for in-field inference. Additionally, combining imagery with acoustic or environmental data could provide deeper biological insights into hive health, while temporal tracking and behavior analysis across time-series images could facilitate early outbreak prediction.Federated learning approaches may also allow decentralized training across different apiaries, preserving data privacy. Developing a mobile-integrated alert system could assist beekeepers with real-time notifications and intervention guidance. Although the present study emphasizes the interpretability advantages of the VGG16 backbone, future research will explore performance and explainability trade-offs incorporating more recent architectures such as ResNet50, DenseNet121, EfficientNet-B0, and transformer-based self-attention models. This planned extension aims to evaluate whether modern, parameter-efficient CNNs and transformer architectures can attain comparable interpretability under SHAP and Grad-CAM frameworks while maintaining real-time feasibility for field-level deployment. Additionally, the classification of infestation stages (mild, moderate, severe) has not been implemented yet, but we plan to include this stage-based categorization in future work to further evaluate inter-class confusion and enhance real-world applicability. Future work may also incorporate advanced explainability methods such as Score-CAM or Layer-wise Relevance Propagation (LRP) to further enhance transparency and model interpretability in apicultural pest management.

Comparative analysis with state-of-the-art models

To contextualize the proposed XAI-HoneyNet and XAI-PestNet within the broader landscape of intelligent pest detection, a comparative evaluation was performed against recent state-of-the-art frameworks. While models such as GBiDC-PEST 40, DMSAU-Net 42, and Transformer-based systems 43 demonstrate competitive accuracy, their focus lies in generic agricultural pest detection or mobile optimization, often without explainability components. Likewise, Smartphone-DSS 58 and APNet 44 emphasize lightweight deployment but lack hierarchical pest stage classification. A summarized comparison with existing benchmark models is presented in Table 12.

Table 12.

Comparison of XAI-HoneyNet and XAI-PestNet with state-of-the-art pest detection frameworks.

Model/study Dataset Accuracy (%) mAP (%) Key highlights
GBiDC-PEST 40 Tpest-3960 N/A 80.1 Lightweight YOLO (2.8MB), high FPS
DL-IP102 41 IP102 84.95 N/A ResNet with segmentation and augmentation
DMSAU-Net 42 IP102 92.16 N/A U-Net with dilated attention modules
Transformer-KG 43 Cotton dataset 94.00 95.00 Transformer + knowledge graphs + edge AI
APNet 44 ATZD01 87.10 N/A YOLOv8n-based detection with fusion modules
Smartphone-DSS 58 Custom N/A 70.2 (mAP50) Mobile AI with DSS, citizen science
XAI-HoneyNet (Our) Custom (binary) 99.00 99.94 (ROC AUC) SHAP + Grad-CAM + Voting ensemble
XAI-PestNet (Our) Custom (multiclass) 96.00 1.00 Stage-wise classification (Larva, Pupa, Adult) with Grad-CAM

Conclusion

This study introduced an adaptive, hierarchical pest detection framework for the early-stage identification of wax moth (Galleria mellonella) infestations in honeybee hives, leveraging a real world, high resolution dataset comprising 3,252 labeled images collected from apiaries in Rahim Yar Khan, Pakistan, during May–August 2024. The proposed framework was structured into two levels of classification: main-class differentiation between healthy and infested hives, and subclass identification across developmental stages (larva, pupa, and adult). Feature extraction was accomplished through a transfer learning approach using a pre-trained VGG16 convolutional neural network, followed by classification using a combination of classical and ensemble machine learning models, including Random Forest, Logistic Regression, Support Vector Machine, K-Nearest Neighbours, and advanced ensemble methods such as Voting and Stacking. The XAI-HoneyNet ensemble exhibited exceptional predictive capability for the main class, achieving a test accuracy of 99%, an ROC AUC score of 0.9994, and a mean 10 fold cross validation accuracy of 98.92%. These results were supported by robust statistical validations, including Cohen’s Kappa (Inline graphic), a highly significant one-sample t-test (Inline graphic, Inline graphic), and an ANOVA analysis comparing ensemble methods (Inline graphic, Inline graphic). For subclass-level categorization, the XAI-PestNet model delivered 96% accuracy, along with high Matthews Correlation Coefficient (MCC) and ROC AUC scores, demonstrating consistent detection performance across all infestation stages. To ensure interpretability and trust in the model’s predictions, explainable AI (XAI) methods were applied. Specifically, SHapley Additive exPlanations (SHAP) and Gradient-weighted Class Activation Mapping (Grad-CAM) highlighted key image regions and feature contributions that influenced model decisions. Overall, the proposed XAI-HoneyNet and XAI-PestNet models constitute a reliable, interpretable, and computationally efficient framework for hierarchical pest detection. This work significantly contributes to the advancement of intelligent pest monitoring in smart apiculture, promoting precision agriculture practices through early detection and informed decision making.

Acknowledgements

This project is partly supported by University of Sharjah, United Arab Emirates.

Author contributions

A.G.: Conceptualization, investigation, methodology, writing-original draft, validation. M.M.: Investigation, data curation, conceptualization, writing-original draft, resources. M.A.: Writing-review & editing, validation, supervision, project administration. M.W.: Software, writing-original draft, resources. S.A.J.Z.: Validation, supervision. K.M.: Validation, supervision. M.K.I.: Project administration, funding acquisition. S.R.H.: Validation, supervision. All authors reviewed and approved the final version of the manuscript.

Funding

No Funding

Data availability

Data supporting the results of this study can be obtained from the corresponding authors upon reasonable request.

Declarations

Competing interests

The authors declare no competing interests.

Visualization design

The dataset images were captured from real honeybee hives under varying light and angle conditions. Conceptual figures were prepared to illustrate the manual inspection and infestation detection workflow. Some conceptual idepiction like Fig. 1 were developed utilizing Canva’s intelligent design interface to enhance visual explanation; these visuals were not involved in data collection or analysis.

Footnotes

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Change history

5/13/2026

The original online version of this Article was revised: The Acknowledgements section in the original version of this Article contained errors. It now reads: “This project is partly supported by University of Sharjah, United Arab Emirates.” The original Article has been corrected.

Contributor Information

Mohamad Khairi Ishak, Email: mishak@sharjah.ac.ae.

Syed Rizwan Hassan, Email: syedrizwanhassan@gmail.com.

References

  • 1.Tang, Z., Chen, Z., Qi, F., Zhang, L. & Chen, S. Pest-yolo: Deep image mining and multi-feature fusion for real-time agriculture pest detection. In 2021 IEEE International Conference on Data Mining (ICDM), 1348–1353 (IEEE, 2021).
  • 2.Vijayakumar, K. et al. Survey, biology and management of greater wax moth, Galleria mellonella l. in Southern Karnataka, India. J. Entomol. Zool. Stud.7, 585–592 (2019). [Google Scholar]
  • 3.Sohail, M., Aqueel, M. A., Ellis, J. D., Afzal, M. & Raza, A. M. Seasonal abundance of greater wax moths (Galleria mellonella l.) in hives of western honey bees (Apis mellifera l.) correlates with minimum and maximum ambient temperature. J. Apic. Res.56, 416–420 (2017). [Google Scholar]
  • 4.Ahmad, I. et al. Deep learning based detector yolov5 for identifying insect pests. Appl. Sci.12, 10167 (2022). [Google Scholar]
  • 5.Vidya Madhuri, E. et al. Transforming pest management with artificial intelligence technologies: The future of crop protection. J. Crop Health77, 48 (2025). [Google Scholar]
  • 6.Pandey, D. K. & Mishra, R. Towards sustainable agriculture: Harnessing ai for global food security. Artif. Intell. Agric.12, 72–84 (2024). [Google Scholar]
  • 7.Ullah, A. et al. Viral impacts on honey bee populations: A review. Saudi J. Biol. Sci.28, 523–530 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 8.Nielsen, R. A. & Brister, C. Greater wax moth: Behavior of larvae. Ann. Entomol. Soc. Am.72, 811–815 (1979). [Google Scholar]
  • 9.Swamy, B. C. H. Bionomics and biometrics of greater wax moth Galleria mellonella linnaeus. Asian J. Bio Sci.3, 49–51 (2008). [Google Scholar]
  • 10.Pietrykowska-Tudruj, E., Staniec, B., Wojda, I. & Wagner, G. Insight into the larva of the greater wax moth Galleria mellonella as a model organism, with a pictorial key for identifying larval stages. Eur. Zool. J.92, 337–360 (2025). [Google Scholar]
  • 11.Borah, A., Koundal, S. & Gharde, S. K. Effect of biotic and abiotic factors on the abundance of greater wax moth, *Galleria mellonella* l. Int. J. Adv. Biochem. Res.8, 772–781. 10.33545/26174693.2024.v8.i7j.1587 (2024). [Google Scholar]
  • 12.Elbehery, H., Abd El-Wahab, T. E. & Dimetry, N. Z. Management of the greater wax moth Galleria mellonella with neem azal-t/s, in the laboratory and under semi-field conditions. J. Apicult. Sci.60, 69 (2016). [Google Scholar]
  • 13.Shoukry, I. F. et al. Histopathological and biochemical efficacy of some entomopathogenic nematodes on the greater wax moth, galleria melonella larvae (lepidoptera: Pyralidae). J. Asia-Pac. Entomol.28, 102409 (2025). [Google Scholar]
  • 14.Singh, G. & Rana, A. Honeybees and colony collapse disorder: understanding key drivers and economic implications. Proc. Indian Natl. Sci. Acad. 1–17 (2025).
  • 15.Kwadha, C. A., Ong’amo, G. O., Ndegwa, P. N., Raina, S. K. & Fombong, A. T. The biology and control of the greater wax moth, Galleria mellonella. Insects8, 61 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 16.García-Vicente, E. J. et al. Main causes of producing honey bee colony losses in southwestern Spain: a novel machine learning-based approach. Apidologie55, 67 (2024). [Google Scholar]
  • 17.Mrozek, D., Goórny, R., Wachowicz, A. & Małysiak-Mrozek, B. Edge-based detection of varroosis in beehives with IOT devices with embedded and TPU-accelerated machine learning. Appl. Sci.11, 11078 (2021). [Google Scholar]
  • 18.Zhang, Y. & Lv, C. Tinysegformer: A lightweight visual segmentation model for real-time agricultural pest detection. Comput. Electron. Agric.218, 108740 (2024). [Google Scholar]
  • 19.Ahmed, S. et al. Iot based intelligent pest management system for precision agriculture. Sci. Rep.14, 31917 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 20.Rahman, W. et al. Automated detection of harmful insects in agriculture: A smart framework leveraging iot, machine learning, and blockchain. IEEE Trans. Artif. Intell. (2024).
  • 21.Bhandari, M., Shahi, T. B., Neupane, A. & Walsh, K. B. Botanicx-ai: Identification of tomato leaf diseases using an explanation-driven deep-learning model. J. Imaging9, 53 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 22.Qi, F., Wang, Y., Tang, Z. & Chen, S. Real-time and effective detection of agricultural pest using an improved yolov5 network. J. Real-Time Image Proc.20, 33 (2023). [Google Scholar]
  • 23.Qian, S. et al. An effective pest detection method with automatic data augmentation strategy in the agricultural field. SIViP17, 563–571 (2023). [Google Scholar]
  • 24.Amrani, A., Diepeveen, D., Murray, D., Jones, M. G. & Sohel, F. Multi-task learning model for agricultural pest detection from crop-plant imagery: A Bayesian approach. Comput. Electron. Agric.218, 108719 (2024). [Google Scholar]
  • 25.Dong, Q., Sun, L., Han, T., Cai, M. & Gao, C. Pestlite: A novel yolo-based deep learning technique for crop pest detection. Agriculture14, 228 (2024). [Google Scholar]
  • 26.Hu, Y. et al. Macnet: A more accurate and convenient pest detection network. Electronics13, 1068 (2024). [Google Scholar]
  • 27.Yuan, W. et al. Smart agricultural pest detection using i-yolov10-sc: An improved object detection framework. Agronomy15, 221 (2025). [Google Scholar]
  • 28.Ferreira, T. P. et al. Potential use of negramina (Siparuna guianensis aubl.) essential oil to control wax moths and its selectivity in relation to honey bees. Ind. Crops Prod.109, 151–157 (2017). [Google Scholar]
  • 29.Hood, W. M., Horton, P. M. & McCreadie, J. W. Field evaluation of the red imported fire ant (hymenoptera: Formicidae) for the control of wax moths (lepidoptera: Pyralidae) in stored honey bee comb. J. Agric. Urban Entomol20, 93–103 (2003). [Google Scholar]
  • 30.Han, B. et al. Greater wax moth control in apiaries can be improved by combining bacillus thuringiensis and entrapments. Nat. Commun.14, 7073 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 31.Hosni, E. M., Al-Khalaf, A. A., Nasser, M. G., Abou-Shaara, H. F. & Radwan, M. H. Modeling the potential global distribution of honeybee pest, Galleria mellonella under changing climate. Insects13, 484 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 32.Adly, D. & Marzouk, W. Efficacy of the larval parasitoid, Bracon hebetor say. (hymenoptera: Braconidae) on the greater wax moth larvae, Galleria mellonella (l.) (lepidoptera: Pyralidae) under laboratory and field conditions. Egypt. J. Biol. Pest Control29, 1–7 (2019). [Google Scholar]
  • 33.Kaboré, B. A. et al. Prevalence and risk factors of wax moth in bee colonies in the central and central-west regions of burkina faso: pilot study. Int. J. Biol. Chem. Sci.15, 1469–1478 (2021). [Google Scholar]
  • 34.Kunduracioglu, I. Utilizing resnet architectures for identification of tomato diseases. J. Intell. Decis. Mak. Inf. Sci.1, 104–119 (2024). [Google Scholar]
  • 35.Kunduracioglu, I. & Pacal, I. Advancements in deep learning for accurate classification of grape leaves and diagnosis of grape diseases. J. Plant Dis. Prot.131, 1061–1080 (2024). [Google Scholar]
  • 36.Kunduracıoğlu, İ & Paçal, İ. Deep learning-based disease detection in sugarcane leaves: evaluating efficientnet models. J. Oper. Intell.2, 235–321 (2024). [Google Scholar]
  • 37.Dhanaraj, R. K., Ali, M. A., Sharma, A. K. & Nayyar, A. Deep multibranch fusion residual network and iot-based pest detection system using sound analytics in large agricultural field. Multimed. Tools Appl.83, 40215–40252 (2024). [Google Scholar]
  • 38.Vilar-Andreu, M., García, L., Garcia-Sanchez, A.-J., Asorey-Cacheda, R. & Garcia-Haro, J. Enhancing precision agriculture pest control: A generalized deep learning approach with yolov8-based insect detection. IEEE Access (2024).
  • 39.Prasath, B. & Akila, M. Aetc: An automated pest detection and classification model using optimal integration of yolo+ ssd and adaptive ensemble transfer cnn with iot-assisted pest images. Knowl. Inf. Syst.66, 7077–7108 (2024). [Google Scholar]
  • 40.Xu, W., Yang, R., Karthikeyan, R., Shi, Y. & Su, Q. Gbidc-pest: A novel lightweight model for real-time multiclass tiny pest detection and mobile platform deployment. J. Integr. Agric. (2024).
  • 41.Venkateswara, S. M. & Padmanabhan, J. Deep learning based agricultural pest monitoring and classification. Sci. Rep.15, 8684 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 42.Wang, X., Zhang, S. & Zhang, T. Crop insect pest detection based on dilated multi-scale attention u-net. Plant Methods20, 34 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 43.Gao, R. et al. Intelligent cotton pest and disease detection: Edge computing solutions with transformer technology and knowledge graphs. Agriculture14, 247 (2024). [Google Scholar]
  • 44.Li, M. et al. Apnet: Lightweight network for apricot tree disease and pest detection in real-world complex backgrounds. Plant Methods21, 4 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 45.Kunduracioglu, I. Cnn models approaches for robust classification of apple diseases. Comput. Decis. Mak. Int. J.1, 235–251 (2024). [Google Scholar]
  • 46.Ahmed, K., Dubey, M. K. & Pandey, D. K. Application of different transfer learning models to classify destructive insects in walnut fruit. Appl. Fruit Sci.67, 1–21 (2025). [Google Scholar]
  • 47.Wang, S. et al. Advances in deep learning applications for plant disease and pest detection: A review. Remote Sens.17, 698 (2025). [Google Scholar]
  • 48.Hardik, J. et al. Symptom-based early detection and classification of plant diseases using ai-driven cnn+ knn fusion software (ACKFS). Softw. Impacts 100755 (2025).
  • 49.Shen, R. et al. Bafl-svm: A blockchain-assisted federated learning-driven SVM framework for smart agriculture. High-Confid. Comput.5, 100243 (2025). [Google Scholar]
  • 50.Cheema, S. M. & Pires, I. M. Aiot based soil nutrient analysis and recommendation system for crops using machine learning. Smart Agric. Technol.11, 100924 (2025). [Google Scholar]
  • 51.Tamilkodi, R., Madhuri, N., Bhavani, G. G. D., Yadav, K. M. & Sayandh, P. Crop yield prediction with suitable fertilization using deep learning. In 2025 International Conference on Machine Learning and Autonomous Systems (ICMLAS), 47–52 (IEEE, 2025).
  • 52.Lakhouit, A., Rashed, W. S. A., Abbas, S. Y. & Shaban, M. Integrating machine learning for precision agriculture waste estimation and sustainability enhancement. Comput. Electron. Agric.230, 109933 (2025). [Google Scholar]
  • 53.Chacón-Maldonado, A., Asencio-Cortés, G. & Troncoso, A. A multimodal hybrid deep learning approach for pest forecasting using time series and satellite images. Inf. Fusion 103350 (2025).
  • 54.Sharma, A., Dalmia, R., Saxena, A. & Mohana, R. A stacked deep learning approach for multiclass classification of plant diseases. Plant Soil506, 621–638 (2025). [Google Scholar]
  • 55.Raju, R. & Thasleema, T. Cutting-edge ensemble framework of deep convolutional neural networks for high-precision insect pest classification. J. Plant Dis. Prot.131, 2207–2219 (2024). [Google Scholar]
  • 56.Rodríguez-Díaz, F., Chacón-Maldonado, A., Troncoso-García, A. & Asencio-Cortés, G. Explainable olive grove and grapevine pest forecasting through machine learning-based classification and regression. Results Eng.24, 103058 (2024). [Google Scholar]
  • 57.Ragu, N. & Teo, J. Pest classification: Explainable few-shot learning vs. convolutional neural networks vs. transfer learning.. Sci. Afr.27, e02512 (2025). [Google Scholar]
  • 58.Christakakis, P. et al. Smartphone-based citizen science tool for plant disease and insect pest detection using artificial intelligence. Technol.12, 101 (2024). [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Data Availability Statement

Data supporting the results of this study can be obtained from the corresponding authors upon reasonable request.


Articles from Scientific Reports are provided here courtesy of Nature Publishing Group

RESOURCES