Smarter Mango Sorting: AI Enhances Ripeness Detection for Farmers and Exporters

Researchers from Faridpur Engineering College, Bangladesh, developed AI-driven models to automate mango ripeness classification, significantly improving accuracy over manual sorting. Their study found that Convolutional Neural Networks (CNNs) outperformed traditional machine learning and transfer learning methods, with Gradient Boosting achieving the highest accuracy at 96.28%.


CoE-EDP, VisionRICoE-EDP, VisionRI | Updated: 24-02-2025 10:13 IST | Created: 24-02-2025 10:13 IST
Smarter Mango Sorting: AI Enhances Ripeness Detection for Farmers and Exporters
Representative image

Bangladesh, one of the world’s leading mango-producing countries, still relies on manual sorting to assess mango ripeness—a process that is time-consuming and prone to human error. Recognizing the need for automation in this crucial industry, researchers from Faridpur Engineering College, Bangladesh, conducted an extensive study comparing machine learning and deep learning models to enhance mango ripeness classification. Their research evaluated traditional machine learning techniques, convolutional neural networks (CNNs), and transfer learning models to determine the most efficient method for automating the sorting process. With mango exports playing a significant role in Bangladesh’s economy, the ability to accurately classify mangoes based on ripeness could greatly improve efficiency and reduce post-harvest losses.

The Challenges of Manual Mango Sorting

Ripeness is a key determinant of mango quality, influencing market value, shelf life, and export viability. Traditionally, mangoes are graded manually based on physical traits such as skin color, texture, and firmness. However, this method is inconsistent and highly subjective, leading to incorrect classification and financial losses. Overripe mangoes lose commercial value and become more prone to spoilage, while unripe mangoes do not appeal to consumers. Exporters, in particular, must ensure mangoes are at the perfect stage of ripeness to survive long transit times while maintaining their freshness.

To address this issue, the researchers compiled an extensive dataset containing images of the popular "Himsagor" mango variety from farms in Rajshahi and Chapainawabganj. A total of 975 mango images, covering unripe, ripe, and overripe stages, were collected. These images underwent preprocessing techniques, including background standardization and color correction, to ensure uniformity and consistency in the classification process.

Artificial Intelligence Takes Over Mango Grading

The study tested three major AI-driven approaches to classify mango ripeness. The first involved traditional machine learning models, including Gaussian Naïve Bayes (GNB), Support Vector Machine (SVM), Gradient Boosting (GB), Random Forest (RF), and K-Nearest Neighbors (KNN). Of these, the Gradient Boosting model outperformed the others, achieving an impressive 94.74% accuracy in correctly classifying mango ripeness.

The second approach leveraged Convolutional Neural Networks (CNNs)—a deep learning technique that autonomously learns to recognize image features. This method significantly outperformed traditional machine learning models, with CNN-based Gradient Boosting achieving the highest classification accuracy at 96.28%. CNNs demonstrated superior ability to capture intricate patterns in mango images, making them the best-performing model overall.

Lastly, the researchers employed Transfer Learning with the VGG16 model, a pre-trained deep learning architecture. Although effective, transfer learning models generally performed below CNN-driven classification methods. The KNN model, trained on VGG16-extracted features, achieved the highest accuracy in this category at 93.97%. Despite its promise, VGG16 struggled in comparison to CNNs, indicating that a model specifically trained on mango images yields better results than one adapted from general image datasets.

Key Insights from the Study

The results of the study highlight the immense potential of artificial intelligence in transforming mango classification. CNN-based approaches consistently delivered the highest accuracy, proving to be more reliable than traditional machine learning models. However, some traditional models like Gradient Boosting and SVM remained highly competitive, offering a balance between computational efficiency and accuracy. Transfer learning, while useful, fell short of CNN-based models, indicating that more specific training is required for classifying agricultural products.

One surprising finding was the poor performance of the Naïve Bayes model, which only achieved 27.05% accuracy. This highlights the challenges of applying simple probabilistic models to complex image classification tasks. The study demonstrates that machine learning can dramatically improve mango classification, but model selection is critical to achieving high accuracy.

Impact on Agriculture and Future Prospects

Automating mango sorting with AI offers significant benefits for farmers, exporters, and retailers. AI-powered classification systems can reduce human error, increase efficiency, and lower operational costs. By integrating these models into export facilities, mangoes can be sorted at optimal ripeness levels, ensuring they arrive at their destinations fresh and in prime condition.

For supermarkets and food processing industries, automated sorting guarantees that only mangoes at the correct ripeness are used for different products such as juices, jams, and chutneys. Even consumers stand to benefit—future developments could introduce AI-powered mobile applications or handheld scanners that allow buyers to assess mango ripeness before purchasing.

Despite its success, the study identified a few challenges. The dataset was imbalanced, with far more unripe mango images compared to ripe and overripe samples. Future research could explore data augmentation techniques to balance datasets and improve classification performance. Additionally, computational efficiency metrics such as training time, inference speed, and memory usage were not measured in this study but will be crucial for real-world implementation.

With continuous advancements in artificial intelligence, AI-powered classification systems could extend beyond mangoes to other fruits and vegetables, improving quality control across the agricultural sector. This research marks a significant step toward modernizing post-harvest processing, ensuring better produce reaches markets with minimal waste. As AI continues to evolve, it is set to revolutionize the global food supply chain, benefiting farmers, businesses, and consumers alike.

  • FIRST PUBLISHED IN:
  • Devdiscourse
Give Feedback