A sugarcane tillering stage field weed identification and positioning method
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-19
- Publication Date
- 2026-08-11
AI Technical Summary
但现有目标检测与关键点定位网络多针对通用场景设计,未结合甘蔗田杂草的生长特征与田间环境特点,存在以下技术缺陷:一是特征提取网络的感受野有限,对小尺度、密集分布的杂草特征提取能力不足;二是多尺度特征融合效果差,无法有效兼顾不同尺寸杂草的特征信息;三是网络模型计算复杂度高,难以适配激光除草机器人的嵌入式算力设备;四是对遮挡、光照变化等复杂场景的鲁棒性差,杂草生长点定位精度低
Smart Images

Figure CN122551180A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of intelligent agricultural detection and precision weed control, and in particular to a method for identifying and locating weeds in the field during the sugarcane tillering stage. Background Technology
[0002] In the development of modern agriculture, precision agriculture technology is a core means to increase crop yields and reduce agricultural resource waste and environmental pollution. Sugarcane, as an important economic crop in southern my country, requires weed control in its fields as a key aspect of sugarcane planting and management. Currently, sugarcane field weeding mainly employs three methods: manual weeding, mechanical weeding, and chemical weeding. Manual weeding is inefficient and costly, making it difficult to meet the needs of large-scale planting. Mechanical weeding is only effective at removing weeds between rows, and weeding within rows can easily damage sugarcane seedlings, affecting sugarcane growth. Although chemical weeding is simple to operate and efficient, it leads to chemical residues, causing soil and water pollution, which contradicts the concept of sustainable agricultural development.
[0003] Laser weeding technology, as a novel precision weeding method, relies on the high energy density of lasers to precisely destroy the cellular structure of weeds, achieving non-contact weed removal. It boasts advantages such as being pollution-free, causing minimal damage to crops, and having high weeding efficiency, making it an important development direction for precision weeding in sugarcane fields. The core of laser weeding technology lies in the accurate identification of weeds in sugarcane fields and the high-precision positioning of weed growth points, providing precise spatial direction for laser output. However, the complex environment of sugarcane fields presents challenges such as mixed weed growth, real-time changes in light conditions, mutual shading between weeds and sugarcane seedlings, and dense weed growth, posing significant challenges to effectively distinguishing weeds from sugarcane seedlings and accurately locating weed growth points.
[0004] With the development of computer vision and deep learning technologies, target detection and key point localization algorithms based on deep convolutional neural networks have been widely used in agriculture. The YOLO series of algorithms, due to their combination of detection accuracy and real-time performance, have become the mainstream algorithms for field target detection. However, existing target detection and key point localization networks are mostly designed for general scenarios and do not take into account the growth characteristics of sugarcane field weeds and the characteristics of the field environment, resulting in the following technical defects: First, the receptive field of the feature extraction network is limited, and its ability to extract features from small-scale, densely distributed weeds is insufficient; second, the multi-scale feature fusion effect is poor, and it cannot effectively take into account the feature information of weeds of different sizes; third, the computational complexity of the network model is high, making it difficult to adapt to the embedded computing power of laser weeding robots; and fourth, it has poor robustness to complex scenarios such as occlusion and changes in lighting, resulting in low accuracy in locating weed growth points.
[0005] To address the aforementioned issues, there is an urgent need to design an independent network model specifically for identifying weeds and locating key growth points in sugarcane fields. Summary of the Invention
[0006] The purpose of this application is to provide a method for identifying and locating weeds in sugarcane fields during the tillering stage. By independently designing an RMB-YOLO network model, optimizing the backbone feature extraction, multi-scale feature fusion, and detection output structure of the network, and combining it with the construction of a dedicated dataset of sugarcane field weeds, the method can achieve accurate identification of weeds and sugarcane seedlings and precise location of weed growth points in complex sugarcane field environments. At the same time, the method achieves lightweight modeling to meet the deployment and real-time detection requirements of laser weeding robot embedded devices.
[0007] This application provides a method for identifying and locating field weeds during the sugarcane tillering stage, which adopts the following technical solution: including the following steps: Step 1: Collect field images of sugarcane during the tillering stage, label the sugarcane seedlings, weeds, and weed growth points in the collected images, and divide the labeled images into a dataset to obtain a training set, a validation set, and a test set; Step 2: Construct the RMB-YOLO weed identification and localization network model, which includes a backbone feature extraction network, a multi-scale feature fusion network, and a detection output network. Step 3: Input the training set into the RMB-YOLO weed recognition and localization network model for model training, and adjust the model parameters based on the validation set to obtain the target model after training; Step 4: Input the test set into the trained target model and output weed category information, target box location information, and weed growth point coordinate information.
[0008] Preferably, the backbone feature extraction network in step two includes a multi-level convolutional downsampling layer, a C2f_RepViT feature extraction module, a pooling layer, and an MLLA linear attention module. The multi-level convolutional downsampling layer uses a 3×3 standard convolution combined with a downsampling operation with a stride of 2 to achieve layer-by-layer downsampling of image features and shallow feature extraction. The C2f_RepViT feature extraction module is set at each scale stage of the backbone feature extraction network, using depthwise separable convolution to replace some standard convolutions, combined with a multi-branch topology structure with reparameterized structure, to achieve deep feature extraction and model lightweighting. The pooling layer uses multi-scale max pooling operation to expand the feature receptive field. The MLLA linear attention module is set at the feature interface before the pooling layer to enhance the key features of weeds and growth points and suppress background-irrelevant information.
[0009] Preferably, the C2f_RepViT feature extraction module includes a token mixer unit, a channel mixer unit, and a structure reparameterization unit; the token mixer unit is used to process the spatial dimension of the input features; the channel mixer unit is used to process the channel dimension of the input features; the structure reparameterization unit is used to construct a multi-branch convolutional structure during the model training phase, convert the multi-branch convolutional structure into a single-branch convolutional structure during the model inference phase, and merge the multi-branch structure into a single-branch 3×3 depth convolutional structure during the inference phase, thereby reducing computational overhead and memory usage.
[0010] Preferably, the MLLA linear attention module includes a gating unit, a position encoding unit, and a linear attention unit. The gating unit is used to perform gating filtering on the input features. The position encoding unit is used to add position information to the input features. The linear attention unit performs attention calculation on the input features using a linear accumulation method. It abandons the traditional quadratic complexity of global similarity calculation and uses advance gating to filter priority dependencies, suppressing redundant information in advance. At the same time, it introduces separate position encoding and local convolution to enhance local context modeling, and replaces the explicit attention matrix with linear accumulation. While maintaining the ability to capture long-distance dependencies, it reduces computation and memory access overhead. MLLA can pay more attention to important feature regions in the image, suppress interference from irrelevant information such as background, highlight the key features of occluded targets and small targets, and ensure the accuracy and speed of detection, meeting the requirements of actual field operations.
[0011] Preferably, the multi-scale feature fusion network in step two is a bidirectional feature pyramid network; the bidirectional feature pyramid network includes a top-down feature upsampling path and a bottom-up feature downsampling path; features of different scales are fused through upsampling, downsampling and feature splicing to achieve bidirectional information interaction of the 80×80, 40×40 and 20×20 scale feature maps output by the backbone feature extraction network, and at the same time, an adaptive weighting mechanism is used to assign adaptive weights to features of different scales to enhance the feature fusion effect of small-scale weeds and growth points.
[0012] Preferably, the detection output network in step two includes a classification branch, a bounding box regression branch, and a keypoint localization branch; the classification branch is used to output target category information; the bounding box regression branch is used to output target box position parameters; the keypoint localization branch is used to output weed growth point coordinate parameters; the classification branch uses a fully connected layer and a Softmax activation function to determine the category of weeds and sugarcane seedlings; the bounding box regression branch introduces the MPDIoU loss function to achieve accurate regression of the detection box. MPDIoU aims to provide an easy-to-implement solution by directly minimizing the keypoint distance between the predicted box and the ground truth box, and can comprehensively consider overlapping areas, center point distance, and deviations in width and height; the keypoint localization branch combines heatmap loss to predict the coordinates of key points of weed growth points. The calculation formula for MPDIoU is: The square of the diagonal of the top left prediction box: The square of the diagonal of the prediction box in the lower right corner: Calculate MPDIoU: .
[0013] Preferably, the sugarcane field weeds collected in step one include *Gnaphalium affine*, *Bidens pilosa*, *Raphanus sativus*, *Digitaria sanguinalis*, *Pharbitis nil*, *Cyperus rotundus*, and *Eleusine indica*. The collection scenarios include normal lighting, strong lighting, weak lighting, and occlusion scenarios. The first three are invasive species, and the latter four are common sugarcane field weeds. The multi-scene images cover normal lighting, strong lighting, and weak lighting conditions, as well as field environments with dense weeds, crop and weed occlusion, and mixed distribution of various weeds. Image acquisition uses a 3048×4060 resolution image acquisition device, with the shooting height at 50-70 cm above the ground. The detection box is marked using the minimum bounding rectangle of the target. The growth point is defined as the key point according to the weed species and growth stage. Image enhancement methods include multi-angle rotation, horizontal flipping, scaling, and brightness adjustment. Multiple methods are randomly combined. The dataset is divided into training set, validation set, and test set in a 7:2:1 ratio.
[0014] Preferably, in step three, the model training uses transfer learning to load pre-trained weights and uses the AdamW optimizer to update the model parameters. The training parameters are set as follows: input model image pixel size 640×640, batch size 16, training times 300 epochs, initial learning rate 0.001, optimizer is AdamW, momentum coefficient 0.937, weight decay coefficient 0.0005; the training environment is equipped with an NVIDIA GeForce RTX 5060 GPU and CUDA 12.8 acceleration environment, and the transfer learning strategy is used to load pre-trained weights to complete model initialization.
[0015] Preferably, in step four, the OKS metric is used to evaluate the coordinate information of weed growth points, and the model detection results are evaluated in conjunction with precision (P), recall (R), mean AP (mAP), and F1 score. OKS quantifies the matching degree of keypoint localization by calculating the normalized Euclidean distance between predicted keypoints and actual keypoints. The value is between 0 and 1, with a higher value indicating higher localization accuracy. The formula for calculating OKS is: in, Indicates the first of the marked key points One element; It is the Euclidean distance between the detected keypoint locations and the actual keypoint locations; s It is the scaling factor for the detected target, and its value is the square root of the area of the detection box of the detected target; It is the attenuation constant at the key point; It represents the visibility of the i-th keypoint (0 indicates unmarked, 1 indicates marked but not visible, and 2 indicates marked and visible). δ ( ) is an indicator function that takes the value 1 when the condition inside the parentheses is true, and 0 otherwise; while OKS is a function that is calculated only for the marked key points.
[0016] Preferably, the weight file of the RMB-YOLO network model can be converted into a file format that can be recognized by the embedded device and deployed on the Jetson Nano embedded computing device. This method is deployed in the vision system of the laser weeding robot. The embedded device transmits the coordinates of the key points of weed growth points output by the RMB-YOLO network model to the end effector of the laser weeding robot, providing precise pointing coordinates for laser output and realizing precise laser weeding in sugarcane fields.
[0017] In summary, this application includes at least one of the following beneficial technical effects: 1. This application addresses the complex environment of sugarcane fields and enables high-precision identification of weeds and sugarcane seedlings under conditions of dense weeds, crop shading, and changing light, significantly reducing missed detections and false detections; 2. This application effectively improves the detection capability of small-scale and densely distributed weeds by optimizing the feature extraction structure and multi-scale fusion mechanism; 3. This application introduces a regression constraint mechanism to achieve collaborative optimization between the detection frame and key points, thereby reducing positioning deviation and improving the positioning accuracy and stability of weed growth points; 4. This application enhances key features and suppresses background interference through an attention mechanism, enabling the model to maintain stable performance under occlusion and different lighting conditions; 5. This application reduces the computational complexity of the model through structural optimization, enabling it to maintain high accuracy while achieving high operating efficiency, thus meeting the requirements of real-time detection; 6. The model in this application can be deployed on embedded devices and provide high-precision positioning information for laser weeding, enabling green, efficient and precise weeding operations. Attached Figure Description
[0018] Figure 1 This is a flowchart of a method for identifying and locating field weeds during the sugarcane tillering stage, as described in this application. Figure 2 This is a technical roadmap for a method of identifying and locating field weeds during the sugarcane tillering stage, as described in this application. Figure 3 This is a dataset of weed species maps for a method of identifying and locating weeds in the field during the sugarcane tillering stage, as described in this application. Figure 4 This is a comparison of the identification and location effects of the sugarcane tillering stage field weed identification and location method of this application and traditional algorithms in complex environments; Figure 5 This is a comparison of the detection, identification, and location effects of the sugarcane tillering stage field weed identification and location method proposed in this application and traditional algorithms under different lighting conditions. Detailed Implementation
[0019] The present application will be further described in detail below with reference to the accompanying drawings.
[0020] Please see the appendix Figure 1 and attached Figure 2 This application provides a method for identifying and locating field weeds during the sugarcane tillering stage, comprising the following steps: Step 1: Obtain a dataset of sugarcane field weed images, simulate the working angle and shooting height of the laser weeding robot, and use a mobile terminal camera to collect images of sugarcane seedlings and common weeds in the tillering stage under multiple lighting and shading scenarios in the sugarcane field to build a basic dataset; Step 2: Preprocess the collected dataset and generate sample images for different scenes through image geometric transformation and illumination transformation. Use LabelMe tool to annotate the detection boxes for weeds and sugarcane seedlings and the key points of weed growth points. The annotation files are uniformly converted from JSON format to TXT format. The dataset is divided into training set, validation set and test set in a ratio of 7:2:1. Step 3: Construct an RMB-YOLO network model for sugarcane field weed detection. The network model includes a backbone feature extraction network, a multi-scale feature fusion network, and a detection output network. The backbone feature extraction network includes multi-level convolutional downsampling layers and a C2f_RepViT feature extraction module set at the multi-scale stage. This module adaptively adjusts the convolutional kernel weights based on local density changes in input features, enhancing the feature representation ability of individual weeds within the cluster. An MLLA linear attention module is added to the feature interface before the SPPF pooling layer to strengthen key features of weeds and growth points, addressing occlusion and dense small targets in real-world environments while suppressing background-irrelevant information. A weighted bidirectional feature fusion network (BiFPN) is constructed at the high-level feature output of the backbone network. Through top-down and bottom-up feature interaction paths, it balances the detection capabilities of both short and tall weeds. An MPDIoU regression constraint mechanism is introduced into the regression branch of the detection output network to enhance the morphological consistency between the detection bounding box and keypoint localization, reducing localization jitter in occluded and mixed scenes. Step 4: Train the RMB-YOLO model using the training set, and perform ablation comparison verification on the C2f_RepViT module, MLLA linear attention module and bidirectional feature fusion module based on the validation set to determine the impact of each module on the target detection results and key point localization results. After meeting the preset indicators, output the trained weight file in pt format and convert it to engine format for deployment on the Jetson Nano embedded device. Step 5: Deploy the laser weeding robot's execution control code on the embedded device, and simultaneously burn the weed growth point coordinate analysis and laser control code into the actuator control module; Step 6: Based on the real-time detection results of the RMB-YOLO model, the system records the weed species and growth point coordinates, and transmits the growth point coordinates to the execution system in sequence according to the weed ID through the TCP protocol. After receiving the coordinate information, the system adaptively controls the laser pointer to adjust the angle and accurately emit the laser according to the provided growth point position. In step three, the C2f_RepViT lightweight convolutional neural network integrates the efficient architecture design of lightweight ViT and gradually enhances the mobile-friendliness of the quasi-lightweight CNN (MobileNetV3). RepViT decouples spatial dependency modeling from channel feature transformation on top of CNN, moving the depthwise convolution up and the extended convolutional layer and projection layer down to separate them. Simultaneously, it employs structural reparameterization, introducing a multi-branch topology to the depthwise convolution during training to improve performance. During inference, the multi-branch structure of the depthwise convolution can be merged into a single-branch structure, eliminating the additional computational and memory costs associated with multiple branches. This allows the model to achieve high-precision visual task performance while maintaining low parameter count, low computational cost, and low memory footprint. It also possesses strong multi-task generalization ability and user-friendly training and deployment characteristics, enabling deployment on mobile and edge devices.
[0021] In step three, the linear attention module MLLA integrates the advantages of Mamba sequence modeling with the lightweight forward attention mechanism of the linear attention Transformer. Mamba is an efficient sequence modeling architecture based on a selective state-space model. Its core advantage lies in capturing long sequence dependencies with linear time complexity, balancing sequence modeling capabilities and computational efficiency. It can quickly process long-distance feature associations in images and adapt to the feature distribution characteristics of images in complex field scenarios. The linear attention Transformer is a lightweight optimization of the traditional Transformer self-attention mechanism. Its core is to retain the Transformer's ability to capture global feature associations through kernel function transformation or computational order reconstruction. Its lightweight design significantly reduces the computational and memory access overhead of the model, adapting to the hardware deployment requirements of field operation equipment. MLLA abandons the traditional quadratic complexity of global similarity calculation and uses forward gating to filter priority dependencies and suppress redundant information in advance. At the same time, it introduces separate positional encoding and local convolution to enhance local context modeling and replaces the explicit attention matrix with linear accumulation, reducing computational and memory access overhead while maintaining the ability to capture long-distance dependencies. MLLA can focus more on important feature regions in an image, suppress interference from irrelevant information such as background, highlight the key features of occluded targets and small targets, and ensure detection accuracy and speed, meeting the requirements of actual field operations. The relevant formulas for the design principle of MLLA are as follows: Priority gating and screening mechanism: Let represent the Sigmoid activation function, X represent the input features, and ⊙ represent the Hadamard product. The advance gating mechanism can suppress non-critical information in advance, reducing subsequent computation.
[0022] Separate position encoding: Indicates the embedding of the position in the height direction. This indicates a positional embedding design in the width direction, using a separate design. The separate positional encoding design adapts to the independent spatial distribution in the longitudinal and transverse directions of field images.
[0023] Linearized cumulative substitution for explicit attention matrix: MLLA uses a recursive approach to achieve attention-like accumulation without constructing an n×n matrix. Let Q be the query after position encoding and gating, K be the key, and V be the value. A kernel function is used... Then, the cumulative state formula is defined: Output: Only one cumulative matrix needs to be maintained each time. Avoid The attention matrix is not explicitly displayed throughout the process, significantly reducing memory access overhead and making it suitable for embedded field devices.
[0024] In step three, the Bidirectional Feature Pyramid Network (BiFPN) is an optimized and upgraded architecture of the traditional FPN. Its core features include efficient bidirectional feature interaction, simplified redundant structures, and enhanced fusion effects. It allows for full interaction between low-level localization information (including fine-grained information such as target location and edges, suitable for locating key points of small weeds and crops) and high-level semantic information (distinguishing between target and background, and weeds and crops). Through bidirectional pathways, these two elements are transmitted bidirectionally and complementarily enhanced, avoiding the information loss caused by the unidirectional transmission in traditional FPN. Simultaneously, BiFPN removes single-input edge nodes that contribute little to fusion to simplify the structure and reduce redundant computation. It also adds hierarchical shortcut connections to alleviate gradient vanishing, accelerate convergence, and reduce feature distortion. Furthermore, it introduces fast normalization fusion and adaptive weighting strategies (dynamically allocating weights to focus on effective weed features and suppress background interference). Through optimized bidirectional connections and fast normalization fusion, BiFPN achieves efficient multi-scale feature fusion with low computational cost and low parameter count. Its bidirectional information flow and weighting mechanism better coordinate features at different scales, improving the accuracy of locating small weeds and key points, and enhancing robustness to multi-scale targets. The formula for weighted calculation of feature fusion is as follows: The i-th layer of the backbone network output represents the original input features (i=3,4,5,6,7). This represents the intermediate fusion features of the top-down path. This represents the final output feature of the i-th layer; These are learnable weights used to adaptively weight features from different sources. For feature map resizing operations, spatial alignment of features at different levels is achieved through upsampling and downsampling. This is the convolutional operation after fusion, used to optimize feature representation; To ensure numerical stability, avoid having a denominator of 0.
[0025] In step six, the control principle of the laser output angle is as follows: First, the depth camera acquires images, and then the obtained images are transmitted to the embedded device for weed identification and growth point detection, thereby obtaining the two-dimensional coordinates of the growth points. The coordinates are then transformed by the depth camera to obtain the three-dimensional coordinates of the weed growth points. Finally, the coordinates are transmitted to the execution system via TCP protocol to control the laser pointer to adjust the angle and accurately emit the laser.
[0026] Specifically, the steps include the following: Step 1: Obtain a dataset of images of weeds in sugarcane fields. The main acquisition method simulates the shooting height and angle of a laser weeding robot. Images were captured in sugarcane fields at the Guangxi University Agricultural Science New City Agricultural Experiment Base using the rear camera of a Honor 90 smartphone (equipped with a Samsung ISOCELL HP3 image sensor, 3048×4060 color resolution). The camera was positioned 50-70 cm vertically above the ground during shooting. The dataset includes sugarcane seedlings in the tillering stage and seven common weeds in sugarcane fields: *Gnaphalium affine*, *Bidens pilosa*, *Raphanus sativus*, *Digitaria sanguinalis*, *Pharbitis nil*, *Cyperus rotundus*, and *Eleusine indica*. These seven weeds are major associated weeds in sugarcane fields and significantly harm the growth of sugarcane seedlings. The collected images cover three lighting conditions: normal light, strong light, and weak light. They also include complex field scenes such as dense weeds, sugarcane seedlings and weeds shading each other, and mixed distribution of various weeds, closely reflecting the actual operating environment of the laser weeding robot. Figure 3 As shown.
[0027] Step 2: Preprocessing of a portion of the collected dataset primarily involves data augmentation through random combinations of multi-angle rotation, horizontal flipping, scaling, and brightness adjustment. This simulates image features under different shooting angles and lighting conditions in the field, enhancing the model's generalization ability. The original images were manually annotated using the LabelMe tool, with annotations stored in JSON format. The annotations included bounding boxes for sugarcane seedlings and weeds, as well as key points for the growth points of different types and growth stages of weeds. The annotated files were then uniformly converted to TXT format suitable for model training. Finally, the annotated dataset was divided into training, validation, and test sets in a 7:2:1 ratio.
[0028] Step 3: Construct an RMB-YOLO network model for weed detection and growth point localization in sugarcane fields. The network model includes a backbone feature extraction network, a multi-scale feature fusion network, and a detection output network. The backbone feature extraction network includes multi-level convolutional downsampling layers and C2f_RepViT feature extraction modules set at multiple scale stages. These modules adaptively adjust the convolutional kernel topology based on local density changes in the input features, enhancing the feature representation ability for both clump-like and single-plant weeds, while also achieving model lightweighting. At the high-level feature output of the backbone feature extraction network, a multi-scale feature fusion network is constructed. Through a top-down feature pyramid path and a bottom-up path aggregation network, information interaction between features at different scales is achieved, simultaneously maintaining the detection and key point localization capabilities for both low-lying, small weeds and tall, clump-like weeds. In the localization regression branch of the detection output network, an MPDIoU regression constraint mechanism is introduced to enhance the morphological consistency constraint between the detection box and key point localization during model training, thereby reducing the deviation jitter between the detection box and key point localization under conditions of weed occlusion, species mixing, and lighting changes. The backbone feature extraction network includes a four-level 3×3 standard convolutional downsampling structure, and a C2f_RepViT feature extraction module is introduced at each scale stage. The C2f_RepViT module includes depthwise separable convolutional units and structure reparameterization units, which are used to adaptively adjust the convolutional kernel parameters and topology based on the local texture density changes of the input feature map. During the training stage, a multi-branch deep convolutional structure is used to enhance the joint modeling ability of the boundary features of the weed community and the fine-grained structure of the individual weeds. During the inference stage, it is merged into a single-branch structure to reduce computational overhead. The multi-scale feature fusion network is a weighted bidirectional feature pyramid network, including a top-down feature upsampling path and a bottom-up feature downsampling path. It integrates features at different scales through upsampling, downsampling, and concatenation, while introducing an adaptive weighting mechanism. This allows the model to simultaneously perceive the detailed features of small-scale weeds and their growth points, as well as the overall structural features of large-scale weeds. MPDIoU regression constraints are used during model training to provide dual constraints on the position and scale of the target detection box and the coordinate localization of weed growth points. This reduces errors in detection box offset and keypoint localization under conditions of weed occlusion, species mixing, and changing lighting, thereby improving localization accuracy and stability.
[0029] Step 4: Train the RMB-YOLO model using the labeled sugarcane field weed dataset. Set up a training environment with an NVIDIA GeForce RTX 5060 GPU and an AMD Ryzen 5 7500F CPU as the core. Set the training parameters such as input image size 640×640, batch size 16, and training epochs 300. Use the AdamW optimizer to iterate the model parameters. Convert the pt weight file obtained after training into an onnx file, then further into an engine file and deploy it in a Jetson Nano embedded device to meet the computing power requirements of the laser weeding robot.
[0030] Step 5: Deploy the laser output angle control code of the laser weeding robot in Jetson Nano, and simultaneously burn the code for receiving control signals from Jetson Nano and sending control signals from the laser actuator into Arduino Uno. This enables communication and linkage between the detection model and the laser actuator, ensuring that the weed growth point positioning results can be converted into precise laser output pointing instructions in real time.
[0031] Step Six: Based on the real-time detection results of the RMB-YOLO model, the system will record the species information and growth point coordinates of all weeds detected in the current frame. Simultaneously, the laser pointing control module communicates with the weed detection and positioning model, adjusting the laser output angle according to the coordinates of the weed growth points to achieve precise laser weed control. The system will continuously cycle through identifying sugarcane field weeds, locating growth points, and adjusting the laser output angle. This process maximizes the accurate identification and positioning of weeds between rows in sugarcane fields, reducing missed detections and positioning errors caused by dense weeds, shading, changes in light intensity, and undulating terrain.
[0032] Comparison of recognition and localization performance in complex environments: Considering actual field weed growth conditions, the model was tested under conditions of uneven weed density distribution, varying weed sizes, and target occlusion. Figure 4 As shown, a direct comparison of the detection results of YOLOv8 and RMB-YOLO is presented. Figure 4 As shown in (a), YOLOv8 misses some small and densely distributed weed targets. Figure 4 As shown in (b), RMB-YOLO successfully identifies weed species and locates key points in environments with dense weeds and weeds of varying sizes. Figure 4As shown in (c), in a scenario where sugarcane seedlings and weeds occlude each other, YOLOv8 failed to detect the weeds and their growth points, and could not identify the weeds obscured by the sugarcane seedlings. In contrast, RMB-YOLO successfully identified the weeds obscured by the sugarcane seedlings and accurately located the weed growth points. Furthermore, we tested the model's detection and keypoint localization capabilities under conditions of dense weeds and color block occlusion, such as... Figure 4 As shown in (d), RMB-YOLO successfully identified all the weeds obscured by color blocks and accurately located their growth points. A comparison of the detection results of YOLOv8 and RMB-YOLO shows that RMB-YOLO performs better in complex environments.
[0033] Comparison of detection, recognition, and localization performance under different lighting conditions: Considering that laser weeding robots need to operate under varying lighting conditions, incorporating variable lighting environment factors during model training and evaluation is crucial. To more accurately simulate the operational scenarios of agricultural robots, this study collected image data under different lighting conditions. Three data collection periods were set daily: 9:00–11:00, 13:00–15:00, and 17:00–19:00, corresponding to normal lighting, strong lighting, and weak lighting conditions, respectively. This diversified data collection strategy enhanced the model's robustness to different lighting conditions and improved its generalization ability in real-world scenarios. Figure 5 As shown in (a), under normal lighting conditions, both RMB-YOLO and YOLOv8 can detect weeds well and accurately locate key points of weeds. However, compared to YOLOv8, RMB-YOLO's average confidence score for weed detection is 2.35% higher. Under low lighting conditions, image brightness and contrast decrease significantly, which affects the model's detection performance. Figure 5 As shown in (b), YOLOv8 may miss detections when the target is small and the light is dim. Under strong lighting conditions, the image will produce overexposed and highlight areas, and introduce shadow noise, which weakens the color and texture information of the weeds. Figure 5 As shown in (c), compared to RMB-YOLO, YOLOv8 failed to detect sugarcane seedlings and exhibited a bias in growth point localization. In contrast, RMB-YOLO correctly classified weeds and sugarcane seedlings and accurately located their growth points. When light conditions change, images may show both direct light and shadow simultaneously, introducing shadow noise and weakening the weed characteristics in shadowed areas. Figure 5As shown in (d), YOLOv8 missed detecting one *Hemiberlesia lataniae* and mistook another for *Morning Glory*, with a clear deviation in keypoint localization. RMB-YOLO also exhibited slight deviations in detection, but its overall detection performance was significantly better than YOLOv8. In conclusion, RMB-YOLO demonstrated excellent detection performance under different light intensities, with confidence scores exceeding 0.8 for most weed detection frames, accurate growth point localization, and low false positive and false negative rates.
[0034] The embodiments described in this specific implementation are preferred embodiments of this application and are not intended to limit the scope of protection of this application. Identical components are represented by the same reference numerals. Therefore, all equivalent changes made to the structure, shape, and principle of this application should be covered within the scope of protection of this application.
Claims
1. A method for identifying and locating field weeds during the sugarcane tillering stage, characterized in that, Includes the following steps: Step 1: Collect field images of sugarcane during the tillering stage, label the sugarcane seedlings, weeds, and weed growth points in the collected images, and divide the labeled images into a dataset to obtain a training set, a validation set, and a test set; Step 2: Construct the RMB-YOLO weed identification and localization network model, which includes a backbone feature extraction network, a multi-scale feature fusion network, and a detection output network. Step 3: Input the training set into the RMB-YOLO weed recognition and localization network model for model training, and adjust the model parameters based on the validation set to obtain the target model after training; Step 4: Input the test set into the trained target model and output weed category information, target box location information, and weed growth point coordinate information.
2. The method for identifying and locating field weeds during the sugarcane tillering stage according to claim 1, characterized in that: The backbone feature extraction network described in step two includes multi-level convolutional downsampling layers, a C2f_RepViT feature extraction module, pooling layers, and an MLLA linear attention module; The multi-level convolutional downsampling layer is used to perform feature downsampling on the input image; The C2f_RepViT feature extraction module is positioned between feature layers of different scales; The MLLA linear attention module is located at the input of the pooling layer.
3. The method for identifying and locating field weeds during the sugarcane tillering stage according to claim 2, characterized in that: The C2f_RepViT feature extraction module includes a token mixer unit, a channel mixer unit, and a structure reparameterization unit. The token mixer unit is used to perform spatial dimension processing on the input features; The channel mixer unit is used to process the input features in the channel dimension. The structure reparameterization unit is used to construct a multi-branch convolutional structure during the model training phase and convert the multi-branch convolutional structure into a single-branch convolutional structure during the model inference phase.
4. The method for identifying and locating field weeds during the sugarcane tillering stage according to claim 2, characterized in that: The MLLA linear attention module includes a gating unit, a position encoding unit, and a linear attention unit. The gating unit is used to perform gating filtering on the input features; The location encoding unit is used to add location information to the input features; The linear attention unit performs attention calculations on the input features using a linear accumulation method.
5. The method for identifying and locating field weeds during the sugarcane tillering stage according to claim 1, characterized in that: The multi-scale feature fusion network described in step two is a bidirectional feature pyramid network; the bidirectional feature pyramid network includes a top-down feature upsampling path and a bottom-up feature downsampling path; features of different scales are fused through upsampling, downsampling and feature concatenation.
6. The method for identifying and locating field weeds during the sugarcane tillering stage according to claim 1, characterized in that: The detection output network in step two includes a classification branch, a bounding box regression branch, and a key point localization branch; the classification branch is used to output target category information; the bounding box regression branch is used to output target box position parameters; and the key point localization branch is used to output weed growth point coordinate parameters.
7. The method for identifying and locating field weeds during the sugarcane tillering stage according to claim 1, characterized in that: The sugarcane field weeds collected in step one include *Gnaphalium affine*, *Bidens pilosa*, *Raphanus sativus*, *Digitaria sanguinalis*, *Pharbitis nil*, *Cyperus rotundus*, and *Eleusine indica*. The data collection scenarios include normal lighting scenarios, strong lighting scenarios, weak lighting scenarios, and occluded scenarios.
8. The method for identifying and locating field weeds during the sugarcane tillering stage according to claim 1, characterized in that: The model training employs transfer learning to load pre-trained weights and uses the AdamW optimizer to update the model parameters.
9. The method for identifying and locating field weeds during the sugarcane tillering stage according to claim 1, characterized in that: In step four, the OKS index is used to evaluate the coordinate information of weed growth points, and the model detection results are evaluated in combination with precision (P), recall (R), mean precision (mAP), and F1 score.
10. A method for identifying and locating field weeds during the sugarcane tillering stage according to any one of claims 1-9, characterized in that: The RMB-YOLO network model is deployed on an embedded device, which is connected to the laser weeding robot actuator. The embedded device is used to send the coordinate parameters of the key growth point to the laser weeding robot actuator.