Research and Application of Fruit Quality Inspection Technology Based on Computer Vision

2025/11/27 14:35


Fruit quality inspection is a crucial link in the modern agricultural industry chain, directly affecting the commercial value and market competitiveness of fruits. With the rapid development of computer vision and artificial intelligence technologies, fruit inspection technology has moved from traditional manual sorting to a new stage of intelligent and automated processing. This paper systematically reviews the research progress and application prospects of fruit quality inspection technology based on computer vision.


1. Technical Principles and System Composition of Fruit Visual Inspection


A computer vision-based fruit inspection system mainly acquires digital images of fruits through image acquisition equipment. Then, image processing algorithms or deep learning models are used to analyze the images, extracting feature parameters such as fruit size, shape, color, and surface defects, ultimately achieving automated grading and quality assessment of the fruits.


A typical automated fruit grading system comprises two core subsystems: a defect detection system and a mechanical sorting system. In terms of hardware architecture, the system typically consists of a conveyor belt, an image acquisition module, a control unit, and an actuator. The image acquisition module uses a CCD camera or USB camera in conjunction with an LED light source to capture RGB images of the fruits in a closed environment to eliminate shadows and external light interference. The control core employs a microcontroller to coordinate image processing results with mechanical actions, achieving closed-loop control.


The image processing algorithm preprocesses the RGB image to convert it to grayscale, HSV, and other color spaces to optimize illumination consistency. Then, it extracts the target region through threshold segmentation, combines morphological operations such as dilation and erosion for noise reduction and contour enhancement, and finally calculates the proportion of defective areas. For example, when the defect proportion is >5%, the fruit can be classified as substandard.


2. Comparison of Traditional Image Processing and Deep Learning Techniques


Fruit visual inspection technology mainly develops along two paths: one is based on traditional image processing methods, and the other is based on deep learning methods.


Traditional image processing technology mainly uses color and texture feature extraction combined with machine learning algorithms to achieve fruit quality detection. Shao Yu et al. proposed an apple leaf disease detection method based on image processing technology. They used GrabCut and watershed image segmentation algorithms to remove the background, then extracted leaf disease features through discriminative local preservation projection algorithm, and finally achieved disease detection through a K-nearest neighbor classifier, achieving an accuracy rate of 91.84%. In their research on black spot disease detection in jujubes, Sun Shipeng et al. analyzed and modeled nine color components of images in the RGB, HSB, and Lab color spaces, achieving a disease detection accuracy of 94.2%.


Traditional methods are advantageous due to their algorithmic transparency, low computational complexity, and low hardware requirements. However, their detection performance is greatly affected by lighting conditions; threshold segmentation is prone to failure when the contrast between the fruit peel color and the background is low or the lighting is uneven. For example, the yellow-green gradient area on the mango peel is easily misclassified as a defect, leading to a high false positive rate.


Deep learning technologies, especially Convolutional Neural Networks (CNNs) and YOLO algorithms, significantly improve the accuracy and robustness of fruit detection by automatically extracting features through end-to-end learning. In a study at Faisalabad Agricultural University, the validation accuracy of the CNN model for defect detection in mangoes and tomatoes reached 95% and 93.5%, respectively, significantly higher than the 89% and 92% of traditional image processing methods.


Deep learning models exhibit stronger adaptability in complex environments, effectively addressing challenges such as fruit pose, occlusion, and background changes. For example, YOLOv8, by optimizing its backbone network structure and introducing a dynamic attention mechanism, can more accurately capture changes in fruit skin texture, color differences, and morphological features, significantly improving the accuracy of identifying rotten areas.


3. Key Evaluation Indicators for Fruit Quality Inspection


Computer vision-based fruit quality inspection mainly revolves around appearance quality, including four main parameters: size, shape, color, and surface defects.


Size and shape features are the basic basis for fruit grading. Fruit size is usually quantified by indicators such as transverse diameter, longitudinal diameter, and volume. Shape features can be described by geometric features such as roundness, rectangularity, and eccentricity. The formula for roundness is 4π × area / perimeter², reflecting the degree to which the fruit is close to a circle; rectangularity is the ratio of area to the area of the smallest bounding rectangle. These geometric features have good distinguishability for fruits that are close to a circle, such as apples and oranges.


Color features are important indicators for judging the ripeness and quality of fruit. In computer vision systems, fruit color is usually represented using color spaces such as RGB, HSV, and Lab. The HSV color space separates color information from brightness information, which is more in line with the characteristics of human visual perception. Color characteristics can be quantified through statistical features of hue, saturation, and lightness, such as mean and standard deviation. For example, bananas gradually change from green to yellow during ripening, eventually becoming a deep yellow with brown spots. This change can be accurately identified by analyzing the hue distribution in the HSV color space.


Surface defect detection is a crucial step in fruit quality control. Surface defects include various types such as diseases, insect infestations, and bruises, directly affecting the commercial value of fruit. Deep learning-based methods perform excellently in this area; for example, the YOLOv8-timm model achieves a 95.3% mAP@0.5 accuracy in identifying good/bad fruit for various types, with a real-time detection speed of 42 FPS.


4. Application Scenarios and Practical Analysis


Computer vision technology has a wide range of applications in fruit quality inspection, covering the entire industry chain from agricultural production to retail consumption.


In agricultural production and harvesting, cameras or drones can be deployed in the fields to monitor the maturity of fruits and vegetables in real time using the YOLO model, assisting farmers in determining the optimal harvest time. Vision systems integrated into intelligent harvesting robots can identify fruit location, ripeness, and adhesion, controlling the robotic arm to perform precise harvesting and solving the problems of "mispicking unripe fruit" and "missing ripe fruit."


In post-harvest processing and grading, automated sorting systems can significantly improve efficiency. Research shows that vision-based automated systems are 10-20 times more efficient than traditional manual inspection, with an accuracy rate (mAP) exceeding 90% and a 60% reduction in labor costs. Yuan Jinli's research on apple external quality inspection and grading system achieves rapid grading by collecting multiple images covering the entire surface of the apple and integrating four parameters: shape, size, color, and surface defects.


In the retail and catering sectors, smart shelves use cameras to monitor the type and freshness of fruits and vegetables in real time and automatically update price tags; self-checkout kiosks utilize fruit recognition technology, allowing users to quickly identify product categories by scanning codes or taking photos, with a single product recognition time of less than 0.5 seconds. These applications significantly improve operational efficiency and reduce food waste.


5. Technological Challenges and Development Trends


Despite significant progress in fruit inspection using computer vision, several technological challenges remain. Model generalization ability is a core issue, and its adaptability to different environments and varieties needs improvement. Few-shot learning is another challenge; for rare fruit varieties, few-shot detection methods need to be developed. Furthermore, real-time requirements are particularly stringent in industrial scenarios, necessitating further optimization of model computational efficiency.


The future of fruit visual inspection technology will develop in multiple directions. Multimodal information fusion is an important trend, combining spectral and thermal imaging technologies to achieve non-destructive detection of fruit internal quality. For example, reflectance spectroscopy can be used to detect diseases on the surface of fruits and leaves, while transmission spectroscopy can detect internal diseases.


Lightweight model design is another trend, suitable for edge computing scenarios. Improved lightweight models such as YOLOv5n achieve a detection rate of 23 FPS and an average accuracy of 89% on the TI Sitara platform, meeting the real-time requirements of unmanned fruit vending systems.


Cross-domain application expansion will also drive technological development. Extending from fruit inspection to agricultural product quality monitoring and food processing quality control, computer vision technology has broad application prospects. With algorithm optimization and reduced hardware costs, intelligent fruit inspection systems will continue to develop towards widespread adoption and greater intelligence.


Conclusion


Computer vision-based fruit quality inspection technology has become an important component of smart agriculture, driving the intelligent upgrading of the fruit industry chain. From traditional image processing to deep learning, technological evolution has significantly improved inspection accuracy and efficiency. With the maturity of technologies such as multimodal fusion and edge computing, visual fruit inspection will play an even more important role in precision agriculture and food supply chain management, providing strong technical support for reducing post-harvest losses and improving fruit quality.