Island remote sensing extraction method based on attention mechanism and feature optimization
By introducing a dual attention mechanism and a feature-optimized TransUNet-DAFRH model into island remote sensing extraction, the problems of weak noise resistance and blurred boundaries in island remote sensing extraction are solved, achieving efficient processing of complex background noise and accurate boundary extraction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGDONG OCEAN UNIVERSITY
- Filing Date
- 2026-03-06
- Publication Date
- 2026-06-09
AI Technical Summary
Existing methods suffer from weak noise resistance, discontinuous extraction of broken coastlines, and blurred boundaries due to insufficient fusion of semantic features in island remote sensing extraction.
The TransUNet-DAFRH model, based on attention mechanism and feature optimization, is adopted. It captures the spatial and channel dependencies of the image through dual attention modules (position attention module and channel attention module), and combines feature optimization head to perform feature fusion in the decoder stage. A composite loss function is used to optimize the training process.
The model's ability to resist complex background noise has been improved, and the accuracy and completeness of island and reef boundary extraction have been enhanced, effectively solving the problem of blurred island boundaries in traditional methods.
Smart Images

Figure CN122176553A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of remote sensing image processing technology, specifically relating to a remote sensing extraction method for islands based on attention mechanisms and feature optimization. Background Technology
[0002] Precise and automated extraction of island data is a key technology supporting decision-making for sustainable marine development. Its core value lies in providing indispensable foundational geographic information for dynamically monitoring the health of coral reef ecosystems (such as bleaching and erosion), assessing the abundance and spatial distribution of island and reef fishery resources, and formulating scientific marine spatial planning and long-term management strategies. Through continuous analysis of coastline changes and island and reef geomorphological evolution, it is possible to accurately grasp changes in core habitats, migration routes, and resource fluctuations of fishery resources, thereby providing a solid scientific basis for implementing ecosystem-based fisheries management, delineating sustainable fishing quotas, and optimizing aquaculture zone layout.
[0003] However, remote sensing image segmentation of islands and reefs currently faces severe challenges. First, the island and reef environment is extremely complex, including fragmented and irregular coastlines, reflection interference from shallow water reef flats, wave disturbances, and cloud cover common in tropical regions. This background noise often makes it difficult for traditional rule-based or simple threshold-based algorithms to clearly define the boundaries between shallow water areas and dry reefs, and these algorithms are extremely sensitive to noise. In recent years, deep learning techniques, represented by convolutional neural networks (CNNs) (such as U-Net and the DeepLab series), have made significant progress in semantic segmentation. However, the inherent local receptive field of CNNs limits their ability to capture long-range dependencies, making it difficult to handle complex island and reef boundaries and global noise interference. Although Transformer-based architectures (such as TransUNet) introduce global modeling capabilities, pure Transformer architectures lack inductive biases for specific spatial and channel features of the image, resulting in poor performance when extracting subtle boundaries. Furthermore, in the U-shaped network architecture, there is a significant "semantic gap" between the low-level features generated by the encoder (rich in spatial information but weak in semantics) and the high-level features generated by the decoder (rich in semantic information but low in resolution). Simple skip connections often cannot effectively fuse these two types of features, resulting in limited segmentation accuracy. In particular, when facing small and fragmented island and reef targets, misjudgment and missed judgment are likely to occur.
[0004] Based on this, the present invention proposes an island remote sensing extraction method based on attention mechanism and feature optimization to solve the problems existing in the prior art. Summary of the Invention
[0005] In view of this, the main objective of this invention is to provide a remote sensing extraction method for islands based on attention mechanisms and feature optimization, so as to solve the problems of weak noise resistance of islands in complex marine backgrounds, discontinuous extraction of broken coastlines, and blurred boundaries caused by insufficient fusion of semantic features in existing methods.
[0006] To achieve the above objectives, the present invention provides the following technical solution:
[0007] This invention provides a first solution: a remote sensing extraction method for islands based on attention mechanisms and feature optimization, characterized by comprising:
[0008] Step S1: Acquire the original satellite remote sensing image of the island and obtain the island and reef remote sensing image centered on the island and reef through cropping operations;
[0009] Step S2: Manually annotate the remote sensing images of the islands to generate binary labels for islands / background;
[0010] Step S3: Crop the labels into image patches using a sliding window method to construct the sample dataset;
[0011] Step S4: Divide the sample dataset into a training set and a test set;
[0012] Step S5: Perform various data augmentation processes on the training set to obtain the training set of processed images;
[0013] Step S6: Construct the TransUNet-DAFRH island segmentation model that integrates dual attention mechanism and feature optimization head;
[0014] The TransUNet-DAFRH island segmentation model includes a dual attention module and a feature optimization head. The dual attention module calculates spatial and channel self-attention matrices through parallel positional attention and channel attention modules, respectively, to generate a weighted feature representation containing global context information. It also retains the original feature information by combining learnable scaling parameters and residual connections. The feature optimization head is located at the skip connection position. Its input is the fusion of encoder and decoder features. Through weighted summation preprocessing and parallel channel and spatial attention branches, it generates multi-dimensional feature refinement weights and combines residual connections to prevent network degradation.
[0015] Step S7: Train the TransUNet-DAFRH island segmentation model using the training set, evaluate its performance based on the test set, and finally perform visualization analysis and quantitative evaluation of the model's prediction results.
[0016] Step S8: Use the trained TransUNet-DAFRH island segmentation model to extract islands with high quality.
[0017] In a preferred embodiment of the present invention, the construction process of the TransUNet-DAFRH island segmentation model in step S6 includes:
[0018] Step S6.1: Input the training set images of the sample dataset processed in step S5 into the CNN encoder of the TransUNet-DAFRH island segmentation model in batches to extract image feature maps;
[0019] Step S6.2: The feature map obtained in step S6.1 is then introduced into the dual attention module to capture the position and channel dependencies of a specific image;
[0020] Step S6.3: Finally, connect the Transformer layer to perform global feature modeling;
[0021] Step S6.4: In the decoding stage, the features of the encoder are received through skip connections, and a feature optimization head is introduced to fuse and refine the encoder features and decoder features;
[0022] Step S6.5: Calculate the error between the predicted result and the true label using the composite loss function, and update the network parameters through backpropagation.
[0023] In a preferred embodiment of the present invention, step S6.1, which involves inputting the training set images of the sample dataset in batches into the CNN encoder of the TransUNet-DAFRH island segmentation model to extract image feature maps, includes:
[0024] The CNN encoder utilizes a pre-trained ResNet50 network to obtain three CNN features with spatial local information through three stages of residual block and pooling downsampling:
[0025] ;
[0026] in, H and W represent the height and width of the input feature map, respectively. .
[0027] In a preferred embodiment of the present invention, the dual attention module includes a positional attention module and a channel attention module. Step S6.2 introduces the feature map obtained in step S6.1 into the dual attention module to capture the positional and channel dependencies of a specific image, including:
[0028] Step S6.2.1: Use the positional attention module to capture specific positional features of the image;
[0029] Step S6.2.2: Use the channel attention module to capture specific channel features of the image.
[0030] In a preferred embodiment of the present invention, the process of capturing specific positional features of an image using the positional attention module in step S6.2.1 includes:
[0031] The position attention module first receives the local feature map A. Where C, H, and W represent the number of channels, height, and width, respectively; then feature map A is passed through a convolutional layer to generate three new feature maps B, C, and D, each feature map having a size of [missing value]. Subsequently, B and C were reshaped into Where N = H × W represents the total number of pixels; matrix multiplication is performed between the transposes of C and B, followed by a softmax operation to obtain the spatial attention map S. :
[0032] ;
[0033] in: This represents the influence of the i-th position on the j-th position;
[0034] Next, feature map D is reshaped into Then, perform matrix multiplication between the transposes of D and S, and reshape the resulting matrix back to its original state. Finally, the result is scaled using a learnable parameter α and added element-wise to the original feature map A to produce the final output E. :
[0035] .
[0036] In a preferred embodiment of the present invention, step S6.2.2, which describes capturing specific channel features of an image using a channel attention module, includes:
[0037] The channel attention module first receives local feature map A. arrive Then, matrix multiplication is performed between A and its transpose; subsequently, a softmax layer is applied to obtain the channel attention map. :
[0038] ;
[0039] in, This represents the influence of the i-th channel on the j-th channel;
[0040] Subsequently, matrix multiplication is performed between the transposes of X and A, and the resulting matrix is reshaped back. The result is then scaled using a learnable parameter β and added element-wise to the original feature map A to produce the final output E. :
[0041] .
[0042] In a preferred embodiment of the present invention, step S6.3, which involves connecting the Transformer layer for global feature modeling, includes:
[0043] Step S6.3.1: Perform linear projection on the feature map enhanced by the dual attention module in step S6.2 to convert the two-dimensional feature map into a one-dimensional feature sequence;
[0044] Step S6.3.2: Within each Transformer layer, the feature sequence is first processed by layer normalization and multi-head self-attention mechanism to calculate global semantic dependencies, and then superimposed with the input through residual connections; subsequently, the output is processed by layer normalization and multilayer perceptron again, and then feature fusion is performed again through residual connections.
[0045] Step S6.3.3: Restore the feature sequence after processing by all Transformer layers into a feature map with spatial dimensions through a reshaping operation, which will serve as the final output feature of the encoder.
[0046] In a preferred embodiment of the present invention, step S6.4, which involves receiving encoder features via a skip connection and introducing a feature optimization head to fuse and refine the encoder and decoder features, includes:
[0047] Step S6.4.1: First, process the feature map generated by the encoder. and the feature map generated by the decoder We perform a weighted summation to obtain the fusion characteristics. Where α is the weighting parameter:
[0048] ;
[0049] Step S6.4.2: Merge features Input two parallel channel branches to enhance feature representations in both channel and spatial dimensions.
[0050] In a preferred embodiment of the present invention, the composite loss function described in step S6.5 is a binary cross-entropy loss. and Dice loss composition;
[0051] ;
[0052] in: This indicates the number of pixels in the segmentation image. This represents the label of the i-th pixel. This represents the predicted mask for the i-th pixel;
[0053] ;
[0054] Where: G and P represent the ground truth image and the predicted image, respectively; α is a parameter;
[0055] Total loss function The sum of the binary cross-entropy loss and the Dice loss:
[0056] .
[0057] This invention provides a second solution: the TransUNet-DAFRH island segmentation model, comprising:
[0058] CNN encoders are used to extract local features;
[0059] The dual attention module, electrically connected to the output of the CNN encoder, includes parallel PAM and CAM sub-modules for capturing the positional and channel dependencies of a specific image.
[0060] The feature optimization head is used to perform multi-dimensional correction on the fused features by utilizing internal parallel spatial and channel branches.
[0061] The composite loss function is used to calculate the error between the predicted result and the true label, and to update the network parameters through backpropagation;
[0062] The decoder receives the feature representation output by the encoder and transforms it into the target output form that meets the task requirements through inverse transformation, feature reconstruction and optimization.
[0063] The CNN encoder, dual attention module, feature optimization head, composite loss function, and decoder mentioned above are all established based on the steps of the attention mechanism and feature optimization method for island remote sensing extraction.
[0064] Compared with existing technologies, this invention provides a remote sensing extraction method for islands based on attention mechanisms and feature optimization, which has the following beneficial effects:
[0065] 1. This invention addresses the problems of complex background noise interference (such as shallow water reef reflection and cloud occlusion) and insufficient capture of specific features in island extraction scenarios. It constructs a TransUNet encoder framework that integrates a dual attention mechanism, which improves the model's sensitivity to specific image features and its noise resistance.
[0066] 2. This invention introduces a dual attention module (DA-Block) before the Transformer encoder layer, capturing the spatial and channel dependencies of the image through parallel positional attention (PAM) and channel attention (CAM) modules, respectively. While the Transformer module utilizes a self-attention mechanism to model global contextual relationships, the DA-Block enhances the extraction of specific local details and discriminative features of the image. This mechanism compensates for the lack of image-specific inductive bias in the pure Transformer architecture, thereby enhancing the ability to differentiate between island and reef bodies and complex marine backgrounds (seawater, clouds, reefs), effectively solving the problem of existing methods struggling to accurately identify island and reef features under strong noise interference.
[0067] 3. This invention achieves efficient refinement of multi-scale features and effective bridging of the "semantic gap," further improving the effectiveness of feature fusion and the precision of land-sea segmentation boundaries.
[0068] 4. This invention introduces a Feature Refinement Head (FRH) and a weighted summation mechanism in the decoder stage to dynamically integrate and refine the features of the encoder and decoder. The FRH module utilizes internal parallel spatial and channel branches to perform multi-dimensional correction on the fused features, effectively fusing the rich spatial details extracted by the encoder with the high-level semantic information generated by the decoder. This mechanism achieves an efficient combination of local details and global contextual information, effectively improving the semantic mismatch problem caused by direct splicing of traditional skip connections.
[0069] 5. This invention combines a hybrid loss function consisting of BCE Loss and Dice Loss to optimize the training process, effectively alleviating the problem of imbalance between positive and negative samples, thereby significantly improving the accuracy and completeness of boundary extraction for broken coastlines and small islands.
[0070] This method addresses the problems of weak noise resistance of islands in complex marine backgrounds, discontinuous extraction of broken coastlines, and blurred boundaries caused by insufficient fusion of semantic features in existing methods. Attached Figure Description
[0071] Figure 1 This is a flowchart of the island remote sensing extraction method based on attention mechanism and feature optimization of the present invention.
[0072] Figure 2 This is a schematic diagram of the structure of the island remote sensing extraction model TransUnet-DAFRH constructed in this invention.
[0073] Figure 3 This is a schematic diagram of the dual attention module (DA) of the present invention.
[0074] Figure 4This is a schematic diagram of the feature optimization header module FRH of the present invention.
[0075] Figure 5 This is a comparison chart of the island segmentation prediction results of the method of this invention and other mainstream network models on test images.
[0076] Figure 6 This image shows a comparison of the island segmentation prediction results of the present invention method and the TransUNet-DAFRH island segmentation model with other mainstream network models on test images to verify the robustness of the present invention.
[0077] Figure 7 This is a comparison of the extraction results of the method of this invention and other mainstream network models on Sentinel-2 remote sensing images of Bishen Reef.
[0078] Figure 8 This is a comparison chart of the extraction results of the method of this invention and other mainstream network models on Sentinel-2 remote sensing images of Nanhua Reef. Detailed Implementation
[0079] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0080] Example 1:
[0081] Please refer to the instruction manual appendix. Figure 1 - Appendix Figure 4 To address the shortcomings of existing methods, such as weak noise resistance of islands in complex marine backgrounds, discontinuous extraction of broken coastlines, and blurred boundaries due to insufficient semantic feature fusion, this invention proposes a remote sensing island extraction method based on an attention mechanism (TransUNet) and feature optimization. This method enhances the capture of specific image features and suppresses background noise by utilizing a dual attention mechanism. It also reduces the semantic gap between the feature maps generated by the encoder and decoder using a feature optimization head, compensating for the lack of image-specific inductive bias in the pure Transformer architecture. This enhances the ability to differentiate islands and reefs from complex marine backgrounds (seawater, clouds, reefs), effectively solving the problem of existing methods struggling to accurately identify island features under strong noise interference. The specific execution process includes:
[0082] Step S1: Acquire the original satellite remote sensing image of the island, and obtain a remote sensing image of the island and reef centered on the island and reef through cropping operations; specifically including:
[0083] Step S1.1: Use the Copernicus Browser remote sensing data acquisition platform to download multispectral satellite remote sensing images covering the target sea area (in this embodiment, Sentinel-2 satellite images are used).
[0084] Step S1.2: Locate the center position of the island and reef based on the geographic information coordinates, set a rectangular window of fixed size for spatial cropping, remove large areas of meaningless background sea area, and retain only the image containing the complete island body and its surrounding adjacent sea area as the research benchmark.
[0085] Step S2: Manually annotate the remote sensing images of islands and reefs to generate binary labels for islands / background; specifically including:
[0086] Step S2.1: Using remote sensing image processing software (such as ENVI or ArcGIS), and referring to high-resolution historical images and coastline maps, manually delineate the islands and reefs in the images pixel by pixel.
[0087] Step S2.2: The annotation results are converted into a single-channel binary mask image, where the pixel value of the island and reef area is set to 1 (or 255), and the pixel value of the ocean background area is set to 0.
[0088] Step S3: Crop the labels into 256×256 pixel image patches using a sliding window method to construct the sample dataset; specifically including:
[0089] Step S3.1: Set the sliding window size to 256×256 pixels, and the step size to be the same as the window size (or set a certain overlap ratio to increase sample diversity), and simultaneously perform block cropping on the original image and its corresponding binary label.
[0090] Step S3.2: Remove pure background image blocks that do not contain any island or reef pixels. Finally, align the remaining image blocks with the label blocks one by one to form the initial sample dataset.
[0091] Step S4: Divide the sample dataset into a training set and a test set in an 8:2 ratio; specifically including:
[0092] A random partitioning method was used to extract 80% of the data from the sample dataset as the training set for iterative updates of the model parameters; the remaining 20% of the data was used as the test set to evaluate the generalization performance and accuracy of the island extraction after the model was trained.
[0093] Step S5: Perform various data augmentation processes on the training set to obtain a training set of processed images; specifically including:
[0094] To improve the model's stability against complex lighting, angles, and sea conditions, enhancement operations (such as geometric transformations, including horizontal flipping, vertical flipping, and rotation at random angles) were performed simultaneously on the image patches and label patches in the training set.
[0095] Step S6: Construct the TransUNet-DAFRH island segmentation model that integrates dual attention mechanism and feature optimization head;
[0096] The TransUNet-DAFRH island segmentation model includes a CNN encoder, a Transformer encoder, a dual attention module, three feature optimization heads, a composite loss function, and a decoder.
[0097] The process of constructing the TransUNet-DAFRH island segmentation model that integrates dual attention mechanism and feature optimization head includes:
[0098] Step S6.1: Input the training set images of the sample dataset processed in Step S5 into the CNN encoder of the TransUNet-DAFRH island segmentation model in batches (used to capture local spatial features of the image (such as the edges of broken coastlines, island and reef texture details, etc.) using the inductive bias of the convolutional kernel) to extract image feature maps; such as Figure 2 As shown, the specific process includes:
[0099] The CNN encoder utilizes a pre-trained ResNet50 network as its backbone, performing layer-by-layer feature abstraction on the input image through three stages of residual block and pooling downsampling operations. At each stage, convolutional operations continuously compress the spatial dimension and increase the channel dimension, ultimately yielding three CNN feature maps with different resolutions and semantic depths.
[0100] ;
[0101] in, This indicates the stage index (or downsampling level) for feature extraction. With... As the value increases, the resolution of the feature map decreases exponentially by powers of 2, representing the evolution from shallow spatial details to deep abstract semantics. H and W represent the height and width of the input feature map, respectively. This represents the number of channels in the feature maps at different levels. It indicates the dimension of the feature attributes that the model can extract at different depths; the more channels, the richer the high-dimensional semantic information captured by the model.
[0102] Step S6.2: The feature map obtained in step S6.1 is then introduced into the dual attention module to capture the positional and channel dependencies of a specific image; such as... Figure 3 As shown, the specific process includes:
[0103] The dual attention module includes a positional attention module (PAM) and a channel attention module (CAM).
[0104] Step S6.2.1: Use the positional attention module to capture specific positional features of the image;
[0105] The position attention module first receives the local feature map A. Where C, H, and W represent the number of channels, height, and width, respectively. Then, feature map A is passed through a convolutional layer to generate three new feature maps B, C, and D, each with a size of [size missing]. Subsequently, B and C were reshaped into Where N = H × W represents the total number of pixels. Matrix multiplication is performed between the transposes of C and B, followed by a softmax operation to obtain the spatial attention map S. :
[0106] ;
[0107] in: This represents the influence of the i-th position on the j-th position.
[0108] Next, feature map D is reshaped into Then, perform matrix multiplication between the transposes of D and S, and reshape the resulting matrix back to its original state. Finally, the result is scaled by a learnable parameter α and added element-wise to the original feature map A to produce the final output E. :
[0109] ;
[0110] Step S6.2.2: Capture specific channel features of the image using the channel attention module;
[0111] The channel attention module focuses on capturing channel features. Unlike the position attention module, the original feature A... arrive Then, matrix multiplication is performed between A and its transpose. Subsequently, a softmax layer is applied to obtain the channel attention map. :
[0112] ;
[0113] in, This represents the influence of the i-th channel on the j-th channel. Subsequently, matrix multiplication is performed between the transposes of X and A, and the resulting matrix is reshaped back. The result is then scaled using a learnable parameter β and added element-wise to the original feature map A to produce the final output E. :
[0114] .
[0115] Step S6.3: Finally, connect the Transformer layer to perform global feature modeling; such as... Figure 2 As shown, the specific process includes:
[0116] Step S6.3.1: Perform linear projection on the feature map enhanced by the dual attention module in step S6.2 to convert the two-dimensional feature map into a one-dimensional feature sequence.
[0117] Step S6.3.2: Within each Transformer layer (used to establish global contextual relationships based on the features extracted by the CNN through a self-attention mechanism, solving the long-distance dependency problem that the CNN struggles to handle due to its limited receptive field), the feature sequence first undergoes layer normalization and multi-head self-attention mechanism processing to calculate global semantic dependencies, and is then superimposed on the input through residual connections; subsequently, the output is again processed by layer normalization and multilayer perceptron, and features are fused again through residual connections.
[0118] Step S6.3.3: Reshape the feature sequence after processing by all Transformer layers to restore it to a feature map with spatial dimensions, which will be used as the final output feature of the encoder.
[0119] Step S6.4: In the decoding stage, features from the encoder are received via skip connections, and a feature optimization head is introduced to fuse and refine the encoder and decoder features to reduce semantic gaps and enhance boundary reconstruction capabilities; for example... Figure 4 As shown, the specific process includes:
[0120] Step S6.4.1: First, process the feature map generated by the encoder. and the feature map generated by the decoder We perform a weighted summation to obtain the fusion characteristics. Where α is the weighting parameter:
[0121] ;
[0122] Step S6.4.2: Merge features Two parallel channel branches are input to enhance feature representations in both the channel and spatial dimensions. The channel branches apply a global average pooling layer to generate channel attention maps C. , where c represents the number of channels. The "shrink and expand" operation consists of two 1×1 convolutional layers, first compressing the channel size by a factor of 4, and then restoring it to its original size. Simultaneously, the spatial branch uses depthwise convolution to generate a spatial attention map S. Here, h and w correspond to the height and width of the feature map, respectively. The attention maps from the two branches are then fused using element-wise addition. Finally, a 1×1 convolutional layer and upsampling are applied to produce the final segmentation output. Residual connections are also incorporated to mitigate network degradation and stabilize training.
[0123] It should be noted that in this embodiment, the dual attention module fully utilizes the image-specific positional and channel dependencies. It primarily uses parallel positional attention (PAM) and channel attention (CAM) modules to calculate spatial and channel self-attention matrices respectively, generating weighted feature representations containing global contextual information. These are then combined with learnable scaling parameters and residual connections to preserve the original feature information. The Feature Optimization Head (FRH), located at the Skip Connection, fully leverages the complementarity between encoder spatial details and decoder semantic information (fusion of encoder and decoder features). It primarily generates multi-dimensional feature refinement weights through weighted summation preprocessing and parallel channel and spatial attention branches, and incorporates residual connections to prevent network degradation.
[0124] Step S6.5: Calculate the error between the predicted result and the true label using a composite loss function, and update the network parameters through backpropagation; the composite loss function consists of binary cross-entropy loss (BCE Loss) and Dice loss (Dice Loss). The specific process includes:
[0125] Step S6.5.1: Calculate the binary cross-entropy loss This is used to measure pixel-level classification accuracy.
[0126] ;
[0127] in: This indicates the number of pixels in the segmentation image. This represents the label of the i-th pixel. This represents the predicted mask for the i-th pixel.
[0128] Step S6.5.2: Calculate Dice loss This is used to measure the degree of overlap between the predicted region and the real region, in order to alleviate the problem of imbalance between positive and negative samples.
[0129] ;
[0130] Where G and P represent the ground truth image and the predicted image, respectively. The parameter α is optional and is used to prevent division by zero and reduce overfitting. In this work, α is set to 0.00001.
[0131] Step S6.5.3: Add the binary cross-entropy loss to the Dice loss to obtain the final total loss function. Used to guide model optimization:
[0132] .
[0133] Step S7: Train the TransUNet-DAFRH island segmentation model using the training set, evaluate its performance based on the test set, and finally perform visualization analysis and quantitative evaluation of the model's prediction results.
[0134] Step S8: Use the trained TransUNet-DAFRH island segmentation model to extract islands with high quality.
[0135] Example 2:
[0136] Unlike Embodiment 1 above, in order to verify the effectiveness of the method described in Embodiment 1, this embodiment uses the test set of Embodiment 1 as input data and compares the TransUNet-DAFRH island segmentation model established in Embodiment 1 with mainstream models (including UNet, DeepLabv3, PSPNet, DANet, SegFormer and Swin-Transformer) to illustrate the advantages of the TransUNet-DAFRH island segmentation model established in this invention.
[0137] Step S7.1: Compare the method described in Embodiment 1 of this invention with six mainstream network models—UNet, Deeplabv3, PSPNet, DANet, Segformer, and SwinT—on the test set. The evaluation metrics are Intersection over Union (IoU), Precision (the proportion of instances predicted as positive by the model that are actually positive, reflecting the reliability of the model's positive predictions; values range from 0 to 1), Recall (measuring the proportion of instances correctly identified by the model among all actual positive instances, reflecting the model's sensitivity to positive examples; values range from 0 to 1), and F1-score (the harmonic average of precision and recall, values range from 0 to 1). The comparison results are shown in Table 1.
[0138] Table 1: Comparison of the results of the method described in Embodiment 1 of the present invention with other mainstream network models on the test set.
[0139] Methods Precision (%) Recall (%) IoU (%) F1-score UNet 95.42 96.13 91.89 0.9578 Deeplabv3 96.44 96.63 93.30 0.9653 PSPNet 96.63 96.19 93.07 0.9641 DANet 96.90 96.36 93.48 0.9663 Segformer 96.71 96.22 93.17 0.9647 SwinT 96.39 97.12 93.72 0.9676 TransUNet-DAFRH 97.32 97.17 94.64 0.9724
[0140] As can be seen from Table 1, the TransUNet-DAFRH island segmentation model described in Embodiment 1 of the present invention outperforms the existing mainstream network models such as UNet, Deeplabv3, PSPNet, DANet, Segformer, and SwinT in terms of Intersection over Union (IoU), Precision, and Recall.
[0141] Step S7.2: Compare the method described in Embodiment 1 of this invention with six mainstream network models—UNet, Deeplabv3, PSPNet, DANet, Segformer, and SwinT—on a test set. Figure 5 As shown. (Through) Figure 5 The results show that the island remote sensing extraction method based on attention mechanism and feature optimization proposed in this invention has higher accuracy than other methods on the island remote sensing data test set.
[0142] Step S7.3: To verify the robustness of the island extraction model TransUNet-DAFRH of the present invention, the method described in Embodiment 1 of the present invention and six mainstream network models—UNet, Deeplabv3, PSPNet, DANet, Segformer, and SwinT—are compared on other types of island remote sensing images. Figure 6 As shown. (Through) Figure 6 The results show that the island remote sensing extraction method based on attention mechanism and feature optimization proposed in this invention has higher accuracy in processing island remote sensing images than other methods.
[0143] Step S7.4: Compare the method described in Embodiment 1 of this invention with five mainstream network models—Deeplabv3, PSPNet, DANet, Segformer, and SwinT—on Sentinel-2 remote sensing images of Bisheng Reef and Nanhua Reef. The results are as follows: Figure 7 and Figure 8 As shown. (Through) Figure 7 and Figure 8 As can be seen, the method described in Embodiment 1 of the present invention can effectively preserve the natural morphology of the broken coastline in both Bisheng and Nanhua Reef areas, while reducing misclassification and underclassification within the islands, demonstrating superior robustness and accuracy compared to other models.
[0144] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A remote sensing method for island extraction based on attention mechanism and feature optimization, characterized in that, include: Step S1: Acquire the original satellite remote sensing image of the island and obtain the island and reef remote sensing image centered on the island and reef through cropping operations; Step S2: Manually annotate the remote sensing images of the islands to generate binary labels for islands / background; Step S3: Crop the labels into image patches using a sliding window method to construct the sample dataset; Step S4: Divide the sample dataset into a training set and a test set; Step S5: Perform various data augmentation processes on the training set to obtain the training set of processed images; Step S6: Construct the TransUNet-DAFRH island segmentation model that integrates dual attention mechanism and feature optimization head; The TransUNet-DAFRH island segmentation model includes a dual attention module and a feature optimization head. The dual attention module calculates spatial and channel self-attention matrices through parallel positional attention and channel attention modules, respectively, to generate a weighted feature representation containing global context information. It also retains the original feature information by combining learnable scaling parameters and residual connections. The feature optimization head is located at the skip connection position. Its input is the fusion of encoder and decoder features. Through weighted summation preprocessing and parallel channel and spatial attention branches, it generates multi-dimensional feature refinement weights and combines residual connections to prevent network degradation. Step S7: Train the TransUNet-DAFRH island segmentation model using the training set, evaluate its performance based on the test set, and finally perform visualization analysis and quantitative evaluation of the model's prediction results. Step S8: Use the trained TransUNet-DAFRH island segmentation model to extract islands with high quality.
2. The island remote sensing extraction method based on attention mechanism and feature optimization as described in claim 1, characterized in that, Step S6 describes the construction process of the TransUNet-DAFRH island segmentation model, which includes: Step S6.1: Input the training set images of the sample dataset processed in step S5 into the CNN encoder of the TransUNet-DAFRH island segmentation model in batches to extract image feature maps; Step S6.2: The feature map obtained in step S6.1 is then introduced into the dual attention module to capture the position and channel dependencies of a specific image; Step S6.3: Finally, connect the Transformer layer to perform global feature modeling; Step S6.4: In the decoding stage, the features of the encoder are received through skip connections, and a feature optimization head is introduced to fuse and refine the encoder features and decoder features; Step S6.5: Calculate the error between the predicted result and the true label using the composite loss function, and update the network parameters through backpropagation.
3. The island remote sensing extraction method based on attention mechanism and feature optimization as described in claim 2, characterized in that, Step S6.1, which involves inputting the training set images of the sample dataset into the CNN encoder of the TransUNet-DAFRH island segmentation model in batches to extract image feature maps, includes: The CNN encoder utilizes a pre-trained ResNet50 network to obtain three CNN features with spatial local information through three stages of residual block and pooling downsampling: ; in, H and W represent the height and width of the input feature map, respectively. .
4. The island remote sensing extraction method based on attention mechanism and feature optimization as described in claim 2, characterized in that, The dual attention module includes a positional attention module and a channel attention module. Step S6.2 introduces the feature map obtained in step S6.1 into the dual attention module. The process of capturing the positional and channel dependencies of a specific image includes: Step S6.2.1: Use the positional attention module to capture specific positional features of the image; Step S6.2.2: Use the channel attention module to capture specific channel features of the image.
5. The island remote sensing extraction method based on attention mechanism and feature optimization as described in claim 4, characterized in that, Step S6.2.1, the process of capturing specific positional features of an image using the positional attention module, includes: The position attention module first receives the local feature map A. Where C, H, and W represent the number of channels, height, and width, respectively; then feature map A is passed through a convolutional layer to generate three new feature maps B, C, and D, each feature map having a size of [missing value]. Subsequently, B and C were reshaped into Where N = H × W represents the total number of pixels; matrix multiplication is performed between the transposes of C and B, followed by a softmax operation to obtain the spatial attention map S. : ; in: This represents the influence of the i-th position on the j-th position; Next, feature map D is reshaped into Then, perform matrix multiplication between the transposes of D and S, and reshape the resulting matrix back to its original state. Finally, the result is scaled using a learnable parameter α and added element-wise to the original feature map A to produce the final output E. : 。 6. The island remote sensing extraction method based on attention mechanism and feature optimization as described in claim 4, characterized in that, Step S6.2.2, the process of capturing specific channel features of an image using the channel attention module, includes: The channel attention module first receives local feature map A. arrive Then, matrix multiplication is performed between A and its transpose; subsequently, a softmax layer is applied to obtain the channel attention map. : ; in, This represents the influence of the i-th channel on the j-th channel; Subsequently, matrix multiplication is performed between the transposes of X and A, and the resulting matrix is reshaped back. The result is then scaled using a learnable parameter β and added element-wise to the original feature map A to produce the final output E. : 。 7. The island remote sensing extraction method based on attention mechanism and feature optimization as described in claim 2, characterized in that, Step S6.3, the process of connecting the Transformer layer for global feature modeling, includes: Step S6.3.1: Perform linear projection on the feature map enhanced by the dual attention module in step S6.2 to convert the two-dimensional feature map into a one-dimensional feature sequence; Step S6.3.2: Within each Transformer layer, the feature sequence is first processed by layer normalization and multi-head self-attention mechanism to calculate global semantic dependencies, and then superimposed with the input through residual connections; subsequently, the output is processed by layer normalization and multilayer perceptron again, and then feature fusion is performed again through residual connections. Step S6.3.3: Restore the feature sequence after processing by all Transformer layers into a feature map with spatial dimensions through a reshaping operation, which will serve as the final output feature of the encoder.
8. The island remote sensing extraction method based on attention mechanism and feature optimization as described in claim 2, characterized in that, Step S6.4, which involves receiving encoder features via skip connections and introducing a feature optimization head to fuse and refine encoder and decoder features, includes: Step S6.4.1: First, process the feature map generated by the encoder. and the feature map generated by the decoder We perform a weighted summation to obtain the fusion characteristics. Where α is the weighting parameter: ; Step S6.4.2: Merge features Input two parallel channel branches to enhance feature representations in both channel and spatial dimensions.
9. The island remote sensing extraction method based on attention mechanism and feature optimization as described in claim 2, characterized in that, The composite loss function described in step S6.5 consists of binary cross-entropy loss. and Dice loss composition; ; in: This indicates the number of pixels in the segmentation image. This represents the label of the i-th pixel. This represents the predicted mask for the i-th pixel; ; Where: G and P represent the ground truth image and the predicted image, respectively; α is a parameter; Total loss function The sum of the binary cross-entropy loss and the Dice loss: 。 10. The TransUNet-DAFRH island segmentation model, characterized in that, include: CNN encoders are used to extract local features; The dual attention module, electrically connected to the output of the CNN encoder, includes parallel PAM and CAM sub-modules for capturing the positional and channel dependencies of a specific image. The feature optimization head is used to perform multi-dimensional correction on the fused features by utilizing internal parallel spatial and channel branches. The composite loss function is used to calculate the error between the predicted result and the true label, and to update the network parameters through backpropagation; The decoder receives the feature representation output by the encoder and transforms it into the target output form that meets the task requirements through inverse transformation, feature reconstruction and optimization. The CNN encoder, dual attention module, feature optimization head, composite loss function, and decoder described above are all established based on the steps of the method as described in any one of claims 1-9.