Next Article in Journal
Revealing the Functional Microbiota of Caproic Acid-Producing and Lactic Acid-Utilizing Bacteria in the Pit Muds for Chinese Nong-Xiang Baijiu Fermentation
Previous Article in Journal
Recent Applications of Machine Learning Algorithms for Pesticide Analysis in Food Samples
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Automated Mango Variety Classification Using Deep Feature Extraction and Machine Learning Classifier Integration

1
College of Biosystems Engineering and Food Science, Zhejiang University, Hangzhou 310058, China
2
Agricultural Engineering Institute (AEI), National Agricultural Research Centre (NARC) Pakistan Agricultural Research Council, Islamabad 44000, Pakistan
3
Department of Nutrition & Food Science, National Research Centre, Dokki, Giza 12622, Egypt
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Foods 2026, 15(3), 414; https://doi.org/10.3390/foods15030414
Submission received: 26 November 2025 / Revised: 12 January 2026 / Accepted: 20 January 2026 / Published: 23 January 2026
(This article belongs to the Section Food Analytical Methods)

Abstract

Manual mango variety classification is time-consuming, error-prone, and contributes significantly to post-harvest losses in developing economies. This study aims to develop a computationally efficient and highly accurate artificial intelligence framework for automated mango variety classification suitable for real-time applications. Eight deep transfer learning models were evaluated as feature extractors and combined with ten classical machine-learning classifiers. Model performance was assessed using accuracy, log loss, memory usage, training time, and inference latency. The hybrid models EfficientNetB0–Linear Discriminant Analysis (LDA) and ResNet50–Logistic Regression achieved 100% test accuracy while reducing inference time by up to 330 times compared to full Convolutional Neural Network (CNN) models. These findings demonstrate that hybrid deep-learning and machine-learning architectures can deliver state-of-the-art accuracy with substantially lower computational cost. Future research will focus on large-scale real-world validation and embedded hardware deployment for industrial fruit sorting systems.

1. Introduction

Mango (Mangifera indica L.), a member of the Anacardiaceae family, is globally renowned as the “King of Fruits” due to its sweet taste and high nutritional value [1]. There are more than a thousand mango varieties available in countries such as Pakistan, India, and China, each having distinct characteristics in terms of texture (shape, size), color, and aroma [2]. The high demand for mangoes in the international market depends upon the quality of grading and certified packaging [3]. The mango industry is facing significant challenges in the standardization of grading procedures, proper packaging, and certification, mainly because it relies heavily on human labor, which adversely affects the exports [4]. Traditionally, the way of harvesting, grading according to the physical appearance, and also the packaging of mangos is labor-intensive and incompatible with man’s daily working capacity, which leads to fatigue [5]. During post-harvest management, nearly 30–35% of mangos are wasted because of incorrect and delayed identification, grading, and sorting by unskilled labor [6,7]. Therefore, the development and implementation of efficient and intelligent automated systems for mango classification and grading are imperative to meet export quality standards and satisfy the demand for freshly harvested mangos.
Over the Past five decades, artificial intelligence (AI) and computer vision (CV) have significantly influenced the Agri-tech industry, offering a solution to accelerate the processes of fruit harvesting, classification, and grading for quality control and packing [8,9,10,11,12]. The identification of distinct mango varieties presents a particular challenge due to their diverse geometric shapes, forms, and features [13,14]. The scarcity of research literature on mango variety classification, compared to studies on other fruits, is mainly due to the limited availability of relevant datasets. By integrating deep learning (DL) and machine learning (ML) techniques, Computer vision has enabled the recognition of mango types and the evaluation of their quality. Deep learning is a subtype of machine learning technology that uses various layers of neural networks to convert unstructured data into meaningful and valuable insights [15].
Several classification techniques were adopted by the previous research works to ensure the quality of mangos, such as near-infrared spectroscopy and Convolutional Neural Networking (CNN) integration [16] and deep learning-based classification [17]. Deep learning fruit classification methods are widely used in the post-harvest stage and the fruit industry. A research study was conducted to improve mango classification and grading using image processing. The Genetic Algorithm Neuro-Fuzzy Inference System (GANFIS) method was applied to the combined genetic algorithms and an adaptive neuro-fuzzy inference system in feature selection and classification in terms of color, shape, and texture. The outcome of the study indicated high performance with 99.18% accuracy, 98.05% sensitivity, and 97.39% specificity [18]. Pratap et al. proposed a lightweight CNN model for mango classification, achieving 97.50% accuracy trained on a dataset of 1600 preprocessed images comprising 800, 350, and 450 samples across three classes [19]. To improve the classification of mango varieties the MobileNet and hybrid ResNet50 models were tested with data augmentation and principal component analysis (PCA), in combination with different machine learning classifiers. The suggested method identified a 100 percent accuracy, precision, recall, and F1-score, which showed its efficiency [20]. Furthermore, a study employing three CNN architectures VGG16, ResNet152, and Inception v3 for the classification and grading of mango cultivars reported that Inception v3 achieved a classification accuracy of 99.2% and a grading accuracy of 96.7% [7]. The study aims to grade mangoes based on shape and estimate weight using visible imaging. A Fourier descriptor method with Discriminant Analysis (DA) and Support Vector Machine (SVM) achieved 98.3% and 100% accuracy, respectively, while a cylinder approximation method predicted fruit weight with 94.0% R2 and 95% grading accuracy [1]. To improve the accuracy of mango grading by means of a multi-level automated system, the ripening stage (through CNN) with 93.23% accuracy, and defects were classified by using a Random Forest model with 95.11% accurcay [21]. Widiyanto et al. applied three grades of mangos, super, A, and B, for the Computer Vision-based classification using Gray-Level Co-occurrence Matrix (GLCM texture-like features and K-Nearest Neighbors (kNN) classification algorithm and kNN achieved an accuracy of 88.88% with a k = 9 value. [22].
Supekar et al. developed a grading system for Dasheri and Kesar mangoes that extracted image features for a Random Forest classifier, applied K-means clustering to segment defects, and used formula-based rules to assign a final grade with 88.88% accuracy [23]. Pandey et al. performed the classification of 15 mango varieties through a transfer learning models (AlexNet, GoogLeNet, ResNet50, VGG16). and by utilizing resized images of 277 × 277 the average performance of the models was measured by calculating the mean, minimum, and maximum values of the F1 score and False Positive Rate (FPR) [24]. Research on the sorting, grading, and classification of mango varieties has employed selected deep transfer learning models, machine learning classifiers, and fine-tuning techniques to identify models’ capabilities to distinguish between different mango types. However, these studies lack clear matrices related to the testing procedures and selection parameters (like training time, inference time of image processing, peak memory usage, and average feature extraction time), which demonstrate the model’s suitability for the dataset. Current methods have not achieved 100% accuracy in the classification of mango varieties. Furthermore, a comprehensive comparative analysis of the integration of deep transfer learning and machine learning for developing fast and accurate models has not been conducted.
Despite significant advances in deep learning for fruit classification, there remains a lack of reproducible, computationally efficient, and real-time capable hybrid frameworks that systematically integrate deep feature extraction with lightweight machine-learning classifiers. Therefore, the scientific problem addressed in this study is the absence of a scalable and low-latency AI architecture for mango variety classification suitable for practical deployment. The aim of this research is to compare eight transfer learning models, integrate the best-performing feature extractors with ten machine-learning classifiers, and identify an optimal hybrid architecture for accurate and real-time mango variety classification.

2. Materials and Methods

Initially, in evaluating the proposed methodology against the traditional benchmark method for classifying mango varieties, the manual assessment of mango cultivar classification was considered. Subsequently, a state-of-the-art dual-phase approach was developed for recommending the most suitable machine vision based on an artificial intelligence model for the automated, real-time on-farm classification of different mango varieties. This study utilized a publicly accessible dataset comprising eight mango varieties: Anwar Ratool (AR), Chaunsa (Black) (CB), Chaunsa (Summer Bahisht) (CSB), Chaunsa (White) (CW), Dosehri (DR), Fajri (FR), Langra (LR), and Sindhri (SR). Initially, eight deep transfer learning models, DenseNet201, EfficientNetB0, InceptionV3, MobileNetV2, NASNet, ResNet50, VGG16, and Xception, were assessed through comparative analysis using model performance metrics. Based on criteria such as training time, inference time per image, and peak memory usage, four models, EfficientNetB0, MobileNetV2, NASNet, and ResNet50, were selected for further optimization. In the second stage, the dense layers of these models were removed, and ten machine learning classifiers (SVM, k-NN, Decision Tree, Random Forest, Logistic Regression, Linear Discriminant Analysis (LDA), Quadratic Discriminant Analysis (QDA), Naive Bayes, XGBoost, and LightGBM) were integrated to enhance classification performance. Based on evaluation metrics including Accuracy, Precision, Recall, F1-Score, Log Loss, training time, inference time, and memory usage, EfficientNetB0-LDA and ResNet50-Logistic Regression were recommended for the real-time automatic classification of mango varieties.

2.1. Human Assessment of Mango Cultivars

While assessing human appreciation of mango cultivators, eight different varieties of mango, specifically, Anwar Ratool, Chaunsa (Black), Chaunsa (Summer Bahisht), Chaunsa (White), Dosehri, Fajri, Langra, and Sindhri were selected. The samples of each variety taken into consideration were 100, and five people of the mango harvesting workforce were randomly selected. Three farms were selected, located in Multan, Pakistan, and three replications were tested, meaning that 2400 samples of mango were evaluated. The basis of classifications was carried out on visual and tactile inspection of cultivar characteristics, which are specific to such structures as skin, shape, and color. Figure 1 illustrates the key visual characteristics of mango varieties that play a significant role in manual classification. The assessment, with each evaluator separately recording its own classifications without viewing the actual labels and majority voting to obtain the results, was performed. Accuracy, precision, recall, and F-score were also calculated using the counts of true positives as well as false positives and false negatives, with each measurement being computed per cultivar and across replications. The confidence was determined according to the degree of consistency between the assessors (e.g., High in case 4 out of 5 assessors agreed).

2.2. Existing Manual Post-Harvest Activities

In Pakistan, various processes are generally undertaken in the post-harvest management of mangoes before the fruit reaches both domestic and international markets. At first, mangoes are manually picked from the fields and then brought together at a designated location. The subsequent crucial step involves sorting the mangoes into different varieties. Following this, the same varieties are graded according to quality parameters. Figure 2 presents a detailed flowchart that outlines the post-harvest processes employed by small-scale mango farmers in Pakistan. In most mango supply chains, especially in those with smallholders, different species of mangoes are grown interspersed. These varieties tend to become mixed during harvest as a result of manual labor, unskilled labor, and limited space. This has the potential to cause contaminated batches to be shipped to packhouses where manual separation is prone to error. The accurate classification and grading of mangoes are crucial for reducing the duration required for their transportation from the farm to the marketplace, while also effectively managing post-harvest losses.

2.3. Data Acquisition and Preprocessing

This study utilized a publicly available dataset featuring eight varieties of mangoes, namely Anwar Ratool, Chaunsa (Black), Chaunsa (Summer Bahisht), Chaunsa (White), Dosehri, Fajri, Langra, and Sindhri, which are predominantly grown in Pakistan [25]. Figure 3 presents the sample images of the eight distinct mango varieties selected randomly. The dataset comprises a total of 1600 RGB images with a depth of 24 bits, with each category containing 200 images. To enhance model performance and mitigate overfitting, all input images were resized to a fixed dimension of 224 × 224 pixels. Throughout this preprocessing step, the original aspect ratio of each image was preserved to prevent geometric distortion. To achieve methodological purity in a controlled comparative study, data augmentation was deliberately omitted so that the differences in performance between the eight deep transfer learning models can be attributed to their intrinsic architectural design and knowledge pre-training, rather than to the differences and improvements in the training data pipeline. To achieve consistent outcomes, the dataset was split into 60% for training, 20% for validation, and 20% for the final test set. This approach was utilized to assess the performance of the deep transfer models on a real dataset for comparative analysis. Secondly, this facilitated the evaluation of the robustness and generalization abilities of pre-trained models, particularly in the context of small datasets and real-world applications. Finally, this approach mitigates the biases that may arise from data manipulation, thereby allowing for an accurate understanding of the models’ true performance and providing valuable insights for mango variety classification using artificial intelligence. Table 1 represents the distribution of the training, test, and validation sets.

2.4. Development of Hybrid Models

The development of a robust artificial intelligence model was accomplished through a two-phase methodology. In the first phase, we evaluated eight deep transfer learning convolutional neural network (CNN) models (DenseNet201, EfficientNetB0, InceptionV3, MobileNetV2, NASNet, ResNet50, VGG16, and Xception), which are frequently utilized for fruit classification tasks. The respective model was evaluated using standard performance metrics, including accuracy, precision, recall, F1-score, log loss, training time, inference time per image, and peak memory usage. Based on this comprehensive evaluation, four models, EfficientNetB0, MobileNetV2, NASNet, and ResNet50, were selected for further optimization, demonstrating a good balance between classification performance and computational efficiency.
During the second phase, the dense (fully connected) layers of the selected CNN models were removed, allowing the model to function solely as high-level feature extraction. The feature was subsequently classified using ten conventional machine learning classifiers by predominantly utilizing default hyperparameters to establish baseline performance. Support Vector Machine (SVM)with radial basis function kernel, k-Nearest Neighbors (k-NN, k = 5), Decision Tree using Gini impurity criterion, Random Forest with 100 estimators, Logistic Regression with increased maximum iterations (1000) to ensure convergence, Linear Discriminant Analysis (LDA), Quadratic Discriminant Analysis (QDA), Naive Bayes, XGBoost optimized with logarithmic loss evaluation, and LightGBM employing gradient boosting with histogram-based learning. All the classifiers were trained with the extracted feature vectors and were tested on the test set with extensive measures such as accuracy, weighted precision, recall, F1-score, and log loss of probabilistic prediction. The efficiency of computations was evaluated by measuring the latency of feature extraction, training time, per-image inference time, and memory at its peak. All models are systematically logged by performance metrics, which were then exported to standardized Excel files, allowing direct comparison of all traditional machine learning, ensemble, and discriminative models in a reproducible experimental structure. Through comprehensive experimentation, two optimal combinations of models (EfficientNetB0 and ResNet50) were determined. Subsequently, the pre-trained model that demonstrated the highest performance and satisfied the evaluation criteria was further refined by incorporating a machine learning classifier. These evaluated models functioned as high-level feature extractors, while the machine learning models served as classification models. Figure 4 explains the development of an artificial intelligence model for mango cultivar classification.

2.5. Hybrid Efficient Model Development

The proposed system implies the use of the EfficientNetB0 as the primary deep-learning feature extractor, as it has an extensively balanced architecture and constructs outstanding performance when used in transfer learning tasks. EfficientNetB0 operates on inputs of 224 × 224 × 3 and has a sequence of MBConv (Mobile Inverted Bottleneck Convolution) layers of receptive fields 3 × 3, which extract meaningful and efficient features. Its compound scaling method ensures computational and memory efficiency, and it achieves high accuracy (minimizing depth, width, and resolution) through fixed coefficients. The assessment of this characteristic makes EfficientNetB0 a very beneficial tool in real-time low-resource procedures, including automatic fruit classification.
During the next step of the study, the EfficientNetB0 feature vector used as an input to different machine learning classifiers was calculated using the 1280-dimensional Global Average Pooling (GAP). Linear Discriminant Analysis (LDA) and LightGBM were the most outstanding performers among them. A statistical classifier called LDA was used to discriminate the eight mango varieties since LDA increases the class separability through a linear projection. The LightGBM framework is a gradient boosting platform that is fast and accurate, and it proved to be quite efficient in the classification of the mango varieties. Notably, both the EfficientNetB0-LDA model and EfficientNetB0-LightGBM had perfect test classification accuracy of 100% as well as a fast inference rate with minimal memory requirements. Figure 5 demonstrates the classification framework that is based on integrating EfficientNetB0 with other machine learning models. Table 2 describes hardware configurations and hyperparameters of the classifiers applied in the presented study.

2.6. Performance Evaluation Metrics

Model evaluation was the initial phase of this research, which took into consideration accuracy, precision, recall, F1-score, and log loss. Finally, the optimization criteria of model selection were chosen based on training time, inference time, and maximum memory utilization. These evaluation parameters and model selection metrics were applied in both stages of model development to the real-time on-farm classification of various mango varieties. Equations (1)–(5) have been used to show the performance evaluation metrics.
Accuracy = T P + T N T P + T N + F P + F N
Precision = T P T P + F P
Recall = T P T P + F N
F 1 = 2 × Precision × recall Precision + recall
M a t t h e w s   C o r r e l a t i o n   C o e f f i c i e n t   ( M C C ) = T P + T N ( F P × F N ) T P + F P ( T P + F N ) ( T N + F P ) ( T N + F N )
Log Loss = 1 N i = 1 N j = 1 8 y i , j · log ( p i , j )
where
  • TP = True Positives
  • TN = True Negatives
  • FP = False Positives
  • FN = False Negatives
  • N: Total number of sample images
  • j: Index of the for each of the mango classes
  • yi,j: 1 if sample i belongs to mango class j; otherwise, 0
  • pi,j: Predicted probability that sample i belongs to class j.

3. Results and Discussion

3.1. Results of Manual Assessment of Mango Cultivars

The human assessment showed significant variations in classification performance across the different mango cultivars, as shown in Table 3. Chaunsa (White) and Langra provided the greatest accuracy levels of 0.960 ± 0.026 and 0.947 ± 0.021, respectively, which can be explained by their specific morphological features. On the other hand, the lowest accuracy was recorded using Dosehri (0.823 ± 0.040), probably because it was similar to Anwar Ratool. The levels of precision differed significantly, where Fajri scored almost perfectly (0.968 ± 0.027), and Sindhri scored significantly lower (0.756 ± 0.013), meaning that Sindhri was often misclassified as different cultivars. Recall values tracked the accuracy trends, indicating that the high and wild cultivars were consistent among those cultivars that share high accuracy. Overall, the F1-scores used to balance precision and recall were sequentially high (>0.89) in all but the Sindhri cultivar (0.838 ± 0.014), indicating its peculiarities. The low standard deviations in F1-scores (e.g., 0.004 of Langra) imply a high replicability among the evaluators, whereas the large deviations in accuracy (e.g., 0.040 of Dosehri) show the variability between the replications. The results of the findings highlight the significance of morphological obscurity influenced by cultivar, and the ambiguous relationship influences human classification performance with possible implications on quality control in packhouse operations.

3.2. Training and Validation

In the initial phase of the methodology, eight deep learning transfer learning models, DenseNet201, EfficientNetB0, InceptionV3, MobileNetV2, NASNet, ResNet50, VGG16, and Xception, with a SoftMax classifier, were trained and validated to recognize eight different types of mangos. In order to evaluate the learning behavior, the convergence performance, generalization capability, and overfitting tendencies of each model and the training, validation accuracy, and loss curves were plotted against the epochs as shown in Figure 6. The evaluation of these graph curves demonstrates the fact that almost all eight models took a pattern of convergence in which training and validation accuracies approached a value of 1.0. These findings indicate that the selected CNN models demonstrate superior generalization performance along with strong classification ability as far as different mango varieties are concerned. The training and validation loss curves showed a consistent decline and a convergence toward zero, which is an indication of learning well to minimize the errors in classification. It is worth mentioning that the EfficientNetB0 model had certain differences in its learning trajectory as compared to the other models. The accuracy curves’ convergence was close to 1.0, and the loss curve was close to zero; this occurred after most of the models signified successful training, and the features were effectively extracted from the mango images. It means that the method of transfer learning based on pre-trained models succeeded rather well in adapting to the mango classification task.

3.3. Comparative Analysis Based on Performance Metrics

Table 4 represents the results of the performance metrics of eight CNN models used in the classification of mango varieties. In all models, the accuracy was high across the training, validation, and test datasets. The overall performance was better in DenseNet201 and ResNet50, with test accuracy, precision, recall, and F1-score being equal to 0.99. These models also had the lowest log loss of 0.02, which showed that they have a high level of confidence in their predictions. EfficientNetB0, MobileNetV2, VGG16, and Xception also showed robust performance with test accuracies dropping to 0.98 and 0.99, alongside the high precision, recall, and F1-scores. InceptionV3 and NASNet received marginally minimal accuracies on test, 0.96 and 0.95, respectively, but the overall performance parameters were high. The training accuracy of all the models was nearly perfect (1.00), and validation accuracies varied between 0.96 and 1.00. The results showed the effectiveness of using transfer learning based on pre-trained CNN models in the mango classification. The efficient performance recorded at all architectures also highlights the strong feature extraction aspects relevant in this task. Overall, the identified results point out the potential of CNN models, in terms of precise mango classification implementation, in the practice of practical applications.

3.4. Confusion Matrix Analysis

In order to evaluate the classification performance of the selected deep transfer learning models comprehensively, confusion matrices were created, as shown in Figure 7. In order to allow a more concise presentation of the confusion matrices, the variety name of mangos was abbreviated. In particular, Anwar Ratool, Chaunsa (Black), Chaunsa (Summer Bahisht), Chaunsa (White), Dosehri, Fajri, Langra, and Sindhri were identified as AR, CB, CSB, CW, DR, FR, LR, and SR, respectively. All these confusion matrices were necessary to estimate the performance of models on a class-wise basis and also demonstrate misclassification patterns for each particular model relating to the classification of mango cultivars. Based on the overall confusion matrices, the fact that the various mango varieties were predicted accurately in most of the pre-trained models was mainly attributed to the high number of correct predictions contained within the diagonal boxes. Nevertheless, a few misclassifications were observed even though the confusion matrix indicated high accuracy in class-wise predictions, and these errors were probably a result of the visual similarity of some of the mango varieties.
The DenseNet201 confusion matrix indicated that the model was almost perfect in the classifications of most types of mangoes, with few cases of misclassification recorded between Chaunsa (White) and Fajri. EfficientNetB0 showed a comparable improvement in accuracy at predicting the classes, but Fajri was sometimes confused with Chaunsa (Black). Relating to InceptionV3, there was a general accuracy on each of the predicted classes, but some intersections were noted between the Sindri and Langra classes. Additionally, some cases of misclassification were reported between the Fajri and Chaunsa (Black) categories. After that, the lightweight MobileNetV2 also reported efficient results, but Chaunsa (S_B) was correctly identified as Chaunsa (White), and Fajri was incorrectly identified as Chaunsa (Black) and Chaunsa (White). NASNet exhibited a higher rate of classification errors than many other models; it often confused and misclassified Chaunsa (White) as Fajri and Sindhri and Fajri with Anwar Ratool. Although it could identify the majority of the categories accurately, its ability to differentiate the varieties that are similar in their looks was relatively inefficient. Compared to ResNet50, it was found that this method had an almost perfect classification in all categories. The only mistake was made in distinguishing Langra and Fajri, which reflects on its ability to classify minor characteristics of mangoes. VGG16 had a strong representation in each category, though it was confused with Chaunsa (S_B), Chaunsa (Black), and Fajri. Although the overall classification performance did not change significantly, it was just slightly less accurate than ResNet50 and DenseNet201. Xception has shown really good results with high accuracy in all categories. Nevertheless, the categories that displayed slight misclassifications were Chaunsa(S_B) and Chaunsa (White). The model did well handling intricate features, but it was experiencing minimal challenges in minor deviations of similar classes. In general, the DenseNet201, ResNet50, and EfficientNetB0 performed better in the terms of classification accuracy, but the NASNet faced some difficulties. Chaunsa and Fajri varieties caused classification challenges, unlike Anwar Ratool, Dosehri, and Sindhri, which were successfully classified with high precision by all models.

3.5. Model Selection for Optimization

The studied deep transfer learning models were compared in terms of selection parameters, including the training time, inference of an image on a computer processor, and the peak memory consumption, which could be optimized in the subsequent processes. The objective of this optimization was to identify the impact of training time on the efficiency of the artificial intelligence (AI) model and the reasons why the inference time of the image is significant in ensuring the real-time recognition of mango varieties. Figure 8 illustrates the output of the comparative analysis of the selected model as per the defined selection parameters. According to the training time, DenseNet201, VGG16, and Xception took relatively more time to train, and thus could not be used for real-time mango variety recognition. Comparatively, the other five models, EfficientNetB0, Inception V3, MobileNetV2, NASNet, and ResNet50, gave satisfactory results, which determined the most suitable models for the next phase of optimization according to their training time. Although when it comes to the responsiveness, the models left out in the first evaluation stage also did not perform optimally in this phase. Simultaneously, the remaining deep transfer learning models demonstrated satisfactory results, indicating their potential for further optimization. them. In the end, the peak memory requirement was observed to be relatively high among the five qualified deep transfer learning models. Inception V3 required relatively high storage space, rendering it unsuitable for real-time mango variety classification. Considering all the selected parameters, it was concluded that EfficientNetB0, MobileNetV2, NASNet, and ResNet50 showed the best results at the first stage, and were permitted to continue for further optimization to make them more efficient.

3.6. Comparative Analysis of Hybrid Models

In the second phase of evaluating four pretrained models such as EfficientNetB0, MobileNet, NASNet, and ResNet50 and nine machine learning classifiers were integrated with each model to optimize first stage qualifier. This has been carried out through determining the metric, including accuracy, precision, recall, F1-score, and log loss. Table 5 and Figure 9 show the overall results of the comparative analysis as measured using the evaluation metrics. The findings showed that the combination of EfficientB0 with LDA and LightGBM made an excellent classification, with the value of precision, recall, and F1-score equal to 1.00, and log loss equal to 0.00. Likewise, ResNet50 combined with SVM, Logistic Regression, and LightGBM presented perfect classification too. During the metrics evaluation, it was noted that machine learning classifiers, including Quadratic Discriminant Analysis (QDA) integration, were not successful in the case of all the pretrained models, and the classification accuracy varied between 0.1688 and 0.23, with the value of log loss being more than 28. Similarly, the Decision Tree classifier also showed poor accuracy, which ranged between 0.6719 and 0.7906 with a maximum log loss of 11.8. The drop in the accuracy of such hybrid models was blamed on overfitting and miscalibration. Based on the high accuracy achieved from the various combinations of deep transfer learning and machine learning classifiers, the following five combinations, EfficientNetB0-LDA, EfficientNetB0-LightGBM, ResNet50-SVM, ResNet50-Logistic Regression, and ResNet50-LightGBM, emerged as the top performers in this optimization phase.

3.7. Validation of Top Models: True vs. Predicted Classification

For the comparison of the top five performing hybrid models in terms of validation, the true versus predicted classification in the form of the confusion matrices is illustrated in Figure 9. To validate this process, 320 random test samples were selected from the dataset, and the outputs showed 100% relevancy between the true and the predicted labels, which confirmed the 100 percent accuracy. These hybrid models presented the accuracy and stability of their mango classifications according to varieties, which evidence the deep feature extraction ability of EfficientNetB0 and ResNet50 architecture combined with optimal classifiers. Furthermore, the results of the confusion matrices justify the fitness of these hybrid models, which recorded 100% accuracy in the classification of mango varieties. There are no entries in the off-diagonal elements, i.e., there was no misclassification in all five configurations, which provides the confirmation and utilization of these hybrid models in real-time on-farm modification of different mango varieties.

3.8. Interpretation of Grad-CAM Visualizations

Figure 10 illustrates the Grad-CAM attention maps of the eight different mango varieties: Anwar Ratool, Chaunsa (Black), Chaunsa (S_B), Chaunsa (White), Dosehri, Fajri, Langra, and Sindhri. These maps indicate that the trained EfficientB0 model is very successful in allocating the most distinctive regions of the fruit images during the classification. Mostly, the highlighted areas show the middle part of the mango and indicate that the shape, surface texture, and coloring pattern are critical factors in the decision-making process of the model. Particularly, the distinct varieties like Anwar Ratool, Fajri, and Sindhri, the Grad-CAM overlay indicates the focus on the specific patterns or features of surfaces, which highlights the high sensitivity of the model to textural and color signals. On the other hand, the attention patterns in Chaunsa (Black), Chaunsa (S_B), and Chaunsa (White) are more distributed (over the surface), indicating that the model uses global visual features to make the distinction. Correspondingly, in Langra and Dosehri, the model focuses on sections that describe the geometrical shape and surface patterns. The identified results affirm the potential of the deep learning model to effectively learn and generalize the fruit-specific visual characteristics, which indicates a strong and explainable approach to deep automation in the classification of distinct mango varieties.

3.9. Final Phase of Model Selection

In order to create a reliable and accurate real-time mango variety classification, four key performance indicators were selected: training time, inference time (latency), peak memory usage, and average feature extraction time. Figure 11 represents the comparative example of the top five models according to these performance indicators. Those achieving better clarity and determined visualization of models are referred to in figure as MC_1 to MC_5. The real names of the hybrid models, that are EfficientNetB0-LDA, EfficientNetB0-LightGBM, ResNet50-SVM, ResNet50-Logistic Regression, and ResNet50-LightGBM have been replaced by MC_1, MC_2, MC_3, MC_4, and MC_5, respectively. The training time analysis shows that the following two models, EfficientNetB0-LDA and ResNet50-Logistic Regression, were better to be taken into consideration in terms of training duration than the other three hybrid models. Moreover, EfficientNetB0-LDA and EfficientNetB0-LightGBM were the most appropriate regarding inference time for real-time mango variety recognition. These models were further distinguished as lighter-weight machine learning models sufficient to execute on-farm artificial intelligence-based mango variety classification. The final analyses of evaluation metrics indicate that the average time for extracting the characteristics of all five models is likely to be similar. Therefore, according to shorter inference time and relatively low peak memory consumption, EfficientNetB0-LDA (MC_1) and ResNet50-Logistic Regression (MC_4) are defined as the most suitable options to run in real-time and on-farm mango classification. These models are quite efficient in terms of computational speed and prediction, making them suitable to integrate into a mobile or embedded device, which requires speedy and accurate classification. The comparative analysis of proposed models with their base model is also shown in Table 6.
The empirical results unequivocally establish the superiority of the hybrid models over their monolithic base counterparts. The hybrid paradigm achieved perfect classification efficacy (1.00000) while yielding exponential improvements in computational efficiency. This methodology, which utilizes deep CNNs as frozen feature extractors in conjunction with classical classifiers such as Linear Discriminant Analysis (LDA) and Logistic Regression (LR), reduced training times by two orders of magnitude. For instance, the training time for the ResNet50-LR model was approximately 330 times faster. Furthermore, inference latency was reduced by a factor of up to 221 for the EfficientNetB0-LDA model, accompanied by a significant decrease in peak memory consumption. These substantial efficiency gains are attributable to the decoupling of feature learning from classification. By offloading the identification of the optimal separating hyperplane to highly efficient convex optimization solvers, this approach eliminates the computational overhead associated with end-to-end backpropagation, which is superfluous for tasks where the extracted features are already highly linearly separable.
Table 7 shows a comparative analysis of the current research that carried out assessments and analyzed the sorting and quality of mangoes based on different image processing and machine learning technologies. These studies are, however, not comprehensive, as reflected in the number of varieties classified and the scope of evaluation metrics. Conversely, the proposed study presents a highly scaled solution based on the application of eight deep learning networks and involves an ensemble of eight machine learning classifiers. Additionally, the study also analyzes other important performance indicators, including training time, inference, memory consumption, and feature extraction time, compared to other similar research, which provides a comprehensive benchmark that can be potentially deployed in real-world applications. Generally, the current research makes a substantial contribution to the development of the area because it surpasses the existing research in precision, scalability, and viability levels. From a practical perspective, the suggested framework has a high potential in industrial fruit sorting as it provides a chance to perform automated grading in an accurate and efficient manner, enhance supply chain efficiency, and enforce higher-quality control over exports, which together contribute to the stability of the farmer’s income due to decreased post-harvest losses. In addition to technical and economic advantages, the enhanced classification accuracy also leads to food waste reduction and food security, whereas the focus on scalability and computational efficiency facilitates the overall democratization of AI in agriculture, especially in resource-limited settings.

4. Conclusions

This research involved a two-phase approach to selecting machine learning models. In the initial phase, eight distinct machine learning models were trained and assessed. Following the evaluation results, the models that met the criteria were combined with ensemble decision networks to create a hybrid model. This model was developed for an on-farm, real-time automated system to classify mango varieties, aiming to improve post-harvest management of mangoes. In the initial phase of model development, experimental findings revealed that DenseNet201 and ResNet50 achieved the highest test accuracy of 0.99 and the lowest log loss of 0.02. Meanwhile, the test accuracy of the other models also exceeded 0.96, confirming the effectiveness of these deep transfer learning models for real-time classification of mango varieties. After evaluating the training duration, image inference time, and maximum memory consumption as essential factors for a real-time mango classification system, it was determined that EfficientNetB0, MobileNetV2, NASNet, and ResNet50 are suitable for the subsequent optimization phase. Following the outcomes of the second stage of model development, it was determined that EfficientNetB0-LDA, EfficientNetB0-LightGBM, ResNet50-SVM, ResNet50-Logistic Regression, and ResNet50-LightGBM were the leading performers in this optimization phase, achieving 100% accuracy in identifying various mango cultivars. Ultimately, during the second phase, which considered training duration, image inference time, and peak memory usage, it was determined that EfficientNetB0-LDA and ResNet50-Logistic Regression emerged as the top choices for real-time and on-farm mango classification. Analyzing these pivotal findings reveals that the integration of deep learning-based feature extraction with an ensemble decision network has markedly improved the classification accuracy of different mango cultivars. The implementation of this hybrid model in practical scenarios can significantly minimize post-harvest losses and enhance smart post-harvest management through the use of AI in the Food systems. Regarding future prospective projects, we are focusing on the field-scale validation and edge-device optimization.

Author Contributions

Conceptualization, I.A. and A.K.; Methodology, I.A. and A.K.; Validation, I.A., M.G. and A.K.; Data curation, I.A., A.K., M.G. and B.S.; Writing—original draft preparation, I.A. and A.K.; Writing—review and editing, I.A., A.K., T.H., M.G., J.T. and Z.Q.; Supervision, Z.Q.; Funding Acquisition, Z.Q. All authors have read and agreed to the published version of the manuscript.

Funding

This work is supported by the China National Key Research and Development Plan Project (2023YFD2000101).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The image dataset of mango varieties used in this study is publicly available in the Mendeley Data repository, doi:10.17632/5MC3S86982.1. The dataset can be accessed and downloaded directly via the following link: URL (https://data.mendeley.com/datasets/5mc3s86982/1, accessed on 19 January 2026). The dataset and code used to support the findings of this study are available in the GitHub repository at: https://github.com/IbrarRai786/Mango_classification_hybrid_deep_learning, accessed on 19 January 2026.

Acknowledgments

We extend our sincere thanks to our peers and colleagues for their valuable comments and suggestions, which greatly improved the rigor and clarity of this work.

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
AIArtificial intelligence
LDALinear discriminant analysis
CVComputer vision
DLDeep learning
MLMachine learning
CNNConvolutional Neural Networking
GANFISGenetic Algorithm-Adaptive Neuro-Fuzzy Inference System
PCAPrincipal component analysis
DADiscriminant Analysis
SVMSupport vector machine
MCCMatthews Correlation Coefficient
GLCMGray-level co-occurrence matrix
kNNk-Nearest neighbors
FPRFalse positive rate
Grad-CAMGradient-weighted class activation mapping
ARAnwar ratool
CBChaunsa (Black)
CSBChaunsa (Summer Bahisht)
CWChaunsa (White)
DRDosehri
FRFajri
LRLangra
SRSindhri
QDAQuadratic discriminant analysis
MBConvMobile inverted bottleneck convolution
AMActivation matrix
AdamAdaptive moment estimation

References

  1. Sa’ad, F.S.A.; Ibrahim, M.F.; Shakaff, A.M.; Zakaria, A.; Abdullah, M.Z. Shape and Weight Grading of Mangoes Using Visible Imaging. Comput. Electron. Agric. 2015, 115, 51–56. [Google Scholar] [CrossRef]
  2. Diop, A.; Méot, J.M.; Léchaudel, M.; Chiroleu, F.; Ndiaye, N.D.; Mertz, C.; Cissé, M.; Chillet, M. Impact of Preharvest and Postharvest on Color Changes during Convective Drying of Mangoes. Foods 2021, 10, 490. [Google Scholar] [CrossRef] [PubMed]
  3. May, O.S.; Wan Ismail, W.N.A.B.; Jun, C. The King of Fruits Dilemma in Malaysia: Discovering Durian Export Challenges to China. J. Eng. Res. Educ. 2023, 15, 61–75. [Google Scholar] [CrossRef]
  4. Sultan, M.T.; Nayyar, A.; Maaz, M.; Noman, A.M. Mango Quality Under Changing Climate Scenario. In Climate Change and Mango Production: Potential Adaptation and Mitigation Options; Naqvi, S.A.H., Ahmad, S., Ahmed, M., Eds.; Springer Nature: Cham, Switzerland, 2025; pp. 109–119. [Google Scholar]
  5. Razak, T.R.; Faizi, N.A.K.; Ismail, M.H.; Fauzi, S.S.M.; Gining, R.A.J. Towards Capturing Mango Grading from Human Experts—A Comprehensive User Study. In Proceedings of the 2021 6th IEEE International Conference on Recent Advances and Innovations in Engineering (ICRAIE), Kedah, Malaysia, 1–3 December 2021; Volume 6, pp. 1–6. [Google Scholar]
  6. Mangan, T. Draft Report on Mango Farm Survey in Sindh, Pakistan; Monash University: Melbourne, Australia, 2018. [Google Scholar]
  7. Rizwan Iqbal, H.M.; Hakim, A. Classification and Grading of Harvested Mangoes Using Convolutional Neural Network. Int. J. Fruit Sci. 2022, 22, 95–109. [Google Scholar] [CrossRef]
  8. Han, B.; Zhang, J.; Almodfer, R.; Wang, Y.; Sun, W.; Bai, T.; Dong, L.; Hou, W. Research on Innovative Apple Grading Technology Driven by Intelligent Vision and Machine Learning. Foods 2025, 14, 258. [Google Scholar] [CrossRef]
  9. Peng, W.; Ren, Z.; Wu, J.; Xiong, C.; Liu, L.; Sun, B.; Liang, G.; Zhou, M. Qualitative and Quantitative Assessments of Apple Quality Using Vis Spectroscopy Combined with Improved Particle-Swarm-Optimized Neural Networks. Foods 2023, 12, 1991. [Google Scholar] [CrossRef]
  10. Liu, R.M.; Su, W.H. APHS-YOLO: A Lightweight Model for Real-Time Detection and Classification of Stropharia Rugoso-Annulata. Foods 2024, 13, 1710. [Google Scholar] [CrossRef]
  11. Shao, D.; Cheng, W.; Jiang, C.; Pan, T.; Li, N.; Li, M.; Li, R.; Lan, W.; Du, X. Machine-Learning-Assisted Aroma Profile Prediction in Five Different Quality Grades of Nongxiangxing Baijiu Fermented During Summer Using Sensory Evaluation Combined with GC×GC–TOF-MS. Foods 2025, 14, 1714. [Google Scholar] [CrossRef]
  12. Gu, Y.; Wu, J.; Guo, Y.; Hu, S.; Li, K.; Shang, Y.; Bao, L.; Hassan, M.; Zhao, C. Grade Classification of Camellia Seed Oil Based on Hyperspectral Imaging Technology. Foods 2024, 13, 3331. [Google Scholar] [CrossRef]
  13. Sennhenn, A.; Prinz, K.; Gebauer, J.; Whitbread, A.; Jamnadass, R.; Kehlenbeck, K. Identification of Mango (Mangifera indica L.) Landraces from Eastern and Central Kenya Using a Morphological and Molecular Approach. Genet. Resour. Crop Evol. 2014, 61, 7–22. [Google Scholar] [CrossRef]
  14. Kashkush, K.; Jinggui, F.; Tomer, E.; Hillel, J.; Lavi, U. Cultivar Identification and Genetic Map of Mango (Mangifera indica). Euphytica 2001, 122, 129–136. [Google Scholar] [CrossRef]
  15. Elbasi, E.; Mostafa, N.; Alarnaout, Z.; Zreikat, A.I.; Cina, E.; Varghese, G.; Shdefat, A.; Topcu, A.E.; Abdelbaki, W.; Mathew, S.; et al. Artificial Intelligence Technology in the Agricultural Sector: A Systematic Literature Review. IEEE Access 2023, 11, 171–202. [Google Scholar] [CrossRef]
  16. Dong, Z.; Wang, J.; Sun, P.; Ran, W.; Li, Y. Mango Variety Classification Based on Convolutional Neural Network with Attention Mechanism and Near-Infrared Spectroscopy. J. Food Meas. Charact. 2024, 18, 2237–2247. [Google Scholar] [CrossRef]
  17. Koirala, A.; Walsh, K.B.; Wang, Z.; Anderson, N. Deep Learning for Mango (Mangifera indica) Panicle Stage Classification. Agronomy 2020, 10, 143. [Google Scholar] [CrossRef]
  18. Anurekha, D.; Sankaran, R.A. Efficient Classification and Grading of MANGOES with GANFIS for Improved Performance. Multimed. Tools Appl. 2020, 79, 4169–4184. [Google Scholar] [CrossRef]
  19. Singh, Y.P.; Chaurasia, B.K.; Shukla, M.M. Mango Fruit Variety Classification Using Lightweight VGGNet Model. SN Comput. Sci. 2024, 5, 1083. [Google Scholar] [CrossRef]
  20. Alhawas, N.; Tüfekci, Z. The Effectiveness of Transfer Learning and Fine-Tuning Approach for Automated Mango Variety Classification. Eur. J. Sci. Technol. 2022, 34, 344–353. [Google Scholar] [CrossRef]
  21. Gururaj, N.; Vinod, V.; Vijayakumar, K. Deep Grading of Mangoes Using Convolutional Neural Network and Computer Vision. Multimed. Tools Appl. 2023, 82, 39525–39550. [Google Scholar] [CrossRef]
  22. Wijaya Widiyanto, W.; Purwanto, E. Classification of Mango Fruit Quality Based on Texture Characteristics of GLCM (Gray Level Co-Occurrence Matrices) with Algorithm K-NN (K-Nearest Neighbors). Techno 2019, 20, 31–40. [Google Scholar] [CrossRef]
  23. Supekar, A.; Wakode, M. Multi-Parameter Based Mango Grading Using Image Processing and Machine Learning Techniques. INFOCOMP J. Comput. Sci. 2020, 19, 175–187. [Google Scholar]
  24. Pandey, C.; Sethy, P.K.; Behera, S.K.; Rajpoot, S.C.; Pandey, B.; Biswas, P.; Panigrahi, M. Evaluation of Transfer Learning Model for Mango Recognition. In Intelligent Manufacturing and Energy Sustainability, Proceedings of the Intelligent Manufacturing and Energy Sustainability; Reddy, A.N.R., Marla, D., Favorskaya, M.N., Satapathy, S.C., Eds.; Springer: Singapore, 2021; pp. 467–474. [Google Scholar]
  25. Rizwan Iqbal, H.M.; Hakim, A. Mango Variety and Grading Dataset; Elsevier: Amsterdam, The Netherlands, 2021; Volume 1. [Google Scholar] [CrossRef]
  26. Chhabra, M.; Gupta, A.; Mehrotra, P.; Reel, S. Automated Detection of Fully and Partially Riped Mango by Machine Vision. In Proceedings of the International Conference on Soft Computing for Problem Solving (SocProS 2011) December 20–22, 2011; Deep, K., Nagar, A., Pant, M., Bansal, J.C., Eds.; Springer: New Delhi, India, 2012; pp. 153–164. [Google Scholar]
  27. Salunkhe, R.P.; Patil, A.A. Image Processing for Mango Ripening Stage Detection: RGB and HSV Method. In Proceedings of the 2015 Third International Conference on Image Information Processing (ICIIP), Waknaghat, India, 21–24 December 2015; pp. 362–365. [Google Scholar]
  28. Momin, M.A.; Rahman, M.T.; Sultana, M.S.; Igathinathane, C.; Ziauddin, A.T.M.; Grift, T.E. Geometry-Based Mass Grading of Mango Fruits Using Image Processing. Inf. Process. Agric. 2017, 4, 150–160. [Google Scholar] [CrossRef]
  29. Bhole, V.; Kumar, A. Mango Quality Grading Using Deep Learning Technique: Perspectives from Agriculture and Food Industry. In Proceedings of the SIGITE 2020—Proceedings of the 21st Annual Conference on Information Technology Education, Virtual, 7–9 October 2020; Association for Computing Machinery, Inc.: New York, NY, USA, 2020; pp. 180–186. [Google Scholar]
  30. Ke, C.; Weng, N.T.; Yang, Y.; Yang, Z.M.; Sumari, P.; Abualigah, L.; Kamel, S.; Ahmadi, M.; Al-Qaness, M.A.A.; Forestiero, A.; et al. Mango Varieties Classification-Based Optimization with Transfer Learning and Deep Learning Approaches. In Classification Applications with Deep Learning and Machine Learning Technologies; Abualigah, L., Ed.; Springer International Publishing: Cham, Switzerland, 2023; pp. 45–65. [Google Scholar]
Figure 1. Key characteristics of the samples assessed by individuals who performed the manual classification of the mangoes.
Figure 1. Key characteristics of the samples assessed by individuals who performed the manual classification of the mangoes.
Foods 15 00414 g001
Figure 2. Flow diagram of mango post-harvest activities.
Figure 2. Flow diagram of mango post-harvest activities.
Foods 15 00414 g002
Figure 3. Sample images of the eight distinct mango varieties selected randomly.
Figure 3. Sample images of the eight distinct mango varieties selected randomly.
Foods 15 00414 g003
Figure 4. Methodology of the proposed approach.
Figure 4. Methodology of the proposed approach.
Foods 15 00414 g004
Figure 5. Integration of EfficientNetB0 as feature extractor and ensemble decision networks.
Figure 5. Integration of EfficientNetB0 as feature extractor and ensemble decision networks.
Foods 15 00414 g005
Figure 6. Training of deep transfer learning models.
Figure 6. Training of deep transfer learning models.
Foods 15 00414 g006
Figure 7. Confusion matrices for (a) DenseNet201; (b) EfficientNetB0; (c) InceptionV3; (d) MobileNetV2; (e) NASNet; (f) ResNet50; (g) VGG16; (h) Xception.
Figure 7. Confusion matrices for (a) DenseNet201; (b) EfficientNetB0; (c) InceptionV3; (d) MobileNetV2; (e) NASNet; (f) ResNet50; (g) VGG16; (h) Xception.
Foods 15 00414 g007
Figure 8. First phase model selection parameters.
Figure 8. First phase model selection parameters.
Foods 15 00414 g008
Figure 9. Confusion metrics for high-performance hybrid models.
Figure 9. Confusion metrics for high-performance hybrid models.
Foods 15 00414 g009
Figure 10. Mango variety-based Grad-CAM attention maps.
Figure 10. Mango variety-based Grad-CAM attention maps.
Foods 15 00414 g010
Figure 11. Second phase model selection parameters.
Figure 11. Second phase model selection parameters.
Foods 15 00414 g011
Table 1. Distribution of training, validation, and test sets.
Table 1. Distribution of training, validation, and test sets.
Mango VarietiesTotalTrainingValidationTest
Anwar Ratool2001204040
Chaunsa (Black)2001204040
Chaunsa (Summer Bahisht)2001204040
Chaunsa (White)2001204040
Dosehri2001204040
Fajri2001204040
Langra2001204040
Sindhri2001204040
Table 2. Specifications of Hardware, Software, and Hyperparameters of Classifiers.
Table 2. Specifications of Hardware, Software, and Hyperparameters of Classifiers.
Hardware UnitSpecifications
Central Processing UnitAMD Ryzen 5 5600 G with Radeon Graphics 3.90 GHz
RAM32 GB
Graphic CardNVIDIA GeForce GTX 1060 6 GB
Operating SystemWindows 10
Programming LanguagePython 3.12
DNN and CNN FrameworkTensorFlow 2.19.0
Batch Size32
OptimizerAdam
Epochs50
LossSparse categorical crossentropy
Table 3. Human assessment results for different mango cultivars.
Table 3. Human assessment results for different mango cultivars.
CultivarAccuracyPrecisionRecallF1-Score
Anwar Ratool0.843 ± 0.025 de0.882 ± 0.031 cd0.843 ± 0.025 de0.862 ± 0.026 c
Chaunsa (Black)0.947 ± 0.032 ab0.923 ± 0.016 ab0.947 ± 0.032 ab0.934 ± 0.011 a
Chaunsa (Summer Bahisht)0.843 ± 0.031 de0.944 ± 0.039 ab0.843 ± 0.031 de0.891 ± 0.032 bc
Chaunsa (White)0.960 ± 0.026 a0.906 ± 0.031 bc0.960 ± 0.026 a0.932 ± 0.025 a
Dosehri0.823 ± 0.040 e0.929 ± 0.035 ab0.823 ± 0.040 e0.873 ± 0.032 c
Fajri0.880 ± 0.030 cd0.968 ± 0.027 a0.880 ± 0.030 cd0.921 ± 0.011 ab
Langra0.947 ± 0.021 ab0.926 ± 0.024 ab0.947 ± 0.021 ab0.936 ± 0.004 a
Sindhri0.940 ± 0.026 bc0.756 ± 0.013 d0.940 ± 0.026 bc0.838 ± 0.014 c
Note: Different superscript letters (a,b,c,d,e) within a column indicate statistically significant differences (p < 0.05) in the mean metric values between cultivars, based on a post-hoc pairwise comparison test (e.g., Tukey’s HSD) conducted after a one-way ANOVA. Cultivars sharing the same letter within a column are not significantly different from each other. For example, in the Accuracy column, ‘Chaunsa (White)’ (a) is significantly more accurate than ‘Dosehri’ (e), but not significantly different from ‘Chaunsa (Black)’ (ab).
Table 4. Comparative analysis of selected deep transfer learning models.
Table 4. Comparative analysis of selected deep transfer learning models.
ModelTraining AccuracyValidation AccuracyTest
Accuracy
PrecisionRecallF1-ScoreMCCLog Loss
DenseNet2011.001.000.990.990.990.990.990.02
EfficientNetB00.990.980.980.980.980.980.970.10
InceptionV31.000.980.960.960.960.960.950.13
MobileNetV21.000.990.980.980.980.970.970.05
NASNet1.000.960.950.950.950.950.950.17
ResNet501.000.990.990.990.990.990.990.02
VGG161.000.980.990.990.990.990.990.04
Xception1.000.970.980.980.980.980.980.05
Table 5. Comparative analysis of selected deep transfer learning models and ensemble decision networks.
Table 5. Comparative analysis of selected deep transfer learning models and ensemble decision networks.
Pretrained ModelClassifierAccuracyPrecisionRecallF1-ScoreLog Loss
EfficientNetB0SVM0.99690.99690.99690.99690.0578
k-NN0.88750.89800.88750.88810.4809
Decision Tree0.79060.79700.79060.79247.5466
Random Forest0.97810.97820.97810.97810.4883
Logistic Regression0.99690.99690.99690.99690.0129
LDA1.00001.00001.00001.00000.0000
QDA0.20310.20680.20310.202628.7223
Naive Bayes0.91250.91840.91250.91313.1538
XGBoost0.99380.99390.99380.99370.0570
LightGBM1.00001.00001.00001.00000.0086
MobileNetSVM0.99380.99390.99380.99370.0709
k-NN0.950.95560.950.94980.2689
Decision Tree0.6750.68040.6750.67711.7142
Random Forest0.93750.94010.93750.93770.726
Logistic Regression0.97810.97850.97810.97810.0456
LDA0.91250.91810.91250.91340.527
QDA0.16880.16970.16880.166429.9613
Naive Bayes0.90940.9120.90940.9093.2665
XGBoost0.95620.95710.95620.95630.1467
LightGBM0.95940.96180.95940.95980.1231
NASNetSVM0.97810.97850.97810.9780.1157
k-NN0.85620.88110.85620.85731.1947
Decision Tree0.67190.6780.67190.671611.8268
Random Forest0.88750.88770.88750.88720.6766
Logistic Regression0.97190.97270.97190.97160.1093
LDA0.95620.95960.95620.95640.2191
QDA0.19380.20280.19380.19629.0602
Naive Bayes0.80620.82840.80620.80626.9835
XGBoost0.94060.94480.94060.94140.2138
LightGBM0.95940.96030.95940.95940.1474
ResNet50SVM1.00001.00001.00001.00000.0479
k-NN0.94060.94540.94060.94040.1451
Decision Tree0.76250.76360.76250.76158.5604
Random Forest0.98440.98480.98440.98440.571
Logistic Regression1.00001.00001.00001.00000.0047
LDA0.20.15950.20.147512.7539
QDA0.17810.18920.17810.179129.6234
Naive Bayes0.87190.88490.87190.87084.6181
XGBoost0.99380.99390.99380.99370.0557
LightGBM1.00001.00001.00001.00000.0053
Table 6. Comparative analysis of proposed model with base models.
Table 6. Comparative analysis of proposed model with base models.
ModelEfficiencyTraining Time (s)Inference Time (s/img)Peak Memory Usage (MB)
EfficientnetB0 Base Model0.98438782.809800.022123520.43222
EfficientNetB0-LDA1.000007.770000.000102760.79000
ResNet50 Base Model0.993751669.686380.036053594.91410
ResNet50-Logistic Regression1.000005.050000.000403195.31000
Table 7. Comparison of the current study with previous studies.
Table 7. Comparison of the current study with previous studies.
ReferenceObjectiveTargetClassesModelSelection ParametersAccuracy
Training TimeInference TimePeak Memory UsageFeature Extraction Time
[26]Automated detection of fully/partially ripened mango using machine visionHarvesting detection for post-harvest managementMangoNeural Network××××95%
[27]Image processing for mango ripening stage detectionPost-harvest Management of Mango4 mango categories
(1.) Green
(2.) Ripe
(3.) Unripe
(4.) Full ripe
RGB and HSV method××××RGB = 90.4%
HSV = 84.2%
[28]Mango mass grading based on Geometry using image processingIdentificationHarvested MangosFaster R-CNN network××××90%
[21]Deep
grading of mangoes using convolutional neural network
and computer vision
Mango maturity classificationMangoCNN××××variety recognition 93.23% and quality grading 95.11%
[29]Mango quality grading
using deep learning technique:
Improve
agriculture and food industry
Variety of MangoesPretrained Squeeze Net model××××classification accuracy for RGB images 93.33% and thermal images 92.27% for
[30]Optimization of mango varieties with transfer learning and deep learning based on classification-4 mango varietiesDeep learning—VGG16,
Xception
××××Satisfactory
Our StudyAutomated Mango Variety Classification Using Deep Feature Extraction and Ensemble Decision NetworksImprove the Export quality of mangos Eight mango varieties8 DL Models (DenseNet201, EfficientNetB0, InceptionV3, MobileNetV2, NASNet, ResNet50, VGG16, and Xception) and ML ClassifiersEfficientNetB0 (LDA) = 100%
EfficientNetB0 (LightGBM) = 100%
ResNet50 (Logistic Regression) = 100%
ResNet50 (LightGBM) = 100%
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Ahmad, I.; Khaliq, A.; Siddique, B.; Gouda, M.; Huang, T.; Tao, J.; Qiu, Z. Automated Mango Variety Classification Using Deep Feature Extraction and Machine Learning Classifier Integration. Foods 2026, 15, 414. https://doi.org/10.3390/foods15030414

AMA Style

Ahmad I, Khaliq A, Siddique B, Gouda M, Huang T, Tao J, Qiu Z. Automated Mango Variety Classification Using Deep Feature Extraction and Machine Learning Classifier Integration. Foods. 2026; 15(3):414. https://doi.org/10.3390/foods15030414

Chicago/Turabian Style

Ahmad, Ibrar, Aftab Khaliq, Bushra Siddique, Mostafa Gouda, Ting Huang, Jinxian Tao, and Zhengjun Qiu. 2026. "Automated Mango Variety Classification Using Deep Feature Extraction and Machine Learning Classifier Integration" Foods 15, no. 3: 414. https://doi.org/10.3390/foods15030414

APA Style

Ahmad, I., Khaliq, A., Siddique, B., Gouda, M., Huang, T., Tao, J., & Qiu, Z. (2026). Automated Mango Variety Classification Using Deep Feature Extraction and Machine Learning Classifier Integration. Foods, 15(3), 414. https://doi.org/10.3390/foods15030414

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop