Water body extraction system and method based on a hollow convolution and a dynamic snake convolution
By combining dilated convolution and dynamic serpentine convolution, the problems of feature loss of small water bodies and difficulty in extracting narrow water bodies in high-resolution remote sensing images are solved, achieving efficient and automated water body extraction results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- LANGFANG YUANGUAN TECHNOLOGY CO LTD
- Filing Date
- 2025-11-25
- Publication Date
- 2026-05-26
AI Technical Summary
In high-resolution remote sensing images, existing technologies often result in the loss of features of small water bodies, difficulty in extracting narrow water bodies, limited generalization ability of traditional methods, and severe interference from shadows.
A water body extraction system based on dilated convolution and dynamic serpentine convolution is adopted. Feature extraction is performed by combining residual multi-scale network with dilated convolution, dynamic serpentine convolution adaptively adjusts the shape of convolution kernel, and attention mechanism is combined to process features. Finally, water body feature map is reconstructed through multi-scale fusion and upsampling operations.
It effectively captures the characteristics of small water bodies, accurately extracts the boundaries of narrow water bodies, improves the model's ability to distinguish water bodies in complex backgrounds, and realizes fully automated water body extraction.
Smart Images

Figure CN121330516B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of remote sensing image processing technology, specifically to a water extraction system and method based on dilated convolution and dynamic serpentine convolution. Background Technology
[0002] With the development of remote sensing technology, high-resolution remote sensing imagery has become an important data source for water body extraction. However, due to the complex and varied morphology of surface water bodies, the extraction of small and narrow water bodies, in particular, still faces severe challenges.
[0003] Traditional water body extraction methods mainly include the water index method and machine learning-based methods. The water index method distinguishes water bodies by calculating the reflectance ratio of different wavelengths, but the threshold determination is highly subjective and easily affected by shadows. Machine learning-based methods rely on manually designed features, requiring adjustments to feature combinations for different regions, and have limited generalization ability.
[0004] In recent years, deep learning technology has been widely applied to water body extraction tasks. Some studies have improved extraction results by improving network structure, using dilated convolutions, or multi-scale feature fusion. However, in sub-meter high-resolution images, features of small water bodies are easily lost during multiple downsampling processes, and narrow water bodies are difficult to extract accurately due to the limitations of fixed-shape convolution kernels. Although dynamic serpentine convolutions have been successfully applied in medical imaging, their potential in the field of water body extraction has not yet been fully explored.
[0005] Therefore, there is an urgent need to develop a new method that can effectively solve the problems of feature loss in small water bodies and the difficulty of extracting from narrow water bodies. Summary of the Invention
[0006] The purpose of this invention is to provide a water extraction system and method based on dilated convolution and dynamic serpentine convolution to solve the problems raised in the prior art.
[0007] To achieve the above objectives, the present invention provides the following technical solution: a water extraction system and method based on dilated convolution and dynamic serpentine convolution.
[0008] The methods include:
[0009] Step S1: Acquire historical remote sensing images containing information about surface water bodies, preprocess the historical remote sensing images, and crop the preprocessed images into image slices of a preset size.
[0010] Step S2: Interpret and label the water bodies in the image slices to generate water body vector data, and generate water body mask labels based on the water body vector data; combine the image slices with the corresponding water body mask labels to construct a water body dataset, and divide the water body dataset into a training set, a validation set and a test set;
[0011] Step S3: Feature extraction is performed on the input image using a residual multi-scale network combined with dilated convolution. The extracted features are then fused at multiple scales. Dynamic serpentine convolution and an attention mechanism are used in parallel to process the features. Finally, an output feature map of the same size as the input image is reconstructed through upsampling. The design of using a residual multi-scale network combined with dilated convolution aims to expand the receptive field while maintaining the feature map resolution, thereby effectively capturing water features at different scales. Multi-scale fusion processing enhances the model's ability to identify small water bodies by integrating feature information from different levels. Dynamic serpentine convolution can adaptively adjust the shape of the convolution kernel to effectively capture the morphological features of narrow water bodies, while the attention mechanism improves the model's ability to distinguish water bodies in complex backgrounds by focusing on important feature regions.
[0012] Step S4: Train the water body extraction network model using the training set, calculate the difference between the predicted value and the true label using the loss function, update the network parameters through backpropagation, and use the validation set for performance evaluation and hyperparameter tuning. Finally, evaluate the model's generalization performance using the test set to obtain the trained water body extraction model. Specifically, the difference between the predicted result and the true label is quantified using the cross-entropy loss function, and the network parameters are optimized using the backpropagation algorithm to enable the model to accurately learn the water body feature representation. The validation set is used to monitor the training process and adjust hyperparameters to prevent overfitting; the test set is used to finally evaluate the model's generalization ability.
[0013] Step S5: Obtain the current remote sensing image of the water body to be extracted, preprocess and crop it according to the method in step S1, and input it into the trained water extraction model to output the water extraction result; in this way, by applying the trained model to new remote sensing images, the automatic extraction of water information is realized, providing technical support for water resource monitoring and management.
[0014] Furthermore, step S1 includes:
[0015] Step S1-1: Acquire historical remote sensing images containing surface water information, and perform radiometric correction on the historical remote sensing images, including radiometric calibration and atmospheric correction; the radiometric calibration is to establish a quantitative relationship between digital quantization values and radiance values in the corresponding field of view; the atmospheric correction is based on the MODRAN4+ radiative transfer algorithm to convert radiance values into actual surface reflectance; the purpose of radiometric correction is to eliminate sensor errors and atmospheric effects to obtain accurate surface reflectance information.
[0016] Step S1-2: Perform orthorectification on the radiometrically corrected image, and use the digital elevation model to perform terrain deformation correction on all pixels in the image; the purpose of orthorectification is to eliminate geometric deformation caused by terrain undulation and sensor attitude, and obtain an image with accurate geographic coordinates.
[0017] Steps S1-3: Perform image fusion on the orthorectified images to generate a composite image; the purpose of image fusion is to integrate multi-source remote sensing data to generate images with richer spatial and spectral features.
[0018] Furthermore, step S2 includes:
[0019] Step S2-1: The water information in the image slice is visually interpreted and labeled by professional interpreters to create visually interpreted water vectors; water masks are generated based on the water vectors to generate water labels; wherein, the accuracy of the labeling is ensured by visual interpretation by professional interpreters, providing high-quality supervision information for model training;
[0020] Step S2-2: Cut the original image and the corresponding water body label into 512×512 pixel image slices to construct a water body dataset for training, and divide the water body dataset into a training set, a validation set and a test set; wherein, cutting large-size images into slices of fixed size is convenient for deep learning models to process and can ensure the diversity of training data.
[0021] Furthermore, step S3 includes:
[0022] Step S3-1: The input image is downsampled. The 512×512 pixel image slice is downsampled to 256×256 pixels through a convolutional layer with a stride of 2, and then input into the residual multi-scale network layer for feature extraction to obtain the first-level feature map. High-level semantic features are extracted step by step through the downsampling operation, while the residual multi-scale network is used to capture water features at multiple scales.
[0023] Step S3-2: Perform multi-scale fusion processing on the first-level feature map. First, the first-level feature map is convolved with 1×1 to obtain a channel-compressed feature map. A set of convolution kernel sizes and a set of dilation rates are defined. Multiple parallel convolution branches extract different visual perception feature information from the channel-compressed feature map. Each convolution branch selects a kernel size from the kernel size set and a dilation rate from the dilation rate set to form feature extraction paths with different receptive fields. The receptive field represents the area size in the original input image corresponding to a pixel in the output feature map of each convolution branch. The feature information output by each branch is concatenated to obtain a multi-scale fusion feature. Finally, the multi-scale fusion feature is fused with the channel-compressed feature map through 1×1 convolution to obtain the second-level feature map. The multi-scale fusion processing extracts features from different receptive fields through parallel convolution branches, effectively capturing multi-scale information from local details to global context. Channel compression and feature concatenation operations ensure computational efficiency while enhancing feature representation capabilities.
[0024] Step S3-3: The second-level feature map is simultaneously processed by dynamic serpentine convolution and dual attention. The input features are fed into the dynamic serpentine convolution branch and the dual attention branch in parallel. The dynamic serpentine convolution iteratively adjusts the kernel coordinates to form a linear structure, while the dual attention branch processes features through feature aggregation and allocation. The output features of the two branches are fused element-wise to obtain the third-level feature map. The dynamic serpentine convolution, by iteratively adjusting the kernel shape, accurately captures the long and winding water body boundaries. The dual attention mechanism, through feature aggregation and allocation, enhances the model's focus on important features. The parallel processing of both achieves an effective combination of local details and global context. In the dynamic serpentine convolution, when the kernel size is set to 9, the sampling points along the x-axis are denoted as... , where index The convolutional kernel, used to represent the offset distance of each sampling point relative to the center grid, employs a progressive coordinate update mechanism: based on the center position... As the starting point, the location of subsequent sampling points The coordinates are from the previous position The coordinates are superimposed with an offset. It is found that through this continuously dependent coordinate update method, the convolution kernel naturally forms a linear structural feature in the x-axis direction that matches the meandering shape of the water body.
[0025] Step S3-4: The size of the third-level feature map is enlarged by repeated upsampling operations, and then added and fused with the feature map of the same scale retained in the encoder to reconstruct an output feature map with the same size as the input image; wherein, spatial details are gradually restored through upsampling and feature fusion operations to ensure that the output feature map is consistent with the size of the input image, thereby achieving pixel-level water extraction.
[0026] Furthermore, step S4 includes:
[0027] Step S4-1: Input the training set into the network model and calculate the water or non-water body classification prediction label of the pixel through forward propagation; wherein, the forward propagation process is calculated through a multi-layer network to gradually extract and transform features, and finally output the classification result of each pixel;
[0028] Step S4-2: Using the cross-entropy loss function, calculate the difference between the predicted classification label and the real water body label pixel by pixel to obtain the loss value of each pixel, and aggregate the loss values of all pixels to obtain the overall loss value characterizing the prediction effect of the image slice; wherein, the cross-entropy loss function can effectively measure the difference between the predicted distribution and the real distribution, and the pixel-by-pixel calculation ensures accurate supervision of each location;
[0029] Step S4-3: Based on the overall loss value, calculate the gradient using the backpropagation algorithm, and update the network weights using the optimizer to minimize the cross-entropy loss function; wherein, the backpropagation algorithm calculates the gradient using the chain rule, and the optimizer continuously adjusts the network parameters using the gradient descent strategy, so that the model prediction results gradually approach the true label.
[0030] Furthermore, step S5 includes:
[0031] Step S5-1: Acquire current remote sensing images containing surface water information, preprocess them according to the radiometric correction, orthorectification and image fusion methods described in step S1, and crop them into 512×512 pixel image slices; wherein, a standardized preprocessing process ensures that the input data and training data have the same data distribution and format;
[0032] Step S5-2: Input the remote sensing image slices into the trained water body extraction network model for processing, and generate water body extraction results based on the output feature map; wherein, the trained model can automatically extract water body features from the input image and output the corresponding water body probability map;
[0033] Step S5-3: Based on the water body extraction results of all remote sensing image slices, determine the water body distribution information in the current remote sensing image; wherein, by integrating the extraction results of all slices, a complete water body distribution map is reconstructed to provide data support for subsequent water resource analysis.
[0034] The system includes: an image acquisition and preprocessing module, a dataset construction module, a network construction module, a model training module, and a water body extraction module;
[0035] The image acquisition and preprocessing module is used to acquire historical remote sensing images containing information about surface water bodies, preprocess the historical remote sensing images, and crop the preprocessed images into image slices of a preset size.
[0036] The dataset construction module is used to interpret and label the water bodies in the image slices, generate water body vector data, generate water body mask labels based on the water body vector data, combine the image slices with the corresponding water body mask labels to construct a water body dataset, and divide the water body dataset into a training set, a validation set and a test set.
[0037] The network construction module is used to extract features from the input image through a residual multi-scale network combined with dilated convolution, perform multi-scale fusion processing on the extracted features, use dynamic snake convolution and attention mechanism to process features in parallel, and reconstruct an output feature map with the same size as the input image through upsampling operation.
[0038] The model training module is used to train the water body extraction network model using the training set, calculate the difference between the predicted value and the true label using the loss function, update the network parameters through backpropagation, evaluate the performance and tune the hyperparameters using the validation set, and finally evaluate the generalization performance of the model through the test set to obtain the trained water body extraction model.
[0039] The water extraction module is used to acquire the current remote sensing image of the water body to be extracted. After preprocessing and cropping according to the method of the image acquisition and preprocessing module, it is input into the trained water extraction model and the water extraction result is output.
[0040] The image acquisition and preprocessing module includes:
[0041] A radiometric correction unit is used to acquire historical remote sensing images containing information about surface water bodies and to perform radiometric correction on the historical remote sensing images, including radiometric calibration and atmospheric correction.
[0042] Orthorectification unit, used to orthorectify radiometrically corrected images;
[0043] The image fusion unit is used to perform image fusion on orthorectified images;
[0044] The dataset building module includes:
[0045] The annotation unit is used to perform visual interpretation and annotation of water body information in the image slice, create water body vectors and generate water body labels;
[0046] The dataset partitioning unit is used to cut the original image and the corresponding water body label into image slices, construct the water body dataset and divide it into training set, validation set and test set.
[0047] The network building blocks include:
[0048] The feature extraction unit is used to downsample the input image and extract features through a residual multi-scale network.
[0049] The multi-scale fusion unit is used to perform multi-scale fusion processing on the extracted features, and extracts feature information of different visual perceptions through multiple parallel convolutional branches.
[0050] The feature optimization unit is used to simultaneously perform dynamic serpentine convolution and dual attention processing on the fused features;
[0051] The feature reconstruction unit is used to reconstruct an output feature map of the same size as the input image through an upsampling operation;
[0052] The model training module includes:
[0053] The forward propagation unit is used to input the training set into the network model and calculate the classification prediction label through forward propagation;
[0054] The loss calculation unit is used to calculate the difference between the predicted label and the true label using the cross-entropy loss function to obtain the overall loss value;
[0055] The parameter update unit is used to update the network weights based on the overall loss value using the backpropagation algorithm.
[0056] The water extraction module includes:
[0057] The preprocessing unit is used to acquire current remote sensing images and perform preprocessing and cropping.
[0058] The inference unit is used to input the preprocessed image slices into the trained water extraction network model for processing.
[0059] The result generation unit is used to determine water body distribution information based on the processing results of all image slices.
[0060] Compared with the prior art, the beneficial effects of the present invention are:
[0061] 1. In this invention, the multi-scale feature fusion module captures feature information at different scales through parallel convolution branches, ensuring that the features of small water bodies are not lost during multiple downsampling processes; the dynamic serpentine convolution accurately tracks the meandering boundaries of narrow water bodies by adaptively adjusting the shape of the convolution kernel.
[0062] 2. The dual attention mechanism introduced in this invention enables the model to adaptively focus on important feature regions while suppressing interference from non-water areas through feature aggregation and allocation operations. Furthermore, the rich contextual information provided by the multi-scale feature fusion module further enhances the model's ability to distinguish between water and non-water regions.
[0063] 3. This invention constructs a complete water body extraction process, from data preprocessing and model training to the final extraction of water body information, achieving fully automated processing. Through an end-to-end deep learning network, it avoids the cumbersome feature engineering and manual threshold adjustment processes of traditional methods. Attached Figure Description
[0064] Figure 1 This is a schematic diagram of the water extraction method based on dilated convolution and dynamic serpentine convolution of the present invention. Detailed Implementation
[0065] 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.
[0066] Example: Figure 1 As shown, this invention provides a technical solution: a water extraction system and method based on dilated convolution and dynamic serpentine convolution.
[0067] The methods include:
[0068] Step S1: Acquire historical remote sensing images containing information about surface water bodies, preprocess the historical remote sensing images, and crop the preprocessed images into image slices of a preset size.
[0069] Step S2: Interpret and label the water bodies in the image slices to generate water body vector data, and generate water body mask labels based on the water body vector data; combine the image slices with the corresponding water body mask labels to construct a water body dataset, and divide the water body dataset into a training set, a validation set and a test set;
[0070] Step S3: Extract features from the input image using a residual multi-scale network combined with dilated convolution, perform multi-scale fusion processing on the extracted features, use dynamic snake convolution and attention mechanism to process features in parallel, and reconstruct an output feature map with the same size as the input image through upsampling operation;
[0071] Step S4: Train the water body extraction network model using the training set, calculate the difference between the predicted value and the true label using the loss function, update the network parameters through backpropagation, evaluate the performance and tune the hyperparameters using the validation set, and finally evaluate the generalization performance of the model through the test set to obtain the trained water body extraction model.
[0072] Step S5: Obtain the current remote sensing image of the water body to be extracted, preprocess and crop it according to the method in step S1, input it into the trained water extraction model, and output the water extraction result.
[0073] Furthermore, step S1 includes:
[0074] Step S1-1: Acquire satellite remote sensing images covering a plain watershed, including water bodies such as rivers, ponds, and irrigation canals, as well as backgrounds such as farmland and buildings;
[0075] Radiometric calibration: Based on the calibration coefficients provided by satellite sensors, a quantitative relationship is established between the digital quantization value of the image and the radiance value at the sensor inlet, eliminating the sensor's own response error and obtaining accurate radiance data;
[0076] Atmospheric correction: The MODTRAN4+ radiative transfer algorithm is used to perform pixel-level correction on the radiance data, eliminating errors caused by atmospheric scattering, absorption and reflection, converting the radiance value into the actual surface reflectance, and improving the spectral authenticity of the image.
[0077] Step S1-2: Obtain the 30m resolution digital elevation model (DEM) of the watershed, use the DEM to correct the terrain deformation of the radiometrically corrected image, and at the same time eliminate the geometric deformation caused by camera orientation and sensor error, and output a planar real image that meets the requirements of orthophoto projection.
[0078] Step S1-3: The Pan-sharpening fusion algorithm is used to fuse the high-resolution panchromatic band with the multispectral band to generate a synthetic image with both high spatial resolution and rich spectral information. This fully utilizes the complementary features of different band data to provide support for subsequent water feature extraction.
[0079] Steps S1-4: The fused image is cropped into image slices of 512×512 pixels. The edges that are not full are filled with zero, resulting in a total of 2000 slices for subsequent processing.
[0080] Furthermore, step S2 includes:
[0081] Step S2-1: A professional with remote sensing interpretation experience performs visual interpretation of the image slices obtained in step S1: all water areas are labeled, including irrigation canals with a width of <3m and ponds with an area of <50㎡, vector data is generated, and a binary water body mask label is generated based on the vector data: the pixel value of the water area is set to 1, and the non-water area is set to 0. The label size is consistent with the original slice size of 512×512 pixels.
[0082] Step S2-2: Combine the "image slice-mask label" pairs to construct a water body dataset containing 2000 sets of data, and randomly divide it in a 7:2:1 ratio: training set: 1400 sets for model parameter learning; validation set: 400 sets for hyperparameter tuning; test set: 200 sets for generalization performance evaluation.
[0083] Furthermore, step S3 includes:
[0084] Step S3-1: Input a 512×512 pixel image slice into the network, downsample it to 256×256 pixels through a 3×3 convolutional layer with a stride of 2, and input it into a Res2NetLayer. The Res2NetLayer is composed of 4 stacked Res2NetBlocks, which can express multi-scale features at a fine-grained level and increase the receptive field size of each layer. After processing by this layer, the output first-level feature map contains two sets: 256×256 pixels (branch): retains more detailed features of the original image, with high spatial resolution but shallow semantic information; 128×128 pixels (main path): after deeper convolutional processing, it contains richer semantic features, with reduced spatial resolution but a larger receptive field, and can capture the distribution trend of water bodies over a large area.
[0085] Step S3-2: Process the 256×256 pixel branch features (branch portion of the first-level feature map) output in step S3-1:
[0086] Channel compression: 64 channels are compressed to 32 channels using 1×1 convolution, reducing computational load;
[0087] Multi-branch feature extraction: Set a set of convolution kernel sizes containing several kernel sizes and a set of dilation rates containing several dilation rates. Extract feature information of different visual perceptions from the channel-compressed feature map through multiple parallel convolution branches. Each convolution branch selects a kernel size from the kernel size set and a dilation rate from the dilation rate set for combination configuration to form feature extraction paths with different receptive fields.
[0088] Feature fusion: The feature information output from each branch is concatenated to obtain multi-scale fused features. Finally, the multi-scale fused features are fused with the channel-compressed feature map through a 1×1 convolution to obtain a second-level feature map, which is retained for decoding fusion. This feature map not only retains the detailed information of the branch features but also integrates semantic features at different scales, effectively alleviating the problem of easy loss of small water body features during processing. The 128×128 and 64×64 pixel branch features generated after processing the main features are all processed and retained according to the above MBDC module process.
[0089] Step S3-3: Process the 128×128 pixel main path features output from step S3-1:
[0090] Dynamic serpentine convolution branch: Employing a convolution kernel of a specific size, the kernel coordinates are iteratively adjusted to form a linear morphological structure, adapting to the shape of narrow water bodies and extracting their morphological features. In the dynamic serpentine convolution, when the kernel size is set to 9, the sampling points along the x-axis are denoted as... , where index The convolutional kernel, used to represent the offset distance of each sampling point relative to the center grid, employs a progressive coordinate update mechanism: based on the center position... As the starting point, the location of subsequent sampling points The coordinates are from the previous position The coordinates are superimposed with an offset. Thus, through this continuously dependent coordinate update method, the convolution kernel naturally forms a linear structural feature in the x-axis direction that conforms to the meandering shape of the water body; the formula in the x-axis direction is: The formula along the y-axis is: Due to the offset Typically, the result is a decimal; bilinear interpolation is used to obtain more accurate pixels. The bilinear interpolation formula is: ,in Indicates the decimal position of the x-axis and y-axis expressions. Represents the spatial location of an integer. The bilinear interpolation kernel is decomposed into two one-dimensional kernels as shown in the following equation: ;
[0091] Dual attention branch: Features are processed through feature aggregation and feature allocation mechanisms to achieve complementary fusion of global and local features.
[0092] Feature fusion: The output features of the two processing steps are fused element-wise to obtain a third-level feature map. This feature map integrates the local morphological features and global contextual information of the narrow water body, significantly improving the distinguishability of the narrow water body from obscure backgrounds such as shadows and dark vegetation. Subsequent 64×64 pixel main path features are fused in the same way. Module process handling;
[0093] Step S3-4: After processing by MBDC, the 32×32 pixel main path features are upsampled to 64×64 pixels through transposed convolution with a stride of 2, and then fused with the 64×64 pixel branch features retained in step S3-2. Repeated upsampling: 64×64→128×128→256×256→512×512 pixels, each level is fused with the branch features of the corresponding scale, finally reconstructing an output feature map with the same size as the input.
[0094] Furthermore, step S4 includes:
[0095] Step S4-1: Input the training set slices into the network constructed in step S3, and obtain the water / non-water body classification prediction label for each pixel through forward propagation;
[0096] Step S4-2: Using the cross-entropy loss function, calculate the difference between the classification prediction label and the real water body label pixel by pixel to obtain the loss value of each pixel, and aggregate the loss values of all pixels to obtain the overall loss value that characterizes the prediction effect of the image slice.
[0097] Step S4-3: Based on the overall loss value, calculate the gradient using the backpropagation algorithm; use the Adam optimizer to update the network weights to minimize the cross-entropy loss function; calculate the cross-union ratio (CUI) using the validation set after each training cycle; stop training when the CUI does not improve for 15 consecutive cycles and save the optimal model.
[0098] Step S4-4: Input the test set into the trained model and evaluate the model's generalization performance on unseen data, including metrics such as crossover ratio, accuracy in extracting small water bodies, and accuracy in extracting narrow water bodies.
[0099] Furthermore, step S5 includes:
[0100] Step S5-1: Obtain the current satellite remote sensing image of the watershed, and perform radiometric correction, orthorectification, and image fusion according to the methods in steps S1-1 to S1-3, and crop it into 512×512 pixel slices.
[0101] Step S5-2: Input the preprocessed slices into the model trained in step S4, and output a 512×512 pixel binarized result (1 for water body, 0 for non-water body).
[0102] Step S5-3: Stitch together all the slice results to obtain the current water distribution vector map of the watershed, which includes the location, boundary and morphological information of the water bodies.
[0103] The system includes: an image acquisition and preprocessing module, a dataset construction module, a network construction module, a model training module, and a water body extraction module;
[0104] The image acquisition and preprocessing module is used to acquire historical remote sensing images containing information about surface water bodies, preprocess the historical remote sensing images, and crop the preprocessed images into image slices of a preset size.
[0105] The dataset construction module is used to interpret and label the water bodies in the image slices, generate water body vector data, generate water body mask labels based on the water body vector data, combine the image slices with the corresponding water body mask labels to construct a water body dataset, and divide the water body dataset into a training set, a validation set and a test set.
[0106] The network construction module is used to extract features from the input image through a residual multi-scale network combined with dilated convolution, perform multi-scale fusion processing on the extracted features, use dynamic snake convolution and attention mechanism to process features in parallel, and reconstruct an output feature map with the same size as the input image through upsampling operation.
[0107] The model training module is used to train the water body extraction network model using the training set, calculate the difference between the predicted value and the true label using the loss function, update the network parameters through backpropagation, evaluate the performance and tune the hyperparameters using the validation set, and finally evaluate the generalization performance of the model through the test set to obtain the trained water body extraction model.
[0108] The water extraction module is used to acquire the current remote sensing image of the water body to be extracted. After preprocessing and cropping according to the method of the image acquisition and preprocessing module, it is input into the trained water extraction model and the water extraction result is output.
[0109] The image acquisition and preprocessing module includes:
[0110] A radiometric correction unit is used to acquire historical remote sensing images containing information about surface water bodies and to perform radiometric correction on the historical remote sensing images, including radiometric calibration and atmospheric correction.
[0111] Orthorectification unit, used to orthorectify radiometrically corrected images;
[0112] The image fusion unit is used to perform image fusion on orthorectified images;
[0113] The dataset building module includes:
[0114] The annotation unit is used to perform visual interpretation and annotation of water body information in the image slice, create water body vectors and generate water body labels;
[0115] The dataset partitioning unit is used to cut the original image and the corresponding water body label into image slices, construct the water body dataset and divide it into training set, validation set and test set.
[0116] The network building blocks include:
[0117] The feature extraction unit is used to downsample the input image and extract features through a residual multi-scale network.
[0118] The multi-scale fusion unit is used to perform multi-scale fusion processing on the extracted features, and extracts feature information of different visual perceptions through multiple parallel convolutional branches.
[0119] The feature optimization unit is used to simultaneously perform dynamic serpentine convolution and dual attention processing on the fused features;
[0120] The feature reconstruction unit is used to reconstruct an output feature map of the same size as the input image through an upsampling operation;
[0121] The model training module includes:
[0122] The forward propagation unit is used to input the training set into the network model and calculate the classification prediction label through forward propagation;
[0123] The loss calculation unit is used to calculate the difference between the predicted label and the true label using the cross-entropy loss function to obtain the overall loss value;
[0124] The parameter update unit is used to update the network weights based on the overall loss value using the backpropagation algorithm.
[0125] The water extraction module includes:
[0126] The preprocessing unit is used to acquire current remote sensing images and perform preprocessing and cropping.
[0127] The inference unit is used to input the preprocessed image slices into the trained water extraction network model for processing.
[0128] The result generation unit is used to determine water body distribution information based on the processing results of all image slices.
[0129] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
Claims
1. A water extraction method based on dilated convolution and dynamic serpentine convolution, characterized in that: Includes the following steps: Step S1: Acquire historical remote sensing images containing information about surface water bodies, preprocess the historical remote sensing images, and crop the preprocessed images into image slices of a preset size. Step S2: Interpret and label the water bodies in the image slices to generate water body vector data, and generate water body mask labels based on the water body vector data; combine the image slices with the corresponding water body mask labels to construct a water body dataset, and divide the water body dataset into a training set, a validation set and a test set; Step S3: Extract features from the input image using a residual multi-scale network combined with dilated convolution, perform multi-scale fusion processing on the extracted features, use dynamic snake convolution and attention mechanism to process features in parallel, and reconstruct an output feature map with the same size as the input image through upsampling operation; Step S3 includes: Step S3-1: Downsample the input image by passing a 512×512 pixel image slice downsampled to 256×256 pixels through a convolutional layer with a stride of 2, and input it into the residual multi-scale network layer for feature extraction to obtain the first-level feature map. Step S3-2: Perform multi-scale fusion processing on the first-level feature map. First, the first-level feature map is convolved with 1×1 to obtain a channel-compressed feature map. A set of convolution kernel sizes and a set of dilation rates are set. Multiple parallel convolution branches are used to extract different visually perceptual feature information from the channel-compressed feature map. Each convolution branch selects a kernel size from the kernel size set and a dilation rate from the dilation rate set to form feature extraction paths with different receptive fields. The receptive field represents the area size in the original input image corresponding to a pixel in the output feature map of each convolution branch. The feature information output by each branch is concatenated to obtain a multi-scale fusion feature. Finally, the multi-scale fusion feature is fused with the channel-compressed feature map using 1×1 convolution to obtain the second-level feature map. Step S3-3: Perform dynamic serpentine convolution and dual attention processing on the second-level feature map simultaneously. Input features are fed into the dynamic serpentine convolution branch and the dual attention branch in parallel. The dynamic serpentine convolution forms a linear structure by iteratively adjusting the kernel coordinates, while the dual attention branch processes features through feature aggregation and feature allocation mechanisms. The output features of the two branches are fused by element-wise addition to obtain the third-level feature map. Step S3-4: The size of the third-level feature map is enlarged by repeated upsampling operations, and then added and fused with the feature map of the same scale retained in the encoder to reconstruct an output feature map of the same size as the input image. Step S4: Train the water body extraction network model using the training set, calculate the difference between the predicted value and the true label using the loss function, update the network parameters through backpropagation, evaluate the performance and tune the hyperparameters using the validation set, and finally evaluate the generalization performance of the model through the test set to obtain the trained water body extraction model. Step S5: Obtain the current remote sensing image of the water body to be extracted, preprocess and crop it according to the method in step S1, input it into the trained water extraction model, and output the water extraction result.
2. The water extraction method based on dilated convolution and dynamic serpentine convolution according to claim 1, characterized in that: Step S1 includes: Step S1-1: Acquire historical remote sensing images containing information about surface water bodies, and perform radiometric correction on the historical remote sensing images, including radiometric calibration and atmospheric correction; the radiometric calibration is to establish a quantitative relationship between digital quantization values and radiance values in the corresponding field of view; the atmospheric correction is to convert radiance values into actual surface reflectance based on the MODRAN4+ radiative transfer algorithm. Step S1-2: Perform orthorectification on the radiometrically corrected image and use the digital elevation model to perform terrain deformation correction on all pixels in the image. Step S1-3: Perform image fusion on the orthorectified image to generate a composite image.
3. The water extraction method based on dilated convolution and dynamic serpentine convolution according to claim 2, characterized in that: Step S2 includes: Step S2-1: Visual interpretation and water body annotation of the water body information in the image slice by professional interpreters, and creation of visually interpreted water body vectors; water body masking based on the water body vectors to generate water body labels; Step S2-2: Cut the original image and the corresponding water body label into 512×512 pixel image slices to construct a water body dataset for training, and divide the water body dataset into a training set, a validation set and a test set.
4. The water extraction method based on dilated convolution and dynamic serpentine convolution according to claim 3, characterized in that, Step S4 includes: Step S4-1: Input the training set into the network model and calculate the water or non-water body classification prediction label of the pixel through forward propagation; Step S4-2: Using the cross-entropy loss function, calculate the difference between the classification prediction label and the real water body label pixel by pixel to obtain the loss value of each pixel, and aggregate the loss values of all pixels to obtain the overall loss value characterizing the prediction effect of the image slice. Step S4-3: Based on the overall loss value, calculate the gradient using the backpropagation algorithm, and use the optimizer to update the network weights to minimize the cross-entropy loss function.
5. The water extraction method based on dilated convolution and dynamic serpentine convolution according to claim 4, characterized in that, Step S5 includes: Step S5-1: Obtain the current remote sensing image containing surface water information, preprocess it according to the radiometric correction, orthorectification and image fusion methods described in step S1, and crop it into 512×512 pixel image slices. Step S5-2: Input the remote sensing image slices into the trained water body extraction network model for processing, and generate water body extraction results based on the output feature map; Step S5-3: Based on the water body extraction results of all remote sensing image slices, determine the water body distribution information in the current remote sensing image.
6. A water extraction system based on dilated convolution and dynamic serpentine convolution, used to execute the water extraction method based on dilated convolution and dynamic serpentine convolution as described in any one of claims 1-5, characterized in that: The system includes: The system includes modules for image acquisition and preprocessing, dataset construction, network construction, model training, and water extraction. The image acquisition and preprocessing module is used to acquire historical remote sensing images containing information about surface water bodies, preprocess the historical remote sensing images, and crop the preprocessed images into image slices of a preset size. The dataset construction module is used to interpret and label the water bodies in the image slices, generate water body vector data, generate water body mask labels based on the water body vector data, combine the image slices with the corresponding water body mask labels to construct a water body dataset, and divide the water body dataset into a training set, a validation set and a test set. The network construction module is used to extract features from the input image through a residual multi-scale network combined with dilated convolution, perform multi-scale fusion processing on the extracted features, use dynamic snake convolution and attention mechanism to process features in parallel, and reconstruct an output feature map with the same size as the input image through upsampling operation. The model training module is used to train the water body extraction network model using the training set, calculate the difference between the predicted value and the true label using the loss function, update the network parameters through backpropagation, evaluate the performance and tune the hyperparameters using the validation set, and finally evaluate the generalization performance of the model through the test set to obtain the trained water body extraction model. The water extraction module is used to acquire the current remote sensing image of the water body to be extracted. After preprocessing and cropping according to the method of the image acquisition and preprocessing module, it is input into the trained water extraction model and the water extraction result is output.
7. The water extraction system based on dilated convolution and dynamic serpentine convolution according to claim 6, characterized in that, The image acquisition and preprocessing module includes: A radiometric correction unit is used to acquire historical remote sensing images containing information about surface water bodies and to perform radiometric correction on the historical remote sensing images, including radiometric calibration and atmospheric correction. Orthorectification unit, used to orthorectify radiometrically corrected images; The image fusion unit is used to perform image fusion on orthorectified images; The dataset construction module includes: The annotation unit is used to perform visual interpretation and annotation of water body information in the image slice, create water body vectors and generate water body labels; The dataset partitioning unit is used to cut the original image and the corresponding water body label into image slices, construct the water body dataset and divide it into training set, validation set and test set.
8. The water extraction system based on dilated convolution and dynamic serpentine convolution according to claim 7, characterized in that, The network construction module includes: The feature extraction unit is used to downsample the input image and extract features through a residual multi-scale network. The multi-scale fusion unit is used to perform multi-scale fusion processing on the extracted features, and extracts feature information of different visual perceptions through multiple parallel convolutional branches. The feature optimization unit is used to simultaneously perform dynamic serpentine convolution and dual attention processing on the fused features; The feature reconstruction unit is used to reconstruct an output feature map of the same size as the input image through an upsampling operation; The model training module includes: The forward propagation unit is used to input the training set into the network model and calculate the classification prediction label through forward propagation; The loss calculation unit is used to calculate the difference between the predicted label and the true label using the cross-entropy loss function to obtain the overall loss value; The parameter update unit is used to update the network weights based on the overall loss value using the backpropagation algorithm.
9. The water extraction system based on dilated convolution and dynamic serpentine convolution according to claim 8, characterized in that, The water extraction module includes: The preprocessing unit is used to acquire current remote sensing images and perform preprocessing and cropping. The inference unit is used to input the preprocessed image slices into the trained water extraction network model for processing. The result generation unit is used to determine water body distribution information based on the processing results of all image slices.