A remote sensing image lake semantic segmentation method based on CA attention mechanism and light network
By introducing the CA attention mechanism into the ASPP module of the DeepLab v3+ model and using the lightweight MobileNetV2 network, the problems of inaccurate segmentation of small objects and high complexity of the model are solved, and efficient and accurate lake remote sensing image segmentation is achieved.
Patent Information
- Application Number
- CN202410591075.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-13
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2044-05-13
AI Technical Summary
The DeepLab v3+ model suffers from inaccurate segmentation when dealing with very small or elongated objects, especially in lake remote sensing images. Furthermore, the model is highly complex and requires significant computational resources.
The Coordinate Attention (CA) mechanism is introduced into the ASPP module of the DeepLab v3+ model, and the lightweight MobileNetV2 network is used to replace the Xception network to build the CA-DeepLab v3+ model, which enhances the understanding of spatial relationships and reduces model complexity.
It improves the semantic segmentation accuracy of lake remote sensing images, reduces the number of model parameters and computational complexity, and outperforms other mainstream models, especially when dealing with small water bodies and complex scenes.
Smart Images

Figure CN118505989B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, specifically to a method for semantic segmentation of lakes in remote sensing images based on the CA attention mechanism and a lightweight network. Background Technology
[0002] In the field of computer vision, semantic segmentation is crucial because it involves understanding the specific category to which each pixel in an image belongs. DeepLab v3+ is a significant milestone in this field, making substantial improvements over previous DeepLab models, particularly in feature extraction and upsampling techniques. This enables DeepLab v3+ to achieve more accurate segmentation in more complex image scenes, especially excelling in handling details such as object edges. DeepLab v3+ is an advanced semantic segmentation model that primarily improves upon the DeepLab series models by refining feature extraction and upsampling, thereby enhancing segmentation accuracy, especially in handling object edges.
[0003] However, despite its excellent performance in many aspects, DeepLab v3+ still has some limitations when dealing with very small or elongated objects, such as small bodies of water. Because these objects have a small number of pixels, the model sometimes struggles to capture enough features for accurate classification. Furthermore, the visual importance of these small objects in the image may be disproportionate to their pixel count, causing the model to perform poorly when faced with trade-offs between global and local features. In addition, DeepLab v3+ is based on the computationally intensive Xception network, resulting in high model complexity and significant computational resource requirements. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention provides a semantic segmentation method for lakes in remote sensing images based on the CA attention mechanism and a lightweight network, which solves the limitations that DeepLab v3+ still has when processing very small or elongated objects.
[0005] To achieve the above objectives, this invention provides the following technical solution: a semantic segmentation method for lakes in remote sensing images based on a CA attention mechanism and a lightweight network, comprising the following steps:
[0006] Step 1: Introduce the Coordinate Attention (CA) mechanism into the ASPP module of the DeepLab v3+ model. By performing pooling, merging, and convolution operations on the feature maps in the vertical and horizontal directions, spatial attention weights are generated to enhance the model's ability to understand the spatial positional relationships of objects.
[0007] Step 2: Replace the original Xception network of DeepLab v3+ with the lightweight MobileNetV2 network as the backbone feature extraction network. MobileNetV2 adopts depthwise separable convolution and inverted residual structure, which reduces the number of model parameters while maintaining high feature extraction capability.
[0008] Step 3: Combine the CA attention mechanism in Step 1 with the MobileNetV2 network in Step 2 to construct an improved DeepLab v3+ model, namely CA-DeepLab v3+. This model uses MobileNetV2 to extract multi-scale features in the encoder part, applies the CA attention mechanism to enhance feature representation in the ASPP module, and finally restores spatial details through the decoder to achieve accurate pixel-level segmentation.
[0009] Step 4: Train and test the CA-DeepLab v3+ model on a lake remote sensing image dataset. Use cross-entropy as the loss function, adopt the SGD optimizer, and set appropriate hyperparameters. Validate the effectiveness of the proposed method by comparing its performance with other classic semantic segmentation models.
[0010] Preferably, in step one, the input image is first processed by an encoder equipped with a dilated spatial pyramid pooling module for feature extraction. The ASPP module includes multiple parallel convolutional layers, each with a different dilation rate, to capture multi-scale information in the input image. Then, a fused feature map is obtained through the ASPP module. The feature map contains both global content information and local detail features of the image. Finally, the feature map is input into a decoder to obtain pixel-level segmentation results.
[0011] Preferably, the ASPP module has limitations in capturing spatial information, and its ability to express fine-grained details and contextual dependencies in complex scenes needs to be improved. Specifically, in image scenes with occlusion, lighting changes, and large scale differences, the segmentation accuracy of the ASPP module needs to be further improved.
[0012] Preferably, the ASPP incorporates a CA attention mechanism to enhance the model's ability to identify key features and perceive spatial relationships. The CA attention mechanism strengthens the spatial information lost by embedding location spatial information into the channel attention mechanism. It adopts a unique design that avoids traditional spatial information compression methods. In this mechanism, global average pooling is replaced by two dedicated modules, which are responsible for extracting attention information in the vertical and horizontal directions, respectively.
[0013] Preferably, taking the vertical direction as an example, the input feature map undergoes average pooling along the vertical direction. Assuming the input feature map is C*H*W, after average pooling, the new size of the feature map becomes C*1*W, thus condensing the features in the vertical direction. At this point, the feature condensation for each feature unit in the horizontal direction is obtained. Similarly, after condensing the features in the horizontal direction, the feature condensation for each feature unit in the vertical direction is obtained, and the size of the feature layer becomes C*H*1. The feature maps generated by these two parallel processing steps enable the model to capture spatial attention information from two different dimensions. The specific formula is as follows:
[0014]
[0015]
[0016] in This is the feature layer after average pooling in the vertical direction. The feature layer is the result of average pooling in the horizontal direction. After obtaining the feature layers in the two directions, these two feature layers will be merged, combining the features in the vertical and horizontal directions. At this time, the size of the feature layer is C×1×(W+H).
[0017] Preferably, the feature layer is normalized using a 1×1 convolution. The size of the normalized feature map is C / r×1×(W+H), where r is a reduction factor used to reduce model parameters. The specific formula is as follows:
[0018] f=δ(F1([Z h Z W ])) (3)
[0019]
[0020] Where δ is the activation function, square brackets represent concatenation, and f represents the generated feature layer. It represents the set of real numbers.
[0021] Preferably, this process is further divided into two parallel stages, operating on the vertical and horizontal directions respectively. After the splitting and processing are completed, the two feature maps are transposed, resulting in two dimensionally compressed feature maps, C / r×H×1 and C / r×1×W. The former is compressed in the horizontal direction, and the latter in the vertical direction. The specific feature layer representation is as follows.
[0022]
[0023]
[0024] Preferably, after the initial processing, the feature maps have been optimized in both the vertical and horizontal directions. Then, a 1x1 convolution is applied to each of these feature maps to adjust the number of channels. After adjustment, the number of channels is uniformly converted to C. Next, the Sigmoid activation function is used to obtain the attention vectors in the vertical and horizontal directions, denoted as g and g', respectively. w The specific formula is as follows.
[0025] g h =σ(F h (f h (7)
[0026] g w =σF w (f w (8)
[0027] Preferably, after acquiring the feature maps, the dimensions of the feature maps are C×H×1 and C×1×W, respectively. For the former, it needs to be expanded in the horizontal direction, and for the latter, it needs to be expanded in the vertical direction. Multiplying the expanded feature maps yields the result y, which is the result of the CA attention mechanism. c (i, j), the specific formula is as follows;
[0028]
[0029] In the formula, x c (i, j) represents the value of the input feature map at position (i, j).
[0030] Preferably, the inverted residual structure expands the dimension through a 1x1 convolutional layer, then applies a depthwise separable convolution, and finally reduces the dimension with another 1x1 convolutional layer to establish residual connections.
[0031] This invention provides a semantic segmentation method for lakes in remote sensing images based on a CA attention mechanism and a lightweight network. It offers the following advantages:
[0032] 1. This invention enhances the model's ability to understand the spatial relationships of objects by introducing the CA attention mechanism into the ASPP module, thereby improving the accuracy of lake semantic segmentation, especially in handling small water bodies and complex scenes.
[0033] 2. This invention uses the lightweight MobileNetV2 network as the backbone feature extraction network, which significantly reduces the number of model parameters and computational complexity while maintaining high segmentation performance, making it more suitable for practical application deployment.
[0034] 3. This invention combines the CA attention mechanism with the MobileNetV2 network to construct the CA-DeepLab v3+ model, which outperforms other mainstream semantic segmentation models on multiple evaluation metrics, demonstrating superior lake segmentation performance.
[0035] In summary, the method proposed in this invention provides a new approach for accurate and efficient semantic segmentation of lakes in remote sensing images, and has broad application prospects. Attached Figure Description
[0036] Figure 1 This is a schematic diagram of the CA-DeepLab v3+ network model of the present invention;
[0037] Figure 2 This is a schematic diagram of the CA attention mechanism of the present invention;
[0038] Figure 3 This is a schematic diagram of the average pooling in the vertical direction (left) and horizontal direction (right) of the present invention;
[0039] Figure 4 This is a schematic diagram of the merged feature layer of the present invention;
[0040] Figure 5 These are schematic diagrams of the conventional residual structure (top) and the inverted residual structure (bottom) of the present invention;
[0041] Figure 6 This is a schematic diagram of the MobileNetV2 network model of the present invention;
[0042] Figure 7 This is a schematic diagram of the loss function variation curve of the present invention;
[0043] Figure 8 This is a schematic diagram of the ablation experiment results of the present invention;
[0044] Figure 9 A bar chart comparing the model results of this invention;
[0045] Figure 10 This is a schematic diagram of the lake edge detail image results of the present invention. Detailed Implementation
[0046] 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.
[0047] Example:
[0048] Please see the appendix Figure 1 - Appendix Figure 4 This invention provides a method for semantic segmentation of lakes in remote sensing images based on a CA attention mechanism and a lightweight network, comprising the following steps:
[0049] First, the remote sensing image lake dataset is preprocessed, including atmospheric correction, band synthesis, mosaicking, cropping, and data augmentation. Then, the preprocessed data is used to train the CA-DeepLab v3+ model proposed in this invention, as shown in the table below.
[0050] Table 1. Characterization of Model Training Parameters
[0051]
[0052] Reference Appendix Figure 7-8 During training, this invention uses cross-entropy as the loss function, sets the initial learning rate to 0.007, the batch size to 4, selects SGD as the optimizer, and sets the training period to 100 epochs to avoid overfitting. Analysis of the loss function variation curve of the CA-DeepLab v3+ model reveals that the model tends to converge after 60 epochs of training, with the minimum training set loss value reaching 0.015.
[0053] During training, this invention uses cross-entropy as the loss function, sets the initial learning rate to 0.007, the batch size to 4, selects SGD as the optimizer, and sets the training period to 100 epochs to avoid overfitting. Analysis of the loss function variation curve of the CA-DeepLab v3+ model reveals that the model tends to converge after 60 epochs of training, with the minimum training set loss value reaching 0.015.
[0054] Reference Appendix Figure 5-6 Based on the aforementioned optimization of the ASPP module, we further propose to replace the original computationally intensive Xception network with the lightweight MobileNetV2 network, in order to reduce memory consumption and computational resource requirements while maintaining model performance.
[0055] MobileNetV2 is an improved MobileNet architecture, its core being the introduction of depthwise separable convolution and inverted residual structures. Depthwise separable convolution decomposes the standard convolution operation into two parts: depthwise convolution and pointwise convolution. The depthwise convolution filters each channel of the input independently, while the pointwise convolution uses a 1x1 convolution kernel to fuse the depthwise convolution results along the channel dimension. This decomposition method can significantly reduce model complexity and the number of parameters.
[0056] The inverted residual structure is another innovation of MobileNetV2. Unlike the traditional residual module's process of going through a narrow layer, then a wide layer, and finally back to a narrow layer, the inverted residual structure first expands the dimension through a 1x1 convolutional layer, then applies depthwise separable convolutions, and finally reduces the dimension with another 1x1 convolutional layer to establish residual connections. This structure not only reduces the number of parameters but also optimizes gradient propagation, which is beneficial for training deeper networks. In addition, the inverted residual structure also introduces a linear bottleneck technique, that is, using a linear activation function instead of a ReLU activation function at the end of the residual block to maximize the preservation of information when the feature space is compressed to a low dimension.
[0057] The specific network model of MobileNetV2 is as follows: When the stride is 1, the input passes through a 1x1 convolutional layer (expanding the number of channels, using the ReLU6 activation function), a 3x3 deep convolutional layer (non-linear transformation, using the ReLU6 activation function), and a 1x1 point convolutional layer (reducing the number of channels, using the linear bottleneck activation function), and finally the data before and after are added together through an accumulator connection; when the stride is 2, due to the inconsistent size of the input and output feature maps, the accumulator connection is not used.
[0058] This invention constructs an improved DeepLab v3+ model based on the MobileNetV2 network architecture and the aforementioned CA attention mechanism. This model integrates the CA attention mechanism into the ASPP module to enhance the understanding of spatial relationships and improve the accuracy of semantic segmentation. Simultaneously, to achieve a balance between model complexity and performance, this invention replaces the original Xception with MobileNetV2 as the backbone network, significantly reducing the number of model parameters while maintaining the advantages of the attention mechanism, thus achieving a lightweight model. The optimized DeepLab v3+ model is named CA-DeepLabv3+.
[0059] Reference Appendix Figure 9Furthermore, to verify the superiority of the CA-DeepLab v3+ model over other classic semantic segmentation models, this invention conducted comparative experiments on the same dataset against models such as FCN-8s, SegNet, U-Net, and DeepLab v3+. Through visual comparison and quantitative index analysis, the superior performance of CA-DeepLab v3+ on the lake water segmentation task was confirmed. Compared to FCN-8s, the model of this invention improved accuracy, recall, F1 score, and IoU by 0.83%, 1.07%, 1.19%, and 1.7%, respectively, with only a slightly higher parameter count than FCN-8s. Compared to SegNet and U-Net, CA-DeepLab v3+ also showed significantly better segmentation performance. Compared to the original DeepLab v3+, the model of this invention reduced the parameter count by 70.02MB while maintaining high accuracy, achieving a balance between performance and efficiency.
[0060] In summary, the proposed semantic segmentation method for lakes in remote sensing images, based on an attention mechanism and a lightweight network, enhances the model's understanding of lake water bodies in complex scenes by introducing the CA attention mechanism into the ASPP module. Using MobileNetV2 as the backbone network significantly reduces model complexity while ensuring segmentation accuracy. Compared with other mainstream semantic segmentation models, CA-DeepLab v3+ demonstrates superior performance advantages, providing a new solution for efficient and accurate lake remote sensing image segmentation.
[0061] Reference Appendix Figure 10 To more intuitively demonstrate the segmentation performance of CA-DeepLab v3+, this invention selects the following images of lake edge details and presents their processing results under different segmentation models.
[0062] 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 image lake semantic segmentation method based on CA attention mechanism and lightweight network, characterized by, Includes the following steps: Step 1: Introduce the Coordinate Attention (CA) mechanism into the ASPP module of the DeepLab v3+ model. This mechanism generates spatial attention weights by performing pooling, merging, and convolution operations on the feature map in the vertical and horizontal directions, enhancing the model's ability to understand the spatial relationships of objects. In Step 1, the input image is first processed by an encoder equipped with a dilated spatial pyramid pooling module for feature extraction. The ASPP module includes multiple parallel convolutional layers, each with a different dilation rate, used to capture multi-scale information in the input image. Then, the ASPP module yields a fused feature map, which simultaneously contains global content information and local detail features of the image. Finally, the feature map is input into the decoder to obtain pixel-level segmentation results. Step 2: Replace the original Xception network of DeepLab v3+ with the lightweight MobileNetV2 network as the backbone feature extraction network. MobileNetV2 adopts depthwise separable convolution and inverted residual structure, which reduces the number of model parameters while maintaining high feature extraction capability. Step 3: Combine the CA attention mechanism in Step 1 with the MobileNetV2 network in Step 2 to construct an improved DeepLab v3+ model, namely CA-DeepLab v3+. This model uses MobileNetV2 to extract multi-scale features in the encoder part, applies the CA attention mechanism to enhance feature representation in the ASPP module, and finally restores spatial details through the decoder to achieve accurate pixel-level segmentation. Step 4: Train and test the CA-DeepLab v3+ model on a lake remote sensing image dataset. Use cross-entropy as the loss function, adopt the SGD optimizer, and set appropriate hyperparameters. Validate the effectiveness of the proposed method by comparing its performance with other classic semantic segmentation models.
2. The method according to claim 1, wherein, The ASPP module has limitations in capturing spatial information, and its ability to express fine-grained details and contextual dependencies in complex scenes needs to be improved. Specifically, in image scenes with occlusion, lighting changes, and large scale differences, the segmentation accuracy of the ASPP module needs to be further improved.
3. The method according to claim 1, wherein, The ASPP incorporates a CA attention mechanism to enhance the model's ability to identify key features and perceive spatial relationships. The CA attention mechanism strengthens the spatial information lost by embedding location spatial information into the channel attention mechanism. It adopts a unique design that avoids traditional spatial information compression methods. In this mechanism, global average pooling is replaced by two dedicated modules, which are responsible for extracting attention information in the vertical and horizontal directions, respectively.
4. The method according to claim 1, wherein, Taking the vertical direction as an example, the input feature map undergoes average pooling along the vertical direction. Assuming the input feature map is C*H*W, after average pooling, the new size of the feature map becomes C*1*W, thus condensing the features in the vertical direction. This yields the feature condensation for each feature unit in the horizontal direction. Similarly, after condensing the features in the horizontal direction, the feature condensation for each feature unit in the vertical direction is obtained, and the size of the feature layer becomes C*H*1. The feature maps generated by these two parallel processing steps enable the model to capture spatial attention information from two different dimensions. The specific formula is as follows: wherein is the average-pooled feature layer in the vertical direction, is the average-pooled feature layer in the horizontal direction, after obtaining the feature layers in the two directions, the two feature layers are merged, and the features in the vertical and horizontal directions are merged together, at this time the size of the feature layer is .
5. The method for semantic segmentation of lakes in remote sensing images based on CA attention mechanism and lightweight network according to claim 1, characterized in that, The convolutional layer is used to standardize the features of the feature layer. The size of the standardized feature map is , where is a reduction factor used to reduce model parameters. The specific formula is as follows: in The square brackets represent the activation function, and f represents the generated feature layer. It represents the set of real numbers.
6. The method for semantic segmentation of lakes in remote sensing images based on CA attention mechanism and lightweight network according to claim 1, characterized in that, This process is further divided into two parallel stages, operating on the vertical and horizontal directions respectively. After the splitting and processing are completed, the two feature maps are transposed, resulting in two dimensionally condensed feature maps, namely and , where the former is condensed in the horizontal direction and the latter in the vertical direction. The specific feature layer representation is as follows.
7. The method for semantic segmentation of lakes in remote sensing images based on CA attention mechanism and lightweight network according to claim 1, characterized in that, After initial processing, the feature maps have been optimized in the vertical and horizontal directions respectively. Then, 1*1 convolutions are applied to these two feature maps to adjust the number of channels. After adjustment, their channel numbers are uniformly converted to C. Next, the sigmoid activation function is used to obtain the attention vectors in the vertical and horizontal directions, which are and , respectively. The specific formulas are as follows.
8. The method for semantic segmentation of lakes in remote sensing images based on CA attention mechanism and lightweight network according to claim 1, characterized in that, After obtaining the feature maps, the feature maps have sizes of and . For the former, they need to be expanded in the horizontal direction, and for the latter, they need to be expanded in the vertical direction. Multiplying the expanded feature maps together, the result is the result of the CA attention mechanism. The specific formula is as follows: In the formula This represents the value of the input feature map at position (i,j).
9. The method for semantic segmentation of lakes in remote sensing images based on CA attention mechanism and lightweight network according to claim 1, characterized in that, The inverted residual structure expands the dimension through a 1x1 convolutional layer, then applies a depthwise separable convolution, and finally reduces the dimension with another 1x1 convolutional layer to establish residual connections.
Citation Information
Patent Citations
High-efficiency and high-precision remote sensing image semantic segmentation method and application
CN116863347A
