Cloud / shadow edge sensing segmentation vectorization rapid calculation method
Through the combination of the UNet model and the CRF module, the cloud/shadow boundary segmentation of remote sensing images is optimized, solving the problem of insufficient boundary perception in the existing technology, achieving pixel-level accurate and high recall cloud/shadow marking in remote sensing images, and improving Improved the ability to capture shadow boundaries.
Patent Information
- Application Number
- CN202410764719.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-10-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing technology is difficult to generate pixel-level accurate, boundary-optimized, and high-recall cloud/shadow labeling results in remote sensing images, and cannot achieve boundary perception, vectorization, and fast calculation.
The UNet model is combined with the CRF module embedded in the network to optimize the segmentation predicted boundary area. The model is trained through pixel-by-pixel classification and weighted cross-entropy loss function, and multi-spectral features and long-range spatial features are used to improve the capture ability of shadow boundaries and achieve boundary-aware segmentation.
It achieves pixel-level accurate marking of clouds/shadows in remote sensing images, improves the recall rate of shadow boundaries, provides regional-level accurate or pixel-level accurate cloud/shadow marking results, and supplements the shortcomings of existing computer vision methods.
Smart Images

Figure CN118762178A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of boundary-aware segmentation vectorized calculation methods, and in particular to a cloud / shadow edge-aware segmentation vectorized fast calculation method. Background Art
[0002] my country's earth observation technology is becoming increasingly mature and widely used. Every day, a large amount of remote sensing high-resolution image data is generated by satellites in orbit, playing an increasingly important role in the country's modernization drive. Optical remote sensing images have a large amount of information, high resolution, and stable geometric positioning properties. They are widely used in the application and analysis of remote sensing data. However, about 70% of the earth's surface is covered by clouds. The collected remote sensing images are easily obscured by clouds and cloud shadows, causing the information of ground objects in the image to be attenuated, blurred, or even completely lost. Therefore, the detection of clouds and shadows under clouds is considered to be the key to the subsequent identification, classification, and interpretation of remote sensing images. It is one of the basic tasks of remote sensing image restoration and an important prerequisite for the production of seamless remote sensing products in time and space.
[0003] With the development of machine learning and computer vision technology, cloud / shadow detection has been transformed into a semantic segmentation problem. By introducing advanced segmentation models and combining labeled samples, coarse-grained cloud / shadow detection results can be obtained. However, cloud / shadow segmentation technology for remote sensing images based on deep learning has made significant breakthroughs, but the cloud / shadow detection effect of this type of method on typical remote sensing datasets (such as Landsat 8OLI and domestic high-resolution 1 data) still needs to be improved. Specifically, the labeling results generated by the algorithm are accurate in the region, but difficult to achieve pixel-level accuracy, and cannot generate boundary-accurate labeling results. Therefore, it is necessary to design a method that can generate pixel-level accurate, boundary-optimized, and high-recall cloud / shadow labeling results, and realize boundary perception, vectorization, and fast calculation in cloud / shadow prediction tasks.
[0004] It is difficult to obtain pixel-level labels for model training, cloud / snow pixels are difficult to distinguish, and cloud shadow recall rate is low. This project believes that it is possible to use the easy-to-obtain domestic data image-level weak labels (cloud / no cloud, shadow / no shadow) and multispectral features of pixels to design the corresponding coupled probability model and image weak label domestic remote sensing image cloud / shadow boundary optimization segmentation technology to obtain. At the same time, it can be combined with the cloud / shadow boundary precise segmentation model studied in the previous study to optimize the target boundary and achieve a fully compact and sharp boundary segmentation effect.
[0005] Prior art 1
[0006] Typical cloud / shadow detection methods can be roughly divided into manual labeling methods, band threshold-based methods, and learning-based methods. Among them, the manual labeling method requires domain experts to manually outline the cloud and shadow areas; the threshold method represented by CFMask detects clouds and shadows in a limited domain by observing the distribution of spectral data: this method is a multi-band algorithm that uses a decision tree to infer the pixel classification in the scene, verifies the corresponding classification labels based on the statistical data in the scene, and creates cloud and shadow labels by iteratively estimating the cloud height and projecting it to the ground.
[0007] Prior art 2
[0008] On the other hand, with the development of machine learning and computer vision technology, data-driven semantic segmentation methods on natural images have become increasingly prosperous and have achieved remarkable results. Therefore, current research focuses on transforming cloud / shadow detection into a semantic segmentation problem in computer vision tasks. By introducing advanced segmentation models and combining a large number of weakly labeled samples, coarse-grained cloud / shadow detection results can be obtained. In addition, cloud segmentation methods based on weak labels have also emerged, all of which use large-scale data to train deep learning models to achieve cloud / shadow detection.
[0009] The second disadvantage of the prior art
[0010] The above method can obtain coarse-grained cloud / shadow detection results, but its disadvantage is that the labeling result is accurate in the region, but it is difficult to achieve pixel-level accuracy and cannot generate accurate boundary labeling results. Summary of the invention
[0011] In order to solve the above technical problems, the present invention provides a cloud / shadow edge-aware segmentation vectorization fast calculation method, which solves the problem of being unable to generate boundary-accurate marking results.
[0012] The technical solution provided by the present invention is as follows:
[0013] A cloud / shadow edge-aware segmentation vectorization fast calculation method comprises the following steps:
[0014] Step S1: Use the UNet model to build a backbone network;
[0015] Step S2: Use the CRF module embedded in the network to optimize the boundary area of the segmentation prediction output by the backbone network and further separate the cloud / snow area and recall the shadow.
[0016] Preferably, the input of the UNet model in step S1 is an image to be classified pixel by pixel; the UNet model includes 4 downsampling blocks and 4 upsampling blocks; the downsampling blocks include convolution, ReLU and maximum pooling; the upsampling blocks include upsampling, convolution and ReLU.
[0017] Preferably, S1 comprises the following sub-steps:
[0018] Sub-step S11: When constructing the UNet model forward, the encoder extracts image features at all levels in layers, recombines them into higher-level semantic features, and then implements element-by-element classification in the decoder module based on the high-level semantic features;
[0019] Sub-step S12: Use residual connections to cascade intermediate layer feature maps of the same scale, and the last convolutional layer of the UNet model outputs pixel-by-pixel labels;
[0020] Sub-step S13: After obtaining accurate pixel-by-pixel labeling at the region level, the backbone network can be trained to deeply capture the multispectral features of pixels of a specific category and optimize the segmentation performance;
[0021] Sub-step S14: During training, driven by the weighted cross entropy loss function, the UNet model gradually determines the learnable parameters in the model;
[0022] Sub-step S15: The training uses a weighted multi-classification cross entropy loss function with an adaptive classification weight vector α, which enables the backbone network to focus on a smaller number of pixel samples in the segmentation task;
[0023] Sub-step S16: After the training is completed, the test image is given an expected output close to the surface cover classification.
[0024] Preferably, step S2 includes the following sub-steps:
[0025] Sub-step S21: Given the global observation value I, the boundary perception result update method is:
[0026]
[0027] χ * = argmaxQ(χ), χ∈L N
[0028] Among them, x represents the classification of each pixel; Q(x i ) represents the probability of pixel i taking category x; k (m) (f i ,f j ) represents the message passing kernel function; w (m) represents the kernel function weight; μ represents the label compatibility function; m represents the feature number subscript; ψ u (x i ) represents a univariate potential function; X* represents the optimal x; Q(x j ) represents the probability of pixel j taking category x;
[0029] Sub-step S22: using the fast bilateral message passing method to obtain the boundary-aware optimized segmentation result.
[0030] The beneficial effects of the cloud / shadow edge-aware segmentation vectorization fast calculation method of the present invention are as follows:
[0031] 1. The present invention proposes a cloud / shadow boundary-aware segmentation vectorized fast calculation method to achieve boundary-aware segmentation of clouds / shadows in remote sensing images, which can serve the production of cloud / shadow labels with regional accuracy or pixel precision.
[0032] 2. This method does not require pixel-precise cloud / shadow labels. Only image-level weak labels are needed to train the model and produce sufficient pixel-level cloud / shadow labels. It is also expected to provide a complete set of boundary-aware segmentation models and well-labeled data, which is an effective supplement to existing production methods.
[0033] 3. Compared with computer vision methods, this method makes full use of the multispectral characteristics and long-range spatial characteristics of pixels in remote sensing images, optimizes the model's sensitivity to potential shadow boundaries, effectively improves the model's ability to capture shadow boundaries, and improves the recall rate of shadows. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 This is the overall architecture diagram of the present invention. DETAILED DESCRIPTION
[0035] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.
[0036] A cloud / shadow edge-aware segmentation vectorization fast calculation method comprises the following steps:
[0037] Step S1: Use the UNet model to build a backbone network;
[0038] Step S2: Use the CRF module embedded in the network to optimize the boundary area of the segmentation prediction output by the backbone network and further separate the cloud / snow area and recall the shadow.
[0039] The input of the UNet model in step S1 of this implementation scheme is an image to be classified pixel by pixel; the UNet model includes 4 downsampling blocks and 4 upsampling blocks; the downsampling blocks include convolution, ReLU and maximum pooling; the upsampling blocks include upsampling, convolution and ReLU.
[0040] S1 of this embodiment includes the following sub-steps:
[0041] Sub-step S11: When constructing the UNet model forward, the encoder extracts image features at all levels in layers, recombines them into higher-level semantic features, and then implements element-by-element classification in the decoder module based on the high-level semantic features;
[0042] Sub-step S12: Use residual connections to cascade intermediate layer feature maps of the same scale, and the last convolutional layer of the UNet model outputs pixel-by-pixel labels;
[0043] Sub-step S13: After obtaining accurate pixel-by-pixel labeling at the region level, the backbone network can be trained to deeply capture the multispectral features of pixels of a specific category and optimize the segmentation performance;
[0044] Sub-step S14: During training, driven by the weighted cross entropy loss function, the UNet model gradually determines the learnable parameters in the model;
[0045] Sub-step S15: The training uses a weighted multi-classification cross entropy loss function with an adaptive classification weight vector α, which enables the backbone network to focus on a smaller number of pixel samples in the segmentation task;
[0046] Sub-step S16: After the training is completed, the test image is given an expected output close to the surface cover classification.
[0047] Step S2 of this embodiment includes the following sub-steps:
[0048] Sub-step S21: Given the global observation value I, the boundary perception result update method is:
[0049]
[0050] χ * = argmaxQ(χ), χ∈L N
[0051] Among them, x represents the classification of each pixel; Q(x i ) represents the probability of pixel i taking category x; k (m) (f i ,f j ) represents the message passing kernel function; w (m) represents the kernel function weight; μ represents the label compatibility function; m represents the feature number subscript; ψ u (x i ) represents a univariate potential function; X* represents the optimal x; Q(x j ) represents the probability of pixel j taking category x;
[0052] Sub-step S22: using a fast bilateral message passing method to obtain a boundary-aware optimized segmentation result.
[0053] When this implementation plan is implemented, Figure 1 As shown, the present invention cascades the UNet backbone network and the boundary optimization layer based on CRF mean field approximate reasoning to construct an end-to-end model to achieve coarse-grained positioning of deterministic boundaries and fine-grained boundary optimization. The input of the model is a 7-band high-resolution remote sensing image tile. After end-to-end boundary optimization segmentation, the segmentation prediction of the same spatial resolution is output. The splicing of remote sensing image slices and segmentation prediction tiles is preprocessing and post-processing, that is, according to the preset window size, the sliding window method is used to crop / splice into a high-resolution remote sensing image.
[0054] The present invention uses the UNet model to establish a backbone network.
[0055] The input of UNet is the image that needs to be classified pixel by pixel. When constructing the model forward, UNet extracts the image features at each level in the encoder, recombines them into higher-level semantic features, and then implements element-by-element classification in the decoder module based on the multi-level features.
[0056] UNet contains 4 downsampling blocks consisting of "Convolution-ReLU-MaxPooling" and 4 upsampling blocks consisting of "UpSample-Convolution-ReLU", and uses residual connections to cascade intermediate layer feature maps of the same scale. The last layer outputs the likelihood value of the pixel-by-pixel labeling category.
[0057] During training, driven by the weighted cross entropy loss function, the UNet construction model gradually locks the learnable parameters;
[0058] After training, the expected output for the test image is close to the land cover classification.
[0059] After obtaining accurate regional labeling (rough cloud / shadow labeling), the backbone network can be further trained to deeply capture the multispectral features of specific categories of pixels and optimize the segmentation performance.
[0060] The training process proposes to use a weighted multi-class cross entropy loss function with an adaptive classification weight vector α, which allows the backbone network to focus on a smaller number of pixel samples in the segmentation task.
[0061] Specifically, the number of pixels of category i in the current image block is M i , all categories of pixels vector M, dynamic adaptive weight vector α, weight vector element α i is the maximum value max(M) in vector M and M i The ratio of , that is, small samples in the segmentation can have higher weights. Therefore, the loss function is
[0062]
[0063] Where x represents the one-hot vector of the label, represents the prediction of the backbone network for input I0, and α is the adaptive weight vector for each category. Each element of α is dynamically calculated during training, that is,
[0064]
[0065] in, Represents category x k The dynamic weight of M i A vector representing the total count of class i.
[0066] It is then planned to use the CRF module embedded in the network to optimize the boundary area of the segmentation prediction output by the backbone network, and further separate the cloud / snow area and recall the shadow.
[0067] Given a global observation value I (a reference image with a specified number of channels, which can be a pseudo-color or multispectral image), the boundary perception result update method is
[0068]
[0069]
[0070] The fast bilateral messaging method is designed as follows.
[0071] First initialize the lattice structure, the canonical simplex Orthogonal basis Diagonal Matrix of Scale Factors for
[0072]
[0073] V δ Defined as
[0074]
[0075] and the (d+1)×(d+1)-dimensional identity matrix U d+1 .
[0076] For the bilateral eigenvector F = f n ={[w / θ α ,h / θ α ,r / θ β ,g / θ β ,b / θ β ] T}, first lift it to the subspace, that is
[0077]
[0078] Nearest acnode vertices is
[0079]
[0080] L0 = L +,L+-F'<F'-L- + L -,L+-F'≥F'-L-
[0081] And the elements of the sum vector in each dimension of the feature dimension are
[0082]
[0083] For the rank matrix First, calculate F' - L0 and sort it, that is
[0084] Δ = F' - L0.
[0085] Subsequently, broadcast Δ, add the last dimension and the penultimate dimension, denoted as Δ i and Δ j , that is
[0086] Δ i = Δ(:, :, 1)
[0087] Δ j = Δ(:, 1, :).
[0088] Respectively extract the parts of Δ i <Δ j and Δ i ≥ Δ j and use V δ to extract the upper triangular part (excluding the diagonal), that is
[0089] Δ i<j = I(Δ i <Δ j )·V δ (1, :, :)
[0090] Δ i≥j = I(Δ i ≥ Δ j )·V δ (1, :, :).
[0091] Let δ ∈ Δ, respectively take the parts of i < j and i ≥ j, and respectively implement reduction addition for j and i. The update method for the corresponding elements of the rank matrix R is
[0092]
[0093] First, use s0 to update the rank matrix R, and then use r+d+1(l0+d+1) and rd-1(l0-d-1) to update the parts of R and L0 where R<0 and R>d. The update method of R and L0 is
[0094] R←R+s0(1,:)
[0095] R←(R+[d]+1) R<0 +(R-[d]-1) R>d +R 0≤R≤d
[0096] L0←(L0+[d]+1) R<0 +(L0-[d]-1) R>d +L 0,0≤R≤d .
[0097] Center of gravity weight for
[0098]
[0099] And update the dimension after [d]-R+1 arrangement, that is
[0100]
[0101] Then update the first dimension, that is
[0102] B :,1 ←B :,1 +B :,d+2 +1.
[0103] For i = 1, ..., d + 1 and j = 1, ..., d, the key Offset And weight The specific calculation is as follows. S' d for
[0104]
[0105] key By L0 and S' d Calculate and rearrange to get, that is
[0106] K=reshape(L0(:,1,:d)+S′ d (:,:,:d),(-1,d)),
[0107] Offset Use the hash table to insert the key value and add 1 to get it, that is
[0108] O = HashTable.insert(K)+1
[0109] Weight By rearranging the centroid weight B, we get
[0110] W = reshape(B(:,:d+1),-1).
[0111] Assume that M keys are finally available. For each key k h And for each axis j=1,…,d+1, its fuzzy neighbors are
[0112] K - =K h (:,d+1,:)-1+dU d+1 (1,:,:d)+U d+1 (1,:,:d)
[0113] K + =K h (:,d+1,:)+1-dU d+1 (1,:,:d)-U d+1 (1,:,:d).
[0114] Then the keys of the fuzzy neighbors are rearranged, that is
[0115] K - ←reshape(K - ,(-1,d))
[0116] K + ←reshape(K + ,(-1,d)).
[0117] The offset of the fuzzy neighbor can be obtained by looking up the hash table, i.e.
[0118] U - =HashTable.lookup(Kx)
[0119] U + =HashTable.lookup(K + ).
[0120] Then the offsets of the fuzzy neighbors are rearranged, that is
[0121] U - ←reshape(U - ,(M,d+1))
[0122] U + ←reshape(U + ,(M,d+1)).
[0123] Bilateral message passing can be accomplished by following the steps below. n∈Q are all divided: select the partition offset o according to the subscript n ni , with w ni is the weight, and is divided into
[0124]
[0125] For m = 2, ..., M + 1 and j = 1, ..., d + 1, the fuzzy neighbors are first selected according to their offset u, and then the weighted fuzzy operation is performed, that is,
[0126]
[0127] Finally, given α = 1 / (1+2 -d ), according to the partition offset O, the Q weight is mapped back to the original space, that is,
[0128] Q * =α·W(:,1)·Q′ O ,
[0129] And rearrange Q, that is
[0130] Q * ←reshape(Q * ,(N,d+1,C)),
[0131] And Q * Each element of is obtained by summing the second dimension (i.e., j), that is,
[0132]
[0133] The obtained Q * That is the boundary-aware optimized segmentation result.
Claims
1. A cloud / shadow edge-aware segmentation vectorization fast calculation method, characterized in that: The following steps are involved: Step S1: Use the UNet model to build a backbone network; Step S2: Use the CRF module embedded in the network to optimize the boundary area of the segmentation prediction output by the backbone network and further separate the cloud / snow area and recall the shadow.
2. The boundary-aware segmentation vectorization fast calculation method according to claim 1 is characterized in that: The input of the UNet model in step S1 is an image to be classified pixel by pixel; the UNet model includes 4 downsampling blocks and 4 upsampling blocks; the downsampling blocks include convolution, ReLU and maximum pooling; the upsampling blocks include upsampling, convolution and ReLU.
3. The boundary-aware segmentation vectorization fast calculation method according to claim 1 is characterized in that: The S1 comprises the following sub-steps: Sub-step S11: When constructing the UNet model forward, the encoder extracts image features at all levels in layers, recombines them into higher-level semantic features, and then implements element-by-element classification in the decoder module based on the high-level semantic features; Sub-step S12: Use residual connections to cascade intermediate layer feature maps of the same scale, and the last convolutional layer of the UNet model outputs pixel-by-pixel labels; Sub-step S13: After obtaining accurate pixel-by-pixel labeling at the region level, the backbone network can be trained to deeply capture the multispectral features of pixels of a specific category and optimize the segmentation performance; Sub-step S14: During training, driven by the weighted cross entropy loss function, the UNet model gradually determines the learnable parameters in the model; Sub-step S15: The training uses a weighted multi-classification cross entropy loss function with an adaptive classification weight vector α, which enables the backbone network to focus on a smaller number of pixel samples in the segmentation task; Sub-step S16: After the training is completed, the test image is given an expected output close to the surface cover classification.
4. The boundary-aware segmentation vectorization fast calculation method according to claim 1 is characterized in that: The step S2 comprises the following sub-steps: Sub-step S21: Given the global observation value I, the boundary perception result update method is: x * =arg max Q(χ),χ∈L N Among them, x represents the classification of each pixel; Q(x i ) represents the probability of pixel i taking category x; k (m) (f i ,f j ) represents the message passing kernel function; w (m) represents the kernel function weight; μ represents the label compatibility function; m represents the feature number subscript; ψ u (x i ) represents a univariate potential function; X* represents the optimal x; Q(x j ) represents the probability of pixel j taking category x; Sub-step S22: using the fast bilateral message passing method to obtain the boundary-aware optimized segmentation result.
Citation Information
Patent Citations
Remote sensing image cloud detection method based on feature multi-scale perception and adaptive aggregation
CN114494821A
Cited By
Parallelization boundary perception cloud or shadow rapid segmentation method
CN121329997A
