Farmland navigation path extraction method based on affiliation filtering strategy
By adopting a method based on affiliation filtering strategy in farmland navigation path extraction, the navigation path of corn crop rows is extracted using the RS-YOLOv8 model and clustering algorithm, the problem of characteristic points being susceptible to environmental changes in the existing technology is solved, and high-precision and real-time navigation path extraction is achieved.
Patent Information
- Application Number
- CN202510301900.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-14
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2045-03-14
AI Technical Summary
The existing feature points extracted based on canopy detection frames are susceptible to environmental changes, resulting in low accuracy of navigation path extraction and long calculation time, making it difficult to process in real time.
The farmland navigation path extraction method based on the affiliation filtering strategy was adopted, and corn plants and roots were detected through the RS-YOLOv8 lightweight model. The affiliation filtering algorithm was designed to screen the root detection box, and the center point at the bottom of the root detection box was extracted as feature points. The clustering algorithm was used to divide the crop ridges, and the navigation path was fitted through the least squares method.
It improves the accuracy and real-time performance of navigation path extraction, reduces calculation time, ensures the reliability of route information, and adapts to navigation needs in complex farmland environments.
Smart Images

Figure CN120236180A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition, and in particular to a method for extracting a farmland navigation path based on a subordinate relationship filtering strategy. Background Art
[0002] To improve agricultural production efficiency, intelligent agricultural equipment has gradually become a key technical means in modern agriculture. Among them, the autonomous operation ability of agricultural robots is particularly important, and accurate navigation technology is the core guarantee for realizing their efficient autonomous operation.
[0003] Currently, the research on navigation technology mainly focuses on two major fields: satellite navigation and visual navigation. Satellite navigation uses the GPS system to provide positioning and path planning for agricultural machinery. However, in a complex farmland environment, the GPS signal is easily blocked and cannot well meet the real-time requirement. To address the limitations of satellite navigation technology, visual navigation technology has gradually become a research hotspot. Visual navigation technology obtains environmental information in real time through a camera, extracts path features from a complex environment, and provides accurate navigation data for agricultural machinery. As an important visual cue in the environment, the navigation path has become the focus of research. In the field of navigation path extraction, many researchers have explored through traditional image processing techniques and made certain progress. The navigation paths extracted by these methods can meet the actual farmland operation requirements in terms of both accuracy and angular error, but generally have the problems of long calculation time and difficulty in real-time processing.
[0004] In recent years, the rise of deep learning technology has provided a new solution for visual navigation. The visual navigation technology based on convolutional neural network has the ability to efficiently extract crop row information, is significantly superior to traditional image processing methods in terms of computational efficiency, and can meet the accuracy requirements in practical applications, showing higher reliability and practicability, and is gradually replacing traditional image processing methods. Most of the existing crop row detection methods based on deep learning rely on extracting feature points from canopy detection frames and then extracting navigation paths. This method has some limitations. First, due to the lateral deviation between the corn canopy and the root system position, the agricultural machinery is likely to crush crops when driving automatically. Second, interference in the natural environment (such as wind, light changes, etc.) may cause fluctuations in the position of feature points, affecting the accuracy of the navigation path. In addition, when the edge of the captured image shows incomplete plants, the deviation between the feature points extracted based on the canopy detection frame and the real feature points is more significant, which will have a great impact on the extraction of the navigation path. The fundamental reason for these problems is that the canopy feature points are easily affected by environmental changes and their positions are unstable. Therefore, it is necessary to optimize them to cope with the interference brought by environmental changes to the feature points and the extraction of the navigation path. Summary of the Invention
[0005] The technical solution of the present invention to solve the above technical problems is to provide a method for extracting farmland navigation paths based on a subordination relationship filtering strategy, including the following steps:
[0006] Step 1, establish a dataset of corn crop rows in multiple growth environments, use annotation tools to annotate corn plants and their roots, and perform data augmentation on the dataset;
[0007] Step 2, detect plants and roots through the lightweight RS-YOLOv8 model;
[0008] Step 3, based on the subordination relationship filtering algorithm of the detection frames of corn plants and roots, screen the root detection frames that overlap with the plant detection frames, and eliminate isolated misdetection frames;
[0009] Step 4, according to the filtered detection frames, extract the region of interest (ROI) through the region screening algorithm, including determining the key detection frames, connecting the key points to form a boundary line, and filling the interference regions;
[0010] Step 5: Extract the center point at the bottom of the root detection frame as a feature point, use the clustering algorithm to divide the crop ridges, and fit the crop row lines within the ROI by the least squares method to extract the navigation path.
[0011] Further, in step 2, based on the YOLOv8 model, the RS-YOLOv8 model is constructed. The improved parts include:
[0012] Add a tiny detection head module in the detection head to improve the small target detection ability, and replace the loss function with PIoU2;
[0013] Introduce a lightweight edge aggregation module (DBA), a C2f_SCAA module, and an optimized GAM module in the neck network to enhance edge feature extraction, multi-scale perception, and anti-interference capabilities;
[0014] Use the hierarchical adaptive sparsity pruning algorithm (LAMP) to perform lightweight processing on the model.
[0015] Further, the C2f_SCAA module replaces the original Bottleneck structure by cascading two CS_CAA modules. The CS_CAA module includes channel shuffle, context anchor point attention, and dilation convolution branches, and is used to strengthen multi-scale feature interaction;
[0016] The optimized GAM module adds a 1×1 pointwise convolution in the output stage to reduce redundant features;
[0017] The DBA module uses depthwise separable convolution to replace the standard convolution to reduce the computational complexity.
[0018] Further, in step 1, during annotation, multiple adherent plants are labeled as a whole, and the root detection box focuses on the root area near the ground surface;
[0019] Data augmentation includes horizontal flipping, noise addition, and motion blur processing.
[0020] Further, in step 3, the specific steps of the subordinate relationship filtering algorithm include:
[0021] Classify the detection boxes into class A (seedling) and class B (root), and regard class B as the subordinate object;
[0022] Judge whether there is an intersection between the class B detection box and any class A detection box. If there is an intersection, retain it; otherwise, eliminate it;
[0023] The judgment condition for the intersection is that there are overlapping regions in both the horizontal and vertical directions of the two detection boxes.
[0024] Further, in step 4, the region screening algorithm includes:
[0025] Divide the image into the left and right sides according to the center point position of the seedling detection box, and select the key detection boxes near the center line and the bottom edge on the left and right sides;
[0026] Connect the corner points of the key detection boxes to form a boundary line, extend the boundary line until it intersects with the image edge, and fill the area outside the boundary line as the interference area.
[0027] Further, in step 5, the feature point coordinates (x0, y0) are converted from the coordinates of the root detection box, and its conversion formula is as follows:
[0028] x0 = x center ;
[0029]
[0030] where, (x center , y center ) represents the center point coordinates of the root detection box of this corn plant, and height represents the height of the detection box;
[0031] Use the K-means algorithm to cluster the feature points, and the same cluster corresponds to one crop ridge;
[0032] Fit the crop row lines on the left and right sides by the least squares method, and calculate the connecting line of the top and bottom intersection points as the navigation path.
[0033] The technical solution of the present invention uses the Labelimg tool to label corn plants and their roots; a lightweight RS-YOLOv8 model is proposed based on YOLOv8n, which realizes model lightweight while improving the detection performance of the network model for small-size targets such as corn plant roots; a filtering algorithm based on the subordinate relationship of the detection frames of corn plants and their roots is designed to filter out the isolated root misdetection frames that do not conform to the actual position in the model prediction results; a region screening algorithm for extracting the region of interest (ROI) based on the filtered prediction results is designed to screen out the regions of interest related to the navigation task and eliminate the interference regions that do not contain navigation information; the center point at the bottom of the root detection frame is extracted as a feature point, and the feature points of the same crop ridge are clustered using a clustering algorithm, and the crop row line within the ROI is fitted by the least squares method, and finally the navigation path is extracted. The present invention aims at the problem that the feature points extracted based on the detection frames of the plant canopy are vulnerable to environmental interference, resulting in fluctuations in the positions of the feature points and thus affecting the extraction accuracy of the navigation path. It is proposed to extract high-quality feature points that are not easily affected by the environment through the root detection frame, and then fit the navigation path to ensure the reliability of the route information. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on the structures shown in these drawings.
[0035] Figure 1 It is the algorithm flowchart of the farmland navigation path extraction method based on the subordinate relationship filtering strategy described in the present invention;
[0036] Figure 2 It is the example diagram of the dataset images and image data annotation of the present invention;
[0037] Figure 3 It is the network architecture diagram of RS-YOLOv8 of the present invention;
[0038] Figure 4 It is the structure diagram of the DBA module of the present invention;
[0039] Figure 5 It is the structure diagram of the C2f_SCAA module of the present invention;
[0040] Figure 6 It is the structure diagram of the optimized GAM module of the present invention;
[0041] Figure 7 It is the algorithm flowchart of the LAMP pruning algorithm of the present invention;
[0042] Figure 8 This is the flowchart of the subordinate relationship filtering algorithm of the present invention;
[0043] Figure 9 This is the schematic diagram of the area screening algorithm of the present invention;
[0044] Figure 10 This is the extraction result diagram of the navigation path of corn crops under various growth environments of the present invention. Specific implementation manners
[0045] The present invention proposes a method for extracting a farmland navigation path based on a subordinate relationship filtering strategy, aiming to design a method for extracting a farmland navigation path based on a subordinate relationship filtering strategy that is not easily affected by the environment.
[0046] The following will illustrate the method for extracting a farmland navigation path based on a subordinate relationship filtering strategy proposed by the present invention in specific embodiments:
[0047] Embodiment 1:
[0048] In the technical solution of this embodiment, as Figure 1 shown, a method for extracting a farmland navigation path based on a subordinate relationship filtering strategy includes the following steps:
[0049] Step 1, establish a dataset of corn crop rows under various growth environments, use a labeling tool to label corn plants and their roots, and perform data augmentation on the dataset;
[0050] Use the Labelimg tool to label corn plants and their roots, and the labeling categories are "seedling" (plant) and "root" (root) respectively. During labeling, since there are often adhesion and mutual occlusion phenomena between leaves during the growth of corn, it is difficult to accurately mark some independent plants. Therefore, in some scenarios during labeling, multiple corn plants are marked as a whole;
[0051] Data augmentation includes horizontal flipping, noise addition, and motion blur processing.
[0052] Step 2, detect plants and roots through the RS-YOLOv8 lightweight model;
[0053] The RS-YOLOv8 lightweight model, as Figure 3 shown, mainly includes a Backbone (main network) responsible for extracting multi-level features of the input image and providing basic feature information for subsequent detection; a Neck (neck network) responsible for aggregating multi-scale features, enhancing the feature expression ability, and improving the detection effect on targets of different sizes; a Head (detection head) responsible for target classification and bounding box regression based on the aggregated features to complete the target detection task.
[0054] In the Head part, an additional tiny detection head module is added based on the original detection head. The improved detection head structure strengthens the extraction of high-resolution features, significantly improves the model's ability to capture details of tiny-sized targets, and lays a solid foundation for the optimization of subsequent modules; the loss function is replaced from CIoU in YOLOv8n to PIoU2. The PIoU2 loss function not only accelerates the model's convergence speed but also further improves the accuracy of the detection boxes by optimizing the anchor box regression path and gradient adjustment strategy.
[0055] In the Neck part, a lightweight edge aggregation module (DBA) is added based on the selective edge aggregation module (SBA), as Figure 4 shown. By effectively combining shallow detail information and deep semantic information, it significantly improves the model's ability to refine the depiction and accurately locate the target contour. To address the problem of the high computational cost of SBA, DBA introduces depthwise separable convolutions to replace standard convolutions, reducing the computational complexity while maintaining the detection accuracy and achieving more efficient edge feature processing and aggregation; to improve the model's detection accuracy and robustness in complex scenarios, the C2f feature fusion module in the YOLOv8n structure is improved. The Bottleneck in C2f has problems of insufficient global context modeling and redundant receptive field interference, which limits its perception of tiny-sized targets. Therefore, the CS_CAA module is proposed, and the Bottleneck structure is replaced by two cascaded CS_CAA modules to obtain the C2f_SCAA module, as Figure 5 shown. The C2f_SCAA module uses context fusion and attention mechanisms to strengthen multi-scale feature perception and inter-channel information interaction, significantly suppressing redundant information interference and improving the model's detection accuracy for tiny targets; to address the problem of the degradation of the maize plant root detection performance caused by factors such as light changes, weed interference, and similar colors, the GAM module is introduced and optimized, as Figure 6 shown. The optimized GAM module fuses channel and spatial attention, enhances the model's ability to express significant features, and improves the model's adaptability and stability in complex environments. To address the problem of excessive redundant features in the output stage of GAM, the optimized GAM module adds a 1×1 pointwise convolution, optimizes the feature channel recombination and compactification process, reduces redundant features, and enhances the feature integration ability, thereby improving the model's flexibility and adaptability.
[0056] After optimizing the model structure, to reduce the network parameter occupancy and lower the model complexity, the level adaptive magnitude pruning algorithm (LAMP) is introduced, as Figure 7As shown, this algorithm dynamically adjusts the pruning ratio by quantifying the importance of parameters in the network layer, which not only retains the key feature representation ability but also effectively reduces redundant parameters, thereby improving the real-time performance of model detection while ensuring the stability of detection accuracy.
[0057] Specifically, the CS_CAA module adopts a residual structure design. First, it converts the input feature map into a set of concise regional feature maps through a 3×3 ordinary convolution, and then introduces a channel shuffle operation to improve the information interaction efficiency between channels by rearranging the channels and enhance the diversity of feature representation. On this basis, the module combines the context anchor attention mechanism (CAA) to assign weights to the shuffled feature map, highlighting significant features and suppressing irrelevant information. Next, the CS_CAA module performs morphological filtering on the feature map through a branch structure combined with dilated convolutions with different dilation rates. Different convolution operations process regional feature maps of different sizes based on specific receptive fields, avoiding the interference of redundant receptive fields and ensuring the diversity and integrity of feature representation. Finally, the feature maps output by the branches are concatenated and then feature fusion is performed through a 1×1 pointwise convolution. The introduction of the pointwise convolution can not only change the channel dimension but also integrate the information between branches, making the fused features more compact and efficient. Finally, through residual connection with the input feature map, the module retains the detailed information of the input features and alleviates the problem of gradient disappearance, obtaining the final output feature map.
[0058] Step 3: Based on the filtering algorithm for the subordinate relationship between the corn plant and the root detection box, filter out the root detection boxes that overlap with the plant detection box and eliminate isolated misdetected boxes.
[0059] Define two types of labels, "seedling" (class A) and "root" (class B), and set the class A label as the main detection object and the class B label as its subordinate object. Design a filtering algorithm based on the subordinate relationship between the corn plant and its root detection box to determine whether a class B detection box belongs to a class A detection box, as Figure 8 shown. The specific steps of the filtering algorithm are as follows:
[0060] Model prediction results: The model trained according to the training set images predicts the test set images, and the prediction results can be divided into the following three cases: the root detection box is completely within any seedling detection box; the root detection box has a partial overlapping area with any seedling detection box; there is no overlapping area between the root detection box and any seedling detection box in the image.
[0061] Detection box classification and information conversion: According to the prediction results, the detection boxes are classified into seedling_box (class A) and root_box (class B) according to the category information.
[0062] The detection boxes output by the YOLO model adopt a normalized format, defined as: {class, x center , y center , w, h};
[0063] Among them: class represents the label category, 0 represents class A (seedling_box), and 1 represents class B (root_box); (x center , y center ) are the normalized coordinates of the center point of the detection box; w and h are the normalized width and height of the detection box.
[0064] For the convenience of subsequent processing, it is necessary to convert the normalized coordinates {class, x center , y center , w, h} in YOLO format into a bounding box represented by pixel coordinates [x min , y min , x max , y max . The conversion formula is as follows:
[0065]
[0066] Among them, W and H are the width and height of the image respectively;
[0067] Judge whether there is an overlapping area between two types of detection boxes: Use the principle of axis independence to judge whether two detection boxes have an intersection. If the detection boxes have an intersection in both dimensions, it is considered that there is an overlapping area and they belong to associated detection boxes; otherwise, it is considered that there is no overlapping area.
[0068] Suppose the detection boxes and Then:
[0069] If Then there is no intersection
[0070] If Then there is no intersection
[0071] Otherwise, there is an intersection;
[0072] Screen the associated detection boxes and save the results: For each root detection box in root_box, traverse all seedling detection boxes in turn to judge whether there is an overlapping area. For this root detection box, if there is an intersection with any seedling_box detection box, keep this root_box detection box as a subordinate object; otherwise, discard it.
[0073] Finally, save all the seedling_box detection boxes and the screened root_box detection boxes together as the final prediction results of the detection boxes.
[0074] The image test set is predicted by the RS-YOLOv8 network, and the detection results will be saved in the label file. Using the subordination filtering algorithm for this label file can effectively eliminate redundant root detection boxes that have no association with the plant detection boxes, improving the accuracy of the detection results. This filtering algorithm ensures that each remaining root detection box has an association with the plant detection box, thus better reflecting the spatial distribution characteristics of plants and roots in the actual scene.
[0075] Step 4, according to the filtered detection boxes, extract the region of interest (ROI) through the region screening algorithm, including determining the key detection boxes, connecting the key points to form the boundary line, and filling the interference regions;
[0076] Design a region screening algorithm for extracting the region of interest (ROI) based on the filtered prediction results, which is used to determine whether a certain region should be eliminated. As Figure 9 shown, the specific steps of this region screening algorithm are as follows:
[0077] Determine the spatial position of the seedling detection box: Divide the detection boxes into seedling_box (category A) and root_box (category B) according to the category information. Determine its spatial position according to the center point coordinates (x center , y center ) of each detection box in the seedling_box. The specific judgment conditions are:
[0078] If then this seedling detection box is located on the left side of the image
[0079] Otherwise, this seedling detection box is located on the right side of the image;
[0080] Determine the key seedling detection boxes: On the left side of the image, select the seedling detection box closest to the center line as Left_Closest, and select the seedling detection box farthest and closest to the bottom edge of the image as Left_Farthest; on the right side of the image, select the seedling detection box closest to the center line as Right_Closest, and select the seedling detection box farthest and closest to the bottom edge as Right_Farthest;
[0081] Coordinate transformation: Convert the YOLO normalized coordinates {class, x center , y center , w, h} of the four detection boxes Left_Closest, Left_Farthest, Right_Closest, and Right_Farthest into pixel coordinates [xmin , y min , x max , y max . Extract the upper-left corner points (Left_Closest_TL, Left_Farthest_TL) of Left_Closest and Left_Farthest, and the upper-right corner points (Right_Closest_TR, Right_Farthest_TR) of Right_Closest and Right_Farthest;
[0082] Connect the key points to determine the region boundary: Connect Left_Closest_TL and Left_Farthest_TL to form the boundary line Left_Boundary; if the number of intersection points of Left_Boundary and the image boundary is less than two, extend Left_Boundary until there are two intersection points. Similarly, connect Right_Closest_TR and Right_Farthest_TR to form the boundary line Right_Boundary and perform similar processing.
[0083] Fill the interference region to extract the crop rows: Divide the image into left and right regions by Left_Boundary and fill the left region with black. Divide the image into left and right regions by Right_Boundary and fill the right region with black. The black-filled region is the interference region, and the remaining region is the region of interest;
[0084] Process the tag file filtered by the subordination relationship using the region screening algorithm, which can effectively screen out the regions of interest related to the navigation task and eliminate the interference regions that do not contain navigation information. This algorithm can optimize the process of extracting crop rows and improve the accuracy and robustness of subsequent detection and navigation tasks.
[0085] Step 5: Extract the center point at the bottom of the root detection box as the feature point, use the clustering algorithm to divide the crop ridges, and fit the crop row line within the ROI by the least squares method to extract the navigation path.
[0086] The coordinates of the feature point are denoted as (x0, y0), which are converted from the coordinates of the root detection box, and the conversion formula is as follows:
[0087] x0 = x center
[0088]
[0089] In the above formula, (x center , y center) represents the center point coordinates of the detection frame for the roots of the corn plant, and height represents the height of the detection frame.
[0090] The clustering algorithm refers to clustering the extracted feature points, classifying the feature points on the same ridge into the same cluster, so as to facilitate subsequent row line fitting. Given that the number of feature points in the data sample is small and the data distribution is relatively uniform, the K-means clustering algorithm is selected. K-means is a center-based clustering method, and its algorithm core lies in iteratively updating the cluster center and gradually minimizing the distance from the points within the cluster to the center, thereby completing the effective grouping of the data.
[0091] The basic idea of the least squares method is to find the straight line that is closest to all observed values by minimizing the sum of the squares of the errors between the fitting model and the observed data. Specifically, given n sets of observed point data (x i , y i ), the goal of the least squares method is to minimize the following objective function:
[0092]
[0093] where y i -(kx i +b) represents the vertical distance between the i-th observed point and the fitting straight line. By continuously adjusting the parameters k and b to minimize S, the best-fitting straight line can be obtained.
[0094] According to the clustering results and the least squares method for calculation, the expressions of the crop row lines on the left and right sides within the ROI are as follows:
[0095] y1 = k1x + b1
[0096] y2 = k2x + b2
[0097] After fitting the crop row lines on the left and right sides, the intersection points of the two fitting lines and the top of the image are L1 and R1 respectively, and the intersection points with the bottom of the image are L2 and R2 respectively. Among them, the intersection point of L1 and R1 is C1, and the intersection points of L2 and R2 are C2 respectively. Connecting C1 and C2 obtains the central navigation path of the corn crop row.
[0098] Example 2:
[0099] A method for extracting a farmland navigation path based on a subordination relationship filtering strategy, comprising the following steps:
[0100] Step 1: Establish a dataset of corn crop rows in multiple growth environments. Such as Figure 2As shown, the maize crop row images contained in the dataset were all taken in the experimental field of Jilin Agricultural University in Changchun, Jilin Province (125.41°E, 43.81°N). From May 25th to June 15th, 2024, maize crop rows in various growth environments were photographed. The various growth environments included normal growth, co-growth with weeds, adhesive growth, and growth with missing seedlings, etc. A total of 1422 original images were collected, and the dataset was divided into a training set, a validation set, and a test set according to the ratio of 8:1:1. The dataset was labeled using the annotation tool Labelimg, and the annotation objects were maize plants and the roots of maize plants. Since there are often adhesion and mutual occlusion phenomena between leaves during the growth of maize, it is difficult to accurately label some individual plants. Therefore, in some scenarios during annotation, multiple maize plants were labeled as a whole. To improve the diversity of the data and better extract the key features of maize plants and their roots, data augmentation operations such as horizontal flipping, noise, and motion blur were performed on the dataset images. The augmented dataset contains 5682 images.
[0101] Step 2, input the divided training set images into the RS-YOLOv8 network for training, and save the trained weight file. Use this weight file to predict the test set images, and save the prediction results to the label file. The network structure diagram of RS-YOLOv8 and its internal module diagram are as Figure 3 shown.
[0102] The RS-YOLOv8 detection model uses CSPDarknet in the YOLOv8 network as the backbone to extract features from the input image (640×640), and extracts four feature maps of different sizes including feature1 (160×160), feature2 (80×80), feature3 (40×40), and feature4 (20×20); after the feature maps enter the Neck, feature4 is upsampled and fused with feature3 to obtain the feature map feature5, then feature5 is processed by the C2f module, upsampled and combined with feature2 to obtain the feature map feature6, and feature6 is processed by the C2f module and continues to be upsampled and combined with feature1 to obtain the feature map feature7, and feature7 is used as the input of the C2f-SCAA module. After being processed by the C2f-SCAA module, the model can improve the detection accuracy and robustness of small-sized targets in complex scenarios. The feature map after the action of the C2f-SCAA module is used as the input of the GAM. This operation can solve the problems faced by the model when detecting the roots of corn plants in complex environments, such as the similar colors of the roots and the soil, light changes, and weed interference. The feature map processed by the GAM module is input into the Head part of YOLO for classification target detection (160×160). The feature map processed by the GAM module is downsampled and feature fused with the feature map in the upsampling process. The feature map output after the fused feature map is operated by the C2f module is input into the Head part of YOLO for classification target detection (80×80), and the same downsampling and feature fusion operations are continued for this feature map, and the output feature map is sequentially input into the Head part of YOLO for classification target detection (40×40 and 20×20). Among them, the DBA module in the Neck can improve the model's ability to capture edge and detail features when detecting the tiny target of the roots of corn plants.
[0103] The specific training process of the RS-YOLOv8 detection network model is explained as follows:
[0104] The constructed dataset is input into the model for training. The learning rate is set to 0.01, and SGD is used as the optimizer. The training process involves 200 iterations, the batch size is 32, the momentum is 0.937, and the weight decay is 0.0005.
[0105] Step 3: Analyze the correlation between the two types of detection boxes based on the position information of the two types of detection boxes stored in the label file saved in Step 2, identify and remove unrealistic isolated root misdetection boxes, thereby further improving the detection accuracy of the root detection boxes. The specific steps of the filtering algorithm based on the subordinate relationship between the corn plant and its root detection box are as follows:
[0106] Model prediction results: The model trained based on the training set images is used to predict the test set images. The prediction results can be divided into the following three cases: The root detection box is completely within any seedling detection box; The root detection box has a partial overlapping area with any seedling detection box; There is no overlapping area between the root detection box and any seedling detection box in the image.
[0107] Detection box classification and information conversion: According to the prediction results, the detection boxes are classified into seedling_box (type A) and root_box (type B) according to the category information.
[0108] The detection boxes output by the YOLO model adopt a normalized format, defined as: {class, x center , y center , w, h}
[0109] where: class represents the label category, 0 represents type A (seedling_box), 1 represents type B (root_box); (x center , y center ) is the normalized coordinate of the center point of the detection box; w and h are the normalized width and height of the detection box.
[0110] For ease of subsequent processing, it is necessary to convert the normalized coordinates {class, x center , y center , w, h} in YOLO format to the bounding box [x min , y min , x max , y max represented by pixel coordinates. The conversion formula is as follows:
[0111]
[0112]
[0113] where, W and H are the width and height of the image respectively;
[0114] Judge whether there is an overlapping area between the two types of detection boxes: Use the principle of axis independence to judge whether two detection boxes have an intersection. If the detection boxes have an intersection in both dimensions, it is considered that they have an overlapping area and belong to associated detection boxes; otherwise, it is considered that they have no overlapping area.
[0115] Assume a detection box and then:
[0116] If then there is no intersection
[0117] If then there is no intersection
[0118] Otherwise, there is an intersection;
[0119] Filter and save the associated detection boxes: For each root detection box in root_box, traverse all seedling detection boxes in sequence to determine if there is an overlapping area. For this root detection box, if there is an intersection with any seedling_box detection box, retain this root_box detection box as a subordinate object, otherwise discard it;
[0120] Finally, save all the seedling_box detection boxes together with the filtered root_box detection boxes as the final prediction result of the detection boxes.
[0121] The labeled file processed by the filtering algorithm can effectively eliminate redundant root detection boxes that have no association with the plant detection box, improving the accuracy of the detection result. And it provides a new idea for the misdetection problem that is prone to occur in the target detection model in complex scenarios.
[0122] Step 4, the specific steps of the region screening algorithm for extracting the region of interest (ROI) based on the labeled file filtered in Step 3 are as follows Figure 9 shown. Based on the prediction of the image, by screening out the regions of interest related to the navigation task and eliminating the interference regions that do not contain navigation information, the extraction process of the crop row can be further optimized, improving the accuracy and robustness of subsequent detection and navigation tasks. The specific steps of the region screening algorithm for extracting the region of interest (ROI) based on the detection result are as follows:
[0123] Determine the spatial position of the seedling detection box: Divide the detection boxes into seedling_box (category A) and root_box (category B) according to the category information. Determine its spatial position according to the center point coordinates (x center , y center ) of each detection box in the seedling_box. The specific judgment conditions are:
[0124] If then this seedling detection box is located on the left side of the image
[0125] Otherwise, this seedling detection box is located on the right side of the image;
[0126] Determine the key seedling detection boxes: On the left side of the image, select the seedling detection box closest to the center line as Left_Closest, and select the seedling detection box that is the farthest and closest to the bottom edge of the image as Left_Farthest; on the right side of the image, select the seedling detection box closest to the center line as Right_Closest, and select the seedling detection box that is the farthest and closest to the bottom edge as Right_Farthest;
[0127] Coordinate transformation: Transform the YOLO normalized coordinates {class, x center , y center , w, h} of the four detection boxes Left_Closest, Left_Farthest, Right_Closest, and Right_Farthest into pixel coordinates [x min , y min , x max , y max . Extract the upper left corner points (Left_Closest_TL, Left_Farthest_TL) of Left_Closest and Left_Farthest, and the upper right corner points (Right_Closest_TR, Right_Farthest_TR) of Right_Closest and Right_Farthest;
[0128] Connect the key points to determine the region boundary: Connect Left_Closest_TL and Left_Farthest_TL to form the boundary line Left_Boundary; if the number of intersection points of Left_Boundary and the image boundary is less than two, extend Left_Boundary until there are two intersection points. Similarly, connect Right_Closest_TR and Right_Farthest_TR to form the boundary line Right_Boundary and perform similar processing.
[0129] Fill the interference regions to extract the crop rows: Divide the image into left and right regions by Left_Boundary and fill the left region with black. Divide the image into left and right regions by Right_Boundary and fill the right region with black. The black filled regions are interference regions, and the remaining regions are regions of interest;
[0130] The region screening algorithm for extracting the region of interest (ROI) based on the filtered label file ensures the accuracy of crop row region extraction by eliminating irrelevant interference regions. It optimizes the crop row extraction process and improves the accuracy and robustness of subsequent detection and navigation tasks.
[0131] Step 5, Figure 10 Results of crop row line and navigation path extraction under multiple growth environments, including normal growth, weed co-growth, adhesion growth, and missing seedling growth. The detection effect of the maize navigation path under four growth environments was explored by comparing with the manually calibrated line. It can be seen from the figure that the model shows good detection performance when processing maize rows in four growth environments, effectively overcoming the challenges brought by complex environments to navigation path extraction.
[0132] The coordinates of the feature points are denoted as (x0, y0), which are converted from the coordinates of the root detection box, and the conversion formula is as follows:
[0133] x0 = x center
[0134]
[0135] In the above formula, (x center , y center ) represents the center point coordinates of the root detection box of the maize plant, and height represents the height of the detection box.
[0136] The clustering algorithm refers to clustering the extracted feature points, classifying the feature points on the same ridge into the same cluster, so as to facilitate subsequent row line fitting. Given that the number of feature points in the data sample is small and the data distribution is relatively uniform, the K-means clustering algorithm is selected. K-means is a centroid-based clustering method, and its algorithm core lies in iteratively updating the cluster centers and gradually minimizing the distance from the points in the cluster to the center, thereby completing the effective grouping of the data.
[0137] The basic idea of the least squares method is to find the straight line that is closest to all observed values by minimizing the sum of the squared errors between the fitting model and the observed data. Specifically, given n groups of observed point data (x i , y i ), the goal of the least squares method is to minimize the following objective function:
[0138]
[0139] where, y i - (kx i + b) represents the vertical distance between the i-th observed point and the fitting straight line. By continuously adjusting the parameters k and b to minimize S, the best-fitting straight line can be obtained.
[0140] Calculated according to the clustering results and the least squares method, the expressions of the crop row lines on the left and right sides within the ROI are as follows:
[0141] y1 = k1x + b1
[0142] y2 = k2x + b2
[0143] After fitting the crop row lines on the left and right sides, the intersection points of the two fitted lines and the top of the image are L1 and R1 respectively, and the intersection points with the bottom of the image are L2 and R2 respectively. Among them, the intersection point of L1 and R1 is C1, and the intersection points of L2 and R2 are C2 respectively. Connect C1 and C2 to obtain the central navigation path of the corn crop row.
[0144] As mentioned above, it is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
Claims
1. A farmland navigation path extraction method based on affiliation filtering strategy, characterized in that: The following steps are involved: Step 1: Establish a dataset of corn crop rows under various growth environments, use annotation tools to annotate corn plants and their roots, and perform data enhancement on the dataset; Step 2: Detect plants and roots using the RS-YOLOv8 lightweight model; Step 3: Based on the subordinate relationship filtering algorithm between the corn plant and the root detection frame, the root detection frame that overlaps with the plant detection frame is screened, and isolated false detection frames are eliminated; Step 4: According to the filtered detection frame, the region of interest is extracted through the region screening algorithm, including determining the key detection frame, connecting the key points to form a boundary line, and filling the interference area; Step 5: Extract the bottom center point of the root detection frame as the feature point, use the clustering algorithm to divide the crop ridges, and use the least squares method to fit the crop row lines in the ROI to extract the navigation path.
2. The farmland navigation path extraction method based on the subordination relationship filtering strategy according to claim 1 is characterized in that: In step 2, the RS-YOLOv8 model is constructed based on the YOLOv8 model. The improvements include: Add a tiny detection head module to the detection head to improve the small target detection capability, and replace the loss function with PIoU2; Introduce lightweight edge aggregation module, C2f_SCAA module and optimized GAM module into the neck network to enhance edge feature extraction, multi-scale perception and anti-interference capabilities; A hierarchical adaptive sparsity pruning algorithm is used to lightweight the model.
3. The farmland navigation path extraction method based on the subordination filtering strategy according to claim 2 is characterized in that: The C2f_SCAA module replaces the original Bottleneck structure by connecting two CS_CAA modules in series. The CS_CAA module includes channel shuffling, contextual anchor attention, and dilated convolution branches to enhance multi-scale feature interaction. The optimized GAM module adds 1×1 point-by-point convolution at the output stage to reduce redundant features; The DBA module uses depthwise separable convolution to replace standard convolution to reduce computational complexity.
4. The farmland navigation path extraction method based on the subordinate relationship filtering strategy according to claim 1 is characterized in that: In step 1, when labeling, multiple adhered plants are labeled as a whole, and the root detection frame focuses on the root area close to the ground surface; Data enhancement includes horizontal flipping, noise addition, and motion blur.
5. The farmland navigation path extraction method based on the subordination relationship filtering strategy according to claim 1 is characterized in that: In step 3, the specific steps of the subordination relationship filtering algorithm include: Classify the detection boxes into class A and class B, and treat class B as a subordinate object; Determine whether the B-type detection box intersects with any A-type detection box. If so, keep it; otherwise, remove it. The condition for determining intersection is that the two detection frames have overlapping areas in both the horizontal and vertical directions.
6. The farmland navigation path extraction method based on the subordination relationship filtering strategy according to claim 1 is characterized in that: In step 4, the region screening algorithm includes: Divide the image into left and right sides according to the center point of the seeding detection frame, and select the key detection frames close to the center line and bottom edge on the left and right sides; Connect the corner points of the key detection box to form a boundary line, extend the boundary line to intersect with the edge of the image, and fill the area outside the boundary line as the interference area.
7. The farmland navigation path extraction method based on the subordinate relationship filtering strategy according to claim 1 is characterized in that: In step 5, the feature point coordinates (x0, y0) are converted from the coordinates of the root detection box, and the conversion formula is as follows: x0=x center ; Among them, (x center ,y center ) represents the center coordinate of the detection frame of the corn plant root, and height represents the height of the detection frame; The K-means algorithm is used to cluster the feature points, and the same cluster corresponds to a crop ridge; The crop lines on the left and right sides are fitted by the least squares method, and the line connecting the top and bottom intersections is calculated as the navigation path.
Citation Information
Patent Citations
Corn rhizome navigation datum line extraction method based on navigation trend line
CN112712534A
Intelligent agricultural machine path planning method and device based on remote sensing image and deep learning
CN116882612A
Small target detection method, device and equipment and readable storage medium
CN117132767A
Corn plant detection method and device based on near-earth remote sensing and improved YOLOv8s and computer readable storage medium
CN118429837A
Obstacle detection method in operation process of facility agricultural robot
CN118609093A
Cited By
Agricultural machinery positioning method and system based on deep learning
CN120912667A