A multi-scale feature enhanced DEM river network and gully head identification method
By constructing a deep semantic segmentation model through a multi-scale feature-enhanced DEM river network and gully head identification method, the problem of unstable river network and gully head identification in DEM data is solved, achieving high-precision river network and gully head identification, which is suitable for gully erosion monitoring and hydrological process modeling.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NORTHWEST A & F UNIV
- Filing Date
- 2026-03-26
- Publication Date
- 2026-07-07
AI Technical Summary
Existing methods for identifying river networks and gully heads are prone to problems such as broken river networks, blurred tributaries, and missed or incorrect gully heads in DEM data with drastic undulations or high noise interference. Furthermore, the models rely on empirical thresholds and are difficult to adapt to automated identification under different geomorphic conditions.
A multi-scale feature enhancement method for identifying DEM river networks and gully heads is adopted. By constructing a deep semantic segmentation model, including a multi-scale cavity residual enhancement module, a cavity spatial pyramid multi-scale feature aggregation module, a terrain semantic enhancement module based on channel attention, and a lightweight cross-channel nonlinear hybrid enhancement module, combined with a decoding reconstruction and dual attention fusion module, feature extraction and post-processing are performed to achieve high-precision identification of river networks and gully heads.
It enables continuous identification of river networks and high-precision positioning of gully heads, improves the model's adaptability to different landform types and the consistency of identification results, and is suitable for gully erosion monitoring, landform evolution analysis and hydrological process modeling.
Smart Images

Figure CN122347737A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method for identifying DEM river networks and gully heads with multi-scale feature enhancement. Background Technology
[0002] Digital elevation models (DEMs) are crucial foundational data for quantitative topographic analysis, geomorphic process simulation, and hydrological element extraction. Existing methods for river network extraction and gully head identification are primarily based on traditional hydrological analysis models (such as the D8 and D∞ flow direction algorithms), determining river network distribution through slope, flow direction, and catchment area thresholds. While these methods are applicable to areas with relatively small topographic relief, they often encounter problems such as river network fragmentation, blurred tributaries, and missed or false gully head detections in DEM data with significant undulations or high noise levels. Furthermore, these methods heavily rely on empirical threshold settings, making them difficult to adapt to the automated identification requirements under diverse geomorphic conditions.
[0003] With the development of deep learning technology, some studies have applied semantic segmentation models (such as U-Net, SegNet, DeepLabV3+, etc.) to terrain feature extraction, aiming to achieve automatic river network identification based on DEM. However, existing models are mostly derived from the field of remote sensing imagery, and they still have significant shortcomings in terrain semantic modeling, specifically: (1) The deep feature extraction stage is prone to causing the breakage of the tributaries and the discontinuity of the main channel structure. Due to the loss of spatial resolution caused by multiple downsampling, the model is difficult to maintain the local topographic details and the overall confluence morphology at the same time, resulting in discontinuity, breakage and blurring of the tributary structure of the river network; (2) The response is weak in key topographic areas (gully head, slope break zone, confluence zone). The attention mechanism of the existing model is mainly designed for texture information, which cannot fully capture the topographic undulation and slope change features, resulting in missed detection and false detection of gully head; (3) The model structure is complex and the generalization ability is limited. Existing networks are inefficient in training on cross-regional and multi-terrain datasets, are prone to overfitting, have difficulty maintaining the consistency of terrain recognition results, and have insufficient generalization ability, making it difficult to adapt to changes in different landform types.
[0004] Therefore, existing methods generally suffer from problems such as insufficient feature representation, inadequate structural continuity, and unstable groove head identification.
[0005] It should be noted that this section is intended to provide background or context for the technical solutions of this disclosure as set forth in the claims. The description herein does not constitute an admission that it is prior art simply because it is included in this section. Summary of the Invention
[0006] The purpose of this invention is to provide a multi-scale feature-enhanced DEM river network and gully head identification method, thereby overcoming at least to some extent one or more problems caused by the limitations and defects of related technologies.
[0007] This invention provides a multi-scale feature-enhanced DEM river network and gully head identification method, comprising: S1: Acquire digital elevation model raster data and perform preprocessing; S2 divides the preprocessed data into training set, validation set and test set; S3, Construct a deep semantic segmentation model, which includes: a multi-scale void residual enhancement module, a void spatial pyramid multi-scale feature aggregation module, a terrain semantic enhancement module based on channel attention, a lightweight cross-channel nonlinear hybrid enhancement module, and a decoding reconstruction and dual attention fusion module. S4. Input the training set data into the river network semantic segmentation model for model training, and use the validation set to evaluate the model performance and adjust the model parameters; input the raster data of the digital elevation model to be predicted into the trained model to obtain the river network probability map, and output the river network and gully head distribution map after post-processing.
[0008] In this invention, S1 includes the following steps: S101, performs coordinate projection unification and resolution consistency processing on the digital elevation model raster data; S102, perform anomaly repair and smoothing on the raster data of the digital elevation model; S103, calculates slope, terrain relief index and shadow index; S104, the original DEM is stitched together with slope, topographic relief index and shadow index according to channel dimension to form a multi-layer input tensor, and each channel is normalized or standardized. S105 involves manual labeling and pixel-level spatial registration of the river network and gully head locations.
[0009] In this invention, S2 includes the following steps: S201, use sliding window cropping to generate training samples from the large-format raster in the preprocessed data, and divide the samples into training set, validation set and test set in a 7:2:1 ratio; S202, perform augmentation processing on the data; S203, Calculate the ratio of positive to negative samples and set class weights for the loss function; S204, Define training objectives and evaluation indicators; S205, Determine the reasoning slicing strategy.
[0010] In this invention, step S3 includes the following steps: S301 adopts an encoder-decoder architecture, and builds a multi-scale void residual enhancement module at the encoder end to extract multi-scale terrain features; S302, the encoder high-level feature access hole spatial pyramid multi-scale feature aggregation module is set with four convolutional branches and one global average pooling branch. S303 introduces a terrain semantic enhancement module based on channel attention to perform feature channel weighting during the encoding stage; S304 sets up several enhancement blocks composed of depthwise separable convolution and pixel-wise linear mixing on the channel attention-weighted features to perform cross-channel information interaction and non-linear feature recalibration. S305, in the decoding stage, convolves the low-level features output by the encoder to reduce their dimensionality, aligns them spatially with the upsampled high-level features, and then concatenates them. The concatenated features are then weighted by a cascade of channel attention and spatial attention. First, the channel relationship is used to strengthen the key semantics, and then spatial attention is used to improve the response of narrow channels and edge pixels. Finally, the river network probability map is restored by convolution.
[0011] In this invention, in S301, the multi-scale feature aggregation module of the void spatial pyramid adopts a residual network structure of void convolution with void ratios of 1, 2, 4, and 8.
[0012] In this invention, in S302, the four convolutional branches include one 1×1 convolutional branch and three 3×3 convolutional branches with dilatation rates of 6, 12, and 18.
[0013] In this invention, the post-processing step S4 includes: Thresholding and skeletonization: Using Otsu's global adaptive thresholding method to perform river network probability... Figure 2 Values were converted, and the single-pixel wide river network skeleton was extracted using the Zhang–Suen algorithm; Endpoint detection and gully head identification: Based on convolutional neighborhood operation, endpoints with a node degree of 1 are detected as gully head candidates, and real gully heads are screened according to areas where the local slope difference is greater than a set threshold and the elevation difference is greater than 2m. Morphological optimization: Perform closing operations and small region removal to repair fractured and noisy areas, and obtain a spatially coherent and clearly defined river network and gully head distribution map.
[0014] The technical solution provided by this invention may include the following beneficial effects: This invention presents a multi-scale feature-enhanced DEM river network and gully head identification method. It integrates multi-scale topographic semantic information and spatial structural features, achieving continuous river network identification and high-precision gully head localization through deep feature extraction, context aggregation, attention enhancement, and post-processing. This method can be widely applied in gully erosion monitoring, geomorphological evolution analysis, and DEM-based hydrological process modeling, demonstrating significant scientific research and engineering application value. Attached Figure Description
[0015] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0016] Figure 1 A flowchart illustrating a multi-scale feature-enhanced DEM river network and gully head identification method in an exemplary embodiment of this disclosure is shown. Figure 2 This is local DEM data of Indian Creek; Figure 3 This is the overall flowchart of the deep semantic segmentation model; Figure 4 This is a diagram of the SE channel attention mechanism; Figure 5 This is a diagram of the spatial attention mechanism of CBAM; Figure 6 These are comparative images showing details of the comparative experiment; Figure 7 This is a comparison chart of experimental results from different models; Figure 8 This is a post-processed image showing the result of the groove head recognition. Detailed Implementation
[0017] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that this disclosure will be more comprehensive and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0018] Furthermore, the accompanying drawings are merely illustrative diagrams of embodiments of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities.
[0019] This example implementation first provides a multi-scale feature enhancement method for identifying DEM river networks and gully heads. Please refer to [reference needed]. Figure 1 This method may include: S1-S4, as follows: S1: Acquire digital elevation model raster data and perform preprocessing; S2 divides the preprocessed data into training set, validation set and test set; S3, Construct a deep semantic segmentation model, which includes: a multi-scale void residual enhancement module, a void spatial pyramid multi-scale feature aggregation module, a terrain semantic enhancement module based on channel attention, a lightweight cross-channel nonlinear hybrid enhancement module, and a decoding reconstruction and dual attention fusion module. S4. Input the training set data into the river network semantic segmentation model for model training, and use the validation set to evaluate the model performance and adjust the model parameters; input the raster data of the digital elevation model to be predicted into the trained model to obtain the river network probability map, and output the river network and gully head distribution map after post-processing.
[0020] In this embodiment, a residual network structure with dilated convolutions is employed. Multi-scale contextual feature extraction is achieved through multi-level dilation rates, expanding the receptive field while maintaining high spatial resolution. This effectively addresses the issues of fine groove breaks and main gully blurring caused by deep downsampling in traditional networks. Simultaneously, shallow branches preserve terrain boundaries and slope details, supporting spatial detail recovery during the decoding stage. Building upon this, a dilated spatial pyramid pooling (ASPP) structure is introduced at the encoder's high-level output. This module fuses contextual information at different scales through parallel multi-scale dilated convolution branches and introduces a global average pooling branch to supplement overall terrain trend perception. This design enhances the model's comprehensive adaptability to terrain differences such as wide valleys and fine gullies, improving the scale consistency and semantic integrity of the river network structure.
[0021] In the encoding stage, an SE channel attention mechanism is introduced to adaptively adjust the weights of features from different channels, enhancing the topographic semantic response related to confluence paths and gully head formation areas, and reducing missed detections of small gully heads and location offsets. In the decoding stage, a CBAM spatial attention module is embedded to dynamically focus on gully and slope break zones, solving the problems of blurred boundary recognition and unclear slope transitions in traditional models. In addition, a lightweight global modeling structure of SegNeXt is designed, which combines depthwise separable convolutions and multilayer perceptrons (MLPs) to achieve cross-channel and long-distance feature dependency modeling, enhancing the overall geometric coherence of the river network and its cross-topographic generalization ability while ensuring computational efficiency.
[0022] This invention integrates multi-scale semantic information and spatial structural features of topography. Through deep feature extraction, context aggregation, attention enhancement, and post-processing, it achieves continuous identification of river networks and high-precision positioning of gully heads. It can be widely applied in fields such as gully erosion monitoring, geomorphological evolution analysis, and DEM-based hydrological process modeling, demonstrating significant scientific research and engineering application value.
[0023] The specific process of each step in the above embodiments will be described below.
[0024] S1 includes the following steps: S101, performs coordinate projection unification and resolution consistency processing on the digital elevation model raster data; S102, perform anomaly repair and smoothing on the raster data of the digital elevation model; S103, calculates slope, terrain relief index and shadow index; S104, the original DEM is stitched together with slope, topographic relief index and shadow index according to channel dimension to form a multi-layer input tensor, and each channel is normalized or standardized. S105 involves manual labeling and pixel-level spatial registration of the river network and gully head locations.
[0025] Specifically as follows: (1) Data Acquisition and Unification: Digital Elevation Model (DEM) raster data of the study area was selected as the basic data source, such as... Figure 2 We perform coordinate projection unification and resolution consistency processing on data from different sources to ensure strict alignment of the pixel grid.
[0026] (2) Anomaly repair and smoothing: Depression filling and outlier removal are performed on the DEM; median filtering is used to reduce noise while maintaining the valley edge to address measurement noise and step effect.
[0027] (3) Generation of multiple topographic features: Calculate derived layers such as slope, topographic position index (TPI) and hillshade on a unified grid; the window size is selected as 256*256 according to the data resolution and the geomorphological scale, so that local topography and macro-morphology can be reflected at the same time.
[0028] (4) Multi-channel construction and normalization: The original DEM is spliced with slope, TPI and Hillshade according to the channel dimension to form a multi-layer input tensor; each channel is normalized or standardized to eliminate the difference in dimensions and stabilize the model training.
[0029] (5) Data labeling and registration: The river network and gully head locations are manually labeled using high-resolution orthophotos and measured gully head data; a unified projection coordinate system is adopted and pixel-level spatial registration is performed based on the grid index to ensure that the labeling results correspond accurately with the DEM data in spatial location and to prevent the accumulation of training errors caused by coordinate offset.
[0030] In this step, DEM data is selected as input, and smoothing filtering and depression filling operations are performed to calculate slope, TPI, and Hillshade feature maps. The four channels (original DEM and slope, TPI, and Hillshade) are combined to form a multi-layer input tensor, which is then normalized and input into the successor network model 9 (deep semantic segmentation model).
[0031] S2 includes the following steps: S201, use sliding window cropping to generate training samples from the large-format raster in the preprocessed data, and divide the samples into training set, validation set and test set in a 7:2:1 ratio; S202, perform augmentation processing on the data; S203, Calculate the ratio of positive to negative samples and set class weights for the loss function; S204, Define training objectives and evaluation indicators; S205, Determine the reasoning slicing strategy.
[0032] Specifically as follows: (1) Sample cropping and set division: Under the premise of ensuring coverage of multiple landforms, large-format raster is cropped using a sliding window to generate training samples. The cropping size is preferably 256×256 pixels, and the overlap step is set to 50 according to the image resolution and memory conditions. The samples are divided into training set, validation set and test set in a ratio of 7:2:1.
[0033] (2) Data augmentation: To address the uncertainty of terrain orientation and scale changes, augmentation is performed by random rotation, horizontal / vertical flipping, random cropping, slight scaling and brightness contrast perturbation, etc., to improve the morphological robustness and generalization ability of subsequent models.
[0034] (3) Class imbalance handling: Statistically calculate the ratio of positive and negative samples and set class weights for the loss function; use higher weights for the small proportion of channel classes to suppress undersegmentation.
[0035] (4) Training objectives and evaluation: Hybrid loss is used to optimize the segmentation boundary and the overall region, and the weighted sum of weighted cross-entropy loss and Dice coefficient loss is preferred; pixel accuracy, recall, F1, mIoU, FWIoU and other indicators are selected for training and validation phases to be used for learning rate scheduling and early stopping judgment.
[0036] (5) Inference slicing strategy: In order to adapt to ultra-large format DEM, sliding window slicing and overlapping fusion are used in the inference stage, which is consistent with training, to reduce edge gaps and block effects.
[0037] S3 includes the following steps: S301 adopts an encoder-decoder architecture, and builds a multi-scale void residual enhancement module at the encoder end to extract multi-scale terrain features; S302, the encoder high-level feature access hole spatial pyramid multi-scale feature aggregation module is set with four convolutional branches and one global average pooling branch. S303 introduces a terrain semantic enhancement module based on channel attention to perform feature channel weighting during the encoding stage; S304 sets up several enhancement blocks composed of depthwise separable convolution and pixel-wise linear mixing on the channel attention-weighted features to perform cross-channel information interaction and non-linear feature recalibration. S305, in the decoding stage, convolves the low-level features output by the encoder to reduce their dimensionality, aligns them spatially with the upsampled high-level features, and then concatenates them. The concatenated features are then weighted by a cascade of channel attention and spatial attention. First, the channel relationship is used to strengthen the key semantics, and then spatial attention is used to improve the response of narrow channels and edge pixels. Finally, the river network probability map is restored by convolution.
[0038] This invention employs an encoder-decoder deep semantic segmentation model structure (such as...). Figure 3 As shown, this deep semantic segmentation model performs multi-scale feature extraction, attention enhancement, and global dependency modeling on multi-channel digital elevation model (DEM) data, outputting a river network probability map to provide high-precision input data for subsequent gully head detection and topology analysis. The model comprises the following five functional modules: (1) Construction of multi-scale void residual enhancement module This part employs a residual network structure with dilated convolutions to maintain high spatial resolution and expand the effective receptive field. By stacking convolutions with different dilation rates (preferably 1, 2, 4, and 8), the model can extract multi-scale contextual information without reducing resolution. This design effectively solves the problem of broken grooves and branches caused by multiple downsampling in deep feature extraction in traditional convolutional networks, ensuring the continuity and detail integrity of terrain features. Simultaneously, the network retains a shallow feature branch for detail recovery and boundary alignment during the decoding stage.
[0039] (2) Design of a multi-scale feature aggregation module for a hollow space pyramid A dilated spatial pyramid pooling module is introduced onto the high-level features of the encoder output, with four convolutional branches set in parallel: a standard 1×1 convolutional branch for local feature compression; three 3×3 convolutional branches with dilation rates of 6, 12, and 18 for context capture of different receptive fields; and a global average pooling branch to supplement overall terrain background information. The outputs of each branch are concatenated along the channel dimension to form a multi-scale feature set, which is then fused by 1×1 convolution to obtain a unified semantic representation that takes into account both local fine gully details and global confluence trends, thereby solving the problem of poor scale adaptability of traditional methods in terrains where wide valleys and fine gullies coexist.
[0040] (3) Design of a terrain semantic enhancement module based on channel attention: The features after ASPP (hollow spatial pyramid pooling) concatenation are compressed and activated using a global average pooling-two fully connected layers-Sigmoid mechanism to generate channel weight vectors, which are then multiplied channel by channel with the original features. To further improve the model's response to key terrain features, such as Figure 4 As shown, the process can be represented as follows:
[0041] in, Here is the channel attention weight vector. This is the global descriptor for the c-th channel. As input features, This is the global description vector after channel compression. , and These represent the height, width, and number of channels of the feature map, respectively. For the weights of the fully connected layer, These are the ReLU and Sigmoid activation functions, respectively. Represents the input feature map The One channel, This indicates the first [stage] after channel attention recalibration. Each output channel ultimately yields... Indicates the first The importance weights of each channel are assigned. This mechanism can automatically enhance significant channels associated with channels and confluence structures, while suppressing interference from flat slopes and noisy areas, thereby improving the network's sensitivity and stability to topographic semantic features.
[0042] (4) Construction of a lightweight cross-channel nonlinear hybrid enhancement module: Several enhancement blocks composed of depthwise separable convolutions and pixel-wise linear hybrids are set on the features after SE attention weighting. This structure realizes cross-channel information interaction and nonlinear feature recalibration, effectively improving the coherence of valley edge response and fine line targets. Compared with traditional convolution stacking, this module has fewer parameters and higher computational efficiency, which can strengthen the correlation between terrain features and improve the geometric consistency of river network structure while maintaining the lightweight nature of the model.
[0043] (5) Design of the decoding reconstruction and dual attention fusion module: The decoding stage is used to restore spatial resolution and refine boundary recognition, mainly including the following two parts: Low-level detail alignment: The low-level features output by the encoder are reduced in dimensionality by 1×1 convolution and then aligned spatially with the upsampled high-level features and concatenated; CBAM (channel attention and spatial attention) weighting: The concatenated features are weighted by a cascade of channel attention and spatial attention, first using channel relationships to strengthen key semantics, and then using spatial attention to improve the response of narrow channels and edge pixels, such as... Figure 5 As shown, the process can be represented as follows:
[0044] in, Indicates the context encoding function, , and These represent the height, width, and number of channels of the feature map, respectively. For feature splicing operations, For linear transformations or convolution kernels, This is a joint weighted graph of space and channels. This represents the output features after attention modulation. The CBAM attention mechanism can dynamically adjust the response of different positions and channels according to the context, making it suitable for complex scenarios such as river networks. Represents the context-enhanced features generated by the context encoding function, symbol This represents element-wise multiplication, i.e., attention weight graph. Compared with the original input features Multiplying point-by-point at corresponding spatial locations and channels enhances the response in key areas and suppresses interference from irrelevant areas. Convolution restoration: After refining the boundaries through two layers of 3×3 convolution, a single-channel or multi-channel probability map is output, and then upsampled to the original image size through bilinear interpolation, output as a river network probability map.
[0045] S4 is the process of model training and post-processing, where the post-processing process includes: Thresholding and skeletonization: Using Otsu's global adaptive thresholding method to perform river network probability... Figure 2 Values were converted, and the single-pixel wide river network skeleton was extracted using the Zhang–Suen algorithm; Endpoint detection and gully head identification: Based on convolutional neighborhood operation, endpoints with a node degree of 1 are detected as gully head candidates, and real gully heads are screened according to areas where the local slope difference is greater than a set threshold and the elevation difference is greater than 2m. Morphological optimization: Perform closing operations and small region removal to repair fractured and noisy areas, and obtain a spatially coherent and clearly defined river network and gully head distribution map.
[0046] The specific steps for S4 are as follows: (1) Training process: Input the dataset constructed in S2 into the network model in S3 for end-to-end training; use Adam or a stochastic gradient descent optimizer with momentum, and set the initial learning rate and decay strategy (such as polynomial decay or piecewise descent); introduce an early stopping mechanism, and stop training when the validation set FWIoU or mIoU has not improved for several consecutive rounds to prevent overfitting. Optionally, mixed precision training can be used to improve memory utilization and training speed.
[0047] (2) Model selection and saving: During the training process, the weight file with the best validation set index is saved as the final model; training logs and hyperparameter configurations are recorded to facilitate the reproduction of experiments and migration deployment.
[0048] (3) Inference and Post-processing: After boundary refinement through two layers of 3×3 convolution, a single-channel probability map is output, and then upsampled to the original DEM size through bilinear interpolation to obtain the river network probability map. The following post-processing steps are then performed: Thresholding and skeletonization: Using Otsu's global adaptive thresholding method to threshold probabilities Figure 2 Values were converted, and the single-pixel wide river network skeleton was extracted using the Zhang–Suen algorithm; Endpoint detection and gully head identification: Based on convolutional neighborhood operation, endpoints with a node degree of 1 are detected as gully head candidates, and real gully heads are screened according to areas where the local slope difference is greater than a set threshold and the elevation difference is greater than 2m. Morphological optimization: Perform closing operations and small region removal to repair fractured and noisy areas, and obtain a spatially coherent and clearly defined river network and gully head distribution map.
[0049] (4) Evaluation and application: IoU, Precision, Recall, F1, average pixel precision (MPA) and weighted crossover ratio (FWIoU) are calculated on the test set; the results obtained in this invention are used for gully monitoring, geomorphological evolution analysis and hydrological simulation preprocessing for high-resolution DEM.
[0050] This application inputs a pre-constructed multi-channel DEM image dataset into a deep learning model for training. Different learning rates, batch sizes, loss functions, and hyperparameters such as optimizers are set for model optimization. Early stopping techniques are used during training; the model automatically stops training when the accuracy on the training set does not improve within a certain number of epochs, or when the accuracy on the validation set decreases, indicating overfitting. Several models with high accuracy are selected and validated using validation set data. The model with better generalization results, higher accuracy, and clearer boundaries is chosen and saved, providing guidance for hydrological analysis and related erosion prevention.
[0051] The following specific experiments illustrate the implementation process and beneficial effects of the method described in this application.
[0052] Experimental Example (1) Experimental data The experimental data were selected from two regions. Data one, collected in the laboratory, is located in the Loess Plateau region of northern Shaanxi. Details are as follows: One data point is the Wangmaogou watershed, located on the left bank of the middle reaches of the Jiuyuangou River in Suide County, Shaanxi Province. It is a secondary tributary on the left bank of the middle reaches of the Wuding River. The elevation is approximately 940–1200 m, and the drainage area is 5.97 km². 2 The average annual precipitation is 475.1 mm, with significant interannual variation. The terrain is complex, dominated by ridges and mounds, crisscrossed by gullies, with steep slopes and deep ravines, typical of the Loess Plateau hilly and gully landforms. Another data point is the Zhoutungou area, located in Zhao'an Town, Ansai District, Yan'an City, Shaanxi Province, a tributary of the Yanhe River in the Loess Plateau hilly and gully region. Its drainage area is 33.6 km². 2 Its valley area is approximately 18.8 km². 2 The elevation ranges from 1026 to 1439 meters, and the terrain of the watershed is highly undulating. The area is mainly composed of ridges, gullies, and gully beds, with gullies being the dominant feature. The ridges are narrow and steep, and the steep slopes on both sides are composed of a large amount of loess.
[0053] Data 2 was conducted in the Wayne National Forest in southeastern Ohio, USA. It was selected from local sample areas of open-source data, choosing two representative regions. These areas are characterized by numerous gullies, and the gully heads have not undergone human intervention, making them valuable for research. Researchers conducted field investigations in both regions and marked 36+53 gully heads in each.
[0054] The experiment used DEM images of the four regions shown above. The experimental data was cropped and augmented to obtain a total of 10,042 data slices and corresponding annotation sets. Finally, the training set, validation set, and test set were cropped in a 7:2:1 ratio. The training set was used to train the model, the validation set was used to evaluate the model performance, adjust hyperparameters, and prevent overfitting during the training phase, and the test set was used to verify the model's generalization ability.
[0055] (2) Experimental scheme This deep learning experiment ran on a Windows 10 operating system, with two NVIDIA GeForce RTX 3090 graphics cards. The network was built using the Tensorflow 1.14.0 deep learning framework, and the software environment was Anaconda (Python 3.7). The initial learning rate was 0.01. If the accuracy did not improve within 20 epochs of training, the learning rate was reduced to 0.01 times the original rate. The Adam optimizer was used, with a batch size of 4. Early stopping was employed during training; the model automatically stopped training if the accuracy on the training set did not improve within 20 epochs, or if the accuracy on the validation set decreased, indicating overfitting.
[0056] Comparative Example 1: This comparative example presents a terrain feature recognition method. The difference between this method and the embodiment is that the SE channel attention mechanism module in the embodiment is removed, while the other steps are the same as in the experimental example.
[0057] Comparative Example 2: This comparative example presents a terrain feature recognition method. The difference between this method and the embodiment is that the CBAM spatial attention mechanism module in the embodiment is removed, while the other steps are the same as in the experimental example.
[0058] Comparative Example 3: This comparative example presents a terrain feature recognition method. The difference between this method and the embodiment is that this comparative example removes the multi-channel image input of the embodiment and uses a single DEM image as the input. The other steps are the same as in the experimental example.
[0059] The experimental results are shown in Table 1.
[0060] Table 1 Comparison of module ablation results
[0061] Table 1 shows the experimental results, comparing the performance indicators of Comparative Example 1, Comparative Example 2, Comparative Example 3, and the experimental example of this invention. As can be seen from Table 1, the accuracy of the models decreased to varying degrees after deleting different modules, verifying the important role of the designed modules in river network identification and gully head extraction.
[0062] Comparative Example 1, with the SE channel attention mechanism module removed, showed significantly lower F1 scores and FWIoU indices compared to the complete model. This indicates that the channel attention mechanism can effectively enhance the weight distribution among multi-scale features, enabling the network to focus more on the salient features of the river network trunk and gully head regions during the feature extraction stage. When this module was removed, the model's response to the gully structure weakened, leading to breakage and missed detections in the prediction results.
[0063] Comparative Example 2, without the CBAM spatial attention module, showed blurred boundary details and incomplete gully head identification in its recognition results, demonstrating the crucial role of the spatial attention module in enhancing inter-pixel spatial relationships and improving river network connectivity. The introduction of CBAM enables the network to simultaneously capture local spatial relationships and global location distribution information, thereby improving the detection accuracy at gully heads and tributary confluences.
[0064] Comparative Example 3 uses only a single-channel DEM input, without fusing slope, topographic relief index, and shadow index features, resulting in a significant decrease in its topographic feature recognition performance. Since single elevation information is insufficient to fully reflect changes in topographic structure, multi-channel feature input can provide the network with more geometric and illumination dimensions, helping to enhance the differences between valleys and slopes and improve boundary recognition.
[0065] In comprehensive comparison, the multi-scale residual hollow network model of this invention, after introducing SE channel attention and CBAM spatial attention and fusing multi-channel terrain features, achieved the highest levels of F1, FWIoU, and overall accuracy, reaching 69.24%, 98.78%, and 98.83%, respectively. The results show that the model of this invention can adaptively learn different geomorphic features and highlight key information, significantly improving the completeness and accuracy of gully head identification while maintaining river network connectivity.
[0066] Meanwhile, the models were compared with other mainstream semantic segmentation models. The input layers of CGNet, DeeplabV3+, SegNet, and SegNext were modified to conform to the characteristics of multi-channel input, and then trained on the same dataset. The results are shown in Table 2.
[0067] Table 2 Segmentation results of different models
[0068] Table 2 shows the recognition results of CGNet, Unet, DeepLabV3+, SegNet, SegNeXt, and the model of this invention on the same dataset. As can be seen from Table 2, the multi-scale residual hole network proposed in this invention significantly outperforms other models in terms of F1, FWIoU, and overall accuracy, indicating that the designed structure is more suitable for feature representation of digital elevation models (DEMs) and terrain recognition of DEMs.
[0069] In the experimental results, such as Figure 6 The CGNet model, due to its shallow network layers, is insufficient in responding to changes in terrain elevation and local gully features, resulting in broken river networks, blurred gully heads, and low overall classification accuracy. The UNet model, employing a symmetrical encoder-decoder structure, effectively fuses shallow and deep features through skip connections, demonstrating good overall recognition coherence. However, its convolutional kernels have limited receptive fields, still insufficient in recognizing small tributaries and transitional areas at gully heads in complex terrain; furthermore, in areas with dramatic terrain undulations, some spatial information is lost during feature upsampling, leading to blurred and missed classifications at river network edges. The SegNet model can retain spatial information to some extent structurally, but its shallow feature fusion capabilities limit its ability to misclassify and miss many small gullies and tributary areas. The DeepLabV3+ model, employing a spatial pyramid pooling structure with dilated convolutions (ASPP), excels in capturing large-scale context, but its recognition of small-scale terrain textures and gully head details remains insufficient, resulting in discontinuities and blurred areas at river network boundaries. The SegNeXt model improves computational efficiency through a lightweight token hybrid structure and performs well in identifying the main gully region, but it lacks fine perception of micro-topographical changes and has limited accuracy in locating multi-branch intersection areas and gully heads.
[0070] In contrast, the method of this invention introduces channel attention and spatial attention modules on the basis of multi-scale void residual structure, enabling the model to adaptively focus on valley and confluence feature areas, significantly enhancing its response to the main river network and gully heads. The comprehensive utilization of multi-channel inputs (DEM, slope, TPI, and Hillshade) further enriches the elevation and topographic texture information, enabling the network to simultaneously possess macro-topographic perception and detail discrimination capabilities.
[0071] At the same time from Figure 7 The visualization results show that the model of this invention outperforms the comparative models in terms of river network connectivity and boundary clarity. Especially in areas with complex slopes and dense gullies, the model of this invention can effectively suppress false confluences and breaks, achieving continuous and complete gully network identification. Overall, the results demonstrate that this method balances detail preservation and global consistency in terrain identification using digital elevation models, exhibiting higher stability and practical value.
[0072] Finally, skeletonization is performed on the binary river network mask, followed by breakpoint connection and small component removal. Morphological closing operations or thinning restoration are also performed, outputting a topologically continuous and clearly defined final river network and gully head result, such as... Figure 8 As shown.
[0073] It should be noted that although several modules of the system for executing actions are mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of the present invention, the features and functions of two or more modules described above can be embodied in one module. Conversely, the features and functions of one module described above can be further divided into multiple modules for embodiment. Components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the present invention according to actual needs. Those skilled in the art can understand and implement this without any inventive effort.
[0074] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.
[0075] It should be noted that the installation of image acquisition and personal identification equipment in public places involved in this application is necessary for maintaining public safety, complies with relevant national regulations, and is accompanied by prominent warning signs. The collected personal images and identification information can only be used for the purpose of maintaining public safety and not for other purposes; or the images, personal identification data, etc. in this application are all legally and compliantly obtained or collected with the individual's separate consent.
Claims
1. A method for identifying river networks and gully heads in DEMs with multi-scale feature enhancement, characterized in that, include: S1: Acquire digital elevation model raster data and perform preprocessing; S2 divides the preprocessed data into training set, validation set and test set; S3, Construct a deep semantic segmentation model, which includes: a multi-scale void residual enhancement module, a void spatial pyramid multi-scale feature aggregation module, a terrain semantic enhancement module based on channel attention, a lightweight cross-channel nonlinear hybrid enhancement module, and a decoding reconstruction and dual attention fusion module. S4. Input the training set data into the river network semantic segmentation model for model training, and use the validation set to evaluate the model performance and adjust the model parameters; input the raster data of the digital elevation model to be predicted into the trained model to obtain the river network probability map, and output the river network and gully head distribution map after post-processing.
2. The multi-scale feature enhancement method for identifying DEM river networks and gully heads according to claim 1, characterized in that, S1 includes the following steps: S101, performs coordinate projection unification and resolution consistency processing on the digital elevation model raster data; S102, perform anomaly repair and smoothing on the raster data of the digital elevation model; S103, calculates slope, terrain relief index and shadow index; S104, the original DEM is spliced with slope, topographic relief index and shadow index according to channel dimension to form a multi-layer input tensor, and each channel is normalized or standardized. S105 involves manual labeling and pixel-level spatial registration of the river network and gully head locations.
3. The multi-scale feature enhancement method for DEM river network and gully head identification according to claim 1, characterized in that, S2 includes the following steps: S201, use sliding window cropping to generate training samples from the large-format raster in the preprocessed data, and divide the samples into training set, validation set and test set in a 7:2:1 ratio; S202, perform augmentation processing on the data; S203, Calculate the ratio of positive to negative samples and set class weights for the loss function; S204, Define training objectives and evaluation indicators; S205, Determine the reasoning slicing strategy.
4. The multi-scale feature enhancement method for identifying DEM river networks and gully heads according to claim 1, characterized in that, S3 includes the following steps: S301 adopts an encoder-decoder architecture, and builds a multi-scale void residual enhancement module at the encoder end to extract multi-scale terrain features; S302, the encoder high-level feature access hole spatial pyramid multi-scale feature aggregation module is set with four convolutional branches and one global average pooling branch. S303 introduces a terrain semantic enhancement module based on channel attention to perform feature channel weighting during the encoding stage; S304 sets up several enhancement blocks composed of depthwise separable convolution and pixel-wise linear mixing on the channel attention-weighted features to perform cross-channel information interaction and non-linear feature recalibration. S305, in the decoding stage, convolves the low-level features output by the encoder to reduce their dimensionality, aligns them spatially with the upsampled high-level features, and then concatenates them. The concatenated features are then weighted by a cascade of channel attention and spatial attention. First, the channel relationship is used to strengthen the key semantics, and then spatial attention is used to improve the response of narrow channels and edge pixels. Finally, the river network probability map is restored by convolution.
5. The multi-scale feature enhancement method for DEM river network and gully head identification according to claim 4, characterized in that, In S301, the multi-scale feature aggregation module of the void spatial pyramid adopts a residual network structure with void convolutions of void ratios of 1, 2, 4, and 8.
6. The multi-scale feature enhancement method for DEM river network and gully head identification according to claim 4, characterized in that, In S302, the four convolutional branches include a 1×1 convolutional branch and three 3×3 convolutional branches with dilatation rates of 6, 12, and 18.
7. The multi-scale feature enhancement method for DEM river network and gully head identification according to claim 1, characterized in that, In S4, the post-processing process includes: Thresholding and skeletonization: The Otsu global adaptive thresholding method is used to binarize the river network probability map, and the Zhang-Suen algorithm is used to extract the single-pixel wide river network skeleton. Endpoint detection and gully head identification: Based on convolutional neighborhood operation, endpoints with a node degree of 1 are detected as gully head candidates, and real gully heads are screened according to areas where the local slope difference is greater than a set threshold and the elevation difference is greater than 2m. Morphological optimization: Perform closing operations and small region removal to repair fractured and noisy areas, and obtain a spatially coherent and clearly defined river network and gully head distribution map.