A farmland extraction method based on collaborative edge detection and spatial attention mechanism

Through the cultivation land extraction method of collaborative edge detection and spatial attention mechanism, combined with deep learning model and feature fusion technology, the problem of large error in cultivating land extraction in traditional methods is solved, and higher accuracy and generalization ability are achieved, suitable for complex Divide arable land plots in the agricultural environment.

CN116844042BActive Publication Date: 2024-12-20UNIV OF ELECTRONICS SCI & TECH OF CHINA +1

Patent Information

Application Number
CN202310720842.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-16
Publication Date
2024-12-20
Estimated Expiration
2043-06-16

AI Technical Summary

Technical Problem

Traditional arable land extraction methods have large errors and low accuracy. Especially in complex and changeable agricultural environments, especially in areas where the dividing lines between arable land and other land objects are blurred, it is difficult to ensure the accuracy of the extraction results.

Method used

Using the method of collaborative edge detection and spatial attention mechanism, the U-net-based deep learning model is constructed by blocking, rotating, flipping and adding perturbations to the original cultivated land image data, combining the edge detection module, the spatial attention module and The hollow space convolution pooling module extracts and integrates the edge and spatial features of cultivated land, generates weighted feature maps, further captures multi-scale context information, and improves the generalization ability and segmentation accuracy of the model.

Benefits of technology

It significantly improves the accuracy of arable land extraction and the generalization ability of the model, reduces errors, achieves more accurate arable land plot extraction, and improves the reliability of agricultural production information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116844042B_ABST
    Figure CN116844042B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of land use monitoring, and in particular, relates to a method for extracting cultivated land by coordinating edge detection and spatial attention mechanism. The present invention extracts spatial feature information of cultivated land by constructing a U-net structure based on an encoder-decoder: the spatial features, geometric features, and texture features of the image are fully utilized, and feature extraction and feature fusion are performed based on the network framework under the proposed spatial attention mechanism through the effectiveness of feature extraction at different scales. ASPP ensures that features are extracted without losing information at the lowest resolution, and finally achieves the purpose of extracting cultivated land plots. The present invention effectively solves the problems of large errors and low accuracy in existing cultivated land extraction methods.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of land use monitoring, and in particular relates to a method for extracting cultivated land by coordinating edge detection with a spatial attention mechanism. Background Art

[0002] As a basic resource for agricultural production, cultivated land is of great significance to agriculture, food security, ecological balance and economic development. Cultivated land plot extraction is an important part of cultivated land resource management and monitoring, aiming to automatically and accurately extract the spatial distribution information of cultivated land crops from satellite remote sensing images. However, traditional plot extraction methods usually require a lot of manpower, material resources and time, and it is often difficult to ensure the accuracy and real-time nature of the extraction results. With the development of science and technology, more and more remote sensing earth observation technologies are used for planting area statistics and crop yield estimation. With the continuous improvement of the spatiotemporal resolution of satellite remote sensing images, the objects studied have also tended to be more refined, and the objects of cultivated land extraction in agricultural remote sensing have changed from large-scale and large areas in the past to more precise cultivated land plots.

[0003] The extraction of cultivated land parcels is a very important issue in agricultural production. Accurate extraction of cultivated land parcels can provide a lot of valuable information for agricultural production, such as crop types, planting areas, growth status, etc., which is conducive to scientific and rational planting management and utilization of agricultural resources. Traditional methods of extracting cultivated land parcels mainly rely on manual interpretation of remote sensing images, but such methods have the disadvantages of high labor costs, long time consumption, and prone to errors. In recent years, with the development of machine learning and deep learning algorithms, the extraction of cultivated land parcels based on remote sensing images has also made great progress.

[0004] However, traditional machine learning algorithms are mainly based on manually designed features for classification, which is subjective and limited in feature selection and classifier design. Deep learning algorithms can automatically learn high-level feature representations and classifiers, and have the advantages of strong learning ability and automated feature extraction, which can effectively improve the accuracy and generalization of the model. However, for complex and changeable agricultural environments, especially areas with blurred boundaries between cultivated land and other landforms, extracting only from the perspective of spatial feature extraction can easily lead to increased errors in cultivated land extraction, thereby reducing the accuracy of the algorithm. Summary of the invention

[0005] In view of the above-mentioned problems or shortcomings, and to solve the problems of large errors and low accuracy in existing farmland extraction methods, the present invention provides a farmland extraction method that coordinates edge detection and spatial attention mechanism.

[0006] A method for extracting cultivated land by coordinating edge detection and spatial attention mechanism, comprising the following steps:

[0007] Step 1: Block the original farmland image data and the corresponding original label image data separately: Assume that the height of the two original images is h, the width is w, and the number of channels is c. Randomly generate the starting pixel values ​​of the height and width of each block, and divide it into m sub-pixel blocks with img_h as the height and img_w as the width The size of each pixel block X is img_h×img_w×c.

[0008] In order to increase the number of training set samples and obtain sufficient training data, the obtained block data are randomly rotated, flipped, perturbated and / or noised to improve the generalization ability of the model.

[0009] The final obtained block original farmland image data and the corresponding block original label image data are stored in the sets src_set and label_set respectively as data sets for subsequent deep learning.

[0010] Step 2: Construct the training set and data set, divide src_set and label_set in a ratio of 3:1:1, and construct the training set train_set, the validation set val_set and the test set test_set respectively.

[0011] Step 3: Input the training set data obtained in step 2 into the constructed U-net-based deep learning spatial attention mechanism model (hereinafter collectively referred to as the model) to obtain the edge enhanced image and feature map.

[0012] First, for each input sample F in the training set train The edge detection module is used to extract the edge features of the original cultivated land image data to obtain the edge enhanced image F edge , and with F train Perform connection fusion to obtain the feature map

[0013] Next, the model is used to perform semantic segmentation at multiple scales. Assuming there are l scales in total, a convolution is performed on the input sample at each scale i (i = 1, 2, 3, ..., l) to obtain To adapt the resolution size at the current scale; then get the edge enhanced image at the current scale With feature map At different scales The dimensions are all h i × i ×c i .

[0014]

[0015] In the above formula, [·] channel is a concatenation function that performs concatenation in the channel dimension, and Cov() is a convolution function with a convolution kernel size of 1×1.

[0016] Step 4: Generate spatial attention feature map: Generate the feature map at each scale obtained in step 3 Input into the spatial attention module to generate a spatial attention feature map Its dimension size is: h i × i ×c i .

[0017] Step 5: Fusion of spatial features and geometric features extracted from edges: Fusion of the spatial attention feature map obtained in step 4 and the edge-enhanced image obtained in step 3 to obtain a global spatial relationship perception feature map.

[0018]

[0019] Step 6: Weighted fusion of feature images: Use the spatial relationship perception feature map obtained in step 5 With feature map Perform weighted operation to obtain the weighted output feature map

[0020]

[0021] In the above formula, is the Hadamard product operation.

[0022] Step 7: Atrous spatial convolution pooling: At the lowest resolution, the obtained weighted feature map is passed through an atrous spatial convolution pooling ASPP module to further capture multi-scale contextual information by combining features under different receptive fields:

[0023]

[0024] Step 8: Output feature map Upsampling is performed, and the upsampling result is connected to the output of the submodule with the same resolution in the model encoder as the input of the next submodule in the decoder; cross entropy is used as the loss function to evaluate the segmentation result. At this point, the model training is completed and a trained model is obtained.

[0025] Step 9: Input the test set data obtained in step 2 into the model trained in step 8 to obtain the segmentation result of the cultivated land.

[0026] Furthermore, the step 3 comprises the following steps:

[0027] Step 3.1: Convert the original color image into a grayscale image:

[0028] F gray =F red *0.299+F green *0.587+F blue *0.114

[0029] In the above formula, F red 、F green 、F blue The pixel value matrix of the original image in three different channels R, G, and B, F gray It is the gray value matrix after grayscale conversion.

[0030] Step 3.2, get the Gaussian blur operator:

[0031]

[0032] In the above formula, G(x, y) is a two-dimensional Gaussian convolution operator, which uses its low-pass filtering properties to eliminate high-frequency noise. (x, y) is the relative coordinate position of each pixel under the Gaussian convolution kernel.

[0033] Step 3.3: Use the Canny algorithm to perform edge detection and obtain the edge feature matrices on the x-axis and y-axis images respectively:

[0034]

[0035]

[0036] In the above formula, * is the convolution operation, F gray (x, y) is the grayscale value of the original image at the coordinate (x, y).

[0037] Step 3.4, calculate the gradient amplitude and obtain the edge feature matrix:

[0038]

[0039] Furthermore, the step 4 specifically includes the following steps:

[0040] Step 4.1: Use two types of functions M: average pooling and maximum pooling avg (·) and M max (·) for feature maps Perform feature dimensionality reduction and perform fusion and splicing on the channel dimension:

[0041]

[0042] In the above formula, [·] channel is the concatenation function, which performs concatenation in the channel dimension; Mmax (·) is the maximum pooling function, M avg (·) is the average pooling function. The pooling operation can reduce the channel size of the feature map on the one hand, and on the other hand, two different types of pooling can be used to extract feature textures while retaining background information as much as possible.

[0043] Step 4.2, get the spatial feature attention matrix:

[0044]

[0045] In the above formula, C(·) is a convolution block function, including two 3×3 convolution layers and ReLu activation function. The spatial relationship features are obtained through the convolution layer. Relu(·) is an activation function used to map the input data to the range of (0, ∞);

[0046] Furthermore, the step 7 specifically includes the following steps:

[0047] Step 7.1: The output feature map at the minimum resolution is passed through three dilated convolution operations with kernel sizes of 3×3 and different dilation rates to obtain the spatial information of multi-view perception:

[0048]

[0049] The k in the above formula represents the expansion rates of three types of dilated convolutions, which are 1, 6, 12, and 18 respectively.

[0050] Step 7.2: The output feature map at the minimum resolution is globally pooled and concatenated with the multiple convolution results obtained in step 7.1. In order to obtain the original feature map size, it is then dimensionalized by a convolution with a convolution kernel size of 1×1 to obtain the output result:

[0051]

[0052] Furthermore, the step 8 specifically includes the following steps:

[0053] Step 8.1: Upsample the result of step 7 and upsample the result of each layer. Output of the convolutional module at the same resolution as in the encoder Perform skip connection to obtain And the result As the input of the next upsampling module, the upsampling result of the next layer is obtained

[0054]

[0055] Among them, Cov upIt is an upsampling module that uses bilinear interpolation + convolution to complete the scale transformation and connects the transformed feature map with the output result of the encoder module at the corresponding scale.

[0056] Step 8.2: Construct a cross entropy loss function to evaluate the effect of image segmentation:

[0057]

[0058] In the above formula, y is the true label value (positive value is 1, negative value is 0); is the predicted probability value, Represents the difference between the true sample label and the predicted probability.

[0059] The present invention first performs edge detection on different scales, and transmits the extracted geometric features of the cultivated land boundary to the attention mechanism for feature extraction. The geometric information of the edge features ensures that the boundary between cultivated land and other objects is clear, which greatly increases the accuracy of cultivated land extraction. Then the edge features are input to the extracted spatial features for feature fusion, and the obtained weighted feature map is combined with the features under different receptive fields through the ASPP module at the lowest resolution to further capture multi-scale context information. Finally, the upsampling result is connected to the output of the submodule with the same resolution in the encoder. The test set data is input into the trained model to obtain the segmentation result of cultivated land crops.

[0060] In summary, the present invention makes full use of the spatial features, geometric features, and texture features of the image, and performs feature extraction and feature fusion based on the network framework under the proposed spatial attention mechanism through the effectiveness of feature extraction at different scales. ASPP ensures that features are extracted without losing information at the lowest resolution, and ultimately achieves the purpose of farmland plot extraction. The present invention effectively solves the problems of large errors and low accuracy in existing farmland extraction methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 It is a schematic diagram of the structure flow of the present invention;

[0062] Figure 2 It is a schematic diagram of the process of the present invention;

[0063] Figure 3 A schematic diagram of the structure of an edge detection module provided by an embodiment of the present invention;

[0064] Figure 4 A schematic diagram of the structure of a spatial attention module provided by an embodiment of the present invention;

[0065] Figure 5 A schematic diagram of the structure of an ASPP module provided in an embodiment of the present invention;

[0066] Figure 6 This is the result of farmland extraction in the embodiment, where the white part represents farmland and the black part represents the background;

[0067] Figure 7 This is a graph showing the change in loss function and accuracy during training and verification of the implementation model. DETAILED DESCRIPTION

[0068] The present invention is further described below in conjunction with embodiments. The description of the following embodiments is only used to help understand the present invention. It should be noted that for ordinary persons in the art, without departing from the principle of the present invention, the present invention can also be modified in some ways, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.

[0069] The present invention provides a method for extracting crop features and plot segmentation of cultivated land by coordinating edge detection and spatial attention mechanism. The present invention is based on an encoder-decoder framework. In the encoder part, the original cultivated land image data and the corresponding original label image data are processed to construct a training set and a data set. The edge feature geometric information is extracted by an edge detection operator to obtain an edge enhanced image F. edge ; Further feature fusion is performed with the spatial features under the spatial attention mechanism to obtain the global spatial relationship perception feature map Spatial relationship aware feature map With the original feature image Perform weighted fusion of feature images and extract multi-scale context information under different receptive fields through the hole convolution module ASPP at the lowest scale Finally, the feature image is upsampled in the decoder part, and the upsampling result is connected with the output of the sub-module with the same resolution in the encoder as the input of the next sub-module in the decoder to output the farmland extraction result map.

[0070] As an implementation example, the present invention can use computer software to realize the automatic operation process. Figure 1 The steps of extracting cultivated land plots are described in detail. In the environment of python 3.6, the present invention uses tensorflow+keras framework to realize the construction and training of the model.

[0071] Step 1: Block the original farmland image data and the corresponding original label image data at the same time: Assume that the height of the two original images is h, the width is w, and the number of channels is 3, representing the RGB three channels. Randomly generate the starting pixel values ​​of the height and width of each block, and divide it into m sub-pixel blocks with 256 pixels as width and height. The size of each pixel block X is 256×256×3. In order to increase the number of training set samples and obtain sufficient training data, the obtained block data is randomly rotated, flipped, perturbed and / or noised to improve the generalization ability of the model. The obtained block original cultivated land image data and the corresponding block original label image data are stored in different sets, and src_set and label_set are constructed respectively as the data sets for subsequent deep learning.

[0072] Step 2: Construct the training set and data set, divide src_set and label_set in a ratio of 3:1:1, and construct the training set train_set, the validation set val_set and the test set test_set respectively;

[0073] Step 3: Input the training set data obtained in step 2 into the constructed U-net-based deep learning spatial attention mechanism model (hereinafter collectively referred to as the “model”). First, for each input sample F in the training set train The edge detection module is used to extract the edge features of the original cultivated land image data to obtain the edge enhanced image f edge , and with F train Perform connection fusion to obtain the feature map Then the model is used to perform semantic segmentation at multiple scales. There are five scales in total. At each scale i, the input sample F train Perform a convolution to get To adapt the resolution size at the current scale, and then obtain the edge enhanced image at the current scale With feature map At different scales The accuracy sizes are 256×256×32, 128×128×64, 64×64×128, 32×32×256, and 16×16×512 respectively.

[0074]

[0075] Step 3.1: Convert the original color image into a grayscale image:

[0076] F gray =F red *0.299+F green *0.587+F blue *0.114

[0077] In the above formula, F red 、F green 、F blue The pixel value matrix of the original image in three different channels R, G, and B, F grayIt is the gray value matrix after grayscale conversion.

[0078] Step 3.2, get the Gaussian blur operator:

[0079]

[0080] In the above formula, G(x, y) is a two-dimensional Gaussian convolution operator, which uses its low-pass filtering properties to eliminate high-frequency noise. (x, y) is the relative coordinate position of each pixel under the Gaussian convolution kernel.

[0081] Step 3.3: Use the Canny algorithm to perform edge detection and obtain the edge feature matrices on the x-axis and y-axis images respectively:

[0082]

[0083]

[0084] In the above formula, * is the convolution operation, F gray (x, y) is the grayscale value of the original image at the coordinate (x, y).

[0085] Step 3.4, calculate the gradient amplitude and obtain the edge feature matrix:

[0086]

[0087] Step 4: Generate spatial attention feature map: Generate each layer of feature map obtained in step 3 Input into the spatial attention module to generate a spatial attention feature map Dimension size: h i × i ×c i .

[0088] Step 4.1: Use two types of functions M: average pooling and maximum pooling avg (·) and M max (·) for feature maps Perform feature dimensionality reduction and perform fusion and splicing on the channel dimension:

[0089]

[0090] In the above formula, [·] channel is the concatenation function, which performs concatenation in the channel dimension; M max (·) is the maximum pooling function, M avg (·) is the average pooling function. The pooling operation can reduce the channel size of the feature map on the one hand, and on the other hand, two different types of pooling can be used to extract feature textures while retaining background information as much as possible.

[0091] Step 4.2, get the spatial feature attention matrix:

[0092]

[0093] In the above formula, C(·) is a convolution block function, including two 3×3 convolution layers and a Relu activation function. The spatial relationship features are obtained through the convolution layer. Relu(·) is an activation function used to map the input data to the range of (0, ∞).

[0094] Step 5: Fusion of spatial features and geometric features extracted from edges: Fusion of the spatial attention feature map obtained in step 4 and the edge enhanced image obtained in step 3. Obtaining the global spatial relationship perception feature map

[0095]

[0096] Step 6: Weighted fusion of feature images: Use the spatial relationship perception feature map obtained in step 6 With the feature image Perform weighted operation to obtain the weighted output feature map

[0097]

[0098] In the above formula, is the Hadamard product operation.

[0099] Step 7: Atrous spatial convolution pooling: At the lowest resolution, the obtained weighted feature map is passed through an atrous spatial convolution pooling ASPP module to further capture multi-scale contextual information by combining features under different receptive fields:

[0100]

[0101] Step 7.1: Output feature map at minimum resolution Through three dilated convolution operations with different kernel sizes of 3×3 and different dilation rates, the spatial information of multi-view perception is obtained:

[0102]

[0103] The k in the above formula represents the expansion rates of three types of dilated convolutions, which are 1, 6, 12, and 18 respectively.

[0104] Step 7.2: The output feature map at the minimum resolution is globally pooled and concatenated with the multiple convolution results obtained in step 7.1. In order to obtain the original feature map size, it is dimensional adjusted by another convolution with a convolution kernel size of 1×1 to obtain the output result:

[0105]

[0106] Step 8: Feature map Upsampling is performed, and the upsampling result is connected to the output of the sub-module with the same resolution in the model encoder as the input of the next sub-module in the decoder; cross entropy is used as the loss function to evaluate the segmentation result.

[0107] Step 8.1: Upsample the result of step 7.2 and upsample the upsampled result of each layer. Output feature map of the convolutional module at the same resolution as in the encoder Perform skip connection to obtain And the result As the input of the next upsampling module, the upsampling result of the next layer is obtained

[0108]

[0109] Among them, Cov up It is an upsampling module, which uses bilinear interpolation + convolution to complete the scale transformation. The transformed feature map is connected with the output result of the encoder module at the corresponding scale. The scales of the feature maps obtained after connection are: 32×32×512, 64×64×256, 128×128×128, 256×256×64, and 256×256×32.

[0110] Step 8.2: Construct a cross entropy loss function to evaluate the effect of image segmentation:

[0111]

[0112] In the above formula, y is the true label value (positive value is 1, negative value is 0); is the predicted probability value It represents the difference between the true sample label and the predicted probability. Figure 7 This is a graph showing the change in loss function and accuracy during training and verification of the implementation model.

[0113] Step 9: Input the test set data obtained in step 2 into the trained model to obtain the segmentation result of the cultivated land.

[0114] At the end of this example, the accuracy, precision, and intersection over union (IoU) evaluation indicators are selected to quantitatively evaluate the model segmentation results:

[0115]

[0116]

[0117]

[0118] Among them, TP means that the real label is a positive example and the predicted result is a positive example; TN means that the real label is a positive example and the predicted result is a negative example; FP means that the real label is a negative example and the predicted result is a positive example; FN means that the real label is a positive example and the predicted result is a negative example. After model training, the accuracy, precision and intersection-over-union ratio of cultivated land extraction in the embodiment of the model of the present invention are 93.27%, 92.21% and 91.32% respectively.

[0119] Through the above examples, and the evaluation results of the examples, it can be seen that:

[0120] The present invention extracts spatial feature information of cultivated land by constructing a U-net network structure based on an encoder-decoder, and segments cultivated land plots: first, the edge extraction module is used to obtain the gradient information of the image and extract the edge features of the image. Then, a spatial attention module is constructed to retain global features through maximum pooling and average pooling, and highlight local texture information, and the edge features, global features and texture feature information obtained above are fused; then, the information is input into the next-level encoder module of U-net, and image features are extracted layer by layer through layer coding; then, an ASPP module is used at the lowest resolution to further capture multi-scale context information by combining features under different receptive fields; finally, the upsampling and jump connection of the decoder module will effectively reduce the problems of gradient disappearance and network degradation, and a layer-by-layer decoding module similar to the encoder is used to finally obtain the model output.

Claims

1. A method for extracting cultivated land by coordinating edge detection and spatial attention mechanism, characterized in that: The following steps are involved: Step 1: Block the original farmland image data and the corresponding original label image data separately: Assume that the height of the two original images is h, the width is w, and the number of channels is c. Randomly generate the starting pixel values ​​of the height and width of each block, and divide it into m sub-pixel blocks with img_h as the height and img_w as the width The size of each pixel block X is img_h×img_w×c; The obtained block data are randomly rotated, flipped, perturbed and / or noised to increase the number of training set samples to improve the generalization ability of the model; The final obtained block original farmland image data and the corresponding block original label image data are stored in the sets src_set and label_set respectively as the data sets for subsequent deep learning; Step 2: Construct the training set and data set, divide src_set and label_set in the ratio of 3:1:1, and construct the training set train_set, the validation set val_set and the test set test_set respectively; Step 3: Input the training set data obtained in step 2 into the constructed U-net-based deep learning spatial attention mechanism model to obtain edge-enhanced images and feature maps; First, for each input sample F in the training set train The edge detection module is used to extract the edge features of the original cultivated land image data to obtain the edge enhanced image F edge , and with F train Perform connection fusion to obtain the feature map F in ; Next, the model is used to perform semantic segmentation at multiple scales. Assuming there are l scales in total, a convolution is performed on the input sample at each scale i to obtain To adapt the resolution size at the current scale, i = 1, 2, 3, ..., l; then obtain the edge enhanced image at the current scale With feature map At different scales The dimensions are all h i × i ×c i ; In the above formula, [·] channel is a concatenation function that performs concatenation in the channel dimension, and Cov() is a convolution function with a convolution kernel size of 1×1; Step 4: Generate spatial attention feature map: Generate the feature map at each scale obtained in step 3 Input into the spatial attention module to generate a spatial attention feature map Its dimension size is: h i × i ×c i ; Step 5: Fusion of spatial features and geometric features extracted from edges: Fusion of the spatial attention feature map obtained in step 4 and the edge-enhanced image obtained in step 3 to obtain a global spatial relationship perception feature map. Step 6: Weighted fusion of feature images: Use the spatial relationship perception feature map obtained in step 5 With feature map Perform weighted operation to obtain the weighted output feature map In the above formula, is the Hadamard product operation; Step 7: Atrous spatial convolution pooling: At the lowest resolution, the obtained weighted feature map is passed through an atrous spatial convolution pooling ASPP module to further capture multi-scale contextual information by combining features under different receptive fields: Step 8: Output feature map Upsample and connect the upsampled result with the output of the submodule with the same resolution in the model encoder as the input of the next submodule in the decoder; Use cross entropy as the loss function to evaluate the segmentation results and obtain the trained model; Step 9: Input the test set data obtained in step 2 into the model trained in step 8 to obtain the segmentation result of the cultivated land.

2. The method for extracting cultivated land by coordinating edge detection and spatial attention mechanism according to claim 1, characterized in that: The step 3 comprises the following steps: Step 3.1: Convert the original color image into a grayscale image: F gray =F red *0.299+F green *0.587+F blue *0.114 In the above formula, F red 、F green 、F blue The pixel value matrix of the original image in three different channels R, G, and B, F gray It is the gray value matrix after grayscale conversion; Step 3.2, get the Gaussian blur operator: Where G(x,y) is a two-dimensional Gaussian convolution operator, and (x,y) is the relative coordinate position of each pixel under the Gaussian convolution kernel; Step 3.3: Use the Canny algorithm to perform edge detection and obtain the edge feature matrices on the x-axis and y-axis images respectively: In the above formula, * is the convolution operation, F gray (x,y) is the gray value of the original image at coordinate (x,y); Step 3.4, calculate the gradient amplitude and obtain the edge feature matrix:

3. The method for extracting cultivated land by coordinating edge detection and spatial attention mechanism as claimed in claim 1, characterized in that: The step 4 specifically comprises the following steps: Step 4.1: Use two types of functions M: average pooling and maximum pooling avg (·) and M max (·) for feature maps Perform feature dimensionality reduction and perform fusion and splicing on the channel dimension: In the above formula, [·] channel is the splicing function, M max (·) is the maximum pooling function, M avg (·) is the average pooling function; Step 4.2, get the spatial feature attention matrix: In the above formula, C(·) is a convolution block function, which includes two 3×3 convolution layers and a ReLu activation function. The spatial relationship features are obtained through the convolution layers and are used to map the input data to the range of (0,∞).

4. The method for extracting cultivated land by coordinating edge detection and spatial attention mechanism according to claim 1, characterized in that: The step 7 specifically includes the following steps: Step 7.1: The output feature map at the minimum resolution is passed through three dilated convolution operations with kernel sizes of 3×3 and different dilation rates to obtain the spatial information of multi-view perception: The k in the above formula represents the expansion rate of the three types of dilated convolutions, which are taken from K = {1, 6, 12, 18}; Step 7.2: The output feature map at the minimum resolution is globally pooled and concatenated with the multiple convolution results obtained in step 7.

1. Then, it is dimensionalized by a convolution with a convolution kernel size of 1×1 to obtain the output result:

5. The method for extracting cultivated land by coordinating edge detection and spatial attention mechanism as claimed in claim 1, characterized in that: The step 8 specifically includes the following steps: Step 8.1: Upsample the result of step 7 and upsample the result of each layer. Output of the convolutional module at the same resolution as in the encoder Perform skip connection to obtain And the result As the input of the next upsampling module, the upsampling result of the next layer is obtained Among them, Cov up It is an upsampling module that uses bilinear interpolation + convolution to complete the scale transformation and connects the transformed feature map with the output result of the encoder module at the corresponding scale; Step 8.2: Construct a cross entropy loss function to evaluate the effect of image segmentation: In the above formula, y is the true label value, the positive value is 1, and the negative value is 0; is the predicted probability value, Represents the difference between the true sample label and the predicted probability.

Citation Information

Patent Citations

  • High-resolution remote sensing image land coverage classification method based on local detail enhancement and edge constraint

    CN113343789A

  • Open-pit mine area land utilization identification method based on improved DeepLabV3+

    CN113435411A

Cited By

  • A method for identifying cultivated land parcels based on optical and SAR image fusion

    CN122676357A