A method, apparatus, system, and storage medium for sorting fruit and vegetable quality.
By combining visible light images and near-infrared spectral data into a dual-source fusion judgment matrix, the problem that a single surface image matrix in existing technologies cannot comprehensively consider the quality of fruits and vegetables is solved. This enables a comprehensive evaluation of the appearance and internal quality of fruits and vegetables, improving sorting accuracy and reliability.
Patent Information
- Application Number
- CN202611379740.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-07
- Publication Date
- 2026-11-17
AI Technical Summary
Existing fruit and vegetable sorting devices rely on a single surface image matrix for calculation, which cannot comprehensively consider the appearance and internal quality of fruits and vegetables, resulting in limited grading accuracy. Furthermore, visual recognition relies too heavily on defective samples, leading to missed detection of bad fruit.
This study employs a method combining visible light images and near-infrared spectral data. Through an unsupervised anomaly detection model and a dual-source fusion judgment matrix, the appearance and internal quality of fruits and vegetables are comprehensively evaluated. The unsupervised anomaly detection model is used to extract appearance feature parameters, which are then weighted and calculated in conjunction with the internal quality feature parameters from the near-infrared spectral data to output a comprehensive defect score.
It improves the ability to generalize the identification of unknown and rare skin defects, effectively overcomes the defect of missing detection of outwardly damaged fruit, realizes the capture of hidden lesions inside the fruit flesh, and improves the overall accuracy and reliability of fruit and vegetable quality production line grading and sorting.
Smart Images

Figure CN123115871A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of fruit and vegetable sorting technology, and in particular to a method, apparatus, system and storage medium for sorting fruit and vegetable quality. Background Technology
[0002] The sorting device is mainly used for the industrial grading of small berries. It mainly relies on conveyor belts to separate large quantities of bulk fruits and vegetables into single-row queues, and uses optical detection components and actuators to perform assembly line judgment and sorting of individual fruits and vegetables to determine their quality.
[0003] In existing technologies, sorting devices typically combine machine vision with a transverse conveyor belt. An industrial camera and supplementary lighting source are usually installed above the conveyor belt, and a pneumatic pusher or rigid flap is installed on the side of the end channel. After bulk fruits and vegetables fall into the conveyor belt from the feeding end, they continue to move forward with the belt. The industrial camera captures images of the fruit and vegetable surface, which are then sent to a pre-supervised target detection network to identify surface defects. Fruits and vegetables that are subsequently determined to be defective are pushed away from the main conveyor channel by the pneumatic pusher when they reach the end, thus completing the sorting process.
[0004] However, the aforementioned existing technologies have the following drawbacks: because defective samples are labeled and then fed into the model for training, the data preparation cost is high. In the production line, the morphology of skin defects of fruits and vegetables varies and there are a large number of unpredictable rare lesions, such as non-standard shaped damage and special mold spots. It is difficult to exhaustively list all non-standard shaped defects, resulting in poor model generalization ability and easy omission of bad fruits. In addition, because the calculation relies on a single surface image matrix, it is impossible to comprehensively consider the appearance and internal quality of fruits and vegetables, which limits the overall grading accuracy and reduces the overall quality of fruits and vegetables.
[0005] Therefore, this application aims to solve the problem that existing visual recognition of fruits and vegetables relies too much on defective samples, resulting in missed detection of bad fruits. It also solves the problem that the operation of a single surface image matrix cannot comprehensively consider the quality of fruits and vegetables. Summary of the Invention
[0006] The main purpose of this application is to provide a sorting method, apparatus, system and storage medium for fruit and vegetable quality, which aims to solve the problem that existing visual recognition of fruits and vegetables relies too much on defective samples, resulting in missed detection of bad fruits, and also to solve the problem that the operation of a single surface image matrix cannot comprehensively consider the quality of fruits and vegetables.
[0007] To achieve the above objectives, this application proposes a method for sorting fruits and vegetables based on their quality, comprising the following steps: Acquire visible light images and near-infrared spectral data of the target fruits and vegetables; Perform serial image preprocessing on the visible light image to extract standardized single-fruit region of interest images of the target fruits and vegetables; The standardized single fruit region of interest image is input into an unsupervised anomaly detection model pre-trained based on intact fruit and vegetable samples, and the unsupervised anomaly detection model outputs the appearance feature parameters of the target fruit and vegetable. Perform spectral preprocessing and characteristic wavelength screening on the near-infrared spectral data to extract the internal quality characteristic parameters of the target fruits and vegetables; Substitute the appearance feature vector composed of the appearance feature parameters and the spectral internal feature vector composed of the internal quality feature parameters into the dual-source fusion judgment matrix, and perform weighted calculation according to the preset appearance weight coefficient and internal spectral weight coefficient to obtain the comprehensive defect score of the target fruit and vegetable. By comparing the comprehensive defect score with the preset grade threshold, the quality grade of the target fruits and vegetables is determined and the corresponding sorting control command is output.
[0008] Preferably, the serial image preprocessing includes: Adaptive threshold segmentation is performed on the visible light image to generate a binary mask that distinguishes between the fruit and vegetable region and the background region; Based on the binary mask, reflective pixels that exceed the preset highlight threshold are filtered out, and the continuous reflective areas that meet the preset area conditions are weighted and smoothed using the surrounding non-reflective fruit and vegetable texture pixels. The binary mask is used to identify the texture missing area on the surface of fruits and vegetables caused by occlusion. When the area ratio of the texture missing area does not exceed the preset occlusion threshold, interpolation filling is performed using the effective pixels around the missing area to repair it. The minimum bounding box is generated based on the binary mask, and the smoothed and repaired image is cropped according to the boundary of the minimum bounding box to obtain a standardized single-fruit region of interest image.
[0009] Preferably, the unsupervised anomaly detection model includes a patch description network, an autoencoder, and a teacher-student network branch; The appearance feature parameters output by the unsupervised anomaly detection model include at least: coordinates of the fruit surface blemish area, blemish area ratio, fruit shape index, and color uniformity. The extracted internal quality characteristic parameters of the target fruits and vegetables include at least: the soluble solids content of the pulp and the proportion of internal browning areas.
[0010] Preferably, the step of substituting the appearance feature vector composed of the appearance feature parameters and the spectral internal feature vector composed of the internal quality feature parameters into the dual-source fusion judgment matrix, and performing weighted calculation according to preset appearance weight coefficients and internal spectral weight coefficients, includes: The appearance feature vector is normalized to obtain a first score, and the spectral internal feature vector is normalized to obtain a second score. The dynamic adjustment factor is extracted based on the effective pixel area of a single fruit. The product of the first score and the appearance weight coefficient is added to the product of the second score, the internal spectral weight coefficient, and the dynamic adjustment factor to output the comprehensive defect score.
[0011] Preferably, the step of weighting the calculation according to the preset appearance weighting coefficient and the internal spectral weighting coefficient further includes: Preset internal lesion extreme threshold; When the proportion parameter of the internal browning region in the internal feature vector of the spectrum is greater than the extreme threshold of the internal lesion, the comprehensive defect score representing the lowest quality level is output.
[0012] This application also discloses a fruit and vegetable quality sorting device, comprising: Material conveying components are used to carry and transport target fruits and vegetables; An information acquisition component is installed on the conveying path of the material conveying component, and it is used to acquire visible light images and near-infrared spectral data of the target fruits and vegetables. A control component, communicatively connected to the information acquisition component, is configured to execute the fruit and vegetable quality sorting method as described in any one of claims 1 to 5, and output sorting control instructions; The sorting component is located on the conveying path of the material conveying component and downstream of the information acquisition component, and is communicatively connected to the control component; the sorting component performs rejection or release actions on the target fruits and vegetables based on the received sorting control instructions.
[0013] Preferably, the material conveying assembly includes: At least one conveyor belt is used to transport the target fruits and vegetables; Limiting rollers are respectively installed on the conveyor belt; An information acquisition component is positioned above the conveyor belt; The sorting component, located above the conveyor belt, performs rejection or release actions on the target fruits and vegetables based on the sorting control commands generated by the control component.
[0014] Preferably, the information acquisition component includes: A detection cover is positioned above the conveyor belt; The detection chamber is located between the detection cover and the conveyor belt; The supplementary lighting source, the image acquisition camera, and the near-infrared spectral sensor are respectively fixedly installed inside the detection chamber; The image acquisition camera consists of three cameras, which are arranged at a preset angle around the cross-section of the material conveying component. The acquisition optical paths of the three cameras are all focused on the conveying area of the material conveying component to simultaneously acquire multi-dimensional visible light images of the same target fruit and vegetable. The near-infrared spectral sensor acquires near-infrared spectral data in a direction facing the target fruit and vegetable.
[0015] This application also discloses a fruit and vegetable quality sorting system, including: The data acquisition module is used to acquire visible light images and near-infrared spectral data of the target fruits and vegetables; The image preprocessing module is used to perform serial image preprocessing on the visible light image to extract standardized single fruit region of interest images of the target fruits and vegetables; The visual feature extraction module is used to input the standardized single fruit region of interest image into an unsupervised anomaly detection model pre-trained based on intact fruit and vegetable samples, and the unsupervised anomaly detection model outputs the appearance feature parameters of the target fruit and vegetable. The spectral feature extraction module is used to perform spectral preprocessing and feature wavelength screening on the near-infrared spectral data to extract the internal quality characteristic parameters of the target fruits and vegetables. The dual-source fusion judgment module is used to substitute the appearance feature vector composed of the appearance feature parameters and the spectral internal feature vector composed of the internal quality feature parameters into the dual-source fusion judgment matrix, and perform weighted calculation according to the preset appearance weight coefficient and internal spectral weight coefficient to obtain the comprehensive defect score of the target fruit and vegetable. The graded output module is used to compare the comprehensive defect score with the preset grade threshold, determine the quality grade of the target fruits and vegetables, and output the corresponding sorting control instructions.
[0016] This application also includes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method for sorting fruit and vegetable quality.
[0017] The above technical solution has the following advantages: This application introduces an unsupervised anomaly detection model pre-trained on intact fruit and vegetable samples, eliminating the reliance on massive defect labeling data and improving the generalization ability to identify unknown and rare epidermal defects, effectively overcoming the defect of missed detection of outwardly damaged fruit. Secondly, by simultaneously acquiring near-infrared spectral data and extracting internal quality feature parameters, the limitation of a single surface image matrix being unable to penetrate the peel is avoided, enabling the capture of latent lesions inside the fruit flesh (such as black heart and browning). Furthermore, the extracted appearance feature vector and spectral internal feature vector are substituted into a dual-source fusion judgment matrix for weighted calculation, constructing a dual-source fusion judgment matrix that uniformly maps multi-source heterogeneous optical signals into a comprehensive defect score, thereby comprehensively improving the overall accuracy and reliability of fruit and vegetable quality line grading and sorting. Attached Figure Description
[0018] The present application will now be described in detail with reference to specific embodiments and accompanying drawings, wherein: Figure 1 This is a structural diagram of Example 1 of this application; Figure 2 This is a structural diagram of Example 2 of this application; Figure 3 This is a structural diagram of Example 3 of this application; Figure 4 This is a flowchart of the method described in this application; Figure 5 This is a flowchart of method step S200 of this application; Figure 6 This is a structural block diagram of the sorting system in this application.
[0019] In the diagram: 10. Material rack; 20. Material conveying assembly; 21. First conveyor belt; 22. Second conveyor belt; 23. Limiting roller conveyor; 24. Third conveyor belt; 30. Information acquisition assembly; 31. Detection cover; 32. Detection chamber; 33. Supplemental lighting source; 34. Image acquisition camera; 35. Near-infrared spectral sensor; 40. Sorting assembly; 41. Mounting frame; 42. Motor; 43. Paddle; 50. Rejection channel; 60. Qualified box; 70. Rejection box; 80. Control assembly; 90. Data acquisition module; 91. Image preprocessing module; 92. Visual feature extraction module; 93. Spectral feature extraction module; 94. Dual-source fusion judgment module; 95. Graded output module. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the following specific embodiments are merely illustrative of this application and do not constitute a limitation thereof.
[0021] Traditional fruit and vegetable sorting equipment often uses visible light single-modal machine vision, combined with a transverse conveyor belt and pneumatic push rod mechanism, when sorting small berries such as hawthorn, apples, oranges, and peaches. During continuous feeding and conveying, bulk materials tend to form multiple layers of compression and overlap at the feed end. This causes the optical signals collected laterally to be blocked by the mutual occlusion of the fruits and vegetables, resulting in obstruction of the transmitted and diffuse reflection light paths. Consequently, signals of hidden lesions inside the fruits and vegetables (such as black heart, browning, and insect infestation) appear as pixel aliasing or even missing at the bottom layer of the image.
[0022] Meanwhile, existing visual models mostly use supervised target detection networks with full sample manual annotation. In environments with stray light interference in workshops and high light reflection on conveyor surfaces, it is difficult to accurately extract the complete region of interest for a single fruit. Furthermore, under high concurrency conditions, the inference latency of single-dimensional image processing often exceeds the cycle time of the transmission pipeline.
[0023] In addition, the instantaneous impact load applied by traditional rigid push rods or pneumatic flap mechanisms can easily damage the external tissue of thin-skinned berries such as hawthorn, resulting in secondary mechanical damage.
[0024] In view of the various problems mentioned above, this application proposes a method, apparatus, system and storage medium for sorting fruit and vegetable quality, and solves the various problems mentioned above through the following various embodiments or combinations of embodiments.
[0025] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0026] like Figures 1 to 3 As shown, this application also discloses a fruit and vegetable quality sorting device, which includes a material conveying component 20, an information acquisition component 30, a control component 80, and a sorting component 40; the material conveying component 20 is used to carry and convey target fruits and vegetables; the information acquisition component 30 is disposed on the conveying path of the material conveying component 20, and is used to acquire visible light images and near-infrared spectral data of the target fruits and vegetables; the control component 80 is communicatively connected to the information acquisition component 30, and is configured to execute the above-mentioned fruit and vegetable quality sorting method and output sorting control commands; the sorting component 40 is disposed on the conveying path of the material conveying component 20 and is located downstream of the information acquisition component 30, and is communicatively connected to the control component 80; the sorting component 40 performs rejection or release actions on the target fruits and vegetables based on the received sorting control commands.
[0027] As a further embodiment of this application, the sorting device of this embodiment also includes a material rack 10. The material rack 10 is used to hold the fruits and vegetables to be tested in the initial state, such as hawthorn, jujube, red date, cherry tomato, small tomato and other spherical fruits and vegetables. Taking hawthorn as an example in this embodiment, it can also be equipped with a corresponding conveyor belt to transport the hawthorn in batches to the material conveying component 20, so that the hawthorn to be tested passes through the subsequent information collection component 30 in sequence. Specifically, the material rack 10 is also equipped with a guide slide plate installed at an incline, and a comb-type roller leveling mechanism is assembled at the bottom. In an equivalent embodiment, it can also be replaced by a high-frequency vibrating leveling plate or a soft brush mechanism. Under the action of disturbance, the piled bulk hawthorn is separated one by one and spread flat into the subsequent material conveying component 20.
[0028] The material conveying assembly 20 is located downstream of the material rack 10. It primarily receives hawthorns from the material rack 10 and transports them to the information acquisition assembly 30. It includes at least one conveyor belt for transporting the hawthorns to the information acquisition assembly 30. Furthermore, the material conveying assembly 20 also includes one or more parallel conveyor belts for dividing the hawthorns into multiple conveying and detection paths. In the material conveying assembly 20 of this application, it internally includes at least a motor 42 for driving the conveyor belt and a frame for mounting the conveyor belt. The conveyor belt is mounted on the frame via shafts and bearings. The motor 42 drives at least one shaft to operate the conveyor belt. The above detailed solutions are all existing conveyor belt operation and implementation schemes and will not be repeated here.
[0029] The information acquisition component 30 is positioned above the material conveying component 20. It is used to photograph the hawthorns above the conveyor belt within the material conveying component 20 to obtain visible light images and near-infrared spectral data of the hawthorns on the conveyor belt. Then, it analyzes the above two data within a preset time window to determine the comprehensive defect score of the target fruit and vegetable. Finally, it outputs the corresponding sorting control command based on the comprehensive defect score of the target fruit and vegetable. The sorting control command can include rejection actions and release actions. The rejection actions also include the rejection of second-level qualified products and the rejection of third-level defective products.
[0030] On the material inlet side wall of the information acquisition component 30, a through-beam or diffuse reflection material positioning photoelectric sensor is installed for each conveying channel. When the hawthorn blocks the light beam, an edge jump trigger pulse is generated, which latches the current encoder reading and simultaneously triggers the hawthorn to take pictures and collect near-infrared spectral data. The near-infrared spectral data can be collected using a spectrometer.
[0031] The control component 80 is communicatively connected to the aforementioned information acquisition component 30, and is used to receive the visible light image and near-infrared spectral data, and analyze these two types of data. Specifically, the control component 80 adopts a modular control box integrated on the outside of the rack, and can use a dual-chip architecture of FPGA and PLC programmable logic controller. Among them, the FPGA module communicates directly with the high-speed serial interface (such as LVDS or GigE) of the industrial camera and near-infrared spectrometer, and is responsible for the high-speed pipeline filtering preprocessing of near-infrared spectrum SG-SNV-SPA, and runs the improved EfficientAD neural network inference engine after quantization and clipping, outputting the area, coordinates, sugar content, browning and other indicators of single fruit defects within 20ms; the PLC module interacts with the FPGA through a high-speed serial port or industrial Ethernet, and receives the comprehensive defect score and grade judgment results; at the same time, it is equipped with the A / B phase pulse counter of the photoelectric rotary encoder in real time, and calculates the precise time window for the target fruit to arrive at the downstream sorting component 40 by combining the initial pulse value at the trigger time of the photoelectric sensor.
[0032] The sorting component 40 is rigidly installed on the conveyor channel downstream of the information acquisition component 30. Each independent conveyor channel is equipped with a sorting component 40 of this embodiment. The sorting component 40 of this embodiment can be a wheel-type shallow scoop wheel, which has a mounting frame 41, a motor 42 and a paddle 43. The mounting frame 41 can be mounted on the information acquisition component 30 or directly mounted on the frame of the material conveying component 20. The motor 42 is mounted on the mounting frame 41, and the paddle 43 is connected and fixed to the output shaft of the motor 42. The paddle 43 can extend downward to the position of the hawthorn on the conveyor belt. The signal input terminal of the motor 42 is connected to the output terminal of the control component 80 to receive the sorting control command issued by the control component 80 and start the motor 42 based on the sorting control command, so that the motor 42 drives the paddle 43 to remove the hawthorn on the material conveying component 20.
[0033] Specifically, motor 42 can be a high-speed stepper motor 42 or an electromagnetic direct-drive rotary actuator. Multiple shallow-spoon-shaped, wheel-type polyurethane flexible dials are mounted on the output shaft of motor 42. Preferably, four dials are used, with the four blades evenly distributed around the circumference in a cross-shaped wheel profile. Each blade tip is stamped or injection-molded to form an inwardly concave, shallow-spoon-shaped curved surface, and the material is food-grade high-resilience polyurethane with a Shore hardness of A60 to A80. When the PLC determines that the hawthorns arriving at the unloading station are third-grade defective products, at the encoder matching time point, the output shaft of stepper motor 42 is driven to rotate. The shallow scoop blades smoothly cut into the edge of the hawthorn from the side and rear, lifting and pushing the defective fruit sideways to slide into the removal channel 50 on the side. The removal channel can be implemented by guide rails, pipes or other guiding structures. The removal channel 50 is connected to the removal box 70 below, so that the fruit to be removed falls into the removal box 70 below through the removal channel 50. Its shallow scoop concave surface can completely cover the curved surface of the fruit, and no hard impact stress is generated during high-speed removal, which effectively prevents the fruit and vegetables from being scratched and broken. After rotating once and resetting, it will not interfere with the next fruit following closely behind. The qualified fruit does not need to be turned by the wheel and is directly output to the qualified box 60 at the end by the conveyor belt.
[0034] like Figures 1 to 3 As shown, as a further embodiment of this application, the material conveying assembly 20 includes: at least one conveyor belt, limiting roller conveyors 23, information acquisition assembly 30, and sorting assembly 40. The at least one conveyor belt is used to convey target fruits and vegetables; the limiting roller conveyors 23 are respectively disposed on the conveyor belt; the information acquisition assembly 30 is disposed above the conveyor belt; the sorting assembly 40 is disposed above the conveyor belt, and performs rejection or release actions on the target fruits and vegetables based on the sorting control command generated by the control assembly 80.
[0035] Specifically, there is no detailed limitation on the number of conveyor belts. In this embodiment, a single conveyor belt that runs through the information acquisition component 30 can be used, or multiple segmented conveyor belts can be used, as long as the conveyor belts can connect the material rack 10 and the qualified box 60. An independent information acquisition component 30 can be set above the conveyor belt. In addition, to improve the convenience of installation, the conveyor belt in this embodiment can be spliced from a first conveyor belt 21, a second conveyor belt 22 and a third conveyor belt 24. The first conveyor belt 21 is located upstream and is used to receive the hawthorns conveyed by the material rack 10. The second conveyor belt 22 is connected downstream of the first conveyor belt 21, and the third conveyor belt 24 is connected downstream of the second conveyor belt 22. Both the second conveyor belt 22 and the third conveyor belt 24 are equipped with limit rollers 23. The limit rollers 23 operate synchronously with the conveyor belt. As long as the conveyor belt starts to move, the limit rollers 23 will drive the hawthorns forward synchronously. The limiting roller conveyor 23 can ensure that the hawthorn can be stably set in the middle of the second conveyor belt 22 and the third conveyor belt 24, thereby facilitating the information acquisition component 30 to acquire visible light images and near-infrared spectral data of the hawthorn.
[0036] Among them, the limiting roller 23 is conical and is composed of rotating rollers spliced together with bidirectional conical grooves along the axial direction. Adjacent conical grooves naturally form multiple independent guide grooves that are parallel to each other on the conveying surface. The included angle of the conical slope matches the average diameter of the hawthorn ball, forcing the hawthorn to fall into the center of the bottom of the groove while moving forward, realizing single-channel, single-fruit queuing and limiting, reducing lateral displacement and mutual stacking.
[0037] As a preferred option, an incremental photoelectric rotary encoder is fixed to the coaxial end of the roller conveyor drive shaft. This encoder is used to output a pulse sequence that represents the actual linear displacement of the roller conveyor in real time at a microsecond-level sampling frequency, providing a unified time and displacement reference for tracking fruits and vegetables throughout the entire process.
[0038] like Figures 1 to 3 As shown in the figure, as a further embodiment of this application, the information acquisition component 30 includes a detection cover 31, a detection chamber 32, a supplementary light source 33, an image acquisition camera 34, and a near-infrared spectral sensor 35. The detection cover 31 is disposed above the conveyor belt; the detection chamber 32 is disposed between the detection cover 31 and the conveyor belt; the supplementary light source 33, the image acquisition camera 34, and the near-infrared spectral sensor 35 are respectively fixedly installed inside the detection chamber 32; wherein, there are three image acquisition cameras 34, which are distributed around the cross-section of the material conveying component 20 at a preset angle, and the acquisition optical paths of the three image acquisition cameras 34 are all focused on the conveying area of the material conveying component 20, so as to simultaneously acquire multi-dimensional visible light images of the same target fruit and vegetable.
[0039] Specifically, the information acquisition component 30 is fixedly mounted above the middle section of the material conveying component 20, such as at the junction of the second conveyor belt 22 and the third conveyor belt 24. The detection chamber 32 is an embedded, sealed metal detection chamber 32, which is used to isolate stray light and dust from the workshop to avoid affecting the accuracy of shooting and acquisition.
[0040] Three universal USB global exposure industrial cameras are symmetrically installed inside the inspection chamber 32. The three cameras are at preset angles in a cross-section perpendicular to the material conveying direction, as shown on the left. Directly above right side Surrounding the hawthorn focused on the independent guide groove below, and with the supplementary light source 33 arranged around the camera lens, the supplementary light source 33 can be a ring-shaped LED diffuse reflection supplementary light to eliminate reflection shadows and realize the synchronous capture of multi-dimensional images of the upper surface of a single hawthorn and the exposed curved surfaces on both sides without dead angles.
[0041] In addition, a short-wave near-infrared spectral sensor 35 is integrated horizontally parallel to the conveying surface inside the detection chamber 32. The near-infrared spectral sensor 35 uses an InGaAs linear array sensor chip in the 900nm to 1700nm band, and a quartz light-transmitting window is opened at the bottom. The probe is vertically facing the central cross section of the fruit in each conveying channel, and captures the transmission spectrum of the pulp in a non-contact diffuse reflection form.
[0042] Please see the appendix Figures 1 to 4This application also provides a method for sorting fruits and vegetables based on their quality, mainly applied in the sorting process of small berries such as hawthorn that are prone to internal latent diseases and have easily damaged skin. This method is executed by the aforementioned control component 80, which can be a combination of an FPGA chip and an industrial control host. The specific processing flow includes the following steps: Step S100: Acquire visible light images and near-infrared spectral data of the target fruits and vegetables; When the target fruits and vegetables enter the detection chamber 32 along with the material conveying component 20, the optical sensing component in the detection chamber 32 synchronously captures multi-dimensional signals of the target fruits and vegetables, which may include visible light images and near-infrared spectral data.
[0043] The visible light image is obtained by an image acquisition camera 34 arranged in the detection chamber 32. The image acquisition camera 34 can be an industrial CMOS camera or a CCD area array camera, and the pixel array is a color RGB three-channel format. Near-infrared spectral data is obtained by a short-wavelength near-infrared spectral sensor 35 arranged on the information acquisition component 30, such as an indium gallium arsenide (InGaAs) detector with a wavelength range covering 900 nm to 1700 nm. The near-infrared spectral sensor 35 scans in diffuse reflectance or transmission mode, and the spectral sampling interval is preferably 1 nm to 5 nm. The acquired continuous spectral signal is quantized into a one-dimensional discrete digital absorbance sequence by an A / D analog-to-digital converter chip.
[0044] Finally, in this step S100, the visible light image and near-infrared spectral data of the target fruits and vegetables in the detection chamber 32 are obtained by the image acquisition camera 34 and the near-infrared spectral sensor 35, respectively.
[0045] Step S200: Perform serial image preprocessing on the visible light image to extract standardized single-fruit region of interest images of the target fruits and vegetables; like Figure 5 As shown, in order to eliminate the interference of stray light reflection, edge distortion, and squeezing of nearby fruits on subsequent feature analysis, this step performs a multi-stage serial cascade preprocessing operation on the original visible light image. In the entire visible light image processing operation, the output of the preceding stage is used as the input of the following stage. The serial image and processing procedure of this step are as follows: Step S201: Perform adaptive threshold segmentation on the visible light image to generate a binary mask that distinguishes between the fruit and vegetable region and the background region; Step S202: Based on the binary mask, filter out reflective pixels that exceed the preset highlight threshold, and use the surrounding non-reflective fruit and vegetable texture pixels to perform weighted smoothing correction on the continuous reflective areas that meet the preset area conditions. Step S203: Combine the binary mask to identify the texture missing area on the surface of fruits and vegetables caused by occlusion, and when the area ratio of the texture missing area does not exceed the preset occlusion threshold, use the effective pixels around the missing area to perform interpolation filling repair. Step S204: Generate a minimum bounding box based on the binary mask, and crop the smoothed and repaired image according to the boundary of the minimum bounding box to obtain a standardized single-fruit region of interest image.
[0046] First, before step S201, the acquired raw visible light image is scaled to the target size preset by the model while maintaining the original aspect ratio (e.g., ...). Pixels or (pixels), calculate the pixel difference between the target size and the scaled size in the horizontal and vertical directions, symmetrically distribute the pixel difference to the edge areas around the image, and fill the boundaries using a preset grayscale value (such as a constant pixel value of 114); then, according to the brightness conversion formula Convert a three-channel RGB image into a single-channel grayscale matrix.
[0047] Secondly, a circular neighborhood sliding window with a radius parameter r is set on the single-channel grayscale matrix (preferably). or (pixels), sort all the gray values of the pixels covered inside the window in ascending order, extract the median gray value and replace the value of the center pixel of the window, so as to filter out isolated salt and pepper noise introduced by the dark current of the sensor while preserving the step contour of the fruit edge.
[0048] Then, in step S201, the gray-level histogram of the filtered image is statistically analyzed, and the Otsu algorithm is used to traverse the global candidate thresholds. The inter-class variance between the target foreground region (i.e. the target fruit and vegetables) and the background region is calculated respectively. The gray value that maximizes the inter-class variance is selected as the optimal threshold for binarization, and a coarse segmentation binary mask representing the main body of the fruit is generated. The foreground pixels are set to 1 and the background pixels are set to 0.
[0049] Then, in step S202, a reflective highlight threshold is set based on the foreground range defined by the binary mask, such as a grayscale value greater than 240. When the area of a continuous highlight region exceeds the set area threshold, it is determined to be conveyor belt reflection or strong reflection of fruit peel wax. At this time, the grayscale mean of the normal fruit peel texture pixels at the edge of the highlight region is used, combined with a two-dimensional Gaussian weighted kernel, to perform local smoothing reconstruction on the highlight pixels, eliminating false edges and overexposed white spots. Small highlight noise is retained to avoid excessive smoothing that would damage the natural fruit spot characteristics.
[0050] Furthermore, in step S203, based on binary mask morphology detection of fruit boundary depressions, missing areas caused by contact between adjacent materials or mechanical edge occlusion are identified, and the percentage of the occluded area to the total outline area of a single fruit is calculated. When the percentage of the occluded area is less than or equal to a preset occlusion threshold (e.g., 15%), effective texture pixels outside the missing boundary are extracted, and bilinear interpolation is used to fill and repair the area inward along the normal direction to complete the geometric outline of the single fruit. If the percentage of occlusion exceeds the occlusion threshold, it is directly marked as an invalid sample and temporarily rejected. The temporarily rejected target fruits and vegetables can be sorted a second time.
[0051] Finally, in step S204, a minimum bounding rectangle of a single fruit is generated based on the repaired connected component contour. A safety margin is extended outward along the boundary of the bounding box, such as by 2 to 4 pixels. Rectangular cropping is performed on the multi-channel or single-channel image to remove all external background pixels. Finally, a standardized region of interest image of each single fruit with independent alignment is output.
[0052] Step S300: Input the standardized single fruit region of interest image into an unsupervised anomaly detection model pre-trained based on intact fruit and vegetable samples, and have the unsupervised anomaly detection model output the appearance feature parameters of the target fruit and vegetable; In this step, a standardized single-fruit region of interest image is pre-deployed on computing hardware, such as an FPGA inference acceleration unit or an embedded GPU, to form an unsupervised anomaly detection model. The unsupervised anomaly detection model can use a modified EfficientAD model architecture, which uses only perfectly healthy fruit and vegetable samples as the training set. The network consists of a Patch Description Network (PDN), an autoencoder, and teacher-student network branches. During the inference phase, the model directly generates a pixel-level anomaly heatmap by embedding local feature blocks of the input image in a high-dimensional manner and comparing the feature reconstruction errors output by the student network and the teacher network.
[0053] Based on this abnormal heatmap, a set of appearance characteristic parameters of the target fruits and vegetables is calculated and output, including: Coordinates of fruit surface blemishes : Characterizes the spatial location of damage, mold spots, and insect holes on the surface of target fruits and vegetables; Defect area ratio The proportion of abnormal pixels to the total number of valid pixels in a single result; Fruit shape index The ratio of the longitudinal diameter to the transverse diameter of a single fruit; Color uniformity The standard deviation or information entropy of the H component histogram of the main color pixel on the fruit surface in the HSI space.
[0054] Based on the above-listed set of appearance feature parameters, this embodiment concatenates and encapsulates these sets of appearance feature parameters into an appearance feature vector. In addition, including but not limited to the appearance feature parameters listed above.
[0055] Step S400: Perform spectral preprocessing and characteristic wavelength screening on the near-infrared spectral data to extract the internal quality characteristic parameters of the target fruits and vegetables; For the continuous spectral absorbance sequence of the one-dimensional near-infrared spectral data obtained in step S100, a polynomial convolution smoothing filter is first performed to suppress high-frequency electrical noise. This step can use a Savitzky-Golay (SG) sliding window digital filter. Then, a standard normal variable transformation (SNV) is performed to eliminate baseline drift caused by material particle scattering and optical path difference.
[0056] After baseline correction, the continuous projection algorithm (SPA) was used to eliminate redundant collinear bands across the entire spectrum from 900 nm to 1700 nm, identifying 4 to 8 characteristic wavelengths highly sensitive to CH bonds in fruit pulp and oxidative browning of tissue. The absorbance of these characteristic wavelengths was then substituted into multiple linear regression or partial least squares regression equations to calculate quantitative parameters characterizing the internal quality of the fruit pulp, including: Soluble solids content parameters (Characterizing sugar content, unit: ); Internal browning area percentage parameter (Characteristics of the volume ratio of soft, rotten, moldy, and black-hearted necrosis in the fruit core).
[0057] In this embodiment, the above-mentioned quantization parameters are concatenated and encapsulated into an internal feature vector of internal quality feature parameters, that is... .
[0058] Step S500: Substitute the appearance feature vector composed of the appearance feature parameters and the spectral internal feature vector composed of the internal quality feature parameters into the dual-source fusion judgment matrix, and perform weighted calculation according to the preset appearance weight coefficient and internal spectral weight coefficient to obtain the comprehensive defect score of the target fruit and vegetable. To achieve a comprehensive assessment of both internal and external quality, the appearance feature vector is used. With the spectral internal eigenvector Substituting this into the dual-source fusion decision matrix, it also includes: Step S501: Normalize the appearance feature vector to obtain a first score, and normalize the spectral internal feature vector to obtain a second score; Step S502: Extract a dynamic adjustment factor based on the effective pixel area of a single fruit, and add the product of the first score and the appearance weight coefficient to the product of the second score, the internal spectral weight coefficient and the dynamic adjustment factor to output the comprehensive defect score.
[0059] First, in step S501, range normalization mapping is performed on the two types of feature vectors respectively, and the multi-source heterogeneous parameters are uniformly compressed into the [0,1] interval to obtain the first score characterizing the severity of appearance defects. And a second score characterizing the degree of internal quality deterioration. Subsequently, based on preset appearance weighting coefficients... With internal spectral weighting coefficients Perform weighted fusion calculation.
[0060] In a preferred embodiment, the system presets , (Requires meeting) Defect comprehensive score The calculation formula is:
[0061] As a further preferred embodiment, in step S502, regarding the weighted calculation process of the dual-source fusion determination matrix, considering that the size differences of fruits of different specifications in the actual conveying channel will affect the penetration depth and diffuse reflection path of the near-infrared optical path, a dynamic compensation logic based on the projected area of the fruit is additionally introduced. Specifically, firstly, the binary mask of the fruit body generated in the preceding image preprocessing step (such as the Otsu adaptive threshold segmentation step) is called, and the total number of effective pixels with a pixel value of 1 in the connected domain of the binary mask is counted to characterize the effective pixel area of a single fruit of the current target fruit and vegetable. Subsequently, the extracted effective pixel area of a single fruit is compared with the benchmark fruit area constant stored in the processor or a nonlinear mapping operation is performed to generate a floating-point dynamic adjustment factor. .
[0062] After step S501, the first score obtained after normalization is... With the set appearance weight coefficient Multiply, and simultaneously normalize the resulting second score. , set internal spectral weighting coefficients and the dynamic regulating factors extracted above Perform a multiplication of the three terms, and finally add the product of the external terms to the product of the internal terms. The adder outputs the final comprehensive defect score, which is then:
[0063] It should be noted that, The dynamic adjustment factor; the dynamic adjustment factor in this step. The introduction of this feature enables cross-modal compensation coordination in the dual-source fusion decision matrix during operation. This is because when the target fruit is large, the effective pixel area is large, and the increased pulp thickness can lead to attenuation or deviation of the near-infrared reflection signal from internal lesions. In this case, a dynamic adjustment factor is utilized. Grading of fruits of various sizes improves the stability of fruit identification.
[0064] As a further preferred embodiment, this method also presets an internal lesion extreme value threshold. (For example, the browning rate is greater than 10%), when the internal browning region percentage parameter in the spectral feature vector. In this case, the overall defect score will be directly calculated. Set to the highest destructive score, i.e. They are forcibly classified as the lowest quality grade to prevent fruits and vegetables that are severely rotten inside but intact on the outside from being missed and leaked out.
[0065] Step S600: Compare the comprehensive defect score with the preset grade threshold to determine the quality grade of the target fruits and vegetables and output the corresponding sorting control command.
[0066] This step will calculate the comprehensive defect score. The grade is compared and determined with a preset grade classification threshold, as follows: like If the product is rated as Grade 1 qualified, it means that the target fruit or vegetable is of high quality and intact quality. like If the product is classified as a Level 2 qualified product, it indicates that the target fruit or vegetable has a slight defect. like If a product is determined to be a Level 3 defective item, a corresponding digital level or industrial bus control command is generated based on the determination result. This is the sorting control command mentioned in this step. The sorting control command includes the target channel number and the rejection timestamp. The sorting control command is then sent to... Figure 3 The sorting component 40 removes the corresponding third-grade substandard fruit.
[0067] like Figure 6 As shown, this embodiment provides a modular software system for implementing the above-described sorting method. This system is built upon the sorting method described above and is divided into multiple different processing modules, specifically: The data acquisition module 90 is used to acquire visible light images and near-infrared spectral data of the target fruits and vegetables; The data acquisition module 90 is used to respond to the interruption signal of the material positioning photoelectric sensor and drive the industrial camera array and the short-wave near-infrared scanning head to synchronously capture the visible light multi-field visible light image and one-dimensional absorbance spectrum sequence of the target fruit and vegetable.
[0068] Image preprocessing module 91 is used to perform serial image preprocessing on the visible light image to extract standardized single fruit region of interest images of the target fruit and vegetable; The image preprocessing module 91 includes a Letterbox proportional scaling unit, a circular kernel median denoising unit, an Otsu adaptive threshold binarization unit, a specular reflection weighted smoothing unit, a local occlusion interpolation repair unit, and a minimum bounding box ROI multi-target cropping unit. The standardized single-image region of interest sub-image is output serially from the above units.
[0069] The visual feature extraction module 92 is used to input the standardized single fruit region of interest image into an unsupervised anomaly detection model pre-trained based on intact fruit and vegetable samples, and the unsupervised anomaly detection model outputs the appearance feature parameters of the target fruit and vegetable. The visual feature extraction module 92 is used to input standardized single fruit images into an anomaly detection model that has been unsupervised pre-trained on intact fruit samples. After forward inference and feature reconstruction comparison by the patch description network, it outputs appearance feature vectors such as fruit surface blemish coordinates, blemish area ratio, fruit shape index and color uniformity.
[0070] The spectral feature extraction module 93 is used to perform spectral preprocessing and feature wavelength screening on the near-infrared spectral data to extract the internal quality characteristic parameters of the target fruits and vegetables. The spectral feature extraction module 93 is used to sequentially perform SG filtering noise reduction, SNV scattering calibration and continuous projection feature wavelength extraction on the one-dimensional original spectrum, substitute the dimensionality-reduced wavelength data into the regression model, and output the internal spectral feature vectors such as pulp sugar content and internal browning ratio.
[0071] The dual-source fusion judgment module 94 is used to substitute the appearance feature vector composed of the appearance feature parameters and the spectral internal feature vector composed of the internal quality feature parameters into the dual-source fusion judgment matrix, and perform weighted calculation according to the preset appearance weight coefficient and internal spectral weight coefficient to obtain the comprehensive defect score of the target fruit and vegetable. The dual-source fusion judgment module 94 is used to substitute the appearance feature vector and the spectral internal feature vector into the dual-source feature fusion matrix. After normalization and weighting coefficients, combined with the internal lesion extreme value judgment, the comprehensive defect score of the target fruit and vegetable is output.
[0072] The graded output module 95 is used to compare the comprehensive defect score with the preset grade threshold, determine the quality grade of the target fruits and vegetables, and output the corresponding sorting control instructions.
[0073] The graded output module 95 compares the comprehensive defect score with the standard grade threshold, generates control commands containing fruit grade codes and spatial rejection timestamps, and sends them to the relevant authorities via the fieldbus. Figure 3The driver of the motor 42 triggers the rotation and sorting action of the polyurethane dial at the corresponding workstation.
[0074] Furthermore, this application also provides a computer-readable storage medium storing computer-executable program instructions thereon. This storage medium can be a read-only memory (ROM), random access memory (RAM), flash memory, or an on-chip memory block of an FPGA. When the aforementioned computer program instructions are executed by one or more processors in the control component 80, the various method steps described above are fully implemented.
[0075] Working principle: like Figures 1 to 5 As shown, bulk hawthorns enter through the front material rack 10, are leveled by the comb-type roller leveling mechanism, and then fall smoothly into the multi-channel conical diversion and limiting roller conveyor 23. The limiting roller conveyor 23 is driven forward at a uniform speed, and the conical inclined grooves in each channel automatically center the hawthorns and arrange them in a single line. During this process, the coaxially connected photoelectric rotary encoder continuously sends high-frequency displacement pulses to the PLC. When a target hawthorn in a certain channel enters the detection chamber 32 with the limiting roller conveyor 23, the diffuse reflection photoelectric sensor corresponding to that channel is blocked, generating a level transition signal. After receiving this signal, the control component 80 instantly latches the current encoder pulse count value. Simultaneously triggering the supplementary lighting source 33, three image acquisition cameras 34, and near-infrared spectral sensor 35 within the detection chamber 32. The three image acquisition cameras 34 simultaneously acquire multi-field RGB images of the hawthorn's appearance from three angles, while the near-infrared spectral sensor 35 performs high-speed scanning acquisition of the diffuse reflectance spectrum of the pulp through a quartz window. The acquired raw multi-dimensional data is then sent in parallel to the FPGA chip. Visible light images enter the preprocessing pipeline, undergoing Letterbox size alignment, circular kernel median filtering for noise reduction, Otsu adaptive foreground extraction, specular mask smoothing correction, and local occlusion interpolation repair. The single fruit ROI is accurately cropped and fed into the improved EfficientAD model, which completes the mapping of abnormal feature maps and extracts appearance feature vectors in microseconds. Near-infrared spectral data were smoothed by SG, corrected by SNV baseline and screened by SPA characteristic wavelength to calculate the internal sugar content and browning ratio vectors, and to extract the internal spectral feature vectors of the target fruits and vegetables. The appearance feature vector and the spectral internal feature vector are weighted and mapped in the dual-source fusion judgment matrix according to preset weight coefficients to generate the comprehensive defect score of the hawthorn. .
[0076] After receiving the grade determination result from the FPGA, the PLC calculates the total pulse increment required for the target hawthorn to reach its corresponding discharge port based on the pre-calibrated straight-line distance L from the detection station to the downstream sorting component 40. The PLC performs real-time incremental accumulation tracking of the current encoder pulses; when the encoder count value reaches... When the target fruit has moved to the corresponding sorting component 40 in the channel, it indicates that the target fruit has moved to the corresponding channel.
[0077] If the fruit is judged to be a third-grade defective product ( (Or browning exceeds the standard), the PLC immediately sends a drive level to the corresponding stepper motor 42, and the motor 42 instantly drives the shaft to rotate the lever 43. The defective hawthorn is pushed away from the roller conveyor by the spoon surface of the paddle 43 and falls into the rejection box 70 below. In addition, if the fruit is judged to be a second-level qualified product, another sorting component 40 can be set up to remove the target fruit and vegetable into another box to improve the fine sorting of fruits and vegetables.
[0078] If the fruit is deemed qualified, the wheel remains stationary, and the hawthorn is continuously conveyed along the roller conveyor and eventually falls into the qualified box 60 at the end, completing the entire set of non-destructive, high-precision closed-loop sorting operations.
[0079] The above description is merely a preferred embodiment of this application and does not limit the patent scope of this application. Any equivalent structural transformations made based on the inventive concept of this application and the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included within the patent protection scope of this application.
Claims
1. A method for sorting fruits and vegetables based on their quality, characterized in that, Includes the following steps: Acquire visible light images and near-infrared spectral data of the target fruits and vegetables; Perform serial image preprocessing on the visible light image to extract standardized single-fruit region of interest images of the target fruits and vegetables; The standardized single fruit region of interest image is input into an unsupervised anomaly detection model pre-trained based on intact fruit and vegetable samples, and the unsupervised anomaly detection model outputs the appearance feature parameters of the target fruit and vegetable. Perform spectral preprocessing and characteristic wavelength screening on the near-infrared spectral data to extract the internal quality characteristic parameters of the target fruits and vegetables; Substitute the appearance feature vector composed of the appearance feature parameters and the spectral internal feature vector composed of the internal quality feature parameters into the dual-source fusion judgment matrix, and perform weighted calculation according to the preset appearance weight coefficient and internal spectral weight coefficient to obtain the comprehensive defect score of the target fruit and vegetable. By comparing the comprehensive defect score with the preset grade threshold, the quality grade of the target fruits and vegetables is determined and the corresponding sorting control command is output.
2. The fruit and vegetable quality sorting method as described in claim 1, characterized in that, The serial image preprocessing includes: Adaptive threshold segmentation is performed on the visible light image to generate a binary mask that distinguishes between the fruit and vegetable region and the background region; Based on the binary mask, reflective pixels that exceed the preset highlight threshold are filtered out, and the continuous reflective areas that meet the preset area conditions are weighted and smoothed using the surrounding non-reflective fruit and vegetable texture pixels. The binary mask is used to identify the texture missing area on the surface of fruits and vegetables caused by occlusion. When the area ratio of the texture missing area does not exceed the preset occlusion threshold, interpolation filling is performed using the effective pixels around the missing area to repair it. The minimum bounding box is generated based on the binary mask, and the smoothed and repaired image is cropped according to the boundary of the minimum bounding box to obtain a standardized single-fruit region of interest image.
3. The fruit and vegetable quality sorting method as described in claim 1, characterized in that, The unsupervised anomaly detection model includes a patch description network, an autoencoder, and a teacher-student network branch. The appearance feature parameters output by the unsupervised anomaly detection model include at least: coordinates of the fruit surface blemish area, blemish area ratio, fruit shape index, and color uniformity. The extracted internal quality characteristic parameters of the target fruits and vegetables include at least: the soluble solids content of the pulp and the proportion of internal browning areas.
4. The fruit and vegetable quality sorting method as described in claim 1, characterized in that, The step of substituting the appearance feature vector composed of the appearance feature parameters and the spectral internal feature vector composed of the internal quality feature parameters into the dual-source fusion judgment matrix, and performing weighted calculation according to preset appearance weight coefficients and internal spectral weight coefficients, includes: The appearance feature vector is normalized to obtain a first score, and the spectral internal feature vector is normalized to obtain a second score. The dynamic adjustment factor is extracted based on the effective pixel area of a single fruit. The product of the first score and the appearance weight coefficient is added to the product of the second score, the internal spectral weight coefficient, and the dynamic adjustment factor to output the comprehensive defect score.
5. The fruit and vegetable quality sorting method as described in claim 4, characterized in that, The step of weighting the calculation according to the preset appearance weighting coefficient and the internal spectral weighting coefficient further includes: Preset internal lesion extreme threshold; When the proportion parameter of the internal browning region in the internal feature vector of the spectrum is greater than the extreme threshold of the internal lesion, the comprehensive defect score representing the lowest quality level is output.
6. A fruit and vegetable quality sorting device, characterized in that, include: Material conveying components are used to carry and transport target fruits and vegetables; An information acquisition component is installed on the conveying path of the material conveying component, and it is used to acquire visible light images and near-infrared spectral data of the target fruits and vegetables. A control component, communicatively connected to the information acquisition component, is configured to execute the fruit and vegetable quality sorting method as described in any one of claims 1 to 5, and output sorting control instructions; The sorting component is located on the conveying path of the material conveying component and downstream of the information acquisition component, and is communicatively connected to the control component; the sorting component performs rejection or release actions on the target fruits and vegetables based on the received sorting control instructions.
7. The fruit and vegetable quality sorting device as described in claim 6, characterized in that, The material conveying assembly includes: At least one conveyor belt is used to transport the target fruits and vegetables; Limiting rollers are respectively installed on the conveyor belt; An information acquisition component is positioned above the conveyor belt; The sorting component, located above the conveyor belt, performs rejection or release actions on the target fruits and vegetables based on the sorting control commands generated by the control component.
8. The fruit and vegetable quality sorting device as described in claim 7, characterized in that, The information acquisition component includes: A detection cover is positioned above the conveyor belt; The detection chamber is located between the detection cover and the conveyor belt; The supplementary lighting source, the image acquisition camera, and the near-infrared spectral sensor are respectively fixedly installed inside the detection chamber; The image acquisition camera consists of three cameras, which are arranged at a preset angle around the cross-section of the material conveying component. The acquisition optical paths of the three cameras are all focused on the conveying area of the material conveying component to simultaneously acquire multi-dimensional visible light images of the same target fruit and vegetable. The near-infrared spectral sensor acquires near-infrared spectral data in a direction facing the target fruit and vegetable.
9. A fruit and vegetable quality sorting system, characterized in that, include: The data acquisition module is used to acquire visible light images and near-infrared spectral data of the target fruits and vegetables; The image preprocessing module is used to perform serial image preprocessing on the visible light image to extract standardized single fruit region of interest images of the target fruits and vegetables; The visual feature extraction module is used to input the standardized single fruit region of interest image into an unsupervised anomaly detection model pre-trained based on intact fruit and vegetable samples, and the unsupervised anomaly detection model outputs the appearance feature parameters of the target fruit and vegetable. The spectral feature extraction module is used to perform spectral preprocessing and feature wavelength screening on the near-infrared spectral data to extract the internal quality characteristic parameters of the target fruits and vegetables. The dual-source fusion judgment module is used to substitute the appearance feature vector composed of the appearance feature parameters and the spectral internal feature vector composed of the internal quality feature parameters into the dual-source fusion judgment matrix, and perform weighted calculation according to the preset appearance weight coefficient and internal spectral weight coefficient to obtain the comprehensive defect score of the target fruit and vegetable. The graded output module is used to compare the comprehensive defect score with the preset grade threshold, determine the quality grade of the target fruits and vegetables, and output the corresponding sorting control instructions.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the fruit and vegetable quality sorting method as described in any one of claims 1 to 5.
