A tobacco field contour extraction method based on U-Net and graph neural network
By combining U-Net with graph neural networks, the problem of efficient and accurate extraction of tobacco field contours from large-scale GPS point cloud data was solved. This method achieves high-precision, real-time extraction of tobacco field contours, adapts to dynamic environmental changes, and improves computational efficiency and extraction accuracy.
Patent Information
- Application Number
- CN202511333371.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-18
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2045-09-18
AI Technical Summary
Existing technologies suffer from low computational efficiency, weak noise resistance, blurred boundary recognition, insufficient spatial topology mining, and poor adaptability to dynamic environments when processing large-scale, high-noise GPS point cloud data. These limitations make it difficult to meet the real-time and accuracy requirements of precision agriculture for tobacco field contour extraction.
A method combining U-Net and graph neural networks is adopted. Multi-level features are extracted through the encoder-decoder structure of U-Net, and a GNN-Transformer module is introduced into the bottleneck layer to model global spatial relationships. By combining dynamic graph optimization and multi-scale feature fusion, high-precision and high-efficiency tobacco field contour extraction is achieved.
It significantly improves the accuracy and efficiency of tobacco field contour extraction, can process millions of point cloud data, improves computing efficiency by 144 times, has a contour tracking error within 0.5 meters, supports real-time monitoring and dynamic optimization, and adapts to changes in the farmland environment.
Smart Images

Figure CN120833555B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of agricultural information technology and geospatial data processing technology, and particularly relates to a method for extracting tobacco field contours based on U-Net and graph neural networks. Background Technology
[0002] With the rapid development of precision agriculture, GPS-based farmland data acquisition technology has been widely applied in crop monitoring, yield forecasting, and resource management. In tobacco planting management, accurate extraction of tobacco field contours is a crucial step, as its accuracy directly affects the efficiency and cost of operations such as pesticide spraying and irrigation planning. The intelligent advancement of precision agriculture places higher demands on tobacco field contour extraction technology, requiring not only high-precision extraction results but also the ability to achieve real-time monitoring, dynamic optimization, and multi-source data fusion.
[0003] Traditional methods for extracting tobacco field contours primarily rely on point cloud clustering algorithms (such as DBSCAN and K-means) and geometric methods (such as simple edge detection). In recent years, deep learning-based methods (such as PointNet) and graph neural networks (GNNs) have also been applied to point cloud processing, demonstrating certain advantages. Furthermore, existing GNN models have made some progress in processing static tobacco field contours.
[0004] However, existing technologies have several problems when dealing with large-scale, high-noise GPS point cloud data:
[0005] Low computational efficiency: Traditional point cloud clustering algorithms have extremely high computational complexity when processing millions of data points, making it difficult to achieve real-time response and failing to meet the timeliness requirements of precision agriculture for data processing.
[0006] Weak noise resistance: The farmland environment is complex and GPS signals are easily interfered with. Traditional algorithms are extremely sensitive to noise points, which leads to errors or deviations in the contour extraction results.
[0007] Blurred boundary recognition: The boundary features between tobacco fields and the surrounding environment are complex, and traditional methods are difficult to accurately segment them, resulting in large contour positioning errors, which may affect the accuracy of subsequent operations.
[0008] Insufficient mining of spatial topological relationships: Existing deep learning methods do not fully explore the spatial topological relationships between points, which limits the accuracy of tobacco field contour extraction.
[0009] Poor adaptability to dynamic environments: Existing GNN models are unable to adapt to the dynamic changes in farmland environments and cannot capture the dynamic changes in tobacco field contours in a timely manner, resulting in contour extraction results lagging behind the actual situation.
[0010] To address the aforementioned shortcomings of existing technologies, there is an urgent need to provide a tobacco field contour extraction method based on U-Net and graph neural networks to solve problems such as low computational efficiency, weak noise resistance, ambiguous boundary recognition, insufficient spatial topological relationship mining, and poor adaptability to dynamic environments in traditional methods. Summary of the Invention
[0011] To address the aforementioned technical problems, this invention provides a tobacco field contour extraction method based on U-Net and graph neural networks. It extracts multi-level features through the encoder-decoder structure of U-Net and introduces a GNN-Transformer module at the bottleneck layer to model global spatial relationships. Combined with dynamic graph optimization and multi-scale feature fusion, this method achieves high-precision and high-efficiency tobacco field contour extraction, meeting the needs of precision agriculture for real-time monitoring and dynamic optimization.
[0012] This invention proposes a method for extracting tobacco field contours based on U-Net and graph neural networks, comprising the following steps:
[0013] GPS point cloud data of the target tobacco field area was collected and cleaned to obtain cleaned data;
[0014] The cleaned point cloud data is divided into grids to construct a voxel grid;
[0015] The data in the voxel grid is extracted using a U-Net encoder at multiple scales. Based on the extracted features, a dynamic graph structure is constructed using the k-nearest neighbor algorithm.
[0016] Multi-head graph attention and temporal modules are introduced into the bottleneck layer of U-Net to enhance the features of the dynamic graph structure;
[0017] The enhanced features are used as input to the U-Net decoder, and the output is a high-resolution probability map of the corresponding layer.
[0018] The high-resolution probability map of the corresponding layer is fused with the features of the corresponding layer of the decoder through skip connections, and the fused features are mapped back to the voxel grid and re-input into the U-Net decoder.
[0019] Each voxel output by the U-Net decoder is used as a probability map of the tobacco field boundary. Adaptive threshold segmentation and node classification are performed on the probability map of the tobacco field boundary, and the final tobacco field boundary is obtained based on the node classification results.
[0020] Optionally, the process of dividing the cleaned point cloud data into a grid and constructing a voxel grid includes:
[0021] The cleaned data is divided into several sub-regions according to the geographic coordinate grid, and the sparse sub-regions in the sub-regions are completed by interpolation algorithm; based on the completed sub-regions, a voxel grid is constructed, and each voxel grid includes spatial coordinates, point density and signal strength features.
[0022] The size of the voxel grid is adaptively adjusted based on the density of the point cloud data and the actual extent of the tobacco field area.
[0023] Optionally, the edge weights of the dynamic graph structure are calculated jointly by node feature similarity and spatial distance, using the following formula:
[0024] ,
[0025] in, For the edge weights of the dynamic graph structure, d ij σ is the Euclidean distance between nodes. d and σ s s is an adjustable parameter i and s j Let be the signal strengths at nodes i and j, respectively.
[0026] Optionally, the value of k in the k-nearest neighbor algorithm is dynamically adjusted according to the point cloud distribution and the complexity of the tobacco field boundary, and the value range is [3, 10].
[0027] Optionally, a multi-head graph attention and temporal module are introduced into the bottleneck layer of U-Net to enhance the features of the dynamic graph structure. The process includes:
[0028] The node features in the dynamic graph structure are updated based on multi-head graph attention. The node feature update formula is as follows:
[0029] ,
[0030] in, For nodes In the The updated feature vector of the layer, For nodes In the The feature vector of the layer, Represents a node The set of neighboring nodes, The weight matrix is a learnable matrix. This represents the attention coefficient between nodes.
[0031] Optionally, the process of introducing multi-head graph attention and temporal modules into the bottleneck layer of U-Net to enhance the features of the dynamic graph structure further includes:
[0032] An embedded time-series module is introduced to capture the temporal dependencies of historical point cloud data, as shown in the formula:
[0033] ,
[0034] Among them, T emb H is the location encoding for the timestamp. GNN Output features for the GNN model. This is a time-series dependency.
[0035] Optionally, the U-Net encoder adopts the shrinking path of U-Net, and uses multi-layer convolution operations to extract multi-scale features of point cloud data in each layer of the encoder; the U-Net decoder adopts the expanding path of U-Net, and converts low-resolution feature maps into high-resolution feature maps through deconvolution operations.
[0036] Optionally, each voxel output by the U-Net decoder is used as a probability map of the tobacco field boundary. Adaptive threshold segmentation and node classification are performed on the probability map of the tobacco field boundary. The process of obtaining the final tobacco field boundary based on the node classification results includes:
[0037] A binary mask is generated by segmenting the probability map of the tobacco field boundary based on an adaptive threshold. Morphological operations are performed on the generated binary mask to remove noise points, and then a dilation operation is performed to connect the disconnected boundaries. Then, a polygon fitting algorithm is used to generate the initial tobacco field boundary. The initial tobacco field boundary is optimized based on a sliding window to obtain the final tobacco field boundary.
[0038] Optionally, it also includes dynamically adjusting the data acquisition priority based on information gain before entering the next cycle. The process includes:
[0039] Based on the logical relationship between region division, sub-regions, and information entropy, a formula for information gain is constructed. The information gain of each sub-region is calculated based on the formula for information gain. If the information gain of a sub-region is higher than the set gain threshold and the confidence level of contour extraction is lower than the set confidence level threshold, the sampling density of GPS point cloud data is increased in the next cycle.
[0040] The present invention also provides a large-scale GPS point cloud tobacco field contour extraction system based on graph neural networks, for implementing the method, comprising: a data acquisition module, a grid division module, a feature extraction module, a feature enhancement module, a feature fusion module and a contour extraction module;
[0041] The data acquisition module is used to collect GPS point cloud data of the target tobacco field area and clean it to obtain cleaned data.
[0042] The meshing module is used to divide the cleaned point cloud data into meshes and construct a voxel mesh.
[0043] The feature extraction module is used to perform multi-scale feature extraction on the data in the voxel grid using the U-Net encoder, and to construct a dynamic graph structure based on the extracted features using the k-nearest neighbor algorithm.
[0044] The feature enhancement module is used to introduce a graph neural network and a temporal module into the bottleneck layer of U-Net to enhance the features of the dynamic graph structure.
[0045] The feature fusion module is used to take the enhanced features as input to the U-Net decoder and output a high-resolution probability map of the corresponding layer; it fuses the high-resolution probability map of the corresponding layer with the features of the corresponding layer of the decoder through skip connections, and maps the fused features back to the voxel grid and re-inputs them into the U-Net decoder.
[0046] The contour extraction module is used to take each voxel output by the U-Net decoder as a probability map of the tobacco field boundary, perform adaptive threshold segmentation and node classification on the probability map of the tobacco field boundary, and obtain the final tobacco field boundary based on the node classification results.
[0047] Compared with the prior art, the present invention has the following advantages and technical effects:
[0048] High-precision contour extraction: This invention utilizes the encoder-decoder structure of U-Net to effectively extract multi-scale local features from point cloud data. In the encoder stage, multi-layer convolution and pooling operations progressively mine feature information of tobacco fields at different scales; in the decoder stage, deconvolution and skip connection fusion mechanisms preserve and restore detailed information. Simultaneously, a graph neural network (GNN) and a temporal module are introduced at the bottleneck layer. The GNN can model global spatial relationships and capture the complex topological structure between tobacco field point clouds, while the temporal module can effectively capture the dynamic changes of historical point cloud data. The combination of these two approaches significantly enhances the ability to model complex tobacco field boundaries, accurately distinguishes tobacco fields from their surrounding environment, effectively solves the problem of blurred boundaries in traditional methods, and significantly improves the accuracy of tobacco field contour extraction.
[0049] Highly efficient for processing large-scale data: Based on voxelization representation and dynamic graph optimization techniques, the method of this invention has powerful processing capabilities for millions of point cloud datasets. Voxelization transforms point cloud data into a regular grid structure, facilitating parallel computing and feature extraction; the dynamic graph structure dynamically adjusts according to the real-time distribution and features of the point cloud, reducing redundant computation. Attached Figure Description
[0050] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0051] Figure 1 This is a schematic diagram of the method flow according to an embodiment of the present invention;
[0052] Figure 2 This is a diagram of the U-Net encoder-decoder and GNN-Transformer bottleneck layer architecture according to an embodiment of the present invention.
[0053] Figure 3 A flowchart for dynamic graph construction and feature fusion. Detailed Implementation
[0054] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0055] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0056] Example 1
[0057] like Figure 1 As shown, this embodiment provides a method for extracting tobacco field contours based on U-Net and graph neural networks, including the following steps:
[0058] GPS point cloud data of the target tobacco field area was collected and cleaned to obtain cleaned data;
[0059] The cleaned point cloud data is divided into grids to construct a voxel grid;
[0060] The data in the voxel grid is extracted using a U-Net encoder at multiple scales. Based on the extracted features, a dynamic graph structure is constructed using the k-nearest neighbor algorithm.
[0061] Multi-head graph attention and temporal modules are introduced into the bottleneck layer of U-Net to enhance the features of the dynamic graph structure;
[0062] The enhanced features are used as input to the U-Net decoder, and the output is a high-resolution probability map of the corresponding layer.
[0063] The high-resolution probability map of the corresponding layer is fused with the features of the corresponding layer of the decoder through skip connections, and the fused features are mapped back to the voxel grid and re-input into the U-Net decoder.
[0064] Each voxel output by the U-Net decoder is used as a probability map of the tobacco field boundary. Adaptive threshold segmentation and node classification are performed on the probability map of the tobacco field boundary, and the final tobacco field boundary is obtained based on the node classification results.
[0065] As a specific implementation method, the following steps are included:
[0066] Step 1: Data Collection and Cleaning
[0067] Data Acquisition: High-precision GPS equipment is used to conduct comprehensive data acquisition of the target tobacco field area, obtaining large-scale GPS point cloud data containing information about the tobacco field and its surrounding environment, while recording the acquisition timestamp for each point. Basic elements in the data are identified, such as point clouds representing the tobacco field boundaries, potential obstacles (e.g., utility poles, trees), and feature points within the tobacco field. Simultaneously, constraints on these basic elements are determined, such as the density range of the point cloud and size limitations of obstacles.
[0068] During the data collection process, ensure that the GPS equipment is calibrated to its optimal state to obtain accurate geographic location information. Simultaneously, plan a reasonable data collection route to ensure data coverage of the tobacco field and surrounding key areas, avoiding any blind spots in data collection.
[0069] Data cleaning: The collected GPS point cloud data is cleaned to remove abnormal and noisy points caused by signal interference, equipment failure, etc. For example, by setting reasonable distance and signal strength thresholds, points that are too far from surrounding points or have abnormal signal strength can be eliminated, thereby improving data quality.
[0070] In some specific implementations, GPS point cloud data can also be normalized during the data preprocessing stage. Normalizing the coordinate values of the point cloud data to the [0,1] interval ensures that coordinate values in different ranges have the same scale during model training, which helps the model converge faster.
[0071] Step 2: Data voxelization processing:
[0072] The cleaned data is divided into several sub-regions according to geographic coordinates, and a voxel grid is constructed. Each voxel contains spatial coordinates, point density, and signal intensity features. For sparse regions, interpolation algorithms are used to complete them, such as inverse distance weighted interpolation, to fill the sparse regions based on information from surrounding known points, forming a dense 3D voxel input, providing a unified data structure for subsequent model processing.
[0073] Furthermore, when dividing the GPS point cloud data into grids, the size of the grid is adaptively adjusted according to the density of the point cloud data and the actual range of the tobacco field area to balance the computational load and feature extraction accuracy.
[0074] As a specific implementation method, steps one and two are used to set data acquisition rules and parameters, obtaining the behavioral rules of the data acquisition device, such as acquisition frequency and acquisition range. The acquisition device is initialized, setting its initial position and acquisition parameters. The tobacco field area is divided into several grid areas, each grid area serving as a data acquisition unit to improve data processing efficiency. The probability and frequency of point cloud data generation within each grid area are set to simulate the dynamic changes in actual tobacco field data. The entire data acquisition and processing process is divided into several equivalent time slots to facilitate subsequent time series analysis and model training.
[0075] Step 3: U-Net Encoder and Dynamic Graph Construction: A dynamic graph structure is constructed based on the k-nearest neighbor algorithm. Node features include spatial coordinates, timestamps, and signal strength. Edge weights are calculated jointly by Euclidean distance and signal strength difference, such as... Figure 2 , Figure 3 As shown, specifically:
[0076] U-Net encoder design: Employing the contraction path of U-Net, multiple convolutional operations are used in each layer of the encoder to extract multi-scale features from the point cloud. For example, in the first convolutional layer, a 3×3 kernel with a stride of 1 and padding of 1 is used to perform convolution operations on the input voxel data, enhancing the non-linear representation of features through the ReLU activation function. Pooling operations, such as 2×2 max pooling, are then performed to reduce the resolution of the feature map, decrease computational cost, and further highlight the main features.
[0077] Dynamic Graph Construction: After outputting feature maps at each stage of the encoder, a dynamic graph structure is constructed based on the k-nearest neighbor (k-NN) algorithm. Each spatial location in the feature map is used as a node, and the node features contain semantic information about that location, such as geometric shape and signal strength. The edge weights are calculated jointly by the node feature similarity and spatial distance, using the following formula:
[0078] ,
[0079] Where, d ij σ is the Euclidean distance between nodes. d and σ s s is an adjustable parameter i and s j σ represents the signal strengths at nodes i and j, respectively. In this embodiment, σ d The initial value is set to 5, σ s The initial value is set to 3. The value of k in the k-nearest neighbor algorithm is dynamically adjusted according to the point cloud distribution and the complexity of the tobacco field boundary, and the value range is [3, 10].
[0080] Step 4, GNN-Transformer Bottleneck Layer: Introduce Multi-head Graph Attention (GAT) and a temporal module (Transformer) based on a Graph Neural Network (GNN) framework. This relies on neighbor weights (β). ij Update node features to enhance complex boundary modeling capabilities; Transformer encodes historical point cloud data to capture dynamic changes. Specifically:
[0081] Introducing Multi-head Graph Attention (GAT), the node feature update formula is:
[0082] ,
[0083] in, For nodes In the The updated feature vector of the layer, For nodes In the The feature vector of the layer, Represents a node The set of neighboring nodes, The weight matrix is a learnable matrix. This represents the attention coefficient between nodes.
[0084] Wherein, attention coefficient β ij It is calculated by combining node feature similarity and spatiotemporal distance.
[0085] Furthermore, multi-head graph attention (GAT) has 4-8 heads, with different heads focusing on different spatial features and relationships to enhance feature representation capabilities.
[0086] A time-series module (Transformer) is embedded in the bottleneck layer to capture the temporal dependencies of historical point cloud data. The timestamp location encoding formula is as follows:
[0087] ,
[0088] ,
[0089] Where pos is the timestamp position, i is the encoding dimension index, and d model In this embodiment, d represents the hidden layer dimension of the Transformer model. model Set it to 256.
[0090] The formula for capturing the temporal dependencies of historical point cloud data is:
[0091] ,
[0092] Among them, Temb H is the location encoding for the timestamp. GNN These are the output features of the GNN.
[0093] Furthermore, in the GNN model, the graph attention weights are calculated as follows:
[0094] ,
[0095] Where, N (i) Let W represent the set of neighboring nodes of node i, W be the learnable weight matrix, a be the parameter vector of the attention mechanism, and h be the number of nodes in the set. i h j h k These are the node feature vectors.
[0096] Step 5: U-Net Decoder and Feature Fusion: The high-resolution features of the encoder are fused with the features of the decoder, and the output node features are mapped back to the voxel grid to gradually restore the high-resolution feature map and fuse global information.
[0097] Furthermore, when fusing the high-resolution features of the encoder with the features of the decoder, a weighted fusion method is adopted, with the weights dynamically allocated according to the resolution of the feature map and the importance of semantic information.
[0098] U-Net decoder design: Employing an extended path of U-Net, spatial resolution is gradually restored through deconvolution operations. During deconvolution, appropriate kernel size and stride are used, such as a 4×4 kernel with a stride of 2 and padding of 1, to convert low-resolution feature maps into high-resolution feature maps. In each decoding stage, the high-resolution feature map of the corresponding layer of the encoder is fused with the decoder feature map through skip connections, preserving detailed information and enabling the model to better recover the boundary details of the tobacco field.
[0099] Image-to-mesh feature mapping: The node features output from the bottleneck layer of the GNN are reprojected onto a voxel grid and used as input to the decoder, ensuring that global relational information is passed to the decoder. In this way, global information and local details are fused, improving the accuracy of tobacco field contour extraction.
[0100] Step Six: Contour Generation and Dynamic Optimization: The decoder outputs a probability map of each voxel belonging to the tobacco field boundary. A binary mask is generated through adaptive threshold segmentation, and node classification is performed. An initial contour is generated based on the node classification results, and then optimized using a sliding window to obtain the final tobacco field boundary. Specifically:
[0101] Node classification: The decoder outputs a probability map of each voxel belonging to the tobacco field boundary, and a binary mask is generated through adaptive threshold segmentation. In this embodiment, the Otsu algorithm is used to calculate the optimal threshold based on the grayscale difference between the tobacco field boundary and the background. If there is significant noise in the data, Gaussian filtering preprocessing is performed first, with the standard deviation of the Gaussian kernel set to 1.5 to remove the influence of noise on the threshold calculation, thereby accurately classifying the nodes.
[0102] Contour fitting: Morphological operations are performed on the generated binary mask, such as erosion to remove noise points, dilation to connect broken boundaries, and then a polygon fitting algorithm to generate the initial tobacco field boundary. In the morphological operations, both erosion and dilation operations use 3×3 structuring elements.
[0103] Temporal optimization: By combining historical data, a sliding window mechanism is used to correct boundary jitter. The sliding window size is set to 5 time steps. Within each time step, based on the historical boundary information within the window, the temporal dependencies are modeled using a GNN to adjust the current boundary.
[0104] In the optimization stage of tobacco field contour extraction, in addition to morphological operations and edge detection algorithms, contour-based post-processing methods can also be used. For example, the perimeter and area of the extracted tobacco field contours can be calculated. Based on the actual geometric feature range of the tobacco field, contours with perimeters or areas that clearly do not conform to the characteristics of tobacco fields can be removed, further improving the accuracy of tobacco field contour extraction. At the same time, the extracted tobacco field contours can be compared and verified with existing tobacco field geographic information data. If there are significant differences, corrections can be made through manual intervention or model retraining.
[0105] Step 7, Adaptive Learning and Resource Allocation: Based on information gain, dynamically adjust the data acquisition priority and enter the next cycle.
[0106] Calculating Information Gain: Data acquisition priority is dynamically adjusted based on information gain. The calculation of information gain considers the uncertainty of point cloud data, its correlation with already acquired data, and its importance for tobacco field contour extraction. The formula for calculating information gain is:
[0107] ,
[0108] Where H is the information entropy, A is the spatial region of the point cloud data distribution, and X is the set of point cloud data to be processed within the entire tobacco field area. v This represents the data set for a sub-region. In this embodiment, the priority of data acquisition is determined by calculating the information gain of each sub-region.
[0109] Adjust the data acquisition strategy: Increase the sampling density for low-confidence areas and prioritize the allocation of computing resources for high-information-gain areas. For example, if the information gain of a certain sub-region is higher than a set threshold and the confidence of the contour extraction is low, then increase the number of GPS data acquisitions for that region in the next cycle from once per cycle to three times to improve data accuracy and model performance, and then proceed to the next cycle.
[0110] This embodiment, based on voxelization representation and dynamic graph optimization techniques, possesses powerful processing capabilities for millions of point cloud datasets. Voxelization transforms point cloud data into a regular grid structure, facilitating parallel computing and feature extraction; the dynamic graph structure dynamically adjusts according to the real-time distribution and features of the point cloud, reducing redundant computation. Experiments show that when processing millions of point cloud datasets, the average processing time of the method in this embodiment is 8.3 seconds (configuration: Intel i7-9700K processor, 32GB memory), which is 144 times more efficient than the traditional DBSCAN algorithm's 20 minutes. This meets the stringent requirements for data processing speed in real-time agricultural monitoring and provides strong support for real-time decision-making in precision agriculture.
[0111] This embodiment, through a temporal module (Transformer), can capture the dynamic changes of tobacco field boundaries, maintaining the contour tracking error within 0.5 meters throughout the crop growth cycle. An information gain-guided adaptive sampling strategy reduces data acquisition by 40% while maintaining contour extraction accuracy. Simultaneously, a sliding window mechanism, combined with historical data, effectively corrects for boundary jitter in the tobacco field, and by utilizing a GNN to model temporal dependencies, boundary stability is ensured in the dynamically changing tobacco field environment.
[0112] This embodiment keeps the number of model parameters below 15M, effectively reducing model complexity and making it easily adaptable for edge device deployment. This lightweight design not only reduces hardware costs but also improves system response speed. Furthermore, the model supports multi-source data fusion, integrating other relevant information such as remote sensing imagery and soil moisture data to further enhance the accuracy of contour extraction. Simultaneously, this method and system can be extended to tobacco field scenarios with various terrains and planting patterns, such as terraced fields and plains, demonstrating broad applicability and promising prospects for widespread adoption.
[0113] As an additional implementation method, a tobacco field contour extraction model is constructed for steps one and seven, and the tobacco field contour extraction model further includes:
[0114] Environmental interaction module: For data acquisition and cleaning in step one, the module can interact with the tobacco field environment based on the output of the strategy optimization module, thereby controlling the GPS device to dynamically acquire data (such as additional acquisition in low confidence areas), and storing the acquired data and parameters for model iteration.
[0115] The intrinsic reward module consists of a target network and a prediction network. The target network generates long-term target rewards, while the prediction network predicts the immediate reward for the current action.
[0116] The strategy optimization module includes an action sampling network and a value evaluation network. Both the action sampling network and the value evaluation network consist of a single linear layer, with the hidden layer size determined by the number of data acquisition devices. U-Net is used to extract local features from the point cloud data, while the graph neural network is used to capture the spatial topological relationships and global features between point clouds. Both the target network and the prediction network consist of pooling layers, convolutional layers, and linear layers, with ReLU activation functions used between the convolutional layers.
[0117] Model update module: For the information gain-guided dynamic sampling strategy in step seven, the model update module automatically adjusts the data collection priority rules by iteratively optimizing the internal reward module and the strategy optimization module to adapt to different tobacco field scenarios and data changes.
[0118] Furthermore, model training and deployment include:
[0119] Constructing the total loss function: The total loss function includes value loss, action loss, entropy loss, and intrinsic reward loss. These losses are derived from the action sampling network, value evaluation network, target network, and prediction network. The tobacco field contour extraction model can be trained based on the total loss function.
[0120] Training and Deploying the Model: Gradients are obtained based on stored experience, and the model is updated according to these gradients until the preset number of training iterations is reached. The resulting model is then deployed to actual tobacco field data acquisition and contour extraction applications.
[0121] It is feasible to transform the tobacco field contour extraction problem into a computable optimization task by constructing a state-action space in a deep learning framework, thereby enabling automated decision-making for the data acquisition strategy in step one and adaptive learning and resource allocation in step seven.
[0122] Defining the state space and action space includes:
[0123] State space: includes two channels. One channel contains the positions of all obstacles and feature points at the tobacco field boundary, as well as the point cloud density information of each feature point at time t. The other channel contains the position coordinates of the data acquisition device at time t and the point cloud data acquisition progress of each grid area.
[0124] Motion space: The motion space of each data acquisition device includes the horizontal coordinate increment, the vertical coordinate increment for movement, the data acquisition time, and the data upload time.
[0125] This embodiment also provides a large-scale GPS point cloud tobacco field contour extraction system based on graph neural networks, used to implement the method described above. The effects achieved correspond to the method, and specifically include: a data acquisition module, a grid division module, a feature extraction module, a feature enhancement module, a feature fusion module, and a contour extraction module.
[0126] The data acquisition module is used to collect GPS point cloud data of the target tobacco field area and clean it to obtain cleaned data.
[0127] The meshing module is used to divide the cleaned point cloud data into meshes and construct a voxel mesh.
[0128] The feature extraction module is used to perform multi-scale feature extraction on the data in the voxel grid using the U-Net encoder, and to construct a dynamic graph structure based on the extracted features using the k-nearest neighbor algorithm.
[0129] The feature enhancement module is used to introduce a graph neural network and a temporal module into the bottleneck layer of U-Net to enhance the features of the dynamic graph structure.
[0130] The feature fusion module is used to take the enhanced features as input to the U-Net decoder and output a high-resolution probability map of the corresponding layer; it fuses the high-resolution probability map of the corresponding layer with the features of the corresponding layer of the decoder through skip connections, and maps the fused features back to the voxel grid and re-inputs them into the U-Net decoder.
[0131] The contour extraction module is used to take each voxel output by the U-Net decoder as a probability map of the tobacco field boundary, perform adaptive threshold segmentation and node classification on the probability map of the tobacco field boundary, and obtain the final tobacco field boundary based on the node classification results.
[0132] Example 2:
[0133] Taking a tobacco-growing area as an example, this embodiment collects 1 million GPS point cloud data points. The specific implementation steps are as follows:
[0134] 1) Data preprocessing:
[0135] The point cloud data was divided into 1000 sub-regions, each with a grid size of 10m × 10m. After data cleaning and voxelization, a 3D voxel input was constructed. The data preprocessing process took approximately 30 minutes and mainly included denoising operations during data cleaning and interpolation calculations during voxelization.
[0136] 2) Dynamic graph construction:
[0137] With k=5, a dynamic graph structure is constructed, and the edge weights are calculated jointly by Euclidean distance and signal strength difference. The edge weights are calculated according to the edge weight formula. The dynamic graph construction takes approximately 15 minutes and is mainly used to calculate the distance between nodes, signal strength difference, and edge weights.
[0138] 3) Feature enhancement and fusion:
[0139] Using a 4-head graph attention mechanism, the hidden layer dimension of the temporal module (Transformer) is 256. Feature enhancement and fusion are achieved through multiple iterations to optimize the model parameters.
[0140] 4) Contour generation:
[0141] After the decoder outputs the probability map, the Otsu algorithm is used to generate a binary mask, and the boundary is optimized using a sliding window. The sliding window size is 5 time steps, and the contour generation and optimization process takes approximately 5 minutes when processing data for this region. Through manual verification and evaluation against the actual tobacco field boundary, the final tobacco field contour extraction accuracy rate is 92%.
[0142] 5) Dynamic adjustment:
[0143] Based on confidence feedback, the sampling density was increased by 20% in low-confidence areas. After dynamic adjustment, the accuracy of tobacco field contour extraction improved to 95%. In subsequent monitoring cycles, by dynamically adjusting the data acquisition strategy, the efficiency of data utilization and the accuracy of contour extraction were effectively improved.
[0144] Example 3
[0145] This embodiment also discloses a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method described in Embodiment 1.
[0146] Example 4
[0147] This embodiment also discloses a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the method described in Embodiment 1.
[0148] Example 5
[0149] This embodiment also discloses a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in Embodiment 1.
[0150] The above are merely preferred embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A tobacco field contour extraction method based on U-Net and graph neural network, characterized in that, The method comprises the following steps: Collecting GPS point cloud data of a target tobacco field area and performing cleaning to obtain cleaned data; Grid division is performed on the cleaned point cloud data to construct a voxel grid; Multi-scale feature extraction is performed on the data in the voxel grid by using a U-Net encoder, and a dynamic graph structure is constructed based on the extracted features by using a k-nearest neighbor algorithm; A multi-head graph attention and timing module is introduced at a bottleneck layer of the U-Net to perform feature enhancement on the dynamic graph structure; The enhanced features are taken as inputs of a U-Net decoder, and a high-resolution probability map of a corresponding layer is outputted; The high-resolution probability map of the corresponding layer and the features of the corresponding layer of the decoder are fused through a skip connection, and the fused features are mapped back to the voxel grid and re-inputted into the U-Net decoder; Each voxel outputted by the U-Net decoder is taken as a probability map of a tobacco field boundary, adaptive threshold segmentation and node classification are performed on the probability map of the tobacco field boundary, and a final tobacco field boundary is obtained according to a node classification result; The process of introducing the multi-head graph attention and timing module at the bottleneck layer of the U-Net to perform feature enhancement on the dynamic graph structure comprises: Node features in the dynamic graph structure are updated based on the multi-head graph attention, and a node feature updating formula is as follows: , in, For nodes In the The updated feature vector of the layer, For nodes In the The feature vector of the layer, Represents a node The set of neighboring nodes, The weight matrix is a learnable matrix. The attention coefficient between nodes; The process of introducing the multi-head graph attention and timing module at the bottleneck layer of the U-Net to perform feature enhancement on the dynamic graph structure further comprises: An embedding timing module is introduced to capture a timing dependency relationship of historical point cloud data, and a formula is as follows: , wherein Tembis the position encoding of the timestamp, HGNNis the GNN model output feature, is the time-dependent relationship.
2. The method of claim 1, wherein The process of performing grid division on the cleaned point cloud data to construct a voxel grid comprises: The cleaned data is divided into a plurality of sub-regions according to a geographical coordinate grid, and an interpolation algorithm is used to complete the sub-regions in the sparse sub-regions; based on the completed sub-regions, a voxel grid is constructed, and each voxel grid comprises spatial coordinates, point density and signal strength features; wherein the size of the voxel grid is adaptively adjusted according to the density of the point cloud data and the actual range of the tobacco field area.
3. The method of claim 1, wherein The edge weight of the dynamic graph structure is calculated jointly based on the node feature similarity and the spatial distance, and a formula is as follows: , where, is the edge weight of the dynamic graph structure, d ij is the Euclidean distance between nodes, σ d and σ s are tunable parameters, s i and s j are the signal strengths of nodes i and j, respectively.
4. The method of claim 1, wherein The value of k in the k-nearest neighbor algorithm is dynamically adjusted according to the point cloud distribution and the complexity of the tobacco field boundary, and the value range is [3, 10].
5. The method of claim 1, wherein The U-Net encoder uses a contraction path of the U-Net, and at each layer of the encoder, a multi-layer convolution operation is used to extract multi-scale features of the point cloud data; The U-Net decoder uses an expansion path of the U-Net, and a deconvolution operation is used to convert a low-resolution feature map into a high-resolution feature map.
6. The method of claim 1, wherein The process of taking each voxel outputted by the U-Net decoder as a probability map of a tobacco field boundary, performing adaptive threshold segmentation and node classification on the probability map of the tobacco field boundary, and obtaining a final tobacco field boundary according to a node classification result comprises: The probability map of the tobacco field boundary is segmented based on an adaptive threshold to generate a binary mask; morphological operations are performed on the generated binary mask to remove noise points, and then dilation operations are performed to connect disconnected boundaries, and then an initial tobacco field boundary is generated by using a polygon fitting algorithm; and the initial tobacco field boundary is optimized based on a sliding window to obtain a final tobacco field boundary.
7. The method of claim 1, wherein, Further comprising dynamically adjusting the data acquisition priority based on information gain, and entering the next cycle, the process comprising: Based on the logical relationship between the region division, the sub-region and the information entropy, an information gain formula is constructed; based on the information gain formula, the information gain of each sub-region is calculated, if there is a sub-region whose information gain is higher than the set gain threshold, and the confidence of the contour extraction is lower than the set confidence threshold, then the sampling density of the GPS point cloud data is increased in the next cycle.
8. A large-scale GPS point cloud tobacco field contour extraction system based on a graph neural network, characterized by, For implementing the method of any one of claims 1-7, comprising: a data acquisition module, a grid division module, a feature extraction module, a feature enhancement module, a feature fusion module and a contour extraction module; The data acquisition module is used for acquiring GPS point cloud data of a target tobacco field area and performing cleaning to obtain cleaned data; The grid division module is used for performing grid division on the cleaned point cloud data to construct a voxel grid; The feature extraction module is used for performing multi-scale feature extraction on the data in the voxel grid by using a U-Net encoder, and based on the extracted features, a dynamic graph structure is constructed by using a k-nearest neighbor algorithm; The feature enhancement module is used for introducing a graph neural network and a timing module at a bottleneck layer of the U-Net to perform feature enhancement on the dynamic graph structure; The feature fusion module is used for taking the enhanced features as the input of a U-Net decoder, outputting a high-resolution probability map of a corresponding layer; fusing the high-resolution probability map of the corresponding layer and the features of the corresponding layer of the decoder by using a skip connection, and mapping the fused features back to the voxel grid to be re-input into the U-Net decoder; The contour extraction module is used for taking each voxel output by the U-Net decoder as a probability map of a tobacco field boundary, performing adaptive threshold segmentation and node classification on the probability map of the tobacco field boundary, and obtaining a final tobacco field boundary according to the node classification result.
Citation Information
Patent Citations
Land degradation condition evaluation method and system
CN120107802A
Surveying and mapping geographic information analysis method and system based on machine vision and medium
CN120259887A