A remote sensing image cloud detection method based on spatial data fusion

CN117437547BActive Publication Date: 2026-08-21NORTHEAST FORESTRY UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311610550.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-28
Publication Date
2026-08-21
Estimated Expiration
2043-11-28

AI Technical Summary

Technical Problem

然而,该类方法通常只针对遥感图像的波段进行特征提取,忽略了遥感图像中蕴含着重要的海拔、经度和纬度等地理空间数据,这种单一侧重于波段特征的策略限制了在复杂场景中获得精准的云检测结果的能力

Benefits of technology

[0050]1.提高检测精度:通过融合多源遥感数据,如光学影像、雷达图像等不同传感器的数据,可以提高云检测的精度和准确性。不同传感器的数据能够提供互补的信息,从而提高对云的识别能力。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117437547B_ABST
    Figure CN117437547B_ABST
Patent Text Reader

Abstract

The application discloses a remote sensing image cloud detection method for spatial data fusion, establishes a GS-CDNet model, and comprises an interlaced self-attention mechanism module, a bidirectional multi-scale feature fusion module, a decoder and a cloud boundary extraction module. A double-layer loss function with multi-level supervision is designed, the model is loaded and image prediction is carried out, and the prediction result is displayed. The application has the advantages that the detection precision is improved, the limitation of remote sensing data is reduced, the accuracy and robustness of cloud detection are improved, and the value and utilization effect of remote sensing data are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of optical remote sensing application technology, and in particular to a method for cloud detection in remote sensing images through spatial data fusion. Background Technology

[0002] With the widespread application of remote sensing technology, optical remote sensing images play a crucial role in fields such as earth science, military reconnaissance, and environmental protection. Studies show that the global annual average cloud cover is as high as 66%, which severely hinders the acquisition of effective information from optical remote sensing images and negatively impacts practical needs such as crop yield estimation, urban greening, and land surface temperature estimation. Therefore, accurately detecting cloud-covered areas is essential for improving the usability and accuracy of remote sensing image data, and also has significant research value and implications in many optical remote sensing applications.

[0003] Cloud detection methods in remote sensing images can be divided into two categories: those based on physical feature recognition and those based on machine learning. Physical feature recognition methods utilize the differences in spectral reflectance characteristics between clouds and ground objects, identifying cloud pixels by selecting appropriate bands and thresholds. However, due to the complex surface environment and the diversity of cloud region geometry, accurate cloud pixel segmentation is difficult to comprehensively consider all influencing factors. Furthermore, these methods are highly sensitive to changes in atmospheric conditions and scene attributes, and the selection of thresholds and bands often depends on specific sensors or satellite platforms, lacking universality and portability.

[0004] Machine learning-based methods utilize manually labeled datasets to train specialized classifiers. By incorporating strategies such as multi-feature combinations, large-scale sample training, and integration with physical models, they avoid the problems inherent in physical feature-based recognition methods. While these methods do not require a large amount of physical features as prior knowledge, the quality of cloud masks still heavily relies on manually specified rules, making it impossible to design a universal paradigm to handle the complex and varied cloud regions in remote sensing images.

[0005] In recent years, deep learning theory and applications have made significant progress. Due to its ability to effectively extract multi-layered texture features from remote sensing images, avoiding the problems of experience-based rule setting, and demonstrating higher accuracy than traditional classifiers in various image classification tasks, it has been widely applied to cloud detection. However, deep learning-based cloud detection methods generally capture image features by stacking network depth or using multiple fixed-scale receptive fields. While these strategies have strong scene representation capabilities, they cannot adapt to the complex and varied spatial characteristics of cloud regions. Furthermore, clouds in different geographical regions exhibit different visual appearances. However, these methods typically only extract features from the bands of remote sensing images, ignoring important geospatial data such as altitude, longitude, and latitude contained within the images. This one-sided focus on band features limits the ability to obtain accurate cloud detection results in complex scenes. Summary of the Invention

[0006] This invention addresses the shortcomings of existing technologies by providing a remote sensing image cloud detection method based on spatial data fusion.

[0007] To achieve the above-mentioned objectives, the technical solution adopted by the present invention is as follows:

[0008] A remote sensing image cloud detection method based on spatial data fusion includes the following steps:

[0009] Step 1: Preprocess the remote sensing images;

[0010] A sliding window method is used to crop remote sensing images. A geospatial dataset is constructed using the SRTM3 global raster digital elevation model combined with the remote sensing dataset. A coordinate system transformation algorithm is used to convert the projected coordinates of the remote sensing images into corresponding longitude and latitude coordinates, generating longitude maps, latitude maps, and elevation maps. Figure 3 Geospatial dataset for each band.

[0011] Step 2: Build the GS-CDNet (Geographic Spatial Data-Cloud Detection Network) model;

[0012] 21) Constructing an interleaved self-attention mechanism module: including convolution block cropping to generate intermediate feature maps, multi-stage self-attention mechanism blocks to extract multi-scale features, using stride operations and non-overlapping convolution kernels to downsample the feature maps, and performing a specific self-attention mechanism to extract attention feature maps.

[0013] 22) Construct a bidirectional multi-scale feature fusion module: use top-down and bottom-up strategies to fuse multi-scale features, unify the number of channels of feature information, and perform fusion and upsampling operations.

[0014] 23) Constructing a decoder: Using the contextual feature cues generated by the bidirectional multi-scale fusion module as input, feature fusion and upsampling operations are performed to generate a multi-scale fused feature map.

[0015] 24) Construct a cloud boundary extraction module: Take the multi-scale cloud mask generated by the decoder as input, use the residual structure to generate a differential cloud mask for the cloud boundary, and finally fuse the differential cloud mask with the multi-scale cloud mask.

[0016] Step 3: Design of a two-layer loss function with multi-level supervision;

[0017] Design a suitable loss function, combine the binary cross-entropy loss function and the Jaccard coefficient, and achieve the effect of overall supervision by merging the losses of each part.

[0018] Step 4: Load the trained GS-CDNet model.

[0019] Step 5, Image Prediction: Input the preprocessed remote sensing image data from Step 1 into the loaded GS-CDNet model for prediction. The GS-CDNet model will output a cloud mask image of the same size as the input image, identifying the cloud and non-cloud regions in the image.

[0020] Step 6, Post-processing: Perform post-processing operations on the cloud mask output by the GS-CDNet model, including: removing noise in small areas and filling holes, to obtain more accurate cloud detection results.

[0021] Step 7: Result Display: Overlay or display the post-processed cloud detection results with the original remote sensing image so that users can observe and analyze the detection results.

[0022] Furthermore, the structure of the staggered self-attention mechanism module includes:

[0023] Phase 1: For a given input X∈R H*W*7 The remote sensing image was processed by convolution with a 4x4 kernel and a stride of 4, resulting in an intermediate feature map of shape H / 4*W / 4*C.

[0024] The last three stages: The feature map is downsampled using a stride of 2 and non-overlapping 2*2 convolutional kernels, which halves the spatial size of the feature map and doubles the feature dimensions. Each stage contains N1, N2, N3, and N4 self-attention mechanism blocks, respectively.

[0025] Self-attention mechanism block: After the feature map is convolved and normalized by 3*3, attention feature map is extracted using a specific self-attention mechanism, and then normalized and MLP (multilayer perceptron) is used as the input of the next self-attention block.

[0026] Furthermore, the operation flow of the interleaved self-attention mechanism module is as follows: In the first and second stages, features are extracted using an interleaved approach of local self-attention and sliding window self-attention mechanisms. In the third and fourth stages, downsampling operations are also performed, and a design of alternating local and global self-attention blocks is adopted, which can be transformed into a self-attention mechanism and a two-layer routing self-attention mechanism.

[0027] Furthermore, the operation flow of the bidirectional multi-scale feature fusion module is as follows:

[0028] 31) The intermediate feature maps generated by the self-attention blocks in the staggered attention mechanism module are converted into feature information T1, T2, T3, and T4 by 1*1 convolution to unify the number of channels for each feature information.

[0029] 32) Starting with feature T4, which has the deepest information, the feature is upsampled twice through bilinear interpolation and gradually fused with the features of the previous layer.

[0030] 33) Starting with feature T1, which has the shallowest information, the feature is downsampled by twice the maximum value and gradually fused with the features of the next layer.

[0031] 34) By using 3*3 convolution, batch normalization and ReLU activation function, the fused features are made learnable and features of the same size are fused.

[0032] 35) Finally, four fusion features are obtained, which are multi-scale fusion features with coarse-grained global context information and fine-grained local context information.

[0033] Furthermore, the decoder's operation flow is as follows:

[0034] 41) Multi-scale fusion features generated by the bidirectional multi-scale fusion module.

[0035] 42) Upsample each feature at different magnifications based on its own size to obtain feature maps of the same size.

[0036] 43) After 3*3 convolution, normalization and ReLU activation function, the upsampled feature maps are fused to generate a fused feature map of 4*C*H*W.

[0037] 44) Use three 3*3 convolutions, normalization, and ReLU activation function to extract and enhance features from the fused feature map.

[0038] 45) Use a 1*1 convolution, normalization, and ReLU activation function to reduce the dimensionality of the feature map or add nonlinear transformations to generate a multi-scale cloud mask Y'.

[0039] Furthermore, the specific steps for designing the multi-level supervised two-layer loss function are as follows:

[0040] 51) Calculate the binary cross-entropy loss function, as shown in the following formula:

[0041]

[0042] In the formula, Represents a reference cloud mask image, Y∈R {H*W*1} This represents the overall cloud mask image predicted by the model, where W represents the weight of each category.

[0043] 52) Calculate the Jaccard coefficient using the following formula:

[0044]

[0045] In the formula, the larger the ratio of the overlapping area of ​​the reference cloud mask to the predicted cloud mask, the smaller the Jaccard coefficient. α is a minimum value used to avoid a denominator of 0.

[0046] 53) Combining the binary cross-entropy loss function and the Jaccard coefficient, we obtain a two-layer loss function for multi-level supervision, as shown in the following formula:

[0047]

[0048] In the formula, N represents the number of levels in the loss function.

[0049] Compared with the prior art, the advantages of the present invention are as follows:

[0050] 1. Improve detection accuracy: By fusing multi-source remote sensing data, such as data from different sensors including optical images and radar images, the accuracy and precision of cloud detection can be improved. Data from different sensors can provide complementary information, thereby enhancing the ability to identify clouds.

[0051] 2. Reduce the limitations of remote sensing data: Remote sensing data from a single sensor may be affected by factors such as weather and lighting, leading to a decrease in the accuracy of cloud detection. However, fusing data from multiple sources can reduce the limitations of single-sensor data and improve the robustness of cloud detection.

[0052] 3. To address complex interference factors such as atmosphere, cloud backscattering, and shadows in remote sensing images, fusing multi-source remote sensing image data can better eliminate these interferences and improve the accuracy and robustness of cloud detection.

[0053] 4. By integrating remote sensing image data from different time periods, real-time monitoring of cloud changes and evolution can be achieved, helping to better understand the dynamic changes in cloud-covered areas and providing reliable data support for weather forecasting and environmental monitoring.

[0054] 5. Using a method that fuses remote sensing images for cloud detection can effectively improve the comprehensive utilization efficiency of data, save data storage and transmission costs, and enhance the value and utilization effect of remote sensing data. Attached Figure Description

[0055] Figure 1 This is a flowchart of the remote sensing image overlap and cutting process according to an embodiment of the present invention;

[0056] Figure 2 This is a flowchart illustrating the construction process of the geospatial dataset according to an embodiment of the present invention;

[0057] Figure 3 This is an overall structural diagram of the interleaved self-attention mechanism according to an embodiment of the present invention;

[0058] Figure 4 This is a block structure diagram of the self-attention mechanism according to an embodiment of the present invention;

[0059] Figure 5 This is a structural diagram of the bidirectional multi-scale fusion module according to an embodiment of the present invention;

[0060] Figure 6 This is a structural diagram of the decoder according to an embodiment of the present invention;

[0061] Figure 7 This is a structural diagram of the cloud boundary extraction module according to an embodiment of the present invention;

[0062] Figure 8 The present invention provides an embodiment of the SPARCS dataset combined with a geospatial dataset, showing the MIOU and loss curves, where (a) is the loss function and (b) is the MIOU index curve. Detailed Implementation

[0063] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and examples.

[0064] This invention provides a remote sensing image cloud detection method based on spatial data fusion, comprising the following steps:

[0065] I. Remote Sensing Image Data Preprocessing

[0066] Due to limitations in computing resources, remote sensing images cannot be directly input into the model for training. Therefore, an overlap cropping method is used to crop the remote sensing images. A sliding window with a cropping overlap rate of 25% and a size of 384*384 is used for overlap cropping, as follows: Figure 1 As shown, this method increases the diversity of training data, thereby reducing the risk of overfitting and improving the model's generalization ability. It enables the model to better understand the structure and semantics of images, helping to reduce boundary effects or artifacts and lowering computational costs.

[0067] Simultaneously, this embodiment employs the SRTM3 global raster digital elevation model combined with remote sensing datasets to construct a geospatial dataset. Remote sensing datasets typically include multispectral images, reference cloud masks, and metadata files. However, remote sensing image metadata files usually do not provide longitude and latitude resolution, making it impossible to directly obtain the longitude and latitude values ​​of all pixels. Therefore, from the perspective of geographic coordinate systems, a coordinate system transformation (inverse projection) algorithm is introduced to construct the geospatial dataset, such as... Figure 2 As shown.

[0068] First, obtain the x and y coordinates of each pixel based on the map coordinate system in the remote sensing image metadata file. Then, use the affine transformation formula to obtain the geographic coordinates of all pixels, as follows:

[0069]

[0070] In the formula, the superscript m represents the selected remote sensing image metadata, tl_gcx m and tl_gcy m r represents the geographic coordinates of the initial corner points of the remote sensing image on the horizontal and vertical axes, respectively. x1 r y1 r x2 and r y2 The x and y coordinates represent the ground spatial resolution of the remote sensing image on the horizontal and vertical axes, respectively. These can be obtained from the metadata of the remote sensing image or estimated from the coordinates of the four image corner points and the center point. Equation (1) uses the x and y values ​​of any pixel in the matrix coordinates to obtain the corresponding geographic coordinate value gcx. m and gcy m .

[0071] Before calculating longitude and latitude coordinates, SRTM3 uses the WGS84 (World Geodetic System 1984) geographic coordinate system, while some remote sensing datasets use UTM (Universal Transverse Mercator) projected coordinates. To map the geographic coordinates of each remote sensing image to the longitude and latitude coordinates of SRTM3, a coordinate system transformation (inverse projection) algorithm is needed to convert the projected coordinates in the dataset to the corresponding longitude and latitude coordinates. The formula is as follows:

[0072]

[0073] In the formula, Proj() and zone m The inverse projection algorithm and the remote sensing image represent the projected coordinate system block, where equation (1) is combined with the geographic coordinate value tl_gcx in equation (2). m tl_gcy m And the longitude value (lon) of any pixel in the remote sensing image block is obtained using the inverse projection formula.m and latitude value lat m .

[0074] In summary, longitude and latitude maps matching the remote sensing image can be obtained using equations (1) and (2). Based on the longitude and latitude information of the given image, the SRTM3 global digital elevation model (DEM) is cropped to the projected coordinates of this image to generate an elevation map. The geospatial dataset will contain three bands: longitude, latitude, and elevation.

[0075] II. Model Construction

[0076] This embodiment proposes a remote sensing image cloud detection model GS-CDNet (Geographic Spatial Data-Cloud Detection Network) that combines geospatial data. This model mainly includes an interleaved self-attention mechanism module, a bidirectional multi-scale feature fusion module, a cloud boundary extraction module, and a loss function. The structure of each module will be described in detail below.

[0077] This paper proposes an interleaved self-attention mechanism module that combines different self-attention mechanisms with an MLP perceptron to construct a self-attention mechanism block for extracting multi-scale features. To obtain the multi-scale feature attention map, this module is constructed in four stages. For example... Figure 3 As shown, the staggered self-attention mechanism module in the first stage, for a given input X∈R H*W*7 The remote sensing image is processed by image block convolution with a kernel size of 4*4 and a stride of 4 to obtain an intermediate feature map of shape H / 4*W / 4*C. In the last three stages, a non-overlapping 2*2 convolution kernel with a stride of 2 is used to downsample the feature map, halving its spatial size and doubling its feature dimensions. Each stage contains N1, N2, N3, and N4 self-attention mechanism blocks, respectively. Figure 4 As shown, the feature maps of the self-attention blocks are sequentially processed by 3*3 convolution and normalization, and then the attention feature maps are extracted using a specific self-attention mechanism. After normalization and MLP (Multilayer Perceptron), they are used as the input for the next layer of self-attention blocks.

[0078] Since each image block after image block convolution can only focus on its own local information, this processing method makes it easier for the model to handle large input images and improves computational efficiency. Therefore, in the early (first and second) stages, this module uses an alternating approach of local self-attention mechanism and sliding window self-attention mechanism to extract features. First, the local self-attention mechanism is used to help the model focus on local details and edge information of the input image. This helps to capture features such as cloud texture, shape, and boundary. Second, the sliding window self-attention mechanism is used to focus on specific targets or regions of interest in local areas. Through the sliding window approach, cloud features separated by windows can be discovered more finely, and the detection accuracy of cloud pixels can be improved. In the third and fourth stages, downsampling operations are also performed, and an alternating design of local and global self-attention blocks is adopted, namely deformable self-attention mechanism and dual-layer routing self-attention mechanism, which helps to improve the learning ability of the model. At the same time, considering that cloud pixels are unevenly distributed and account for a small proportion in remote sensing images, this paper selects more deformable attention to better adapt to cloud changes and improve segmentation accuracy. With fewer two-layer routing attention, cloud distribution in images is captured from a global perspective, improving the perceptual range and contextual modeling capabilities of cloud pixels.

[0079] The bidirectional multi-scale feature fusion module employs both top-down and bottom-up strategies to fuse multi-scale features. Specifically, for example... Figure 5 As shown, this invention uses the intermediate feature information generated by the self-attention block in the interleaved attention mechanism module as the input of this bidirectional multi-scale feature fusion module. A 1*1 convolution is used to unify the number of feature channels for each feature information, generating feature information T1, T2, T3, and T4. In the bottom-up direction, the feature with the deepest layer, T4∈R, is... {C *H / 32*W / 32} Starting from this point, the feature is upsampled by a factor of two using bilinear interpolation, and gradually fused with the features from the previous layer. In the top-down direction, the feature with the shallowest information layer, T1∈R, is then... {C*H / 4*W / 4} Starting with this feature, it is downsampled by a factor of two and gradually fused with features from the next layer. Then, the module utilizes 3x3 convolutions, batch normalization, and ReLU activation to make the fused features learnable, and fuses features of the same size. Finally, four multi-scale fused features are obtained, each possessing both coarse-grained global contextual information and fine-grained local contextual information.

[0080] decoder such as Figure 6 As shown. The decoder utilizes contextual feature cues X'4, X'8, X' generated by the bidirectional multi-scale fusion module. 16 ,X' 32As input, the data is passed through a 3x3 convolution, normalized, and activated by a ReLU function, and then upsampled at different ratios according to the size of each feature. After feature fusion, a fused feature map of 4*C*H*W is generated. Finally, a multi-scale cloud mask Y' is generated using three 3x3 convolutions, normalization, and ReLU activation functions, and one 1x1 convolution, normalization, and ReLU activation function.

[0081] Cloud boundary extraction module, such as Figure 7 As shown, this module takes the multi-scale cloud mask generated by the decoder as input and uses the residual structure to generate a differential cloud mask for the cloud boundary. Finally, the differential cloud mask is fused with the multi-scale cloud mask to cancel out the blurred cloud boundary that may appear in the cloud mask.

[0082] To achieve accurate cloud detection in remote sensing images using a deep learning model, this paper designs a multi-level supervised two-layer loss function. This loss function combines the binary cross-entropy loss function and the Jaccard coefficient to train the model. The binary cross-entropy loss function is widely used in binary image classification tasks, and its calculation formula is as follows:

[0083]

[0084] In the formula, This represents a reference cloud mask image. Y∈R {H*W*1} The model predicts the overall cloud mask image. After processing by the Sigmoid function, the predicted cloud mask value is between 0 and 1, with a higher value indicating a higher probability of cloud pixels. W represents the weight of each category. In this paper, the weight is determined by calculating the percentage of pixels labeled each time an image is input.

[0085] The Jaccard coefficient, used to compare the similarity and differences between finite sample sets, is a widely applied evaluation metric for image semantic segmentation. In remote sensing image cloud recognition tasks, it measures the cross-union ratio (CURRR) between the predicted cloud mask and the reference cloud mask. The formula is as follows:

[0086]

[0087] In the formula, the larger the ratio of the overlapping area of ​​the reference cloud mask to the predicted cloud mask, the smaller the Jaccard coefficient. If both the reference cloud mask and the predicted image pixel value are 0, the Jaccard coefficient will produce an extreme value. Therefore, this scheme adds a minimum value α to the Jaccard coefficient to prevent the denominator from being 0.

[0088] In summary, this paper designs a distributed multi-scale supervision method. For example... Figure 6 and Figure 7As shown, this supervision function supervises the intermediate features in the decoder and cloud boundary extraction module, as well as the multi-scale cloud mask. By merging the losses from each part, overall supervision is achieved. The formula for the loss function is as follows.

[0089]

[0090] III. Experimental Analysis

[0091] To verify the effectiveness of the proposed model, our method was compared with other cloud detection methods on four datasets, including Fmask, DeeplabV3+, RS-Net, and Boundary-Net.

[0092] Table 1. Metrics of the Levir_CS dataset in each model

[0093]

[0094]

[0095] Table 2. Metrics of the GF1-WHU dataset in each model.

[0096]

[0097] Table 3. Metrics of the WHUS2-CD dataset in each model

[0098]

[0099] Table 4. Metrics of the SPARCS dataset in each model

[0100]

[0101] Based on the results in the table, it can be calculated that the overall results of the method proposed in this embodiment are significantly better than those of other algorithms compared with existing cloud detection methods.

[0102] To verify the feasibility of using geospatial datasets for cloud detection, ablation experiments were conducted by fusing red, green, blue, and near-infrared four-channel spectral images from the Levir_CS, SPARCS, and WHUS2-CD datasets. The results are shown in Table 5.

[0103] Table 5: Metrics of Geospatial Datasets on the Model

[0104]

[0105] After evaluating the model using geospatial datasets (longitude, latitude, and elevation maps) on the Levir_CS dataset, further performance improvements were observed. Although the Levir_CS dataset showed a slight decrease in M-F1 accuracy (91.7% compared to the original image's 91.9%), significant improvements were observed in MPrecision, MRecall, and OA, with MIOU also slightly increasing to 81.9%. This indicates that the addition of geospatial datasets positively impacts cloud detection performance. Training on the SPARCS and WHUS2-CD datasets using geospatial datasets yielded similar results to the Levir_CS dataset, with significant improvements across all metrics.

[0106] For cases where all metrics in the SPARCS dataset show improvement, this embodiment combines Table 5 and Figure 8 By comparing the loss curves and MIOU curves for the original image and the image with added geospatial dataset, it can be observed that the model converges faster after adding the geospatial dataset, and the MIOU curve shows a significant upward trend. This demonstrates that geographic information, as prior knowledge, has a positive impact on cloud detection tasks in remote sensing images.

[0107] The methods described above according to the invention can be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium (such as a CD-ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or as computer code originally stored on a remote recording medium or a non-transitory machine-readable medium and subsequently stored on a local recording medium, downloaded via a network. Thus, the methods described herein can be stored as software processing on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an ASIC or FPGA). It is understood that the computer, processor, microprocessor controller, or programmable hardware includes storage components (e.g., RAM, ROM, flash memory, etc.) capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the remote sensing image cloud detection method described herein. Furthermore, when a general-purpose computer accesses the code used to implement the processing shown herein, the execution of the code transforms the general-purpose computer into a dedicated computer for performing the processing shown herein.

[0108] Those skilled in the art will recognize that the embodiments described herein are intended to help the reader understand the implementation methods of the present invention, and should be understood that the scope of protection of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific modifications and combinations based on the technical teachings disclosed in this invention without departing from the spirit of the invention, and these modifications and combinations are still within the scope of protection of the present invention.

Claims

1. A method for cloud detection in remote sensing images based on spatial data fusion, comprising the following steps: Step 1: Preprocess the remote sensing images; The remote sensing images are cropped using a sliding window method; a geospatial dataset is constructed by combining the global raster digital elevation model of SRTM3 with the remote sensing dataset; and a coordinate system transformation algorithm is used to convert the projected coordinates of the remote sensing images into corresponding longitude and latitude coordinates to generate geospatial datasets with three bands: longitude map, latitude map, and elevation map. Step 2: Build the GS-CDNet model; 21) Construct an interleaved self-attention mechanism module; The structure of the interleaved self-attention mechanism module includes: First stage: For a given remote sensing image X∈RH*W*7, a 4*4 convolution kernel and a stride of 4 are used to perform image block convolution to obtain an intermediate feature map with shape H / 4*W / 4*C. The last three stages: The feature map is downsampled using a stride of 2 and non-overlapping 2*2 convolution kernels, which halves the spatial size of the feature map and doubles the feature dimensions; Each stage contains N1, N2, N3, and N4 self-attention mechanism blocks respectively. Self-attention mechanism block: After the feature map is convolved and normalized by 3*3, attention feature map is extracted using a specific self-attention mechanism, and then normalized and MLP (multilayer perceptron) is used as the input of the next layer self-attention block; The specific self-attention mechanism is as follows: in the first and second stages, features are extracted by alternating between local self-attention mechanism and sliding window self-attention mechanism; in the third and fourth stages, downsampling operation is also performed, and local and global self-attention blocks are designed alternately, which can be transformed self-attention mechanism and two-layer routing self-attention mechanism. 22) Construct a bidirectional multi-scale feature fusion module: use top-down and bottom-up strategies to fuse multi-scale features, unify the number of channels of feature information, and perform fusion and upsampling operations; 23) Constructing a decoder: Using the contextual feature cues generated by the bidirectional multi-scale fusion module as input, feature fusion and upsampling operations are performed to generate a multi-scale fused feature map; 24) Construct a cloud boundary extraction module: Take the multi-scale cloud mask generated by the decoder as input, use the residual structure to generate a differential cloud mask for the cloud boundary, and finally fuse the differential cloud mask with the multi-scale cloud mask; Step 3: Design of a two-layer loss function with multi-level supervision; Design a suitable loss function, combine the binary cross-entropy loss function and the Jaccard coefficient, and achieve the effect of overall supervision by merging the various losses. Step 4: Load the trained GS-CDNet model; Step 5, Image Prediction: Input the preprocessed remote sensing image data from Step 1 into the loaded GS-CDNet model and perform prediction using the GS-CDNet model; the GS-CDNet model will output a cloud mask image of the same size as the input image, identifying the cloud and non-cloud areas in the image; Step 6, Post-processing: Perform post-processing operations on the cloud mask output by the GS-CDNet model, including: removing noise in small areas and filling holes, to obtain more accurate cloud detection results; Step 7: Result Display: Overlay or display the post-processed cloud detection results with the original remote sensing image so that users can observe and analyze the detection results.

2. The remote sensing image cloud detection method according to claim 1, characterized in that: The operation flow of the bidirectional multi-scale feature fusion module is as follows: 31) The intermediate feature maps generated by the self-attention blocks in the staggered attention mechanism module are converted into feature information T1, T2, T3, and T4 by 1*1 convolution to unify the number of channels for each feature information. 32) Starting with feature T4, which has the deepest information, the feature is upsampled by a factor of two through bilinear interpolation and gradually fused with the features of the previous layer. 33) Starting with feature T1, which has the shallowest information, downsample the feature by twice its maximum value and gradually fuse it with the features of the next layer; 34) By using 3*3 convolution, batch normalization and ReLU activation function, the fused features are made learnable, and features of the same size are fused together; 35) Finally, four fusion features are obtained, which are multi-scale fusion features with coarse-grained global context information and fine-grained local context information.

3. The remote sensing image cloud detection method according to claim 1, characterized in that: The decoder's operation flow is as follows: 41) Multi-scale fusion features generated by the bidirectional multi-scale fusion module; 42) Upsample each feature at different magnifications based on its own size to obtain feature maps of the same size; 43) After 3*3 convolution, normalization and ReLU activation function, the upsampled feature maps are fused to generate a fused feature map of 4*C*H*W; 44) Use three 3*3 convolutions, normalization, and ReLU activation function to extract and enhance features from the fused feature map; 45) Use a 1*1 convolution, normalization, and ReLU activation function to reduce the dimensionality of the feature map or add nonlinear transformations to generate a multi-scale cloud mask Y'.

4. The remote sensing image cloud detection method according to claim 1, characterized in that: The specific steps for designing the two-layer loss function under multi-level supervision are as follows: 51) Calculate the binary cross-entropy loss function, as shown in the following formula: , In the formula, Ŷ∈R {H*W*1} Represents a reference cloud mask image, Y∈R {H*W*1} This represents the overall cloud mask image predicted by the model, where W represents the weight of each category. 52) Calculate the Jaccard coefficient using the following formula: , In the formula, the larger the ratio of the overlapping area of ​​the reference cloud mask to the predicted cloud mask, the smaller the Jaccard coefficient. It is a minimum value used to avoid the denominator being 0; 53) Combining the binary cross-entropy loss function and the Jaccard coefficient, we obtain a two-layer loss function for multi-level supervision, as shown in the following formula: , In the formula, N represents the number of levels in the loss function.

Citation Information

Patent Citations

  • Remote sensing image cloud and cloud shadow detection method based on multi-scale feature fusion network

    CN111797712A

  • Image segmentation method, device, equipment, medium and program product

    CN114495236A