CN-121972413-A - Agricultural product classifying and sorting method and sorting device based on MMRP-YOLO model
Abstract
The invention relates to an agricultural product classifying and sorting method and device based on an MMRP-YOLO model, wherein the sorting device comprises a frame, a conveying mechanism, a visual detection unit, a control unit, a sorting unit and a classifying and collecting unit, the classifying and sorting method comprises the following steps of S1, obtaining an image of an agricultural product to be detected on a conveying belt through an image collecting device, S2, inputting the image of the to-be-detected into the MMRP-YOLO model for identification and reasoning, outputting a boundary frame of each object to be detected and a size category of the boundary frame, S3, generating a sorting control instruction according to coordinate information and the size category of the boundary frame, and S4, driving a single mechanical arm executing mechanism to clamp and transfer the corresponding object to be detected to a collecting area corresponding to the size category based on the sorting control instruction. The invention has the advantages of high detection precision, high reasoning speed, small model volume, low deployment cost and the like.
Inventors
- LU ENHUI
- ZHU SHENGGUO
- YU JIANCHAO
- SUN YUNQIAN
- ZHOU YUYANG
- ZHU XINGLONG
Assignees
- 扬州大学
Dates
- Publication Date
- 20260505
- Application Date
- 20251231
Claims (10)
- 1. An agricultural product sorting and grading method based on an MMRP-YOLO model is characterized by comprising the following steps of: s1, acquiring an image of an agricultural product to be detected on a conveyor belt through an image acquisition device; S2, inputting the image of the object to be detected into an MMRP-YOLO model for recognition and reasoning, and outputting a bounding box of each object to be detected and a size class to which the bounding box belongs; s3, generating a sorting control instruction according to the coordinate information and the size category of the boundary box; and S4, based on the sorting control instruction, driving a single mechanical arm executing mechanism to clamp and transfer the corresponding object to be tested to a collecting area corresponding to the size category.
- 2. The method of claim 1, wherein the size classes are classified into three classes of large, medium and small according to mass or volume distribution of the object to be measured, and the method further comprises the step of constructing and labeling the object to be measured data set before the step S1, wherein the images in the data set cover single-target, multi-target single-class and multi-target multi-class scenes, and the number of samples of the three classes of sizes is balanced.
- 3. The method of claim 1, wherein the MMRP-YOLO model comprises: A backbone network comprising a C3k2-MSPE module comprising a dual domain selection mechanism DSM for enhancing multi-scale edge features and suppressing background noise; The neck network comprises MANet-Star-l modules, wherein the MANet-Star-l modules comprise Star-Block-l sub-blocks adopting depth separable convolution and a gating structure and are used for realizing hierarchical fusion of multi-scale features; the neck network also comprises a C3k2-RVB-EMA module which fuses RepViTBlock with a high-efficiency multi-scale attention EMA mechanism and is used for improving the detection capability of shielding and small-size targets; the model is subjected to global pruning based on a layer self-adaptive amplitude LAMP algorithm.
- 4. A method according to claim 3, characterized in that the multi-scale edge information selection module MSPE performs feature selection and recalibration via the two-domain selection mechanism DSM by constructing a main branch containing local details and a plurality of adaptively pooled multi-scale branches, after channel dimension stitching.
- 5. The method of claim 3 wherein RepViTBlock of the C3k2-RVB-EMA modules employ re-parametrizable deep convolution branches and are equivalent to a single deep convolution after training, and wherein the EMA mechanism blocks channels in a packet form and extracts axial context information in both the height and width directions.
- 6. Sorting device for implementing the method according to any of claims 1-5, characterized in that it comprises: A frame; the conveying mechanism (1) is arranged on the rack and is used for continuously conveying the to-be-sorted agricultural product objects; the visual detection unit is arranged on the frame and positioned above the conveying mechanism (1) and comprises a closed detection cabinet (3), an industrial camera (2) and a light source assembly, wherein the industrial camera (2) and the light source assembly are arranged in the detection cabinet (3) and are used for acquiring clear images of objects to be detected on the conveying mechanism (1); A control unit electrically connected to the vision inspection unit for deploying and running the MMRP-YOLO model of any one of claims 3-5, processing the images and generating sorting instructions; the sorting unit (4) is arranged on the rack and is positioned near the tail end of the conveying mechanism (1), is electrically connected with the control unit and is used for receiving and executing the sorting instruction, and the tail end of the sorting unit is provided with a mechanical clamp (7) with adjustable clamping force; the grading collection unit is arranged in the working range of the single mechanical arm sorting unit (4) and is used for receiving and storing objects to be tested in different sizes.
- 7. The sorting device according to claim 6, wherein the light source assembly comprises an LED light bar and a structured light source (9), and the inner wall of the detection cabinet (3) is provided with a reflective material.
- 8. Sorting device according to claim 6, characterized in that the sorting unit (4) comprises a base rotatable about a vertical axis, an upper arm link (4-1) connected to the base, a forearm (4-2) hinged to the upper arm link, and the mechanical gripper (7) mounted at the end of the forearm.
- 9. Sorting device according to claim 6, characterized in that the classifying collection unit comprises a plurality of collection boxes (6), and a roller step (5) provided at the inlet of each collection box in correspondence.
- 10. A computer-readable storage medium storing computer instructions for causing the computer to perform the MMRP-YOLO model-based agricultural product sorting and grading method of claim 4 or 5.
Description
Agricultural product classifying and sorting method and sorting device based on MMRP-YOLO model Technical Field The invention relates to the technical field of agricultural intelligent equipment and machine vision, in particular to an agricultural product classifying and sorting method and device based on an MMRP-YOLO model. Background Post-harvest sorting of agricultural products is critical to the enhancement of added value of the products. Currently, sorting relies mainly on two ways: manual sorting, namely judging and manually sorting by means of manual vision. The method has the problems of low efficiency, high labor intensity, strong subjectivity of sorting standards and poor consistency, so that the sorting cost is high and large-scale and standardized operation is difficult to realize. Mechanical classification equipment, namely the existing mechanical classification equipment adopts roller screening or mechanical structure based on size threshold value for sorting. Although manual work is replaced to a certain extent, the sorting basis is single (usually only the maximum outer diameter), the agricultural products with irregular shapes cannot be accurately judged, rigid collision and friction are easy to occur between the agricultural products and the sorting machine in the sorting process, so that the epidermis is damaged, the commodity value is influenced, and economic loss is caused. In recent years, computer vision and deep learning technology, in particular YOLO (You Only Look Once) series target detection algorithm, has great potential in the field of agricultural product automatic detection due to high speed and high precision. However, when the existing general purpose object detection model is directly applied to the specific scene of agricultural product sorting, a plurality of technical challenges and bottlenecks are still faced: The detection stability under a complex scene is insufficient, agricultural products are always in a state of stacking, contacting and even partially shielding on a conveyor belt, and the traditional boundary box detection mode is easy to produce false detection or omission under the condition. Meanwhile, a large amount of noise interference can be introduced due to factors such as soil residue on the surface of the conveyor belt, environmental illumination change, equipment reflection and the like, and the robustness of an image recognition algorithm is seriously affected. The small size and the dense target recognition capability are limited, so that the feature extraction capability of the existing model is a bottleneck for small-size or closely arranged agricultural products, and effective distinguishing features of the existing model are difficult to capture, so that the detection rate of the small-target agricultural products is low. The contradiction between model performance and real-time performance, namely a complex deep learning model adopted for pursuing high detection precision, the calculated amount and the parameter amount of the complex deep learning model are quite huge, the complex deep learning model is difficult to stably run under the real-time (high frame rate processing) condition required by a sorting assembly line, and the trade-off problem that the precision and the efficiency are difficult to consider exists. Thus, the prior art has not yet provided an automatic grading solution for agricultural products that enables both high precision identification, high real-time processing, and low computational resource consumption in a practically complex sorting environment. How to construct a special model and a matched system which are compatible with detection performance, reasoning speed and deployment cost becomes a technical problem to be broken through in the field. Disclosure of Invention In order to solve the defects in the prior art, the invention provides an agricultural product grading sorting method and sorting device based on an MMRP-YOLO model. The method is based on an MMRP-YOLO lightweight model and has the advantages of high detection precision, high reasoning speed, small model volume, low deployment cost and the like. In order to achieve the above purpose, the present invention adopts the following technical scheme: an agricultural product sorting and grading method based on an MMRP-YOLO model comprises the following steps: s1, acquiring an image of an agricultural product to be detected on a conveyor belt through an image acquisition device; S2, inputting the image of the object to be detected into an MMRP-YOLO model for recognition and reasoning, and outputting a bounding box of each object to be detected and a size class to which the bounding box belongs; s3, generating a sorting control instruction according to the coordinate information and the size category of the boundary box; and S4, based on the sorting control instruction, driving a single mechanical arm executing mechanism to clamp and transfer the corresponding ob