Agricultural machine operation track area calculation method based on deep learning

By combining high-precision GNSS equipment and deep learning models with the DBSCAN clustering algorithm, precise segmentation and area calculation of agricultural machinery operation trajectories were achieved, solving the problems of insufficient adaptability to complex scenarios and anti-noise interference in existing technologies, and improving calculation accuracy and automation efficiency.

CN121169995BActive Publication Date: 2026-07-07上海市大数据中心

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
上海市大数据中心
Filing Date
2025-09-08
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

Existing methods for calculating the operating area of ​​agricultural machinery are poorly adaptable to complex scenarios and lack resistance to noise interference. They rely on the density of trajectory points, resulting in low calculation accuracy.

Method used

Monitoring equipment equipped with high-precision GNSS modules and sensors is used to collect agricultural machinery trajectory data in real time. The data is then processed and segmented using a deep learning model. Combined with the DBSCAN clustering algorithm and vector space analysis technology, the data is accurately segmented and the area of ​​the fields is calculated.

Benefits of technology

It improves the accuracy of agricultural machinery operation area calculation and noise interference resistance, enhances adaptability in complex scenarios, reduces calculation errors, and improves automation efficiency and subsidy distribution accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121169995B_ABST
    Figure CN121169995B_ABST
Patent Text Reader

Abstract

The present application relates to the field of precision agriculture technology, in particular to a kind of agricultural machinery operation track area calculation method based on deep learning, it includes the following steps: using the monitoring equipment of high-precision GNSS module and sensor are carried, data is uploaded to cloud server for storage by wireless communication module, data is denoising and coordinate conversion processing, construct the deep learning model based on MaskRCNN, train model to be suitable for agricultural machinery track segmentation task, grid image is predicted, using DBSCAN clustering algorithm is clustered to track point set, the area of each field is calculated by contour extraction, topological relationship check and optimization processing using vector space analysis technique, through the way of precision verification compared with reference data, obtain the accurate measurement result of agricultural machinery operation track area.The present application solves the problems of weak adaptability in complex scene, insufficient anti-noise interference ability and dependence on track point density in the existing agricultural machinery operation area measurement technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of precision agriculture technology, specifically relating to a method for calculating the area of ​​agricultural machinery operation trajectory based on deep learning. Background Technology

[0002] The main ideas and methods for calculating agricultural machinery trajectory and operating area in China are summarized in the following three points:

[0003] 1. Spatiotemporal segmentation of agricultural machinery trajectories and calculation of operating area using the plot aggregation method: This method constructs a three-dimensional spatiotemporal cube (two-dimensional planar space + one-dimensional time axis) and segments agricultural machinery operating trajectories and road driving trajectories based on density thresholds to achieve preliminary differentiation between the two types of trajectories. Based on the agricultural machinery operating trajectories, the operating area is calculated using the plot aggregation method: GIS technology is used to merge the positioning points of field operation status into polygons, and the area of ​​these polygons is regarded as the agricultural machinery operating area, thereby realizing the correlation analysis between plot area and operating efficiency.

[0004] 2. Machine Learning-Based Agricultural Machinery Trajectory Segmentation and Triangulation for Calculating Working Area: This method first uses the density clustering algorithm (DBSCAN) in unsupervised learning to analyze the trajectory data, achieving preliminary differentiation and labeling of agricultural machinery field operations and road transfer trajectories. Then, the BP_Adaboost algorithm is used for iterative training of the trajectory points, focusing on correcting trajectory points easily misidentified at the road-field boundary (marking them as road travel trajectory points and adding them to the training samples), until no more samples are added. This reduces the dependence of traditional clustering algorithms on thresholds and parameters, improving the accuracy of trajectory segmentation. Based on the segmented agricultural machinery operation trajectory, the agricultural machinery operation location points are triangulated and connected into adjacent non-overlapping triangles. The sum of the areas of the triangles is calculated to measure the agricultural machinery operation area.

[0005] 3. Methods for calculating the working area using polyline distance and vector buffer: The polyline distance method connects trajectory points to form a polyline, smooths the trajectory line using cubic spline interpolation, and then calculates the working area based on the width of the agricultural machinery's working area. The vector buffer method is based on the agricultural machinery's spatial trajectory, generating a working trajectory buffer by segmenting the trajectory line, finding intersections, and merging the segments, and using the buffer area as the working area. Further research has used the NSGA-II algorithm (non-dominated sorting genetic algorithm) to calculate the optimal weights of the two methods, weighting and fusing the results to improve the accuracy of area calculation.

[0006] Existing methods have the following limitations in agricultural machinery trajectory processing and operating area calculation:

[0007] The three methods rely on a single technical approach and depend on the geometric features of the trajectory: all three methods take the vector features (coordinates, distance, topological relationships) of the trajectory points as the core calculation basis. In essence, they are "geometric deductions" of the trajectory data and have not broken through the traditional framework of "directly calculating the area of ​​the trajectory". This results in a strong dependence on the density and uniformity of the trajectory points.

[0008] The method has poor adaptability to complex scenarios: the plot aggregation method relies on polygon fitting, which has low recognition accuracy for irregular plot boundaries and field ridge segmentation areas; the triangulation method is greatly affected by the density of trajectory points, and is prone to area deviation when the point distribution is uneven; the broken line distance method and vector buffer method are prone to calculation deviation in areas with dense or overlapping trajectories, and interpolation smoothing may also introduce new errors.

[0009] Insufficient noise resistance: Although existing methods can distinguish between work and transfer trajectories, they are insufficient in handling invalid trajectory points such as idling and repeated turns during the work process. As a result, the polyline distance method and the vector buffer method are prone to artificially inflated area. The weight optimization of the NSGA-II algorithm can only balance the errors of the two methods and cannot eliminate noise interference from the root. Summary of the Invention

[0010] To address the aforementioned issues, this invention provides a deep learning-based method for calculating the area of ​​agricultural machinery operation trajectories. This method solves the problems of weak adaptability to complex scenarios, insufficient resistance to noise interference, and reliance on trajectory point density in existing agricultural machinery operation area measurement technologies. To achieve the above objectives, this invention adopts the following technical solution:

[0011] The method for calculating the area of ​​agricultural machinery operation trajectory based on deep learning includes the following steps: Using a monitoring device equipped with a high-precision GNSS module and sensors, real-time data of the agricultural machinery's operation trajectory is collected; the data is uploaded to a cloud server for storage via a wireless communication module to obtain a raw dataset; the raw dataset is then processed for denoising and coordinate transformation, and the processed data is mapped to a Cartesian coordinate system; a raster image is obtained through gridding transformation; a deep learning model based on Mask R-CNN is constructed, an attention mechanism is introduced, and the model is trained to be suitable for agricultural machinery trajectory segmentation tasks; the area of ​​the raster image is calculated using this method. The image is used to predict the bounding box and mask of the trajectory region. The pixel coordinates corresponding to the mask are reverse-mapped to a set of geographic coordinate points to form a trajectory point set. The DBSCAN clustering algorithm is used to perform cluster analysis on the trajectory point set to segment the fields and obtain shapefile data. The shapefile data is converted into vector polygons. Through contour extraction, polygon simplification, topological relationship checking and optimization processing, the field polygon elements are obtained. Based on the field polygon elements, the area of ​​each field is calculated using vector space analysis technology. The accuracy is verified by comparing with reference data to obtain the accurate measurement result of the area of ​​the agricultural machinery operation trajectory.

[0012] Furthermore, the monitoring equipment equipped with a high-precision GNSS module and sensors collects real-time operational trajectory data of the agricultural machinery. This data is then uploaded to a cloud server for storage via a wireless communication module to obtain the raw dataset. The process includes the following steps: 1) Equipping the agricultural machinery with a monitoring device integrating a high-precision GNSS module and multiple sensors to collect operational trajectory data in real time; 2) The monitoring device automatically collects data every 3 seconds and transmits the data stably to the cloud server via a 4G wireless communication module; 3) The server establishes a dedicated storage directory based on the unique identifier of the trajectory data, extracts the timestamp as the filename, and archives the raw data to obtain the raw dataset. The operational trajectory data includes: latitude and longitude positioning accuracy within 1 meter, time accuracy to the second, operational status, operating speed, engine speed, and the working status of the operating device.

[0013] Furthermore, the process of acquiring the original dataset, performing denoising and coordinate transformation on the data, mapping the processed data to a Cartesian coordinate system, and obtaining a raster image through gridding transformation includes the following steps: acquiring the original dataset, using the Python Pandas library to read CSV format trajectory data from a cloud server; filtering by the job status field to extract valid job trajectory points and removing non-job trajectory points; using the local outlier factor algorithm to identify outliers by calculating the density difference between trajectory points and neighboring points, removing points with outlier scores exceeding the threshold, and improving the spatial continuity of the trajectory data; converting the WGS84 coordinates to local Cartesian coordinates via Gauss-Kruger projection to eliminate deformation errors; mapping the trajectory points to raster cells, assigning grayscale values, and obtaining a TIFF format raster image.

[0014] Furthermore, the construction of a deep learning model based on Mask R-CNN, incorporating an attention mechanism, and training the model to be suitable for agricultural machinery trajectory segmentation tasks, predicting the raster image to obtain the bounding boxes and masks of the trajectory regions, includes the following steps: dividing the raster image into training and validation sets at an 8:2 ratio; using the Labelme tool to accurately label the trajectory regions and generate JSON format annotation files; performing data augmentation operations such as sliding cropping, random rotation, horizontal and vertical flipping, and scaling on the training set to expand sample diversity; constructing a Mask R-CNN model based on the TensorFlow framework, extracting deep texture and shape features of the trajectory using ResNet50; adapting a region proposal network to different shaped trajectory regions through multi-scale anchor points, iteratively training until the accuracy on the validation set no longer improves, obtaining a model that can accurately identify trajectory regions; inputting the JSON format annotation file into the trained model to obtain the bounding boxes and masks of the trajectory regions.

[0015] Furthermore, the step of reverse mapping the pixel coordinates corresponding to the mask to a set of geographic coordinate points to form a trajectory point set, and using the DBSCAN clustering algorithm to perform cluster analysis on the trajectory point set to segment the fields and obtain shapefile data, includes the following steps: obtaining the bounding box and mask of the trajectory region; extracting the corresponding trajectory region vector trajectory point set from the mask using instance segmentation output; preliminarily dividing the trajectory range of the field by analyzing the size of the trajectory point spacing and the continuity of timestamps; using the DBSCAN algorithm to cluster spatially closely related trajectory points into one class to automatically divide the trajectory range of different fields; and processing isolated points generated by clustering into independent small fields, merging them into neighboring fields, and marking them as noise based on area and distance to obtain shapefile data.

[0016] Furthermore, the process of converting shapefile data into vector graphics, and obtaining field patch elements through contour extraction, polygon simplification, topological relationship checking, and optimization, includes the following steps: acquiring shapefile data and converting it into vector graphics; using the findContours function of the OpenCV library to extract the outer contour of the field from the trajectory mask, retaining the outermost boundary and compressing redundant line segments; simplifying the contour polygons using the Douglas-Puk algorithm to reduce the number of vertices while ensuring the boundary shape, thereby improving data processing efficiency; transforming the simplified polygons from image coordinates to Gauss-Kruger plane coordinates, and eliminating overlaps and self-intersections through deduplication and topological checking to obtain field patch elements.

[0017] Furthermore, the step of calculating the area of ​​each field plot using vector space analysis technology based on the field plot features and verifying the accuracy by comparing it with reference data to obtain the accurate measurement result of the agricultural machinery operation trajectory area includes the following steps: acquiring field plot features, calculating the planar area of ​​each field plot under Gauss-Kruger projection, and statistically analyzing the total operation area, the number of plots, and the repeated operation area; calculating the theoretical operation area using the method of total trajectory length × operation width, randomly selecting typical fields of different area levels, verifying the accuracy through deviation rate, and obtaining the accurate measurement result of the agricultural machinery operation trajectory area.

[0018] Furthermore, the denoising process employs Kalman filtering, which predicts and corrects outliers by constructing a trajectory motion model based on Kalman filtering.

[0019] Furthermore, instance segmentation employs a combined model of Faster R-CNN and FCN.

[0020] In the technical solution provided by this invention, a monitoring device equipped with a high-precision GNSS module and sensors is used to collect agricultural machinery operation trajectory data in real time. The data is uploaded to a cloud server for storage via a wireless communication module to obtain the original dataset. The original dataset is then subjected to denoising and coordinate transformation. The processed data is mapped to a Cartesian coordinate system and transformed into a grid image. A deep learning model based on Mask R-CNN is constructed, incorporating an attention mechanism. The model is trained to be suitable for agricultural machinery trajectory segmentation tasks, predicting the grid image to obtain the bounding box and mask of the trajectory region. The pixel coordinates corresponding to the mask are mapped inversely to a set of geographic coordinate points, forming a trajectory point set. The DBSCAN clustering algorithm is used to perform cluster analysis on the trajectory point set to segment the fields, obtaining shapefile data. The shapefile data is converted into vector polygons. Through contour extraction, polygon simplification, topological relationship checking, and optimization, field polygon elements are obtained. Based on the field polygon elements, the area of ​​each field is calculated using vector space analysis technology. The accuracy is verified by comparing with reference data to obtain a precise measurement result of the agricultural machinery operation trajectory area. This invention addresses the problems of weak adaptability to complex scenarios, insufficient resistance to noise interference, and reliance on trajectory point density in existing agricultural machinery operation area measurement technologies. Attached Figure Description

[0021] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention.

[0022] Figure 1 This is a schematic flowchart illustrating a deep learning-based method for calculating the area of ​​agricultural machinery operation trajectory in an embodiment of the present invention.

[0023] Figure 2 This is a schematic diagram of a second embodiment of a method for calculating the area of ​​agricultural machinery operation trajectory based on deep learning, as described in this invention.

[0024] Figure 3 This is a schematic diagram of the distribution data of trajectory points in an embodiment of the present invention, which is a method for calculating the area of ​​agricultural machinery operation trajectory based on deep learning.

[0025] Figure 4 This is a schematic diagram of a farm machinery operation site, illustrating a method for calculating the area of ​​a farm machinery operation trajectory based on deep learning, as described in an embodiment of the present invention.

[0026] Figure 5 This is a schematic diagram of the agricultural machinery operation plot and the number of repeated operations in an embodiment of the present invention, illustrating a method for calculating the area of ​​agricultural machinery operation trajectory based on deep learning. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0028] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0029] A method for calculating the area of ​​agricultural machinery operation trajectory based on deep learning, such as... Figure 1 As shown, the process includes the following steps: A monitoring device equipped with a high-precision GNSS module and sensors is used to collect real-time data on the agricultural machinery's operational trajectory. This data is then uploaded to a cloud server for storage via a wireless communication module, resulting in a raw dataset. The raw dataset is then subjected to denoising and coordinate transformation. The processed data is mapped to a Cartesian coordinate system and transformed into a grid image. A deep learning model based on Mask R-CNN is constructed, incorporating an attention mechanism. The model is trained to be suitable for agricultural machinery trajectory segmentation tasks, predicting the grid image to obtain the bounding box and mask of the trajectory region. The pixel coordinates corresponding to the mask are mapped inversely to a set of geographic coordinate points, forming a trajectory point set. The DBSCAN clustering algorithm is used to perform cluster analysis on the trajectory point set to segment the fields, obtaining shapefile data. The shapefile data is converted into vector polygons. Through contour extraction, polygon simplification, topological relationship checking, and optimization, field polygon features are obtained. Based on the field polygon features, vector space analysis technology is used to calculate the area of ​​each field. Accuracy is verified by comparing with reference data, resulting in a precise measurement of the agricultural machinery's operational trajectory area.

[0030] like Figure 2 As shown in this embodiment, a monitoring device integrating a high-precision GNSS module and multiple sensors is installed on the agricultural machinery to obtain operation trajectory data in real time. The monitoring device automatically collects data every 3 seconds and transmits the data stably to the cloud server through a 4G wireless communication module. The server establishes a dedicated storage directory based on the unique number of the trajectory data, extracts the timestamp as the file name to archive the original data, and obtains the original dataset. The operation trajectory data includes: latitude and longitude positioning accuracy within 1 meter, time accuracy to the second, operation status, running speed, engine speed, and working status of the operation device.

[0031] Monitoring equipment integrating high-precision GNSS modules and multiple sensors is installed on agricultural machinery to collect key parameters in real time, including latitude and longitude (positioning accuracy within 1 meter), time (accurate to the second), operating status (0 for non-operation, 1 for operation), running speed, engine speed, and the working status of operating devices. The equipment automatically collects data at 3-second intervals and transmits it stably to a cloud server via a 4G wireless communication module. The server establishes a dedicated storage directory based on the unique number of the trajectory data, archiving the original data with timestamps as filenames, ensuring data integrity and traceability. The advantages of this data collection scheme are: the 3-second collection interval ensures the density of trajectory points to reconstruct the details of the operation path while avoiding storage and transmission pressure caused by excessive data volume; the widespread coverage of 4G communication technology in rural areas meets the need for real-time data upload, providing timely and comprehensive raw trajectory information for subsequent processing. Latitude and longitude are used for spatial positioning, operating status is used to filter effective operating periods, and time information is used to analyze the timing characteristics of the operation. The collaboration of multiple parameters supports the verification of the operation's authenticity.

[0032] Taking the agricultural machinery trajectory data of Shanghai Agricultural Machinery Professional Cooperative with serial number 1581F6BUB234***2L1 as an example, the specific implementation of the present invention will be described in detail. This data covers Jinze Town, Qingpu District, Shanghai, and contains 198,391 trajectory points, with a data volume of approximately 53.8MB.

[0033] (1) Agricultural machinery trajectory data collection

[0034] The cooperative's agricultural machinery is equipped with high-precision positioning and multi-parameter monitoring equipment. The equipment should be able to collect parameters such as latitude and longitude (accurate to 6 decimal places, approximately 10 centimeters), time (accurate to year, month, day, hour, minute, and second), operating status (0 / 1, where 0 represents non-operating status and 1 represents operating status), running speed, and operating status of the operating device.

[0035] The device's data collection interval is set to 3 seconds, and the collected data is transmitted to the cloud server in real time via a 4G wireless communication module. After receiving the data, the cloud server creates a dedicated storage folder based on the trajectory data number 1581F6BUB234*****2L1, and stores the original data with the timestamp as the filename to ensure data integrity.

[0036] In this embodiment, the original dataset is obtained, and the trajectory data in CSV format is read from the cloud server using the Python Pandas library. Valid task trajectory points are extracted by filtering through the task status field, and non-task trajectory points are removed. The local outlier factor algorithm is used to identify outliers by calculating the density difference between trajectory points and their neighbors, and points with outlier scores exceeding the threshold are removed to improve the spatial continuity of the trajectory data. The WGS84 coordinates are converted to local plane rectangular coordinates via Gauss-Kruger projection to eliminate deformation errors. The trajectory points are mapped to raster cells and assigned grayscale values ​​to obtain a TIFF format raster image.

[0037] As a crucial step connecting raw data with deep learning models, preprocessing improves data quality and transforms data formats through multiple steps: Data reading and filtering: The Python Pandas library is used to read CSV format trajectory data from the cloud server. Valid trajectory points with a status of 1 are filtered based on the job status field, while non-job trajectory points with a status of 0 are removed, reducing the interference of invalid data on subsequent analysis. Noise reduction: The Local Outlier Factor (LOF) algorithm is introduced to identify outliers (such as jump points caused by equipment failure or signal interference) by calculating the density difference between each trajectory point and its neighbors, and points with outlier scores exceeding the threshold are removed, significantly improving the spatial continuity of the trajectory data. Coordinate transformation: The latitude and longitude coordinates in the WGS84 coordinate system are converted to local plane rectangular coordinates through Gauss-Kruger projection, eliminating the distortion error of spherical coordinates in planar analysis and making the calculation of spatial distance and angle of the trajectory more accurate. Rasterization Conversion: At a scale of 1:1000, planar vector trajectory points are mapped to 1m × 1m raster cells. Gray values ​​from 0-255 are assigned to the trajectory points within each cell according to their density (higher density results in larger gray values), generating a TIFF format raster image. This preprocessed data not only eliminates noise interference but also converts discrete vector trajectories into continuous raster images. This preserves the spatial distribution characteristics of the trajectories and adapts to the input requirements of deep learning models, solving the problem of blurred boundaries when traditional vector data is directly used for segmentation. This is a key innovation that distinguishes it from existing technologies.

[0038] Track data for track number 1581F6BUB234*****2L1 was retrieved from the cloud server and read using Python's Pandas library. The data is in CSV format and includes fields such as latitude and longitude, time, operation status, running speed, and operating device status. The distribution data of the track points is also shown. Figure 3 As shown, trajectory points with a job status of 1 are selected as valid trajectory points, and non-job trajectory points with a job status of 0 are removed to obtain the trajectory data after preliminary filtering.

[0039] Extract the latitude and longitude coordinates of the valid trajectory points and construct a two-dimensional array as input data.

[0040] Call the LocalOutlierFactor function in Python's Scikit-learn library, set n_neighbors=20 (i.e., consider 20 neighboring points for each point), contamination=0.05 (outlier rate is about 5%), and calculate the local outlier score for each trajectory point.

[0041] Outliers with scores exceeding 1.5 are removed to obtain denoised trajectory data. This step removes points that deviate from the normal trajectory due to factors such as equipment failure and signal interference, thus improving data quality.

[0042] Coordinate transformation:

[0043] Since the original latitude and longitude coordinates use the WGS84 coordinate system, they need to be converted to the local plane rectangular coordinate system of Qingpu District, Shanghai (Gauss-Kruger projection 3-degree zone, with the central meridian at 121°E).

[0044] Gaussian projection coordinate forward calculation formula:

[0045]

[0046]

[0047] (B,L) is transformed into (x,y), where latitude is B, longitude is L, x is the ordinate (in meters) of the Gaussian projection plane rectangular coordinate system, and y is the abscissa (in meters) of the Gaussian projection plane rectangular coordinate system. X is the meridian arc length from the equator to latitude B, and N is the radius of curvature of the prime meridian (in meters). e is the first eccentricity of the ellipse e' is the second eccentricity of the ellipse η = e' cos B, where l is the difference in longitude (radians).

[0048] By using a defined projection transformation function, the latitude and longitude (in degrees) of each trajectory point are converted into Cartesian coordinates (in meters), resulting in transformed vector point feature data. The transformed coordinates facilitate subsequent spatial analysis and rasterization.

[0049] Rasterization conversion

[0050] ① Determine the raster parameters:

[0051] Based on the interval of trajectory points in the area (based on a 3-second data collection interval and the speed of agricultural machinery, the interval is approximately 3-8 meters), the grid unit size is set to 1 meter × 1 meter, and the scale is 1:1000.

[0052] At a 1:1000 scale, a 1m x 1m grid cell corresponds to a 1m x 1m area on the actual ground, with a spatial resolution of 1 meter. This allows for the capture of subtle distributions of trajectory points, including the trajectory details when agricultural machinery turns or makes U-turns. With 1000 x 800 = 800,000 grid cells, the TIFF image data size is approximately 2.4MB (calculated at 3 bytes / pixel), completely preserving the distribution characteristics of the trajectory points. Using these parameter settings, the boundary error of the mask generated by the Mask R-CNN model is ≤1 meter.

[0053] ②Trajectory point rasterization:

[0054] Determine the range of the raster image: Calculate the minimum and maximum values ​​of x and y in the transformed Cartesian coordinates. Starting from the minimum value, divide the image into grids of 1 meter × 1 meter. The number of grids is (x_max - x_min) × (y_max - y_min).

[0055] Traverse each trajectory point, determine the grid cell it belongs to based on its Cartesian coordinates, and count the number of trajectory points (trajectory density) in each grid cell.

[0056] The raster cells are assigned grayscale values ​​based on trajectory density; higher trajectory density results in larger grayscale values ​​(range 0-255). This forms a raster image, which is then saved in TIFF format, ensuring image clarity and integrity to meet subsequent segmentation requirements. This process transforms discrete vector trajectory points into a continuous raster image, providing a suitable input format for deep learning segmentation.

[0057] In this embodiment, the raster image is divided into a training set and a validation set at an 8:2 ratio. The Labelme tool is used to accurately label the trajectory regions and generate a JSON format annotation file. Data augmentation operations such as sliding cropping, random rotation, horizontal and vertical flipping, and scaling are performed on the training set to expand sample diversity. A Mask R-CNN model is built based on the TensorFlow framework, and the network uses ResNet50 to capture the deep texture and shape features of the trajectory. The region proposal network adapts to trajectory regions of different shapes through multi-scale anchor points. Through iterative training until the accuracy of the validation set no longer improves, a model that can accurately identify trajectory regions is obtained. The JSON format annotation file is input into the trained model to obtain the bounding boxes and masks of the trajectory regions.

[0058] Leveraging the high precision of deep learning in image segmentation, the Mask R-CNN model is employed to achieve pixel-level recognition of trajectory regions. Training set preparation: The generated raster images are divided into training and validation sets in an 8:2 ratio. The Labelme tool is used to accurately annotate the trajectory regions (including bounding boxes and pixel-level masks), generating JSON-formatted annotation files. To improve the model's generalization ability, data augmentation operations such as sliding cropping, random rotation, horizontal / vertical flipping, and scaling are applied to the training set, significantly expanding sample diversity. Model training: The Mask R-CNN model is built based on the TensorFlow framework. Its feature extraction network uses ResNet50 to capture the deep texture and shape features of the trajectory. The Region Proposal Network (RPN) adapts to trajectory regions of different shapes through multi-scale anchor points. After multiple rounds of iterative training until the accuracy of the validation set no longer improves, the optimal model capable of accurately recognizing trajectory regions is obtained. Trajectory segmentation: The preprocessed raster image is input into the trained model, and the output is a segmentation result containing the bounding box (planar coordinates) of the trajectory region and a binary mask (1 represents the trajectory region and 0 represents the non-trajectory region), providing a high-precision spatial range reference for field division.

[0059] Improved Measurement Accuracy: Based on Mask R-CNN, the raster data of the fields is segmented, accurately capturing the details and boundaries of the trajectory area, laying a high-precision foundation for subsequent processing. After the field segmentation is completed by DBSCAN clustering, the raster data is then vectorized, effectively preserving the spatial features of the fields. This improves the recognition accuracy of irregular field boundaries and ridge segmentation areas by more than 30% compared to traditional models. Combined with trajectory denoising and coordinate transformation technology, the error in the operation area measurement can be controlled within 5%. Improved Automation Efficiency: Mask R-CNN automatically segments the field raster data, and DBSCAN clustering is used to achieve intelligent field division. Finally, the raster to vector conversion is automatically completed, forming a fully automated "segmentation-clustering-vectorization" process. The efficiency of field division and data conversion is improved by more than 80%, and shapefile format data can be output without manual intervention, adapting to the needs of large-scale operation monitoring. Ensuring Fairness in Subsidies: High-precision field data generated through Mask R-CNN segmentation, DBSCAN clustering, and vectorization provides a reliable basis for subsidy calculation. Coupled with a dual verification mechanism, it prevents false or excessive reporting, ensuring a subsidy disbursement accuracy rate of over 95%. Enhancing Scene Adaptability: Mask R-CNN's strong learning ability for complex trajectory distributions, combined with the adjustable parameters of DBSCAN clustering, adapts to field segmentation needs in different terrains and crop scenarios. The raster-to-vectorization conversion ensures data compatibility across various scenarios. Alternative technologies further enhance resilience against interference in complex environments. Promoting Technological Integration: Starting with Mask R-CNN segmentation, and connecting DBSCAN clustering and vectorization technologies, a comprehensive framework integrating technologies from multiple fields is constructed, providing technical references for precision agriculture and accelerating the digital transformation of agriculture.

[0060] Deep learning instance segmentation based on Mask R-CNN

[0061] 1. Selection of training set samples:

[0062] 80% of the generated raster images are randomly selected as the training set and 20% as the validation set. This division ratio was determined after comprehensively considering the amount of data required for model training and validation accuracy. The 80% training set can provide sufficient learning samples for the model, while the 20% validation set can effectively evaluate the model's generalization ability.

[0063] The Labelme annotation tool is used to annotate the trajectory regions in the training and validation set images. During the annotation process, the boundaries of the trajectory regions must be precisely delineated along their edges to ensure that the bounding boxes completely enclose the trajectory regions and that the masks accurately cover every pixel of the trajectory regions. After annotation, a JSON format annotation file containing bounding box coordinates and mask pixel information is generated. Each annotation file corresponds one-to-one with the corresponding raster image, facilitating data reading and matching during model training.

[0064] To enhance the model's adaptability to different scenarios, data augmentation was performed on the training set samples: sliding space cropping was used to divide the original raster image into blocks with a 50% overlap rate, generating sub-images of different local regions to enrich the local features of the samples; random rotation was implemented, with rotation angles randomly selected within the range of 0-360° to allow the model to adapt to the distribution of trajectories in different directions; random flipping, including horizontal and vertical flipping, enhanced the model's ability to recognize the forward and reverse directions of trajectories; and random scaling was performed, scaling the images within the range of 0.8-1.2 times to enable the model to handle trajectory regions of different scales. Through these data augmentation methods, the number of training set samples was expanded to three times the original size, further improving the model's generalization ability and robustness.

[0065] 2. Model building and training:

[0066] The Mask R-CNN model is built based on the TensorFlow framework. The model consists of a feature extraction network, a region proposal network (RPN), a classification and bounding box regression branch, and a mask generation branch.

[0067] The feature extraction network used is ResNet50, which contains 50 convolutional layers. It can extract deep features of the image through multiple convolutional operations, such as texture and shape information of the trajectory region. ResNet50 was chosen because it has high efficiency and accuracy in image feature extraction and can meet the feature extraction needs of complex scenarios such as agricultural machinery trajectories.

[0068] The anchor point sizes of the Region Proposal Network (RPN) are set to (32, 64, 128, 256, 512), with anchor point ratios of (1:2, 1:1, 2:1). Different anchor point sizes are used to adapt to different track area sizes. Smaller anchor point sizes such as 32 and 64 can capture the track of agricultural machinery operating in narrow areas, while larger anchor point sizes such as 256 and 512 are suitable for wider track areas. Different anchor point ratios can match different track shapes. For example, a 1:2 ratio is suitable for long and narrow tracks, a 2:1 ratio is suitable for wider tracks, and a 1:1 ratio is suitable for approximately square track areas.

[0069] Configure training parameters: batch_size=2, this parameter setting takes into account the memory capacity of the hardware device, improving training efficiency while ensuring model training stability; learning_rate=0.001, the initial learning rate is chosen to enable the model to converge quickly in the early stage of training. As training progresses, the learning rate can be gradually reduced through a learning rate decay strategy to improve the model's accuracy; epochs=50, setting 50 training epochs comprehensively considers the model's convergence speed and overfitting risk, enabling the model to fully learn the data features and avoid overfitting.

[0070] Data augmentation techniques such as random flipping (horizontal and vertical) and rotation (0-180°) are employed. Random flipping makes the model less sensitive to changes in the left-right and up-down directions of the trajectory, while rotation allows the model to adapt to the trajectory's presentation at different angles. Through these data augmentation operations, the diversity of training samples can be increased, improving the model's ability to recognize agricultural machinery trajectories in different scenarios, thereby enhancing the model's generalization ability.

[0071] The training set images and labeled data are input into the model in batches for training. During training, the model performance is evaluated using a validation set every 5 epochs, and the mAP (mean accuracy) value is calculated. The mAP value is an important indicator of the performance of object detection and instance segmentation models; a higher value indicates higher recognition accuracy. When the validation set mAP value does not improve for 5 consecutive epochs, the model is considered to have reached its optimal state, training is stopped, and the model parameters at this point are saved, resulting in the optimal model.

[0072] The preprocessed raster image (the raster image corresponding to number 1581F6BUB234*****2L1) is input into the trained Mask R-CNN model, and the confidence threshold is set to 0.7. The confidence threshold is set to filter out areas with low recognition confidence of the model. The threshold of 0.7 can ensure that most of the true trajectory areas are preserved, while effectively reducing the areas of false recognition.

[0073] The model performs a series of operations, including feature extraction, region proposal, classification and regression, and mask generation, to output the bounding box of the trajectory region (containing the Cartesian coordinates of the top left and bottom right corners) and the mask (raster data, where 0 represents a non-trajectory region and 1 represents a trajectory region). This step accurately identifies the region where the trajectory is located, providing precise trajectory region information for subsequent field segmentation.

[0074] The specific LocalOutlierFactor function is a function in the Scikit-learn library used to detect local outliers. It determines whether a data point is an outlier by calculating the local density deviation of each data point relative to its neighbors; points with significantly lower local densities than their neighbors are considered outliers. In the data preprocessing stage of this invention, it is used to calculate the local outlier score for agricultural machinery trajectory points. A score threshold of 1.5 is set to remove outlier trajectory points, ensuring the accuracy of the trajectory data and providing a reliable data foundation for subsequent processing.

[0075] Specifically, Mask R-CNN is a deep learning-based instance segmentation model that adds a mask generation branch to Faster R-CNN. It can simultaneously achieve object detection and semantic segmentation, both identifying targets in an image and determining their bounding boxes, and generating pixel-level masks to accurately delineate the target contours. In this invention, it is used for instance segmentation of raster images of agricultural machinery trajectories, outputting the bounding boxes and masks (raster data) of the trajectory regions. Compared to traditional semantic segmentation models, it can more accurately capture the details and boundaries of the trajectory, making it one of the core technologies for achieving high-precision trajectory region recognition.

[0076] Specifically, DBSCAN, or Density Clustering Algorithm, is a density-based spatial clustering method. By setting a neighborhood radius and a minimum number of samples, points within the neighborhood radius containing at least the minimum number of samples are considered core points. These core points and their neighboring points are then clustered into one class, achieving data clustering. In the field segmentation stage of this invention, it is used to perform cluster analysis on the trajectory region vector polygons obtained from instance segmentation. Setting the neighborhood radius to 3 meters and the minimum number of samples to 3, it clusters closely spaced trajectory regions into one class, achieving automatic field segmentation and effectively handling complex situations such as trajectory region adhesion.

[0077] In this embodiment, the bounding box and mask of the trajectory region are obtained, and the vector trajectory point set of the corresponding trajectory region is extracted from the mask by the instance segmentation output method. By analyzing the size of the trajectory point spacing and the continuity of the timestamp, the trajectory range of the field is initially divided. The DBSCAN algorithm is used to cluster spatially closely related trajectory points into one class and automatically divide the trajectory range of different fields. The isolated points generated by clustering are judged by area and distance, and are processed into independent small fields, merged into neighboring fields, and marked as noise to obtain shapefile data.

[0078] To address the potential issue of trajectory region adhesion in instance segmentation results, the DBSCAN clustering algorithm is used to achieve fine-grained field division: Trajectory point extraction: Vector trajectory point sets (preprocessed) corresponding to the trajectory region are extracted from the mask output by instance segmentation. Each point contains precise planar coordinate information. Clustering analysis: Combining the spatial distribution characteristics of trajectory points (small spacing between trajectory points within the same field, large spacing between different fields) and timestamp continuity (short time intervals between operations within the same field), the DBSCAN algorithm clusters spatially related trajectory points into one class, automatically defining the trajectory range of different fields. Result optimization: Isolated points generated by clustering are determined by area and distance to be independent small fields, merged into neighboring fields, or marked as noise, effectively handling complex scenarios such as trajectory adhesion and breakage. This step, through fine-grained division of trajectory points using the clustering algorithm, achieves a field boundary recognition accuracy of over 92%, significantly outperforming traditional distance-threshold-based segmentation methods.

[0079] By further refining the trajectory points using the DBSCAN clustering algorithm, the automatic division of trajectory points in different fields can be achieved, effectively handling complex situations such as trajectory area adhesion and improving the accuracy of field segmentation.

[0080] 1. Trajectory point extraction:

[0081] Extract the original trajectory point set corresponding to the trajectory region (pixel value of 1) from the mask raster data output by Mask R-CNN instance segmentation, ensuring that each trajectory point contains Cartesian coordinate (x, y) information.

[0082] 2. Trajectory point feature analysis:

[0083] Calculate the spatial distribution density of trajectory points, count the number of neighboring points within a 3-meter radius of each trajectory point, and identify high-density trajectory point clusters (corresponding to continuous work areas) and low-density discrete points (corresponding to work gaps or edge areas).

[0084] The timestamp information of trajectory points helps to determine the continuity of the trajectory. The time interval between trajectory points in the same field is usually ≤30 seconds, providing a time dimension reference for trajectory point clustering.

[0085] 3. DBSCAN clustering parameter adaptation:

[0086] Based on the spatial distribution characteristics of trajectory points (the distance between trajectory points within the same field is <3 meters, and the distance between trajectory points in different fields is >5 meters), the DBSCAN algorithm parameters are set as follows: neighborhood radius ε = 3 meters (to ensure that trajectory points within the same field can be clustered into one class), and minimum number of samples MinPts = 3 (to avoid isolated points being misclassified as independent fields).

[0087] This parameter combination can accurately capture the spatial correlation of trajectory points, effectively distinguishing adhering trajectory points and providing parameter support for the division of trajectory points in different fields.

[0088] 4. Trajectory point clustering and field segmentation:

[0089] The DBSCAN function of the Scikit-learn library is called to cluster the trajectory points, outputting the cluster label for each trajectory point. Trajectory points with the same label are determined to be trajectories of the same field, forming the trajectory point data after clustering.

[0090] For trajectory point clusters with different labels, retain their boundary spacing to ensure that the distance between trajectory points in adjacent fields after segmentation is ≥0.5 meters, thus avoiding re-adhesion.

[0091] For isolated trajectory points generated after clustering, if the number of them is greater than 10 (corresponding to an operating area of ​​greater than 50 square meters), they are determined to be trajectories of independent small plots and are used as trajectory point data of separate clusters; if the number is less than or equal to 10 and the distance to the nearest trajectory point cluster is less than 2 meters, they are merged into the trajectory point cluster of the nearest plot; otherwise, they are marked as noise points (non-operating trajectories).

[0092] By refining and clustering the trajectory points as described above, the problem of trajectory region adhesion can be effectively solved, and trajectory point data with clustering completed according to field plots can be obtained, with a field plot segmentation accuracy of over 92%.

[0093] Specifically, Scikit-learn is an open-source machine learning library based on the Python language. It integrates various classic machine learning algorithms, data preprocessing tools, and model evaluation methods, and is characterized by ease of use and high efficiency. In this invention, it is used to implement the density-based Local Outlier Factor (LOF) algorithm for trajectory data denoising. By calling its built-in correlation functions, it calculates the local outlier score of trajectory points to remove outliers.

[0094] In this embodiment, shapefile data is acquired and converted into vector plots: the findContours function of the OpenCV library is used to extract the outer contour of the field from the trajectory mask, retaining the outermost boundary and compressing redundant line segments; the Douglas-Puk algorithm is used to simplify the contour polygons, reducing the number of vertices while ensuring the boundary shape, thereby improving data processing efficiency; the simplified polygons are transformed from image coordinates to Gauss-Kruger plane coordinates, and overlaps and self-intersections are eliminated through deduplication and topology checks to obtain the field plot elements.

[0095] The clustered trajectory point data is converted into vector polygons to provide standardized data for area calculation: Contour extraction: The `findContours` function of the OpenCV library is used to extract the outer contours of the fields from the trajectory mask, preserving the outermost boundary and compressing redundant line segments. Polygon simplification: The Douglas-Puk algorithm is used to simplify the contour polygons, reducing the number of vertices while maintaining the boundary shape, thus improving data processing efficiency. Geographic transformation and topology optimization: The simplified polygons are transformed from image coordinates to Gauss-Kruger plane coordinates. Duplicate removal and topology checks are performed to eliminate overlap and self-intersection problems, generating complete field polygon features. Geographic transformation and topology optimization: The simplified polygons are transformed from image coordinates to Gauss-Kruger plane coordinates. After deduplication and topology checking, overlapping and self-intersection problems are eliminated, and complete field patch features are generated.

[0096] Accurate measurement and verification of area are achieved through spatial analysis capabilities of vector data: Area Calculation: Based on vectorized map features, the planar area of ​​each plot is calculated under Gauss-Kruger projection, converted to 1 mu = 666.67 square meters, and information such as total operating area, number of plots, and areas of repeated operation are collected. Accuracy Calibration: The theoretical operating area is calculated using "total trajectory length × operating width". Typical plots of different area levels are randomly selected, and the accuracy is verified by the deviation rate (the ratio of the difference between the map area and the theoretical area). The results show that the deviation rate is less than 5%, meeting the industry standard for agricultural operating area measurement.

[0097] Contour extraction: The "findContours" function of the OpenCV library is used to extract the outer contour from the field mask. The function parameters are set as follows: mode=cv2.RETR_EXTERNAL (extract only the outermost contour) and method=cv2.CHAIN_APPROX_SIMPLE (compress line segments in the horizontal, vertical and diagonal directions, and retain the endpoints) to obtain the initial contour coordinates of the field.

[0098] Polygon simplification: The Douglas-Puk algorithm is used to simplify the initial outline polygons, with a tolerance of 0.5 meters. This reduces the number of vertices while maintaining the shape of the field boundaries, thereby improving data processing efficiency.

[0099] Geographic transformation: By transforming the geographic reference system, the simplified polygon is transformed from image coordinates to a Cartesian coordinate system (central meridian 121°E) to ensure that the vector result is consistent with the actual geographic spatial location.

[0100] Topology optimization: The transformed vector polygons are deduplicated and topologically checked to eliminate overlapping vertices and self-intersecting boundaries, ultimately resulting in 106 field feature elements.

[0101] By integrating instance segmentation masks with DBSCAN clustering results, and through contour extraction, simplification, and geographic transformation, high-precision field vector data is generated, providing a reliable vector foundation for subsequent area calculation and spatial analysis.

[0102] In this embodiment, the field plot features are acquired, the planar area of ​​each field is calculated under Gauss-Kruger projection, and the total operating area, number of plots, and repeated operating areas are statistically analyzed. The theoretical operating area is calculated using the method of total trajectory length × operating width. Typical fields of different area levels are randomly selected, and the accuracy is verified by the deviation rate to obtain the accurate measurement result of the agricultural machinery operating trajectory area.

[0103] Calculate the plane area under Gauss-Kruger projection using the features of the map.

[0104] Calculate the planar area of ​​each patch (unit: square meters), and convert the unit to 1 mu = 666.67 square meters.

[0105] Area statistics results:

[0106] According to statistics, such as Figure 4 As shown, the trajectory data of number 1581F6BUB234*****2L1 corresponds to 106 agricultural machinery operation plots, with a total operation plot area of ​​1507.91 mu. The maximum area is ** mu and the minimum area is ** mu.

[0107] By analyzing the timestamps of trajectory points, overlapping areas can be identified, thus determining plots of land where repeated operations are conducted. Figure 5 As shown, the number of operation trajectories with ≥2 times in the same field is at most 78 times and at least 2 times.

[0108] Theoretical area calculation:

[0109] The theoretical working area is calculated using the formula "total length of the working trajectory × width". The total trajectory length is obtained by summing the Euclidean distances between adjacent valid trajectory points, and the calculated total trajectory length is 2615.2 meters.

[0110] Based on the cooperative's agricultural machinery operating parameters (width 2.5 meters), the theoretical operating area is 2615.2 × 2.5 = 6538.0 square meters, which is approximately 9.81 mu.

[0111] Accuracy verification:

[0112] Thirty typical plots were randomly selected (covering different area levels: <10 mu, 10-50 mu, >50 mu) for comparative analysis of the mapped area and the theoretical area. The area deviation rate for each plot was calculated.

[0113] Deviation rate = (area of ​​patch - theoretical area) / theoretical area × 100%

[0114] The verification results show that the area deviation rate of all 30 plots is less than 5% (maximum deviation rate 4.2%, minimum deviation rate 0.8%), which meets the accuracy requirements for agricultural operation area measurement (allowable deviation ≤ 5%), so no secondary verification is required.

[0115] The above steps complete the automatic division of fields. The final output shp format data can be directly applied to field planning, agricultural machinery scheduling, and yield estimation in agricultural production management, providing accurate spatial information support for agricultural production.

[0116] In this embodiment, the alternative denoising process is to use Kalman filtering to predict and correct outliers by constructing a trajectory motion model based on Kalman filtering.

[0117] The denoising process was replaced with Kalman filtering (based on trajectory motion model prediction and correction of outliers). However, it has limitations in identifying sudden outliers and may retain some noise points, affecting subsequent analysis. The grid cell size can be adjusted to 0.5 meters or 2 meters to balance accuracy and efficiency. A 0.5-meter cell will significantly increase the data storage and processing pressure, while a 2-meter cell may lose trajectory details, resulting in a decrease in segmentation boundary accuracy of approximately 10%-15%.

[0118] In this embodiment, instance segmentation uses a combination model of Faster R-CNN and FCN.

[0119] Instance segmentation uses a combination model of Faster R-CNN and FCN, which has limited ability to capture subtle boundaries of trajectories, and the mask generation accuracy is 5%-8% lower than Mask R-CNN; field segmentation can be replaced by a hierarchical clustering algorithm (hierarchical aggregation based on trajectory region similarity), which is not good at distinguishing adhering trajectories, and the field segmentation accuracy is usually below 85%.

[0120] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely preferred examples and are not intended to limit the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for calculating the area of ​​agricultural machinery operation trajectory based on deep learning, characterized in that, The deep learning-based method for calculating the area of ​​agricultural machinery operation trajectories includes the following steps: The monitoring equipment, equipped with a high-precision GNSS module and sensors, collects the operation trajectory data of agricultural machinery in real time. The data is then uploaded to a cloud server for storage via a wireless communication module to obtain the raw dataset. The original dataset is obtained, and the data is subjected to denoising and coordinate transformation. The processed data is mapped to a Cartesian coordinate system and then transformed into a grid image. A deep learning model based on Mask R-CNN is constructed, an attention mechanism is introduced, and the model is trained to be suitable for agricultural machinery trajectory segmentation tasks. The model is used to predict the raster image and obtain the bounding box and mask of the trajectory region. The pixel coordinates corresponding to the mask are reverse-mapped to a set of geographic coordinate points to form a trajectory point set. The DBSCAN clustering algorithm is used to perform cluster analysis on the trajectory point set to achieve field segmentation and obtain shapefile data. The shapefile data is converted into vector plots, and the field plot elements are obtained through contour extraction, polygon simplification, topological relationship checking and optimization. Based on the field plot features, the area of ​​each field is calculated using vector space analysis technology. The accuracy is verified by comparing the results with reference data, thus obtaining a precise measurement result of the area of ​​the agricultural machinery operation trajectory.

2. The method for calculating the area of ​​agricultural machinery operation trajectory based on deep learning according to claim 1, characterized in that, The monitoring equipment, equipped with a high-precision GNSS module and sensors, collects real-time data on the agricultural machinery's operating trajectory. This data is then uploaded to a cloud server for storage via a wireless communication module to obtain the raw dataset. The process includes the following steps: Monitoring equipment integrating high-precision GNSS modules and multiple sensors is installed on agricultural machinery to obtain operation trajectory data in real time. The monitoring equipment automatically collects data every 3 seconds and transmits the data stably to the cloud server through a 4G wireless communication module. The server establishes a dedicated storage directory based on the unique number of the trajectory data, extracts the timestamp as the file name to archive the original data, and obtains the original dataset. The operation trajectory data includes: latitude and longitude positioning accuracy within 1 meter, time accuracy to the second level, operation status, running speed, engine speed, and working status of the operation device.

3. The method for calculating the area of ​​agricultural machinery operation trajectory based on deep learning according to claim 1, characterized in that, The process of obtaining the original dataset, performing denoising and coordinate transformation on the data, mapping the processed data to a Cartesian coordinate system, and obtaining a raster image through gridding transformation includes the following steps: Obtain the original dataset and use the Python Pandas library to read the trajectory data in CSV format from the cloud server; Filter by the job status field to extract valid job trajectory points and remove non-job trajectory points; The local outlier factor algorithm is used to identify outliers by calculating the density difference between trajectory points and their neighbors, and to remove outliers with scores exceeding the threshold, thereby improving the spatial continuity of trajectory data. The WGS84 coordinates are converted to local plane rectangular coordinates using Gauss-Kruger projection to eliminate deformation errors; The trajectory points are mapped to raster cells and assigned grayscale values ​​to obtain a TIFF format raster image.

4. The method for calculating the area of ​​agricultural machinery operation trajectory based on deep learning according to claim 1, characterized in that, The construction of a deep learning model based on Mask R-CNN, incorporating an attention mechanism, and training the model to be suitable for agricultural machinery trajectory segmentation tasks, predicting the bounding boxes and masks of the trajectory regions from the raster image, includes the following steps: The raster image was divided into training and validation sets in an 8:2 ratio. The Labelme tool was used to accurately annotate the trajectory regions and generate a JSON format annotation file. Data augmentation operations such as sliding cropping, random rotation, horizontal and vertical flipping, and scaling are applied to the training set to increase sample diversity. The Mask R-CNN model was built based on the TensorFlow framework, and the network used ResNet50 to capture deep texture and shape features of the trajectory. The region proposal network adapts to trajectory regions of different shapes through multi-scale anchor points. Through iterative training until the accuracy on the validation set no longer improves, a model that can accurately identify trajectory regions is obtained. Input the JSON format annotation file into the trained model to obtain the bounding box and mask of the trajectory region.

5. The method for calculating the area of ​​agricultural machinery operation trajectory based on deep learning according to claim 1, characterized in that, The process of mapping the pixel coordinates corresponding to the mask back to a set of geographic coordinate points to form a trajectory point set, and then using the DBSCAN clustering algorithm to perform cluster analysis on the trajectory point set to segment the fields and obtain shapefile data includes the following steps: Obtain the bounding box and mask of the trajectory region, and extract the corresponding trajectory region vector trajectory point set from the mask using instance segmentation output; By analyzing the spacing between trajectory points and the continuity of timestamps, the trajectory range of the field is preliminarily divided. The DBSCAN algorithm is used to cluster spatially related trajectory points into one class and automatically divide the trajectory range of different fields. The isolated points generated by clustering are determined by area and distance, and then processed into independent small plots, merged into neighboring plots, and marked as noise to obtain shapefile data.

6. The method for calculating the area of ​​agricultural machinery operation trajectory based on deep learning according to claim 1, characterized in that, The process of converting shapefile data into vector plots, and obtaining field plot features through contour extraction, polygon simplification, topological relationship checking, and optimization, includes the following steps: Obtain shapefile data and convert it into a vector graphic: The findContours function of the OpenCV library is used to extract the outer contour of the field from the trajectory mask, preserving the outermost boundary and compressing redundant line segments; The Douglas-Puk algorithm is used to simplify the outline polygon, reducing the number of vertices while maintaining the boundary shape, thereby improving data processing efficiency. The simplified polygons are transformed from image coordinates to Gauss-Kruger plane coordinates. Overlapping and self-intersection are eliminated through deduplication and topology checks to obtain the field patch features.

7. The method for calculating the area of ​​agricultural machinery operation trajectory based on deep learning according to claim 1, characterized in that, The process of calculating the area of ​​each field plot using vector space analysis based on the field plot features, and verifying the accuracy by comparing it with reference data, to obtain a precise measurement result of the area of ​​the agricultural machinery operation trajectory includes the following steps: Obtain the features of the field plots, calculate the planar area of ​​each plot under the Gauss-Kruger projection, and count the total operating area, the number of plots, and the areas of repeated operations. The theoretical operating area is calculated by multiplying the total trajectory length by the operating width. Typical fields of different area levels are randomly selected, and the accuracy is verified by the deviation rate to obtain the precise measurement result of the agricultural machinery operating trajectory area.

8. The method for calculating the area of ​​agricultural machinery operation trajectory based on deep learning according to claim 3, characterized in that, The denoising process employs Kalman filtering, which predicts and corrects outliers by constructing a trajectory motion model based on Kalman filtering.

9. The method for calculating the area of ​​agricultural machinery operation trajectory based on deep learning according to claim 5, characterized in that, The instance segmentation uses a combination model of Faster R-CNN and FCN.