Seed screening method and system based on image recognition

By combining the dynamic speed adaptation of the linear array camera and the conveyor device with a deep learning model, the problems of low efficiency and poor adaptability of traditional seed screening methods were solved, achieving efficient and accurate seed screening results.

CN120656162APending Publication Date: 2025-09-16NAT SPACE SCI CENT CAS
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510683631.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-26
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

Traditional seed screening methods are inefficient, manual visual inspection is prone to fatigue and has a high missed detection rate, mechanical screening is insensitive to surface defects, existing image recognition technology has poor adaptability in complex environments, and screening results are not reliable enough.

Method used

The linear array camera and the dynamic speed adaptation of the conveyor are adopted, combined with the deep learning model for image preprocessing and recognition, the encoder-decoder structure and attention mechanism are used, multi-scale feature fusion is introduced, and the target detection and segmentation branches work together to construct a highly adaptable training dataset.

Benefits of technology

It achieves efficient and accurate seed screening, significantly improves the efficiency and accuracy of large-scale seed screening, reduces missed detection and false detection rates, and adapts to different varieties and complex backgrounds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120656162A_ABST
    Figure CN120656162A_ABST
Patent Text Reader

Abstract

The invention discloses a seed screening method and system based on image recognition, and belongs to the technical field of image processing. The method comprises the following steps: S1, constructing a training model and a training data set for seed screening, and training the training model by adopting the training data set to obtain a screening model; s2, collecting a seed image to be detected, and preprocessing the seed image to obtain a preprocessed image; and identifying the preprocessed image based on the screening model to obtain a screening result. According to the method, automatic preprocessing and a deep learning model are combined, manual intervention is remarkably reduced, the method is suitable for large-scale seed screening scenes, and efficiency is improved by several times compared with traditional manual visual inspection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image processing, and in particular relates to a seed screening method and system based on image recognition. Background Art

[0002] Traditional seed screening methods rely on inspectors visually observing the seeds for color, shape, and damage, or using microscopes to identify defects like insect infestation and mildew. However, manual visual inspection is inefficient and difficult to handle for large-scale import and export. Furthermore, the human eye is easily fatigued, leading to a high rate of missed detection of minor defects. Manual visual inspection relies heavily on the inspector's experience and is highly subjective. A second method relies on mechanical screening, using vibrating screens or gravity sorters to identify seeds with obvious abnormalities based on size or quantity. However, mechanical screening can only distinguish differences in physical properties and is insensitive to surface defects.

[0003] With the development of computer vision, image recognition technology has gradually been applied to seed screening. However, existing technologies still have significant limitations. Many solutions have difficulty accurately distinguishing seed characteristics in complex environments or have poor adaptability to different seed varieties, resulting in unreliable screening results. Summary of the Invention

[0004] The present invention aims to address the deficiencies of the prior art and proposes a seed screening method based on image recognition, comprising the following steps:

[0005] S1. Constructing a training model and a training data set for seed screening, and using the training data set to train the training model to obtain a screening model;

[0006] S2. Collect a seed image to be detected, and preprocess the seed image to obtain a preprocessed image; identify the preprocessed image based on the screening model to obtain a screening result.

[0007] Further preferably, the method for collecting the seed image to be detected includes:

[0008] Calculating the horizontal pixel accuracy of the seed image based on the seed conveying speed and conveying device parameters;

[0009] The speed of the conveying device is adjusted based on the horizontal pixel accuracy, and the seed image is captured using a line array camera.

[0010] Further preferably, in S2, the preprocessing method includes:

[0011] Performing denoising and enhancement processing on the seed image to obtain a first image;

[0012] performing histogram equalization processing on the first image to obtain a second image;

[0013] Perform edge detection on the second image to extract the edge contour of the second image; and detect the integrity of the edge contour. When the edge contour is broken, perform contour repair on the edge contour, and perform segmentation processing on the repaired edge contour to obtain the preprocessed image.

[0014] Further preferably, a contour extraction model is used to extract the edge contour of the second image;

[0015] The contour extraction model includes: an encoder part and a decoder part;

[0016] The decoder part includes a first convolution block and a second convolution block; the first convolution block includes two convolution layers; the second convolution block includes three convolution layers; the convolution kernel size is 3×3, and the activation function is ReLU; a 2×2 maximum pooling layer is set at the end of each of the first and second convolution blocks;

[0017] The skip connection layer between the encoder part and the decoder part is provided with an attention mechanism model;

[0018] The decoder part is provided with a feature fusion module before upsampling.

[0019] Further preferably, the method for performing contour repair on the edge contour includes:

[0020]

[0021] Where, I o represents the pixel value of the occluded area; λ1 and λ2 represent the equalization parameters; and Represents the gradient of the image in the occluded area and the background area; I r represents the target contour area; ||·||2 represents the two-norm.

[0022] Further preferably, a segmentation model is used to segment the restored edge contour;

[0023] The segmentation model includes: a first backbone network, a first neck network and a first head detection network;

[0024] The first backbone network includes: a detection layer, an SPPF module and a CBAM module;

[0025] The detection layers are connected to each other through a C3 module; the input end of the SPPF module is connected to the last detection layer, and the output end is connected to the CBAM module;

[0026] The first neck network adopts FPN structure and PAN structure;

[0027] The first head detection network includes an object detection branch and an object segmentation branch.

[0028] Further preferably, the screening model includes: a second backbone network, a second neck network and a second head detection network;

[0029] The second backbone network includes: a guiding module, an aggregation module, an SPPF module and a feature enhancement module;

[0030] The second neck network includes: a guiding module, an aggregation module and an upsampling module;

[0031] The second head detection network includes: a recognition module.

[0032] The present invention also provides a seed screening system based on image recognition, comprising: a collection system and a model system;

[0033] The acquisition system includes a first acquisition unit and a second acquisition unit;

[0034] The first acquisition unit is used to acquire a training data set;

[0035] The second acquisition unit is used to acquire a seed image to be detected and preprocess the seed image to obtain a preprocessed image;

[0036] The model system is used to construct a training model, and train the training model based on the training data set to obtain a screening model; then the screening model is used to identify the preprocessed image to obtain a screening result.

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

[0038] The present invention achieves high-speed, continuous image acquisition through dynamic speed adaptation of the linear array camera and the conveying device; combined with automated preprocessing and deep learning models, it significantly reduces manual intervention and is suitable for large-scale seed screening scenarios, with efficiency several times higher than traditional manual visual inspection. Denoising, histogram equalization and edge repair techniques effectively eliminate image noise and contour breaks, ensuring the data quality of the input model. The encoder-decoder structure combines the attention mechanism (such as the CBAM module) with the feature fusion module to enhance the ability to capture details such as seed edges and textures; the introduction of the P2 detection layer and multi-scale feature fusion (FPN+PAN) significantly improves the recognition accuracy of small targets (such as minor damage and mildew). The target detection and segmentation branches work together to simultaneously locate defective areas and accurately segment seed contours, reducing missed detection and false detection rates. The training data set covers a variety of normal / defective seeds and interference objects (such as gravel). Combined with technologies such as reparameterized convolution and differential convolution, the model can adapt to different varieties of seeds and complex backgrounds, solving the problem of traditional methods being insensitive to surface defects. Through technological innovation and system integration, the present invention is significantly superior to existing technologies in terms of accuracy, efficiency, adaptability and cost control in seed screening, and has important practical value and market prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0040] Figure 1 The figure is a flow chart of a seed screening method based on image recognition according to an embodiment of the present invention. DETAILED DESCRIPTION

[0041] The following will clearly and completely describe the technical solutions in the embodiments of the present invention 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 making creative efforts are within the scope of protection of the present invention.

[0042] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0043] Example 1:

[0044] like Figure 1 As shown, this embodiment provides a seed screening method based on image recognition, comprising the following steps:

[0045] S1. Construct a training model and a training data set for seed screening, and use the training data set to train the training model to obtain a screening model.

[0046] In this embodiment, the training data set includes: different types of seeds in normal morphology, different types of seeds with defective morphology (such as damaged, moldy, etc.), and non-seed images (such as straw, gravel, etc.). Using the training data set, the training model is trained to recognize seed type, seed morphology, and non-seed, thereby obtaining a screening model for seed screening.

[0047] Further implementation is that the screening model includes: a second backbone network, a second neck network and a second head detection network; the second backbone network includes: a guidance module, an aggregation module, an SPPF module and a feature enhancement module; the second neck network includes: a guidance module, an aggregation module and an upsampling module; the second head detection network includes: an identification module.

[0048] Specifically, the seed image is input into the second backbone network, where it first passes through a convolutional layer to extract preliminary features. It then passes through four sets of "guidance modules and aggregation modules" and is then fed into the SPPF module. Finally, it passes through the feature enhancement module and is fed into the second neck network. The guidance module consists of four extractors: a local feature extractor, a surrounding context extractor, a joint feature extractor, and a global context extractor. After a 1x1 convolution, the input seed image is fed into the local feature extractor and the surrounding context extractor to learn local and contextual features. The local feature extractor is implemented using a standard 3x3 convolutional layer, while the surrounding context extractor uses a 3x3 depthwise convolution to capture contextual information. The local and contextual features obtained by the local and surrounding context extractors are then fed into the joint feature extractor for fusion, yielding fused features. The joint feature extractor first combines the local and contextual features using a concat layer, then enhances feature representation through batch normalization (BN) and the pre-resolved linear unit (PReLU) activation function. The fused features are then fed into the global context extractor to yield the joint features. The global context extractor first aggregates the contextual information of the fused features using global average pooling (GAP). This information is then further processed through two fully connected layers (FC) to learn the joint features of the local and surrounding environments. In the aggregation module, the input image is first subjected to channel compression using a 1x1 standard convolution. The model then splits into two branches: a convolution branch and a line branch. The convolution branch consists of a reparameterized convolution, a 3x3 standard convolution, and a 1x1 standard convolution. The line branch directly feeds the input image, processed by the 1x1 standard convolution, into the concatenation layer. The concatenation layer integrates the features of the two branches and outputs them using a 1x1 standard convolution. The SPPF module uses a standard spatial pyramid pooling module. The feature enhancement module uses a standard C2PSA module.

[0049] The second neck network adopts the standard neck network of the YOLO11 network model and replaces its C3K2 module with an aggregation module.

[0050] The second-head detection network uses three second-head detection modules. The second-head detection module includes P3, P4, and P5 detection layers, each of which is connected to a 1*1 group normalization convolution layer. The group normalization convolution layer groups the feature dimensions of the input image and normalizes them within each group. It then passes through two DE convolution layers to capture more image details. The feature map output by the DE convolution layer then passes through the Conv_Reg and Conv_Cls layers for bounding box regression and category classification, and scale is used to adjust the scale of the final output. The DE convolution layer contains five convolution layers: ordinary convolution, center difference convolution, angular difference convolution, horizontal difference convolution, and vertical difference convolution. First, center difference convolution and angular difference convolution are used to encode prior information into the convolution layer. Then, horizontal difference convolution and vertical difference convolution are used to integrate traditional local descriptors into the convolution layer, enhancing representation and generalization capabilities by learning gradient information. Normal convolution and differential convolution are used to obtain horizontal intensity and enhance gradient information, and integrate the features learned by the five convolutional layers. Finally, reparameterization technology is used to obtain rich features without introducing additional computational cost, which is used as the output of the DE convolutional layer.

[0051] S2. Collect the seed image to be detected, and preprocess the seed image to obtain a preprocessed image; identify the preprocessed image based on the screening model to obtain a screening result.

[0052] The quality of the captured image is a major factor affecting screening results. In this embodiment, a linear scan camera is used to capture images of seeds on a conveyor. To avoid distortion of the captured images, this embodiment provides a method for capturing images of the seeds to be tested, including: calculating the horizontal pixel accuracy of the seed image based on the seed conveyor speed and conveyor device parameters; adjusting the conveyor speed based on the horizontal pixel accuracy; and capturing the seed image using a linear scan camera.

[0053] The calculation method of horizontal pixel accuracy includes:

[0054]

[0055] Where p1 represents the horizontal pixel accuracy; L0 represents the width of the conveyor belt; H c Indicates the number of pixels per unit of a line scan camera.

[0056] The horizontal pixel accuracy is made the same as the vertical pixel accuracy, and the conveyor belt running speed is calculated based on the vertical pixel accuracy. The method includes:

[0057]

[0058] Where, v represents the conveyor belt running speed; T0 represents the conveyor belt running time for scanning one frame of image; vc represents the line scan rate of the linear array camera; T c Indicates the scanning time of the linear array camera for scanning one frame of image. In this embodiment, T0=T c .

[0059] Further implementation is that, in S2, the preprocessing method includes:

[0060] The seed image is subjected to denoising and enhancement processing to obtain a first image.

[0061] Perform histogram equalization processing on the first image to obtain a second image.

[0062] Perform edge detection on the second image to extract the edge contour of the second image; and detect the integrity of the edge contour. If there is a break in the edge contour, perform contour repair on the edge contour, and perform segmentation processing on the repaired edge contour to obtain a preprocessed image.

[0063] In this embodiment, a contour extraction model is used to extract the edge contour of the second image; the contour extraction model includes: an encoder part and a decoder part; the decoder part includes a first convolution block and a second convolution block; the first convolution block contains two convolution layers; the second convolution block includes three convolution layers; the convolution kernel size is 3×3, and the activation function is ReLU; a 2×2 maximum pooling layer is provided at the end of each of the first convolution block and the second convolution block; the jump connection layer between the encoder part and the decoder part is provided with an attention mechanism model; in this embodiment, the decoder part is based on the Unet decoder, and the decoder part is provided with a feature fusion module before upsampling.

[0064] The processing of the attention mechanism model includes: performing a global average pooling operation on the input C feature map of size H×W, compressing the C×H×W feature map into a one-dimensional feature map of size 1×1×C Figure 1 , and then for the one-dimensional feature Figure 1 A 1D convolution operation is performed to obtain a one-dimensional feature map 2 of the same size. Finally, the obtained one-dimensional feature map 2 is activated by a sigmoid function and calibrated with the input feature map to obtain the output of the attention mechanism model.

[0065] The feature fusion module consists of a parallel 1×1 convolution layer, three dilated convolution layers and a pooling layer. The three dilated convolution layers have different expansion factors. After fusing the obtained five feature maps of different scales, a 1×1 convolution is performed to obtain the output feature map of the feature fusion module.

[0066] In a further embodiment, the method for performing contour repair on the edge contour includes:

[0067]

[0068] Where, I o represents the pixel value of the occluded area; λ1 and λ2 represent the equalization parameters; and Represents the gradient of the image in the occluded area and the background area; I r represents the target contour area; ||·||2 represents the two-norm.

[0069] A further implementation involves using a segmentation model to segment the restored edge contours. This segmentation model is improved upon the traditional Yolov5s-segment network model and includes a first backbone network, a first neck network, and a first head detection network. The first backbone network includes a detection layer, an SPPF module, and a CBAM module. Each detection layer is connected via a C3 module. The input of the SPPF module is connected to the final detection layer, and the output is connected to the CBAM module. By introducing the P2 small target detection layer into the backbone network of the traditional Yolov5s-segment network model, the problem of the traditional Yolov5s-segment network model's P3, P4, and P5 detection layers having poor small target detection capabilities is addressed. Specifically, the input feature map first passes through the P2 detection layer, which has a size of [160, 160], followed by the P3, P4, and P5 detection layers and the SPPF module. The CBAM module is introduced after the SPPF module to better fuse the feature maps and improve the model's detection performance. The first neck network adopts FPN and PAN structures. Since the neck network of the traditional Yolov5s-segment network model does not have a 160×160 pixel feature map, this embodiment performs a convolution and upsampling operation on the 80×80 pixel feature map in the first neck network to obtain a 160×160 pixel feature map, and performs a tensor splicing operation with the feature map generated by the P2 detection layer in the first backbone network. Finally, it is processed by the C3 module to obtain the detection and segmentation results of small targets. The first head detection network adopts the head prediction network structure of the traditional Yolov5s-segment network model, including a target detection branch and a target segmentation branch.

[0070] Example 2:

[0071] This embodiment provides a seed screening system based on image recognition, including: an acquisition system and a model system; the acquisition system includes a first acquisition unit and a second acquisition unit; the first acquisition unit is used to acquire a training data set; the second acquisition unit is used to acquire seed images to be detected and preprocess the seed images to obtain preprocessed images; the model system is used to construct a training model and train the training model based on the training data set to obtain a screening model; the screening model is then used to identify the preprocessed image to obtain a screening result.

[0072] The embodiments described above are merely descriptions of preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by persons skilled in the art should fall within the scope of protection defined by the claims of the present invention.

Claims

1. A seed screening method based on image recognition, characterized in that: The following steps are involved: S1. Constructing a training model and a training data set for seed screening, and using the training data set to train the training model to obtain a screening model; S2, collecting a seed image to be detected, and preprocessing the seed image to obtain a preprocessed image; The pre-processed image is identified based on the screening model to obtain a screening result.

2. The seed screening method based on image recognition according to claim 1, characterized in that: The method of collecting the seed image to be detected includes: Calculating the horizontal pixel accuracy of the seed image based on the seed conveying speed and conveying device parameters; The speed of the conveying device is adjusted based on the horizontal pixel accuracy, and the seed image is captured using a line array camera.

3. The seed screening method based on image recognition according to claim 1, characterized in that: In S2, the preprocessing method includes: Performing denoising and enhancement processing on the seed image to obtain a first image; performing histogram equalization processing on the first image to obtain a second image; Perform edge detection on the second image to extract the edge contour of the second image; and detect the integrity of the edge contour. When the edge contour is broken, perform contour repair on the edge contour, and perform segmentation processing on the repaired edge contour to obtain the preprocessed image.

4. The seed screening method based on image recognition according to claim 3, characterized in that: extracting an edge contour of the second image using a contour extraction model; The contour extraction model includes: an encoder part and a decoder part; The decoder part includes a first convolution block and a second convolution block; the first convolution block includes two convolution layers; the second convolution block includes three convolution layers; the convolution kernel size is 3×3, and the activation function is ReLU; a 2×2 maximum pooling layer is set at the end of each of the first and second convolution blocks; The skip connection layer between the encoder part and the decoder part is provided with an attention mechanism model; The decoder part is provided with a feature fusion module before upsampling.

5. The seed screening method based on image recognition according to claim 3, characterized in that: The method for performing contour repair on the edge contour includes: Where, I o represents the pixel value of the occluded area; λ1 and λ2 represent the equalization parameters; and Represents the gradient of the image in the occluded area and the background area; I r represents the target contour area; ||·||2 represents the two-norm.

6. The seed screening method based on image recognition according to claim 3, characterized in that: Use the segmentation model to segment the restored edge contour; The segmentation model includes: a first backbone network, a first neck network and a first head detection network; The first backbone network includes: a detection layer, an SPPF module and a CBAM module; The detection layers are connected to each other through a C3 module; the input end of the SPPF module is connected to the last detection layer, and the output end is connected to the CBAM module; The first neck network adopts FPN structure and PAN structure; The first head detection network includes an object detection branch and an object segmentation branch.

7. The seed screening method based on image recognition according to claim 1, characterized in that: The screening model includes: a second backbone network, a second neck network and a second head detection network; The second backbone network includes: a guiding module, an aggregation module, an SPPF module and a feature enhancement module; The second neck network includes: a guiding module, an aggregation module and an upsampling module; The second head detection network includes: a recognition module.

8. A seed screening system based on image recognition, the system being used to implement the method according to any one of claims 1 to 7, characterized in that: include: Acquisition system and model system; The acquisition system includes a first acquisition unit and a second acquisition unit; The first acquisition unit is used to acquire a training data set; The second acquisition unit is used to acquire a seed image to be detected and preprocess the seed image to obtain a preprocessed image; The model system is used to construct a training model, and train the training model based on the training data set to obtain a screening model; then the screening model is used to identify the preprocessed image to obtain a screening result.

Citation Information

Patent Citations

  • Wheat seed screening method based on CS-DNet lightweight model

    CN118470414A