A tobacco field contour extraction method based on a graph neural network

By employing local graph convolution and global graph attention mechanisms based on graph neural networks, this method addresses the issues of high computational complexity and low accuracy in tobacco field contour extraction, achieving efficient and accurate tobacco field contour extraction that is applicable to agricultural remote sensing and planting planning.

CN120852798BActive Publication Date: 2026-03-31GUANGDONG TOBACCO MEIZHOU
2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-22
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing methods for segmenting tobacco fields are unstable under the interference of factors such as illumination, vegetation shading, and irregular field shapes. Furthermore, existing graph neural network models have high computational complexity and long running time when processing high-resolution remote sensing images, making it difficult to effectively extract tobacco field outlines.

Method used

A graph neural network-based approach is adopted, which combines local graph convolutional modules and global graph attention mechanisms with local k-nearest neighbor graphs and fully connected graphs to perform preprocessing, feature extraction, region segmentation, and feature fusion of remote sensing images of tobacco fields, and outputs a tobacco field segmentation mask map.

Benefits of technology

It improves the accuracy and processing efficiency of tobacco field contour extraction, reduces computational complexity, is suitable for pixel-level contour extraction of high-resolution remote sensing images, and has good engineering deployability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120852798B_ABST
    Figure CN120852798B_ABST
Patent Text Reader

Abstract

The application discloses a tobacco field contour extraction method based on a graph neural network, and belongs to the fields of artificial intelligence and image processing, and comprises the following steps: pre-processing a tobacco field remote sensing image; inputting the pre-processed image into an encoder to extract multi-scale features and obtain a high-level feature map; dividing the spatially flattened high-level feature map into a plurality of sub-regions to construct a local k-neighbor graph, and calculating a center feature vector of the sub-regions; constructing a fully connected global graph based on the center feature vector, and performing cross-region feature interaction based on a graph attention mechanism; broadcasting the updated global features to the corresponding sub-regions, combining neighbor feature differences to perform global-local feature fusion; reconstructing the fused features into an image feature map, outputting a tobacco field segmentation mask map from the image feature map through a decoder, and obtaining a pixel-level extraction result of the tobacco field contour based on the tobacco field segmentation mask map. The application effectively enhances the global perception and boundary connectivity modeling capability of the model for the tobacco field contour.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of artificial intelligence and image processing technology, and in particular relates to a method for extracting tobacco field contours based on graph neural networks. Background Technology

[0002] With the rapid development of remote sensing imaging and agricultural informatization, the automatic identification and boundary extraction of crop plots using image segmentation technology has become an important direction for smart agriculture. In tobacco field management, accurate extraction of the tobacco field outline is of great significance for plot location, area calculation, and path planning. However, existing tobacco field segmentation methods still have many technical bottlenecks.

[0003] Traditional image processing methods rely on color, texture, or morphological features for region segmentation, with typical algorithms including region growing, thresholding, and Canny edge detection. In practical applications, these methods are affected by factors such as lighting, vegetation occlusion, and irregular field shapes, leading to unstable segmentation results, especially in areas with blurred or broken field boundaries.

[0004] Convolutional Neural Network (CNN) models such as U-Net and DeepLab have been widely used in image segmentation, but they are limited by their local receptive field and struggle to model long-range dependencies. When processing remote sensing images of 1024×1024 or larger, the model's memory consumption increases significantly, and inference efficiency decreases. Furthermore, due to the limitations of CNNs in boundary modeling, problems such as jagged edges, adhesion, or fragmentation easily occur, leading to decreased segmentation accuracy. Statistics show that CNN-based models take an average of 1.3–2.1 seconds to process a single high-resolution tobacco field image (resolution ≥ 1m), and the segmentation accuracy is generally below 85%.

[0005] In recent years, Graph Neural Networks (GNNs) have been introduced into image segmentation tasks, possessing the ability to model non-Euclidean spatial structures and express topological relationships between graphs, and showing certain advantages in boundary perception. However, existing GNN methods mostly employ a full-graph construction approach, resulting in an excessive number of nodes and high computational complexity. Especially when processing high-resolution remote sensing images (e.g., 2048×2048 and above), they suffer from slow graph construction, redundant graph convolution calculations, and excessively long running times, limiting their practicality.

[0006] Therefore, there is an urgent need to propose a novel method that combines the advantages of convolutional feature extraction with graph structure modeling capabilities. This method can efficiently process large-size tobacco field images, enhance the perception and expression of complex boundary structures, and improve the accuracy and efficiency of contour extraction. Summary of the Invention

[0007] To address the aforementioned technical problems, this invention proposes a method for extracting tobacco field contours based on graph neural networks, thereby resolving the issues present in the prior art.

[0008] To achieve the above objectives, this invention provides a method for extracting tobacco field contours based on graph neural networks, comprising:

[0009] Preprocessing is performed on remote sensing images of tobacco fields to obtain preprocessed images;

[0010] An encoder is constructed by inserting local map convolutional modules between convolutional layers. The preprocessed image is then input into the encoder to extract multi-scale features and obtain a high-level feature map.

[0011] The high-level feature map is spatially flattened, and the flattened high-level feature map is divided into several sub-regions by a clustering algorithm. A local k-nearest neighbor graph is constructed in each sub-region.

[0012] The center feature vector of the sub-region is calculated based on the node features of the local k-nearest neighbor graph; a fully connected global graph is constructed using the center feature vector as nodes, and cross-region feature interaction is performed based on the graph attention mechanism to obtain the updated global features;

[0013] The updated global features are broadcast to the nodes in the corresponding sub-regions, and global-local feature fusion is performed by combining the differences in features from neighbors.

[0014] The fused features are reconstructed into an image feature map, and the image feature map is output as a tobacco field segmentation mask by a decoder.

[0015] The segmentation mask image is binarized to obtain pixel-level extraction results of the tobacco field outline.

[0016] Optionally, the process of preprocessing the remote sensing image of the tobacco field to obtain a preprocessed image includes:

[0017] The RGB three channels of the tobacco field remote sensing image are standardized based on the mean and standard deviation to obtain a standardized image;

[0018] The standardized image is cropped to fit the encoder input size to obtain the cropped image;

[0019] The cropped image is subjected to data augmentation operations to obtain a preprocessed image; wherein the data augmentation operations include random rotation, horizontal flipping, and brightness perturbation.

[0020] Optionally, the process of constructing the encoder by inserting local graph convolutional modules between convolutional layers includes:

[0021] The encoder includes five convolutional layers, each consisting of two consecutive 3×3 convolutional operations, a BatchNorm normalization layer, and a ReLU activation function;

[0022] Spatial downsampling is performed between each convolutional layer using 2×2 max pooling;

[0023] After the output of each convolutional layer, local graph convolutional modules are inserted between two adjacent convolutional layers to construct the encoder.

[0024] Optionally, the process of constructing a local k-nearest neighbor graph in each sub-region includes:

[0025] Calculate the feature similarity between nodes within a sub-region;

[0026] Based on the aforementioned feature similarity, select the k nearest neighbor nodes for each node;

[0027] For each node, establish edges connecting it to its k nearest neighbors to form a local k-nearest neighbor graph.

[0028] Optionally, the expression for calculating the central feature vector of the sub-region is:

[0029]

[0030] In the formula, This represents the central feature vector of the i-th sub-region. Let V represent the set of graph nodes contained in the i-th sub-region, and let V represent the set of all nodes in the entire graph. This represents the input feature vector corresponding to node v.

[0031] Optionally, the calculation expression for obtaining the updated global features is:

[0032]

[0033] In the formula, This represents the global feature of the updated i-th sub-region. This is a single-head attention weight, where k represents the number of neighboring sub-regions, and j represents the neighboring sub-regions of the current sub-region i. This represents the central feature vector of the neighboring sub-region j. Perform a linear transformation.

[0034] Optionally, the calculation expression for the single-head attention weight is:

[0035]

[0036] In the formula, R and L represent the left and right directions of the linear mapping, respectively. The left linear mapping direction can be learned by the linear transformation matrix. The direction of the right linear mapping can be learned by the linear transformation matrix. For the attention weight vector, the LeakyReLU activation function has a negative slope. This represents the central feature vector of subregion j. This represents the global feature representation of the m-th sub-region.

[0037] Optionally, the updated global features are broadcast to nodes in the corresponding sub-regions, and the process of global-local feature fusion based on the differences in neighbor features includes:

[0038] The updated global features are broadcast to the nodes in the corresponding sub-regions, and each node in the current sub-region receives a global feature vector.

[0039] For each node, calculate the difference between the node's own features and the features of its corresponding neighboring nodes to obtain the neighbor difference features;

[0040] For each node, the node's own features, neighbor difference features, and global feature vector are concatenated to form a fused feature vector.

[0041] Optionally, the expression for obtaining the node feature vector after global-local feature fusion is:

[0042]

[0043] In the formula, For the node v in the t-th layer of a graph neural network, The global features of the updated i-th sub-region are represented by AGG, which stands for Average Pooling, and MLP stands for Multilayer Perceptron. This represents the update result of node v in the (t+1)th layer of the graph neural network. Let be the feature of the neighbor node u corresponding to the node at layer t.

[0044] Optionally, the process of reconstructing the fused features into an image feature map, wherein the image feature map is output as a tobacco field segmentation mask by a decoder, includes:

[0045] The fused node feature vectors are reconstructed into a feature map with the same spatial size as the input image.

[0046] The decoder upsamples the reconstructed feature map layer by layer. After each layer of upsampling, the feature map output by the decoder is concatenated with the feature map of the corresponding layer in the encoder.

[0047] Perform a convolution operation on the concatenated feature map to obtain the updated feature map;

[0048] Based on the updated feature map, after multi-layer upsampling and feature fusion by the decoder, a segmentation mask map with 1 channel is output.

[0049] Compared with the prior art, the present invention has the following advantages and technical effects:

[0050] This invention introduces a region partitioning and global interaction mechanism based on graph neural networks, effectively enhancing the model's global perception of tobacco field contours and boundary connectivity modeling capabilities. It integrates GATv2 and G-GCN structures to model long-distance dependencies with low computational overhead, improving structure recognition capabilities in remote sensing images. By structurally combining local and global graphs, it reduces the complexity of graph construction and inference processes, making it suitable for high-resolution image processing. The overall structure of this invention can be trained end-to-end, possessing good engineering deployability and applicable to practical scenarios such as agricultural remote sensing, tobacco field surveys, and planting planning. Attached Figure Description

[0051] 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:

[0052] Figure 1 This is a flowchart of the tobacco field contour extraction method based on graph neural networks according to an embodiment of the present invention. Detailed Implementation

[0053] 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.

[0054] 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.

[0055] This invention is implemented based on the PyTorch 2.2.2 and PyTorch Geometric 2.5.2 deep learning frameworks. Both the training and testing environments utilize NVIDIA A100 GPUs with 80GB of dedicated GPU memory, 256GB of system RAM, and Ubuntu 20.04 LTS as the operating system. The AdamW optimizer is used during training, with an initial learning rate set to 2×10⁻⁶. -3 The batch size is set to 1024, and the performance is evaluated on a single GPU during the inference phase to ensure that the model can be stably deployed in both high-performance computing environments and general-purpose server environments.

[0056] like Figure 1As shown, to address the problems of complex tobacco field boundaries in remote sensing images, limited receptive fields in existing semantic segmentation models, and low computational efficiency of graph structures, this invention provides a tobacco field contour extraction method based on graph neural networks. This method integrates an encoder-decoder structure with an efficient graph construction mechanism, balancing global modeling capabilities and inference efficiency, and is suitable for pixel-level contour extraction tasks in high-resolution tobacco field remote sensing images. Specifically, it includes the following steps.

[0057] S1. Obtain images of tobacco fields, and perform normalization, cropping, and enhancement processing on the images to construct a standard-sized input tensor to adapt to the input requirements of subsequent neural network structures.

[0058] The process of preprocessing remote sensing images of tobacco fields to obtain preprocessed images includes: standardizing the RGB three channels of the tobacco field remote sensing images based on the mean and standard deviation to obtain standardized images; cropping the standardized images to fit the encoder input size to obtain cropped images; and performing data augmentation operations on the cropped images to obtain preprocessed images. Among these, the data augmentation operations include: random rotation, horizontal flipping, and brightness perturbation.

[0059] Furthermore, during the preprocessing stage, the input images are standardized with a mean of 0.5 and a standard deviation of 0.5 for each RGB channel to eliminate brightness differences under different shooting conditions. At the same time, data augmentation operations are applied, including random rotation ±15 degrees, random horizontal flip (probability 0.5), and brightness perturbation (±10%), to improve the model's generalization performance.

[0060] S2. Input the input image into the encoder, and use multi-layer convolution and pooling operations to extract multi-scale semantic features to obtain high-level feature maps. Further, insert local graph convolution modules between convolutional layers, use the feature similarity between nodes to construct local graph structures and perform graph convolution operations to enhance the spatial consistency modeling ability of features on boundary regions.

[0061] Furthermore, the encoder structure introduces a graph neural enhancement module on top of the standard convolutional network. This module comprises five convolutional layers, each consisting of two consecutive 3×3 convolutional operations, a BatchNorm normalization layer, and a ReLU activation function. The number of channels is set to 64, 128, 256, 512, and 1024 respectively. Spatial downsampling is performed between layers using 2×2 max pooling, halving the feature map resolution layer by layer.

[0062] Unlike traditional convolutional encoders, this module adds a local graph convolutional enhancement module after each convolutional layer output. This module first divides the feature map of the current layer into several local regions of a fixed size (e.g., 8×8 or 16×16). The center pixel of each region is used as a node in the graph structure, and edge weights are constructed between nodes in adjacent regions based on feature similarity (e.g., cosine distance). The graph structure is updated using a sliding window approach, and the adjacency matrix of the graph is dynamically calculated based on features during each forward propagation.

[0063] The graph neural enhancement module uses the EdgeConv operation to achieve feature propagation between nodes, aggregating semantic information from neighboring nodes to enhance semantic consistency in the local space. The node features output by the graph convolution are upsampled (e.g., by bilinear interpolation) and mapped back to the feature map dimension. Then, they are concatenated with the original convolution output in the channel dimension and used as input to the next convolutional structure.

[0064] This graph enhancement structure can introduce the ability to model the structural relationships of images without significantly increasing computational overhead, thereby improving the model's feature expression ability under complex conditions such as blurred boundaries and poor target connectivity in tobacco field images, and providing a more stable semantic foundation for subsequent graph construction and semantic segmentation.

[0065] S3. After spatially flattening the high-level feature map, the K-means clustering algorithm is used to divide it into several sub-regions, forming a region division representation of the image features.

[0066] Furthermore, the K-means clustering operation flattens and clusters the high-level feature map based on the channel dimension as the feature vector. Let the size of the input feature map be... The clustering input matrix has a dimension of The output is K-means clustering is used to divide the flattened feature matrix into regions. The initial centroids are determined using the K-means++ strategy to accelerate convergence. Each cluster represents a sub-region, and the number of sub-regions M ranges from 4 to 6, dynamically set according to the image size and tobacco field complexity. The number of nodes in each sub-region is controlled between 256 and 1024 to ensure the reliability and connectivity of local feature statistics.

[0067] By segmenting the input image into multiple partitions and constructing k-NN graphs in parallel within each partition, the computational complexity is reduced from the traditional O(N²) to O(N² / M²) (where M is the number of partitions), significantly reducing the overhead of dynamic graph construction.

[0068] S4. Within each sub-region, construct a local k-nearest neighbor graph based on feature similarity to form the corresponding local graph structure.

[0069] Furthermore, the local graph construction process includes: during the local k-nearest neighbor graph construction process, each node calculates its set of neighboring nodes based on cosine similarity, selects the nearest k=8~16 neighboring nodes to establish edge connections, and sets the edge weights. Defined as:

[0070]

[0071] The local adjacency matrix adopts a dynamic graph mechanism, recalculating neighbor relationships during each forward propagation round. Neighbor updates are triggered based on the magnitude of node feature changes (local mean change greater than 0.1) to ensure the adaptability of the connection structure to the current feature distribution, especially in the area near the tobacco field boundary.

[0072] Based on the above similarity, a sparse k-NN graph is constructed, and each node is connected to its... The most similar neighbor, The value range is 8~16; the adjacency structure of all local graphs is encoded into a sparse matrix form for subsequent graph neural network operations.

[0073] S5. Calculate the central feature vector of each sub-region, construct a fully connected global graph, and use the graph attention mechanism (GATv2) to perform cross-region feature interaction to obtain the global updated features of each sub-region.

[0074] Furthermore, the global feature interaction employs a graph attention mechanism (GATv2) to aggregate global features from each partition (such as partition center vectors). This global graph interaction enhances the model's context awareness and compensates for the limitations of local graph structures. Specifically, this includes: connecting each node to its k=8~16 most similar neighbors to form a k-NN sparse graph structure for subsequent graph neural network computation. The center feature vectors within each sub-region are calculated, obtained through pooling. The features of all nodes within the vector are averaged and pooled to obtain the central feature vector, defined as:

[0075]

[0076] In the formula, This represents the central feature vector of the i-th sub-region. Let V represent the set of graph nodes contained in the i-th sub-region, and let V represent the set of all nodes in the entire graph. This represents the input feature vector corresponding to node v.

[0077] All partition center vectors { , ,..., As nodes in the graph, a fully connected graph is constructed based on the center nodes of all sub-regions. Edges are established between each pair of partitions to model the semantic interactions between regions. The number of nodes is [number missing]. The number of sides is constitute.

[0078] For any two center vectors and Using learnable linear transformations and After mapping to a low-dimensional space and concatenating the data, the attention score is calculated using the LeakyReLU activation function.

[0079]

[0080] The update formula for the features of the center node of each sub-region is:

[0081]

[0082] In the formula, This represents the global feature of the updated i-th sub-region. This is a single-head attention weight, where k represents the number of neighboring sub-regions, and j represents the neighboring sub-regions of the current sub-region i. This represents the central feature vector of the neighboring sub-region j. Perform a linear transformation.

[0083] The graph attention mechanism GATv2 is used to fuse information between nodes, and its single-head attention weights are... Defined as:

[0084]

[0085] Where R and L represent the left and right directions of the linear mapping, respectively. The left linear mapping direction can be learned by the linear transformation matrix. The direction of the right linear mapping can be learned by the linear transformation matrix. Let be the attention weight vector, and let the LeakyReLU activation function have a negative slope, set to 0.2. This represents the central feature vector of subregion j. This represents the global feature representation of the m-th sub-region.

[0086] S6. Broadcast the updated global features to the corresponding subgraph nodes, and use a global graph convolutional network (G-GCN) to perform global-local feature fusion and update in combination with neighbor features.

[0087] The process of broadcasting the updated global features to the nodes of the corresponding sub-region and performing global-local feature fusion by combining the differences in neighbor features includes: broadcasting the updated global features to the nodes of the corresponding sub-region, and each node in the current sub-region obtaining a global feature vector; for each node, calculating the difference between the node's own features and the features of the node's corresponding neighbor nodes to obtain the neighbor difference features; for each node, concatenating the node's own features, neighbor difference features, and global feature vector to form the fused feature vector.

[0088] Furthermore, Global Aware Graph Convolutional Networks (G-GCNs) are used to achieve global-local feature fusion and updates. Their main structure includes:

[0089] (1) Global feature broadcasting: Broadcasting the global representation of each sub-region Copy and assign to all nodes within the sub-region, so that each node can access the global context semantics of this region.

[0090] (2) Neighbor Difference Aggregation Module: For each node v, the feature difference between its neighboring nodes and itself is calculated to obtain the neighbor difference feature, and average pooling is performed to capture local structural changes, as shown below:

[0091]

[0092] (3) Feature fusion module: The feature fusion module integrates the features of node v in the graph neural network at layer t. Neighbor difference features, global features of the region to which this node belongs The data is then concatenated and fed into a multilayer perceptron (MLP) for feature transformation.

[0093]

[0094] MLP is a feedforward network consisting of two layers of linear mapping and a nonlinear activation function. The output dimension is the same as the input, used to control the stability of the updated node representation. AGG represents average pooling. This is the global region feature vector. This is the update result of node v in the (t+1)th layer of the graph neural network.

[0095] (4) Update output: After all nodes have completed the above update, the node features of the overall graph are expressed by fusion, while retaining the local adjacency topology information and the global region semantic information.

[0096] S7. Reconstruct the fused features into an image feature map, perform multi-layer upsampling and skip connection fusion through the decoder, and output a tobacco field segmentation mask map.

[0097] The process of outputting the tobacco field segmentation mask includes: reconstructing all the fused node feature vectors into a feature map with the same spatial size as the input image; the decoder upsampling the reconstructed feature map layer by layer, and after each layer of upsampling, concatenating the feature map output by the decoder with the feature map of the corresponding layer in the encoder; performing a convolution operation on the concatenated feature map to obtain the updated feature map; and based on the updated feature map, after multi-layer upsampling and feature fusion by the decoder, outputting a segmentation mask with 1 channel.

[0098] Furthermore, the decoder includes a four-level upsampling structure. Each level uses transposed convolution (kernel=2, stride=2) for size restoration, and convolutionally fuses the same-level features in the encoder through skip connections. The number of channels is halved layer by layer, and the final output channel number is 1, representing the foreground probability of the segmentation mask.

[0099] S8. Using the Sigmoid activation function, binary classification segmentation results are obtained, completing pixel-level contour extraction of the tobacco field region. Further, the output mask image is processed by the Sigmoid function and transformed into a probability map between 0 and 1, with each pixel value... Generate a binary image using the following rules:

[0100]

[0101] Furthermore, the method can be deployed on edge computing devices equipped with GPUs or NPUs, drone carrier platforms, or cloud servers, supporting efficient and accurate extraction and visualization output of tobacco field boundaries in field scenarios.

[0102] Based on publicly available remote sensing image datasets, actual evaluations under a unified testing environment show that the method of this invention significantly improves both inference speed and segmentation accuracy in high-resolution images compared to traditional methods, with inference speed improved by approximately 30% to 37% and segmentation accuracy improved by more than 5 percentage points.

[0103] This invention constructs a method for extracting tobacco field contours by combining graph neural networks and image semantic segmentation structures. This method achieves pixel-level extraction capabilities in remote sensing images, resulting in stronger boundary continuity, a wider modeling range, and superior structural representation. Compared to existing traditional segmentation methods and convolutional neural network models, this invention offers significant technical advantages and practical benefits in the following aspects: First, it proposes a graph structure modeling approach based on region partitioning. K-means clustering is used to divide high-level semantic features into multiple spatial sub-regions, and a sparse k-nearest neighbor graph is constructed within each sub-region. This achieves accurate modeling of the spatial dependencies of local structures while maintaining computational efficiency. Unlike traditional convolutional operations, which can only process local neighbor pixels, the graph structure better matches the morphological distribution characteristics of field boundaries, effectively improving the detail and completeness of edge recognition.

[0104] Secondly, this invention constructs a region-level fully connected graph by introducing a graph attention mechanism (GATv2), enabling information interaction and context fusion between different sub-regions, thereby breaking the limitations of traditional semantic segmentation models in terms of receptive field. Especially in remote sensing images of tobacco fields, where the fields span large areas, have complex shapes, and blurred boundaries, the global graph structure of this invention can achieve effective correlation between long-distance features, improving the model's ability to model large-scale structures and its cross-regional consistent expression capabilities.

[0105] Furthermore, this invention integrates local node features, adjacency difference features, and region-level global semantic features in the graph neural computation layer, and uses a multilayer perceptron (MLP) to update nodes, thus constructing a graph convolutional network (G-GCN) with global perception capabilities. This module not only preserves the regional semantic context during the update process but also fully considers the microstructural differences between nodes, resulting in a final segmentation mask with stronger boundary preservation capabilities and morphological recognition accuracy.

[0106] Furthermore, the graph construction method proposed in this invention adopts a "locally sparse + fully connected regions" structure, avoiding the high complexity problem caused by traditional full-graph construction. This significantly reduces the model's memory consumption and inference time on high-resolution images, improving the model's engineering deployment efficiency. The entire method architecture is highly compatible with mainstream convolutional models such as U-Net, and can be seamlessly integrated as a plug-in module, possessing good transferability and flexibility.

[0107] Finally, this invention possesses excellent deployability and promising application prospects. The method can run on GPU servers, edge computing platforms, or lightweight UAV image processing units, and is suitable for smart agriculture tasks such as contour extraction in tobacco planting areas, crop plot statistics, field information fusion, and agricultural machinery operation path planning, demonstrating practical application value.

[0108] In summary, this invention significantly improves the integrity of boundary representation, contour recognition accuracy, and segmentation consistency in tobacco field images while maintaining low computational resource consumption. It has comprehensive advantages of high accuracy, high speed, and strong portability, providing a scalable and deployable novel graph neural network solution for complex target segmentation tasks in agricultural remote sensing images.

[0109] 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 technical scope 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 method for extracting a tobacco field contour based on a graph neural network, characterized in that, The method comprises the following steps: obtaining a pretreatment image by preprocessing a tobacco field remote sensing image; inserting a local graph convolution module between convolution layers to construct an encoder, inputting the pretreatment image into the encoder to extract multi-scale features and obtain a high-level feature map; spatially flattening the high-level feature map, dividing the spatially flattened high-level feature map into a plurality of sub-regions by a clustering algorithm, and constructing a local k-neighbor graph in each sub-region; calculating a center feature vector of the sub-region based on node features of the local k-neighbor graph, constructing a fully connected global graph with the center feature vector as a node, and performing cross-region feature interaction based on a graph attention mechanism to obtain an updated global feature; broadcasting the updated global feature to nodes in the corresponding sub-region, and performing global-local feature fusion by combining neighbor feature differences; reconstructing the fused feature into an image feature map, and outputting a tobacco field segmentation mask image through a decoder; performing binaryzation processing on the segmentation mask image to obtain a pixel-level extraction result of a tobacco field contour.

2. The method of claim 1, wherein the method is based on a graph neural network. The process of obtaining a pretreatment image by preprocessing a tobacco field remote sensing image comprises: respectively normalizing the RGB three channels of the tobacco field remote sensing image based on mean and standard deviation to obtain a standardized image; cropping the standardized image to adapt to the input size of the encoder to obtain a cropped image; performing a data enhancement operation on the cropped image to obtain a pretreatment image; wherein the data enhancement operation comprises random rotation, horizontal flip and brightness disturbance.

3. The method of claim 1, wherein the method is based on a graph neural network. The process of inserting a local graph convolution module between convolution layers to construct an encoder comprises: the encoder comprises five convolution layers, each layer being composed of two consecutive 3*3 convolution operations, a BatchNorm normalization layer and a ReLU activation function; each convolution layer is spatially down-sampled by 2*2 max pooling; a local graph convolution module is inserted between adjacent two convolution layers to construct the encoder.

4. The method of claim 1, wherein the method is based on a graph neural network. The process of constructing a local k-neighbor graph in each sub-region comprises: calculating the feature similarity between nodes in the sub-region; selecting k nearest neighbor nodes for each node based on the feature similarity; connecting each node with its k nearest neighbor nodes to form a local k-neighbor graph.

5. The method of claim 3, wherein the method further comprises: The expression for calculating the center feature vector of the sub-region is: ; In the formula, denotes the center feature vector of the i-th sub-region, denotes the set of graph nodes contained in the i-th sub-region, and V denotes the set of all nodes in the entire graph, denotes the input feature vector corresponding to the node v.

6. The method of claim 5, wherein the method further comprises: The calculation expression for obtaining the updated global feature is: ; wherein, denotes the global feature of the updated i-th sub-region, is the single-head attention weight, k denotes the number of neighboring sub-regions of the current sub-region, and j denotes the neighboring sub-region of the current sub-region i, denotes the center feature vector of the neighboring sub-region j is linearly transformed.

7. The method of claim 6, wherein the method further comprises: The calculation expression for the single-head attention weight is: ; where R and L represent linear mapping direction markers left and right, respectively, denotes a learnable linear transformation matrix in the left linear mapping direction, denotes a learnable linear transformation matrix in the right linear mapping direction, is an attention weight vector, LeakyReLU activation function negative slope, denotes the center feature vector of the sub-region j, denotes the global feature representation of the m-th sub-region, and M denotes the total number of sub-regions obtained by region division.

8. The method of claim 1, wherein the method is based on a graph neural network. The process of broadcasting the updated global feature to the nodes in the corresponding sub-region and performing global-local feature fusion by combining neighbor feature differences comprises: the updated global feature is broadcasted to the nodes in the corresponding sub-region, and each node in the current sub-region obtains a global feature vector; for each node, the difference between the node's own feature and the features of the neighbor nodes is calculated to obtain neighbor difference features; for each node, the node's own feature, the neighbor difference features and the global feature vector are spliced to form a fused feature vector.

9. The method of claim 8, wherein the method further comprises: The expression for obtaining the node feature vector after global-local feature fusion is: ; wherein, is the node self-feature of node v at the t-th layer in the graph neural network, is the updated global feature of the i-th sub-region, AGG represents the average pooling operation, and MLP is a multi-layer perceptron operation, is the updated result of node v at the t+1-th layer in the graph neural network, is the feature of the neighbor node u corresponding to the node at the t-th layer.

10. The method of claim 1, wherein the method is based on a graph neural network. The process of reconstructing the fused feature into an image feature map, and outputting a tobacco field segmentation mask image through a decoder comprises: The fused node feature vectors are reconstructed into a feature map with the same spatial size as the input image; The decoder performs layer-by-layer upsampling on the reconstructed feature map, and after upsampling at each layer, splices the feature map output by the decoder with the feature map at the corresponding level in the encoder; Convolution is performed on the spliced feature map to obtain an updated feature map; Based on the updated feature map, after multi-layer upsampling and feature fusion of the decoder, a segmentation mask graph with a channel number of 1 is output.

Citation Information

Patent Citations

  • Tobacco plant segmentation and counting method and system based on unmanned aerial vehicle large-scale image

    CN119091331A

  • CNN and GNN fusion-based network architecture and image detection method

    CN120147753A