Comparative Analysis of Machine Learning Models and Greylag Goose

Optimization for High-Accuracy Apple Quality Grading

Marwa M. Eid1,*, Anis Ben Ghorbal2

1Faculty of Artificial Intelligence, Delta University for Science and Technology, Mansoura 11152, Egypt

2Department of Mathematics and Statistics, Faculty of Science, Imam Mohammad Ibn Saud Islamic University (IMSIU), Riyadh 11432,

Saudi Arabia

Emails: mmm@ieee.org; assghorbal@imamu.edu.sa

Abstract

A significant barrier to sustaining and achieving successful quality evaluation of apples has been the biases and inefficiencies

of manual inspection, which cannot be effectively applied to large-scale industrial processing. This paper fills this gap by

building an automated machine learning system for apple quality classification, which combines physical (size, weight,

firmness) and sensory (sweetness, acidity, juiciness) features. Four baseline models, including K-Nearest Neighbors (KNN),

Naive Bayes, Decision Tree, and Gradient Boosting, were trained on a preprocessed dataset. Imputation, categorical encoding,

and feature scaling were used. To enhance predictive accuracy, hyperparameter tuning of three metaheuristic optimization

algorithms — Genetic Algorithm (GA), Particle Swarm Optimization (PSO), and Greylag Goose Optimization (GGO) —

was employed. The findings indicated that KNN had the highest baseline accuracy of 93.6% and that its accuracy improved

to 98.6% with GGO optimization, which was better than that of GA and PSO. These results indicate that GGO-optimized

KNN can provide a high-quality and scalable approach to assessing the quality of apples in the industry, offering enhanced

accuracy, reduced variability, and a high degree of practical applicability in supply chain decision-making, thereby increasing

customer satisfaction and decreasing losses after harvesting.

Keywords: Apple Quality Assessment; Machine Learning; Greylag Goose Optimization (GGO); Food Quality Prediction;

Smart Agriculture

1 Introduction

Ensuring and maintaining the quality of agricultural products has long been a central challenge in modern food production

systems. Among these products, apples represent one of the most economically significant fruits worldwide, forming a critical

part of global diets and agribusiness [1]. The quality of apples directly affects consumer satisfaction, market competitiveness,

and the efficiency of supply chains. Poor quality control can result not only in economic losses but also in reputational damage

for producers and distributors. Despite technological advances in farming and storage, quality assurance remains a bottleneck

due to the difficulty of consistent, scalable evaluation of essential attributes such as size, shape, color, texture, firmness, and

sugar content [2]. These attributes are inherently variable across orchards, seasons, and even within the same batch, making

reliable classification highly challenging. Furthermore, many of these traits are qualitative and require human judgment,

which is prone to subjectivity and inconsistency [3]. Traditional evaluation methods rely on manual inspection by trained

experts, who visually and physically examine apples for conformity with quality standards. While this practice benefits from

human intuition and experience, it suffers from limitations such as fatigue, time consumption, and inconsistency [4] [5]. At

the industrial scale, where millions of apples may pass through grading and packaging facilities on a daily basis, manual

inspection becomes not only impractical but also a major bottleneck to productivity [6]. Furthermore, physical inspection

introduces risks associated with authenticity and traceability [7]. For instance, varying interpretations among evaluators can

lead to discrepancies in quality grading, ultimately impacting brand image and consumer trust. Regulatory frameworks and

consumer expectations demand high accuracy and standardization in food quality evaluation [8]. Manual systems, therefore,

fail to provide the scalability, repeatability, and precision necessary for modern supply-chain operations [9]. This shortcoming

motivates the adoption of automated approaches capable of operating with industrial efficiency while maintaining high

accuracy and reliability [10]. In recent years, artificial intelligence (AI) and machine learning (ML) have gained prominence

as transformative technologies in agriculture and food industries. AI refers broadly to systems designed to perform tasks

that typically require human intelligence, whereas ML specifically focuses on algorithms that learn patterns from data to

make predictions or decisions [11]. These technologies are particularly suited to agri-food contexts, where large datasets