An Improved Model for Detecting the Presence of Pesticide Residues in Edible Parts of Tomatoes, Cabbages, Carrots, and Green Pepper Vegetables Using Batch Image Analysis
In this article, we describe an improved model for batch image analysis of pesticide residues in the edible parts of green peppers,tomatoes, cabbages, and carrots. Our method uses a deep learning–based convolutional neural network (CNN), an advanced image processing, feature extraction, and a dataset of 1,094 photographs collected from Mbarara city markets to accurately identify the presence of pesticides in the edible parts of vegetables. The model employs the following preprocessing techniques, that is, adaptive histogram equalization and Gaussian filtering, to enhance image quality before feature extraction through color analysis, edge detection, and texture measurement using the Gray Level Co-occurrence Matrix. The major improvement in this study was batch image processing, which significantly increases computational efficiency and enables the simultaneous analysis of several images. The CNN design consists of three convolutional layers, with max pooling coming after each layer. A probabilistic output is then generated by two fully connected layers. The other improvement was made on performance where the accuracy, precision, recall, and F1 score of the models particularly ResNet50 and Inception V3 produce dependable results. The accuracy and precision of ResNet50 were 93.2% and 94.0%, respectively. In comparison to the single image processing model for detecting pesticide residues in edible parts of vegetables, this improved model of batch image processing reduced the training time by 40%, demonstrating scalability for bigger datasets. Our results highlight the potential influence of this model on agricultural food safety practices by indicating that it can be used for the quick and extensive identification of pesticide residues. We suggest that future studies concentrate on the possibility of using multispectral photography and real-time apps to automate the identification of pesticide residues in vegetables. Received: 22 October 2024 | Revised: 2 July 2025 | Accepted: 22 August 2025 Conflicts of Interest The authors declare that they have no conflicts of interest to this work. Data Availability Statement The data that support the findings of this study are openly available in the vegetable chemical residue detection dataset at https://www.kaggle.com/datasets/vegetabledataset/mancozeb-and-other-chemical-residues. Author Contribution Statement Nabaasa Evarist: Conceptualization, Methodology, Validation, Writing – original draft, Writing – review & editing, Software, Data curation, Investigation, Formal analysis. Natumanya Deborah: Conceptualization, Validation, Writing – original draft, Writing review & editing, Data curation, Investigation, Project administration, Formal analysis. Mabirizi Vicent: Methodology, Software, Validation, Writing – original draft, Writing – review & editing, Visualization, Software, Investigation, Formal analysis.
Authors
- Mabirizi Vicent (ORCID: https://orcid.org/0000-0001-8990-4003)
- Evarist Nabaasa (ORCID: https://orcid.org/0000-0002-1722-767X)
- Natumanya Deborah (ORCID: https://orcid.org/0000-0002-4491-0650)
Institutions
- Mbarara University of Science and Technology (UG)
- Kabale University (UG)
Publication Details
- Journal
- Artificial Intelligence and Applications
- Published
- 2025-10-02
- DOI
- https://doi.org/10.47852/bonviewaia52024612
- Primary Topic
- Spectroscopy and Chemometric Analyses
- Type
- article
- Field-Weighted Citation Impact
- 0.00