Agricultural machine motion mode recognition algorithm and device driven by trajectory distribution characteristics, equipment and storage medium

By combining data cleaning driven by distribution characteristics and deep learning models with agricultural machinery trajectory data, the problem of low accuracy in agricultural machinery trajectory point recognition has been solved, achieving high-precision recognition of agricultural machinery movement patterns and supporting the rational planning of rural road networks.

CN118520394BActive Publication Date: 2026-11-20SHANDONG COMP SCI CENTNAT SUPERCOMP CENT IN JINAN +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410589830.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-13
Publication Date
2026-11-20
Estimated Expiration
2044-05-13

AI Technical Summary

Technical Problem

Existing technologies contain anomalies (such as spatiotemporal repetition points, discrete points, and drift points) in agricultural machinery trajectory data, resulting in low accuracy in recognizing agricultural machinery movement patterns and affecting the effective construction of rural road networks.

Method used

By designing a data cleaning method based on trajectory distribution features, including removing spatiotemporal repeating points, discrete points, and drifting points, and combining a deep learning model to extract deep features from motion and distribution features, the BiLSTM-Based model is used to identify the motion patterns of agricultural machinery.

Benefits of technology

It effectively improves the accuracy of agricultural machinery trajectory point recognition, ensures data quality and recognition reliability, enhances the recognition accuracy of agricultural machinery movement patterns, and supports the efficient construction of rural road networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118520394B_ABST
    Figure CN118520394B_ABST
Patent Text Reader

Abstract

The present application relates to the field of agricultural machinery motion recognition technology, and specifically relates to an agricultural machinery motion mode recognition algorithm driven by trajectory distribution characteristics, a device, equipment and a storage medium. The method comprises the following steps: obtaining original data of agricultural machinery motion trajectory to obtain a trajectory data set; removing time-space repeated points, discrete points and drift points in the trajectory data set through data cleaning; calculating motion characteristics and distribution characteristics of each trajectory point in the trajectory data set after data cleaning, and taking the motion characteristics and the distribution characteristics as input characteristics; the distribution characteristics include density characteristics and parallel characteristics; deep learning model is used to extract deep features from the input characteristics, and the agricultural machinery motion trajectory points are recognized. The present application can effectively improve the recognition accuracy of agricultural machinery trajectory points by combining motion characteristics and distribution characteristics with deep learning model, and obtain more accurate agricultural machinery motion mode recognition results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of agricultural machinery motion recognition technology, specifically to an algorithm, device, equipment, and storage medium for recognizing agricultural machinery motion patterns driven by trajectory distribution features. Background Technology

[0002] In recent years, Global Navigation Satellite System (GNSS) technology has developed rapidly and has been widely applied to agricultural machinery. Agricultural machinery equipped with GNSS devices is known as intelligent agricultural machinery and is widely used in the agricultural field, generating massive amounts of agricultural machinery trajectory data. This data records the operating time, latitude and longitude coordinates, speed, and direction information of the agricultural machinery, intuitively reflecting its operating status and geographical location in the fields and on roads. In addition, this data contains other richer spatiotemporal information and is widely used in the field of data mining.

[0003] Agricultural machinery movement pattern recognition is an important task in the field of data mining. This task involves classifying agricultural machinery movement trajectory points into "field operation points" and "road travel points," which is an important means of constructing rural road networks. Specifically, rural road network planning based on trajectory point recognition results can make agricultural machinery transportation routes more rational, achieve efficient and coordinated operation of agricultural machinery in different regions, and facilitate the smooth transportation of equipment and resources across different areas, thereby greatly reducing transportation time and fuel consumption.

[0004] However, agricultural machinery typically operates outdoors, and the collection and transmission of trajectory data are affected by factors such as weather conditions, terrain, and signal interference. These factors result in numerous anomalies in the acquired agricultural machinery trajectory data, primarily including spatiotemporal repetition points, discrete points, and drift points. These anomalies affect the accuracy of subsequent identification of agricultural machinery movement patterns, thereby impacting the effective construction of rural road networks.

[0005] In addition, the raw trajectory data only records time, latitude and longitude, speed, and direction, which are insufficient for high-precision identification. Therefore, existing technologies enrich trajectory data by designing motion features such as acceleration, angular velocity, and angular acceleration, thereby improving the accuracy of trajectory point identification. For example, Chinese patent CN117591938A discloses a neural network-based algorithm for extracting the spatiotemporal characteristics and recognizing the behavior of agricultural machinery trajectories. This method designs five motion features: acceleration, angular velocity, direction difference, angular velocity difference, and displacement, and combines them with speed and direction as input features to a BiLSTM+CE 1DFCN neural network model. While this method improves recognition accuracy, these motion features fail to fully reflect the distribution characteristics of agricultural machinery, such as the density and parallelism of trajectory points, which makes it difficult to significantly improve recognition accuracy. This is because field trajectory points are denser and have more parallel points than road trajectory points; simply using motion features cannot better reflect the distribution of agricultural machinery, resulting in poor learning ability and recognition accuracy of the neural network.

[0006] Therefore, in order to improve the accuracy of agricultural machinery movement pattern recognition, there is an urgent need for a method that can effectively eliminate abnormal points in agricultural machinery trajectories and enrich the characteristics of agricultural machinery trajectories. Summary of the Invention

[0007] The purpose of this invention is to provide an agricultural machinery motion pattern recognition algorithm driven by trajectory distribution features. This method can solve the problem of low accuracy in the existing technology for recognizing agricultural machinery trajectory points. By combining motion and distribution features with a deep learning model, it effectively improves the recognition accuracy of agricultural machinery trajectory points and obtains more accurate agricultural machinery motion pattern recognition results.

[0008] To achieve the above objectives, the present invention adopts the following technical solution:

[0009] In a first aspect of the invention, an algorithm for recognizing agricultural machinery motion patterns driven by trajectory distribution features is disclosed. The method includes the following steps:

[0010] S1. Obtain the raw data of the agricultural machinery's movement trajectory to obtain a trajectory data set;

[0011] S2. Clean the trajectory data set by removing spatiotemporal repetition points, discrete points, and drift points.

[0012] S3. Calculate the motion characteristics and distribution characteristics of each trajectory point in the cleaned trajectory data set, and use the motion characteristics and distribution characteristics as input features; the distribution characteristics include density characteristics and parallelism characteristics.

[0013] S4. Use a deep learning model to extract deep features from the input features and identify the movement trajectory points of the agricultural machinery.

[0014] According to a preferred embodiment of the present invention, in step S2, data cleaning is performed on the trajectory data set to remove spatiotemporal repeating points, discrete points, and drift points, including:

[0015] S21. Remove spatiotemporal duplicate points: If consecutive trajectory points have the same timestamp or the same latitude and longitude coordinates, then except for the first point, the other trajectory points are considered spatiotemporal duplicate points. The first point in the consecutive trajectory points is retained, and the other trajectory points are removed.

[0016] S22. Remove discrete points: Use the average distance comparison method based on moving window to remove discrete points from the trajectory data set;

[0017] S23. Remove drift points: Use a comparison method based on the distance between adjacent points to remove drift points.

[0018] According to a preferred embodiment of the present invention, step S22, based on the average distance comparison method of the moving window, includes:

[0019] Set a moving window of length t, that is, process t adjacent points at time each time the movement is made, and use the moving window to calculate the average displacement of t adjacent points at time around the current trajectory point; use the average displacement as the average displacement feature dAverage of the current trajectory point, compare the average displacement feature dAverage with the threshold l, and if dAverage is less than the threshold l, the trajectory point is determined to be a discrete point and the trajectory point is removed.

[0020] The average distance comparison method based on the moving window is implemented using the following formula:

[0021] Δlon k =lon k -lon k-1 ,Δlat k =lat k -lat k-1 (1)

[0022]

[0023]

[0024]

[0025] if dAverage k ≤l,rm(P k (5)

[0026] In formulas (1)-(5), Δlon k Indicates the change in longitude at the k-th point; lon kIndicates the longitude of the k-th point; lon k-1 Δlat represents the longitude of the (k-1)th point. k Indicates the latitude change at the k-th point; lat k lat represents the latitude of the k-th point; k-1 Let represent the latitude of the (k-1)th point; b and c are intermediate variables in the calculation process; R represents the average radius of the Earth in meters, with a value of 6371000; Δd k dAverage represents the distance characteristic of the k-th point, in meters. k represents the average distance change from point k to point k+t; i is an auxiliary variable representing the distance from k points to k+t points; k is the index of the point, ranging from 1 to N, where N is the total number of points in the current trajectory; t is the length of the moving window; rm(P k Used to delete discrete point P k ;l represents the threshold for determining whether to delete discrete points; rm(P) k Used to delete discrete point P k .

[0027] According to a preferred embodiment of the present invention, step S23, which involves eliminating drift points using a comparison method based on the distance between adjacent points, includes:

[0028] If a point P K to its previous point P K-1 The distance is greater than that of point P. K-1 Point P K-2 The distance is m times the distance to point P, and the point P is... K To the next point P K+1 The distance is greater than that of point P. K+1 Point P K+2 If the distance to point P is m times the distance to point P, then the point P is P. K It was identified as a drift point;

[0029] The method of eliminating drift points using a comparison based on the distance between adjacent points is implemented using the following formula:

[0030] Δlon k =lon k -lon k-1 ,Δlat k =lat k -lat k-1 (6)

[0031]

[0032]

[0033]

[0034] In formulas (6)-(9), Δlon k Indicates the change in longitude at the k-th point; lon k Indicates the longitude of the k-th point; lon k-1 Δlat represents the longitude of the (k-1)th point. k Indicates the latitude change at the k-th point; lat k lat represents the latitude of the k-th point; k-1 Let represent the latitude of the (k-1)th point; b and c are intermediate variables in the calculation process; R represents the average radius of the Earth, in meters, with a value of 6371000; Δd k The distance feature of the k-th point is represented in meters; m represents the threshold factor for determining whether to delete a drifting point; Δd k+1 Represents the distance feature of the (k+1)th point; rm(P) k-1 ) indicates the point used to delete drift point P. k-1 ;rm(P k ) indicates the point used to delete drift point P. k ;Δd k-1 Δd represents the distance characteristic of the (k-1)th point; k+2 The distance feature of the (k+2)th point is represented by "and"; "and" indicates "and"; K is the distance feature of point P. K The index value of K is between 0 and N-1; d K For P K-1 To P K The distance; N represents the number of points in a given set of trajectories; k represents the index of a trajectory point, between 0 and N-1; P k This represents the k-th trajectory point.

[0035] According to a preferred embodiment of the present invention, in step S3, the motion characteristics and distribution characteristics of each trajectory point in the cleaned trajectory data set are calculated, and the motion characteristics and distribution characteristics are used as input features, including:

[0036] S31. Calculate the motion characteristics of the trajectory points using the time relationship between trajectory points in the trajectory data set; the motion characteristics include velocity, velocity difference, acceleration, displacement, direction, direction difference, angular velocity, and angular velocity difference;

[0037] S32. Based on the spatial relationships between trajectory points in the trajectory data set, calculate the density feature and parallelism feature of the trajectory points; the density feature represents the number of trajectory points within a square centered on the latitude and longitude coordinates of a certain trajectory point; the parallelism feature represents the number of trajectory points within a square centered on the latitude and longitude coordinates of a certain trajectory point p. i The orbital point p is located within a square centered on the latitude and longitude coordinates. i The number of points that are approximately parallel;

[0038] In step S31, the motion characteristics are calculated using the time relationship between trajectory points, which is achieved using the following formula:

[0039]

[0040] Δdir k =(dir k -dir k-1 +θ1)modθ1,θ1=360° (11)

[0041]

[0042] Δlon k =lon k -lon k-1 ,Δlat k =lat k -lat k-1 (13)

[0043]

[0044]

[0045] In formulas (10)-(15), Δv k This represents the velocity change at the k-th trajectory point; v k v represents the velocity of the k-th trajectory point; k-1 a represents the velocity of the (k-1)th trajectory point; k t represents the acceleration of the k-th trajectory point; k The timestamp of the k-th trajectory point; t k-1 Represents the timestamp of the (k-1)th trajectory point; Δdir k Indicates the change in direction of the k-th trajectory point; dir k Indicates the direction of the k-th trajectory point; dir k-1 The direction of the (k-1)th trajectory point is represented by θ; mod represents the modulo operation; θ I Used to ensure that angle changes are within 360 degrees; ω k Δω represents the angular velocity of the k-th trajectory point. k ω represents the change in angular velocity at the k-th trajectory point; k-1 Δlon represents the angular velocity of the (k-1)th trajectory point. k Indicates the change in longitude at the k-th point; lon k Indicates the longitude of the k-th point; lon k-1 Δlat represents the longitude of the (k-1)th point. k Indicates the latitude change at the k-th point; lat klat represents the latitude of the k-th point; k-1 Let represent the latitude of the (k-1)th point; b and c are intermediate variables in the calculation process; R represents the average radius of the Earth, in meters, with a value of 6371000; Δd k This represents the distance characteristic of the k-th point, in meters.

[0046] According to a preferred embodiment of the present invention, in step S4, deep features are extracted from the input features using a deep learning model, and the movement trajectory points of the agricultural machinery are identified, including:

[0047] S41. Design of a deep learning model: The deep learning model adopts a BiLSTM-Based model; the BiLSTM-Based model includes a BiLSTM module, a fully connected layer, and a Sigmoid layer; the Sigmoid layer uses the Sigmoid activation function;

[0048] S42. Using the BiLSTM module, extract deep-level features from the motion and distribution features of trajectory data;

[0049] S43. Based on deep features, use fully connected layers and Sigmoid layers to identify trajectory points.

[0050] According to a preferred embodiment of the present invention, the BiLSTM module comprises two LSTM networks, the expressions of which are as follows:

[0051] h i =LSTM(x i h i-1 (16)

[0052] In formula (16), x i h is the feature vector of the i-th trajectory point; i Represents the deep features of the i-th trajectory point; h i-1 This represents the deep-level features of the (i-1)th trajectory point;

[0053]

[0054] In formula (17), Capture the temporal dependencies of past points from the i-th trajectory point; Capture the temporal dependencies of past points from the (i-1)th trajectory point; Capture the temporal dependencies of past points from the (i+1)th trajectory point; Learn the temporal dependencies of future points from the i-th trajectory point; x i h is the feature vector of the i-th trajectory point; iRepresents the deep features of the i-th trajectory point; h i+1 This represents the deep-level features of the (i+1)th trajectory point.

[0055] According to a preferred embodiment of the present invention, in step S42, a BiLSTM module is used to extract deep-level features from the motion and distribution features of the trajectory data, including:

[0056] The used trajectory and its reverse trajectory are obtained from the cleaned trajectory dataset. A BiLSTM module is then used to learn deep-level features h from these two trajectories. i ;

[0057] Here, the trajectory refers to the ordered set of motion points collected by the positioning device, the reverse trajectory is the set of motion points in the opposite direction of the corresponding trajectory, and the deep feature h i It combines time information from the past and the future.

[0058] According to a preferred embodiment of the present invention, in step S43, trajectory point recognition is performed based on deep features using a fully connected layer and a Sigmoid layer, including:

[0059] Based on deep features h i The i-th trajectory point is classified through a fully connected layer and a sigmoid activation function; using the sigmoid activation function, the predicted probability distribution p of the trajectory point in the categories of "field" and "road" is obtained. i Based on probability distribution, determine the category of agricultural machinery trajectory points;

[0060] The expression for the Sigmoid activation function is as follows:

[0061]

[0062] In formula (18), f(x) represents the Sigmoid function, which physically maps x to a probability value between 0 and 1; e is a constant, approximately equal to 2.71828; and x represents the input of the Sigmoid function.

[0063] According to a preferred embodiment of the present invention, the loss function FC of the BiLSTM-Based model is:

[0064]

[0065] In formula (19), Let t represent the probability that the t-th trajectory point is in the predicted category of field or road. α and γ are pre-set parameters. α is used to handle class imbalance, and γ is used to reduce the contribution of easily identifiable points to the final loss.

[0066] In a second aspect, a device for recognizing agricultural machinery motion behavior based on multi-feature enhancement is disclosed. The device includes a trajectory data acquisition module, a trajectory data cleaning module, a trajectory point feature acquisition module, and an agricultural machinery motion trajectory point recognition module.

[0067] The trajectory data acquisition module is used to acquire the original data of the agricultural machinery's movement trajectory to obtain a trajectory data set.

[0068] The trajectory data cleaning module is used to clean the trajectory data set by removing spatiotemporal repeating points, discrete points, and drifting points.

[0069] The trajectory point feature acquisition module is used to calculate the motion features and distribution features of each trajectory point in the cleaned trajectory data set, and to use the motion features and distribution features as input features; the distribution features include density features and parallel features.

[0070] The agricultural machinery trajectory point recognition module is used to extract deep features from input features using a deep learning model and to recognize the agricultural machinery trajectory points.

[0071] In a third aspect of the invention, an electronic device is disclosed, comprising: at least one processor; and a memory storing instructions that, when executed by the at least one processor, cause the at least one processor to execute the agricultural machinery motion pattern recognition algorithm driven by trajectory distribution features.

[0072] In a fourth aspect of the invention, a machine-readable storage medium is disclosed, which stores executable instructions that, when executed, cause the machine to perform the agricultural machinery motion pattern recognition algorithm driven by trajectory distribution features.

[0073] Compared with the prior art, the advantages of the present invention are:

[0074] (1) In terms of data cleaning, existing technologies mainly focus on removing spatiotemporal duplicate points, while neglecting the cleaning of discrete and drifting points. Compared with these technologies, this invention, based on the cleaning of spatiotemporal duplicate points, also provides an average distance comparison method based on moving windows and a comparison method based on the distance between adjacent points to effectively remove discrete and drifting points. By effectively removing discrete and drifting points, this invention greatly improves the quality of trajectory data, ensures the accuracy and reliability of the data, and provides a reliable data foundation for subsequent research.

[0075] (2) Regarding feature enhancement, existing technologies mainly focus on the design of motion features (MF), while neglecting the study of distribution features (DIF). Compared to these technologies, this invention, based on eight motion features, also provides a statistical method based on spatial relationships to extract density features (DF) and parallel features (PF) of trajectory points from the original trajectory data. By designing the density and parallel features of trajectory points, this invention fully reflects the distribution of agricultural machinery, making the trajectory features richer and greatly improving the learning ability of the neural network.

[0076] (3) In trajectory point recognition, existing technologies mainly utilize deep learning models to extract deep features from motion features to achieve the recognition task; however, they neglect to extract features from distribution features. In contrast to these technologies, this invention provides a Bi-directional Long Short-Term Memory Network (BiLSTM) model that extracts deep features from both motion and distribution features. Compared to simply utilizing motion features, this invention fully utilizes trajectory data by extracting deep features from both motion and distribution features using a deep learning model, achieving high-precision trajectory point recognition. Attached Figure Description

[0077] Figure 1 This is a flowchart of the agricultural machinery motion pattern recognition algorithm driven by trajectory distribution features in this invention;

[0078] Figure 2 This is a schematic diagram of the agricultural machinery motion pattern recognition algorithm driven by trajectory distribution features in this invention;

[0079] Figure 3a , Figure 3b and Figure 3c These are three sets of example diagrams of agricultural machinery trajectory data;

[0080] Figure 4 This is an example diagram of agricultural machinery trajectories containing discrete points;

[0081] Figure 5 This is a schematic diagram of the principle of removing discrete points based on the average distance comparison method of a moving window;

[0082] Figures 6a to 6f This is a cleaning effect diagram of a set of discrete point trajectories under various threshold values; among them, Figure 6a This is the original trajectory diagram; Figure 6b This is a screenshot showing the cleaning effect when the threshold is 5. Figure 6c This is a screenshot showing the cleaning effect when the threshold is 1. Figure 6d This is a picture showing the cleaning effect when the threshold is 0.5; Figure 6e This is a screenshot showing the cleaning effect when the threshold is 0.1. Figure 6fThis is a picture of the cleaning effect when the threshold is 0.05;

[0083] Figure 7 This is an example diagram of a trajectory containing drift points;

[0084] Figure 8a and Figure 8b This is a schematic diagram illustrating the principle of removing drift points based on the comparison of distances between adjacent points; among which, Figure 8a This is a schematic diagram of the normal trajectory segment; Figure 8b It is a schematic diagram of a trajectory segment containing drift points;

[0085] Figures 9a to 9d These are example images of drift point trajectory cleaning under different thresholds; among them, Figure 9a This is the original trajectory diagram; Figure 9b This is a picture of the cleaning effect when the threshold is 6; Figure 9c This is a screenshot showing the cleaning effect when the threshold is 5. Figure 9d This is a screenshot showing the cleaning effect when the threshold is 4.

[0086] Figure 10 This is an example diagram of a square region based on the foldback spacing;

[0087] Figure 11 This is a diagram of the BiLSTM-Based model architecture. Detailed Implementation

[0088] The present disclosure will be further described below with reference to the accompanying drawings and embodiments:

[0089] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of this disclosure. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure pertains.

[0090] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this disclosure. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0091] Where there is no conflict, the embodiments and features described herein can be combined with each other.

[0092] To address the shortcomings of existing technologies, this invention provides an agricultural machinery motion pattern recognition algorithm, device, equipment, and storage medium driven by trajectory distribution features. Specifically, it involves data cleaning and feature enhancement methods based on mathematical statistical rules, as well as an agricultural machinery motion pattern recognition algorithm based on deep learning technology, to solve the technical problem that the accuracy of agricultural machinery trajectory point recognition is difficult to significantly improve in existing technologies.

[0093] This invention, based on the spatiotemporal relationship between trajectory points, performs effective feature engineering on trajectory data to obtain the distribution characteristics of trajectory points. Specifically, the agricultural machinery motion pattern recognition algorithm driven by trajectory distribution characteristics described in this invention includes four parts: data acquisition, data cleaning, data augmentation, and trajectory point recognition.

[0094] Example 1

[0095] This embodiment provides an algorithm for recognizing agricultural machinery movement patterns driven by trajectory distribution features, such as... Figure 1 and Figure 2 As shown, the method includes the following steps:

[0096] S1. Data Acquisition: Acquire the raw data of the agricultural machinery's movement trajectory to obtain a trajectory data set.

[0097] This invention first randomly selects 100 pre-labeled sets of agricultural machinery trajectory data from the Shandong Provincial Agricultural Machinery Management Cloud Platform. This data, originating from Yanzhou District, Jining City, Shandong Province, is named the Harvester dataset. The selected trajectory data is in the following format: Figure 3a , Figure 3b and Figure 3c As shown. In Figure 3a , Figure 3b and Figure 3c In the table, one table represents all the trajectory points of a certain agricultural machine during its operation on that day, i.e., a set of trajectories. In addition, each row of data in the table represents a trajectory point of the agricultural machine during its operation, recording the time (timestamp), longitude (longitude), latitude (latitude), speed (speed), direction (direction), and type (type) of that trajectory point.

[0098] exist Figures 3a-3b In the data, the type has two values: "0" and "1". "0" represents a road trajectory point, and "1" represents a field trajectory point. The total number of trajectory points, field points, and road points in Harvester, as well as the ratio of the number of field points and road points, are shown in Table 1.

[0099] Table 1 Harvester Statistics

[0100] Parameter name Parameter value Number of trajectories 100 Number of trajectory points 1,152,867 Number of field trajectory points 873,383 Number of road trajectory points 279,484 The ratio of field points to road points 0.7576:0.2424 GNSS receiver sampling time 2 seconds GNSS receiver sampling accuracy 5 meters

[0101] Table 1 shows that the number of field points in Harvester is much greater than the number of road points, indicating a class imbalance problem. This is because agricultural machinery spends most of its time in the fields, such as tilling, sowing, and harvesting, while spending relatively little time on roads. Class imbalance causes the neural network to overlearn the features of field points during training, while learning very few features of road points. This leads to many road points being misidentified as field points during the prediction stage, affecting the final recognition accuracy. To improve subsequent recognition performance, this invention employs the Focal Loss (FC) loss function in the model training section to mitigate the class imbalance problem.

[0102] S2. Data Cleaning: Clean the trajectory data set by removing spatiotemporal repetition points, discrete points, and drift points.

[0103] Agricultural machinery typically operates outdoors, and the collection and transmission of trajectory data are affected by factors such as weather conditions, terrain, and signal interference. These factors result in numerous outliers in the acquired agricultural machinery trajectory data, primarily including spatiotemporal repetition points, discrete points, and drift points. These outliers affect the accuracy of subsequent identification of agricultural machinery movement patterns, thereby impacting the effective construction of rural road networks.

[0104] To avoid the negative impact of outlier data, this invention employs three data cleaning methods to remove these points from Harvester. The specific implementation steps of the three methods are shown in the following sections:

[0105] S21. Removal of Spatiotemporal Duplicate Points

[0106] When consecutive trajectory points have the same timestamp or the same latitude and longitude coordinates, all trajectory points except the first one are considered spatiotemporally repeated points. Therefore, it is necessary to retain the first point in a consecutive trajectory and discard the other trajectory points.

[0107] The spatiotemporal repetition point removal method in this embodiment is shown in the code in Table 2.

[0108] Table 2 Methods for Removing Spatiotemporal Duplicate Points

[0109]

[0110]

[0111]

[0112] After removing the spatiotemporal duplicates as described above, Harvester's statistics are shown in Table 3.

[0113] Table 3 Harvester information before and after removing spatiotemporal duplicate points.

[0114] Parameter name Parameter value Number of trajectory points before removal 1,152,867 Number of track points after removal 890,333 Number of field track points before removal 873,383 Number of field track points after removal 782,596 Number of road trajectory points before removal 279,484 Number of road trajectory points after removal 107,737 The ratio of field points to road points before removal 0.7576:0.2424 The ratio of the number of field points to road points after removal 0.8790:0.1210

[0115] Table 3 shows that by using the spatiotemporal duplicate point removal method, a total of 262,534 spatiotemporal duplicate points were removed from Harvester, resulting in 890,333 trajectory points. This large-scale removal of points will bring significant benefits to subsequent data augmentation, model training, and prediction processes.

[0116] Based on this, the removal of spatiotemporal duplicates can not only greatly optimize Harvester's data quality, providing more reliable and accurate training samples for deep learning models, thereby improving the robustness and generalization ability of the models; it can also reduce the consumption of computing resources by outliers, greatly improve computing efficiency, and accelerate the execution speed of subsequent tasks.

[0117] S22, Removal of Discrete Points

[0118] When agricultural machinery stops on the road or enters / exits a garage, the GNSS receiver records many dense, discrete points. These points are scattered within a small area of ​​the actual location of the agricultural machinery, such as... Figure 4 Points within the circular area. These points, similar to field points in terms of high density, slow speed, and short displacement, can negatively impact the model's learning ability and reduce the accuracy of agricultural machinery movement pattern recognition. Furthermore, the presence of these discrete points hinders the construction of rural road networks, which requires continuous trajectory points along the roads. Therefore, these discrete points need to be removed to ensure the accuracy and usability of the trajectory data.

[0119] This invention proposes a moving window-based average distance comparison method to eliminate these discrete points, thereby improving the quality of trajectory data. The basic principle of this method is as follows: Figure 5 As shown.

[0120] Specifically, the motion characteristics of field points, road points, and discrete points are first analyzed. Field points have slow speeds, are in uniform motion most of the time, and have short displacements. Road points have fast speeds, are in uniform or accelerating motion most of the time, and have long displacements. Compared to field and road points, discrete points have very low speeds, are stationary or decelerating most of the time, and have very short displacements. Based on these differences in motion, this invention uses the displacement characteristics of trajectory points as an indicator for whether to delete a point; that is, if the displacement of a point is less than a threshold l, then the point is considered a discrete point. However, simply using the displacement characteristics of a point to determine whether it is a discrete point is inappropriate. Because the displacement of some field points is also very small, this could lead to a large number of field points being mistakenly deleted if the threshold l is too large. Therefore, to ensure that a large number of field points are not mistakenly deleted, this invention introduces the concept of a moving window to effectively remove discrete points. That is, a moving window of length t is used to calculate the average displacement of the current point's t time-interval neighboring points, and then this value is used as the average displacement characteristic dAverage of the current point. Finally, the average displacement feature is compared with a threshold. If dAverage is less than the threshold l, then the point is a discrete point. By utilizing the average displacement feature of neighboring points, the movement trend and clustering of points within the current time period can be comprehensively reflected, thus more effectively eliminating discrete points.

[0121] The moving window-based tie-distance comparison method is implemented using the following formula:

[0122] Δlon k =lon k -lon k-1 ,Δlat k =lat k -lat k-1 (1)

[0123]

[0124]

[0125]

[0126] if dAverage k ≤l,rm(P k (5)

[0127] In formulas (1)-(5), Δlon k Indicates the change in longitude at the k-th point; lon k Indicates the longitude of the k-th point; lon k-1 Δlat represents the longitude of the (k-1)th point. k Indicates the latitude change at the k-th point; lat k lat represents the latitude of the k-th point;k-1 Let represent the latitude of the (k-1)th point; b and c are intermediate variables in the calculation process; R represents the average radius of the Earth, in meters, with a value of 6371000; Δd k dAverage represents the distance characteristic of the k-th point, in meters. k represents the average distance change from point k to point k+t; i is an auxiliary variable representing the distance from k points to k+t points; k is the index of the point, ranging from 1 to N, where N is the total number of points in the current trajectory; t is the length of the moving window; rm(P k Used to delete discrete point P k ; l represents the threshold for determining whether to delete discrete points; rm(P) k Used to delete discrete point P k .

[0128] In this invention, the moving window length t is set to 20. After determining t, regarding the selection of the threshold l, this invention uses the sampling accuracy of the GNSS receiver (5 meters) as a reference, setting l to 5, 1, 0.5, 0.1, and 0.05 respectively, and conducting comparative experiments to evaluate the removal effect of discrete points. The experimental results are shown in Table 4.

[0129] Table 4. Parameter settings and changes before and after Harvester for removing discrete points.

[0130]

[0131]

[0132] Table 4 shows that as l increases, the total number of deleted field and road points also increases. This is because the average displacement calculated within the moving window is relatively small, while a large threshold l leads to the deletion of a large number of points. Therefore, the value of l should not be too large. In addition, to more intuitively observe the deletion of discrete points, Figure 5 It provides the cleaning effect diagrams of a set of discrete point trajectories under various thresholds.

[0133] Figure 6 shows the cleaning effect of a set of discrete point trajectories under various threshold values; where... Figure 6a This is the original trajectory diagram; Figure 6b This is a screenshot showing the cleaning effect when the threshold is 5. Figure 6c This is a screenshot showing the cleaning effect when the threshold is 1. Figure 6d This is a picture showing the cleaning effect when the threshold is 0.5; Figure 6e This is a screenshot showing the cleaning effect when the threshold is 0.1.

[0134] Figure 6fFigure 6 shows the cleaning effect when the threshold is 0.05. It illustrates that when l is set to 5, a large number of normal field and road points are mistakenly deleted. However, when l is set to 0.05 and 0.1, almost no discrete points are deleted. When l is set to 0.5 and 1, the deletion of discrete points is more effective, and the number of mistakenly deleted normal field and road points is smaller.

[0135] However, even with l = 0.5, many discrete points still exist, which can affect the learning ability of the subsequent neural network model. Based on the above experimental results, this invention sets l to 1, ultimately obtaining a Harvester dataset with 747,096 field points, 89,105 road points, and a total of 836,201 points. By selecting an appropriate l value, the interference from discrete points is mitigated, while retaining a large number of normal field and road points, laying a good foundation for subsequent data processing and analysis.

[0136] S23, Drift Point Removal

[0137] A drift point is characterized by its extremely large distances from both its preceding and following points. This unusual distance is caused by factors such as satellite signal interference, equipment malfunction, or sudden changes in motion. A trajectory containing a drift point is shown below. Figure 7 As shown, the existence of drift points affects the accuracy and reliability of trajectory data, therefore drift points need to be removed.

[0138] This invention proposes a method based on the comparison of distances between adjacent points to eliminate drifting points, thereby improving the quality of trajectory data. The basic principle of this method is shown in Figure 8. Here, N is the number of trajectory points, and K is the distance between point P and point P. K The index value, K is between 0 and N-1, d K For P K-1 To P K The distance, where m is a multiple threshold.

[0139] In a normal trajectory, the characteristics of consecutive trajectory points are usually similar; for example, the distance between them is not too large. Figure 8a As shown. However, if there are drift points in a trajectory, the distances from those points to both the preceding and following points are very large, such as... Figure 8b As shown. Therefore, based on the characteristic that the distance from a drift point to both its preceding and following points is very large, this invention uses the comparison of distances with distance multiples to determine whether a point is a drift point. Specifically, if a point P K to its previous point P K-1 The distance is greater than that of point P. K-1 Point P K-2 The distance is m times the distance to point P, and the point P is... K To the next point P K+1 The distance is greater than that of point P. K+1Point P K+2 If the distance to point P is m times the distance to point P, then the point P is P. K It was identified as a drift point.

[0140] The comparison method based on the distance between adjacent points is implemented using the following formula:

[0141] Δlon k =lon k -lon k-1 ,Δlat k =lat k -lat k-1 (6)

[0142]

[0143]

[0144]

[0145] In formulas (6)-(9), Δlon k Indicates the change in longitude at the k-th point; lon k Indicates the longitude of the k-th point; lon k-1 Δlat represents the longitude of the (k-1)th point. k Indicates the latitude change at the k-th point; lat k lat represents the latitude of the k-th point; k-1 Let represent the latitude of the (k-1)th point; b and c are intermediate variables in the calculation process; R represents the average radius of the Earth, in meters, with a value of 6371000; Δd k The distance feature of the k-th point is represented in meters; m represents the threshold factor for determining whether to delete a drifting point; Δd k+1 Represents the distance feature of the (k+1)th point; rm(P) k-1 ) indicates the point used to delete drift point P. k-1 ;rm(P k ) indicates the point used to delete drift point P. k ;Δd k-1 Δd represents the distance characteristic of the (k-1)th point; k+2 The distance feature of the (k+2)th point is represented by "and"; "and" indicates "and"; k is the distance feature of point P. K The index value of d represents the index of the trajectory point, where k is between 0 and N-1; K For P K-1 To P K The distance; N represents the number of points in a given set of trajectories; P k This represents the k-th trajectory point.

[0146] Regarding the selection of the threshold m, to determine the upper limit of m, this invention first analyzes the trajectory data after removing discrete points. By statistically analyzing the distances between field points and road points, it was found that at a 2-second acquisition interval, the displacement of most field points was concentrated between 0.5 meters and 3.1 meters, and the displacement of most road points was concentrated between 1.2 meters and 7.4 meters. Therefore, this invention uses the ratio of the maximum to the minimum point distance as the upper limit of m. In the field points, the displacement ratio is approximately 6.2. In the road points, the ratio of the two displacements is approximately 6.17. Therefore, this invention sets the upper limit of the multiple m to 6. Then, this invention sets the multiple m to 6, 5, and 4 respectively for comparative experiments to verify the effect of removing drift points. The experimental results are shown in Table 5.

[0147] Table 5. Parameter settings for removing drift points and changes before and after Harvester.

[0148]

[0149] Table 5 shows that the total number of deleted field points and road points increases as the value of m decreases. This is because when m decreases, the restriction on drift points by this method weakens, leading to the false deletion of a larger number of perfectly valid points. To more intuitively observe the deletion of drift points, Figure 8a and Figure 8b This provides a diagram showing the removal effect of a set of agricultural machinery trajectories containing drift points under various threshold values. Figure 8b In the middle, when d k ≥m×d k-1 And d k-1 ≥m×d k+2 P k This is the drift point.

[0150] Figure 9a This is the original trajectory diagram; Figure 9b This is a screenshot showing the cleaning effect when the threshold is 6. Figure 9c This is a screenshot showing the cleaning effect when the threshold is 5. Figure 9d Figure 9 shows the cleaning effect when the threshold is 4. It demonstrates that drift points can be deleted when m is set to 4, 5, and 6, proving the effectiveness of the proposed method. However, smaller values ​​of m weaken the restriction on drift points, leading to the deletion of a larger number of normal points. Therefore, this invention sets the value of m to 6 to ensure the integrity of the trajectory data. Finally, after deleting spatiotemporal duplicate points, discrete points, and drift points, trajectory data with high integrity and reliability is obtained. The statistical information of Harvester before and after cleaning is shown in Table 6.

[0151] Table 6. Harvester information before and after processing by the three data cleaning methods.

[0152]

[0153]

[0154] Table 6 confirms the presence of numerous outliers in Harvester data, with spatiotemporal repetitions being the most prevalent, followed by discrete points, and drift points being the least common. After data cleaning, the data quality of Harvester was ensured, and the accuracy and reliability of the data were improved, providing a solid foundation for subsequent research.

[0155] S3. Data Augmentation: Calculate the motion and distribution features of each trajectory point in the cleaned trajectory data set, and use the motion and distribution features as input features; the distribution features include density features and parallel features.

[0156] The raw trajectory data records the timestamps, latitude and longitude coordinates, speed, and direction features of agricultural machinery operation, and contains other rich spatiotemporal features. Extracting useful spatiotemporal features is crucial for neural network models to learn more deep features. In the field of deep learning-based agricultural machinery motion pattern recognition, previous studies have mainly designed more motion features based on the temporal relationships between trajectory points, such as acceleration, angular velocity, and angular acceleration. Although most studies have made full use of the motion features of trajectory points, an excessive increase in motion features will increase the computational load of the model, leading to increased consumption of computing resources. In addition, too many motion features may contain redundant features, which will complicate the input features and affect the model's learning ability. Most studies have made little use of the distribution features of trajectory points, making it difficult to further improve recognition accuracy. This is because field points are more densely distributed than road points. This significant difference in distribution characteristics allows the model to learn more useful deep features, thereby improving recognition accuracy. Therefore, this invention proposes a data augmentation method based on spatiotemporal relationships to extract the motion and distribution features of trajectory points from the original data, and then uses a neural network model to extract more useful deep features from these features, thereby achieving full utilization of the trajectory data. The specific implementation of this method is shown in the following subsection.

[0157] S31. Calculation of motion features based on time relationships

[0158] To determine which motion characteristics are effective, this invention first analyzes the motion characteristics of agricultural machinery in field and road scenarios. Specifically, agricultural machinery operates at a slower speed in the field, mainly performing uniform or decelerating motion, with small speed differences, short displacements, frequent turning movements, and low angular velocities. On roads, however, agricultural machinery travels at a faster speed, mainly performing accelerating or uniform motion, with larger speed differences, longer displacements, fewer turning movements, and higher angular velocities. Based on the above analysis, this invention utilizes the time relationship between trajectory points to design eight motion characteristics: speed, speed difference, acceleration, displacement, direction, change of direction, angular velocity, and angular velocity difference. Specific implementation details are shown in the following formulas.

[0159]

[0160] Δdir k =(dir k -dir k-1 +θ1)modθ1,θ1=360° (11)

[0161]

[0162] Δlon k =lon k -lon k-1 ,Δlat k =lat k -lat k-1 (13)

[0163]

[0164]

[0165] In formulas (10)-(15), Δv k This represents the velocity change at the k-th trajectory point; v k v represents the velocity of the k-th trajectory point; k-1 a represents the velocity of the (k-1)th trajectory point; k t represents the acceleration of the k-th trajectory point; k The timestamp of the k-th trajectory point; t k-1 Represents the timestamp of the (k-1)th trajectory point; Δdir k Indicates the change in direction of the k-th trajectory point; dir k Indicates the direction of the k-th trajectory point; dir k-1 The direction of the (k-1)th trajectory point is represented by θ; mod represents the modulo operation; θ I Used to ensure that angle changes are within 360 degrees; ω k Δω represents the angular velocity of the k-th trajectory point. kω represents the change in angular velocity at the k-th trajectory point; k-1 Δlon represents the angular velocity of the (k-1)th trajectory point. k Indicates the change in longitude at the k-th point; lon k Indicates the longitude of the k-th point; lon k-1 Δlat represents the longitude of the (k-1)th point. k Indicates the latitude change at the k-th point; lat k lat represents the latitude of the k-th point; k-1 Let represent the latitude of the (k-1)th point; b and c are intermediate variables in the calculation process; R represents the average radius of the Earth, in meters, with a value of 6371000; Δd k This represents the distance characteristic of the k-th point, in meters.

[0166] S32. Calculation of distribution characteristics based on spatial relationships

[0167] After calculating motion features based on time relationships, each trajectory point has 11 features instead of the original 5, thus improving the feature representation of the trajectory points. However, relying solely on motion features makes it difficult for neural network models to learn more useful deep features. To further enhance the feature representation of trajectory points and enrich the trajectory data, this invention first analyzes the spatial distribution characteristics of agricultural machinery in field and road scenarios. Specifically, when agricultural machinery is traveling on roads, the density of trajectory points is low, and the number of parallel points is small. Secondly, when agricultural machinery is operating in fields, the density of trajectory points is high, and the number of parallel points is large. Finally, when agricultural machinery is at the intersection of fields and roads, the density of road points is high, but the number of parallel points is small.

[0168] Based on the above analysis, this invention proposes a distribution feature calculation method based on spatial relationships to extract the density and parallelism features of trajectory points from the data. Here, the density feature represents the distribution feature of a trajectory point p. i latitude and longitude coordinates (lon) i ,lat i The number of trajectory points within a square with a width of square_width and centered at point p. Additionally, the parallel feature represents the number of points within a square with a width of square_width and centered at a trajectory point p. i latitude and longitude coordinates (lon) i ,lat i Centered on a square with width square_width, the point p on the trajectory intersects the target point. i The number of approximately parallel points. By calculating the number of points within a specified region for each trajectory point and the number of points approximately parallel to it, the spatial distribution characteristics of the trajectory points are fully reflected, thus enriching the spatial information of the trajectory data. The density feature calculation method is shown in the code in Table 7.

[0169] Table 7 Density Calculation Method Code

[0170]

[0171]

[0172] Where lon_WGS and lat_WGS represent geographic coordinates (WGS84), i.e., the longitude and latitude characteristics of the trajectory points. lon_UTM and lat_UTM represent planar coordinates (UTM). T represents all points of the given trajectory, and square_width represents the width of the square region surrounding the current trajectory point p.

[0173] Regarding the selection of the threshold `square_width`, this invention determines the range of `square_width` based on the spacing during each turn of the agricultural machinery. Specifically, the turning spacing of the agricultural machinery is mainly between 3 and 5 meters. Therefore, this invention sets the sides of the square region to 6 meters and 10 meters, i.e., squares with twice the turning spacing, as shown by the dotted square in Figure 9. However, a square with twice the spacing can cover a relatively small number of trajectory points, resulting in a small difference in the density characteristics of points in the field and on the road. Therefore, to increase the number of points covered by the square, thereby expanding the difference in density characteristics between points in the field and on the road, this invention uses squares with four times the turning spacing, i.e., 12 meters and 20 meters, as shown in Figure 9. Figure 10 The dashed square is shown. To ensure greater differentiation in density characteristics between field and road points, the square_width is ultimately set to 20.

[0174] Subsequently, this invention utilizes all points within the square region corresponding to each trajectory point to extract the parallel features of the trajectory points. The calculation method for the parallel features is shown in the code in Table 8.

[0175] Table 8. Parallel Feature Calculation Method Code

[0176]

[0177]

[0178] Where dir1 represents the direction of the first point, dir2 represents the direction of the second point, q represents the threshold of the parallel angle, and nearPoint_dirs represents the list of directions of all trajectory points in Tp.

[0179] To ensure that the deviation from the definition of parallelism is not excessive, the threshold q should not be too large. Therefore, this invention sets q to 30°.

[0180] After data augmentation, each trajectory point's features increased from 5 to 13, significantly improving its feature representation. Ultimately, the velocity, velocity difference, acceleration, direction, direction difference, angular velocity, angular acceleration, density, and parallelism features of each trajectory point were used as input to the neural network model, allowing the model to extract more deep-level features.

[0181] S4. Trajectory Point Recognition: Deep learning models are used to extract deep features from input features and to identify the trajectory points of agricultural machinery.

[0182] To fully validate the effectiveness of density and parallel features, this invention utilizes a BiLSTM-based model for training and testing. This model comprises a BiLSTM, a fully connected layer, and a Sigmoid layer. The BiLSTM is used to extract deep features from the trajectory data, while the fully connected and Sigmoid layers utilize these deep features to identify field and road points. The model structure is as follows: Figure 11 As shown.

[0183] This invention sets the input features of the BiLSTM-Based model to 8 motion features (MF), 8 motion features (MF) and 1 density feature (DF), and 8 motion features (MF), 1 density feature (DF), and 1 parallel feature (PF) to evaluate the improvement of each feature on the model's learning ability and its impact on recognition accuracy. The parameters of the BiLSTM module are shown in Table 9. The model's layer count is set to 2 to increase its depth, enabling it to better capture hierarchical features in the input data and helping the model learn more complex sequence patterns and relationships.

[0184] Table 9 Parameter settings for BiLSTM-Based models

[0185] method Input feature dimension Output layer dimension Number of layers in the model BilSTM+MF 8 8 2 BilSTM+MF+DF 9 9 2 BilSTM+MF+DF+PF 10 10 2

[0186] S41, Model Introduction

[0187] Specifically, the BiLSTM module contains two LSTM networks, and the expressions for the LSTM networks are as follows:

[0188] h i =LSTM(x i h i-1 (16)

[0189] In formula (16), x i h is the feature vector of the i-th trajectory point; i Represents the deep features of the i-th trajectory point; h i-1This represents the deep features of the (i-1)th trajectory point; deep features are also called hidden states.

[0190]

[0191] In formula (17), Capture the temporal dependencies of past points from the i-th trajectory point; Capture the temporal dependencies of past points from the (i-1)th trajectory point; Capture the temporal dependencies of past points from the (i+1)th trajectory point; Learn the temporal dependencies of future points from the i-th trajectory point; x i h is the feature vector of the i-th trajectory point; i Represents the deep features of the i-th trajectory point; h i+1 This represents the deep-level features of the (i+1)th trajectory point.

[0192] Using the BiLSTM module, deep features are extracted from the motion and distribution characteristics of trajectory data. The used trajectory and its reverse trajectory are obtained from the cleaned trajectory dataset. The BiLSTM module then learns the deep feature h from these two trajectories. i Wherein, trajectory refers to the ordered set of motion points collected by the positioning device, reverse trajectory is the set of motion points in the opposite direction of the corresponding trajectory, and deep feature h i It combines past and future temporal information. Utilizing the bidirectional modeling capability of the BiLSTM module, it captures the past and future relationships between trajectory points, thereby extracting deep-level features from the motion and distribution characteristics of the trajectory data. The input features are processed by the BiLSTM module, and the output is the deep-level features.

[0193] Based on deep features h i The i-th trajectory point is classified using a fully connected layer and a sigmoid activation function. The fully connected layer ensures that the output feature dimension is the same as the number of categories in the agricultural machinery motion pattern recognition, guaranteeing the smooth progress of the experiment. Then, by using the sigmoid activation function, the predicted probability distribution p of the trajectory point in the "field" and "road" categories is obtained. i The probabilities of the two categories are calculated to determine the category of the trajectory point. Based on this probability distribution, the category of the agricultural machinery trajectory point is determined. The expression of the Sigmoid activation function is as follows:

[0194]

[0195] In formula (18), f(x) represents the Sigmoid function, which physically maps x to a probability value between 0 and 1; e is a constant, approximately equal to 2.71828; and x represents the input of the Sigmoid function.

[0196] S42, Model Training

[0197] In this invention, the model training used 200 epochs. Furthermore, this invention employs the Focal Loss (FC) loss function to mitigate the class imbalance problem in the dataset. The FC loss function is shown in the following formula:

[0198]

[0199] in, This represents the probability that the t-th trajectory point falls within the predicted category (field or road). α and γ are pre-defined parameters. α is used to handle class imbalance, and γ is used to reduce the contribution of easily identifiable points to the final loss. α is set to 0.25, and γ is set to 2.

[0200] Furthermore, this invention employs the AdamW optimizer to optimize the model. In this invention, the weight decay parameter of the AdamW optimizer is set to 0.00001, and the learning rate parameter is set to 0.0001.

[0201] Finally, considering the overfitting problem—that is, the model performs well on the training set but poorly on the test set—this invention employs an early stopping strategy to mitigate this phenomenon. All code, model training, and testing in this invention are performed on the following server environment, with specific parameters shown in Table 10.

[0202] Table 10 Environmental Configuration

[0203]

[0204] S43, Model Evaluation

[0205] The evaluation metrics used in this invention are accuracy, precision, recall, and F1 score. Accuracy represents the proportion of correctly predicted trajectory points out of all trajectory points, denoted as Acc. The following formula illustrates the calculation method for Acc:

[0206]

[0207] However, agricultural machinery spends far more time working in the fields than on roads, resulting in a much larger number of field points than road points in the data. This leads to class imbalance. When class imbalance occurs, Accu-Criteria (Acc) is insufficient to effectively represent the model's recognition performance; that is, even with a high Accu-Criteria, a small number of road points may be incorrectly identified. Therefore, other metrics should be used in conjunction with the model to evaluate its recognition performance.

[0208] Precision represents the proportion of trajectory points that the model predicts as positive, and which are also true as positive. Let precision be P, and the following formula shows how P is calculated:

[0209]

[0210] Recall represents the proportion of trajectory points correctly predicted by the model among those trajectory points whose true class is positive. Let recall be R, and the following formula shows how R is calculated:

[0211]

[0212] The F1 score is the harmonic mean of P and R, combining the results of both to more effectively reflect the model's recognition performance. The F1 score is denoted as F1, and the following formula illustrates how F1 is calculated:

[0213]

[0214] Based on accuracy (Acc), precision (P), recall (R), and F1 score, this invention employs 10-fold cross-validation to evaluate the classification performance of various methods. 10-fold cross-validation is widely used due to its numerous advantages and applicability.

[0215] S44. Results Analysis

[0216] To evaluate the impact of density features (DF) and parallel features (PF) on recognition performance, this invention conducted experimental verifications using BilSTM+MF (motion features), BilSTM+MF+DF, and BilSTM+MF+DF+PF. The experimental results from Harvester and Paddy are shown in Table 11.

[0217] Table 11 Recognition performance of the three methods on Harvester

[0218] method P(%) R(%) F1(%) Acc(%) BiLSTM+MF 83.49 72.37 72.79 88.62 BiLSTM+MF+DF 94.42 91.19 91.42 96.39 BiLSTM+MF+DF+PF 95.57 91.21 92.65 97.55

[0219] Table 11 shows that adding density features (DF) significantly improves the overall recognition performance of the BiLSTM-Based model. On Harvester, after adding DF to MF, the F1 score and accuracy (Acc) of the BiLSTM-Based model improved by 18.63% and 7.77%, respectively. This significant performance improvement indicates that density features play a crucial role in enhancing the model's classification accuracy for field points and road points. Specifically, density features provide important information about the density of the environment surrounding the trajectory point. By incorporating density features, the model can more accurately distinguish between field points and road points, thereby improving overall classification performance.

[0220] In addition, on Harvester, adding parallel features to both field and road points improved the F1 score and accuracy (Acc) of the BiLSTM-Based model by 1.23% and 1.16%, respectively. This demonstrates that parallel features are also highly effective in improving the field-road classification performance of neural network models. The introduction of parallel features helps the model learn the feature differences between field points and road points more effectively, further improving the model's classification accuracy. Although the improvement is smaller compared to density features, it still plays a positive role in improving model performance.

[0221] In summary, the density and parallelism of trajectory points play a vital role in improving the recognition performance of agricultural machinery movement patterns. This improved recognition accuracy is of great significance for farmland area estimation and rural road network construction, and helps to improve agricultural production efficiency and farmland resource utilization.

[0222] Example 2

[0223] This embodiment provides a multi-feature enhancement-based agricultural machinery motion behavior recognition device, which includes a trajectory data acquisition module, a trajectory data cleaning module, a trajectory point feature acquisition module, and an agricultural machinery motion trajectory point recognition module.

[0224] The trajectory data acquisition module is used to acquire the original data of the agricultural machinery's movement trajectory to obtain a trajectory data set.

[0225] The trajectory data cleaning module is used to clean the trajectory data set by removing spatiotemporal repeating points, discrete points, and drifting points.

[0226] The trajectory point feature acquisition module is used to calculate the motion features and distribution features of each trajectory point in the cleaned trajectory data set, and to use the motion features and distribution features as input features; the distribution features include density features and parallel features.

[0227] The agricultural machinery trajectory point recognition module is used to extract deep features from input features using a deep learning model and to recognize the agricultural machinery trajectory points.

[0228] Example 3

[0229] This embodiment also provides an electronic device, including: at least one processor; and a memory, the memory storing instructions that, when executed by the at least one processor, cause the at least one processor to execute the agricultural machinery motion pattern recognition algorithm driven by trajectory distribution features as described above.

[0230] In this embodiment, the electronic device may include, but is not limited to: personal computer, server computer, workstation, desktop computer, laptop computer, notebook computer, mobile computing device, smartphone, tablet computer, cellular phone, personal digital assistant (PDA), handheld device, messaging device, wearable computing device, consumer electronic device, etc.

[0231] Example 4

[0232] This embodiment also provides a machine-readable storage medium storing executable instructions that, when executed, cause the machine to perform the agricultural machinery motion pattern recognition algorithm driven by trajectory distribution features as described above.

[0233] Specifically, a system or apparatus equipped with a readable storage medium may be provided, on which software program code implementing the functions of any of the embodiments described above is stored, and the computer or processor of the system or apparatus can read and execute the instructions stored in the readable storage medium.

[0234] In this case, the program code read from the readable medium itself can perform the functions of any of the above embodiments, and therefore the machine-readable code and the readable storage medium storing the machine-readable code constitute a part of this specification.

[0235] Examples of readable storage media include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD-RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code can be downloaded from a server computer or the cloud via a communication network.

[0236] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0237] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0238] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0239] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0240] The above-described embodiments are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made by those skilled in the art to the technical solutions of the present invention without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.

Claims

1. An algorithm for recognizing agricultural machinery motion patterns driven by trajectory distribution features, characterized in that, The method includes the following steps: S1. Obtain the raw data of the agricultural machinery's movement trajectory to obtain a trajectory data set; S2. Clean the trajectory data set by removing spatiotemporal repetition points, discrete points, and drift points. S3. Calculate the motion characteristics and distribution characteristics of each trajectory point in the cleaned trajectory data set, and use the motion characteristics and distribution characteristics as input features; the distribution characteristics include density characteristics and parallelism characteristics. In step S3, the motion characteristics and distribution characteristics of each trajectory point in the cleaned trajectory data set are calculated, and the motion characteristics and distribution characteristics are used as input features, including: S31. Calculate the motion characteristics of the trajectory points using the time relationship between trajectory points in the trajectory data set; the motion characteristics include velocity, velocity difference, acceleration, displacement, direction, direction difference, angular velocity, and angular velocity difference; S32. Based on the spatial relationships between trajectory points in the trajectory data set, calculate the density feature and parallelism feature of the trajectory points; the density feature represents the number of trajectory points within a square centered on the latitude and longitude coordinates of a certain trajectory point; the parallelism feature represents the number of trajectory points within a square centered on the latitude and longitude coordinates of a certain trajectory point. The points within the square centered on the latitude and longitude coordinates and the trajectory points The number of points that are approximately parallel; In step S31, the motion characteristics are calculated using the time relationship between trajectory points, which is achieved using the following formula: (10) (11) (12) (13) (14) (15) In formulas (10)-(15), Indicates the first k The velocity change of each trajectory point; Indicates the first k The velocity of each trajectory point; Indicates the first k- The velocity of a single trajectory point; Indicates the first k The acceleration of each trajectory point; Indicates the first k Timestamps of each trajectory point; Indicates the first k -1 timestamp of a trajectory point; Indicates the first k The direction of each trajectory point changes; Indicates the first k The direction of each trajectory point; Indicates the first k- The direction of a trajectory point; This represents the modulo operation; This is used to ensure that the angle change is within 360 degrees; Indicates the first k angular velocity of each trajectory point; Indicates the first k Changes in angular velocity at each trajectory point; Indicates the first k -1 angular velocity of the trajectory point; Indicates the first Longitude changes at each point; Indicates the first k The longitude of each point; No. k -1 point longitude; Indicates the first k Latitude changes at each point; Indicates the first k The latitude of each point; Indicates the first k -1 latitude; b and c are intermediate variables in the calculation process; b and c are intermediate variables in the calculation process; This represents the average radius of the Earth, in meters, and has a value of 6,371,000. Indicates the first Distance characteristics of each point, in meters; S4. Use a deep learning model to extract deep features from the input features and identify the movement trajectory points of the agricultural machinery.

2. The agricultural machinery motion pattern recognition algorithm driven by trajectory distribution features according to claim 1, characterized in that, In step S2, the trajectory data set is cleaned by removing spatiotemporal repeating points, discrete points, and drifting points, including: S21. Remove spatiotemporal duplicate points: If consecutive trajectory points have the same timestamp or the same latitude and longitude coordinates, then except for the first point, the other trajectory points are considered spatiotemporal duplicate points. The first point in the consecutive trajectory points is retained, and the other trajectory points are removed. S22. Remove discrete points: Use the average distance comparison method based on moving window to remove discrete points from the trajectory data set; S23. Remove drift points: Use a comparison method based on the distance between adjacent points to remove drift points; In step S22, the average distance comparison method based on the moving window includes: Set the length to t The moving window, which processes t adjacent points at each time step, is used to calculate the surrounding data of the current trajectory point. The average displacement of adjacent points at each time interval; the average displacement is used as the average displacement feature of the current trajectory point. For the average displacement characteristics With threshold If a comparison is made, Less than the threshold If the trajectory point is determined to be a discrete point, then the trajectory point is removed. The average distance comparison method based on the moving window is implemented using the following formula: (1) (2) (3) (4) (5) In formulas (1)-(5), Indicates the first Longitude changes at each point; Indicates the first k The longitude of each point; No. k -1 point longitude; Indicates the first k Latitude changes at each point; Indicates the first k The latitude of each point; Indicates the first k -1 latitude; b and c are intermediate variables in the calculation process; b and c are intermediate variables in the calculation process; This represents the average radius of the Earth, in meters, and has a value of 6,371,000. Indicates the first Distance characteristics of each point, in meters; Indicates from point Time The average value of the distance change; i As an auxiliary variable, it represents from k Point to k+t One point; k The index value of the point, ranging from 1 to... N , N This represents the total number of points in the current trajectory. t The length of the moving window; Used to delete discrete points ; This represents the threshold used to determine whether to delete discrete points. Used to delete discrete points ; In step S23, drift points are eliminated using a comparison method based on the distance between adjacent points, including: If a point P K to its previous point P K The distance of 1 is greater than that of point P. K 1 to point P K The distance is m times the distance of point P. K To the next point P K+1 The distance is greater than that of point P. K+1 Point P K+2 If the distance to point P is m times the distance to point P, then the point P is P. K It was identified as a drift point; The method of eliminating drift points using a comparison based on the distance between adjacent points is implemented using the following formula: (6) (7) (8) (9) In formulas (6)-(9), Indicates the first Longitude changes at each point; Indicates the first k The longitude of each point; No. k -1 point longitude; Indicates the first k Latitude changes at each point; Indicates the first k The latitude of each point; Indicates the first k -1 latitude; b and c are intermediate variables in the calculation process; b and c are intermediate variables in the calculation process; This represents the average radius of the Earth, in meters, and has a value of 6,371,000. Indicates the first Distance characteristics of each point, in meters; This represents the threshold multiple by which to determine whether to delete a drift point; Indicates the first Distance features of +1 point; Indicates the purpose of deleting drift points. Used to delete drift points ; Indicates the first Distance features of -1 points; Indicates the first +2 points of distance feature; Indicates "and"; k For point The sequence number value represents the index of the trajectory point. k From 0 to N Between 1; for arrive The distance; This indicates the number of points in a given set of trajectories; Indicates the first A trajectory point.

3. The agricultural machinery motion pattern recognition algorithm driven by trajectory distribution features according to claim 1, characterized in that, In step S4, a deep learning model is used to extract deep features from the input features and to identify the movement trajectory points of the agricultural machinery, including: S41. Design of a deep learning model: The deep learning model adopts a BiLSTM-Based model; the BiLSTM-Based model includes a BiLSTM module, a fully connected layer, and a Sigmoid layer; the Sigmoid layer uses the Sigmoid activation function; S42. Using the BiLSTM module, extract deep-level features from the motion and distribution features of trajectory data; S43. Based on deep features, use fully connected layers and Sigmoid layers to identify trajectory points.

4. The agricultural machinery motion pattern recognition algorithm driven by trajectory distribution features according to claim 3, characterized in that, The BiLSTM module contains two LSTM networks, and the expressions for the LSTM networks are as follows: (16) In formula (16), It is the first Feature vectors of trajectory points; Indicates the first i Deep-level features of each trajectory point; Indicates the first Deep-level features of each trajectory point; (17) In formula (17), Capture the temporal dependencies of past points from the i-th trajectory point; Capture from the first The time dependency of past points of a trajectory point; Capture from the first The time dependency of past points of a trajectory point; Learning comes from the The time dependency of future points of a trajectory point; It is the first Feature vectors of trajectory points; Indicates the first Deep-level features of each trajectory point; Indicates the first The deep features of each trajectory point.

5. The agricultural machinery motion pattern recognition algorithm driven by trajectory distribution features according to claim 3, characterized in that, In step S42, the BiLSTM module is used to extract deep-level features from the motion and distribution features of the trajectory data, including: The used trajectory and its reverse trajectory are obtained from the cleaned trajectory dataset. A BiLSTM module is then used to learn deep features from these two trajectories. ; Here, the trajectory refers to the ordered set of motion points collected by the positioning device, the reverse trajectory is the set of motion points in the opposite direction of the corresponding trajectory, and the deep-level features... It combines time information from the past and the future; In step S43, trajectory point recognition is performed based on deep features, using fully connected layers and Sigmoid layers, including: Based on deep features , No. Each trajectory point is classified through a fully connected layer and a Sigmoid activation function; using the Sigmoid activation function, the predicted probability distribution of the trajectory point in the "field" and "road" categories is obtained. Based on probability distribution, determine the category of agricultural machinery trajectory points; The expression for the Sigmoid activation function is as follows: (18) In formula (18), The Sigmoid function represents the physical meaning of... x Mapped to a probability value between 0 and 1; It is a constant, approximately equal to 2.71828; This represents the input to the Sigmoid function.

6. The agricultural machinery motion pattern recognition algorithm driven by trajectory distribution features according to claim 3, characterized in that, The loss function FC of the BiLSTM-Based model is: (19) In formula (19), Indicates the first The probability of a trajectory point falling within the predicted category of field or road. and These are pre-set parameters. Used to handle class imbalance This is used to reduce the contribution of easily identifiable points to the final loss.

7. A device for recognizing the motion behavior of agricultural machinery based on multi-feature enhancement, characterized in that, The device includes a trajectory data acquisition module, a trajectory data cleaning module, a trajectory point feature acquisition module, and an agricultural machinery motion trajectory point recognition module; The trajectory data acquisition module is used to acquire the original data of the agricultural machinery's movement trajectory to obtain a trajectory data set; The trajectory data cleaning module is used to clean the trajectory data set, removing spatiotemporal repeating points, discrete points, and drifting points. The trajectory point feature acquisition module is used to calculate the motion features and distribution features of each trajectory point in the cleaned trajectory data set, and to use the motion features and distribution features as input features. The distribution characteristics include density characteristics and parallelism characteristics; The agricultural machinery trajectory point recognition module is used to extract deep features from input features using a deep learning model and to recognize the agricultural machinery trajectory points.

8. An electronic device, characterized in that, include: At least one processor; and a memory, the memory storing instructions that, when executed by the at least one processor, cause the at least one processor to... One less processor executes the agricultural machinery motion pattern recognition algorithm driven by trajectory distribution features as described in any one of claims 1 to 6.

9. A machine-readable storage medium, characterized in that, It stores executable instructions that, when executed, cause the machine to perform the agricultural machinery motion pattern recognition algorithm driven by trajectory distribution features as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Agricultural machinery track space-time characteristic extraction and behavior identification method based on neural network

    CN117591938A