Optimization method of furrow recognition algorithm

Through improved random sampling consistency algorithm, clustering algorithm and convolutional neural network to identify and optimize the border of ditch boundaries, the problem of traditional algorithm dependence on thresholds and lack of dynamic adjustment is solved, and high-precision and efficient ditch recognition is achieved.

CN119445372AInactive Publication Date: 2025-02-14ANHUI AGRICULTURAL UNIVERSITY

Patent Information

Application Number
CN202411478321.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-22
Publication Date
2025-02-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional ditch identification algorithms are highly dependent on thresholds and lack intelligent dynamic adjustment capabilities, which leads to a decrease in recognition accuracy when farmland environment changes, making it difficult to meet the needs of modern intelligent agriculture.

Method used

The improved random sampling consistency algorithm and clustering algorithm are used for preliminary segmentation, combined with the convolutional neural network to identify and optimize the border of the ditch through multiple iterative training, and the interference information is eliminated through conditional filtering.

Benefits of technology

It significantly improves the segmentation accuracy of field ridge surfaces and ditches boundaries, reduces errors, avoids identification failures, reduces manual intervention, and meets the efficient management needs of large-scale agricultural production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119445372A_ABST
    Figure CN119445372A_ABST
Patent Text Reader

Abstract

The invention discloses an optimization method of a furrow recognition algorithm, and the method comprises the steps: S1, obtaining an image or point cloud data of a furrow region, S2, carrying out the preprocessing of the image or point cloud data, and carrying out the denoising, filtering, color conversion and morphological operation, the method comprises the following steps: S1, preprocessing data, S3, carrying out preliminary segmentation of furrow areas on the preprocessed data by using an improved random sampling consistency algorithm and a clustering algorithm, S4, identifying and optimizing furrow boundaries in the segmented areas through a machine learning model, and carrying out repeated iterative training on the model, and S5, carrying out conditional filtering on the furrow boundaries to remove interference information; according to the optimization method of the furrow recognition algorithm, the complexity of manual setting and possible errors are reduced, the optimized furrow recognition algorithm can be dynamically adjusted, the efficient management requirement of large-scale agricultural production is met, the automation degree and management efficiency of agricultural production are greatly improved, and the development of precision agriculture is promoted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of agricultural engineering, and in particular to an optimization method for a furrow recognition algorithm. Background Art

[0002] In modern agriculture, the rational planning and maintenance of furrows are crucial to improving the growth environment of crops and enhancing irrigation and drainage efficiency. Traditionally, the identification of field furrows and ditch boundaries mainly relies on manual observation or simple mechanization. However, with the development of agricultural automation and intelligence, the need for automatic identification and management of field furrows and ditch boundaries has become more and more urgent, especially in large-scale agricultural production. Efficient and accurate furrow identification technology has become an important means to improve agricultural management efficiency. At present, furrow identification technology mainly relies on point cloud data processing, which uses sensors such as lidar or RGB-D cameras to obtain three-dimensional point cloud data of farmland, and then uses point cloud segmentation algorithms to identify and classify field terrain features. Traditional point cloud segmentation algorithms usually require pre-setting of fixed thresholds to distinguish ground features, crops, and ditch boundaries. However, this method has many shortcomings in practical applications.

[0003] First, traditional algorithms are highly dependent on thresholds. In farmland environments, factors such as the height of different crops, planting density, and soil properties can cause large changes in terrain features. Fixed thresholds cannot flexibly adapt to these changes, resulting in a significant decrease in recognition accuracy. Especially when faced with inconsistent crop heights or complex farmland environments, fixed thresholds can easily lead to unclear boundaries between bed surfaces and ditch borders, thereby affecting the accuracy of irrigation and drainage. Secondly, there is a lack of intelligent dynamic adjustment capabilities. The threshold setting in traditional methods is usually based on prior experience, which means that once environmental conditions change, the system must manually readjust the parameters, which is time-consuming and labor-intensive, and difficult to respond flexibly in actual complex environments. The limitations of this method are particularly evident in modern smart agricultural scenarios, especially for vast farmlands or high-intensity agricultural production models. The efficiency and accuracy of traditional methods can no longer meet actual needs. Summary of the invention

[0004] The purpose of the present invention is to provide an optimization method for a furrow recognition algorithm to solve the problems of traditional algorithms being highly dependent on thresholds and lacking intelligent dynamic adjustment capabilities.

[0005] To achieve the above object, the present invention provides the following technical solution: a method for optimizing a furrow recognition algorithm, the method comprising: S1. Obtaining images or point cloud data of furrow areas; S2. Preprocessing the image or point cloud data, wherein the preprocessing includes denoising, filtering, color conversion and morphological operations; S3, using the improved random sampling consistency algorithm and clustering algorithm to perform preliminary segmentation of the furrow area on the preprocessed data; S4, identifying and optimizing furrow boundaries in the segmented area through a machine learning model, wherein the model is trained through multiple iterations; S5, removing interference information from the furrow boundary by conditional filtering; Wherein, the step S3 uses a density clustering algorithm to cluster the initially segmented data, specifically: Choosing neighborhood radius using k-distance graph and the minimum number of samples, where the k value is equal to the dimension plus 1, calculates the distance of each point to its k neighboring points, and determines the cluster neighborhood based on the following formula: , in, and represents two sample points, and They are respectively indicated in The coordinates of the dimension, represents the Euclidean distance between two points, Indicates the number of dimensions of the sample points, Indicates the dimension index currently being calculated. Represents the neighborhood radius.

[0006] Preferably, the preprocessing in step S2 further includes: Perform color model conversion on image data, convert RGB color model to HSV color model, and voxelize point cloud data.

[0007] Preferably, in step S4, a convolutional neural network is used as a machine learning model, and the training process of the model includes the following steps: The preprocessed image data is input into the convolutional neural network for boundary detection, and the cross entropy loss function is used to optimize the model parameters. The loss function is defined as: , in, represents the loss function value, represents the number of samples used for training, represents the sample index, Indicates The true labels of samples, Indicates The probability that a sample is predicted as a positive class by the model; Use stochastic gradient descent to update the network weights. The weight update formula is: , in, Indicates that the model is at the current time step The weight matrix when Indicates that the model is in the next time step +1 is the updated weight matrix, represents the learning rate, Represents the loss function The gradient with respect to the weights.

[0008] Preferably, the boundary optimization process in step S5 includes: Conditional filtering is performed on the identified furrow boundaries, the strip interval is set and the centroid is calculated. The specific formula is: and , in, and Represents the coordinates of the center of mass on the X and Y axes, represents the number of samples, Indicates the index of traversing samples, and Indicates The coordinates of the sample points on the X and Y axes.

[0009] Preferably, the machine learning model and filter used in step S4 and step S5 are processed by a time synchronizer.

[0010] Preferably, the machine learning model adopts online data enhancement technology during the training process, specifically including: Transform images in real time by random rotation, scaling, flipping, etc. to generate more training samples; The enhanced transformation parameters are dynamically adjusted by the following formula: , in, represents the strength of data augmentation, represents the minimum enhancement strength, Indicates the maximum enhancement strength, represents the change in loss value, Represents the initial loss value.

[0011] Preferably, in the boundary optimization process of step S5, the boundary is further refined by conditional filtering and morphological operations, specifically including: Use morphological dilation and erosion operations to optimize the smoothness of furrow boundaries; The size of the structural element of the morphological operation is dynamically adjusted according to the size of the furrow. The specific formula is: , in, Indicates the size of the structure element of the morphological operation, represents the mean width of furrows, represents the adjustment coefficient; The point cloud data obtained in step S1 is collected by a laser radar or a structured light sensor, and the depth information of the furrows is measured using a three-dimensional coordinate system.

[0012] The color conversion in step S2 converts the color image into a grayscale image to reduce the interference of color information on furrow boundary detection.

[0013] The improved random sampling consensus algorithm in step S3 improves the robustness to noise data by introducing a weighting factor.

[0014] It can be seen from the above technical solution that the present invention has the following beneficial effects: The optimization method of the furrow recognition algorithm obtains images or point cloud data of the furrow area, pre-processes the images or point cloud data, the pre-processing includes denoising, filtering, color conversion and morphological operations, uses an improved random sampling consistency algorithm and a clustering algorithm to perform preliminary segmentation of the furrow area on the pre-processed data, identifies and optimizes the furrow boundaries in the segmented area through a machine learning model, and the model is trained for multiple iterations, and the interference information is eliminated by conditional filtering on the furrow boundaries, which significantly improves the segmentation accuracy of the field furrow surface and the ditch boundary, effectively reduces errors, avoids the problem of recognition failure caused by environmental changes during crop growth, reduces human intervention, reduces the complexity of manual settings and possible errors, and the optimized furrow recognition algorithm can be dynamically adjusted to meet the efficient management needs of large-scale agricultural production, greatly improve the automation level and management efficiency of agricultural production, promote the development of precision agriculture, and solve the problems of traditional algorithms' high dependence on thresholds and lack of intelligent dynamic adjustment capabilities. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 The figure is a flow chart of the method of the present invention. DETAILED DESCRIPTION

[0016] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0017] like Figure 1 As shown, an optimization method for a furrow recognition algorithm includes the following steps: S1. Obtain images or point cloud data of the furrow area. High-precision cameras or sensors such as laser radar can be used to collect images or three-dimensional point cloud data of the furrow area, which will serve as the basis for subsequent processing; S2. Preprocess the image or point cloud data. The preprocessing step mainly includes denoising, filtering, color conversion and morphological operations. For example, denoising can be performed by using methods such as Gaussian filtering and bilateral filtering. Filtering can reduce the impact of noise and enhance the clarity of the image. Color conversion can convert the original RGB image into a color space that is more suitable for processing (such as HSV). Morphological operations can be used to highlight the geometric features of furrows. S3, using the improved random sampling consistency algorithm and clustering algorithm to perform preliminary segmentation of the furrow area on the preprocessed data; Step S3 uses a density clustering algorithm to cluster the initially segmented data, specifically: Choosing neighborhood radius using k-distance graph and the minimum number of samples, where the k value is equal to the dimension plus 1, calculates the distance of each point to its k neighboring points, and determines the cluster neighborhood based on the following formula: , in, and represents two sample points, and They are respectively indicated in The coordinates of the dimension, represents the Euclidean distance between two points, Indicates the number of dimensions of the sample points, Indicates the dimension index currently being calculated. represents the neighborhood radius; S4. Identify and optimize the furrow boundaries in the segmented area through a machine learning model. The model uses a convolutional neural network and optimizes the recognition effect through multiple iterations of training to ensure the accuracy of the segmented boundaries. The training process includes inputting preprocessed image or point cloud data, optimizing the model using a cross entropy loss function, and finally updating the model weights through a stochastic gradient descent method; S5. Conditional filtering is used to remove interference information from the optimized furrow boundary to further improve recognition accuracy. This process sets conditions based on specific features of the furrow area (such as depth and width) and cleans up interference information in combination with filter parameters.

[0018] This optimization method achieves accurate recognition of furrow areas through a series of image or point cloud data processing steps combined with advanced clustering and machine learning algorithms. The improved random sampling consistency algorithm helps to improve the robustness of the initial segmentation, while the density clustering algorithm can automatically adjust the clustering neighborhood while ensuring the recognition accuracy, avoiding the parameter tuning problem in the traditional method. The convolutional neural network model not only improves the accuracy of boundary recognition through multiple iterative training, but also continuously optimizes the model parameters to make the recognition results more accurate. Finally, through conditional filtering, noise and other interference information are effectively eliminated to ensure that the output furrow boundary is clearer. This method effectively improves the accuracy and efficiency of furrow recognition, especially in scenes with more noise or blurred boundaries, with significant performance improvement. Through the preprocessing steps, the interference of data noise is reduced; the combination of random sampling consistency and density clustering algorithms improves the accuracy of the initial segmentation of the furrow area; the convolutional neural network model optimizes the boundary recognition effect through multiple training, and removes redundant information through conditional filtering, thereby improving the quality of the final output. In addition, the entire algorithm has high adaptability and can be applied in a variety of different scenarios.

[0019] In alternative embodiments of the present invention: other sensor devices, such as multispectral cameras or structured light 3D sensors, can be used to acquire image or point cloud data to adapt to different application scenarios; in the preprocessing stage, the filtering method can adopt alternative algorithms such as median filtering or adaptive bilateral filtering, and the color space conversion can also adopt other color models (such as Lab model) to further improve the color segmentation effect; the clustering algorithm can be replaced by other adaptive clustering methods to meet the processing requirements under different data distribution conditions; the structure of the convolutional neural network can be adjusted according to different requirements, such as introducing a deep neural network (DNN) or a graph convolutional network (GCN) to improve the boundary recognition accuracy in complex scenes; in the boundary optimization process, in addition to conditional filtering, methods such as image sharpening or Laplacian operator can also be combined to enhance the detail performance of the boundary.

[0020] The preprocessing in step S2 further includes color model conversion of the image data and voxelization of the point cloud data. Specifically: for the image data, the RGB color model is first converted to the HSV color model. In the HSV color space, hue, saturation, and value represent the color information, color concentration, and brightness of the image, respectively. Through this conversion, the furrow area and the background can be more effectively distinguished, thereby improving the accuracy in subsequent processing. The main steps of the color model conversion include extracting the color value of each pixel from the RGB color space, mapping these values ​​to corresponding values ​​in the HSV space using a standard conversion formula, and ensuring that the data can maintain good robustness under different lighting conditions; voxelization of the point cloud data. Voxelization is to divide the continuous three-dimensional space into small cubic grids (i.e., voxels), and simplify multiple points into one point in each voxel to reduce the amount of data and enhance processing efficiency. The voxelization operation not only reduces redundant point cloud data, but also retains the three-dimensional geometric features of the furrow, thereby helping to improve the accuracy of clustering and segmentation. Specifically, the voxelization process includes setting the size of the voxel grid, traversing the point cloud data, and assigning each point to the corresponding voxel, and simplifying the data by calculating the average value within each voxel.

[0021] In this embodiment, by converting the RGB color model to the HSV model, the distinction between the furrow area and other backgrounds in the image is enhanced, because in the HSV space, the color change and the brightness change are more independent, which is conducive to the segmentation of the target. Voxelization processing reduces the data scale by simplifying the voxel grid representation of the point cloud data, and significantly improves the processing speed of the algorithm. Especially in the scenario of large-scale point cloud data, voxelization can reduce the amount of calculation while ensuring the integrity of geometric features. The color model conversion makes the method more robust under different lighting conditions, especially when the color contrast between the furrow area and the surrounding environment is low, it can improve the recognition rate of the furrow area. Voxelization processing reduces the redundancy of point cloud data and reduces the computational complexity of subsequent processing. At the same time, it retains the geometric shape characteristics of the furrow and improves the overall processing efficiency. The preprocessing step of this method not only improves the clarity of the image and point cloud data, but also provides a better data foundation for the subsequent clustering, segmentation and boundary optimization steps, and ultimately improves the overall performance of the algorithm.

[0022] Color model conversion can also use other color spaces, such as the Lab model or the YCbCr model, to adapt to different types of images or application scenarios. The Lab model is less dependent on lighting and is suitable for furrow recognition in natural environments. Point cloud data can be processed without voxelization, but other simplification methods such as sampling or aggregation operations can be used to reduce the amount of data. For example, a curvature-based sampling method can be used to weighted sample areas with higher curvature in point cloud data, thereby reducing the number of points while retaining key geometric features.

[0023] In step S4, a convolutional neural network is used as a machine learning model. The training process of the model includes the following steps: The preprocessed image data is input into the convolutional neural network for boundary detection, and the cross entropy loss function is used to optimize the model parameters. The loss function is defined as: , in, represents the loss function value, represents the number of samples used for training, represents the sample index, Indicates The true labels of samples, Indicates The probability that a sample is predicted as a positive class by the model; Use stochastic gradient descent to update the network weights. The weight update formula is: , in, Indicates that the model is at the current time step The weight matrix when Indicates that the model is in the next time step +1 is the updated weight matrix, represents the learning rate, Represents the loss function The gradient with respect to the weights.

[0024] The preprocessed image data is input into the convolutional neural network. The preprocessed image data has been processed by denoising, color model conversion and filtering, and has better feature expression, which is suitable for boundary detection. The CNN model can be composed of multiple convolutional layers, pooling layers and fully connected layers. The convolutional layer is used to extract edge features in the image, while the pooling layer is used to reduce the dimension of the image and reduce the amount of calculation. After multiple layers of convolution operations, the model can gradually extract boundary information of different scales in the image, so as to identify the boundary of the furrow. The cross entropy loss function is used to evaluate the difference between the output of the model and the true label. After each sample is predicted by the model, its loss value is calculated. The cross entropy loss function measures the performance of the model by comparing the true label and predicted probability of each sample. When the prediction result is closer to the true value, the loss value is smaller, and the stochastic gradient descent (SGD) is used to update the weight of the model. In each round of training, the model updates the weight according to the gradient information of the loss function.

[0025] In this embodiment, the convolutional neural network can effectively capture the spatial structural features in the image through multi-level convolution and pooling operations, and is particularly good at identifying boundary information in the image. The cross entropy loss function can accurately measure the gap between the output of the model and the target value. Through the feedback of the loss value, the stochastic gradient descent method can gradually adjust the network weights and optimize the prediction ability of the model. Finally, after multiple iterations of training, the convolutional neural network can accurately identify the boundaries of the furrow area. The convolutional neural network has a strong feature extraction capability and can accurately identify the boundaries of the furrow area in the image. It is particularly suitable for detail processing in complex scenes. Through the combination of the cross entropy loss function and the stochastic gradient descent method, the model can quickly optimize its weights, with high training efficiency and fast convergence speed. CNN has strong resistance to noise and complex backgrounds, and can work stably under different lighting and environmental conditions, which improves the wide range of application scenarios of the furrow recognition algorithm. This method only needs to appropriately adjust the structure and hyperparameters of the convolutional neural network under different data sets or tasks to obtain better recognition effects and has good adaptability.

[0026] Convolutional neural networks can be replaced by other deep learning models, such as bidirectional long short-term memory networks (BiLSTM) or fully convolutional networks (FCN). These models have unique advantages in processing sequence data or pixel-level image segmentation tasks. Stochastic gradient descent can also be replaced by other optimization algorithms, such as adaptive moment estimation (Adam) optimizer or RMSProp optimizer. These optimization algorithms can better handle the dynamic adjustment of learning rate and improve the stability and convergence speed of training.

[0027] The boundary optimization process in step S5 includes: Conditional filtering is performed on the identified furrow boundaries, the strip interval is set and the centroid is calculated. The specific formula is: and , in, and Represents the coordinates of the center of mass on the X and Y axes, represents the number of samples, Indicates the index of traversing samples, and Indicates The coordinates of the sample points on the X and Y axes.

[0028] In the process of boundary optimization, in addition to calculating the centroid, other important geometric features such as the minimum enclosing rectangle and convex hull need to be calculated to further describe and optimize the boundary. The minimum enclosing rectangle is the smallest rectangle that contains the boundary and is used to describe the overall size and direction of the boundary. The calculation is usually done by finding the rotation angle of the boundary and calculating the area of ​​the rectangle at each angle to find the minimum enclosing rectangle.

[0029] The convex hull is the smallest convex polygon that encloses the boundary. The calculation of the convex hull helps to fit the boundary of the furrow more accurately. Common algorithms such as Graham scanning can be used to calculate the convex hull. These algorithms gradually check the boundary points to find the smallest set of convex polygons.

[0030] First, conditional filtering is applied to the identified furrow boundary data. The filter removes possible interference information, such as noise or misidentified boundary fragments, by setting certain threshold conditions (such as the continuity of the boundary, the amplitude of the depth or width change). The parameter setting of the conditional filter can be adjusted according to the characteristics of the actual furrow area to ensure the smoothness and consistency of the boundary. After the filtering is completed, the position of the furrow boundary is further optimized by centroid calculation. In order to further improve the smoothness of the boundary, the strip interval can be set based on the centroid calculation. Strip interval is a strategy to divide the furrow area into multiple strips. By calculating the centroid within each strip, more detailed boundary information can be obtained. The strip interval is set according to the geometric shape and size of the furrow. Generally, a smaller interval can improve the accuracy of boundary optimization.

[0031] The working principle of this implementation method mainly relies on conditional filtering and centroid calculation. The role of conditional filtering is to remove noise or misidentification information in the furrow boundary by eliminating abnormal data, thereby ensuring the continuity and consistency of the boundary. The centroid calculation further optimizes the position of the boundary by obtaining the centroid position of the furrow area, thereby ensuring the accuracy of the boundary globally. By setting the strip interval, the optimization process can be refined, making the recognition of the furrow boundary more precise and stable. By combining conditional filtering with centroid calculation, noise information is eliminated, and the optimized boundary is smoother and more accurate, which is suitable for furrow recognition tasks in complex scenarios. The centroid calculation is combined with the use of strip intervals to make the entire furrow boundary smoother during the optimization process, reducing the boundary error caused by data fluctuations. This method can flexibly adjust the parameters of the conditional filter and the strip interval according to the morphology and geometric characteristics of different furrows, so as to maintain a good recognition effect under different environments and conditions.

[0032] The setting of strip spacing can be dynamically adjusted according to different application scenarios. For example, in scenarios where the geometric changes in the furrow area are large, the strip spacing can be appropriately reduced to improve the optimization accuracy; while in flat areas, the strip spacing can be appropriately enlarged to reduce the amount of calculation. The centroid calculation can be combined with other geometric features, such as using the minimum enclosing rectangle or convex hull algorithm to further optimize the overall shape of the boundary, thereby ensuring the smoothness and continuity of the boundary. Another alternative optimization method is to further smooth the boundary lines through Bezier curves or spline interpolation, making boundary recognition more natural and accurate.

[0033] The machine learning models and filters used in step S4 and step S5 are processed by a time synchronizer. The main function of the time synchronizer is to ensure the timing consistency of multi-sensor or multi-threaded data processing to improve the accuracy of overall recognition and optimization. The specific implementation steps are as follows: Configuration of time synchronizer: During the entire furrow identification and optimization process, image data or point cloud data may come from multiple sensors, and the data acquisition frequency of each sensor is different, which can easily lead to data asynchrony. To solve this problem, configure a time synchronizer to ensure that data between different data sources can be processed under the same timestamp. The time synchronizer can be implemented through a hardware clock or a software clock, and can attach an accurate timestamp to each frame of data; Time synchronization of machine learning models: In step S4, convolutional neural network (CNN) is used as the main machine learning model for the recognition and optimization of furrow boundaries. The time synchronizer can ensure that the data input to the CNN model has a consistent timestamp to avoid recognition errors caused by inconsistent data timing. Specifically, each frame of image data or point cloud data is calibrated by the time synchronizer, so that the CNN model can be processed frame by frame in time order to ensure that the recognition effect of the model remains consistent; Time synchronization of filters: In step S5, conditional filters are used to remove noise and interference information and optimize furrow boundaries. In practical applications, filter processing often involves multiple data sources (such as multiple frames of images or point cloud data from multiple sensors). Time synchronizer processing can ensure that when the filter is applied to each frame of data in the time series, the data is synchronized, ensuring the continuity and consistency of the filtering process; Overall time synchronization process: First, all input data streams (images or point clouds) are processed by the time synchronizer to ensure timing consistency. Then, the synchronized data enters the CNN model for recognition, and the output furrow boundary data is processed by the conditional filter. The filter also ensures that each step is synchronized with the previous and next frame data. In this way, the overall processing of the time synchronizer ensures that the furrow boundary recognition and optimization process is continuous and consistent in the time dimension.

[0034] The core of this implementation is the introduction of a time synchronizer, which solves the problem of inconsistent timing that may occur during multi-sensor or multi-threaded data processing. Through the time synchronizer, the timestamps input from different data sources are ensured to be consistent, so that the machine learning model and filter can accurately align each frame of data, thereby maintaining the stability of the recognition and optimization effect in a continuous time series. Especially when it involves multiple sensors working together or high-frequency data acquisition, the processing of the time synchronizer greatly improves the reliability of the system. The time synchronizer ensures that data from different sensors can be processed at the same timestamp, avoiding recognition errors caused by inconsistent timing, and improving the accuracy of machine learning model and filter processing. Through time synchronization, the machine learning model and filter can maintain the continuity and consistency of data processing in the time dimension, making the identification of furrow boundaries smoother without jumping or discontinuity. In multi-sensor systems, data synchronization problems often lead to system instability. The introduction of the time synchronizer effectively improves the stability and robustness of the overall system, and is particularly suitable for use in scenarios with high real-time requirements.

[0035] Time synchronizers can be implemented in different ways, such as a global time synchronization system based on GPS or a local high-precision clock synchronization mechanism. These alternatives can select appropriate time synchronization solutions according to specific application scenarios. If the sensor data source is relatively single or the processing speed is fast, the design of the time synchronizer can be simplified, and a simpler timestamp calibration method can be used to reduce complexity. The time synchronizer can be further combined with the data fusion algorithm. In addition to ensuring time consistency, data alignment and fusion can also be performed simultaneously, thereby improving the utilization efficiency of multi-sensor data in the process of furrow identification and optimization.

[0036] The machine learning model uses online data augmentation techniques during training, including: Transform images in real time by random rotation, scaling, flipping, etc. to generate more training samples; The enhanced transformation parameters are dynamically adjusted by the following formula: , in, represents the strength of data augmentation, represents the minimum enhancement strength, Indicates the maximum enhancement strength, represents the change in loss value, Represents the initial loss value.

[0037] Machine learning models use online data enhancement technology during the training process. Online data enhancement refers to performing various random transformations on the input image data in real time during the training process to generate new samples to increase the robustness and generalization ability of the model. Other enhancement methods such as random cropping and color perturbation can also be added. The random cropping operation can simulate different perspectives and focal points by randomly selecting cropping boxes in different areas of the image. This method helps to improve the robustness of the model to partial occlusion or changes in perspective. Color perturbation technology is introduced to simulate scenes under different lighting conditions by randomly adjusting parameters such as image brightness, contrast, saturation, and hue. This can further improve the diversity of training data. The specific steps include the following: In each training iteration, random geometric transformation operations are performed on the input image data. Common transformations include: Random rotation: randomly select a rotation angle (for example, within the range of ±10 degrees) to rotate the image, change the position and angle of the furrows in the image, and increase the diversity of the data; Random scaling: Randomly scale the image to enlarge or reduce it within a certain range of proportions to simulate furrow recognition scenarios at different distances or scales. Random flipping: Randomly flip the image horizontally or vertically to break the original directionality in the data set and increase the diversity of training samples.

[0038] In order to control the intensity of data enhancement, the transformation parameters of data enhancement are dynamically adjusted according to the changes in the loss function during model training. The data enhancement operation is performed in real time, that is, at the beginning of each training batch, the above-mentioned random transformation operation is performed on the image data of the current batch. This online data enhancement can not only increase the number of training samples, but also improve the generalization ability of the model by enhancing the features of different types of samples, especially when dealing with complex tasks such as furrow boundary recognition, it can effectively reduce overfitting problems.

[0039] This implementation method generates new training samples in real time through data enhancement operations such as random rotation, scaling, and flipping, thereby expanding the diversity of the training data set. The mechanism for dynamically adjusting the data enhancement intensity is based on the amount of change in the loss function. When the model converges slowly, the enhancement intensity is increased to increase the complexity of the sample, further promoting the progress of model training. In this way, the machine learning model can better adapt to various complex scenes and improve the robustness of furrow recognition. Through real-time online data enhancement, the sample types in the training set are more diverse, which can effectively improve the performance of the model in different scenes and avoid the model from overfitting specific samples. Random rotation, scaling, flipping and other operations simulate furrow images under different shooting angles, distances and directions, and enhance the adaptability of the model to different shooting conditions, so that it can still maintain good recognition effects in various undesirable scenes. By dynamically adjusting the intensity of data enhancement, it can ensure that the degree of data enhancement is reasonably controlled during the model training process, which can increase the complexity of the sample and avoid the adverse effects of excessive enhancement on model training. By generating diverse training samples, the model can learn a wider range of features, avoid overfitting a certain type of feature, and improve the accuracy and stability of the model in practical applications.

[0040] The data enhancement operation can be further expanded. For example, other enhancement methods such as random cropping and color perturbation can be added to further improve the diversity of training data. The formula for dynamically adjusting the enhancement parameters can also be replaced by other adjustment mechanisms, such as the accuracy of model training or the gradient change of model weights, to further optimize the flexibility of the enhancement process. If the data set is large during model training, online data enhancement can be converted to offline data enhancement, that is, the data set can be enhanced in advance to generate a larger training set, and then training can be carried out.

[0041] In the boundary optimization process of step S5, the boundary is further refined through conditional filtering and morphological operations, specifically including: Use morphological dilation and erosion operations to optimize the smoothness of furrow boundaries; The size of the structural element of the morphological operation is dynamically adjusted according to the size of the furrow. The specific formula is: , in, Indicates the size of the structure element of the morphological operation, represents the mean width of furrows, Represents the adjustment coefficient.

[0042] The size of the structural element of the morphological operation can be dynamically adjusted to adapt to the uneven width of the furrow. By analyzing the local features of the image (such as edge strength, texture change, etc.), the size of the structural element suitable for the current area can be dynamically calculated. Before performing the morphological operation, the image is firstly feature extracted to obtain the feature information of each local area, and the extracted features are input into the adaptive model to predict the optimal size of the structural element for each area, such as using a decision tree to predict, and then according to the predicted size of the structural element, morphological operations (such as dilation, erosion, opening and closing operations) are performed on each local area to maintain a good boundary optimization effect.

[0043] In the boundary optimization process of step S5, the furrow boundary is further refined through conditional filtering and morphological operations. The specific implementation steps are as follows: First, a conditional filter is applied to the furrow boundary after preliminary segmentation to remove abnormal boundary noise. By setting certain filtering conditions (such as the continuity of the boundary, the width variation range, etc.), the noise points or misjudgment points in the boundary are screened out to ensure that the filtered boundary is smoother and continuous. On the basis of conditional filtering, the smoothness of the furrow boundary is further optimized through morphological operations. Specific morphological operations include dilation operations: dilation operations can fill small cracks or gaps in the boundary to make the boundary more coherent. The dilation operation will expand the area of ​​the furrow boundary, connect adjacent boundary points, and eliminate small noise areas; the erosion operation: after the dilation, the boundary is slightly reduced by the erosion operation to remove the redundant edge points caused by the dilation operation, and finally the boundary is restored to the accurate position and maintains its smoothness. The size of the structural element used in the morphological operation is dynamically adjusted according to the size of the furrow. The conditional filtering and morphological operation are used together, so that the furrow boundary has high smoothness and accuracy after multiple iterative processing. Especially for areas with irregular furrow boundaries or complex boundary lines, morphological operations can significantly improve the coherence and overall smoothness of the boundary.

[0044] This implementation method uses conditional filtering to remove abnormal points and noise in the boundary, and further optimizes the smoothness of the boundary through morphological operations (dilation and erosion). The size of the structural element of the morphological operation is dynamically adjusted according to the average width of the furrow, ensuring that furrow areas of different sizes can obtain suitable boundary optimization effects. The dilation operation is used to expand the boundary and fill cracks, and the erosion operation is used to correct the boundary and remove the redundant dilation part to ensure the accuracy of the boundary. Through the dilation and erosion operations, the continuity and smoothness of the furrow boundary are optimized, making the identified furrow boundary smoother and more natural, which is particularly suitable for scenes with complex or irregular boundaries. The size of the structural element is dynamically adjusted according to the mean value of the furrow width, so that the method can maintain good adaptability and optimization effects in furrow areas of different sizes, and the accuracy of the boundary will not be affected by changes in the furrow size. Through conditional filtering, noise points or misjudged boundaries can be effectively removed, so that subsequent morphological operations are performed on relatively clean boundary data, further improving the recognition accuracy and optimization effect of the boundary.

[0045] The shape of the structural element of the morphological operation can be selected according to the actual situation, such as using circular, elliptical or diamond structural elements to adapt to the ridge areas of different shapes. The selection of these structural element shapes can better match the geometric characteristics of the ridges. In addition to the expansion and erosion operations, other morphological operations, such as closing and opening operations, can also be introduced to further optimize the smoothness and coherence of the boundaries. The closing operation can remove small internal voids, and the opening operation can remove small protruding areas on the boundary. The size of the structural element can be dynamically adjusted through a more complex model, such as calculating the adaptive structural element size based on the local features of the image, so as to ensure the optimization effect when the width of the ridge boundary is uneven.

[0046] In a possible implementation, the point cloud data acquired in step S1 is collected by a laser radar (LiDAR) or a structured light sensor. The LiDAR generates high-precision three-dimensional point cloud data by emitting a laser beam and receiving its return signal, while the structured light sensor generates point cloud data by projecting a light pattern and capturing the deformation of the light on the surface of an object. These devices can accurately capture the three-dimensional information of the furrow area.

[0047] After data collection, the depth of the furrows in the point cloud data is measured using a three-dimensional coordinate system. By establishing a three-dimensional coordinate system based on the X, Y, and Z axes, the X and Y axes are used to describe the horizontal and vertical position information of the furrow area, and the Z axis is used to measure the depth change of the furrow. This can accurately describe the morphological characteristics of the furrows, especially when the slope or depth of the furrow needs to be finely measured, the three-dimensional point cloud data provides more detailed spatial information.

[0048] The point cloud data generated by the laser radar or structured light sensor contains the three-dimensional coordinates of the furrow area. The depth information of the area can be extracted through the three-dimensional coordinate system. Combined with the X, Y, and Z three-dimensional coordinates, the geometric features of the furrow can be accurately described, providing basic data support for the subsequent segmentation and optimization process. Through the three-dimensional point cloud data obtained by the laser radar or structured light sensor, this embodiment can accurately capture the three-dimensional morphology of the furrow area, especially the depth information of the furrow. Compared with two-dimensional image data, three-dimensional point cloud data has significant advantages in capturing spatial structure, which helps to improve the accuracy of furrow recognition. In addition, the use of a three-dimensional coordinate system makes subsequent data processing (such as segmentation, optimization, etc.) more accurate and intuitive.

[0049] In this embodiment, the laser radar can be replaced by other 3D sensing devices, such as a stereo camera or a time-of-flight (ToF) sensor, to obtain point cloud data. The 3D coordinate system can also be adjusted according to the application scenario, such as using a polar coordinate system to process complex terrain information.

[0050] In a possible implementation, the color conversion in step S2 includes converting the collected color image into a grayscale image. The purpose of this process is to reduce the interference of color information on furrow boundary detection, so as to focus more on the brightness and structural features in the image.

[0051] Color images are composed of color information from three channels: red, green, and blue (RGB). Although color information can help distinguish objects, it may cause noise or interference in some scenes, especially when the color difference is small or the color is similar to the background environment. By converting color images to grayscale images, the influence of color information can be eliminated, so that the image only retains brightness (light intensity) information, which helps to enhance the boundary features of the furrow area.

[0052] In the color conversion process, the gray value is usually calculated by the weighted average of the RGB channels, and the formula is as follows: Gray = 0.299 × R + 0.587 × G + 0.114 × B; where R, G, and B represent the pixel values ​​of the red, green, and blue channels, respectively, and the weighting coefficient is adjusted according to the sensitivity of the human eye to different colors. Through this conversion, each pixel in the image will get a gray value, forming a colorless gray image.

[0053] The color image is converted into a grayscale image through a weighted algorithm, and the converted image only retains brightness information. By eliminating the interference caused by color, the grayscale image can more clearly reflect the boundary features of the furrow, thereby providing a more stable basis for subsequent boundary detection and segmentation. By converting the color image into a grayscale image, this embodiment effectively reduces the interference of color on furrow boundary detection. Since the grayscale image only retains brightness information, it can better highlight the edge and structural features, thereby improving the accuracy of furrow boundary detection. In addition, the data processing volume of the grayscale image is small, which helps to improve the running speed and efficiency of the algorithm compared to the color image.

[0054] In some application scenarios, you can choose other color spaces (such as HSV or Lab) for conversion, or use specific color channels for processing (such as using only the green channel). In addition, after color conversion, you can also combine other image enhancement techniques (such as histogram equalization or edge enhancement filtering) to further highlight the boundary information of the furrows.

[0055] In a possible implementation, the improved random sampling consensus algorithm (RANSAC) in step S3 improves robustness to noisy data by introducing a weighting factor. When processing data, the traditional RANSAC algorithm usually randomly extracts samples from the data set to fit the model and calculates the inliers and outliers of the model. However, when the data set contains more noise or outliers, the traditional RANSAC algorithm is easily affected, resulting in inaccurate model fitting.

[0056] In order to improve the robustness of the algorithm to noise, the improved RANSAC algorithm introduces a weighting factor for each data point. Specifically, in the process of sampling and fitting the model, the algorithm no longer considers all data points to be equal, but assigns different weights to each point based on the confidence, distance or other characteristics of the data point. The weight roughly reflects the probability of each data point being considered an inlier. Noise points are usually assigned lower weights, while more reliable data points are assigned higher weights. The weighted model fitting process will focus more on high-weight data points and reduce the impact of noise points.

[0057] The basic steps of the algorithm are as follows: Random sampling: randomly select several points from the data set as samples; Fitting model: Fit a preliminary furrow boundary model based on the selected samples; Weighted processing: assign weights to each data point. The weights can be calculated based on the distance, confidence or other features of the data point. Noise points have lower weights, while more reliable inliers have higher weights. Consistency assessment: Calculate the difference between the fitted model and all data points, evaluate the number of internal points of the model based on the weights, and improve the resistance to noise points through the weighted average method; Iterative optimization: Repeat the above steps until the best fitting model is found, that is, the model with the largest set of weighted inliers.

[0058] The improved RANSAC algorithm evaluates the credibility of data points by introducing a weighting factor for each data point. Noise points are assigned lower weights, which reduces their impact on the model during the fitting process, thereby improving the robustness of the algorithm. Inliers affect model fitting through higher weights, ensuring that the fitted model is more accurate.

[0059] By introducing the weighting factor, this implementation significantly improves the robustness of the RANSAC algorithm to noisy data, so that the segmentation of furrow boundaries can still maintain a high accuracy in the case of more noise. The weighted algorithm can handle abnormal data points more flexibly, improving the stability and fitting accuracy of the overall model.

[0060] In this embodiment, the weighting factor can be calculated using other criteria, such as the density of local data points or the correlation between adjacent points. In addition, other algorithms (such as the least squares method) can be combined to further optimize the model fitting process, or the weights can be dynamically adjusted using an adaptive threshold. In addition, the weighting factor can be combined with other robustness estimation methods, such as M estimation or Huber loss function, to further improve the performance of the algorithm in complex scenarios.

[0061] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for optimizing a furrow recognition algorithm, characterized in that: The method comprises: S1. Obtaining images or point cloud data of furrow areas; S2. Preprocessing the image or point cloud data, wherein the preprocessing includes denoising, filtering, color conversion and morphological operations; S3, using the improved random sampling consistency algorithm and clustering algorithm to perform preliminary segmentation of the furrow area on the preprocessed data; S4, identifying and optimizing furrow boundaries in the segmented area through a machine learning model, wherein the model is trained through multiple iterations; S5, removing interference information from the furrow boundary by conditional filtering; Wherein, the step S3 uses a density clustering algorithm to cluster the initially segmented data, specifically: Choosing neighborhood radius using k-distance graph and the minimum number of samples, where the k value is equal to the dimension plus 1, calculates the distance of each point to its k neighboring points, and determines the cluster neighborhood based on the following formula: , in, and represents two sample points, and They are respectively indicated in The coordinates of the dimension, represents the Euclidean distance between two points, Indicates the number of dimensions of the sample points, Indicates the dimension index currently being calculated. Represents the neighborhood radius.

2. The optimization method of a furrow recognition algorithm according to claim 1, characterized in that: The pre-processing in step S2 further comprises: Perform color model conversion on image data, convert RGB color model to HSV color model, and voxelize point cloud data.

3. The optimization method of a furrow recognition algorithm according to claim 1, characterized in that: In step S4, a convolutional neural network is used as a machine learning model, and the training process of the model includes the following steps: The preprocessed image data is input into the convolutional neural network for boundary detection, and the cross entropy loss function is used to optimize the model parameters. The loss function is defined as: , in, represents the loss function value, represents the number of samples used for training, represents the sample index, Indicates The true labels of samples, Indicates The probability that a sample is predicted as a positive class by the model; Use stochastic gradient descent to update the network weights. The weight update formula is: , in, Indicates that the model is at the current time step The weight matrix when Indicates that the model is in the next time step +1 is the updated weight matrix, represents the learning rate, Represents the loss function The gradient with respect to the weights.

4. The optimization method of a furrow recognition algorithm according to claim 1, characterized in that: The boundary optimization process in step S5 includes: Conditional filtering is performed on the identified furrow boundaries, the strip interval is set and the centroid is calculated. The specific formula is: and , in, and Represents the coordinates of the center of mass on the X and Y axes, represents the number of samples, Indicates the index of traversing samples, and Indicates The coordinates of the sample points on the X and Y axes.

5. The optimization method of a furrow recognition algorithm according to claim 1, characterized in that: The machine learning models and filters used in step S4 and step S5 are processed by a time synchronizer.

6. The optimization method of a furrow recognition algorithm according to claim 3, characterized in that: The machine learning model uses online data enhancement technology during the training process, specifically including: Transform images in real time by random rotation, scaling, flipping, etc. to generate more training samples; The enhanced transformation parameters are dynamically adjusted by the following formula: , in, represents the strength of data augmentation, represents the minimum enhancement strength, Indicates the maximum enhancement strength, represents the change in loss value, Represents the initial loss value.

7. The optimization method of a furrow recognition algorithm according to claim 1, characterized in that: In the boundary optimization process of step S5, the boundary is further refined through conditional filtering and morphological operations, specifically including: Use morphological dilation and erosion operations to optimize the smoothness of furrow boundaries; The size of the structural element of the morphological operation is dynamically adjusted according to the size of the furrow. The specific formula is: , in, Indicates the size of the structure element of the morphological operation, represents the mean width of furrows, Represents the adjustment coefficient.

8. The optimization method of a furrow recognition algorithm according to claim 1, characterized in that: The point cloud data obtained in step S1 is collected by a laser radar or a structured light sensor, and the depth information of the furrows is measured using a three-dimensional coordinate system.

9. The optimization method of furrow recognition algorithm according to claim 1, characterized in that: The color conversion in step S2 converts the color image into a grayscale image to reduce the interference of color information on furrow boundary detection.

10. The optimization method of furrow recognition algorithm according to claim 1, characterized in that: The improved random sampling consensus algorithm in step S3 improves the robustness to noise data by introducing a weighting factor.

Citation Information

Patent Citations

  • Rice spike segmentation method of big paddy field based on deep learning and super-pixel segmentation

    CN107316289A

  • Farmland seedling ridge identification method and system based on semanteme and instance segmentation

    CN110765916A

  • Three-dimensional point cloud clustering recognition method and system based on image recognition

    CN113935428A

  • Rain and snow sky lane line detection method and system based on generative adversarial network

    CN115272995A

  • Farmland and tractor track boundary line extraction method and system

    CN116091951A

Cited By

  • Intelligent segmentation method and system for space steel structure nodes

    CN119672040A