Applying convolutional neural networks to X-ray images to improve postharvest detection of fruit fly infestation
Early detection of fruit fly (Diptera: Tephritidae) infestation in traded fruit is important for maintaining phytosanitary security, particularly for quarantine pests. This study evaluated the integration of micro-focus X-ray computed tomography (µCT) and deep learning as a non-destructive, automated, and scalable solution for postharvest pest detection. The Mediterranean fruit fly (medfly), Ceratitis capitata Wiedemann, 1824, was used as a model species and Navel oranges, Citrus sinensis (Osbeck), served as the host commodity. Controlled infestation experiments were conducted using both artificially punctured fruit to promote oviposition and intact fruit to avoid confounding effects associated with mechanical damage. Oranges were exposed to varying adult medfly densities to generate different infestation levels. Following exposure, the infested oranges were subjected to varying incubation periods to simulate different infestation stages. High-resolution µCT scans were first assessed manually and subsequently analyzed using a staged deep learning pipeline incorporating convolutional neural networks (CNNs), 3D CNNs, CNN-Long Short-Term Memory (LSTM) hybrids and Transformer-based models. Manual μCT inspection achieved mean correct classification rates of 0.84 in punctured fruit and 0.69 in intact fruit, with detection performance increasing with infestation stage. Deep learning analyses were conducted on a curated punctured-fruit dataset using a slice-level classification and voting-based aggregation strategy. Among the evaluated transfer-learning architectures, DenseNet121 achieved the best overall performance, reaching an accuracy of 0.88, a precision of 0.86, a sensitivity of 1.00, and an AUC of 0.80; because the manual and automated analyses were performed on different sets of fruit, these accuracies are complementary rather than directly comparable. Grad-CAM and attention visualizations confirmed that model predictions were driven by biologically meaningful tissue regions associated with larval damage. Although the deep learning workflow was developed and validated only on punctured fruit, the results demonstrate that μCT images contain sufficient information for automated detection of medfly infestation when infestation-associated damage is visible. These findings support the potential of combining μCT imaging and artificial intelligence (AI) for automated, reproducible and non-destructive postharvest pest detection and enhanced phytosanitary compliance in postharvest supply chains.
Authors
- Leani Serfontein (ORCID: https://orcid.org/0000-0002-1075-0089)
- C. Pezzoni
- Wayne Kirkman (ORCID: https://orcid.org/0000-0003-3773-6938)
- Guy F. Sutton (ORCID: https://orcid.org/0000-0003-2405-0945)
- Aruna Manrakhan (ORCID: https://orcid.org/0000-0003-2954-4450)
- Francesca Scolari (ORCID: https://orcid.org/0000-0003-3085-9038)
- Anna Sandionigi (ORCID: https://orcid.org/0000-0002-5257-0027)
- D Pescini
- Andrea Moyano
- Sean Moore
- Jakobus Hoffman
- Lunga Bam
- Grzegorz J. Możdżyński
Institutions
- Rhodes University (ZA)
- South African Nuclear Energy Corporation (South Africa) (ZA)
- Stellenbosch University (ZA)
- Istituto di Genetica Molecolare (IT)
- Citrus Research International (ZA)
- Poznań University of Technology (PL)
- University of Milano-Bicocca (IT)
Publication Details
- Journal
- Postharvest Biology and Technology
- Published
- 2026-09-12
- DOI
- https://doi.org/10.1016/j.postharvbio.2026.114707
- Primary Topic
- Insect behavior and control techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- Citrus Research International
- HORIZON EUROPE Framework Programme