An edge-aware based lightweight boll detection method and system

By constructing a lightweight deep convolutional network with an edge-aware module, the problems of accuracy and real-time performance in cotton boll detection were solved, enabling accurate detection of unopened cotton bolls in complex farm environments and improving detection speed and accuracy.

CN116434012BActive Publication Date: 2026-02-06SHANDONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310494160.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-26
Publication Date
2026-02-06
Estimated Expiration
2043-04-26

AI Technical Summary

Technical Problem

Existing methods for detecting cotton bolls are difficult to meet the requirements of accuracy, lightweight design, and real-time operation in complex farm environments, especially when unopened cotton bolls are similar to background interference factors, which can easily lead to false detections and missed detections.

Method used

A lightweight deep convolutional network with an edge-aware module is constructed. By mining edge information through depth, the edge-aware module is used to mine and fuse edge information in the feature map. Combined with a lightweight convolutional method, feature fusion is performed to construct a cotton boll detection model.

Benefits of technology

It enables accurate detection of unopened cotton bolls in complex field environments, improving detection accuracy and speed. It is suitable for real-time tasks in real-world scenarios and has a certain degree of generalization and robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116434012B_ABST
    Figure CN116434012B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on edge perception's light cotton boll detection method and system, it is related to image processing technical field.Data set is obtained to construct, and training set and test set are divided;Depth convolution network with edge perception module is constructed, feature extraction is carried out to training set after processing using depth convolution network, and edge information is mined and fused using edge perception module;Afterwards, the final fusion feature map is obtained by convolution fusion to each layer feature map;Cotton boll detection model is obtained by training using the final fusion feature map, test set is used to test and correct cotton boll detection model, and the final cotton boll detection model is obtained;The image to be detected is detected using the final cotton boll detection model.The application constructs light depth convolution network with edge perception module, depth mines edge information, and accurately detects unopened cotton boll in farm in real time.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, and in particular to a light-weight boll detection method and system based on edge perception. BACKGROUND

[0002] The statements in this section merely provide background information related to the present application and do not necessarily constitute the prior art.

[0003] Cotton is one of the most important economic crops in the world, and cotton fiber is an important raw material for the textile industry, with a wide range of applications. The unopened boll stage is the most vigorous period of cotton growth and development, and its growth and development directly affect the yield of cotton. Therefore, the detection of unopened bolls is crucial for the prevention and control management of automated farms, and can provide a basis for management decisions, thereby improving the quality and efficiency of cotton production.

[0004] Currently, in the field of boll detection methods, there are mainly two types: traditional machine learning-based detection methods and deep learning-based detection methods. Traditional machine learning-based detection methods use image analysis and computer vision techniques to achieve boll detection, which can improve work efficiency and reduce errors caused by manual work. However, this method is not suitable for complex farm environments and the increasing demand for detection accuracy. With the development of artificial intelligence technology, deep learning-based detection methods have been widely used in target detection because they greatly improve detection accuracy compared to traditional image processing methods. At the same time, high-dimensional features in deep learning models have strong robustness and anti-noise and anti-missing capabilities after being processed by multiple layers of convolution, which can adapt to complex field environments.

[0005] However, detecting unopened bolls in natural fields is still a challenging task because green unopened bolls are smaller than cracked cotton, and their characteristics are similar to those of many background interference factors, including soil, stems, and leaves, so false positives and false negatives can easily occur. Existing deep learning models do not perform well in detecting targets with edge information similar to the background, and cannot meet the accuracy requirements in boll operations. At the same time, as the number of convolution layers increases in boll detection research using deep learning methods, some of the running efficiency is sacrificed. Therefore, existing methods cannot meet the accuracy, lightness, and real-time requirements of unopened boll detection in real-world scenarios. SUMMARY

[0006] To address the deficiencies in the prior art, the present application aims to provide a light-weight boll detection method and system based on edge perception, which constructs a light-weight deep convolutional network with an edge perception module, deeply mines edge information, and accurately detects unopened bolls in real time.

[0007] To achieve the above objectives, the present invention is implemented through the following technical solution:

[0008] The first aspect of this invention provides a lightweight cotton boll detection method based on edge perception, comprising the following steps:

[0009] Obtain original unopened cotton boll images and label them to form a labeled dataset;

[0010] The labeled dataset is divided into a training set and a test set. Data augmentation and preprocessing operations are performed on the training set.

[0011] A deep convolutional network with an edge-aware module is constructed. The deep convolutional network is used to extract features from the processed training set to obtain feature maps of four feature layers. The four feature layers are: the second feature layer, the third feature layer, the fourth feature layer, and the fifth feature layer.

[0012] The edge perception module is used to mine and fuse the edge information of the feature maps of the second and fifth feature layers to obtain the fused feature map of the fifth layer.

[0013] The feature maps from the third and fourth feature layers are convolved and fused with the fused feature map from the fifth layer to obtain the final fused feature map.

[0014] The cotton boll detection model is trained using the final fused feature map. The cotton boll detection model is then tested and corrected using a test set to obtain the final cotton boll detection model.

[0015] The final cotton boll detection model is used to detect unopened cotton bolls in the image to be detected.

[0016] Furthermore, the specific steps for data augmentation and preprocessing of the training set include:

[0017] The training set is augmented by adding brightness, noise, rotation, and flipping to obtain the augmented training set.

[0018] Images from the enhanced training set are randomly selected and processed using a mosaic method.

[0019] Furthermore, the specific steps for mining and fusing edge information from the feature maps of the second and fifth feature layers using the edge perception module to obtain the fused feature map of the fifth layer include:

[0020] The number of channels in the feature maps of the second and fifth feature layers is changed by convolution;

[0021] Enhancement processing is performed on the feature maps of the second and fifth feature layers after changing the number of channels;

[0022] The enhanced second feature layer feature map and the fifth feature layer feature map are integrated through a concatenation operation.

[0023] The attention mechanism is introduced to eliminate irrelevant feature interference of the integrated feature map, and a fifth layer fusion feature map is obtained.

[0024] Further, the specific steps of enhancing the second feature layer feature map and the fifth feature layer feature map after changing the number of channels respectively include:

[0025] The second feature layer feature map is subjected to edge information enhancement processing using a high-speed filter.

[0026] The fifth feature layer feature map is subjected to an upsampling operation, and the feature map after upsampling is subjected to receptive field expansion processing.

[0027] Further, the specific steps of performing convolution fusion on the third feature layer feature map, the fourth feature layer feature map, and the fifth layer fusion feature map to obtain the final fusion feature map are:

[0028] The third feature layer feature map, the fourth feature layer feature map, and the fifth layer fusion feature map are subjected to feature fusion of each layer respectively.

[0029] The third feature layer feature map, the fourth feature layer feature map, and the fifth layer fusion feature map after feature fusion are subjected to feature fusion using a feature pyramid, to obtain the final fusion feature map.

[0030] Further, the specific steps of performing feature fusion of each layer on the third feature layer feature map, the fourth feature layer feature map, and the fifth layer fusion feature map are:

[0031] The third feature layer feature map, the fourth feature layer feature map, and the fifth layer fusion feature map are subjected to feature fusion respectively using a synthetic fusion module.

[0032] The fifth layer fusion feature map is subjected to further feature fusion through a lightweight convolution method.

[0033] Further, the specific steps of training the final fusion feature map to obtain a cotton boll detection model are:

[0034] The final fusion feature map is predicted using a target detection algorithm.

[0035] The prediction result is subjected to score sorting and non-maximum suppression screening to calculate a loss value.

[0036] The training set is adjusted according to the loss value until a preset expectation is reached, to obtain a cotton boll detection model.

[0037] The second aspect of the present application provides a lightweight cotton boll detection system based on edge perception, comprising:

[0038] a data acquisition module configured to acquire an original unopened boll image, and to perform label annotation on the original unopened boll image to form a label data set;

[0039] a data preprocessing module configured to divide the label data set into a training set and a test set, and to perform data enhancement and preprocessing operations on the training set;

[0040] a feature extraction module configured to construct a deep convolutional network with an edge-aware module, and to perform feature extraction on the processed training set by using the deep convolutional network to obtain four feature layer feature maps; the four feature layers are a second feature layer, a third feature layer, a fourth feature layer and a fifth feature layer;

[0041] the edge-aware module is configured to perform edge information mining and fusion on the second feature layer and the fifth feature layer feature maps by using the edge-aware module to obtain a fifth layer fusion feature map;

[0042] a feature fusion module configured to perform convolution fusion on the third feature layer feature map, the fourth feature layer feature map and the fifth layer fusion feature map to obtain a final fusion feature map;

[0043] a model training module configured to perform training by using the final fusion feature map to obtain a boll detection model, to test and correct the boll detection model by using the test set, and to obtain a final boll detection model;

[0044] a boll detection module configured to perform unopened boll detection on an image to be detected by using the final boll detection model.

[0045] The third aspect of the present application provides a medium having a program stored thereon, the program being executed by a processor to implement the steps in the edge-aware based lightweight boll detection method according to the first aspect of the present application.

[0046] The fourth aspect of the present application provides a device including a memory, a processor and a program stored on the memory and executable on the processor, the processor executing the program to implement the steps in the edge-aware based lightweight boll detection method according to the first aspect of the present application.

[0047] The above one or more technical solutions have the following beneficial effects:

[0048] The application discloses a kind of based on edge perception's light cotton boll detection method and system, propose a kind of based on deep learning target detection algorithm, to realize the accurate detection of unopened cotton boll in farm in real-time task.The application constructs a light, for the edge information fuzzy problem depth convolution network.By using light main extraction network, the complexity of model is further reduced;Increase edge perception module, further excavate the edge information in bottom feature network;Introduce light convolution method, realize the light of feature fusion network.Based on edge perception's light cotton boll detection method is good in the detection and leaf extremely similar green unopened cotton boll, realizes the balance of speed and accuracy.At the same time, in complex field environment certain generalization and robustness, the method proposed is valuable for yield prediction and intelligent field management of cotton planting season, applicable to real-time task in real scene.

[0049] The advantages of the additional aspects of the application will be partly given in the following description, partly will become obvious from the following description, or be known by the practice of the application. BRIEF DESCRIPTION OF DRAWINGS

[0050] The drawings accompanying the specification of this application form a part thereof, serve to provide further understanding of the application, and together with the description, explain the application and do not limit the application.

[0051] Figure 1 Flow chart of the light cotton boll detection method based on edge perception in embodiment one of the application;

[0052] Figure 2 Structure framework diagram of the light cotton boll detection method based on edge perception in embodiment one of the application;

[0053] Figure 3 Structure schematic diagram of edge perception module in embodiment one of the application;

[0054] Figure 4 Synthetic fusion block feature fusion schematic diagram in embodiment one of the application. DETAILED DESCRIPTION

[0055] It should be noted that the following detailed description is exemplary, and is intended to provide further explanation of the application.Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the application belongs.

[0056] It should be noted that in the embodiments of the application, related data such as cotton boll images are involved, and when the above embodiments of the application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0057] It is to be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of example embodiments consistent with the present application. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, steps, operations, elements, components, and / or groups thereof, but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, and / or groups thereof.

[0058] Embodiment one:

[0059] The embodiment one of the present application provides a lightweight cotton boll detection method based on edge perception, as shown in the figure, comprising the following steps: Figure 1

[0060] Step 1, obtaining an original unopened cotton boll image, and performing label annotation on the original unopened cotton boll image to form a label data set.

[0061] Step 1.1, investigating three regions far apart, and collecting original unopened cotton boll images at 1-2 representative sampling points in each region, and the collection standard covers different environments, light and time conditions.

[0062] Step 1.2, performing label annotation on the collected original unopened cotton boll images to form a label data set for loss value calculation.

[0063] Step 1.3, randomly dividing the data set according to the ratio of 8:2.

[0064] Step 2, dividing the label data set into a training set and a test set, and performing data enhancement and preprocessing operations on the training set.

[0065] Step 2.1, the original image size is 1080x1440, in order to facilitate training, the size of the training set picture and label is scaled to 416x416 pixels.

[0066] Step 2.2, in order to prevent overfitting caused by too few images, the images are enhanced by increasing brightness, noise, rotation and flipping to improve the robustness of the algorithm, and the enhanced training set is obtained.

[0067] Step 2.3, randomly selecting 50% of the enhanced training set images for processing using the mosaic method, that is, by randomly cropping four arbitrary images and splicing them into one image as training data, effectively reducing the GPU occupancy.

[0068] Step 3, constructing a deep convolutional network with an edge perception module, using a deep convolutional network to extract features from the processed training set to obtain four feature layer feature maps.​

[0069] In one specific implementation, such as Figure 2 As shown, the four feature layers obtained are: the second feature layer, the third feature layer, the fourth feature layer, and the fifth feature layer. An edge-aware module is used to process the feature map of the fifth feature layer. A lightweight feature fusion network is used to fuse the feature maps of the third, fourth, and fifth feature layers. After prediction by a predictor, a cotton boll detection model is obtained. The final detection result is obtained by using the cotton boll detection model.

[0070] The second, third, fourth, and fifth feature layers are the effective feature layers in the feature extraction network, located in the middle, lower-middle, and bottom layers of the backbone, respectively, and contain a set of edge and semantic information. These effective feature layers are used to further extract features, which are then input into the feature fusion network for multi-scale fusion. The first feature layer, obtained through three convolutions, is mainly used to adjust image size and does not contain sufficient effective feature information; therefore, this embodiment does not operate on the first feature layer.

[0071] Step 3.1: Select MobileNetV3 as the feature extraction network to achieve lightweight extraction. The MobileNet network model consists of 13 convolutional layers, one average pooling layer, one fully connected layer, and one input / output layer. As its core, the convolutional layers of the MobileNet network model adopt depthwise separable convolution. Depthwise separable convolution mainly decomposes the standard convolution into depthwise convolution and pointwise convolution, improving computational efficiency by breaking the interconnection relationship between the output channel and the convolution kernel, and significantly reducing the amount of computation and model parameters.

[0072] An image of an unopened cotton boll with a size of 416×416 is input into the MobileNetV3 feature extraction network to obtain four feature layers: the second feature layer, the third feature layer, the fourth feature layer, and the fifth feature layer, with sizes of 104×104×128, 52×52×256, 26×26×512, and 13×13×1024, respectively.

[0073] Step 4, edge information of the second feature layer and the fifth feature layer feature map is mined and fused by using an edge perception module to obtain the fifth layer of fusion feature map. The edge perception module uses edge prior information as an effective auxiliary clue to enhance the edge visibility related to the object to promote feature learning. The edge perception module uses edge semantics to improve the performance of detection, and by integrating low-level edge information and high-level semantic information, the edge features of the target and the background are distinguished to greatly improve the mis-detection problem caused by sunlight reflection. In the convolutional neural network, the shallow feature map contains a large amount of edge information, but it is relatively rough, and the high-level feature map contains semantic information, but its edge feature is less. The edge perception module can fuse the characteristics of shallow features and high-level features, so that the features contain edge information and semantic information at the same time.

[0074] Step 4.1, the channel number of the second feature layer feature map and the fifth feature layer feature map is changed by convolution.

[0075] In a specific embodiment, first, two 1x1 convolutional layers are used to change the channel number of the second layer feature map and the fifth layer feature map, and the changed size is 104x104x64 and 13x13x256 respectively.

[0076] Step 4.2, the second feature layer feature map and the fifth feature layer feature map after changing the channel number are respectively subjected to enhancement processing.

[0077] Step 4.2.1, as shown in Figure 3 , the second feature layer feature map is subjected to edge information enhancement processing by using a normalized high-speed filter.

[0078] Step 4.2.2, the fifth feature layer feature map is subjected to upsampling operation, and the feature map after upsampling is subjected to receptive field expansion processing, that is, the receptive field module is applied to the fifth layer feature map after upsampling. The improved receptive field module includes five branches, the first branch passes through a 1x1 convolutional layer, and the next two layers are: 1x1 convolutional layer and 3x3 convolutional layer. The second branch passes through a 1x1 convolutional layer, and the next two layers are two 3x3 convolutional layers, and finally a dilated convolution with a dilated coefficient of 3 is used. The third branch passes through a 1x1 convolutional layer, and the next two layers are: 5x5 convolutional layer and 3x3 convolutional layer, and finally a dilated convolution with a dilated coefficient of 5 is used. The fourth branch passes through a 1x1 convolutional layer, and the next two layers are: 7x7 convolutional layer and 3x3 convolutional layer, and finally a dilated convolution with a dilated coefficient of 7 is used. After the first four branches are connected in series, the channel number is reduced by 1x1 convolution operation. Finally, the fifth branch (1x1 convolutional layer) is added, and the whole is input into the ReLU function to obtain the enhanced fifth layer feature to further expand the receptive field.

[0079] Step 4.3, the enhanced second feature layer feature map and the fifth feature layer feature map are integrated through a concatenation operation.

[0080] Step 4.4, an attention mechanism is introduced to eliminate irrelevant feature interference of the integrated feature map, to obtain a fifth layer fusion feature map.

[0081] Step 4.4.1, an attention mechanism is introduced to eliminate irrelevant feature interference of the integrated feature map.

[0082] Step 4.4.2, the feature map after eliminating irrelevant feature interference is passed through a 1x1 convolution layer.

[0083] Step 4.4.3, the convolutional feature map is output through a Sigmoid function to obtain the final fifth layer fusion feature map.

[0084] In a specific embodiment, the Sigmoid function has a value range of 0-1, and the formula and derivative are as follows:

[0085]

[0086]

[0087] wherein σ(z) represents the Sigmoid function formula, and z represents the input feature real value

[0088] Step 5, the third feature layer feature map, the fourth feature layer feature map and the fifth layer fusion feature map are convolved and fused to obtain the final fusion feature map.

[0089] This embodiment selects SFPN synthetic fusion pyramid network as the feature fusion network, and further improves it in a lightweight manner. The SFPN synthetic fusion pyramid network is a bidirectional feature fusion network, which can improve the accuracy of the lightweight backbone extraction network. SFPN adds a mesoscale feature map to make the transition between different scales smoother, achieving better target detection effect. SFPN proposes a synthetic fusion module (SFM),

[0090] The synthetic fusion module includes three optional inputs. First, linearly scale the three input features, specifically upsample by 1.5 and downsample by 0.75, then add pixel by pixel, and finally pass through a 3x3 convolution fusion.

[0091] The embodiment adopts SFM to construct intermediate layers, and a plurality of intermediate layers are generated between original layers. The synthetic fusion module includes one to three optional inputs. In the embodiment, the input data is a feature map with different proportions. First, the input feature map is linearly scaled, then pixel-by-pixel addition is performed, and finally 3*3 convolution fusion is performed. SFPN defines three SFMs as synthetic fusion blocks (SFBs), because each SFB undergoes a fusion operation of three input layers. SFB divides all the layers of the feature fusion network into two batches, as shown in Figure 4 Fig. 1. First, features are transmitted from the first batch of layers of the outer layer to the second batch of layers of the middle layer, and then from the second batch of layers to the first batch of layers of the outer layer. The synthetic fusion module of the middle layer can be regarded as a concentrated merging of features, and then radiates the features outward. SFPN is stacked by two SFBs. SFPN enhances the utilization of shallow features by channel connection from bottom to top, and retains more edge information of the unopened cotton boll image. The top-down path is used to extract semantic-rich features and combine them with accurate positioning information, and the intermediate layer is used to make the original layer retain more information for object representation. SFB integrates the top-down and bottom-up directions in the same block, so it can realize the concentrated merging and outward radiation of features. The addition of SFM makes the feature scale more continuous, because if the scale gap between the adjacent two layers of FPN is large, two objects with similar sizes will be predicted and classified into different layers. SFB contains multiple SFMs, which realizes the aggregation of feature layers with different scales, and the bidirectional network effectively transmits low-level semantic information and high-level semantic information, so it can effectively improve the accuracy.

[0092] Step 5.1, respectively, the third feature layer feature map, the fourth feature layer feature map and the fusion feature map of the fifth layer are fused.

[0093] Step 5.1.1, the third feature layer feature map, the fourth feature layer feature map and the fusion feature map of the fifth layer are fused by the synthetic fusion module.

[0094] The effective feature layers input into SFPN are three: the third feature layer feature map, the fourth feature layer feature map and the fusion feature map of the fifth layer. The three feature layers are located in the middle layer, the lower layer and the bottom layer of the backbone network, respectively.

[0095] In a specific embodiment, the spatial pyramid pooling (SPP) operation is first used on the fused fifth layer feature map, and a cross stage partial layer (CSPLayer) is introduced in the spatial pyramid pooling structure, thereby obtaining an intermediate feature layer P5. This module has a large residual edge auxiliary optimization to increase the receptive field and reduce the loss of target details. Then, P5 is adjusted by 1X1 convolution, and the three SFMs are used for feature fusion operation.

[0096] The fourth layer feature map is obtained after the lateral three lightweight SFMs, and another output feature layer F4 is obtained, with a size of 26x26x128.

[0097] The third layer feature map outputs the last feature layer F3, with a size of 52x52x64.

[0098] Step 5.1.2, further feature fusion is performed on the fifth layer fused feature map by a lightweight convolution method.

[0099] Specifically, the 3x3 convolution in the last step of SFM is replaced by a lightweight convolution method CSL cross-region lightweight convolution. The cross-region lightweight convolution method divides the input feature P5 into two branches. The first branch generates half of the redundant feature mapping with a size of 13x13x128, and the second branch first experiences two feature expansion modules to generate the other half of the necessary feature mapping. The feature expansion module includes three stacked depth separable convolution methods and a Mish activation function. Then, it experiences a depth separable method and a 1x1 convolution to adjust the channel number, so that the size is 13x13x128. Finally, the two branches are connected together to output the final feature map. CSL can generate redundant features from simple operations and use depth convolution instead of point-by-point convolution in the middle expansion stage to generate candidate features, which can significantly reduce the computational amount. Finally, one of the output feature layers F5 is obtained, with a size of 13x13x256.

[0100] Step 5.2, the feature pyramid can fuse features of different sizes, which is beneficial to extract better features. The feature pyramid is used to fuse the third feature layer feature map, the fourth feature layer feature map, and the fused feature map of the fifth layer, thereby obtaining the final fused feature map.

[0101] Step 6, the final fused feature map is used to train a cotton boll detection model, and the test set is used to test and correct the cotton boll detection model, thereby obtaining the final cotton boll detection model.

[0102] Step 6.1: Use an object detection algorithm to predict the final fused feature map.

[0103] This embodiment uses the Head structure of the YOLO one-stage object detection algorithm as the principle for prediction. In the YOLO prediction process, each feature point on each feature layer has three prior boxes. By splitting and decoding the feature map dimensions, multiple parameters can be obtained. These parameters can be divided into three parts: the first four parameters are used to determine the regression parameters for each feature point, and adjusting the regression parameters yields the predicted bounding box; the fifth parameter is used to determine whether each feature point contains an object; and the last parameter is used to determine the type of object contained in each feature point. Therefore, after score sorting and non-maximum suppression filtering, label assignment and loss calculation can be performed on the prediction results.

[0104] Step 6.2: Calculate the loss value by sorting the prediction results by score and filtering by nonmaximum suppression.

[0105] Step 6.2.1, similar to the prediction results, the loss value also consists of three parts: Reg, Obj, and Cls. The Reg part determines the regression parameters of the feature points, the Obj part determines whether the feature points contain objects, and the Cls part determines the types of objects contained in the feature points. After initially selecting positive samples, the SimOTA allocation strategy is used to optimize the anchor point selection process. The SimOTA cost formula is:

[0106]

[0107] in, This represents the regression loss between each sample and each ground truth bounding box. Calculate the classification loss between all ground truth bounding boxes and candidate bounding boxes, c ij Let represent the sample loss, and i and j represent the different relative coordinate positions of the predicted bounding boxes. SimOTA selects the k predictions with the lowest cost values ​​as its positive samples and assigns the corresponding grid cells to these predictions as positive, while assigning the remaining grid cells as negative. This dynamic advanced label assignment strategy greatly improves detection accuracy.

[0108] Step 6.2.2: Finally, calculate the network's loss value. First, obtain the prior box corresponding to each ground truth box, extract the predicted box corresponding to that prior box, and calculate the CIOU loss using the ground truth box and the predicted box to obtain the Loss value of the Reg part. Then, calculate the cross-entropy loss based on the prediction results of positive and negative samples and whether the feature points contain objects to obtain the Loss value of the Obj part. Finally, extract the category prediction result of each corresponding prior box, calculate the cross-entropy loss based on the category of the ground truth box and the category prediction result of the prior box to obtain the Loss value of the Cls part.

[0109] Step 6.3, adjust the training set according to the loss value until the preset expectation is reached to obtain a cotton boll detection model.

[0110] In a specific embodiment, the training and testing process operates on a GPU server, sets the stochastic gradient descent (SGD) momentum to 0.9, sets the initial learning rate to 0.01, sets the minimum learning rate to 0.0001, sets the weight decay to 0.0005, and adopts the cosine method for learning rate decay. The loss function adopts cross-entropy loss. The number of categories is set to 1 because there is only one target of unopened cotton bolls in the image. During the training process, due to the limitation of GPU memory, the batch size of the training is set to 8, and a total of 200 epochs are performed. A test is performed every time the training set is iterated once, and the test accuracy is output. After the training is completed, a trained model is obtained.

[0111] Step 7, using the final cotton boll detection model to detect unopened cotton bolls in the image to be detected. Randomly select an unopened cotton boll image and input it into the trained model to output a detection effect diagram. The diagram shows the position box, category name and average precision value.

[0112] Example Two:

[0113] The embodiment two of the present application provides a lightweight cotton boll detection system based on edge perception, comprising:

[0114] A data acquisition module configured to acquire original unopened cotton boll images, and label the original unopened cotton boll images to form a labeled data set;

[0115] A data preprocessing module configured to divide the labeled data set into a training set and a test set, and perform data enhancement and preprocessing operations on the training set;

[0116] A feature extraction module configured to construct a deep convolutional network with an edge perception module, and extract features from the processed training set using the deep convolutional network to obtain four feature layer feature maps; the four feature layers are: a second feature layer, a third feature layer, a fourth feature layer and a fifth feature layer;

[0117] An edge perception module configured to use the edge perception module to mine and fuse edge information of the second feature layer and the fifth feature layer feature maps to obtain a fifth layer fusion feature map;

[0118] A feature fusion module configured to convolve and fuse the third feature layer feature map, the fourth feature layer feature map and the fifth layer fusion feature map to obtain a final fusion feature map;

[0119] The model training module is configured to train the cotton boll detection model by using the final fusion feature map, test and correct the cotton boll detection model by using a test set, and obtain a final cotton boll detection model.

[0120] The cotton boll detection module is configured to detect the unopened cotton bolls in the image to be detected by using the final cotton boll detection model.

[0121] Embodiment three

[0122] Embodiment three of the present application provides a medium having a program stored thereon, which, when executed by a processor, implements the steps in the edge-aware lightweight cotton boll detection method according to embodiment one of the present application.

[0123] Embodiment four

[0124] Embodiment four of the present application provides a device comprising a memory, a processor, and a program stored in the memory and executable on the processor, wherein the processor implements the steps in the edge-aware lightweight cotton boll detection method according to embodiment one of the present application when executing the program.

[0125] The steps and methods involved in embodiments two, three and four above correspond to embodiment one, and the specific embodiments can be understood with reference to the relevant description of embodiment one. The term "computer-readable storage medium" should be understood to include a single medium or multiple media containing one or more instruction sets. It should also be understood to include any medium that can store, encode or carry instruction sets for execution by a processor and cause the processor to perform any of the methods in the present application.

[0126] Those skilled in the art should understand that the modules or steps of the present application described above can be implemented by a general computer device, and alternatively, they can be implemented by program codes executable by a computing device, so that they can be stored in a storage device for execution by a computing device, or they can be made into individual integrated circuit modules, or a plurality of modules or steps among them can be made into a single integrated circuit module. The present application is not limited to any specific combination of hardware and software.

[0127] The above describes the specific embodiments of the present application in conjunction with the accompanying drawings, but is not a limitation on the scope of protection of the present application. Those skilled in the art should understand that various modifications or variations made by those skilled in the art on the basis of the technical solutions of the present application without inventive labor are still within the scope of protection of the present application.

Claims

1. A lightweight cotton boll detection method based on edge perception, characterized in that, Includes the following steps: Obtain original unopened cotton boll images and label them to form a labeled dataset; The labeled dataset is divided into a training set and a test set. Data augmentation and preprocessing operations are performed on the training set. A deep convolutional network with an edge-aware module is constructed. The deep convolutional network is used to extract features from the training set after data augmentation and preprocessing to obtain feature maps of four feature layers. The four feature layers are: the second feature layer, the third feature layer, the fourth feature layer, and the fifth feature layer; The edge perception module is used to mine and fuse the edge information of the feature maps of the second and fifth feature layers to obtain the fused feature map of the fifth layer. The feature maps from the third and fourth feature layers are convolved and fused with the fused feature map from the fifth layer to obtain the final fused feature map. The cotton boll detection model is trained using the final fused feature map. The cotton boll detection model is then tested and corrected using a test set to obtain the final cotton boll detection model. The final cotton boll detection model is used to detect unopened cotton bolls in the image to be detected.

2. The lightweight cotton boll detection method based on edge perception as described in claim 1, characterized in that, The specific steps for data augmentation and preprocessing of the training set include: The training set is augmented by adding brightness, noise, rotation, and flipping to obtain the augmented training set. Images from the enhanced training set are randomly selected and processed using a mosaic method.

3. The lightweight cotton boll detection method based on edge perception as described in claim 1, characterized in that, The specific steps for mining and fusing edge information from the feature maps of the second and fifth feature layers using the edge perception module to obtain the fused feature map of the fifth layer include: The number of channels in the feature maps of the second and fifth feature layers is changed by convolution; Enhancement processing is performed on the feature maps of the second and fifth feature layers after changing the number of channels; The enhanced feature maps of the second and fifth feature layers are integrated through a cascading operation; An attention mechanism is introduced to eliminate irrelevant feature interference in the integrated feature map, resulting in the fused feature map of the fifth layer.

4. The lightweight cotton boll detection method based on edge perception as described in claim 3, characterized in that, The specific steps for enhancing the feature maps of the second and fifth feature layers after changing the number of channels include: The feature map of the second feature layer is processed with a high-speed filter to enhance edge information. The feature map of the fifth feature layer is upsampled, and the receptive field of the upsampled feature map is enlarged.

5. The lightweight cotton boll detection method based on edge perception as described in claim 1, characterized in that, The specific steps for convolutionally fusing the feature maps from the third and fourth feature layers with the fused feature map from the fifth layer to obtain the final fused feature map are as follows: Perform feature fusion on the feature maps of the third, fourth, and fifth layers respectively; The feature pyramid is used to fuse the feature maps of the third and fourth feature layers after feature fusion with the fused feature map of the fifth layer to obtain the final fused feature map.

6. The lightweight cotton boll detection method based on edge perception as described in claim 5, characterized in that, The specific steps for feature fusion of each layer—the feature map of the third feature layer, the feature map of the fourth feature layer, and the fused feature map of the fifth layer—are as follows: The feature maps of the third feature layer, the fourth feature layer, and the fused feature map of the fifth layer are fused using the synthesis and fusion module. The fusion feature map of the fifth layer is further fused using a lightweight convolution method.

7. The lightweight cotton boll detection method based on edge perception as described in claim 1, characterized in that, The specific steps for training the cotton boll detection model using the final fused feature map are as follows: The final fused feature map is predicted using an object detection algorithm; The loss value is calculated by sorting the prediction results by score and filtering by nonmaximum suppression; The training set is adjusted based on the loss value until the preset expectation is reached, thus obtaining the boll detection model.

8. A lightweight cotton boll detection system based on edge perception, characterized in that, include: The data acquisition module is configured to acquire raw, unopened cotton boll images and label them to form a labeled dataset. The data preprocessing module is configured to divide the label dataset into training and test sets, and perform data augmentation and preprocessing operations on the training set. The feature extraction module is configured to construct a deep convolutional network with an edge-aware module, and use the deep convolutional network to extract features from the training set after data augmentation and preprocessing to obtain feature maps of four feature layers. The four feature layers are: the second feature layer, the third feature layer, the fourth feature layer, and the fifth feature layer; The edge perception module is configured to mine and fuse edge information from the feature maps of the second and fifth feature layers to obtain the fused feature map of the fifth layer. The feature fusion module is configured to perform convolutional fusion of the feature maps of the third feature layer, the fourth feature layer, and the fusion feature map of the fifth layer to obtain the final fusion feature map; The model training module is configured to train the cotton boll detection model using the final fused feature map, and then test and correct the cotton boll detection model using a test set to obtain the final cotton boll detection model. The boll detection module is configured to use the final boll detection model to detect unopened bolls in the image to be detected.

9. A computer-readable storage medium, characterized in that, It stores multiple instructions, which are adapted to be loaded and executed by the processor of a terminal device, according to any one of claims 1-7, the lightweight cotton boll detection method based on edge perception.

10. A terminal device, characterized in that, The invention includes a processor and a computer-readable storage medium, the processor being used to implement various instructions; the computer-readable storage medium being used to store multiple instructions adapted to be loaded by the processor and executed by the processor for the edge-aware lightweight cotton boll detection method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Lightweight target detection method

    CN114120019A

  • Target detection network system and method applied to multi-sensor data fusion in rainy and snowy weather scene

    CN114140672A