A remote sensing image segmentation method based on dual-branch multi-scale feature fusion
Through the dual-branch multi-scale feature fusion network, combined with CNN and Transformer encoder, the problem of difficulty in processing different scale features and high computational complexity in remote sensing image segmentation is solved, and high-precision and stable image segmentation results are achieved.
Patent Information
- Application Number
- CN202410740970.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-06-11
AI Technical Summary
Existing remote sensing image segmentation methods cannot effectively handle features of different scales, have high computational complexity and inaccurate or unstable segmentation results.
A dual-branch multi-scale feature fusion network is used, combined with CNN and Transformer encoder, to extract and fuse local and global features of high-resolution remote sensing images through the multi-scale feature fusion module and detail preservation module, and is optimized using Dice coefficient and cross-entropy loss function. model, reducing computational complexity and improving segmentation accuracy.
It is possible to improve the accuracy and stability of remote sensing image segmentation without increasing calculation and memory consumption, reduce the uncertainty of image segmentation results, and improve the generalization ability of the model.
Smart Images

Figure CN118314353B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of remote sensing image processing, and in particular to a remote sensing image segmentation method based on dual-branch multi-scale feature fusion. Background Art
[0002] Semantic segmentation, also known as object recognition in remote sensing, is an intensive prediction task that requires first classifying the pixels in the remote sensing image and then corresponding to different categories of objects. Remote sensing images usually have a large geographical area and a variety of object types, which leads to the existence of multi-scale and relatively complex texture information of objects in the image. Due to the interference of irrelevant areas of the scene and the complexity of the spatial distribution of objects, there is a problem of inter-class similarity in remote sensing images, that is, some different scenes show similar features, and there is a problem of large intra-class differences. There are differences in scenes of the same category, making it difficult to accurately separate the boundaries of these objects.
[0003] The Chinese patent publication number is "CN117808826A", and its name is "Directional remote sensing image segmentation method based on multi-scale feature interaction and adaptive rotation dynamic convolution". This method first uses pre-trained language model and visual model to obtain language features and visual features; then models multi-scale local features; then fuses visual features based on multi-scale information of different granularities; uses dynamic convolution method to predict segmentation mask; and proposes remote sensing image segmentation data labeled using semi-automatic method.
[0004] The remote sensing image segmentation achieved by this method cannot effectively process land features of different scales, has high computational complexity, and has problems such as inaccurate or unstable image segmentation results. Summary of the invention
[0005] In view of the shortcomings of the existing technology, the present invention provides a remote sensing image segmentation method based on dual-branch multi-scale feature fusion, which solves the problems that the existing remote sensing image segmentation cannot effectively process the features of objects of different scales, achieve accurate segmentation without consuming a lot of calculations and memory, and has unstable image segmentation results.
[0006] In order to achieve the above-mentioned purpose, the present invention specifically adopts the following technical solutions:
[0007] A remote sensing image segmentation method based on dual-branch multi-scale feature fusion includes the following steps:
[0008] Step 1, build the network model: the entire dual-branch multi-scale feature fusion network consists of a dual encoder-decoder. The encoder part uses ResNet50 as the backbone of multi-scale feature extraction, including stacked residual module, feature enhancement module, detail preservation module, pyramid pooling downsampling module and feature fusion module; the decoder part includes convolution upsampling module, multi-scale attention module, multi-head attention module, batch normalization module;
[0009] Step 2, prepare the dataset: This method uses the Potsdam urban scene dataset consisting of 38 high-resolution images and the Vaihingen small village dataset consisting of independent multi-story buildings and small multi-story buildings, and randomly crops the images into 512 × 512 blocks, and uses enhancement techniques such as random vertical flipping, random horizontal flipping, and random rotation to expand the dataset;
[0010] Step 3, training the network model: training the remote sensing image segmentation network model, inputting the preprocessed data set in step 2 into the network model constructed in step 1 for training, and obtaining the training weights;
[0011] Step 4: Select a suitable loss function and determine the optimal evaluation index of this segmentation method: the main loss is a combination of Dice coefficient loss and cross entropy loss, and the auxiliary loss is cross entropy loss; then set the training loss threshold, and continuously iterate and optimize the model until the number of training times reaches the set threshold or the value of the loss function reaches the set threshold range. The model parameters can be considered to have been pre-trained, the model parameters are saved, and the optimal evaluation index for remote sensing image segmentation effect is selected to measure the model segmentation accuracy and segmentation performance;
[0012] Step 5, determine the segmentation model: design a new remote sensing semantic segmentation model, which consists of a dual encoder structure, consisting of a CNN-based main encoder and a Transformer-based auxiliary encoder, to capture and fuse global and local contexts, and a dual encoder-decoder architecture to achieve efficient search of long-range features and more accurate capture of multi-scale targets.
[0013] Furthermore, the dual encoder of the encoder path in the step 1 is composed of a CNN main encoder, a transformer-based auxiliary encoder and a multi-scale feature fusion module. The CNN main encoder specifically includes four residual blocks, four activation functions, and three pooling modules; the transformer auxiliary encoder specifically includes multi-head self-attention (MSA), a multi-layer perceptron (MLP) and layer normalization (LN); the multi-scale feature fusion module specifically includes global average pooling, ReLu activation function, Sigmoid activation function, depth-separable convolution block, convolution block, and residual block.
[0014] Furthermore, in the step 1, residual block 1, residual block 2, residual block 3, and residual block 4 in the CNN branch are used to extract shallow feature information; the Transformer structure combines the features extracted at different stages, and places a detail preservation module before entering the Transformer block, which helps the model to extract richer feature representations while retaining the details of the original image. A spatial feature enhancement module is introduced after the Transformer encoder, and contextual information of different spatial dimensions is collected through pooling convolution operations in the horizontal and vertical directions. The multi-scale feature fusion module is used to inject the multi-scale information of the transformer branch into the CNN feature map; the pooling downsampling module is unified into maximum pooling.
[0015] Furthermore, the four decoders of the decoder path in step 1 are composed of a batch normalization module, a multi-head attention module, a residual module, and a multi-scale attention module; the multi-scale attention module uses operations such as pooling, upsampling or convolution to fuse features of different scales, and the multi-head attention module is responsible for fusing information from different subspaces to capture the correlation between the input sequence and the target sequence. Each decoder layer contains a residual connection, and the input of the decoder layer is normalized through a batch normalization operation; the input image generates rich feature information after passing through the dual-branch encoder path, and then after passing through the decoder path, the final high-precision segmentation image is obtained.
[0016] Furthermore, in the step 4, the cross entropy loss function in the main loss function of the entire network training process is to construct the final loss value by averaging the output probability distribution of the model and the probability distribution of the true label, and train the model together with the gradient descent optimization algorithm by minimizing the cross entropy loss; the Dice coefficient loss function is based on the Dice coefficient to predict the ratio of the intersection of the region and the true region to their average size, and measures the degree of overlap between the segmentation result predicted by the model and the true segmentation; the auxiliary loss uses the cross entropy loss to optimize the Transformer block, and the multi-head design of the main loss and the auxiliary loss is used to train the entire network.
[0017] Furthermore, in the step 4, two types of evaluation indicators are used to judge the quality of the segmentation model during the entire dual-branch network training process. One is the overall accuracy (OA), average F1 score (F1) and mean intersection over Union (mIoU) to evaluate the accuracy of the network; the other is the floating point operation count (Flops) to evaluate the complexity, the frames per second (FPS) to evaluate the speed, the memory usage (MB) and the number of model parameters (M) to evaluate the memory requirements to evaluate the scale of the network.
[0018] Compared with the prior art, the present invention provides a remote sensing image segmentation method based on dual-branch multi-scale feature fusion, which has the following beneficial effects:
[0019] The present invention adopts a dual-branch multi-scale fusion network, and replaces the encoder module in the original encoding-decoding network with two parallel branches of CNN and Transformer. CNN and Transformer respectively extract local features and global features at different resolutions to extract multi-scale feature maps, efficiently extract and fuse local information and multi-scale global context information of high-resolution remote sensing images, so that the global-local information is fully integrated.
[0020] The present invention uses a detail structure preservation module to mitigate the loss of detail and structure information caused by Transformer downsampling; and introduces a spatial feature enhancement module to collect contextual information of different spatial dimensions. Compared with the existing preservation module and feature enhancement module methods, this method further improves the network's ability to extract image feature detail information and avoids the loss of detail information.
[0021] The present invention introduces a multi-scale information fusion module on the encoder output path. The output sequence of the encoder is reshaped into a feature map according to the size of each scale, so that the CNN branch and the Transformer branch can interact with each other and be aligned and fused in the feature space, effectively improving the performance and generalization ability of the dual-branch multi-scale remote sensing image model. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 This is a flow chart of a multi-scale remote sensing image segmentation method based on a dual-branch network;
[0023] Figure 2 is a network structure diagram of a multi-scale remote sensing image segmentation method based on a dual-branch network;
[0024] Figure 3 The overall structural diagram of the module is reserved for the details of the present invention;
[0025] Figure 4 It is the overall structure diagram of the feature enhancement module of the present invention;
[0026] Figure 5 This is a structural diagram of the multi-scale feature fusion module of the present invention. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0028] Example 1. Figure 1-5 As shown, an embodiment of the present invention proposes a remote sensing image segmentation method based on dual-branch multi-scale feature fusion, and the method specifically includes the following steps:
[0029] Step 1: Build a network model. The entire dual-branch multi-scale network consists of an encoder-decoder. The encoder module that introduces the CNN branch and the Transformer branch in parallel is used. The output is then matched by the multi-scale feature fusion module to dimensionally match features of different resolutions and semantic levels. At the same time, a detail preservation module is placed before the Transformer block, and a spatial feature enhancement module is introduced after the Transformer encoder, so that the model can extract richer feature representations while retaining the details of the original image, and then the matched feature information is connected to the decoder path. The encoder CNN path includes four residual blocks, four activation functions, and three pooling modules. The CNN branch extracts local feature information of different scales of the image by gradually increasing the receptive field size, multi-layer convolution and pooling operations; the encoder Transformer path includes an attention module, a linear transformation, a GELU activation function, a multi-layer perceptron, and a layer normalization module. The self-attention mechanism calculates the attention distribution of each position in the input sequence to capture the long-range dependencies within the sequence, and calculates the attention weights of multiple attention heads in parallel through multi-head attention. The training of the model is simplified through residual connections, and finally layer normalization is applied to the output of each sub-layer to achieve global information modeling and learn global feature representations of different scales; the detail preservation module introduced before the encoder Transformer path collects long-range context information in two spatial dimensions through striped convolution, and adds ReLU activation functions and residual connections to optimize the module to reduce computational complexity; the spatial feature enhancement module introduced after the encoder Transformer path superimposes feature maps through ReLU activation functions, combines them with the original feature maps using residual connections, and finally reshapes them into vector form. The decoder Transformer path includes a multi-head self-attention mechanism, a feedforward neural network, and a multi-scale attention mechanism. First, the input sequence is converted into a query, key, and value vector through a linear transformation. Then, the dot product of the query and all keys is softmax normalized to obtain the attention weight. The attention weight and the value are operated to obtain the final output representation. The multi-scale context is adjusted to the size of each pooling scale, and finally it is upsampled to 1 / 8 of the original image and concatenated as the output.
[0030] Step 2, prepare the dataset. The pre-training dataset uses the Potsdam urban scene dataset consisting of 38 high-resolution images and the Vaihingen small village dataset consisting of independent multi-story buildings and small multi-story buildings. The images are randomly cropped into 512 × 512 blocks, and the dataset is expanded using enhancement techniques such as random vertical flipping, random horizontal flipping, and random rotation. The pre-processed images are input into the training network.
[0031] Step 3: Train the network model. Train the remote sensing image segmentation network model, input the preprocessed data set in step 2 into the network model built in step 1 for training, obtain the training weights, further segment the remote sensing image, and obtain the segmentation results.
[0032] Step 4, select a suitable loss function and determine the optimal evaluation index of this segmentation method. The main loss is a combination of Dice coefficient loss and cross entropy loss, and the auxiliary loss is cross entropy loss. In order to better combine with the main loss, the auxiliary loss is further multiplied by the factor α, and then the training loss threshold is set. The model is continuously iterated and optimized until the number of training times reaches the set threshold or the value of the loss function reaches the set threshold range. The model parameters are considered to have been pre-trained, and the model parameters are saved. The accuracy and segmentation precision of the segmentation are taken into account by combining the main loss and the auxiliary loss; the optimal evaluation index for the segmentation effect of remote sensing images is selected to measure the segmentation precision and segmentation performance of the model. Two types of evaluation indicators are used in the training process to judge the quality of the segmentation model. One is the overall accuracy (OA), the average F1 score (F1) and the mean intersection over Union (mIoU) to evaluate the accuracy of the network; the other is the floating point operation count (Flops) to evaluate the complexity, the frames per second (FPS) to evaluate the speed, the memory usage (MB) and the number of model parameters (M) to evaluate the memory requirements to evaluate the scale of the network.
[0033] Step 5: Determine the segmentation model. Load the pre-trained model, solidify the network model parameters, accelerate model convergence, determine the final segmentation model, and evaluate the entire model to ensure its segmentation performance. If performing remote sensing image segmentation, the trained network model can be directly input into the segmentation model to obtain the final dual-branch multi-scale remote sensing segmentation image.
[0034] Embodiment 2. The dual-branch multi-scale remote sensing image network model structure in step 1 is as follows Figure 2 As shown in the figure. The entire dual-branch network adopts an encoder-decoder structure. The encoder part is divided into the main encoder of CNN and the auxiliary encoder of Transformer. The main encoder of CNN specifically includes four residual blocks, four activation functions, and three pooling modules. The auxiliary encoder of Transformer specifically includes multi-head self-attention (MSA), multi-layer perceptron (MLP) and layer normalization (LN); the multi-scale feature fusion module specifically includes global average pooling, ReLu6 activation function, Sigmoid activation function, depth-separable convolution block, convolution block, residual block; the decoder part includes batch normalization module, attention module, and residual module.
[0035] Given an image x∈RH×W×C, it is fed into the main encoder of CNN and the auxiliary encoder based on Transformer, where H represents the image height, W represents the image width, and C represents the number of image channels. In the Transformer-based encoder, a detail-preserving module is placed before entering the Transformer block. This module stacks the depth-separable convolution and 1 × 1 convolution layers together through the GELU activation function, and combines them with the original feature map using residual connections. The overall structure of the detail-preserving module is as follows: Figure 3 As shown in Figure 1, the spatial feature enhancement module is placed after entering the Transformer block. The module consists of strip convolutions, that is, pooling convolution operations are performed in the horizontal and vertical directions. The module is optimized by adding ReLU activation functions and residual connections to collect contextual information from different spatial dimensions. The overall structure of the feature enhancement module is shown in Figure 1. Figure 4 As shown in Figure 2, we output the four auxiliary encoders with dimensions F∈RH / 32×W / 32×1024 and feed them into the ResNet50 network. We use a multi-scale feature fusion module to fuse the features of the main encoder and the auxiliary encoder and output them to the decoder. The structure of the multi-scale feature fusion module is shown in Figure 2. Figure 5 As shown in the figure, a four-layer encoding module is used in the encoding stage, and no pooling downsampling module is added. Experiments show that after four downsamplings, the image size has become very small. If downsampling is performed again, too much image information will be lost.
[0036] The operations inside the encoder-decoder block of Transformer can be expressed as follows:
[0037]
[0038]
[0039] The vector t∈RN×D, where D is a constant vector size in all layers of the Transformer.
[0040] Where LN represents the LayerNorm function. The calculations included in the MSA unit are:
[0041]
[0042] Where q, k, v∈RN×D / n are the three mappings of LN(t), A∈RN×N is the attention matrix, and n is the number of attention heads in MSA.
[0043] The detail-preserving module introduced before the encoder block of the Transformer first reshapes the vector into a feature map form, then feeds the feature map to a 3 × 3 depth-separable convolution and a 1 × 1 convolution layer, superimposes the feature maps together through the RELU activation function, combines them with the original feature map using a residual connection, and finally reshapes them into a vector form. The mathematical representation is as follows:
[0044] out = ReLU(DSConv(x))⊕ReLU(Conv(x))⊕x
[0045] where ⊕ represents element-wise addition.
[0046] The feature enhancement module introduced before the encoder block of Transformer first optimizes the model by adding ReLU activation function and residual connection to reduce computational complexity and alleviate the gradient vanishing problem. A 1×1 convolution is used to extract strip information from the given input along the vertical and horizontal dimensions. , then perform pooling operations on the vertical and horizontal dimensions respectively, then perform convolution operations, and finally fuse the features of the two dimensions. This can be expressed mathematically as follows:
[0047]
[0048]
[0049] The multi-scale feature fusion module refines the features of each feature map in the two paths through 3 × 3 convolution and residual concatenation, normalizes the features using the BatchNorm module, and then selectively weights the two features according to their contribution to the segmentation accuracy through a weighted sum operation, thereby learning a more generalized fusion feature. The formula for the weighted sum operation can be expressed as:
[0050]
[0051] Among them, FF represents the fused features, CF represents the features generated by CNN, and TF represents the features generated by the Transformer block.
[0052] The Potsdam dataset in step 2 is a set of 38 high-resolution aerial images collected by an aircraft over the city of Potsdam, Germany. It contains high-resolution aerial images of 6 types of objects, including buildings, roads, trees, etc., and corresponding object classification labels. The image resolution is 5 cm / pixel. The images are captured in different seasons and weather conditions to cover various areas of the city and provide information in multiple bands (RGB, infrared, altitude, etc.). 19 of the 38 images are used for network training and 19 images are used for network testing; the Vaihingen dataset contains 16 high-resolution aerial images of 6 types of objects, including buildings, roads, trees, etc. The high-resolution aerial images are provided by the city of Stuttgart, Germany, and include five types of land features, including buildings, roads, trees, etc., as well as unlabeled background areas. They also include high-resolution aerial images and corresponding land feature classification labels, with an image resolution of 9 cm / pixel, and also provide images in multiple bands, such as RGB, infrared, and altitude. Image enhancement operations are performed on the images in the two data sets to improve image contrast, and then the two data sets are augmented by random data cropping, scaling, and rotation operations. Finally, each original image is cropped into a 512×512 resolution image as input.
[0053] The loss function in step 4 is designed to measure the similarity between the network prediction value and the label. The better the loss function is, the better the network performance will be. Based on the multi-head design, we use the main loss and auxiliary loss to train the entire network. Main loss is the cross entropy loss and Dice loss The auxiliary loss is the cross entropy loss, which can be expressed as:
[0054]
[0055]
[0056] +
[0057] Where N is the number of samples and K is the number of categories. and represents the encoding of the semantic label and its corresponding network softmax output, n∈[1,⋯n]. is the confidence of sample n of class k. We choose cross entropy loss as the auxiliary loss and construct a 3×3 convolution layer with batch normalization and ReLU, a 1×1 convolution layer, and an upsampling operation to produce the output. In order to better combine with the main loss, the auxiliary is multiplied by a factor Therefore, the total loss L can be expressed as:
[0058]
[0059] The default setting of α is 0.4.
[0060] The design of the main loss and auxiliary loss of remote sensing segmentation images calculates the gradient and updates the model parameters in each iteration, so that the prediction results match the true labels as accurately as possible. The pixel-level classification accuracy and the similarity of the segmented areas are jointly considered, so that the model can learn more accurate and robust segmentation results.
[0061] In step 4, two types of evaluation indicators are selected to judge the quality of the segmentation model. One is the overall accuracy (OA), average F1 score (F1) and mean intersection over union (mIoU) to evaluate the accuracy of the network; the other is the floating point operation count (Flops) to evaluate the complexity, the frames per second (FPS) to evaluate the speed, the memory usage (MB) and the number of model parameters (M) to evaluate the memory requirements to evaluate the size of the network. The overall accuracy (OA), average F1 score (F1) and mean intersection over union (mIoU) are defined as follows:
[0062]
[0063]
[0064]
[0065] in represents the number of correctly segmented foreground pixels, Indicates the number of background pixels that are incorrectly segmented as foreground pixels, represents the number of correctly segmented background pixels, represents the number of foreground pixels that are incorrectly segmented as background pixels; OA is the ratio of the number of correctly predicted pixels to the total number of pixels. In addition, we use floating-point operations per second (Flops) and the number of parameters (for processing 3 × 512 × 512 images) to evaluate the complexity of the model.
[0066] Optimize the network model, set the number of training times to 200, use the Adam optimizer, the learning rate is 0.001, the learning rate decay rate is multiplied by 0.1 for every 10 rounds of training, set the loss threshold to 0.0002, and continuously iterate the number of training times. When the training loss is infinitely close to the loss threshold, the network is considered to have been basically trained.
[0067] After the network training is completed in step 5, it is necessary to solidify all the trained parameters in the network and determine the final segmentation model. If a remote sensing image segmentation task is performed, the two data sets can be directly input into the trained end-to-end network model to obtain the final remote sensing segmentation image.
[0068] Among them, the implementation of convolution operations, activation functions, batch normalization and multi-layer perceptrons are algorithms well known to those skilled in the art, and the specific processes and methods can be found in corresponding textbooks or technical literature.
[0069] The present invention designs a multi-scale remote sensing image segmentation method based on a dual-branch network and applies it to the remote sensing image segmentation task, thereby realizing pixel classification and ground object correspondence in remote sensing pictures, better solving the segmentation problems caused by complex background, large intra-class variance and large scale change in remote sensing images, and improving the accuracy or stability of image segmentation.
[0070] Comparison of the evaluation indicators of the prior art and the method proposed in the present invention shows that the method proposed in the present invention has higher accuracy and smaller computation and network scale than the prior art, and in the test phase, the average segmentation time per image is only 0.98 seconds. These indicators further demonstrate that the method proposed in the present invention has better segmentation quality and achieves the expected effect.
[0071] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A remote sensing image segmentation method based on dual-branch multi-scale feature fusion, characterized in that: The steps include: Step 1, build the network model: the entire dual-branch multi-scale feature fusion network consists of a dual encoder-decoder. The encoder part uses ResNet50 as the backbone of multi-scale feature extraction, including stacked residual module, feature enhancement module, detail preservation module, pyramid pooling downsampling module and feature fusion module; the decoder part includes convolution upsampling module, multi-scale attention module, multi-head attention module, batch normalization module; The dual encoder of the encoder path in step 1 is composed of a CNN main encoder, a transformer-based auxiliary encoder, and a multi-scale feature fusion module. The CNN main encoder specifically includes four residual blocks, four activation functions, and three pooling modules; the transformer auxiliary encoder specifically includes multi-head self-attention, multi-layer perceptron, and layer normalization; the multi-scale feature fusion module specifically includes global average pooling, ReLu activation function, Sigmoid activation function, depth-separable convolution block, convolution block, and residual block; In the step 1, residual blocks 1, 2, 3 and 4 in the CNN branch are used to extract shallow feature information; the features extracted at different stages of the Transformer structure are combined, and a detail preservation module is placed before entering the Transformer block, which helps the model to extract richer feature representations while retaining the details of the original image. A spatial feature enhancement module is introduced after the Transformer encoder to collect context information of different spatial dimensions through pooling convolution operations in the horizontal and vertical directions. The multi-scale feature fusion module is used to inject the multi-scale information of the transformer branch into the CNN feature map; the pooling downsampling module is unified into the maximum pooling; The detail-preserving module introduced before the encoder block of the Transformer first reshapes the vector into a feature map form, then feeds the feature map to a 3 × 3 depthwise separable convolution and a 1 × 1 convolution layer, stacks the feature maps together through the RELU activation function, combines them with the original feature map using a residual connection, and finally reshapes them into a vector form, which can be mathematically represented as follows: out = ReLU(DSConv(x))⊕ReLU(Conv(x))⊕x Where ⊕ represents element-wise addition; The four decoders of the decoder path in step 1 are composed of a batch normalization module, a multi-head attention module, a residual module, and a multi-scale attention module; the multi-scale attention module uses pooling, upsampling or convolution operations to fuse features of different scales, and the multi-head attention module is responsible for fusing information from different subspaces to capture the correlation between the input sequence and the target sequence. Each decoder layer contains a residual connection, and the input of the decoder layer is normalized by a batch normalization operation; The input image generates rich feature information after passing through the dual-branch encoder path, and then passes through the decoder path to obtain the final high-precision segmentation image; Step 2, prepare the dataset: use the Potsdam urban scene dataset consisting of 38 high-resolution images, and the Vaihingen small village dataset consisting of independent multi-story buildings and small multi-story buildings, and randomly crop the images into 512 × 512 blocks, and use random vertical flip, random horizontal flip and random rotation enhancement techniques to expand the dataset; Step 3, training the network model: training the remote sensing image segmentation network model, inputting the preprocessed data set in step 2 into the network model constructed in step 1 for training, and obtaining the training weights; Step 4: Select a suitable loss function and determine the optimal evaluation index: the main loss is a combination of Dice coefficient loss and cross entropy loss, and the auxiliary loss is cross entropy loss; then set the training loss threshold, continuously iterate and optimize the model until the number of training times reaches the set threshold or the value of the loss function reaches the set threshold range, then the model parameters are considered to have been pre-trained, save the model parameters, and select the optimal evaluation index for remote sensing image segmentation effect to measure the model segmentation accuracy and segmentation performance; The cross entropy loss function in the main loss function of the entire network training process in step 4 is to construct the final loss value by averaging the output probability distribution of the model and the probability distribution of the true label, and train the model by minimizing the cross entropy loss together with the gradient descent optimization algorithm; the Dice coefficient loss function is based on the Dice coefficient to predict the ratio of the intersection of the region and the true region to their average size, and measures the overlap between the segmentation result predicted by the model and the true segmentation; the auxiliary loss uses the cross entropy loss to optimize the Transformer block, and uses the multi-head design of the main loss and the auxiliary loss to train the entire network; In the step 4, two types of evaluation indicators are used to judge the quality of the segmentation model during the entire dual-branch network training process. One is the overall accuracy, average F1 score and average intersection-over-union ratio to evaluate the accuracy of the network; the other is the floating-point operation count to evaluate the complexity, the frames per second to evaluate the speed, the memory usage and the number of model parameters to evaluate the memory requirements to evaluate the scale of the network; Step 5, determine the segmentation model: design a new remote sensing semantic segmentation model, which consists of a dual encoder structure, consisting of a CNN-based main encoder and a Transformer-based auxiliary encoder, to capture and fuse global and local contexts, and a dual encoder-decoder architecture to achieve efficient search of long-range features and more accurate capture of multi-scale targets.
Citation Information
Patent Citations
Directive remote sensing image segmentation method based on multi-scale feature interaction and adaptive rotation dynamic convolution
CN117808826A
Remote sensing image semantic segmentation method based on double-branch feature fusion
CN115797931A
Transform-based multi-stage underwater image enhancement method
CN116596788A
Remote sensing image segmentation method and system based on improved SwinTransform
CN117095168A
Cited By
A robust tampering localization method for remote sensing images based on segmentation-all-model (SAM)
CN120298404B
