Farmland boundary construction and operation area calculation method, device and system, and storage medium
By employing an end-to-end deep geometric learning method and combining GNSS/IMU metadata, the physical boundaries of farmland can be directly calculated from UAV/satellite images. This solves the problems of error accumulation and boundary recognition in complex environments in existing technologies, and achieves high-precision farmland area calculation and boundary construction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JIANGXI AGRICULTURAL UNIVERSITY
- Filing Date
- 2026-02-11
- Publication Date
- 2026-05-12
AI Technical Summary
Existing technologies in farmland surveying suffer from problems such as cumulative errors due to fragmented processing procedures, difficulty in identifying narrow field ridges in complex farmland environments, low area calculation accuracy due to neglecting imaging geometric distortion, and a lack of direct optimization targets for geometric and area accuracy.
An end-to-end deep geometry learning approach is adopted, which uses neural networks to simulate the cognitive process of professional surveyors. By extracting semantic and detail features through an improved BiSeNet and combining GNSS/IMU metadata, geographic vector polygons representing the physical boundaries of fields are directly calculated from UAV/satellite images, and sub-pixel-level accurate calculation of cultivated land area is achieved.
It improves the accuracy of agricultural machinery operation area, which can greatly improve the accuracy of farmland boundary construction and area calculation, and generate structured vector geographic information products that can be directly used in GIS systems.
Smart Images

Figure CN122023501A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of agricultural machinery operation technology, specifically relating to a method, device, system, and storage medium for constructing farmland boundaries and calculating the operating area. Background Technology
[0002] With the advancement of precision agriculture and national agricultural modernization, accurate mapping of farmland boundaries and precise statistics of arable land area have become crucial foundations for agricultural subsidy distribution, land transfer and rights confirmation, and agricultural monitoring. Traditional farmland mapping primarily relies on manual labor using GNSS-RTK equipment to walk along field ridges and mark points. While this method offers high accuracy, it is extremely inefficient, labor-intensive, and difficult to implement in complex terrains such as paddy fields, swamps, or during the growing season of tall crops, thus failing to meet the need for rapid acquisition of large-scale farmland information.
[0003] In recent years, with the development of low-altitude UAV remote sensing technology and deep learning computer vision algorithms, automated farmland extraction based on UAV imagery has become a research hotspot. Existing technologies mainly focus on using semantic segmentation networks (such as U-Net, DeepLab series, etc.) to perform pixel-level classification on farmland orthophotos or single aerial images, segmenting the image into binary masks of "cultivated land" and "non-cultivated land," and then calculating the area through image post-processing.
[0004] However, despite the progress made in existing technologies, the following significant technical problems and shortcomings still exist in practical applications: 1. Fragmented Processing Flow Leads to Severe Accumulated Errors. Existing technologies typically employ a "step-by-step" processing strategy: first, a deep learning network outputs pixel-level raster segmentation maps; then, traditional image processing algorithms such as edge extraction, skeletonization, and Douglas-Peucker polygon fitting convert the raster into vector boundaries; finally, coordinate transformation is performed to calculate the area. In this non-end-to-end process, edge noise from the segmentation stage (such as jagged edges) is carried over to subsequent steps, and the polygon fitting process often relies on manually set thresholds, lacking adaptability. This results in a significant deviation between the final generated vector boundaries and the actual field ridges, with errors accumulating step by step.
[0005] 2. Difficulty in handling "weak boundary" recognition in complex farmland environments: In real-world farmland scenarios, field ridges (boundaries) are often very narrow (only 20-50 cm) and frequently covered by weeds or obscured by crops (such as lodged wheat or growing rice). Existing semantic segmentation networks mainly rely on color and texture features for pixel classification, easily misclassifying weedy ridges similar in color to crops as cultivated land, or misclassifying field shadows as boundaries. The lack of prior modeling of field geometry (such as straightness and closure) leads to extracted boundaries often exhibiting breaks, adhesion, or shape distortion.
[0006] 3. Ignoring Imaging Geometric Distortions Leads to Low Area Calculation Accuracy: Existing monocular vision area calculation methods mostly estimate area simply by multiplying the number of pixels by the ground resolution (GSD). This method assumes the camera is shooting from a perfectly vertical downward angle and the ground is absolutely flat. However, during actual drone flights or agricultural field data collection, pitch or roll distortion is inevitable due to airflow, causing perspective distortion in the image (e.g., rectangular fields appear as trapezoids in the image); simultaneously, terrain undulations also cause projection errors. Current technologies lack a mechanism for end-to-end geometric correction using GNSS / IMU metadata, and area calculations directly based on distorted images often have significant deviations.
[0007] 4. Lack of Direct Optimization Objectives for Geometric and Area Accuracy: Mainstream deep learning networks typically use cross-entropy loss or IoU loss during training. These loss functions focus on pixel classification accuracy, rather than the geometric location accuracy of boundaries or the accuracy of the final area value. This results in the network performing well in classifying the center area of the field, but exhibiting ambiguity at the boundary locations that determine area accuracy, failing to meet the accuracy requirements at the cadastral survey level.
[0008] In summary, developing an end-to-end mapping method that can integrate image features and shooting posture information to directly output high-precision vector boundaries and perform area calibration is a key technical problem that urgently needs to be solved in the field of smart agriculture sensing. Summary of the Invention
[0009] To address the problems existing in the prior art, this invention provides a method, apparatus, system, and storage medium for constructing farmland boundaries and calculating the operational area.
[0010] To achieve the above objectives, the present invention provides the following solution: A method for constructing farmland boundaries and calculating the operational area includes: Step S1: Obtain farmland images and their GNSS / IMU metadata; Step S2: Based on farmland images and their GNSS / IMU metadata, extract semantic features that distinguish crops, field ridges, and non-cultivated land, and capture detailed features that capture the subtle direction of field ridges; Step S3: Simulate a surveyor walking along the field ridges and marking points based on semantic and detail features to obtain the vertices of the field ridge polygon; Step S4: Obtain the offset field from each pixel to the geographic coordinates based on GNSS / IMU metadata; Step S5: Obtain the geographic polygon based on the vertices of the field ridge polygon and the offset field; Step S6: Obtain the predicted area based on the geographic polygon; Step S7: Based on end-to-end training and optimization, output the vector boundary and reliable surface of the georeferenced data.
[0011] As preferred options, the loss functions optimized for end-to-end training include: vertex sequence loss L_vertex, geographic coordinate regression loss L_geo, and area consistency loss L_area.
[0012] Preferably, in step S2, based on the farmland image and its GNSS / IMU metadata, semantic features that distinguish crops, field ridges and non-cultivated land are extracted using an improved BiSeNet, along with detailed features that capture the subtle direction of the field ridges.
[0013] The present invention also provides a device for constructing farmland boundaries and calculating the area of operation, comprising: The first processing module is used to acquire farmland images and their GNSS / IMU metadata; The second processing module is used to extract semantic features that distinguish crops, field ridges and non-cultivated land, and to capture detailed features that capture the subtle direction of field ridges, based on farmland images and their GNSS / IMU metadata. The third processing module is used to simulate a surveyor walking along the field ridges and marking points based on semantic features and detailed features, thereby obtaining the vertices of the field ridge polygons. The fourth processing module is used to obtain the offset field from each pixel to the geographic coordinates based on GNSS / IMU metadata; The fifth processing module is used to obtain the geographic polygon based on the vertices of the field ridge polygon and the offset field; The sixth processing module is used to obtain the predicted area based on the geographic polygon; The seventh processing module is used for end-to-end training optimization to output the vector boundaries and reliable surfaces of the georeferenced data.
[0014] As preferred options, the loss functions optimized for end-to-end training include: vertex sequence loss L_vertex, geographic coordinate regression loss L_geo, and area consistency loss L_area.
[0015] Preferably, the second processing module extracts semantic features that distinguish crops, field ridges and non-cultivated land, as well as detailed features that capture the subtle direction of field ridges, based on farmland images and their GNSS / IMU metadata, using an improved BiSeNet.
[0016] The present invention also provides a system for constructing farmland boundaries and calculating the area of farmland, comprising: a memory and a processor, wherein the memory stores a computer program that is executed by the processor, and the computer program executes a method for constructing farmland boundaries and calculating the area of farmland when it is run by the processor.
[0017] The present invention also provides a storage medium storing a computer program, which executes a method for constructing farmland boundaries and calculating the operating area when the computer program is running.
[0018] Compared with the prior art, the beneficial effects of the present invention are as follows: To address the problems in existing farmland surveying techniques, such as difficulty in distinguishing field boundaries where crops and weeds coexist, susceptibility to uneven lighting and crop lodging, and inaccurate positioning of field corners (inflection points) due to traditional multi-step methods (segmentation followed by vectorization), leading to large errors in planting area calculations, this invention employs an end-to-end deep geometric learning method. It utilizes neural networks to simulate the cognitive process of professional surveyors: focusing on the texture features of field ridges and the geometric closure of land parcels. It directly calculates geographic vector polygons representing the physical boundaries of fields from UAV / satellite images carrying GNSS / IMU metadata, achieving sub-pixel-level accurate calculation of cultivated land area. Using this invention, the accuracy of agricultural machinery operation area can be significantly improved, and the distribution of field parcels can be accurately obtained. Attached Figure Description
[0019] To more clearly illustrate the technical solution of the present invention, the drawings used in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart illustrating the method for constructing farmland boundaries and calculating the operating area according to an embodiment of the present invention. Detailed Implementation
[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0023] Example 1 like Figure 1 As shown, this invention provides a method for constructing farmland boundaries and calculating the operational area, including: Step S1: Obtain farmland images and their GNSS / IMU metadata; Step S2: Based on farmland images and their GNSS / IMU metadata, extract semantic features that distinguish crops, field ridges, and non-cultivated land, and capture detailed features that capture the subtle direction of field ridges; Step S3: Simulate a surveyor walking along the field ridges and marking points based on semantic and detail features to obtain the vertices of the field ridge polygon; Step S4: Obtain the offset field from each pixel to the geographic coordinates based on GNSS / IMU metadata; Step S5: Obtain the geographic polygon based on the vertices of the field ridge polygon and the offset field; Step S6: Obtain the predicted area based on the geographic polygon; Step S7: Based on end-to-end optimization, output the vector boundary and reliable area of the georeferenced data.
[0024] As one embodiment of the present invention, in step S2, semantic features that distinguish between crops, field ridges and non-cultivated land and detailed features that capture the subtle direction of field ridges are extracted by a shared backbone network.
[0025] Shared Backbone Network: Farmland boundaries are typically composed of narrow ridges, often covered with weeds, which closely resemble the texture of crops within the field. General networks are prone to obfuscating these boundaries. An improved BiSeNetV2 is used as the base feature extractor. The multi-scale feature maps {F_d, F_c} output by its detail and semantic branches will be shared by the subsequent two task flows.
[0026] Specific structure and function: The improved BiSeNetV2 serves as the backbone, balancing details and semantics while undergoing lightweight modifications to accommodate possible embedded deployments.
[0027] The ridge texture detail branch focuses on extracting high-frequency information, namely edge abrupt changes in the image. In farmland, this corresponds to the water-land boundary of paddy fields and the furrow edges of dry land. The output feature contains the geometric contour information of the ridges. It consists of three concatenated (Conv3×3, stride=2)→BatchNorm→ReLU blocks, which are quickly downsampled to 1 / 8 of the input size (H / 8, W / 8), and output high-resolution detail features F_detail∈R^(C1×H / 8×W / 8).
[0028] The land cover semantic branch focuses on low-frequency contextual information to distinguish large areas of color patches. For example, it distinguishes between "green wheat areas in the growing season" (inside the field) and "yellow-brown dirt road areas" (outside the field). The output features represent the land cover type. A lightweight network (such as MobileNetV3-Small) is used as the encoder. Its last fully connected layer and pooling layer are removed, outputting features at three scales: 1 / 8, 1 / 16, and 1 / 32. Each scale feature is followed by an attention optimization module (ARM). The ARM first performs global average pooling on the input feature F_in to obtain the channel weight vector w, then performs a non-linear transformation through a fully connected layer containing ReLU, and multiplies it channel-by-channel with the original feature to obtain the refined feature F_arm=σ(FC(Pool(F_in)))⊙F_in, where σ is the Sigmoid function.
[0029] The Feature Fusion Module (FFM) fuses F_detail (field ridge lines) and F_arm (plot attributes) to generate a shared feature that includes both the plot category attributes and retains precise field ridge location information. It is used to fuse the output of the detail branch and 1 / 8 of the semantic branch output. Let the detail feature be F_d and the semantic feature be F_s. First, F_s is upsampled to the same size as F_d and concatenated by channels: F_cat = Concat(F_d, Upsample(F_s)). Then, a 1×1 convolution is used for dimensionality reduction, and channel attention is applied: F_fused = Attn(Conv1x1(F_cat)), where the Attn structure is similar to ARM. The final output shared feature F = F_fused has a size of (C×H / 8×W / 8).
[0030] In one embodiment of the present invention, in step S3, the vertices of the field ridge polygon are predicted by the boundary vertex sequence prediction module.
[0031] Furthermore, farmland shapes are often irregular (non-standard rectangles) and contain many tiny jagged edges. Traditional segmentation methods generate boundary points that are too dense and contain noise. This module aims to generate sparse but critical "boundary points" (inflection points), i.e., locations where the direction of the field ridges changes significantly. Instead of outputting pixel-level segmentation masks, it directly regresses the ordered vertex sequence of the field ridge polygons.
[0032] Network structure: Field context encoding: The context vector represents the overall topological shape of the current field (e.g., whether it is an "L-shaped" or "trapezoidal" field). An RNN recurrent neural network module is then connected to this shared feature.
[0033] The virtual surveyor decoder based on RNN: Shared feature maps are encoded into a context vector via CNN and input into the RNN. The RNN recursively predicts the relative offset (Δx_i, Δy_i) of a boundary vertex and a "terminator" at each step, thus autoregressively generating a closed polygon vertex sequence V_img={v1,v2,...,vn} (image coordinate system). This recursive process simulates the surveyor walking along the field ridges. Each boundary vertex represents the surveyor's current position and direction of travel at step i. Sequence generation ends when the predicted point returns to the vicinity of the starting point (i.e., a closed field is detected).
[0034] The loss function is the correlation boundary characteristic: Because the number of manually labeled field boundary points may differ from the predicted number of points, Time Warping (DTW) is used to align the predicted field ridge trajectories with the actual cadastral boundaries, ensuring shape fitting rather than forced point-to-point matching. Chamfer Distance or Dynamic Time Warping (DTW) loss is used to calculate the distance between the predicted vertex sequence and the actual labeled vertex sequence. These losses are insensitive to the sequence order and the number of points, making them more suitable for polygon matching.
[0035] L_vertex=CD(V_pred,V_gt)=Σ_{pinV_pred}min_{qinV_gt}||pq||^2+Σ_{qinV_gt}min_{pinV_pred}||pq||^2 Detailed network structure of the boundary vertex sequence prediction flow: Context encoder: The shared feature F is further encoded by a lightweight convolutional encoder (e.g., 2 residual blocks) and then compressed into a fixed-dimensional context vector c∈R^D by global average pooling.
[0036] GRU-based sequence decoder: Initial state: The initial hidden state h_0 of the decoder GRU is obtained by mapping the context vector c through a linear layer: h_0 = W_h c+b_h Decoding Step 1: Input a learnable "start" token s_start∈R^2, and the GRU outputs the hidden state h_1.
[0037] Looping prediction: At time step t, the hidden state h_t of the GRU is passed through a prediction head (fully connected layer + Tanh) to output the vertex v_t for the current step. Simultaneously, v_t is linearly transformed and concatenated with the context vector c, serving as the input x_{t+1} for the next step. This process continues until the "end" token is predicted or the maximum step size N_max is reached.
[0038] formulation: h_t=GRU([x_t;c_proj],h_{t-1}) v_t=Tanh(W_v h_t+b_v) x_{t+1}=Linear([v_t;c]) Here, c_proj is a linear projection of c.
[0039] Loss function: Main loss: Dynamic Time Warping (DTW) loss is used. Let the predicted sequence P = {p_1,...,p_m} and the true sequence G = {g_1,...,g_n}. DTW searches for an aligned path π that minimizes the cumulative distance: L_dtw(P,G)=min_{π∈A}Σ_{(i,j)∈π}||p_i-g_j||^2 Where A is the set of all possible alignment paths. This is implemented using differentiable DTW forward computation.
[0040] Auxiliary loss: Polygon closure loss L_close=||p_1-p_m||^2, which encourages sequences to be connected end to end.
[0041] Total loss of this flow: L_vertex = L_dtw + α L_close By forcing the predicted last point to coincide with the first point through total loss, the algorithm conforms to the physical property that farmland plots must be closed. Traditional methods extract contours from segmentation masks, which easily produces jagged edges. GRU sequence prediction directly generates vectorized inflection points. This means that the algorithm outputs smooth, straight field ridge segments, which conform to the planning characteristics of farmland irrigation construction, eliminating the need for post-processing smoothing.
[0042] As one embodiment of the present invention, in step S4, the offset field from each pixel to the geographic coordinate is obtained by the pixel-geographic coordinate implicit mapping field prediction flow module based on GNSS / IMU metadata.
[0043] Furthermore, the network structure of the pixel-geographic coordinate implicit mapping field prediction flow module: Metadata encoder: The metadata vector M is encoded into a condition vector z ∈R^C_z by a multilayer perceptron (MLP).
[0044] Conditional Feature Modulation: Shared features F are fed into a series of "conditional convolutional blocks". Each block first performs a standard convolution on the input features X, then uses a conditional vector z to generate a scaling factor γ and an offset factor β, and performs an affine transformation on the convolution output: Y = γ(z) ⊙ Conv(X) + β(z). This makes the feature response dependent on the geometry at the time of capture.
[0045] Offset field prediction head: The modulated feature map is progressively upsampled to the original image size (H, W) by a decoder consisting of three transposed convolutional layers (or upsampling + convolution). The last layer uses the Tanh activation function to output the normalized offset (Δu, Δv) ∈ [-1, 1]^2 for each pixel.
[0046] Offset to geographic offset conversion: Assume the geographic offset of the image center pixel (H / 2, W / 2) is (0, 0). The maximum geographic offset (Δlat_max, Δlon_max) of the image edge pixels can be estimated using an initial value based on camera height, field of view (FOV), and center point latitude, and used as a learnable scaling parameter S. Finally, the geographic offset of pixel (i,j) is: (Δlat_{ij}, Δlon_{ij}) = S ⊙ (Δu_{ij}, Δv_{ij}) For any pixel in the image that shares a feature F (representing a crop or a section of field ridge), its output value, Maximum Geographic Offset (Δlat_max, Δlon_max), represents the latitude and longitude offset of that point relative to the image center on the real Earth's surface. This step is essentially an implicit orthorectification of the image, mapping the features of the farmland image under perspective projection back to the real geographic space.
[0047] In one embodiment of the present invention, in step S5, a geographic polygon is obtained by using a vertex coordinate geographic mapping module based on the vertices and offset field of the field ridge polygon.
[0048] The vertex coordinate geomapping module is the core hub connecting the "image space" and "geographic space" of the entire system. Its core task is to fuse the sequence of polygon vertices (continuous values) in the image coordinate system output by the boundary vertex prediction stream module with the dense geographic offset field (discrete grid) output by the pixel-geographic coordinate implicit mapping field prediction stream module, ultimately calculating the precise geographic coordinates (latitude and longitude) of each vertex in the real world. The processing is a deterministic computational flow, executing the following steps in parallel or cyclically for each vertex in the sequence: Coordinate Alignment First, the normalized continuous coordinates (x^n_i, y^n_i) of vertex v_i need to be mapped to the discrete grid space of the offset field to determine its floating-point position (x'_i, y'_i) in the grid.
[0049] Let the width of the Offset field be W and the height be H.
[0050] If the input is standardized coordinates in the interval [0, 1], then the mapping formula is: x'_i = x^n_i \times (W - 1) y'_i = y^n_i \times (H - 1) Result: We obtained the precise floating-point position of the vertex in the H × W grid (e.g., in row 50.3, column 60.7).
[0051] Neighborhood Identification Determine the four nearest integer grid points (i.e., “pixels”) surrounding the floating-point position (x’_i, y’_i).
[0052] Top-left index: (x_0, y_0) = (\lfloor x'_i \rfloor, \lfloor y'_i \rfloor) (rounded down) Top-right index: (x_1, y_0) = (x_0 + 1, y_0) Bottom-left index: (x_0, y_1) = (x_0, y_0 + 1) Bottom right index: (x_1, y_1) = (x_0 + 1, y_0 + 1) Read the geographic offset values corresponding to these four corner points from the Offset field: O_{00}, O_{10}, O_{01}, O_{11}.
[0053] Bilinear Interpolation Sampling This is the most crucial step. Based on the distance of the floating-point position from the four corner points, the weights are calculated, and a weighted average is taken to obtain the precise geographical offset of the point (\Delta lat_i, \Delta lon_i).
[0054] Calculate the relative distance weights (decimal part): \alpha = x'_i - x_0 (weight of horizontal distance from the left) \beta = y'_i - y_0 (weight of vertical distance from the top) Applying the bilinear interpolation formula: Sampling result Offset_i = (1-\alpha)(1-\beta)O_{00} + \alpha(1-\beta)O_{10}+ (1-\alpha)\beta O_{01} + \alpha\beta O_{11} Result: The precise geographic offset vector (\Delta lat_i, \Deltalon_i) corresponding to vertex v_i was obtained.
[0055] Deep learning frameworks (such as PyTorch's grid_sample or TensorFlow's resampler) provide efficient and differentiable implementations. This means that during backpropagation training, gradients can not only be propagated back to the offset field to update the pixel-geographic implicit mapping field prediction flow module, but also propagated back to the position coordinates (x'_i, y'_i) through \alpha and \beta in the above formula, thereby updating the boundary vertex series prediction flow module, achieving end-to-end training.
[0056] Absolute Geographic Coordinate Calculation The relative offset obtained from sampling is added to the absolute reference coordinates of the image center to obtain the final geographic coordinates.
[0057] lat_i = lat_c + \Delta lat_i lon_i = lon_c + \Delta lon_i In one embodiment of the present invention, in step S6, the predicted area is obtained by using a differentiable area calculation module based on the geographic polygon.
[0058] The differentiable area calculation module is the final functional output and key supervision feedback point of the entire deep learning network. It converts the geographic polygons (spherical coordinates) output by the vertex coordinate geographic mapping module into precise farmland areas (physical values). The calculation process consists of two strictly sequential steps: Equal-Area Projection Transformation This is a necessary bridge connecting spherical geographic data with planar geometric calculations.
[0059] Objective: To convert latitude and longitude coordinates (lat, lon) on a sphere into metric coordinates (x, y) in a Cartesian coordinate system.
[0060] Key constraint: Equal-Area Projection must be used. This is because our ultimate goal is to calculate area. Many common projections (such as the Mercator projection) severely distort areas (e.g., by magnifying high-latitude regions), leading to inaccurate calculation results. Equal-Area Projection ensures that the area of the projected polygon is equal to the actual area of the Earth's surface.
[0061] Implementation method: Choose an equal-area projection algorithm suitable for the target area, such as Albers Equal-Area Conic Projection Or, for a small area, a local tangent plane is used for equal-area projection.
[0062] The projection defines a mathematical function P_{proj}, which typically includes trigonometric functions and square root operations, but its parameters are fixed geographic constants (not involved in network training).
[0063] Apply this transformation to each vertex in the sequence: (x_i, y_i) = P_{proj}(lat_i, lon_i) Result: The vertex sequence V_{planar} = \{(x_1, y_1), ...,(x_N, y_N)\} in the Cartesian coordinate system is obtained, usually in meters.
[0064] Differentiable Shoelace Formula Calculation After obtaining the planar coordinates, the area of the polygon is calculated using classical analytical geometry formulas, and the calculation process is ensured to be differentiable within the deep learning framework.
[0065] Formula principle: The shoelace formula (also known as the surveyor's formula) calculates the area of any simple polygon by summing the cross product of the coordinates of adjacent vertices.
[0066] Implementation method: Input the planar vertex sequence V_{planar}. To ensure the formula is closed, the virtual N+1th point is set to be equal to the 1st point: (x_{N+1}, y_{N+1}) = (x_1, y_1).
[0067] In deep learning frameworks, the following formula is implemented using basic tensor addition, subtraction, and multiplication operations: Sum = \sum_{i=1}^{N} (x_i \cdot y_{i+1} - x_{i+1} \cdot y_i) The final predicted area is half the absolute value of this sum: Area_{pred} = 0.5 times |Sum| Differentiability explanation (key logic): The addition, subtraction, multiplication, and division involved in the above formulas are all basic differentiable operators in frameworks such as PyTorch / TensorFlow. The absolute value operation |·| is not differentiable at zero, but in practical engineering implementations, deep learning frameworks provide subgradient or smooth approximations (such as variants of Huber Loss or directly using the framework's built-in torch.abs) to ensure that gradients can pass smoothly.
[0068] Logical Connection: Because this calculation process constitutes part of the computation graph, the gradient of Area_{pred} with respect to planar coordinates (x_i, y_i) can be automatically calculated. Combined with the gradient of the projection transformation, the gradient can be propagated back to latitude and longitude (lat_i, lon_i), and then to the vertex coordinate geographic mapping module, the pixel-geographic coordinate implicit mapping field prediction flow module, and the boundary vertex series prediction flow module.
[0069] As one embodiment of the present invention, in step S7, based on end-to-end optimization, the vector boundary and reliable area of the georeferenced data are output, that is, the end-to-end mapping and area optimization from image pixels to geographic vectors. Through the following five logical steps, a closed-loop processing from "original image input" to "geographic reference vector and accurate area output" is realized.
[0070] Step 1: Establish the topological features of the field boundaries within the image (vectorized sequence generation) First, the system does not generate traditional raster masks, but instead uses the boundary vertex series prediction stream module to directly generate vectorized vertices.
[0071] Implementation details: Sequence sampling is performed on the shared feature map using a GRU decoder. The predicted v_t = (u_t, v_t) at each step represents a key turning point (boundary point) of the field ridge.
[0072] Technical logic connection: This step solves the problem of "where is the boundary". By outputting an ordered vertex sequence, the topological closure of the fields is directly established, avoiding the jagged effect and topological breaks during the pixel-to-vector conversion in traditional methods.
[0073] Step 2: Construct a pixel-level geographic coordinate mapping field (geometric correction and relocation) While predicting vertices, the pixel-geographic coordinate implicit mapping field prediction stream module combines sensor metadata M (air altitude, pitch angle, roll angle) to generate a dense geographic offset field Offset.
[0074] Implementation details: The metadata encoder converts camera pose into spatial transformation parameters.
[0075] Conditional convolutional blocks (CondConv) perform "anti-distortion" processing on image features based on pose parameters.
[0076] The output Offset(i, j) records the latitude and longitude offset (\Delta lat, \Delta lon) of each pixel in the image relative to the GNSS coordinates of the center point.
[0077] Technical logic connection: This step solves the problem of "where is the physical location of the pixel". It links the pixel coordinates of monocular vision to the real geophysical coordinate system, compensating for the geometric deformation of farmland caused by camera tilt.
[0078] Step 3: Geographic coordinate mapping of boundary points (cross-spatial bilinear sampling) This is the key link in realizing "geographic reference" in this invention.
[0079] Implementation details: The system uses the vertex coordinates V_{img} = \{v_1, v_2, ..., v_N\} of the image output from the first step as the sampling index.
[0080] Using differentiable bilinear sampling techniques, the corresponding geographic offsets are extracted from the Offset mapping field generated in the second step.
[0081] Calculation formula: Polygon_{geo_i} = (lat_c, lon_c) + Offset(u_i, v_i).
[0082] Technical logic connection: This step uses bilinear sampling to make the "visual inflection point" and "geographic offset" coincide in space, realizing a lossless transformation from the pixel coordinate system to the geographic coordinate system (WGS84), and obtaining a set of vector boundary points with physical meaning.
[0083] Step 4: Physical projection transformation and calculation of differentiable area To obtain a reliable area, the system must perform calculations on an equal-area projection plane.
[0084] Implementation details: Projection transformation: The sequence of geographic boundary points Polygon_{geo} is converted into a set of Cartesian coordinates \{(x_i, y_i)\} (unit: meters) through a fixed equal-area projection layer (such as UTM projection).
[0085] Shoelace Formula Calculation: Area_{pred} = 0.5 \cdot \left| \sum_{i=1}^{N} (x_i y_{i+1} - x_{i+1}y_i) \right| Technical logic connection: This step solves the problem of "how to convert shape into numerical value". Through differentiable mathematical formulas, complex geometric polygons are transformed into a single area value, which directly corresponds to the actual arable area of the land surface.
[0086] Step 5: End-to-end area consistency optimization (backpropagation feedback) This is the core inventive aspect of the present invention: using area error to guide boundary extraction in reverse.
[0087] Implementation details: Calculate the relative error loss L_{area} between the predicted area Area_{pred} and the actual confirmed area Area_{gt}.
[0088] Gradient backtracking: The gradient of L_{area} passes through the shoelace formula, through the projection transformation, and through bilinear sampling, and is finally fed back to the vertex prediction flow of the Module 2 Boundary Vertex Series Prediction Flow Module and the offset field prediction flow of the Module 3 Pixel-Geographic Coordinate Implicit Mapping Field Prediction Flow Module.
[0089] Technical logic connection: This step achieves a logical closed loop. If the area calculation is inaccurate, the system will automatically fine-tune the boundary point coordinates output by the second boundary vertex prediction flow module, bringing them closer to the geometric location that "can generate the correct area." This constraint forces the network to learn the field ridge centerline that better conforms to cadastral surveying standards.
[0090] The innovation of this invention lies in: 1. End-to-end learning: It integrates multiple separate traditional algorithm steps into a trainable neural network, and learns the optimal "perception-geometry-computation" mapping in a data-driven manner, avoiding the problems of error accumulation and manual parameter tuning in traditional pipelines.
[0091] 2. Implicit geometric modeling: Using neural networks to implicitly learn complex pixel-geographic coordinate mappings, it has better robustness to sensor calibration errors, terrain undulations, etc.
[0092] 3. Task Collaborative Optimization: The three tasks of boundary prediction, geolocation, and area calculation provide each other with supervision signals during training, realizing multi-task collaborative efficiency and improving the accuracy and consistency of the overall output.
[0093] 4. Output is ready to use: Directly generate structured vector geographic information products that can be used directly in GIS systems without complex post-processing.
[0094] The specific workflow of this invention is as follows: A vision camera is installed on a rice transplanter to collect image information during the machine's back-and-forth operation. This image information is transmitted to a backend system, which identifies the field ridges using the method of this invention and records their latitude and longitude positions. These coordinates are then connected to form a closed line, and the algorithm processes this line to ultimately form the boundary of the work area. This boundary is then converted into a plot of land on a map, and its area is calculated. This completes the acquisition of the work area map and the calculation of the work area. Example 2 The present invention also provides a device for constructing farmland boundaries and calculating the area of operation, comprising: The first processing module is used to acquire farmland images and their GNSS / IMU metadata; The second processing module is used to extract semantic features that distinguish crops, field ridges and non-cultivated land, and to capture detailed features that capture the subtle direction of field ridges, based on farmland images and their GNSS / IMU metadata. The third processing module is used to simulate a surveyor walking along the field ridges and marking points based on semantic features and detailed features, thereby obtaining the vertices of the field ridge polygons. The fourth processing module is used to obtain the offset field from each pixel to the geographic coordinates based on GNSS / IMU metadata; The fifth processing module is used to obtain the geographic polygon based on the vertices of the field ridge polygon and the offset field; The sixth processing module is used to obtain the predicted area based on the geographic polygon; The seventh processing module is used for end-to-end training optimization to output the vector boundaries and reliable surfaces of the georeferenced data.
[0095] As one embodiment of the present invention, the loss function for end-to-end training optimization includes: vertex sequence loss L_vertex, geographic coordinate regression loss L_geo, and area consistency loss L_area.
[0096] As one embodiment of the present invention, the second processing module extracts semantic features that distinguish crops, field ridges and non-cultivated land, as well as detailed features that capture the subtle direction of field ridges, based on farmland images and their GNSS / IMU metadata, using an improved BiSeNet.
[0097] Example 3 The present invention also provides a system for constructing farmland boundaries and calculating the area of farmland, comprising: a memory and a processor, wherein the memory stores a computer program that is executed by the processor, and the computer program executes a method for constructing farmland boundaries and calculating the area of farmland when it is run by the processor.
[0098] Example 4 The present invention also provides a storage medium storing a computer program, which executes a method for constructing farmland boundaries and calculating the operating area when the computer program is running.
[0099] The embodiments described above 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 to the technical solutions of the present invention by those skilled in the art 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. A method for constructing farmland boundaries and calculating the operational area, characterized in that, include: Step S1: Obtain farmland images and their GNSS / IMU metadata; Step S2: Based on farmland images and their GNSS / IMU metadata, extract semantic features that distinguish crops, field ridges, and non-cultivated land, and capture detailed features that capture the subtle direction of field ridges; Step S3: Simulate a surveyor walking along the field ridges and marking points based on semantic and detail features to obtain the vertices of the field ridge polygon; Step S4: Obtain the offset field from each pixel to the geographic coordinates based on GNSS / IMU metadata; Step S5: Obtain the geographic polygon based on the vertices of the field ridge polygon and the offset field; Step S6: Obtain the predicted area based on the geographic polygon; Step S7: Based on end-to-end training and optimization, output the vector boundary and reliable surface of the georeferenced data.
2. The method for constructing farmland boundaries and calculating the operating area as described in claim 1, characterized in that, The loss functions optimized for end-to-end training include: vertex sequence loss L_vertex, geographic coordinate regression loss L_geo, and area consistency loss L_area.
3. The method for constructing farmland boundaries and calculating the operating area as described in claim 2, characterized in that, In step S2, based on the farmland image and its GNSS / IMU metadata, semantic features that distinguish crops, field ridges and non-cultivated land are extracted using an improved BiSeNet, along with detailed features that capture the subtle direction of the field ridges.
4. A device for constructing farmland boundaries and calculating the area of operation, characterized in that, include: The first processing module is used to acquire farmland images and their GNSS / IMU metadata; The second processing module is used to extract semantic features that distinguish crops, field ridges and non-cultivated land, and to capture detailed features that capture the subtle direction of field ridges, based on farmland images and their GNSS / IMU metadata. The third processing module is used to simulate a surveyor walking along the field ridges and marking points based on semantic features and detailed features, thereby obtaining the vertices of the field ridge polygons. The fourth processing module is used to obtain the offset field from each pixel to the geographic coordinates based on GNSS / IMU metadata; The fifth processing module is used to obtain the geographic polygon based on the vertices of the field ridge polygon and the offset field; The sixth processing module is used to obtain the predicted area based on the geographic polygon; The seventh processing module is used for end-to-end training optimization to output the vector boundaries and reliable surfaces of the georeferenced data.
5. The farmland boundary construction and operation area calculation device as described in claim 4, characterized in that, The loss functions optimized for end-to-end training include: vertex sequence loss L_vertex, geographic coordinate regression loss L_geo, and area consistency loss L_area.
6. The farmland boundary construction and operation area calculation device as described in claim 5, characterized in that, The second processing module uses an improved BiSeNet to extract semantic features that distinguish crops, field ridges, and non-cultivated land, as well as detailed features that capture the subtle direction of field ridges, based on farmland images and their GNSS / IMU metadata.
7. A system for constructing farmland boundaries and calculating operational area, characterized in that, include: A memory and a processor, wherein the memory stores a computer program executed by the processor, the computer program executing the farmland boundary construction and operation area calculation method as described in any one of claims 1-3 when run by the processor.
8. A storage medium, characterized in that, The storage medium stores a computer program, which executes the farmland boundary construction and operation area calculation method as described in any one of claims 1-3 when the computer program is running.