Farmland weed detection method and system, and electronic device
By improving the YOLOv8 model and combining it with the RevColNet backbone network and lightweight design, the problems of high computational complexity and insufficient accuracy in farmland weed identification were solved, achieving efficient and accurate weed detection.
Patent Information
- Application Number
- PCT/CN2024/096052
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-04-22
- Filing Date
- 2024-05-29
- Publication Date
- 2025-10-30
AI Technical Summary
Existing technologies for identifying weeds in farmland suffer from high computational complexity, numerous model parameters, large model size, and insufficient recognition accuracy, making it difficult to achieve efficient and accurate weed detection.
An improved YOLOv8 model based on the RevColNet backbone network is adopted. By introducing a fusion expandable residual attention module, a depthwise separable convolution module, and an improved bounding box regression loss function, a lightweight weed detection model is constructed, which improves feature extraction capability and recognition accuracy.
While reducing computational complexity and the number of parameters, it improves the accuracy and efficiency of weed identification, achieving higher detection accuracy and lower computational cost, and is suitable for real-time scanning and detection of weeding robots.
Smart Images

Figure CN2024096052_30102025_PF_FP_ABST
Abstract
Description
Methods and systems for detecting weeds in farmland, and electronic equipment. Technical Field
[0001] This invention relates to the field of image recognition technology, and in particular to a method, system, and electronic device for detecting weeds in farmland. Background Technology
[0002] Weed control is one of the most crucial tasks in agricultural production. Weeds are incredibly resilient and can significantly impact crop yield and quality by competing with them for resources such as nutrients, water, and sunlight. Statistics show that annual grain losses due to weed infestations amount to approximately 13.2%, equivalent to the annual food supply for 1 billion people.
[0003] Currently, weed control is mainly achieved by spraying herbicides over large areas. This indiscriminate spraying leaves a large amount of pesticide residue on crops, which not only affects the normal growth of crops but also causes some damage to the ecological environment in the fields.
[0004] Accurate identification of field weeds and precise weed control play a significant role in increasing crop yields and reducing the environmental damage caused by pesticides. Therefore, weeding robots capable of accurately identifying and removing various weeds have gradually developed, achieving intelligent weed control and playing a crucial role in improving crop yields and reducing the environmental impact of pesticides. Traditional field weed detection methods mainly rely on manually designed features such as texture and shape, using methods such as wavelet analysis, Bayesian discriminant models, and support vector machines to detect the target. However, because manually designed features cannot adequately summarize the various information about weeds, these methods struggle to achieve high recognition accuracy on complex datasets.
[0005] In addition, the core processing equipment of weeding robots has limited computing and storage resources. Given the current problems of high computational complexity, large number of model parameters, and large model size of weeding robots, it is urgent (and absolutely necessary) to solve the problem of reducing the number of model parameters and computational complexity while ensuring the accuracy of weed identification.
[0006] Summary of the Invention
[0007] This invention provides a method, system, and electronic device for detecting weeds in farmland, which addresses the shortcomings of existing technologies in identifying weeds in farmland. These technologies cannot adequately describe various information about weeds, making it difficult to achieve high identification accuracy. Furthermore, they suffer from high computational complexity, a large number of model parameters, and a large model size. The solution proposed in this application provides an improved model based on YOLOv8, which can identify weeds in farmland with higher accuracy, lower computational complexity, and higher efficiency in weed identification.
[0008] This invention provides a method for detecting weeds in farmland, comprising:
[0009] Collect target images of farmland containing weeds;
[0010] A weed detection model was constructed using YOLOv8 based on the RevColNet backbone network, and weed identification was performed based on the weed detection model.
[0011] Precise removal of weeds.
[0012] The method for detecting weeds in farmland according to the present invention utilizes a YOLOv8 model based on the RevColNet backbone network to construct a weed detection model, including:
[0013] The YOLOv8 backbone network was reconstructed based on RevColNet to obtain a new backbone network RevCol.
[0014] A fusion-scalable residual attention module is introduced to improve the ability to identify occluded targets;
[0015] We introduce the GSConv module and VoV-GSCSPC module based on depthwise separable convolution to perform model lightweighting.
[0016] Based on the minimum point distance, we improve the bounding box regression loss function of the YOLOv8 model.
[0017] According to the method for detecting weeds in farmland provided by the present invention, the backbone network RevCol includes multiple columns, each column representing an input. The starting position of each column contains low-level detail information. As the image channel is compressed, high-level semantic information is extracted at the end of each column. A reversible connection design is adopted between columns to ensure that information is transmitted between columns without loss. At the same time, supervision is added at the end of each column to constrain the feature extraction of each column.
[0018] The method for detecting weeds in farmland provided by this invention integrates an expandable residual attention module for:
[0019] The data input to the weed detection model is subjected to a standard 3×3 convolution operation, and features are extracted by batch normalization and activation using an activation function.
[0020] After unfolding the 3×3 convolution, semantic residuals are obtained through a BN layer;
[0021] Connect all branches to the feature maps, and merge all feature maps using pointwise convolution to generate the final residual corresponding to the data input to the weed detection model;
[0022] The final residuals are fused with the input data to construct the final feature representation.
[0023] According to the method for detecting weeds in farmland provided by the present invention, the fused expandable residual attention module is configured with several channels, wherein the number of the hole depth convolution channel with the lowest void ratio is set to twice that of the other channels.
[0024] According to the method for detecting weeds in farmland provided by the present invention, the GSConv module is used for:
[0025] Based on the number of input channels, the first number of output channels is obtained through standard convolution;
[0026] Based on the first number of output channels, the second number of output channels is obtained through depthwise separable convolution;
[0027] The number of output channels is obtained by concatenating and shuffling the first and second output channel numbers.
[0028] The method for detecting weeds in farmland according to the present invention improves the bounding box regression loss function of the YOLOv8 model based on minimum point distance, including:
[0029] Determine the similarity between the predicted bounding box and the actual labeled bounding box during the bounding box regression process. Based on the similarity, calculate the key point distance between the predicted bounding box and the actual labeled bounding box to improve the accuracy of loss measurement.
[0030] The method for detecting weeds in farmland according to the present invention improves the bounding box regression loss function of the YOLOv8 model, including:
[0031] A scaling factor ratio is introduced to control the size of the auxiliary bounding box in order to calculate the loss.
[0032] When the value of ratio is set to greater than 1, an auxiliary bounding box with a larger scale relative to the actual bounding box is generated to calculate the loss.
[0033] When the value of ratio is set to less than 1, a smaller-scale auxiliary bounding box is generated to calculate the loss, so that the absolute value of the regression gradient is greater than the absolute value of the actual bounding box IoU gradient.
[0034] This invention also provides a system for detecting weeds in farmland, comprising:
[0035] The image acquisition module acquires target images of weeds in farmland;
[0036] The weed identification module uses YOLOv8 based on the RevColNet backbone network to build a weed detection model, and performs weed identification based on the weed detection model;
[0037] The weed removal module is used for precise removal of weeds.
[0038] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement any of the above-described methods for detecting weeds in farmland.
[0039] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described methods for detecting weeds in farmland.
[0040] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements any of the above-described methods for detecting weeds in farmland.
[0041] In this application, the backbone network of YOLOv8 is reconstructed based on RevColNet, which can improve the model's ability to extract features while reducing the computational complexity and number of parameters. When the improved weed detection model is used for weed identification, weeds in farmland can be identified with higher accuracy, and the computational complexity is lower, resulting in higher efficiency in weed identification. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0043] Figure 1 is a flowchart illustrating the method for detecting weeds in farmland provided in an embodiment of the present invention;
[0044] Figure 2 is one of the structural schematic diagrams of the weed detection model provided in an embodiment of the present invention;
[0045] Figure 3 is a second structural schematic diagram of the weed detection model provided in an embodiment of the present invention;
[0046] Figure 4 is a third structural schematic diagram of the weed detection model provided in the embodiment of the present invention;
[0047] Figure 5 is a fourth structural schematic diagram of the weed detection model provided in an embodiment of the present invention;
[0048] Figure 6 is the fifth structural schematic diagram of the weed detection model provided in the embodiment of the present invention;
[0049] Figure 7 is a schematic diagram of the structure of the weed detection model provided in the embodiment of the present invention;
[0050] Figure 8 is a structural schematic diagram of the weed detection model provided in an embodiment of the present invention;
[0051] Figure 9 is a structural schematic diagram of the weed detection model provided in an embodiment of the present invention;
[0052] Figure 10 is a schematic diagram of the structure of the farmland weed detection system provided in an embodiment of the present invention;
[0053] Figure 11 is a schematic diagram of the physical structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0054] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0055] With the rapid development of computer technology, convolutional neural networks have achieved good results in weed identification. In recent years, the YOLO series of deep learning models have been increasingly widely used in the field of object recognition, achieving superior performance compared to other models in multiple visual tasks. Therefore, some scholars have begun to apply the YOLO series models to the field of agricultural identification. Among them, Dong Hui et al. used an embedded SA module to optimize the feature extraction capability of the YOLOv4 model and improved the detection accuracy by optimizing the detection head. Guo Baizhang et al. proposed an improved YOLOv5 model that incorporates an attention mechanism and used stochastic gradient descent during model training, achieving accurate identification even when weeds and crops have high similarity. The latest detection model, YOLOv8, achieved an mAP50 of 92.1% and an mAP50-95 of 62.3% on the weed25 dataset.
[0056] Analysis reveals that while current weed identification models have achieved good detection accuracy, the core processing equipment of weeding robots has limited computing and storage resources. Therefore, they still face challenges such as high computational complexity, a large number of model parameters, and large model size. Further research is needed to reduce the number of model parameters and computational complexity while maintaining identification accuracy. This paper proposes an improved model based on the newly developed YOLOv8. This model uses an improved device fixed to the vision module of the weeding robot for real-time scanning and detection, and the positioning module returns the weed coordinates to achieve precise weed removal.
[0057] Figure 1 is a flowchart illustrating the method for detecting weeds in farmland provided in an embodiment of the present invention.
[0058] As shown in Figure 1, this embodiment provides a method for detecting weeds in farmland, including:
[0059] Step 101: Collect target images of farmland containing weeds;
[0060] Step 102: Construct a weed detection model using YOLOv8 based on the RevColNet backbone network, and identify weeds based on the weed detection model;
[0061] Step 103: Precisely remove the weeds.
[0062] YOLOv8 is a commonly used object detection model, but it still has many problems, such as low resolution of small object bounding boxes, dense distribution and easy overlap; small object detection is easily affected by image background and noise; and the loss for small object classification and localization is difficult to calculate. Therefore, the conventional YOLOv8 model cannot meet the task of weed detection. Based on this, the solution in this application improves the conventional YOLOv8 model based on RevColNet, which reduces the computational complexity and number of parameters of the model while improving the model's ability to extract features.
[0063] In practice, the backbone of the current YOLO series models is a top-down structure. During feature extraction, the information contained in the image will be lost to a certain extent, and the performance of the model will also suffer a certain loss. However, the RevColNet (Reversible Column Networks) used in this application is a reversible multi-column network with a multi-column structure.
[0064] In practical applications, the precise removal of weeds in step 103 can be achieved by accurately locating the weeds in coordinate form and controlling the weeding robot to remove them. In other words, the weed recognition model provided in this embodiment can ultimately output the coordinates of the weeds in the target image of the farmland.
[0065] In an exemplary embodiment, a weed detection model is constructed using YOLOv8 based on the RevColNet backbone network, including:
[0066] The YOLOv8 backbone network was reconstructed based on RevColNet to obtain a new backbone network RevCol.
[0067] A fusion-scalable residual attention module is introduced to improve the ability to identify occluded targets;
[0068] We introduce the GSConv module and VoV-GSCSPC module based on depthwise separable convolution to perform model lightweighting.
[0069] Based on the minimum point distance, we improve the bounding box regression loss function of the YOLOv8 model.
[0070] The solution in this embodiment has the following beneficial effects:
[0071] By redesigning the YOLOv8 backbone, the multi-scale fusion of feature information at different levels was enhanced, and the computational complexity and number of parameters of the model were significantly reduced by limiting the number of RevCol columns.
[0072] Introducing a fusion-scalable residual attention module can help the model more effectively fuse features from different levels, thereby improving the model's detection accuracy.
[0073] By introducing the GSConv and VoVGSCSPC modules, the number of model parameters and the model size are significantly reduced while ensuring the model's detection accuracy and generalization ability.
[0074] The bounding box regression loss function provided in this embodiment not only includes all relevant factors considered in existing loss functions, namely overlapping or non-overlapping regions, center point distance, and deviations in width and height, but also simplifies the calculation process. Furthermore, the improved bounding box regression loss function uses auxiliary bounding boxes to calculate the loss, which aids in sample regression. Ultimately, the proposed bounding box regression loss function effectively improves the model's detection accuracy.
[0075] In an exemplary embodiment, the backbone network RevCol includes multiple columns, each column representing an input. The starting position of each column contains low-level detail information, and as the image channels are compressed, high-level semantic information is extracted at the end of each column. A reversible connection design is adopted between columns to ensure that information is transmitted between columns without loss. At the same time, supervision is added at the end of each column to constrain the feature extraction of each column.
[0076] In practice, low-level details can be represented by low-level information, which usually refers to small details in the image, such as edges, corners, colors, pixels, gradients, etc. This information can be obtained through filters, SIFT, or HOG.
[0077] High-level semantic information can be represented by a feature, which is built on top of low-level information and can be used for the recognition and detection of the shape of targets or objects in images. It has richer semantic information and can be understood as information obtained by combining a series of information such as environmental information and texture information. This high-level semantic information can be used to make judgments in subsequent classification or detection.
[0078] Figure 2 is one of the structural schematic diagrams of the weed detection model provided in the embodiment of the present invention.
[0079] Figure 2 illustrates the macroscopic structure of RevColNet used in the scheme of this application. As shown in Figure 2, RevColNet adopts a multi-input design. The starting position of each column contains low-level information. With the compression of image channels, semantic information in the feature is extracted at the end of the column. The reversible connection design between columns ensures that the information is transferred between columns without loss. At the same time, supervision is added at the end of each column to constrain the feature extraction of each column.
[0080] Figure 3 is a second schematic diagram of the structure of the weed detection model provided in the embodiment of the present invention.
[0081] Figure 4 is the third structural schematic diagram of the weed detection model provided in the embodiment of the present invention.
[0082] Figures 3 and 4 illustrate the microstructure of RevColNet used in the scheme of this application, where each level module in Figure a performs feature extraction through downsampling and ConvNeXt, and Figure b shows the reversible connection design between columns.
[0083] In practical applications, the reversible connection design between columns in Figure b conforms to the calculation formulas (1) and (2): Xt=Ft(Xt-1,Xt-m+1)+γXt-m (1) Xt-m=γ -1 [Xt-Ft(Xt-1,Xt-m+1)] (2)
[0084] Formula (1) illustrates the interaction between each level in the second column, and the output is X. t It is determined by three inputs. The output of the previous level is X. t-1 The output of the next level in the previous column is X. t-m+1 The two outputs are through F t Operations adjust shape and output X from the previous column t-m To maintain consistency, the Ft() operation includes a fusion module and n convolutional modules, and finally the obtained features are multiplied by γ times X. t-m By performing the addition operation, Equation 2 demonstrates the reversibility of the network, ensuring lossless information transmission.
[0085] Figure 5 is the fourth structural schematic diagram of the weed detection model provided in the embodiment of the present invention.
[0086] Figure 5 illustrates the structure of a reconstructed backbone network, RevCol.
[0087] As shown in Figure 5, to avoid an overly bloated backbone network that increases model complexity and parameter count, the number of columns in RevCol can be set to 2. Simultaneously, the operations in the feature fusion module (Fusion Block) are restructured. For high-level semantic information, only one composite operation is performed to achieve downsampling: convolution, batch normalization, and activation function. For low-level detail information, convolution combined with upsampling replaces the original upsampling operation. Furthermore, the C2f module of YOLOv8 replaces the ConvNeXt module in the level module.
[0088] In practical applications, the aforementioned feature fusion module is a module in the backbone network that adjusts feature channels with different input sizes to the same output size.
[0089] In an exemplary embodiment, the fusion of the scalable residual attention module is used for:
[0090] The data input to the weed detection model is subjected to a standard 3×3 convolution operation, and features are extracted by batch normalization and activation using an activation function.
[0091] After unfolding the 3×3 convolution, semantic residuals are obtained through a BN layer;
[0092] Connect all branches to the feature maps, and merge all feature maps using pointwise convolution to generate the final residual corresponding to the data input to the weed detection model;
[0093] The final residuals are fused with the input data to construct the final feature representation.
[0094] Figure 6 is the fifth structural schematic diagram of the weed detection model provided in the embodiment of the present invention.
[0095] In practical applications, traditional YOLO series models, due to their multi-scale characteristics, perform poorly in recognizing occluded targets and are prone to misclassification. They also have certain shortcomings in small target detection. Therefore, this paper introduces a fused dilation-wise residual (DWR) module, applied to the deep layers of the network. The multi-branch structure is used to adapt to the receptive field requirements of different sizes in a layer. Its structure is shown in Figure 6. For the input feature map, a standard 3×3 kernel convolution operation is first performed, followed by batch normalization and ReLU layers to extract features. Since each output channel contains several small spatial regions that need to be refined, the entire output is a collection of these regions. Then, a depthwise 3×3 convolution is unfolded to extract semantic information from these regions. Then, a BN layer is used to obtain semantic residuals to further analyze the semantic information from the region features. Next, all branch feature maps are connected, and pointwise convolution is used to merge all feature maps to generate the final residual corresponding to the input feature map. Finally, the final residual and the input feature map are fused to construct a stronger and more comprehensive feature representation.
[0096] In an exemplary embodiment, the fused scalable residual attention module is configured with a plurality of channels, wherein the number of the hole depth convolution channel with the lowest hole rate is set to twice that of the other channels.
[0097] In practical applications, regardless of the stage, features extracted with small receptive fields are relatively important. Therefore, the number of convolutional channels with the lowest hole rate is set to twice that of other channels.
[0098] Figure 7 is a schematic diagram of the structure of the weed detection model provided in the embodiment of the present invention.
[0099] In an exemplary embodiment, inspired by the DWR module, a C2fDWR module is further designed in this embodiment, and its structure diagram is shown in Figure 7. In order to make up for the shortcomings of the model in occluded target recognition, the designed C2fDWR module replaces the C2f module of the reconstructed trunk RevCol in this embodiment, so that the performance of the model is further improved.
[0100] In an exemplary embodiment, the GSConv module is used for:
[0101] Based on the number of input channels, the first number of output channels is obtained through standard convolution;
[0102] Based on the first number of output channels, the second number of output channels is obtained through depthwise separable convolution;
[0103] The number of output channels is obtained by concatenating and shuffling the first and second output channel numbers.
[0104] Figure 8 is the seventh structural schematic diagram of the weed detection model provided in the embodiment of the present invention.
[0105] In practical applications, lightweight design is essential to better suit edge terminal devices. Lightweighting not only reduces computational resource costs but also improves detection speed. This embodiment uses depthwise separable convolution instead of traditional convolution modules. Unlike traditional convolution, depthwise separable convolution processes the feature layers of the input channels in layers, effectively reducing the computational burden associated with multi-channel systems. However, conventional depthwise separable convolution suffers from information loss between channels. Therefore, this paper introduces the GSConv lightweight convolution module based on depthwise separable convolution, whose main structure is shown in Figure 7. The number of input channels is C1, and the number of output channels is C2. First, based on the input channel number C1, a standard convolution is performed to obtain the first number of output channels. Then, the same number of channels, the second number of output channels, is obtained through depthwise separable convolution. Finally, the two results are concatenated and shuffled to obtain the final number of output channels. In other words, both the first and second output channel numbers are equivalent to half of the final number of output channels.
[0106] In this embodiment, GSConv enables the preservation of multi-channel information, reducing computational resources while improving the expressive power of image features.
[0107] Figure 9 is the eighth structural schematic diagram of the weed detection model provided in the embodiment of the present invention.
[0108] In an exemplary embodiment, Figure 9 illustrates the structure of a VoV-GSCSPC module. This embodiment discloses the introduction of a GSConv module into the Neck layer, replacing standard convolutions with GSConv to reduce the number of parameters and computational cost of the neck module. Furthermore, it utilizes the VoV-GSCSPC, a VoV cross-level partial network module based on GSConv and a lightweight bottleneck layer GSbottleneck, to replace the original model's CSP module, further improving the performance of YOLOv8.
[0109] In an exemplary embodiment, the bounding box regression loss function of the YOLOv8 model is improved based on the minimum point distance, including:
[0110] Determine the similarity between the predicted bounding box and the actual labeled bounding box during the bounding box regression process. Based on the similarity, calculate the key point distance between the predicted bounding box and the actual labeled bounding box to improve the accuracy of loss measurement.
[0111] In practical applications, the bounding box regression loss function used by the YOLOv8 model is CIou loss. CIou, based on DIou, incorporates the aspect ratio of the bounding box into the loss function, further improving regression accuracy. However, most BBR loss functions, represented by CIou, may have the same value under different prediction results, which reduces the convergence speed and accuracy of bounding box regression. Therefore, this embodiment introduces a novel loss function based on minimum point distance, MPDIou, as an improved bounding box regression loss function for the YOLOv8 model. It compares the similarity between the predicted bounding box and the actual labeled bounding box during the bounding box regression process. By directly calculating the keypoint distance between the predicted box and the ground truth box, it provides a more accurate loss measurement method. Specifically, the calculation formula for the loss function provided in this embodiment is as follows: LMPDloU = 1 - MPDIoU
[0112] Where A and B are the predicted bounding box and the ground truth bounding box, respectively, and w and h represent the width and height of the input image, respectively. and Let A represent the coordinates of the top-left corner and the bottom-right corner of A, respectively. and These represent the coordinates of the top left and bottom right corners of B, respectively.
[0113] In an exemplary embodiment, the improved bounding box regression loss function of the YOLOv8 model includes:
[0114] A scaling factor ratio is introduced to control the size of the auxiliary bounding box in order to calculate the loss.
[0115] When the value of ratio is set to greater than 1, an auxiliary bounding box with a larger scale relative to the actual bounding box is generated to calculate the loss.
[0116] When the value of ratio is set to less than 1, a smaller-scale auxiliary bounding box is generated to calculate the loss, so that the absolute value of the regression gradient is greater than the absolute value of the actual bounding box IoU gradient.
[0117] In practical applications, the scheme of this embodiment can further incorporate Inner IoU based on the aforementioned loss function MPDIou, proposing a new loss function InnerMPDIou as the model bounding box regression loss function. Specifically, Inner IoU differs from traditional improvement methods. By analyzing how using auxiliary bounding boxes of different scales to calculate the loss during the regression process can effectively accelerate bounding box regression, Inner IoU introduces a scale factor ratio to control the size of the auxiliary bounding box in calculating the loss. Typically, the value of the scale factor ratio ranges from [0.5, 1.5]. When the value of ratio is set to greater than 1, it generates an auxiliary bounding box with a larger scale than the actual bounding box to calculate the loss, which can expand the effective range of regression and provide some gain for the regression of low IoU samples. Conversely, when the value of ratio is set to less than 1, it generates an auxiliary bounding box with a smaller scale to calculate the loss, making the absolute value of the regression gradient greater than the absolute value of the actual bounding box IoU gradient, which is helpful for the regression of high IoU samples and accelerates convergence. The calculation formula for Inner MPDIouU is as follows: union = (w gt *h gt )*(ratio) 2 +(w*h)*(ratio) 2 -inter L InnerMPDIoU =L MPDIoU +IoU-IoU inner
[0118] On the weed25 dataset, compared to YOLOv8, the improved model proposed in this study reduces computational complexity by 35.8%, parameter count by 35.36%, and model size by 30.15%, while improving mAP50 and mAP50-95 values to 93.8% and 63.4%, respectively, and accuracy to 92.9%. The improved model outperforms the original YOLOv8 model in several aspects.
[0119] The detection system for farmland weeds provided by the present invention will be described below. The detection system for farmland weeds described below can be referred to in correspondence with the detection method for farmland weeds described above.
[0120] Figure 10 is a schematic diagram of the structure of the farmland weed detection system provided in an embodiment of the present invention.
[0121] As shown in Figure 10, the farmland weed detection system provided in this embodiment includes:
[0122] Image acquisition module 1001 acquires target images of weeds in farmland;
[0123] The weed identification module 1002 uses YOLOv8 based on the RevColNet backbone network to build a weed detection model and performs weed identification based on the weed detection model.
[0124] The weed removal module 1003 is used for precise removal of weeds.
[0125] The specific implementation method of the farmland weed detection system provided in this embodiment can be implemented with reference to the above embodiment, and will not be repeated here.
[0126] Figure 11 illustrates a schematic diagram of the physical structure of an electronic device. As shown in Figure 11, the electronic device may include: a processor 1110, a communication interface 1120, a memory 1030, and a communication bus 1140. The processor 1110, communication interface 1120, and memory 1130 communicate with each other via the communication bus 1140. The processor 1110 can call logical instructions from the memory 1130 to execute a method for detecting weeds in farmland. This method includes:
[0127] Collect target images of farmland containing weeds;
[0128] A weed detection model was constructed using YOLOv8 based on the RevColNet backbone network, and weed identification was performed based on the weed detection model.
[0129] Precise removal of weeds.
[0130] The weed detection model was obtained in the following way:
[0131] The YOLOv8 backbone network was reconstructed based on RevColNet to obtain a new backbone network RevCol.
[0132] A fusion-scalable residual attention module is introduced to improve the ability to identify occluded targets;
[0133] We introduce the GSConv module and VoV-GSCSPC module based on depthwise separable convolution to perform model lightweighting.
[0134] Based on the minimum point distance, we improve the bounding box regression loss function of the YOLOv8 model.
[0135] Furthermore, the logical instructions in the aforementioned memory 1130 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0136] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to perform the farmland weed detection method provided by the above-described methods, the method comprising:
[0137] Collect target images of farmland containing weeds;
[0138] A weed detection model was constructed using YOLOv8 based on the RevColNet backbone network, and weed identification was performed based on the weed detection model.
[0139] Precise removal of weeds.
[0140] The weed detection model was obtained in the following way:
[0141] The YOLOv8 backbone network was reconstructed based on RevColNet to obtain a new backbone network RevCol.
[0142] A fusion-scalable residual attention module is introduced to improve the ability to identify occluded targets;
[0143] We introduce the GSConv module and VoV-GSCSPC module based on depthwise separable convolution to perform model lightweighting.
[0144] Based on the minimum point distance, we improve the bounding box regression loss function of the YOLOv8 model.
[0145] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for detecting weeds in farmland provided by the methods described above, the method comprising:
[0146] Collect target images of farmland containing weeds;
[0147] A weed detection model was constructed using YOLOv8 based on the RevColNet backbone network, and weed identification was performed based on the weed detection model.
[0148] Precise removal of weeds.
[0149] The weed detection model was obtained in the following way:
[0150] The YOLOv8 backbone network was reconstructed based on RevColNet to obtain a new backbone network RevCol.
[0151] A fusion-scalable residual attention module is introduced to improve the ability to identify occluded targets;
[0152] We introduce the GSConv module and VoV-GSCSPC module based on depthwise separable convolution to perform model lightweighting.
[0153] Based on the minimum point distance, we improve the bounding box regression loss function of the YOLOv8 model.
[0154] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0155] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.
[0156] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting weeds in farmland, characterized in that, include: Collect target images of farmland containing weeds; A weed detection model was constructed using YOLOv8 based on the RevColNet backbone network, and weed identification was performed based on the weed detection model. The weeds were precisely removed.
2. The method for detecting weeds in farmland according to claim 1, characterized in that, The method of constructing a weed detection model using YOLOv8 based on the RevColNet backbone network includes: The YOLOv8 backbone network was reconstructed based on RevColNet to obtain a new backbone network RevCol. A fusion-scalable residual attention module is introduced, which improves the ability to identify occluded targets; We introduce the GSConv module and VoV-GSCSPC module based on depthwise separable convolution to perform model lightweighting. Based on the minimum point distance, we improve the bounding box regression loss function of the YOLOv8 model.
3. The method for detecting weeds in farmland according to claim 2, characterized in that, The backbone network RevCol includes multiple columns, each representing an input. The starting position of each column contains low-level detail information, and as the image channels are compressed, high-level semantic information is extracted at the end of each column. A reversible connection design is adopted between columns to ensure that information is transmitted between columns without loss. At the same time, supervision is added at the end of each column to constrain the feature extraction of each column.
4. The method for detecting weeds in farmland according to claim 2, characterized in that, The fusion-scalable residual attention module is used for: The data input to the weed detection model is subjected to a standard 3×3 convolution operation, and features are extracted by batch normalization and activation using an activation function. After unfolding the 3×3 convolution, semantic residuals are obtained through a BN layer; Connect all branches to the feature maps, and merge all feature maps using pointwise convolution to generate the final residual corresponding to the data input to the weed detection model. The final residual is fused with the input data to construct the final feature representation.
5. The method for detecting weeds in farmland according to claim 4, characterized in that, The fusion-scalable residual attention module is configured with several channels, wherein the number of the hole depth convolution channel with the lowest hole rate is set to twice that of the other channels.
6. The method for detecting weeds in farmland according to claim 2, characterized in that, The GSConv module is used for: Based on the number of input channels, the first number of output channels is obtained through standard convolution; Based on the first number of output channels, the second number of output channels is obtained through depthwise separable convolution; The first number of output channels and the second number of output channels are concatenated and shuffled to obtain the number of output channels.
7. The method for detecting weeds in farmland according to claim 2, characterized in that, The improved bounding box regression loss function for the YOLOv8 model based on minimum point distance includes: Determine the similarity between the predicted bounding box and the actual labeled bounding box during the bounding box regression process, and calculate the key point distance between the predicted bounding box and the actual labeled bounding box based on the similarity to improve the accuracy of loss measurement.
8. The method for detecting weeds in farmland according to claim 7, characterized in that, The bounding box regression loss function of the improved YOLOv8 model includes: A scaling factor ratio is introduced to control the size of the auxiliary bounding box in order to calculate the loss. When the value of ratio is set to greater than 1, an auxiliary bounding box with a larger scale relative to the actual bounding box is generated to calculate the loss. When the value of ratio is set to less than 1, a smaller-scale auxiliary bounding box is generated to calculate the loss, so that the absolute value of the regression gradient is greater than the absolute value of the actual bounding box IoU gradient.
9. A system for detecting weeds in farmland, characterized in that, include: The image acquisition module acquires target images of weeds in farmland; The weed identification module uses YOLOv8 based on the RevColNet backbone network to build a weed detection model, and performs weed identification based on the weed detection model; The weed removal module is used to precisely remove the weeds.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method for detecting farmland weeds as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Small target detection method and system for field corn weeds and application
CN117036950A
Cited By
Rice and crab target detection device and method for rice field complex scene pictures and training method of target detection network
CN121459392A
Wind power blade damage detection method for low-quality damage image
CN122048944A
A wind turbine blade damage detection method for low-quality damage images
CN122048944B