Hollow fresh soybean detection method and sorting device based on machine vision
Through the hollow fresh soybean detection method based on machine vision, the improved YOLOv8 classification model and data amplification technology are used to solve the problems of high and slow internal quality inspection costs and slow speed of fresh soybeans, and high-throughput and lightweight classification are achieved Select the effect, suitable for quality monitoring of various pods and beans.
Patent Information
- Application Number
- CN202411644881.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2024-12-31
AI Technical Summary
In the prior art, fresh soybeans have high internal quality detection costs and slow image processing speed, which cannot achieve high-throughput sorting requirements.
Using the hollow fresh soybean detection method based on machine vision, by obtaining fresh soybean RGB images with transmission information and surface information, using edge detection algorithm to extract single fresh soybean images, constructing an improved YOLOv8 classification model, combining data amplification and A specific loss function to achieve fast and accurate detection of hollow fresh soybeans.
It realizes lightweight, high-throughput and high-accuracy fresh soybean sorting, reduces detection costs, improves computing speed, and is suitable for the quality monitoring and management of various pods and bean materials.
Smart Images

Figure CN119216243A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of primary processing of bean vegetables, and more specifically to a method and a sorting device for detecting hollow fresh soybeans based on machine vision. Background Art
[0002] Fresh soybean is a traditional legume vegetable with a long history of cultivation. It is one of the important food crops in my country. Due to many factors such as the cultivation environment and individual differences, the harvested fresh soybeans may have problems such as hollowness, insect holes, and mold spots, which reduce the overall quality of the fresh soybeans and reduce economic benefits. Therefore, the quality sorting of fresh soybeans is an indispensable part of the harvest period.
[0003] In the quality sorting of fresh soybeans, external quality detection such as insect holes and mold spots has been relatively mature, while individuals with missing seeds, shriveled seeds, too small seeds or only seed coats in the pods are judged as hollow fresh soybeans. The surface differences between hollow fresh soybeans are small and the characteristics are not obvious. There are only internal differences in seeds, and their sorting faces huge challenges. At present, the lighting mechanism of the color sorter uses visible light to illuminate and image the surface of fresh soybeans, which cannot transmit the internal information of fresh soybeans. The image acquisition mechanism can only capture the surface information of fresh soybeans, and it is difficult to distinguish hollow fresh soybeans. Using a hyperspectral imager to obtain hyperspectral images and spectral data of fresh soybeans can realize the internal quality detection of fresh soybeans with high detection accuracy, but the hyperspectral imager has a high cost, large data volume, and slow image processing speed, and cannot meet the high-precision and high-throughput sorting requirements of fresh soybeans. Summary of the invention
[0004] In view of the technical problems in the prior art such as high cost of collecting the internal quality of fresh soybeans, slow image processing speed, and inability to meet the requirements of high-throughput fresh soybean sorting, the present invention provides a hollow fresh soybean detection method and sorting device based on machine vision, which can achieve lightweight, high-throughput and high-accuracy reliable sorting for hollow fresh soybeans.
[0005] The technical solutions adopted are as follows:
[0006] In one aspect, the present invention provides a method for detecting hollow fresh soybeans based on machine vision, the detection method comprising the following steps:
[0007] Step 1, obtaining a fresh soybean RGB image with transmission information and surface information;
[0008] Step 2, extracting a single fresh soybean image through an edge detection algorithm to construct a fresh soybean dataset with center coordinates;
[0009] Step 3, annotate the fresh soybean dataset and divide it into training set, validation set and test set;
[0010] Step 4, using the labeled fresh soybean dataset to build an improved YOLOv8 classification model;
[0011] Step 5, using the improved YOLOv8 classification model to determine whether the fresh soybeans on the conveyor line are hollow fresh soybeans, and transmitting the signal determined to be hollow fresh soybeans to the central controller, which instructs the sorting mechanism to separate the hollow fresh soybeans.
[0012] Preferably, in step 1, the fresh soybeans are illuminated simultaneously by using a transmission light source and a reflection light source arranged vertically to obtain an RGB image of the fresh soybeans having transmission information and surface information.
[0013] Preferably, in step 2, a single fresh soybean image is extracted using a contour-based edge detection algorithm, and a specific method for constructing the center coordinates of each fresh soybean is:
[0014] Step 2.1, converting the collected fresh soybean RGB image into a grayscale image;
[0015] Step 2.2, perform Gaussian noise reduction filtering on the grayscale image;
[0016] Step 2.3, using the Canny operator to detect the edge of the fresh soybean grayscale image to obtain the fresh soybean outline;
[0017] Step 2.4, draw the outline of the fresh soybean on the original fresh soybean RGB image, and obtain the minimum bounding rectangle of the fresh soybean outline. After cropping, the center coordinates of the minimum bounding rectangle are used as the center coordinates of the fresh soybean.
[0018] Furthermore, step 3 also includes using a data augmentation method to amplify the original training set data, and the data augmentation method used includes at least one of flipping, rotating, scaling, cropping, translating and noise perturbation operations on the collected fresh soybean RGB image, and enhancing each fresh soybean RGB image at least 4 times.
[0019] Preferably, in step 4, an improved YOLOv8 classification model is constructed using the labeled fresh soybean dataset, and the specific method is:
[0020] Step 4.1, add a binarization algorithm to the input of the YOLOv8 classification model to convert a single fresh soybean RGB image into a black and white image, retaining the perspective characteristics of the fresh soybean;
[0021] Step 4.2, replace the backbone network in the YOLOv8 classification model with the MobileNetV4 module;
[0022] In step 4.3, replace the classification loss function Distribution Focal Loss in the YOLOv8 classification model with Quality Focal Loss.
[0023] Furthermore, the Head part of the YOLOv8 classification model is added with a ShuffleAttention mechanism.
[0024] Preferably, the Quality Focal Loss loss function algorithm adopted is:
[0025] QFL(σ)=-y-σ β ((1-y)log(1-σ)+ylog(σ))
[0026] Where σ∈(0,1) is a hyperparameter, β is a parameter that can smoothly control the weighting rate, and y-σ β is the modulation factor. When the evaluation of fresh soybeans is inaccurate and deviates from the regression label y, the modulation factor is larger, making the model pay more attention to learning this difficult example. When the evaluation is accurate, σ→y, the modulation factor becomes 0, and the loss of this example is reduced.
[0027] On the other hand, the present invention also provides a hollow fresh soybean sorting device based on machine vision, the sorting device comprising:
[0028] A material conveying mechanism is used to convey fresh soybeans and throw the fresh soybeans out at the discharging end;
[0029] The lighting mechanism is arranged in the throwing area of the fresh soybeans, and comprises an upper light source, a lower light source and a shading plate. The thrown fresh soybeans are thrown from between the upper light source and the lower light source, and the shading plate is located in front of and on both sides of the farthest throwing position of the fresh soybeans;
[0030] An image acquisition unit, used for acquiring a fresh soybean RGB image with transmission information and surface information;
[0031] A YOLOv8 classification model is used to train a hollow fresh soybean detection weight model based on an input RGB image, thereby obtaining an improved YOLOv8 classification model capable of identifying hollow fresh soybeans and obtaining the center coordinates of each fresh soybean.
[0032] The central controller receives the RGB image of fresh soybeans collected by the image acquisition unit, trains a hollow fresh soybean detection weight model based on the YOLOv8 classification model, obtains an improved YOLOv8 classification model capable of identifying hollow fresh soybeans, and obtains the center coordinates of each fresh soybean;
[0033] The sorting mechanism is connected to the central controller and performs screening on the identified hollow fresh soybeans in combination with the central coordinates of the fresh soybeans.
[0034] Preferably, the upper light source and the lower light source are both LED strip light sources with adjustable light intensity, one of the upper light source and the lower light source is a transmission light source for seeing through the internal grains of fresh soybeans, and the other light source is a reflection light source; the image acquisition unit includes an area array camera, and the distance between the area array camera and the dropped fresh soybeans is 40 cm; the sorting mechanism is an air-blowing sorting device.
[0035] Further preferably, the sorting device is also provided with a human-computer interaction terminal, which is respectively connected to the area array camera, the central controller, the lighting mechanism and the sorting mechanism through signal lines.
[0036] The technical solution of the present invention has the following advantages:
[0037] A. The contour-based edge detection algorithm provided by the present invention extracts each fresh soybean image from the captured fresh soybean RGB image separately, constructs a single fresh soybean image dataset, and adopts an improved YOLOv8 classification model to achieve lightweight and high-accuracy classification of fresh soybeans. The present invention converts the multi-target detection task into a single-target classification task, maximizes the features of fresh soybeans, and improves the classification accuracy.
[0038] B. The improved YOLOv8 classification model provided by the present invention performs hollow detection on hollow fresh soybeans, and enhances the perspective features of the input fresh soybean image by adding a binarization algorithm at the network input end; replaces its backbone network with MobileNetV4, greatly reducing the model parameters, making it more suitable for deployment on mobile devices; partially replaces its classification loss function with Quality Focal Loss to solve the problem of imbalance between positive and negative samples of fresh soybean images; and also adds a ShuffleAttention mechanism to the Head part of the classification model to improve the classification accuracy of the model without increasing too much computing cost. Compared with the original YOLOv8 classification model, the present invention has fast computing speed and high classification accuracy, provides technical support for quality monitoring and management of pod and bean materials, and has broad application prospects and significant social and economic benefits.
[0039] C. The hollow fresh soybean sorting device provided by the present invention is provided with an upper reflective light source and a lower transmissive light source based on visible light at the discharge end of the material conveying mechanism, so that the image acquisition unit can obtain the surface and internal quality information of the fresh soybean. Compared with the traditional near-infrared and other spectral imaging, the present invention has the advantages of rapidity, accuracy, low cost, anti-interference, and easy implementation.
[0040] D. The sorting mechanism in the present invention adopts an air-blowing sorting device, which has a fast execution speed and does not affect the material conveying speed.
[0041] E. The hollow fresh soybean detection method and sorting device provided by the present invention have an automated grading function and are applicable to a variety of pod bean materials, with strong applicability and high promotion. Compared with conventional existing equipment, the method and device of the present invention can realize the conventional external detection function while completing internal information detection and identification. The whole set of sorting devices has great advantages and realizes the multi-quality online high-throughput and precise grading and sorting of fresh soybeans. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the specific embodiments of the present invention, the drawings required for use in the specific embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1 It is a flow chart of the hollow fresh soybean detection method provided by the present invention;
[0044] Figure 2 This is a front view of the fresh soybean sorting device provided by the present invention;
[0045] Figure 3 It is a three-dimensional diagram of the fresh soybean sorting device provided by the present invention;
[0046] Figure 4 yes Figure 3 Schematic diagram of the structure of the lighting mechanism;
[0047] Figure 5 It is a schematic diagram of the improved YOLOv8 classification model algorithm provided by the present invention;
[0048] Figure 6 It is a structural diagram of MobileNetV4 in the YOLOv8 classification model provided by the present invention;
[0049] Figure 7 It is a structural diagram of the ShuffleAttention mechanism in the YOLOv8 classification model provided by the present invention.
[0050] The symbols provided in the figure are explained as follows:
[0051] 1-hopper; 2-power switch; 3-conveying motor; 4-conveyor belt; 5-frame
[0052] 6- Lighting mechanism
[0053] 61-upper light source, 62-lower light source, 63-shading plate, 64-stand
[0054] 7-Image acquisition unit
[0055] 71-area array camera, 72-camera mount
[0056] 8-sorting mechanism; 9-discharging port; 10-control box; 20-fresh soybean
[0057] 30- conveyor belt tensioning mechanism; 40- transmission mechanism. DETAILED DESCRIPTION
[0058] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0059] like Figure 1 As shown, the present invention provides a method for detecting hollow fresh soybeans based on machine vision, comprising the following steps:
[0060]
S01
[0061] The present invention uses a transmissive light source and a reflective light source arranged up and down to simultaneously illuminate fresh soybeans. The transmissive light source is preferably located below the reflective light source, so that the fresh soybean raw material passes through the two, thereby simultaneously obtaining a fresh soybean RGB image with transmissive information and surface information, and simultaneously collecting the surface information and internal seed information of the fresh soybeans. The collected fresh soybean surface image is preprocessed, and a perspective image of the fresh soybean is constructed.
[0062]
S02
[0063] The specific method is:
[0064]
S021
[0065]
S022
[0066]
S023
[0067] [S024] Draw the outline of fresh soybeans on the original fresh soybean RGB image, and obtain the minimum enclosing rectangle of the fresh soybean outline. After cropping, the center coordinates of the calculated minimum enclosing rectangle are regarded as the center coordinates of the fresh soybeans.
[0068]
S03
[0069] Of course, according to the actual online production of fresh soybeans, the present invention uses a combination of multiple data augmentation methods for the training set to achieve data augmentation of the original training set. The data augmentation method adopted includes at least one of flipping, rotating, scaling, cropping, translating and noise disturbance operations on the collected fresh soybean RGB image. The enhancement operations can be superimposed and used. At least one enhancement is effective by default, and each fresh soybean RGB image is preferably enhanced at least 4 times. Of course, it is also possible to enhance it 2 or 3 times here, which will not be described in detail.
[0070]
S04
[0071]
S041
[0072]
S042
[0073] like Figure 6As shown in the figure, the MobileNetV4 module introduces the universal inverted bottleneck (UIB) search block. This structure integrates the inverted bottleneck (IB), ConvNext, feedforward network (FFN) and a variant of extra deep convolution (ExtraDW), which significantly reduces the model parameters and computational complexity while ensuring the classification accuracy of the model. In addition to the universal inverted bottleneck module, the structure also introduces the Mobile MQA module, which integrates the spatial reduced attention (SRA) on the basis of the multi-query attention (MQA) module, and further reduces the model parameters by reducing the resolution of keys and values. Compared with the original multi-query attention (MQA) module, the operation efficiency is improved by 20%, and the accuracy is only lost by 0.06%. At the same time, MobileNetV4 adopts an optimized NAS strategy, which combines coarse-grained and fine-grained searches to achieve a two-stage search to obtain higher classification efficiency and optimize the model quality, so that the model strikes a balance between efficiency and accuracy. The present invention replaces the backbone network in the YOLOv8 model with the MobileNetV4 module, which significantly improves the lightweight level of the model and makes it more suitable for mobile devices and embedded systems.
[0074]
S043
[0075] Replace the classification loss Distribution Focal Loss in the YOLOv8 model with Quality FocalLoss. This loss function improves the cross entropy part and scaling factor in Focal loss. The formula is as follows.
[0076] QFL(σ)=-y-σ β ((1-y)log(1-σ)+ylog(σ))
[0077] Where σ∈(0,1) is a hyperparameter, β is a parameter that can smoothly control the weighting rate, and y-σ β is the modulation factor. When the evaluation of fresh soybeans is inaccurate and deviates from the regression label y, the modulation factor is larger, which makes the model pay more attention to learning this difficult example. When the evaluation is accurate, σ→y, the modulation factor becomes 0, and the loss of this example is reduced.
[0078] Quality Focal Loss applies the ability of Focal Loss to process unbalanced data in object detection to image classification. By replacing it with the YOLOv8 model, it can solve the problem of imbalanced positive and negative samples in fresh soybean images.
[0079] In addition, the present invention also adds the ShuffleAttention mechanism to the Head part of the YOLOv8 classification model, and its structure is as follows: Figure 7 As shown. The ShuffleAttention mechanism divides the channel dimension into multiple sub-features, constructs a channel attention module and a spatial attention module for each sub-feature unit, and uses the shuffle unit to effectively combine the two to suppress noise and highlight the correct semantic feature area. Compared with the traditional technology that simply combines spatial attention with channel attention, the ShuffleAttention mechanism provided by the present invention has higher accuracy and lower computational complexity.
[0080]
S05
[0081] The improved YOLOv8 classification model adopted in the detection method of the present invention has faster operation speed and higher classification accuracy than the original YOLOv8, provides technical support for quality monitoring and management of legume materials, and has broad application prospects and significant social and economic benefits.
[0082] The hollow fresh soybean detection method adopted by the present invention utilizes two groups of light sources placed in an upper and lower arrangement in the fresh soybean dropping area to form transmission and reflection, so as to obtain the surface information of the fresh soybean and obtain the internal perspective information of the fresh soybean at the same time, and extract a single fresh soybean image through an edge detection algorithm, and finally use the improved YOLOv8 classification algorithm to determine the hollow fresh soybean, thereby achieving lightweight and high accuracy of detection, overcoming the shortcomings of the prior art, providing a more efficient and reliable solution for the quality detection of fresh soybeans, and providing technical support for the automation and intelligent high-throughput grading of industrial production lines.
[0083] like Figures 2 to 4As shown, the present invention also provides a hollow fresh soybean sorting device based on machine vision, and the sorting device includes: a material conveying mechanism, an illumination mechanism 6, an image acquisition unit 7, a central controller and a sorting mechanism 8. The material conveying mechanism is used to convey fresh soybeans and throw the fresh soybeans out at the discharging end; specifically, the material conveying mechanism is mainly composed of a hopper 1, a conveyor belt 4, a conveying motor 3, a power switch 2, a transmission mechanism 40, a conveyor belt tensioning mechanism 30 and a frame 5. The hopper 1 here is preferably a vibrating hopper, which helps to spread the material more evenly. The conveying motor 3 drives the conveyor belt 4 to rotate through the transmission mechanism 40. The back shape of the conveyor belt 4 and the transmission wheel are selected as toothed mechanisms to maintain the accuracy of the transmission position of the conveyor belt 4. In addition, a conveyor belt tensioning mechanism 30 is also designed at the transmission wheel position, so that the transmission wheel can mesh with the conveyor belt more closely to avoid slipping and loss of rotation. After the fresh soybean material is fed into the hopper 1, it is thrown to the illumination mechanism 6 through the conveyor belt 4.
[0084] The lighting mechanism 6 is arranged in the throwing area of the fresh soybeans, and includes an upper light source 61, a lower light source 62 and a shading plate 63. The thrown fresh soybeans 20 are thrown from between the upper light source 61 and the lower light source 62, and the shading plate 63 is located in front of and on both sides of the farthest position of the thrown fresh soybeans 20. Specifically, Figure 4 As shown, the lighting mechanism includes an upper light source 61, a lower light source 62, a shading plate 63 and a stand 64, wherein the upper light source 61 and the lower light source 62 are composed of two LED strip light sources, one above and one below. The upper light source 61 is preferably a reflective light source, and the lower light source 62 is preferably a transmissive light source. According to the movement trajectory of the fresh soybean 20, two groups of upper and lower LED strip light sources are respectively set at about 40 cm above and below the upper and lower surfaces of the thrown fresh soybean 20. The upper light source 61 and the lower light source 62 are fixed on the stand 64, and the power is preferably 30w, and the light intensity is adjustable. Let the illumination of the two lower light sources below be 160lux, and the illumination of the two upper light sources above be 80lux. At this time, for the upper surface of the fresh soybean 20, the lighting mechanism 6 can reflect the surface details of the fresh soybean 20 while forming the perspective of the internal grains; for the lower surface, the lighting mechanism 6 can clearly present the surface details of the fresh soybean 20. The shading plate 64 is responsible for eliminating external light interference.
[0085] The image acquisition unit 7 is used to acquire the RGB image of the fresh soybean 20 with transmission information and surface information. It is mainly composed of a surface array camera 71, a camera fixing seat 72 and other components. The surface array camera 72 is about 40 cm away from the fresh soybean 20.
[0086] The present invention sets the central controller in the control box 10, which receives the RGB image of fresh soybeans from the image acquisition unit 7, trains the hollow fresh soybean detection weight model based on the YOLOv8 classification model, obtains an improved YOLOv8 classification model capable of identifying hollow fresh soybeans, and obtains the center coordinates of each fresh soybean. The sorting mechanism 8 is connected to the central controller, and the central controller will execute the variable unit work according to the set program, perform screening actions on the identified hollow fresh soybeans in combination with the center coordinates of the fresh soybeans, and screen out good fresh soybeans from the discharge port 9. The sorting mechanism 8 here is preferably an air-blowing sorting device.
[0087] In addition, in order to facilitate system operation and visualization of monitoring information, the sorting device is also provided with a human-computer interaction terminal, which is arranged on the control box 10 and has an interactive interface. It is respectively connected to the area array camera 71, the central controller, the lighting mechanism 6 and the sorting mechanism 8 through signal lines to simplify and facilitate the operation of the fresh soybean sorting device, thereby effectively improving work efficiency.
[0088] After the image acquisition unit 7 acquires the image of the fresh soybean 20, the image is transmitted to the pre-trained hollow fresh soybean detection weight model, that is, an improved YOLOv8 classification model is obtained, which has been improved and trained with a large amount of data and has the ability to classify hollow fresh soybeans. When the fresh soybeans are detected to be hollow fresh soybeans during the throwing process, the improved YOLOv8 classification model will output the center coordinates of the hollow fresh soybeans and send them to the central controller, thereby controlling the air-blowing sorting mechanism 8 to complete the screening of the hollow fresh soybeans.
[0089] Anything not described in the present invention is applicable to the prior art.
[0090] Obviously, the above embodiments are merely examples for the purpose of clear explanation, and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. However, the obvious changes or modifications derived therefrom are still within the scope of protection of the present invention.
Claims
1. A method for detecting hollow fresh soybeans based on machine vision, characterized in that: The detection method comprises the following steps: Step 1, obtaining a fresh soybean RGB image with transmission information and surface information; Step 2, extracting a single fresh soybean image through an edge detection algorithm to construct a fresh soybean dataset with center coordinates; Step 3, annotate the fresh soybean dataset and divide it into training set, validation set and test set; Step 4, using the labeled fresh soybean dataset to build an improved YOLOv8 classification model; Step 5, using the improved YOLOv8 classification model to determine whether the fresh soybeans on the conveyor line are hollow fresh soybeans, and transmitting the signal determined to be hollow fresh soybeans to the central controller, which instructs the sorting mechanism to separate the hollow fresh soybeans.
2. The method for detecting hollow fresh soybeans based on machine vision according to claim 1, characterized in that: In the step 1, the fresh soybeans are illuminated simultaneously by using a transmission light source and a reflection light source arranged vertically to obtain an RGB image of the fresh soybeans having transmission information and surface information.
3. The method for detecting hollow fresh soybeans based on machine vision according to claim 1, characterized in that: In step 2, a single fresh soybean image is extracted by using a contour-based edge detection algorithm, and the specific method for constructing the center coordinates of each fresh soybean is: Step 2.1, converting the collected fresh soybean RGB image into a grayscale image; Step 2.2, perform Gaussian noise reduction filtering on the grayscale image; Step 2.3, using the Canny operator to detect the edge of the fresh soybean grayscale image to obtain the fresh soybean outline; Step 2.4, draw the outline of the fresh soybean on the original fresh soybean RGB image, and obtain the minimum bounding rectangle of the fresh soybean outline. After cropping, the center coordinates of the minimum bounding rectangle are used as the center coordinates of the fresh soybean.
4. The method for detecting hollow fresh soybeans based on machine vision according to claim 1, characterized in that: The step 3 also includes using a data augmentation method to augment the original training set data, and the data augmentation method used includes at least one of flipping, rotating, scaling, cropping, translating and noise perturbation operations on the collected fresh soybean RGB image, and enhancing each fresh soybean RGB image at least 4 times.
5. The method for detecting hollow fresh soybeans based on machine vision according to claim 2, characterized in that: In step 4, an improved YOLOv8 classification model is constructed using the labeled fresh soybean dataset, and the specific method is: Step 4.1, add a binarization algorithm to the input of the YOLOv8 classification model to convert a single fresh soybean RGB image into a black and white image, retaining the perspective characteristics of the fresh soybean; Step 4.2, replace the backbone network in the YOLOv8 classification model with the MobileNetV4 module; In step 4.3, replace the classification loss function Distribution Focal Loss in the YOLOv8 classification model with Quality Focal Loss.
6. The method for detecting hollow fresh soybeans based on machine vision according to claim 5, characterized in that: A ShuffleAttention mechanism is added to the Head part of the YOLOv8 classification model.
7. The method for detecting hollow fresh soybeans based on machine vision according to claim 5, characterized in that: The Quality Focal Loss loss function algorithm used is: QFL(σ)=-y-σ β ((1-y)log(1-σ)+ylog(σ)) Where σ∈(0,1) is a hyperparameter, β is a parameter that can smoothly control the weighting rate, and y-σ β is the modulation factor. When the evaluation of fresh soybeans is inaccurate and deviates from the regression label y, the modulation factor is larger, making the model pay more attention to learning this difficult example. When the evaluation is accurate, σ→y, the modulation factor becomes 0, and the loss of this example is reduced.
8. A hollow fresh soybean sorting device based on machine vision, characterized in that: The sorting device comprises: A material conveying mechanism is used to convey fresh soybeans and throw the fresh soybeans out at the discharging end; The lighting mechanism is arranged in the throwing area of the fresh soybeans, and comprises an upper light source, a lower light source and a shading plate. The thrown fresh soybeans are thrown from between the upper light source and the lower light source, and the shading plate is located in front of and on both sides of the farthest throwing position of the fresh soybeans; An image acquisition unit, used for acquiring a fresh soybean RGB image with transmission information and surface information; The central controller receives the RGB image of fresh soybeans collected by the image acquisition unit, trains a hollow fresh soybean detection weight model based on the YOLOv8 classification model, obtains an improved YOLOv8 classification model capable of identifying hollow fresh soybeans, and obtains the center coordinates of each fresh soybean; The sorting mechanism is connected to the central controller and performs screening on the identified hollow fresh soybeans in combination with the central coordinates of the fresh soybeans.
9. The hollow fresh soybean sorting device based on machine vision according to claim 8, characterized in that: The upper light source and the lower light source are both LED strip light sources with adjustable light intensity, one of the upper light source and the lower light source is a transmission light source that penetrates the internal seeds of fresh soybeans, and the other light source is a reflection light source; the image acquisition unit includes an area array camera, and the distance between the area array camera and the dropped fresh soybeans is 40 cm; the sorting mechanism is an air-blowing sorting device.
10. The hollow fresh soybean sorting device based on machine vision according to claim 9, characterized in that: The sorting device is also provided with a human-machine interaction terminal, which is respectively connected with the area array camera, the central controller, the lighting mechanism and the sorting mechanism through signal lines.
Citation Information
Cited By
Chinese herbal medicine and foreign matter detection method and system thereof, storage medium and product
CN120047894A
Device and method for sensing crop growth environment and detecting chlorophyll content based on map fusion
CN120801223A
Crop growth environment perception and chlorophyll content detection device and detection method based on atlas fusion
CN120801223B