A method for detecting weed seeds

The identification of weed seeds through the seed delivery device and the deep convolutional neural network model solves the problem of low efficiency of grain seed inspection in the existing technology, achieves fast and accurate weed seed detection, and improves detection efficiency and accuracy.

CN110188609BActive Publication Date: 2024-09-27AGRICULTURAL GENOMICS INSTITUTE AT SHENZHEN CHINESE ACADEMY OF AGRICULTURAL SCIENCES (SHENZHEN BRANCH GUANGDONG LABORATORY FOR LINGNAN MODERN AGRICULTURE)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910335799.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-04-24
Publication Date
2024-09-27
Estimated Expiration
2039-04-24

AI Technical Summary

Technical Problem

The existing grain seed inspection methods are inefficient and cannot detect mixed weed seeds quickly, accurately and quantitatively, which affects the efficiency of customs clearance of goods.

Method used

A detection method including a seed conveying device, an image acquisition device and a main control computer is adopted to identify weed seeds through image preprocessing and a deep convolutional neural network model, combined with a vibrating seed metering device and a transparent conveyor belt to improve detection accuracy and efficiency.

Benefits of technology

It achieves rapid, accurate and quantitative identification of weed seeds, improves detection efficiency, reduces manual intervention, enhances contrast and image recognition accuracy, and is suitable for import and export inspection and quarantine departments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110188609B
    Figure CN110188609B
Patent Text Reader

Abstract

The present invention discloses a method for detecting weed seeds, which comprises the following steps: step 1, conveying the seeds to be detected through an image acquisition device through a seed conveying device to collect the seed images to be detected; step 2, the main control computer divides the seed images to be detected into single seed images through an image preprocessing module; step 3, manually marking the names of all single seed images of one of the seed images to be detected to form a seed image database; step 4, training a seed image recognition model through a training module to obtain a seed image recognition module; step 5, identifying the single seed images of other seed images to be detected through the seed image recognition module; step 6, displaying the recognition results through a display. The present invention can quickly, accurately and quantitatively identify various weed seeds to improve the detection efficiency, especially to improve the detection efficiency of weed seeds in import and export inspection and quarantine departments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of grain seed inspection, and in particular to a weed seed detection method. Background Art

[0002] Certain weed seeds are intentionally or unintentionally mixed with imported grain seeds. After entering my country, if they are scattered during transportation and storage, these weed seeds will grow and reproduce explosively in their new habitats, thus becoming extremely harmful weed plants, changing the original biogeographic distribution, disrupting the original structure and function of the ecosystem, and destroying the local ecosystem diversity.

[0003] Seed inspection and quarantine in my country has always been an important task for the inspection and quarantine departments of various ports. At present, the main inspection methods rely on chemical methods and manual observation, which are arduous and inefficient, seriously affecting the customs clearance efficiency of goods. Therefore, there is an urgent need to develop a new automatic detection technology that can quickly, accurately and quantitatively detect weed seeds mixed in grain seeds.

[0004] The information disclosed in this background technology section is only intended to enhance the understanding of the overall background of the invention and should not be regarded as an acknowledgment or any form of suggestion that the information constitutes the prior art already known to a person skilled in the art. Summary of the invention

[0005] The object of the present invention is to provide a method for detecting weed seeds, thereby overcoming the disadvantage of low efficiency of the existing method for detecting weed seeds mixed in grain seeds.

[0006] To achieve the above-mentioned object, the present invention provides a method for detecting weed seeds, which comprises the following steps: step 1, conveying the seeds to be detected forward through an image acquisition device by a seed conveying device, so that the image acquisition device acquires the image of the seeds to be detected, and the acquired image of the seeds to be detected is conveyed to a main control computer; step 2, the main control computer processes the image of the seeds to be detected acquired by the image acquisition device by an image preprocessing module, and divides all the seeds contained in the image of the seeds to be detected into single seed images; step 3, marking all the seeds contained in one of the images of the seeds to be detected acquired by manual marking on the main control computer; The name of the single seed image is obtained to form a seed image database; step four, the main control computer trains a seed image recognition model using the seed image database as a training set through a training module, and the trained seed image recognition model is a seed image recognition module; step five, the main control computer identifies all the single seed images of the other seed images to be tested through the seed image recognition module; the single seed image does not belong to any category in the seed image database and is classified into other categories; and step six, the main control computer displays the recognition result of the seed image recognition module in step five through a display.

[0007] Preferably, in the above technical solution, the seed transport device includes a conveyor belt and a seed storage box, and the seed storage box is located below the rear end of the conveyor belt; and the image acquisition device is arranged in the middle of the conveyor belt.

[0008] Preferably, in the above technical solution, the seed conveying device also includes a vibrating seed meter and a feed hopper, the feed hopper is located above the front of the vibrating seed meter, the rear end of the vibrating seed meter is located above the front of the conveyor belt, and the vibrating seed meter vibrates and disperses the seeds before conveying them to the conveyor belt.

[0009] Preferably, in the above technical solution, the image acquisition device includes a dark box, a light source and a camera, the dark box is arranged in the middle of the conveyor belt, the conveyor belt is a transparent belt, the light source is arranged in the dark box and is located below the conveyor belt; the camera is arranged in the dark box and is located above the conveyor belt, and the camera is connected to the main control computer.

[0010] Preferably, in the above technical solution, the light sources are LED light sources arranged in a matrix.

[0011] Preferably, in the above technical solution, the process of the image preprocessing module processing the seed image to be tested is: first, using the threshold method to divide all the seeds contained in the seed image to be tested into single seed targets; then, marking the single seed targets based on four-connectivity, and obtaining the total number of the single seed targets; then, extracting the marked single seed targets, and extracting the corresponding regional coordinates of the single seed targets based on the marks, and then changing the pixel values ​​of the regional coordinates of the non-extracted single seed targets in the original image to 255, and the pixel values ​​of the regional coordinates of the extracted single seed targets remain unchanged; finally, with the center coordinates of the area where the single seed target is located as the center, the original image is cropped into a square image to obtain the single seed image.

[0012] Preferably, in the above technical solution, the seed image recognition model is a deep convolutional neural network model, comprising: an input layer for reading the single seed image obtained by the image preprocessing module; a hidden layer for extracting features of the single seed image; and an output layer for outputting the recognition result.

[0013] Preferably, in the above technical solution, in the step five, the single seed image classified as other categories is manually identified and stored in the seed image database after being manually labeled with a name, and the main control computer retrains the seed image recognition model to update the seed image recognition module.

[0014] Compared with the prior art, the present invention has the following beneficial effects:

[0015] 1. The main control computer of the present invention processes and trains one of the collected seed images to obtain a seed image recognition module, and then automatically recognizes the seeds in other collected seed images to be tested through the seed image module, so that various weed seeds can be identified quickly, accurately and quantitatively to improve the detection efficiency, especially to improve the detection efficiency of weed seeds in import and export inspection and quarantine departments.

[0016] 2. The seed conveying device of the present invention can disperse the seed targets by arranging a vibrating seed metering device, thereby preventing the seeds from sticking and overlapping, thereby improving the accuracy of image recognition.

[0017] 3. The conveyor belt of the present invention is a transparent belt, and the light source is located below the conveyor belt, which can enhance the contrast between the seed target and the background in the collected seed image to be tested, and reduce the reflection of light by the seed shadow and the seed body.

[0018] 4. The present invention stores individual seed images classified into other categories into the seed image database after manual identification and labeling, and updates the seed image recognition module. In this way, the image database will gradually grow with the increase of detection tasks, and the types of seeds recognized by the image recognition model will also increase accordingly. The more time goes by, the less manual intervention will be required. If the seed images to be detected are all in the database, no manual intervention is required at all and they can be directly detected, thereby greatly improving the detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a flow chart of the method for detecting weed seeds according to the present invention;

[0020] Figure 2 It is a schematic diagram of the structure of a related device to which the weed seed detection method according to the present invention is applied.

[0021] Description of main reference numerals:

[0022] 1-feed hopper, 2-vibration seed metering device, 3-conveyor belt, 4-dark box, 5-light source, 6-camera, 7-seed storage box, 8-main control computer, 9-seed image recognition platform, 10-image preprocessing module, 11-seed image database, 12-training module, 13-image recognition module, 14-display, 15-seed image to be tested. DETAILED DESCRIPTION

[0023] The specific implementation modes of the present invention are described in detail below in conjunction with the accompanying drawings, but it should be understood that the protection scope of the present invention is not limited by the specific implementation modes.

[0024] Unless explicitly stated otherwise, throughout the specification and claims, the term “comprise” or variations such as “include” or “comprising”, etc., will be understood to include the stated elements or components but not to exclude other elements or components.

[0025] Figure 1 to Figure 2 A schematic diagram showing a method for detecting weed seeds according to a preferred embodiment of the present invention is shown. Figure 1 The weed seed detection method comprises the following steps:

[0026] Step 1: The seed to be tested is transported forward through the image acquisition device by the seed transport device, so that the image acquisition device acquires the seed image 15 to be tested, and the acquired seed image 15 to be tested is transmitted to the main control computer 8. Figure 2The main control computer 8 is provided with a seed image recognition platform 9, which includes an image preprocessing module 10, a seed image database 11, a training module 12, an image recognition module 13 and a display 14. The seed conveying device conveys the seeds to be detected forward at a uniform speed, and the image acquisition device sets the shooting interval time according to the conveying speed of the seed conveying device to ensure that the collected seed images 15 to be detected are neither overlapped nor missed during the continuous conveying and continuous acquisition process.

[0027] refer to Figure 2 In the present invention, preferably, the seed conveying device includes a conveyor belt 3 and a seed storage box 7, the seed storage box 7 is located below the rear end of the conveyor belt 3, the image acquisition device is arranged in the middle of the conveyor belt 3, the conveyor belt 3 conveys the seeds to be detected backward through the image acquisition device, and the seeds to be detected finally fall from the rear end of the conveyor belt 3 to the seed storage box 7 for recovery. Further preferably, the seed conveying device also includes a vibrating seed metering device 2 and a feed hopper 1, the feed hopper 1 is located above the front of the vibrating seed metering device 2, and is used to discharge the seeds to be detected to the vibrating seed metering device 2, the rear end of the vibrating seed metering device 2 is located above the front of the conveyor belt 3, and the vibrating seed metering device 2 vibrates and disperses the seeds and then conveys them to the conveyor belt 3. The seed conveying device of the present invention can disperse the seed targets by setting the vibrating seed metering device 2, prevent the seeds from sticking and overlapping, and improve the accuracy of image recognition. The vibrating seed metering device 2 can be a vibrating screen tilted backward and downward, and the seeds are vibrated on the vibrating screen and roll backward and downward under the action of gravity to fall onto the conveyor belt 3. Of course, the vibrating seed metering device 2 can also be other devices that can realize corresponding functions. The present invention is also preferably that the image acquisition device includes a dark box 4, a light source 5 and a camera 6. The dark box 4 is arranged in the middle of the conveyor belt 3, and the seeds transported on the conveyor belt 3 pass through the dark box 4. The conveyor belt 3 is a transparent belt, and the light source 5 is arranged in the dark box 4 and below the conveyor belt 3. Preferably, the light source 5 is an LED light source arranged in a matrix. The camera 6 is arranged in the dark box 4 and above the conveyor belt 3. The camera 6 can be specifically located at the central position of the top of the dark box 4. The camera 6 maintains a fixed distance from the conveyor belt 3 to ensure the consistency of the seed image scale. The camera 6 is connected to the main control computer 8, so that the captured seed image to be tested is transmitted to the main control computer 8. The conveyor belt 3 of the present invention is a transparent belt, and the light source 5 is located below the conveyor belt 3, which can enhance the contrast between the seed target and the background in the collected seed image to be tested, and reduce the reflection of light by the seed shadow and the seed body.

[0028] Step 2: The main control computer 8 processes the to-be-detected seed image 15 collected by the image acquisition device through the image preprocessing module 10 to segment all the seeds contained in the to-be-detected seed image 15 into single seed images of a fixed pixel size. Preferably, in the present invention, the process of the image preprocessing module 10 processing the to-be-detected seed image 15 is as follows:

[0029] First, the threshold method is used to segment all the seeds contained in the to-be-detected seed image into single seed targets. Specify a value a (threshold 0 < a < 255). The pixel values greater than or equal to a in the to-be-detected seed image become white (pixel value = 255), and the pixel values less than a become black (pixel value = 0). In this way, the seed targets and the background are distinguished, which is convenient for the subsequent calculation of extracting single seed targets. Since the background is the transparent conveyor belt 3 and the light irradiates from bottom to top, after the seed image is grayscale processed (color image becomes a gray image), the seed targets in the grayscale image are significantly darker (pixel values are smaller), while the background part is significantly brighter (pixel values are close to 255). In this way, it is easier to distinguish the seed targets and the background.

[0030] Then, the single seed targets are marked based on four-connectivity, and the total number of single seed targets is obtained. Four-connectivity marking means comparing each pixel point with its four adjacent pixel points in the front, back, left, and right directions. If the values are the same, the pixel points are connected and marked. The same marked ones form a connected domain. If they are different regions, due to no connection in the front, back, left, and right directions, they are regarded as new separate regions. In this way, each seed and the background are marked.

[0031] Next, the marked single seed targets are extracted, and the regional coordinates of the corresponding single seed targets are extracted based on the marking. Then, the pixel values of the regional coordinates of the non-extracted single seed targets in the original image are changed to 255, and the pixel values of the regional coordinates of the extracted single seed targets remain unchanged.

[0032] Finally, the original image is cropped into a square image of fixed pixel size with the center coordinate of the area where the single seed target is located as the center, and a single seed image is obtained. The fixed pixel size is related to the maximum pixel area occupied by the seed target to ensure that all types of seed targets are included in the image of fixed pixel size. The fixed pixel size is generally selected as 224, 112, 56, and 28. The vertical distance between the image acquisition device and the conveyor belt 3 can also be adjusted to ensure that all types of seed targets are included in the image of fixed pixel size. Based on the label, after the pixels in the non-specified label area have been changed to white (pixel value specified = 255), the entire image only has the pixels of the specified label part = 0, and the image is added to the original image (the corresponding pixels and the corresponding pixel values ​​are added, if greater than 255, then = 255). In this way, except for the part with the specified label that retains the original pixel value (that is, a single seed), the other pixel values ​​= 255 (white), and then it is cropped into a square image with the regional coordinates of the single seed target as the center (if the seed is at the boundary of the large image, cropping may cause insufficient size in a certain direction, then 255 pixels are added), and the size is specified according to the actual shooting situation (other seeds are based on this pixel size, that is, the image size of the seed database is the same), so that the individual seeds of all types of seeds can be fully displayed.

[0033] Step 3: On the main control computer 8, the names of all the individual seed images of one of the seed images to be detected 15 are manually marked to form a seed image database 11. The seed image database 11 is composed of a series of individual seed images of fixed pixel size, and the names of the seed images are manually marked. According to the detection requirements, all kinds of seed images to be detected are included as much as possible, especially the seed images of weeds. Of course, the seed image database can also be a single seed image of each kind that meets the size requirements directly stored in advance.

[0034] Step 4, main control computer 8 trains seed image recognition model with seed image database 11 as training set through training module 12, and the trained seed image recognition model is seed image recognition module 13. When training module is trained, the training parameters of seed image recognition model are set, and training parameters include training test ratio, initial learning rate, learning rate decay factor, learning rate decay cycle, single training sample number and training number of times. Setting training parameters generally includes: sample is divided into training set and test set by training test ratio 4:1, learning rate decay factor is 0.1, learning rate decay cycle is 20, initial learning rate is 0.01, training batch maximum number is 50, each time 100 samples in the training set are extracted to calculate (all extracted to be 1 batch), each time training is carried out to obtain a model, and the test set is tested with this model, and the operation result is fed back to the next training, so that the model recognition seed is more and more accurate.

[0035] Preferably, in the present invention, the seed image recognition model is a deep convolutional neural network model, including an input layer, a hidden layer and an output layer, the input layer is used to read a single seed image processed by the image preprocessing module 10, the hidden layer is used to extract the features of the single seed image, the hidden layer is generally composed of a convolutional layer, an activation function, a pooling layer, a fully connected layer and a classification layer, and the output layer is used to output the recognition result, and the type of the recognition result is the name of the single seed image marked in the seed image database 11 and others.

[0036] The specific structure of the deep convolutional neural network is:

[0037] Input layer: data, the input is an RGB3 channel image of size 112×112×3;

[0038] The second layer: convolutional layer convolution2dLayer, function size 7×7, step size 2, padding;

[0039] The third layer: activation function reluLayer;

[0040] The fourth layer: pooling layer maxPooling2dLayer, function size 3×3, step size 1, padding;

[0041] Fifth layer: Response-nomalization Layer;

[0042] The sixth layer: convolutional layer convolution2dLayer, function size 5×5, step size 2, padding;

[0043] The seventh layer: activation function reluLayer;

[0044] Layer 8: Response-nomalization Layer;

[0045] Layer 9: pooling layer maxPooling2dLayer, function size 3×3, step size 1, padding;

[0046] The tenth to the thirty-seventh layers: two inception structures of GoogLeNet;

[0047] Layer 38: Pooling layer maxPooling2dLayer, function size 3×3, step size 1, padding;

[0048] Layer 39: convolutional layer convolution2dLayer, function size 3×3, step size 2, padding;

[0049] The 40th layer: activation function reluLayer;

[0050] The 41st layer: convolutional layer convolution2dLayer, function size 3×3, step size 2, padding;

[0051] Layer 42: activation function reluLayer;

[0052] Layer 43: Pooling layer maxPooling2dLayer, function size 3×3, step size 1, no padding;

[0053] Layer 44: drop layer;

[0054] Layer 45: Fully connected layer, 10 channels (N number of database seed types + other types, i.e. N+1 channels);

[0055] Layer 46: classification layer softmaxLayer;

[0056] Output layer: classificationLayer.

[0057] Step five, the main control computer 8 identifies all the individual seed images of the other seed images to be tested 15 through the seed image recognition module 13; if the individual seed image does not belong to any category in the seed image database, it is classified as other categories. The image recognition module 13 can identify all types of seeds contained in the seed image database 11, and if the individual seed image does not belong to any category in the seed image database 11, it is classified as others. Preferably, in the present invention, in step five, for the individual seed images classified as other categories, they are manually identified and stored in the seed image database after being manually marked with names, and the main control computer 8 retrains the seed image recognition model to update the seed image recognition module 13. The present invention stores the single seed images classified into other categories into the seed image database 11 after manual identification and labeling, and updates the seed image recognition module 13. In this way, the image database 11 will gradually grow with the increase of detection tasks, and the seed types recognized by the image recognition model 13 will also increase accordingly. The more time passes, the less manual intervention will be required. If the seed images to be detected are all in the image database 11, no manual intervention is required at all, and there is no need to re-establish the image database 11. They can be directly detected, thereby greatly improving the detection efficiency.

[0058] Step 6: The main control computer 8 displays the recognition result of the seed image recognition module 13 in step 5 through the display 14. The result includes the seed name and quantity information.

[0059] The main control computer 8 of the present invention processes and trains one of the collected seed images 15 to obtain a seed image recognition module 13, and then automatically recognizes the seeds in other collected seed images 15 to be tested through the seed image module 13, that is, a seed image database 11 is established through one seed image 15 to be tested to train the seed image recognition module, and then other seed images 15 to be tested are recognized, so that various weed seeds can be recognized quickly, accurately and quantitatively, so as to improve the detection efficiency, especially the detection efficiency of weed seeds in import and export inspection and quarantine departments.

[0060] The foregoing description of specific exemplary embodiments of the present invention is for the purpose of illustration and demonstration. These descriptions are not intended to limit the present invention to the precise form disclosed, and it is clear that many changes and variations can be made based on the above teachings. The purpose of selecting and describing the exemplary embodiments is to explain the specific principles of the present invention and its practical application, so that those skilled in the art can realize and utilize various different exemplary embodiments of the present invention and various different selections and changes. The scope of the present invention is intended to be limited by the claims and their equivalents.

Claims

1. A method for detecting weed seeds, characterized in that: The following steps are involved: Step 1: The seeds to be tested are transported forward through the image acquisition device by the seed transport device, so that the image acquisition device acquires the image of the seeds to be tested, and the acquired image of the seeds to be tested is transmitted to the main control computer; Step 2: the main control computer processes the seed image to be tested acquired by the image acquisition device through an image preprocessing module, and divides all seeds contained in the seed image to be tested into single seed images; Step 3, manually marking the names of all the single seed images collected from one of the seed images to be tested on the main control computer to form a seed image database; Step 4, the main control computer trains the seed image recognition model by using the seed image database as a training set through a training module, and uses the trained seed image recognition model as a seed image recognition module; Step 5, the main control computer identifies all the single seed images of the other seed images to be tested through the seed image recognition module; if the single seed image does not belong to any category in the seed image database, it is classified as other categories; as well as Step 6, the main control computer displays the recognition result of the seed image recognition module in step 5 through a display; The seed image recognition model is a deep convolutional neural network model, comprising: An input layer, used for reading the single seed image processed by the image preprocessing module; A hidden layer, used to extract features of the single seed image; and Output layer, used to output recognition results; Among them, the specific structure of the deep convolutional neural network is: Input layer: data, the input is an RGB3 channel image of size 112×112×3; The second layer: convolutional layer convolution2dLayer, function size 7×7, step size 2, padding; The third layer: activation function reluLayer; The fourth layer: pooling layer maxPooling2dLayer, function size 3×3, step size 1, padding; Fifth layer: Response-nomalization Layer; The sixth layer: convolutional layer convolution2dLayer, function size 5×5, step size 2, padding; The seventh layer: activation function reluLayer; Layer 8: Response-nomalization Layer; Layer 9: pooling layer maxPooling2dLayer, function size 3×3, step size 1, padding; The tenth to the thirty-seventh layers: two inception structures of GoogLeNet; Layer 38: Pooling layer maxPooling2dLayer, function size 3×3, step size 1, padding; Layer 39: convolutional layer convolution2dLayer, function size 3×3, step size 2, padding; The 40th layer: activation function reluLayer; The 41st layer: convolutional layer convolution2dLayer, function size 3×3, step size 2, padding; Layer 42: activation function reluLayer; Layer 43: Pooling layer maxPooling2dLayer, function size 3×3, step size 1, no padding; Layer 44: drop layer; Layer 45: fully connected layer, 10 channels; Layer 46: classification layer softmaxLayer; Output layer: classificationLayer.

2. The method for detecting weed seeds according to claim 1, characterized in that: The seed conveying device comprises a conveyor belt and a seed storage box, wherein the seed storage box is located below the rear end of the conveyor belt; and the image acquisition device is arranged in the middle of the conveyor belt.

3. The method for detecting weed seeds according to claim 2, characterized in that: The seed conveying device also includes a vibrating seed meter and a feed hopper. The feed hopper is located above the front of the vibrating seed meter. The rear end of the vibrating seed meter is located above the front of the conveyor belt. The vibrating seed meter vibrates and disperses the seeds before conveying them to the conveyor belt.

4. The method for detecting weed seeds according to claim 2, characterized in that: The image acquisition device includes a dark box, a light source and a camera. The dark box is arranged in the middle of the conveyor belt, the conveyor belt is a transparent belt, the light source is arranged in the dark box and is located below the conveyor belt; the camera is arranged in the dark box and is located above the conveyor belt, and the camera is connected to the main control computer.

5. The method for detecting weed seeds according to claim 4, characterized in that: The light sources are LED light sources arranged in a matrix.

6. The method for detecting weed seeds according to claim 1, characterized in that: The process of the image preprocessing module processing the seed image to be tested is as follows: Firstly, a threshold method is used to segment all seeds contained in the seed image to be tested into single seed targets; Then, the single seed target is marked based on four-connectivity, and the total number of the single seed target is obtained; Next, extract the marked single seed target, and extract the region coordinates of the corresponding single seed target based on the mark, and then change the pixel value of the region coordinates of the non-extracted single seed target in the original image to 255, while the pixel value of the region coordinates of the extracted single seed target remains unchanged; Finally, the original image is cropped into a square image with the central coordinates of the area where the single seed target is located as the center, thereby obtaining the single seed image.

7. The method for detecting weed seeds according to claim 1, characterized in that: In step five, the single seed images classified as other categories are manually identified and stored in the seed image database after being manually labeled. The main control computer retrains the seed image recognition model to update the seed image recognition module.