New deep learning system revolutionizes quality grading of fresh produce
This research provides a blueprint for intelligent agricultural systems that can dramatically reduce post-harvest losses and promote supply chain efficiency. Accurate, non-destructive quality detection enables better timing for harvest, reduces food spoilage in transport, and supports compliance with export quality standards.
- Country:
- Mexico
A new study has demonstrated how cutting-edge deep learning (DL) techniques can dramatically enhance the quality detection of fruits and vegetables, potentially transforming agricultural logistics and food supply chains. The research, titled “A Novel Deep Learning Approach for Precision Agriculture: Quality Detection in Fruits and Vegetables Using Object Detection Models,” was published in Agronomy. It explores how automated object detection models can accurately classify produce as unripe, ripe, or overripe, thus enabling smarter harvesting and minimizing food waste.
Developed by a multidisciplinary team from the Autonomous University of Querétaro and the Centro de Investigaciones en Óptica in Mexico, the study benchmarks 12 state-of-the-art object detection models using a custom dataset of 1,535 images across 39 fruit and vegetable classes. The models were evaluated on detection accuracy and reliability, with top-performing architectures achieving high mean average precision (mAP) and strong classification consistency.
How can AI identify the ripeness of fresh produce?
The research aimed at developing a DL-based quality inspection system that avoids the limitations of manual or invasive inspection techniques. Manual grading is slow, labor-intensive, and prone to human error. In contrast, object detection models powered by AI can classify quality stages in real time using only visual cues, color, shape, texture, and defects, preserving produce integrity while improving decision-making.
The research team trained 12 models from the MMDetection framework on images labeled as unripe, ripe, or overripe. The dataset, curated from internet sources, was manually annotated using LabelImg software to ensure precision in bounding box identification. Each image underwent data augmentation to improve model generalization, including rotation, flipping, brightness and contrast tuning, and cropping - all designed to simulate diverse real-world conditions without compromising object semantics.
Among the 12 models tested, two transformer-based architectures, DDQ (Dynamic Denoising Query) and DINO (Detection Transformer with Improved Denoising Anchor Boxes), emerged as superior performers. Both models achieved a mAP of 0.65 and showed robustness in classifying complex, multistage ripeness states. Their ability to discern subtle differences in fruit conditions sets a new benchmark for precision agriculture tools.
Which models deliver the most accurate and scalable results?
While all models delivered moderate to high classification accuracy, the transformer-based approaches clearly outpaced their CNN-based counterparts in both convergence stability and discrimination capacity. The DDQ model achieved an AUC (area under the ROC curve) of 0.95, while DINO reached 0.89, demonstrating high performance across all classification thresholds.
The DDQ model also showed the highest success rate in the confusion matrix evaluation, correctly classifying 81% of image labels compared to DINO’s 67%. These results underscore the superior ability of transformer models to differentiate among visually similar categories, such as distinguishing onions from rotten onions or pears from grapes.
Interestingly, while CNN-based models like RetinaNet and FCOS achieved quicker initial learning and decent mAP scores (0.55–0.59), they plateaued early in training. Their lower capacity to refine classification over time makes them less suitable for large-scale, high-variance datasets like those seen in fresh produce quality monitoring.
The study’s design also involved strict training validation: 75% of the dataset was used for training, 15% for validation, and 10% for final testing. By holding out test data, the team ensured unbiased performance measurement, confirming that the models can generalize effectively beyond the training sample.
What does this mean for the future of precision agriculture?
This research provides a blueprint for intelligent agricultural systems that can dramatically reduce post-harvest losses and promote supply chain efficiency. Accurate, non-destructive quality detection enables better timing for harvest, reduces food spoilage in transport, and supports compliance with export quality standards.
The models tested are not just high-performing but scalable. They are built using open-source architectures and trained on readily available hardware - a Ryzen 5 5600G CPU, NVIDIA RTX A4000 GPU, and 48 GB of RAM - demonstrating that robust precision agriculture tools are within reach for mid-sized producers and researchers.
Despite the promising results, the study acknowledges certain limitations. The dataset, though diverse, included only 39 produce classes and lacked variability in growth environments and lighting conditions. Future work should expand the training dataset and explore domain adaptation techniques to enhance cross-context performance.
Moreover, there is significant potential for integration with robotics, computer vision, and IoT-based smart agriculture systems. Embedding these models into mobile harvesters, packaging lines, or handheld inspection tools could revolutionize real-time sorting and grading.
The broader implications extend to environmental sustainability as well. With global food waste continuing to rise, AI-driven quality detection can be part of a larger strategy to improve resource efficiency, reduce emissions from waste, and support climate-resilient agriculture.
- READ MORE ON:
- AI in precision agriculture
- fruit ripeness detection with AI
- deep learning for agriculture
- AI food quality inspection
- AI grading system for fruits and vegetables
- deep learning models for detecting ripeness in fruits and vegetables
- how AI improves quality control in fresh produce supply chains
- AI solutions to reduce food waste in precision farming
- FIRST PUBLISHED IN:
- Devdiscourse

