Rice panicle feature extraction method and computer storage medium

By incorporating the attention module, semantic segmentation module, and convolution module in the rice ear detection model, combined with the SIoU loss function and S-ASPP structure, the problems of complex backgrounds and occlusion in rice ear detection are solved, thereby improving the accuracy of rice detection and the ability to recognize multi-scale targets.

WO2026065976A1PCT designated stage Publication Date: 2026-04-02GUANGDONG OCEAN UNIVERSITY
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-03-19
Publication Date
2026-04-02

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately distinguish rice ears from the background in complex environments, and the occlusion of rice ears and multi-scale variations affect the accuracy of rice detection.

Method used

A rice ear detection model is adopted, including an attention module, a semantic segmentation module, and a convolution module. Rice ear features are extracted through convolution calculation, the model is trained using the SIoU loss function, and the feature extraction is optimized by combining the SA attention module and the S-ASPP structure.

Benefits of technology

It improved the accuracy of rice detection, optimized the detection of complex backgrounds and rice ear targets in the field, enhanced the detection capability of multi-scale targets, and reduced the false alarm rate and false negative rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025083423_02042026_PF_FP_ABST
    Figure CN2025083423_02042026_PF_FP_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of target detection. Provided are a rice panicle feature extraction method and a computer storage medium. The rice panicle feature extraction method comprises the steps of: acquiring a sampled rice panicle image; and then inputting the sampled rice panicle image into a pre-trained rice panicle detection model, in order to obtain a rice panicle feature extraction result, wherein the rice panicle detection model at least comprises an attention module and a semantic segmentation module, and the attention module and the semantic segmentation module are used for sequentially performing convolution calculation on the sampled rice panicle image, in order to obtain the rice panicle feature extraction result. On this basis, the present invention can ameliorate, on the basis of images acquired by an unmanned aerial vehicle, the problems of complex field backgrounds, rice panicle target occlusion, multi-scale targets, etc., thereby improving the detection accuracy for crops such as rice.
Need to check novelty before this filing date? Find Prior Art

Description

Rice ear feature extraction method and computer storage medium TECHNICAL FIELD

[0001] The present application relates to the technical field of target detection, in particular to a rice ear feature extraction method and a computer storage medium. BACKGROUND

[0002] In the prior art, in order to obtain crop information such as rice ears in the field, the unmanned aerial vehicle is used to obtain wheat ear information, and then a deep learning method is used to identify and / or detect the corresponding crop information. However, due to the complex background of the field planting of rice, for example, the presence of weeds similar to rice in the field, etc., it is difficult for the detection model based on deep learning to accurately distinguish between rice ears and the background. And due to the interference of the field planting environment, for example, the change of natural light conditions (overcast, sunny, morning or evening) affects the brightness or contrast of the target image, thereby increasing the recognition effect of the above detection model. At the same time, if the field is densely planted, the rice ears may overlap each other, affecting the accuracy of counting and identifying of the above detection model.

[0003] Therefore, there is an urgent need for a target detection scheme that can improve the detection accuracy of crops such as rice in a complex background. SUMMARY

[0004] In view of the above problems in the prior art, the present application provides a rice ear feature extraction method and a computer storage medium, which can optimize the problems of complex background in the field, rice ear target occlusion and multi-scale target, etc. on the basis of obtaining images by unmanned aerial vehicle, and improve the detection accuracy of crops such as rice.

[0005] In order to achieve the above-mentioned application purposes, the technical scheme adopted by the present application is as follows:

[0006] In a first aspect, the present application provides a rice ear feature extraction method, comprising:

[0007] obtaining a rice ear sampling image;

[0008] inputting the rice ear sampling image into a pre-trained rice ear detection model to obtain a rice ear feature extraction result; wherein the pre-trained rice ear detection model at least includes an attention module and a semantic segmentation module; the attention module and the semantic segmentation module are used to sequentially perform convolution calculation on the rice ear sampling image to obtain the rice ear feature extraction result.

[0009] Preferably, when the pre-trained rice ear detection model further includes a convolution module, the step of inputting the rice ear sampling image into the pre-trained rice ear detection model to obtain the rice ear feature extraction result includes:

[0010] performing convolution calculation on the rice ear sampling image by using the convolution module to obtain an initial feature image;

[0011] convolve the initial feature image by using the attention module to obtain a first feature image;

[0012] convolve the initial feature image and the first feature image by using the semantic segmentation module to obtain a panicle feature extraction result.

[0013] Preferably, the step of inputting the panicle sampling image into the pre-trained panicle detection model to obtain the panicle feature extraction result comprises the steps of:

[0014] constructing an initial panicle detection model;

[0015] obtaining a panicle sample image; and inputting the panicle sample image into the panicle detection model, training the initial panicle detection model by using a loss function to obtain the pre-trained panicle detection model; wherein the loss function is represented as:

[0016] wherein Loss SIoU is a total loss value, IoU is an intersection over union value, Δ is a distance loss value, and Ω is a shape loss value.

[0017] Preferably, when the initial feature image comprises a first convolution result, a second convolution result, and a third convolution result, the convolution module comprises a first convolution layer, a second convolution layer, and a third convolution layer connected in sequence; the step of convolving the panicle sampling image by using the convolution module to obtain the initial feature image comprises:

[0018] convolving the panicle sampling image by using the first convolution layer to obtain the first convolution result;

[0019] convolving the first image feature by using the second convolution layer to obtain the second convolution result;

[0020] convolving the second image feature by using the third convolution layer to obtain the third convolution result;

[0021] wherein the convolution kernel sizes corresponding to the first convolution layer, the second convolution layer, and the third convolution layer are all different.

[0022] Preferably, when the first feature image comprises a first feature parameter and a second feature parameter, the attention module comprises a first attention feature layer, a second attention feature layer, and a third attention feature layer connected in sequence; the step of convolving the initial feature image by using the attention module to obtain the first feature image comprises:

[0023] convolving the first convolution result by using the first attention feature layer to obtain the first feature parameter;

[0024] convolving the second convolution result by using the second attention feature layer to obtain the second feature parameter;

[0025] The first attention feature layer and the first attention feature layer correspond to different convolution kernel sizes.

[0026] Preferably, the convolution calculation formula of the first attention feature layer satisfies:

[0027] wherein s is a channel statistical feature vector; X k1 (i,j) is a branch under the (i,j) spatial dimension of the k1th input feature map X, i∈H, j∈W; H is the spatial height of the input feature map X, and W is the width of the input feature map X; is an average pooling function.

[0028] Preferably, when the convolution kernel of the first attention feature layer satisfies: 40*40*512, the convolution kernel of the second attention feature layer satisfies: 40*40*1024.

[0029] Preferably, when the semantic segmentation module comprises: a semantic segmentation layer, a feature fusion layer and a third attention feature layer connected in sequence; the step of performing convolution calculation on the initial feature image and the first feature image by using the semantic segmentation module to obtain the panicle feature extraction result comprises:

[0030] performing convolution calculation on the third convolution result by using the semantic segmentation layer to obtain the third feature parameter;

[0031] performing feature fusion on the third feature parameter, the second feature parameter and the first feature parameter in sequence by using the feature fusion layer to obtain the initial panicle feature extraction result;

[0032] performing convolution calculation on the initial panicle feature extraction result by using the third attention feature layer to obtain the final panicle feature extraction result;

[0033] The semantic segmentation layer comprises a plurality of convolution layers connected in sequence and having different deconvolution sampling rates.

[0034] Preferably, when the semantic segmentation layer further comprises a pooling layer, the step of performing convolution calculation on the third convolution result by using the semantic segmentation layer to obtain the third feature parameter comprises:

[0035] performing convolution calculation on the third convolution result in sequence by using the plurality of convolution layers to obtain the initial third feature parameter;

[0036] performing convolution on the initial third feature parameter by using the pooling layer to obtain the final third feature parameter.

[0037] In a second aspect, the present application also provides a computer storage medium, which comprises a stored program, wherein the program performs the rice panicle feature extraction method of any one of the first aspect when running.

[0038] Based on this, the rice panicle feature extraction method and the computer storage medium provided by the present application have the following beneficial effects:

[0039] A rice panicle feature extraction method, which comprises the following steps: obtaining a rice panicle sampling image; inputting the rice panicle sampling image into a pre-trained rice panicle detection model to obtain a rice panicle feature extraction result; wherein an attention module and a semantic segmentation module are used to sequentially perform convolution calculation on the rice panicle sampling image to obtain the rice panicle feature extraction result. Based on this, the present application can optimize the problems of complex background in the field, rice panicle target occlusion and multi-scale target, etc. on the basis of the image obtained by the unmanned aerial vehicle, and improve the detection accuracy of crops such as rice. BRIEF DESCRIPTION OF DRAWINGS

[0040] Fig. 1 is a step schematic diagram of a rice panicle feature extraction method provided by the present application;

[0041] Fig. 2 is a structural schematic diagram of a rice panicle detection model in the present application;

[0042] Fig. 3 is a step schematic diagram of a rice panicle feature extraction method provided by the present application;

[0043] Fig. 4 is a structural schematic diagram of a rice panicle detection model in the present application;

[0044] Fig. 5 is a step schematic diagram of a rice panicle feature extraction method provided by the present application;

[0045] Fig. 6 is a structural schematic diagram of a rice panicle detection model in the present application;

[0046] Fig. 7 is a step schematic diagram of a rice panicle feature extraction method provided by the present application;

[0047] Fig. 8 is a step schematic diagram of a rice panicle feature extraction method provided by the present application;

[0048] Fig. 9 is a structural schematic diagram of a rice panicle detection model in the present application;

[0049] Fig. 10 is a step schematic diagram of a rice panicle feature extraction method provided by the present application.

[0050] Fig. 10 is a step schematic diagram of a rice panicle feature extraction method provided by the present application. DETAILED DESCRIPTION

[0051] The specific embodiments of the present application are described below to facilitate the understanding of the present application for those skilled in the art, but it should be clear that the present application is not limited to the scope of the specific embodiments, and for those skilled in the art, it is obvious that various changes are within the spirit and scope of the present application defined and determined by the appended claims, and all the inventions utilizing the concept of the present application are within the scope of protection.

[0052] As described in the background, most of the existing unmanned aerial vehicles are combined to complete the research on crop ear recognition, but most of the research objects are wheat ears, because the morphological characteristics (including shape, size, density, etc.) of the upright ear crops such as wheat are relatively obvious. However, the rice plant is relatively high, and the leaves are dense, which causes the target and the background to be confused in the rice image, which brings difficulties to image analysis. And the mature rice ear will droop due to its own weight, so that there are more multi-scale changes in the rice ear when the unmanned aerial vehicle is shooting, which increases the detection difficulty.

[0053] In view of the above problems in the prior art, the present application provides a target detection scheme, which can improve the detection accuracy of crops such as rice in a complex background. That is, a rice ear feature extraction method and a computer storage medium are provided, which can optimize the problems of complex background in the field, rice ear target shielding and multi-scale target on the basis of obtaining images from unmanned aerial vehicle images, and improve the detection accuracy of crops such as rice.

[0054] In order to achieve the above-mentioned application purposes, the technical scheme adopted by the present application is:

[0055] In a first aspect, referring to FIG. 1, the present application provides a rice ear feature extraction method, comprising steps 110 to 140.

[0056] Step 110, obtaining a rice ear sampling image.

[0057] Step 140, inputting the rice ear sampling image into the pre-trained rice ear detection model to obtain a rice ear feature extraction result.

[0058] Referring to FIG. 2, the rice ear detection model 100 at least includes an attention module 101 and a semantic segmentation module 102 connected in sequence. The attention module and the semantic segmentation module are used to sequentially perform convolution calculation on the rice ear sampling image to obtain the rice ear feature extraction result. In one possible implementation manner, in the present embodiment, the attention module is used to perform convolution calculation on the rice ear sampling image to obtain an initial feature image. The semantic segmentation module is used to perform convolution calculation on the initial feature image to obtain the rice ear feature extraction result.

[0059] In this embodiment, an initial rice panicle detection model can be constructed first, and then rice panicle sample images, for example, rice panicle images with correct rice panicle detection results, are used as samples to train the initial rice panicle detection model by using a loss function to obtain a final rice panicle detection model.

[0060] Before step 140, steps 120 to 130 are further included, as shown in FIG. 3.

[0061] Step 120: constructing an initial rice panicle detection model;

[0062] Step 130: obtaining rice panicle sample images; inputting the rice panicle sample images into the rice panicle detection model, training the initial rice panicle detection model by using a loss function, and obtaining a pre-trained rice panicle detection model.

[0063] To improve the generalization ability of the rice panicle detection model and accelerate the convergence, the bounding box loss function of the rice panicle detection model is replaced with a SIoU loss function in this embodiment. In one possible implementation manner, the loss function is represented as:

[0064] wherein, Loss SIoU is a loss value, IoU is an intersection over union value, Δ is a distance loss value, and Ω is a shape loss value.

[0065] In this embodiment, the specific calculation process is represented as:

[0066] When the intersection of the predicted bounding box and the real bounding box is represented as A, and the union of the predicted bounding box and the real bounding box is represented as B, wherein:

[0067] (1) The angle loss (Angle cost) is represented as:

[0068] wherein, Λ is an angle loss value, c h is a height difference between the center points of the real bounding box and the predicted bounding box, and σ is a distance between the center points of the real bounding box and the predicted bounding box.

[0069] In one possible implementation manner, Based on this, the following can be obtained:

[0070] wherein, is a real bounding box center coordinate, is a predicted bounding box center coordinate.

[0071] (2) The distance loss (Distance cost) is determined according to the real bounding box center coordinate and the predicted bounding box center coordinate , and the distance loss satisfies:

[0072] wherein, Δ is a distance loss value, e is a constant, ρ x is a distance between the predicted bounding box center coordinate x and the real bounding box center coordinate x, and satisfies: ρ y is a distance between the predicted bounding box center coordinate y and the real bounding box center coordinate y, and satisfies: γ is a parameter for calculating distance cost, and satisfies: γ = 2-Λ.

[0073] (3) Shape cost, defined as follows

[0074] wherein, θ is a hyperparameter for controlling the weight of shape loss, (w, h) is the width and height of the predicted bounding box; (w gt ,h gt ) is the width and height of the real bounding box; w w is the absolute value of the difference between the width of the predicted bounding box and the width of the real bounding box, which can be normalized to the maximum value of the width of the real bounding box, and this width loss term will adjust the weight according to the size of shape loss Ω, so that the model converges to the correct prediction box size better, and satisfies: w h is the absolute value of the difference between the height of the predicted bounding box and the height of the real bounding box, which can be normalized to the maximum value of the height of the real bounding box, and satisfies: max(.) is the maximum value function; |.| is the absolute value function.

[0075] In this embodiment, the degree of attention to shape loss can be controlled, and θ is in the range of [2, 6] to avoid excessive attention to shape loss and reduce the movement of the predicted bounding box.

[0076] (4) IoU cost (IoU cost), satisfies:

[0077] wherein, IoU is the intersection over union value, A is the predicted bounding box, and B is the real bounding box. In one possible implementation, when the intersection over union value IoU is greater than or equal to 0.5, the model can obtain a better result.

[0078] Based on this, the overlap area between the detection frame of the rice field and the ground live frame can be considered, and the size difference between them is also considered, so that it has better stability under different scales of target features and is less affected by the size of the target feature. In addition, the SIoU loss function in the embodiment also considers the vector angle between the actual image frame and the image prediction frame, which can accelerate the convergence process by reducing the angle between the anchor frame and the GT frame in the horizontal or vertical direction. Since the SIoU Loss is relatively simple and has a small amount of calculation, it can reduce the time cost of training and inference, which helps to improve the efficiency of the model.

[0079] In one possible implementation, in order to improve the problems of complex background, dense and occluded rice panicles, and missed detection of small-scale rice panicles in the current detection of rice panicles using images taken by unmanned aerial vehicles, the YOLOv7 detection model is improved. First, through the attention module, such as the SA attention module, the rice panicle detection model pays more attention to important features related to rice panicle detection in the rice panicle image, thereby enhancing the feature representation capability and achieving fast and accurate detection of rice panicles in complex field environments. Then, based on the hollow convolution structure, a semantic segmentation module is proposed, which can be represented as an S-ASPP structure, to improve the multi-scale detection capability of the rice panicle detection model, greatly reduce the false positive rate, and effectively locate small rice panicles in the field, thereby more accurately detecting rice panicle targets of various scales.

[0080] In the embodiment, based on the YOLOv7 detection model, the convolution module is used to first extract the features of the rice panicle image. The attention module can be set at the end of the backbone extraction network of the YOLOv7 detection model. Then, the attention module is combined with the hollow convolutional neural network to obtain the semantic segmentation module. The initial features extracted by the convolution module are optimized by the attention module and the semantic segmentation module, respectively. Please refer to FIG. 4. The rice panicle detection model of the embodiment also includes a convolution module 103. The convolution module 103 is used to perform convolution calculation on the rice panicle sample image or the rice panicle sampling image to obtain an initial feature image. The attention module 101 is used to perform convolution calculation on the initial feature image to obtain a first feature image. The semantic segmentation module 102 is used to perform convolution calculation on the initial feature image and the first feature image to obtain a rice panicle feature extraction result.

[0081] Please refer to FIG. 5. When the initial feature image includes a first convolution result, a second convolution result, and a third convolution result, the convolution module includes a first convolution layer, a second convolution layer, and a third convolution layer connected in sequence. At this time, the step of performing convolution calculation on the rice panicle sampling image by the convolution module to obtain the initial feature image includes steps 210 to 230.

[0082] In step 210, the first convolution layer is used to perform convolution calculation on the rice panicle sampling image to obtain a first convolution result.

[0083] Step 220, performing convolution calculation on the first image feature by using a second convolution layer to obtain a second convolution result.

[0084] Step 230, performing convolution calculation on the second image feature by using a third convolution layer to obtain a third convolution result.

[0085] In the embodiment, please refer to FIG. 6, which shows a convolution structure diagram of the ear model. In the diagram, stage1 is the first convolution layer, stage2 is the second convolution layer, and stage3 is the third convolution layer. The first convolution layer stage1, the second convolution layer stage2, and the third convolution layer stage3 are connected in sequence. In a possible implementation manner, the first convolution layer stage1, the second convolution layer stage2, and the third convolution layer stage3 can be composed of a plurality of convolution layers connected in sequence. The convolution kernel sizes corresponding to the first convolution layer, the second convolution layer, and the third convolution layer are different.

[0086] Please continue to refer to FIG. 6. When the input ear image satisfies 640*640*3, the first convolution layer stage1 is composed of a convolution layer with a convolution kernel of 640*640*32, a convolution layer with a convolution kernel of 320*320*32, a convolution layer with a convolution kernel of 320*320*64, a convolution layer with a convolution kernel of 320*320*64, a convolution layer with a convolution kernel of 160*160*256, an MP (down-sampling module), and an E-ELAN (extended efficient layer aggregation network) module with a convolution kernel of 80*80*512, and the like in sequence. The second convolution layer stage2 is composed of an MP (down-sampling module) and an E-ELAN module with a convolution kernel of 40*40*1024, and the like in sequence. The third convolution layer stage3 is composed of an MP (down-sampling module) and an E-ELAN (extended efficient layer aggregation network) module with a convolution kernel of 20*20*1024, and the like in sequence. The E-ELAN module with a convolution kernel of 40*40*1024 is connected with the MP module in the third convolution layer stage3.

[0087] In the embodiment, please refer to FIG. 7. When the first feature image includes the first feature parameter and the second feature parameter, the attention module includes the first attention feature layer and the second attention feature layer connected in sequence. At this time, the step of performing convolution calculation on the initial feature image by using the attention module to obtain the first feature image includes steps 310 to 320.

[0088] Step 310, performing convolution calculation on the first convolution result by using the first attention feature layer to obtain the first feature parameter.

[0089] Step 320, convolve the second convolution result by using the second attention feature layer to obtain a second feature parameter.

[0090] The first attention feature layer and the first attention feature layer corresponding convolution kernel size are different.

[0091] In a possible implementation manner, the attention module can be an SA module, which combines spatial attention and channel attention, that is, the spatial attention is applied to the input feature map (each convolution result of the convolution module in the application), and then the channel attention is applied to the generated spatial manned feature map, and then the spatial attention and the channel attention are combined together by using Shuffle Units. The convolution calculation formula of the first attention feature layer and / or the second attention feature layer satisfies:

[0092] Wherein, s is a channel statistical feature vector; X k1 (i,j) is a branch under i x j spatial dimension of the k1th input feature map X, i∈H, j∈W; H is the spatial height of the input feature map X, and W is the width of the input feature map X; is an average pooling function.

[0093] Specifically, s is a channel statistical feature obtained by performing global average pooling on the input feature map X k1 . k1 (i,j) is a branch of the input feature map X k1 , used to generate a channel attention map. Wherein H x W represents the size of the spatial dimension, H represents the spatial height of the input feature map X, and W represents the width of the input feature map X, The input feature map X k1 is average-pooled along the spatial dimension (H x W) to obtain a channel statistical vector s. This vector s contains the mutual relationship information between channels, which can be used to generate a channel attention map.

[0094] The embodiment also creates a tight feature, which is selected accurately and adaptively by having a sigmoid activation function. Based on this, the final output X′ k1 of the channel attention is:

[0095] Wherein, and are parameters for scaling and moving s. X k1 is an enhanced function, and σ(.) is a sigmoid activation function, used to generate a channel attention map. X is a branch of the input feature map Xk, used to generate a channel attention map.

[0096] Similarly, the final output X' of the spatial attention k2 is represented as: X' = σ(W2·GN(X k2 +b2)·X k2 k2

[0097] wherein W2 and b2 are respectively a first parameter and a second parameter used for generating a spatial attention map; X k2 is a sub-feature of the input feature map X, which can be obtained through channel segmentation; and GN(.) is a spatial statistical function used for generating spatial statistical information of X k2 .

[0098] Based on this, the embodiment can enable interaction between each group of sub-features, so that the cross-group information flow can flow along the channel dimension, wherein the first attention feature layer and the second attention feature layer output feature parameters (specifically, feature images) of the same size, thereby reducing the above operation process and avoiding increasing the calculation cost.

[0099] In a possible implementation manner, when the convolution kernel of the first attention feature layer satisfies 40*40*512, the convolution kernel of the second attention feature layer satisfies 40*40*1024, based on which the channel of the feature transmission can be increased on the premise of guaranteeing the original feature transmission, so that more feature information is transmitted to the deep network. More shallow features can be transmitted to the deep layer, thereby preventing the risk of missing small rice panicles due to low contrast of the image and few pixels.

[0100] In the embodiment, please refer to FIG. 8, when the semantic segmentation module includes a semantic segmentation layer, a feature fusion layer and a third attention feature layer, the step of performing convolution calculation on the initial feature image and the first feature image by using the semantic segmentation module to obtain the first feature image includes steps 410 to 430.

[0101] Step 410, performing convolution calculation on the third convolution result by using the semantic segmentation layer to obtain third feature parameters.

[0102] Step 420, sequentially performing feature fusion on the third feature parameters, the second feature parameters and the first feature parameters by using the feature fusion layer to obtain initial rice panicle feature extraction results.

[0103] Step 430, performing convolution calculation on the initial rice panicle feature extraction results by using the third attention feature layer to obtain final rice panicle feature extraction results.

[0104] wherein the semantic segmentation layer includes a plurality of convolution layers with different deconvolution sampling rates.

[0105] ​In this embodiment, in order to enhance the attention to the sample area of the dense small target and further improve the positioning accuracy of the dense small target under mutual occlusion, the ASPP (Atrous Spatial Pyramid Pooling) structure of the multi-scale receptive field technology is used to replace the SPPCSPC structure in this paper. ASPP is a module commonly used in semantic segmentation tasks, mainly used to capture context information at different scales. Compared with using only one large dilation rate, using various dilation rates will more significantly reduce the impact of environmental factors and enhance the background data at multiple scales to help detect small objects, so that multi-scale context information can be extracted to avoid small target loss. At the same time, the atrous convolution in ASPP can share parameters, reducing the parameter amount of the model and reducing the risk of overfitting.

[0106] Referring to FIG. 9, the ASPP structure includes four convolution layers connected in turn: among them, the 1x1 convolution reduces the dimension of the input; the convolution layer with padding of 6, dilation of 6, and kernel size of 3x3 is convolved; the convolution layer with padding of 12, dilation of 12, and kernel size of 3x3 is convolved; the convolution layer with padding of 18, dilation of 18, and kernel size of 3x3 is convolved; and the third feature parameter is obtained.

[0107] Further, referring to FIG. 10, the third convolution result is convolved and calculated using a semantic segmentation layer to obtain the third feature parameter, and the steps include steps 510 to 520.

[0108] Step 510, the third convolution result is convolved and calculated using multiple convolution layers in turn to obtain the initial third feature parameter.

[0109] Step 520, the initial third feature parameter is convolved using a pooling layer to obtain the final third feature parameter.

[0110] After obtaining the third feature parameter, the input is pooled to 1x1 using a pooling layer with the size of the input, and then reduced in dimension using a 1x1 convolution, and finally up-sampled back to the original input size to obtain the final third feature parameter.

[0111] Subsequently, on the basis of the third feature parameter, a SA module is added, that is, a ShuffleAttention attention mechanism is embedded after the 1x1 Conv, which divides the target pixel points and other pixel points, thereby enhancing the attention to the dense small target area, reducing the effective feature loss, and suppressing the confused feature expression.

[0112] The embodiment also provides an ablation experiment, using YOLOv7 as the baseline of the ablation experiment, and using a preset data set as an experimental data set to evaluate the influence of various improved components in the RP-YOLO. Four groups of ablation experiments NO.1-NO.4 are made, and the advantages and disadvantages and effects of various improvement strategies are compared through comparison experiments. The data parameters are shown in Table 1.

[0113] Table 1

[0114] From the table, it can be seen that after adding the attention module to the YOLOv7 algorithm, the model detection mAP0.5 is improved to 96.47%, which shows that the insertion of the SA module reduces the missed detection of the YOLOv7 algorithm due to the failure to extract the features of small rice ears. Switching the SPPCSPC module to the S-ASPP module, it can be seen from the table that the S-ASPP has a more significant impact on the detection of rice ear targets, mainly because the traditional downsampling can increase the perception field but reduce the spatial resolution, while using the cavity convolution can expand the perception field while ensuring the resolution, and different expansion rates will bring different perception fields to the network, allowing the model to capture multi-scale context information. From the data, the application of the SIoU loss function also significantly improves the value of mAP 0.5:0.95, because when predicting the boundary regression, since the SIoU considers the overlapping area, the center distance and the aspect ratio of the two frames, the final detection accuracy is better. Therefore, this method is more comprehensive and comprehensive, and is more suitable for the training process.

[0115] In a second aspect, the present application also provides a computer storage medium, which comprises a stored program, wherein the program runs to execute the rice ear feature extraction method of any one of the above-mentioned first aspect.

[0116] In summary, the present application provides a rice ear feature extraction method, which acquires a rice ear sampling image; then inputs the rice ear sampling image into a pre-trained rice ear detection model to obtain a rice ear feature extraction result; wherein the rice ear detection model at least includes an attention module and a semantic segmentation module. The attention module is used for convolution calculation on the rice ear sampling image to obtain an initial feature image. The semantic segmentation module is used for convolution calculation on the initial feature image to obtain the rice ear feature extraction result. Based on this, the present application can optimize the problems of complex background in the field, rice ear target occlusion and multi-scale target, etc. on the basis of unmanned aerial vehicle image acquisition image, and improve the detection accuracy of crops such as rice.

[0117] The principles and implementation manners of the present application are described by using specific examples in the present application, and the above examples are only used for helping to understand the method of the present application and its core idea; meanwhile, for the ordinary skilled in the art, according to the idea of the present application, the specific implementation manners and application ranges can be changed, and the above description should not be understood as the limitation of the present application.

[0118] Those skilled in the art will appreciate that the examples described herein are presented for purposes of aiding the reader in understanding the principles of the present application and are not intended to limit the scope of the present application to such specifically recited examples and features. Various modifications and alterations of the present application are possible and within the scope of the present application as set forth in the appended claims.

Claims

1. A method of extracting a rice panicle feature, characterized by, The method comprises: acquiring a rice panicle sampling image; inputting the rice panicle sampling image into a pre-trained rice panicle detection model to obtain a rice panicle feature extraction result; wherein the pre-trained rice panicle detection model at least comprises an attention module and a semantic segmentation module connected in sequence; the attention module and the semantic segmentation module are used for sequentially performing convolution calculation on the rice panicle sampling image to obtain the rice panicle feature extraction result; when the pre-trained rice panicle detection model further comprises a convolution module, the step of inputting the rice panicle sampling image into the pre-trained rice panicle detection model to obtain the rice panicle feature extraction result comprises: performing convolution calculation on the rice panicle sampling image by using the convolution module to obtain an initial feature image; performing convolution calculation on the initial feature image by using the attention module to obtain a first feature image; performing convolution calculation on the initial feature image and the first feature image by using the semantic segmentation module to obtain the rice panicle feature extraction result; the step of inputting the rice panicle sampling image into the pre-trained rice panicle detection model to obtain the rice panicle feature extraction result comprises the step of: constructing an initial rice panicle detection model; An image of a rice panicle sample is acquired, and the image of the rice panicle sample is input into a rice panicle detection model. An initial rice panicle detection model is trained using a loss function to obtain a pre-trained rice panicle detection model. The loss function is represented as: wherein Loss SIoU is the total loss value, IoU is the intersection over union value, Δ is the distance loss value, and Ω is the shape loss value.

2. The rice panicle feature extraction method according to claim 1, characterized in that, when the initial feature image comprises a first convolution result, a second convolution result and a third convolution result, the convolution module comprises a first convolution layer, a second convolution layer and a third convolution layer connected in sequence; the step of performing convolution calculation on the rice panicle sampling image by using the convolution module to obtain the initial feature image comprises: performing convolution calculation on the rice panicle sampling image by using the first convolution layer to obtain the first convolution result; performing convolution calculation on the first image feature by using the second convolution layer to obtain the second convolution result; performing convolution calculation on the second image feature by using the third convolution layer to obtain the third convolution result; wherein the convolution kernel sizes corresponding to the first convolution layer, the second convolution layer and the third convolution layer are all different.

3. The rice panicle feature extraction method according to claim 2, characterized in that, when the first feature image comprises a first feature parameter and a second feature parameter, the attention module comprises a first attention feature layer, a second attention feature layer and a third attention feature layer connected in sequence; the step of performing convolution calculation on the initial feature image by using the attention module to obtain the first feature image comprises: performing convolution calculation on the first convolution result by using the first attention feature layer to obtain the first feature parameter; performing convolution calculation on the second convolution result by using the second attention feature layer to obtain the second feature parameter; wherein the convolution kernel sizes corresponding to the first attention feature layer and the first attention feature layer are all different.

4. The rice panicle feature extraction method according to claim 3, characterized in that, The convolution calculation formula of the first attention feature layer satisfies: wherein s is a channel statistical feature vector; X k1 (i,j) is a branch under the (i,j) spatial dimension of the k1th input feature map X, i∈H, j∈W; H is the spatial height of the input feature map X, and W is the width of the input feature map X; is an average pooling function.

5. The rice panicle feature extraction method according to claim 3, characterized in that, when the convolution kernel of the first attention feature layer satisfies 40*40*512, the convolution kernel of the second attention feature layer satisfies 40*40*1024.

6. The rice panicle feature extraction method according to claim 3, characterized in that, when the semantic segmentation module comprises a semantic segmentation layer, a feature fusion layer and a third attention feature layer connected in sequence; the step of performing convolution calculation on the initial feature image and the first feature image by using the semantic segmentation module to obtain the rice panicle feature extraction result comprises: perform convolution calculation on the third convolution result by using the semantic segmentation layer to obtain a third feature parameter; perform feature fusion on the third feature parameter, the second feature parameter and the first feature parameter in sequence by using the feature fusion layer to obtain an initial panicle feature extraction result; perform convolution calculation on the initial panicle feature extraction result by using the third attention feature layer to obtain a final panicle feature extraction result. The semantic segmentation layer comprises a plurality of convolution layers connected in sequence and having different deconvolution sampling rates.

7. The rice panicle feature extraction method according to claim 6, characterized in that, When the semantic segmentation layer further comprises a pooling layer, the step of performing convolution calculation on the third convolution result by using the semantic segmentation layer to obtain a third feature parameter comprises: perform convolution calculation on the third convolution result in sequence by using a plurality of convolution layers to obtain an initial third feature parameter; perform convolution on the initial third feature parameter by using a pooling layer to obtain a final third feature parameter.

8. A computer storage medium, characterized in that The computer storage medium comprises a stored program, wherein the program performs the panicle feature extraction method of any one of claims 1 to 7 when executed.

Citation Information

Patent Citations

  • Image semantic segmentation method and system and computer storage medium

    CN111523546A

  • Field rice spike positioning identification method based on unmanned aerial vehicle image and deep learning

    CN118097465A

  • Rice yield disaster loss assessment method based on high-resolution remote sensing image

    CN118692073A

  • Rice ear feature extraction method and computer storage medium

    CN118864874A

  • Determining Cereal Grain Crop Yield Based On Cereal Grain Trait Value(s)

    US20220121919A1