A watershed division method based on deep learning semantic segmentation

Through the basin division method based on deep learning semantic segmentation, the problem of insufficient basin division efficiency and accuracy in the prior art is solved, efficient and accurate basin division is achieved, which reduces the computational complexity and improves the reliability of the results.

CN116883651BActive Publication Date: 2025-03-28NORTHWEST A & F UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310667361.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-06
Publication Date
2025-03-28
Estimated Expiration
2043-06-06

AI Technical Summary

Technical Problem

The existing basin division method has high computational complexity in depression filling pretreatment, and the uncertainty of the flow accumulation threshold makes the basin division result unreliable.

Method used

The basin division method based on deep learning semantic segmentation is adopted, and the basin division method is established by collecting and pre-processing of the basin image data of geomorphic types, and the deep learning semantic segmentation model is used to train and predict it using multi-channel feature information to achieve efficient basin division.

Benefits of technology

The calculation complexity of depression filling pretreatment is effectively reduced, and the accuracy and efficiency of basin division are improved by optimizing the loss function and using multi-channel feature information, making the basin division results more reliable and consistent with the actual terrain.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116883651B_ABST
    Figure CN116883651B_ABST
Patent Text Reader

Abstract

The present invention provides a watershed division method based on deep learning semantic segmentation, which collects a preset number of watershed image data samples of different landform types, performs preprocessing to obtain multiple sub-image samples of preset sizes, and obtains multiple watershed image annotated samples after annotation; establishes a deep learning semantic segmentation model by dividing the multiple sub-image samples and the corresponding sub-image annotated samples into a training set and a verification set; respectively trains the variable values ​​of the deep learning semantic segmentation model with the training set and verifies the Accuracy, MPA and FwIou accuracy of the deep learning semantic segmentation model with the verification set to obtain the best deep learning semantic segmentation model; collects image data to be detected of different landform types, performs preprocessing to obtain multiple sub-images to be detected of preset sizes, and predicts the sub-images to be detected using the best deep learning semantic segmentation model to obtain corresponding watershed division prediction images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of topography and geomorphology, relates to watershed division, and specifically to a watershed division method based on deep learning semantic segmentation. Background Art

[0002] A watershed is an area where rainwater is dispersed, converged and discharged in a concentrated manner. It is an organic natural geographical unit surrounded by a certain watershed and is a carrier of geological disasters and hydro-meteorological disasters. A watershed has obvious hierarchical divisions and scale effects. A watershed can be divided into multiple small watersheds according to the water system level, and the small watershed is also part of the larger watershed in which it is located. A watershed is an area where water and other substances converge and flow out from a common outlet. It is also called a basin, confluence area or catchment area. Generally, the total area of ​​a watershed catchment area is obtained by giving a pouring point or outlet. Its characteristics include the shape, area, direction, height, river network density, etc. of the watershed. The process of dividing a watershed into several sub-basins is called watershed segmentation. According to the diversity of landforms and the complexity of spatial combinations in the watershed catchment area, how to solve the watershed segmentation is the key to application.

[0003] Although the existing watershed division methods differ in details, they have roughly the same steps overall. The first step is to fill the depressions in the digital elevation model (DEM) to ensure that the subsequent process analysis can obtain the correct flow direction. The second step is to determine the flow direction of water in each grid unit of the DEM. The third step is to extract the runoff accumulation and river network. In the surface runoff model, runoff is obtained based on the runoff accumulation. The runoff accumulation is calculated based on the flow direction. The fourth step is the formation of the watershed and the division of the watershed. Determine an outlet point, that is, the lowest point of the watershed, and then combine the flow direction data to analyze and search all the grids flowing upstream of the outlet until all the grids in the watershed are determined, that is, the location of the search basin boundary basin. Given different thresholds, river networks of different scales are obtained, thereby obtaining watershed division results of different scales. However, the existing methods mainly have the following problems.

[0004] The first problem is that the computational complexity of basin demarcation data preprocessing and depression filling is high. DEM is a relatively smooth surface model. Due to the influence of data noise and various interpolation methods, DEM data often contains some depression information. Depressions may be the true form of the surface or data errors caused by the DEM production process. In hydrological analysis, depressions will cause the river water flow extracted from DEM to be sluggish and fail to form a complete basin river network. Therefore, the depressions in the DEM data are first filled to ensure that the subsequent process analysis can obtain the correct flow direction. In early work, the commonly used depression removal method is mainly to smooth the DEM data and then fill the depression. A small window is used to traverse the entire DEM, and the elevation value of the center point of the window is compared with the surrounding points. If the center point is low, the center point is a depression. After obtaining the depression point, the elevation value of the depression point is changed to the minimum value in the adjacent four directions. Due to the nested search, the computational complexity of this method is as high as O(N2). When the number of grids has increased significantly due to the emergence of high-resolution DEM in recent years, although some improved methods have been proposed, for example, simulating the overland flow process to flood the depression point grid, the complexity is O(N1.5), or using overflow elevation and minimum cost search to reduce the complexity to O(NlogN), the depression filling preprocessing is still time-consuming.

[0005] The second problem is that the uncertainty of the flow accumulation threshold makes the watershed delineation results unreliable. It is usually necessary to repeatedly try different thresholds empirically to obtain different watershed results, while comparing the choice of threshold with the help of existing reference data. In detail, channel pixels are considered to be mainly transport-limited and have a gradually declining slope, while on the contrary, hillside pixels are controlled by separation and experience parallel retreat; these differences are difficult to capture by the size of the sub-catchment with a single threshold. To address this problem, some studies introduced geometric features such as terrain curvature and used the geodesic minimization principle to identify channel pixels, while other studies used the relationship between local slope and catchment area to classify pixels. However, the first solution only uses a small set of predefined features while other geometric features may also be used. In addition, the second solution still uses a single threshold that can change with spatial and temporal changes in hydrological and erosional processes. Summary of the invention

[0006] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a watershed division method based on deep learning semantic segmentation to solve the technical problem that the efficiency and accuracy of the watershed division method in the prior art need to be further improved.

[0007] In order to solve the above technical problems, the present invention adopts the following technical solutions to achieve the above problems:

[0008] A watershed division method based on deep learning semantic segmentation is performed in the following steps:

[0009] Step S1, collect a preset number of watershed image data samples of different landform types, and preprocess them to obtain multiple sub-image samples of preset sizes; annotate the multiple sub-image samples to obtain multiple annotated sub-image samples of the annotated watershed area, and form a watershed feature data set.

[0010] Step S2, dividing the sub-image annotated samples obtained in step S1 into a training set and a validation set.

[0011] Step S3, annotating and enhancing the watershed feature dataset obtained in step S1.

[0012] The annotation includes extracting boundaries using a canny operator and post-processing; the enhancement includes random transformation and enhancement combined with semantic information; the semantic information is watershed edge information.

[0013] Step S4, for the watershed image data in the watershed feature data set annotated and enhanced in step S3, extract the multi-channel feature information of the watershed image data, wherein the multi-channel feature information includes TPI, slope, slope aspect, flow direction, profile curvature, local high point, slope variability, slope aspect variability, slope length and elevation variation coefficient.

[0014] Step S5, inputting the training set obtained in step S2 and the multi-channel feature information obtained in step S4 into the improved deep learning image semantic segmentation network for training, and obtaining a trained deep learning semantic segmentation model.

[0015] Step S6. Collect image data of the watershed to be tested of different landform types, and preprocess them according to the preprocessing method of step S1 to obtain multiple sub-images to be tested of preset sizes. The sub-images to be tested are input into the deep learning semantic segmentation model trained in step S5 to obtain the corresponding predicted images, thereby realizing the segmented image results of the watershed to be tested.

[0016] The present invention also has the following technical features:

[0017] In step S1, the watershed image data adopts DEM elevation data.

[0018] In step S1, the preprocessing includes:

[0019] Step S101, using Gaussian filtering method to remove noise.

[0020] Step S102, Kriging interpolation is used to fill in the abnormal values ​​by using clustering method.

[0021] Step S103, using Global Mapper raster processing software to perform clipping and resampling.

[0022] Step S104, performing normalization processing using a minimum-maximum normalization method.

[0023] Step S3 specifically includes the following steps:

[0024] Step S301, extracting boundaries:

[0025] Firstly, the DEM elevation data in the watershed feature dataset was imported into the Global Mapper software for visualization of the pseudo-color shading map, and then exported as an 8-bit single-channel grayscale image. The edge detection method Canny operator was used to extract the boundary information.

[0026] Step S302, post-processing boundary:

[0027] The post-processing process uses a threshold parameter of 10 to remove spurs and boundary breaks on the boundary. The post-processing result generates a binary image of the mountain background and the watershed boundary, where the mountain background pixel value is set to 0 and the watershed boundary pixel value is set to 1.

[0028] Step S303, enhancement:

[0029] Two enhancement methods are used: one is to introduce random transformation, and the other is to enhance by combining semantic information.

[0030] The random transformation includes mirror flipping, rotation transformation, random translation, random rotation and random scaling.

[0031] The enhancement by combining semantic information includes randomly deleting some watershed boundary pixels in the watershed boundary extraction task to simulate noise and missing data in the actual watershed, so as to increase the robustness of the model to noise and missing data.

[0032] In step S5, the improvement process of the deep learning image semantic segmentation network is as follows:

[0033] In step S501, the encoding layer goes through 5 stages in total. Each stage consists of two convolutional layers + normalization layer + ReLU layer, one bottleneck attention mechanism module, and the last layer is the maximum pooling layer, which uses a 2×2 convolution kernel with a step size of 2.

[0034] Step S502: A pooling module is added between the decoding layer and the encoding layer. The module is composed of four layers of convolution kernels, and the sizes are 1×1, 2×2, 3×3, and 6×6 respectively.

[0035] Step S503, the decoding layer corresponds to the encoding layer, and is divided into 5 stages in total. Each stage consists of a bottleneck attention mechanism module, an upsampling layer, two convolutional layers + normalization layer + ReLU layer.

[0036] Step S504, optimize the loss function in the original SegNet backbone network architecture, using a composite weighted loss function Loss, and the final optimized loss function suitable for the watershed division task is:

[0037]

[0038]

[0039]

[0040] Where:

[0041] Represents the cross entropy loss function for binary classification of pixel categories;

[0042] express Loss function;

[0043] represents the composite weighted loss function;

[0044] Indicates pixels, ;

[0045] Indicates the number of pixels;

[0046] Represents the pixel label value;

[0047] Represents the predicted value of a single pixel;

[0048] represents the weighted hyperparameter, which is set to 0.7.

[0049] Compared with the prior art, the present invention has the following technical effects:

[0050] (I) The present invention effectively solves the problem of time-consuming depression filling preprocessing and unreliable watershed division results due to the uncertainty of flow accumulation threshold through shared weights and end-to-end deep learning model training.

[0051] (II) The algorithm of the present invention adopts an improved network segmentation model and optimizes loss calculation to ensure efficient watershed division, and is particularly efficient when segmenting large-scale watersheds.

[0052] (III) While satisfying the requirement of efficient segmentation, the present invention can achieve more accurate watershed division than traditional methods by combining multi-channel information features. The watershed division result is more consistent with the actual terrain than that obtained by traditional methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 This is a schematic diagram of the improved deep learning semantic segmentation model MegNet network structure.

[0054] The specific contents of the present invention are further explained in detail below in conjunction with embodiments. DETAILED DESCRIPTION

[0055] It should be noted that, unless otherwise specified, all algorithms in the present invention adopt algorithms known in the prior art.

[0056] With the rapid development of deep learning, image processing technology has made significant breakthroughs. Image segmentation can be expressed as a pixel classification problem with semantic labels (semantic segmentation) or a single object segmentation problem (instance segmentation). Combining deep learning semantic segmentation technology with the task of watershed segmentation can effectively solve the above problems through the selection of training data, network architecture, loss function, and training strategy. For example, a set of filters can be used to remove depressions to smooth the DEM; combined with multi-channel information, geometric features can be automatically extracted to identify watersheds. In addition, shared weights and end-to-end deep learning model training make watershed segmentation more efficient in both time and space.

[0057] The present invention provides a watershed division method based on deep learning semantic segmentation, which collects a preset number of watershed image data samples of different landform types, performs preprocessing to obtain multiple sub-image samples of preset sizes, and obtains multiple watershed image annotated samples after annotation; establishes a deep learning semantic segmentation model by dividing the multiple sub-image samples and the corresponding sub-image annotated samples into a training set and a verification set; respectively trains the variable values ​​of the deep learning semantic segmentation model with the training set and verifies the Accuracy, MPA and FwIou accuracy of the deep learning semantic segmentation model with the verification set to obtain the best deep learning semantic segmentation model; collects image data to be detected of different landform types, performs preprocessing to obtain multiple sub-images to be detected of preset sizes, and predicts the sub-images to be detected using the best deep learning semantic segmentation model to obtain corresponding watershed division prediction images.

[0058] In accordance with the above technical scheme, specific embodiments of the present invention are given below. It should be noted that the present invention is not limited to the following specific embodiments, and all equivalent changes made on the basis of the technical scheme of this application fall within the protection scope of the present invention.

[0059] Example:

[0060] This embodiment provides a watershed division method based on deep learning semantic segmentation, which includes the following steps:

[0061] Step S1, collect a preset number of watershed image data samples of different landform types, and preprocess them to obtain multiple sub-image samples of preset sizes; annotate the multiple sub-image samples to obtain multiple annotated sub-image samples of the annotated watershed area, and form a watershed feature data set.

[0062] In step S1, the watershed image data adopts DEM elevation data. Samples of watershed image data of different landform types are collected, and reliable and accurate data are selected from the data sources of satellite remote sensing data, map data or meteorological data to ensure that sufficient information can be provided for watershed division. The distribution of different watersheds in the data set also needs to be considered, and it is necessary to ensure that the distribution of different watersheds is uniform to avoid overfitting of the model to certain watersheds. Comprehensive consideration is given to selecting DEM elevation data here.

[0063] In step S1, the preprocessing includes:

[0064] Step S101: Noise exists in the DEM elevation data, which will affect the accuracy and reliability of the data. This step uses Gaussian filtering to remove the noise.

[0065] Step S102: There are missing values ​​and outliers in the DEM data, which need to be repaired. In the present invention, missing values ​​are filled by Kriging interpolation, and outliers are repaired by using clustering methods.

[0066] Step S103, the range and resolution of the DEM data need to be clipped and resampled to meet the requirements, and the present invention uses Global Mapper raster processing software to perform clipping and resampling.

[0067] Step S104: In addition, the elevation value ranges of DEM data are different, and normalization processing is required to improve the comparability and accuracy of the data. The present invention adopts the minimum-maximum normalization method for normalization processing.

[0068] Step S2, dividing the sub-image annotated samples obtained in step S1 into a training set and a validation set.

[0069] In this step, the training set is used to train the deep learning model, and the validation set is used to adjust the model parameters and prevent overfitting.

[0070] In this embodiment, specifically, to meet the needs of training data, the DEM elevation data is first resampled to 60m resolution. The advantage of this is that the sample can contain as much watershed boundary information as possible. The data is cropped at a repetition rate of 10%, and the large area data is processed into a single sample of 512×512 pixels. After removing the data containing the boundary valueless area, a total of 40445 valid original samples are obtained, which are randomly divided into a training set and a validation set according to a ratio of 7:3.

[0071] Step S3, annotating and enhancing the watershed feature dataset obtained in step S1.

[0072] The annotation includes extracting boundaries using a canny operator and post-processing; the enhancement includes random transformation and enhancement combined with semantic information; the semantic information is watershed edge information.

[0073] Step S3 specifically includes the following steps:

[0074] Step S301, extracting boundaries:

[0075] First, the DEM elevation data in the watershed feature dataset is imported into the Global Mapper software for visualization of the pseudo-color gradient map, and then exported as an 8-bit single-channel grayscale image. The edge detection method canny operator is used to extract the boundary information. Due to the discreteness of the DEM data, the extracted results will have problems such as boundary breaks and overlaps, which need to be solved by post-processing.

[0076] Step S302, post-processing boundary:

[0077] The post-processing process uses a threshold parameter of 10 to remove spurs and boundary breaks on the boundary. The post-processing result generates a binary image of the mountain background and the watershed boundary, where the mountain background pixel value is set to 0 and the watershed boundary pixel value is set to 1.

[0078] Step S303, enhancement:

[0079] In order to increase the diversity of samples and improve the generalization and robustness of the model, it is necessary to perform data enhancement on the original samples. Two enhancement methods are used: one is to introduce random transformation, and the other is to enhance with semantic information.

[0080] The random transformation includes mirror flipping, rotation transformation, random translation, random rotation and random scaling.

[0081] The enhancement by combining semantic information includes randomly deleting some watershed boundary pixels in the watershed boundary extraction task to simulate noise and missing data in the actual watershed, so as to increase the robustness of the model to noise and missing data.

[0082] Step S4, for the watershed image data in the watershed feature data set annotated and enhanced in step S3, extract the multi-channel feature information of the watershed image data, wherein the multi-channel feature information includes TPI, slope, slope aspect, flow direction, profile curvature, local high point, slope variability, slope aspect variability, slope length and elevation variation coefficient.

[0083] As a derivative of synthetic aperture radar data, DEM elevation data has weak characterization capabilities of a single channel. In order to improve the segmentation accuracy of the model, multi-channel design is required as the input of the model.

[0084] The specific introduction of multi-channel feature information is as follows:

[0085] First, TPI is the difference between the central grid elevation and the mean elevation of the neighborhood grids in a local area. The TPI value reflects the degree of surface undulation in the local area.

[0086]

[0087] Where:

[0088] TPI represents the difference between the central grid elevation and the mean of the neighborhood grid elevation in a local area;

[0089] i Indicates i Neighborhood grids;

[0090] R The area radius representing the local area;

[0091] e c Indicates the central grid elevation in the local area;

[0092] 𝑒 i Indicates the local area i The neighborhood grid elevations.

[0093] Here are the general steps for calculating TPI:

[0094] (1.1) Define the analysis window size and resolution. The analysis window size refers to the size of the area on the terrain surface used to calculate the TPI. The resolution refers to the size of each pixel in the analysis window.

[0095] (1.2) Smooth the DEM data to reduce noise and details and make terrain features easier to identify.

[0096] (1.3) Calculate the difference between the height value of each pixel and the average of the height values ​​of the pixels surrounding it. This can be achieved by calculating the average height value in the analysis window and subtracting the height value of the center pixel from it.

[0097] (1.4) For each pixel, the difference value is compared with a defined threshold. If the value is greater than the threshold, the pixel is considered a peak; if the value is less than the threshold, the pixel is considered a valley.

[0098] (1.5) TPI is calculated based on the number and location of peaks or valleys. If the number of peaks is greater than the number of valleys, TPI is positive; if the number of valleys is greater than the number of peaks, TPI is negative; if the number of peaks and valleys is equal, TPI is zero.

[0099] (1.6) It should be noted that the calculation results of TPI may be affected by the choice of analysis window size and threshold.

[0100] Specifically, in this embodiment, a 3×3 analysis window size and a threshold of 1 are selected, and a resolution of 60m is selected.

[0101] Second, the slope reflects the steepness of the surface slope. Generally, in the river area, due to the sediment transport and deposition of the riverbed, the slope is relatively gentle. The following are the general steps for calculating the slope:

[0102] (2.1) Smooth the DEM to reduce noise and details and make terrain features easier to identify.

[0103] (2.2) Calculate the height gradient of each pixel. This can be achieved by calculating the difference in height values ​​around the pixel.

[0104] (2.3) Calculate the slope according to the calculation formula. The calculation formula for the slope is to divide the height gradient of each pixel by the horizontal resolution of the corresponding pixel (that is, the resolution of the DEM) and convert it into a percentage. The calculation formula is as follows:

[0105] Slope = arctan(rise / run)×100

[0106] Where:

[0107] arctan represents the inverse tangent function;

[0108] Rise represents the pixel height gradient (i.e., the rising height);

[0109] A run represents the horizontal resolution of the corresponding pixel (i.e., the resolution of the DEM).

[0110] (2.4) It should be noted that the slope calculation results may be affected by the resolution and smoothness of the DEM.

[0111] Specifically in this embodiment, the resolution of the DEM elevation data is 60m.

[0112] Third, the aspect refers to the direction of a point on the surface on the horizontal plane, which can also be called the slope direction. It is an important indicator for describing the terrain, usually expressed in the form of angle or direction. The aspect can be used to calculate the development of river networks, predict hydrological processes, determine the direction of terrain, etc. This example uses the slope method to calculate the aspect, which is based on the relationship between the ground slope angle and the cosine value of the horizontal direction.

[0113] Assuming the coordinates of a point in the DEM are (x, y) and the DEM value is z, the slope angle of the point can be calculated by the following formula: slope = arctan(sqrt((dz / dx)^2 + (dz / dy)^2))

[0114] Where:

[0115] dz / dx and dz / dy represent the gradients of the DEM in the x and y directions, respectively.

[0116] Sqrt() represents the square root function;

[0117] Then, the aspect is calculated by the following formula:

[0118] aspect=arctan2(dz / dy,-dz / dx)

[0119] Where:

[0120] aspect indicates the slope direction;

[0121] arctan2 represents the inverse tangent function, and its return value is an angle expressed in radians, which can be converted into an angle expressed in degrees as needed.

[0122] Fourth, flow direction refers to the direction in which water flows on the surface. In the digital elevation model (DEM), flow direction is obtained by calculating the elevation gradient around a point on the surface. After determining the slope and aspect, the D8 algorithm is used to calculate the flow direction. The basic idea of ​​the D8 algorithm is to move the water flow in the steepest direction until it encounters a direction steeper than it. When calculating the flow direction, the slope and aspect information of the adjacent pixels need to be considered. The calculation steps of the D8 algorithm are as follows:

[0123] (4.1) Preprocess the DEM and smooth out the outliers in the DEM to avoid abnormal results during the calculation process.

[0124] (4.2) Calculate the slope and aspect of each pixel in the DEM.

[0125] (4.3) For each pixel in the DEM, calculate its outflow direction in the D8 algorithm. This is usually achieved by finding the elevation and aspect information of adjacent pixels.

[0126] (4.4) According to the calculated outflow direction, each pixel is classified into the corresponding watershed.

[0127] Fifth, the profile curvature is a quantitative factor that quantifies the degree of distortion change at a point on the terrain surface. It is a measure of the rate of change of ground elevation along the direction of maximum slope drop. It is the rate of change of ground slope, or the second derivative of elevation change, which can reflect the local terrain structure. The following are the general steps for calculating profile curvature:

[0128] (5.1) Select a profile line. A profile line is a line along the terrain surface, usually selected manually by the user or extracted from DEM data.

[0129] (5.2) Select some sampling points on the profile line. The sampling points should be dense enough to represent the curvature change of the profile.

[0130] (5.3) Calculate the profile curvature for each sampling point. This can be achieved by fitting a quadratic function of the height values ​​around the sampling point. Specifically, the three-point quadratic function fitting method can be used to calculate the profile curvature, that is, the three points formed by the sampling point and its two adjacent points are used as the input values ​​of the fitting function to obtain the coefficients of the quadratic function and calculate the curvature value.

[0131] (5.4) You can choose to use different curvature calculation methods. This example uses the mean curvature method. The mean curvature method calculates the average curvature of all sampling points on the profile.

[0132] Sixth, in DEM, local high points usually refer to points with the maximum elevation value in the surrounding area. Calculating local high points follows the following steps:

[0133] (6.1) The DEM is smoothed to reduce noise and details and make terrain features easier to identify.

[0134] (6.2) Perform height analysis on the DEM to determine the highest height value in it.

[0135] (6.3) Determine the location of the highest height value. This example uses the pixel coordinates of the highest height value to determine its location.

[0136] Seventh, slope rate refers to the rate of change of surface slope with distance or position in a certain area. It can be used to analyze the degree of change of terrain, such as judging the flatness and complexity of terrain. To calculate the slope rate, you need to follow the following steps:

[0137] (7.1) The DEM is smoothed to reduce noise and details and make terrain features easier to identify.

[0138] (7.2) Perform slope analysis on the DEM to determine the slope value of each pixel.

[0139] (7.3) Calculate the slope change rate between adjacent pixels. This example uses the following formula to calculate the slope change rate of each pixel:

[0140] Slope rate= (Slope(i,j)-Slope(i-1,j-1)) / Slope(i-1,j-1)*100

[0141] Where:

[0142] Slope rate indicates the rate of change of slope;

[0143] Slope(i,j) represents the slope value of the (i,j)th pixel;

[0144] Slope(i-1,j-1) is the slope value of the pixel below and to its left.

[0145] When calculating the slope change rate, the slope values ​​between adjacent pixels are needed to determine the slope change rate.

[0146] Eighth, aspect variability refers to the rate of change of surface aspect with distance or position in a certain area. It can be used to analyze the degree of terrain change, such as judging the flatness and complexity of the terrain. To calculate aspect variability, you need to follow the following steps:

[0147] (8.1) The DEM is smoothed to reduce noise and detail and make terrain features easier to identify.

[0148] (8.2) Perform slope analysis on the DEM to determine the slope and aspect values ​​for each pixel.

[0149] (8.3) Calculate the slope change rate between adjacent pixels. The slope change rate of each pixel can be calculated using the following formula:

[0150] Aspect rate =abs(Aspect(i,j)-Aspect(i-1,j-1))

[0151] Where:

[0152] Aspect rate refers to the slope change rate;

[0153] abs means taking the absolute value;

[0154] Aspect(i,j) represents the slope value of the (i,j)th pixel;

[0155] Aspect(i-1,j-1) is the aspect value of the pixel to its lower left.

[0156] When calculating the aspect change rate, the aspect values ​​between adjacent pixels are needed to determine the aspect change rate.

[0157] Ninth, slope length refers to the horizontal distance from top to bottom along the terrain slope. It represents the actual distance traveled in the horizontal direction during the vertical elevation change. Slope length is often used to describe the steepness of the terrain and the continuity of terrain features. Longer slope lengths are usually associated with flatter terrain features, while shorter slope lengths indicate steeper terrain. To calculate slope length, you can use the following steps:

[0158] (9.1) The DEM is smoothed to reduce noise and detail and make terrain features more easily identifiable.

[0159] (9.2) Determine the path or area for which you want to calculate the slope length. You can select a specific route or area, or customize the path according to your needs.

[0160] (9.3) Extract elevation values ​​on the selected path or area. Extract elevation values ​​at appropriate intervals or steps according to the resolution and sampling density of the DEM data.

[0161] (9.4) Calculate the horizontal distance between adjacent elevation values. This can be done using either straight-line distance or Euclidean distance.

[0162] (9.5) Accumulate the horizontal distances between adjacent elevation values ​​to obtain the total slope length of the path or area.

[0163] Tenth, the coefficient of variation of elevation (CVE) is an indicator used to describe the degree of change in terrain elevation. It refers to the ratio of the standard deviation of elevation to the average elevation in a certain area. It is often used in the study of terrain change and land use change. The calculation steps of the coefficient of variation of elevation are as follows:

[0164] (10.1) Smooth the DEM to reduce noise and detail and make terrain features more easily identifiable.

[0165] (10.2) Calculate the mean μ and standard deviation σ of the DEM data.

[0166] Step S5, inputting the training set obtained in step S2 and the multi-channel feature information obtained in step S4 into the improved deep learning image semantic segmentation network for training, and obtaining a trained deep learning semantic segmentation model.

[0167] like Figure 1 As shown, the improvement process of the deep learning image semantic segmentation network is:

[0168] In step S501, the encoding layer goes through 5 stages in total. Each stage consists of two convolutional layers + normalization layer + ReLU layer, one bottleneck attention mechanism module, and the last layer is the maximum pooling layer, which uses a 2×2 convolution kernel with a step size of 2.

[0169] Step S502: A pooling module is added between the decoding layer and the encoding layer. The module is composed of four layers of convolution kernels, and the sizes are 1×1, 2×2, 3×3, and 6×6 respectively.

[0170] Step S503, the decoding layer corresponds to the encoding layer, and is divided into 5 stages in total. Each stage consists of a bottleneck attention mechanism module, an upsampling layer, two convolutional layers + normalization layer + ReLU layer.

[0171] Step S504, optimize the loss function in the original SegNet backbone network architecture, because the ratio of positive and negative samples in the watershed division task is seriously unbalanced, and the loss function needs to be adjusted according to this scenario. The loss function is set to the cross entropy loss (Cross Entropy Loss) and Dice loss for pixel category binary classification. Dice loss can alleviate the impact of sample imbalance, but considering the instability of Dice loss, a composite weighted loss function Loss is used. The final optimized loss function suitable for the watershed division task is:

[0172]

[0173]

[0174]

[0175] Where:

[0176] Represents the cross entropy loss function for binary classification of pixel categories;

[0177] express Loss function;

[0178] represents the composite weighted loss function;

[0179] Indicates pixels, ;

[0180] Indicates the number of pixels;

[0181] Represents the pixel label value;

[0182] Represents the predicted value of a single pixel;

[0183] represents the weighted hyperparameter, which is set to 0.7.

[0184] In this embodiment, the detection image is first preprocessed so that the width and height of the image are scaled to 512 pixels and multi-channel feature information is combined at the same time. The detection image and 10 multi-channel feature information, a total of 11 channels of information, are input into the improved backbone network.

[0185] Specifically in this embodiment, the accuracy and recall rate of the training model are tested through the validation set every 10 rounds of training to verify the model detection effect; the final model detection accuracy of the trained model is tested through the test set, and the model is considered acceptable if and only if the model accuracy rate is higher than 95%.

[0186] Step S6. Collect image data of the watershed to be tested of different landform types, and preprocess them according to the preprocessing method of step S1 to obtain multiple sub-images to be tested of preset sizes. The sub-images to be tested are input into the deep learning semantic segmentation model trained in step S5 to obtain the corresponding predicted images, thereby realizing the segmented image results of the watershed to be tested.

[0187] Application examples:

[0188] This application example provides a watershed division method based on deep learning semantic segmentation based on the above embodiment.

[0189] To verify the effectiveness of the present invention, the present invention has conducted a comparative test on the improved network model based on 28311 training sets, 12133 validation sets, and 4044 test sets, combined with multi-channel information (TPI, slope, profile curvature, slope direction, flow direction, local high point, slope change rate, slope change rate, slope length, and elevation variation coefficient). The idea of ​​the comparative experiment is to superimpose the elevation data and multi-channel feature information in sequence for experiments, which are recorded as comparative method 1, comparative method 2, ..., comparative method 10 in sequence.

[0190] The three indicators commonly used in deep learning, namely accuracy, average pixel accuracy MPA and weighted intersection-over-union FwIou, are used to evaluate the model effect. The calculation method is as follows:

[0191]

[0192] Where:

[0193] Indicates the number of positive samples for which both the model annotation results and the actual results are positive;

[0194] Indicates the number of positive samples labeled by the model and the number of negative samples in actual results;

[0195] Indicates the number of samples that are actually negative but marked as positive by the model;

[0196] Indicates the number of positive samples that are actually marked as negative samples by the model;

[0197] i represents the i-th category;

[0198] j represents the jth category;

[0199] k It means there are k+1 classes, including an empty class or background;

[0200] P i Indicates the pixel accuracy of each category;

[0201] P ii Indicates the actual number of pixels;

[0202] P ij It represents the number of pixels that belong to the i-th class but are predicted to be the j-th class.

[0203] Table 1 is a comparison between different models. It can be seen from the table that the method proposed in the present invention has achieved the best results in terms of accuracy, category average pixel accuracy MPA and weighted intersection over union FwIou compared with the comparison method.

[0204] Table 1 Effects of the present invention and two comparative methods

[0205]

Claims

1. A watershed division method based on deep learning semantic segmentation, characterized in that: The method proceeds as follows: Step S1, collecting a preset number of watershed image data samples of different landform types, and preprocessing them to obtain a plurality of sub-image samples of preset sizes; annotating the plurality of sub-image samples to obtain a plurality of annotated sub-image samples of the annotated watershed area, and forming a watershed feature data set; Step S2, dividing the sub-image annotated samples obtained in step S1 into a training set and a validation set; Step S3, annotating and enhancing the watershed feature dataset obtained in step S1: The annotation includes extracting boundaries and post-processing using a canny operator; the enhancement includes random transformation and enhancement combined with semantic information; the semantic information is watershed edge information; Step S4, extracting multi-channel feature information of the watershed image data in the watershed feature data set annotated and enhanced in step S3, wherein the multi-channel feature information includes TPI, slope, slope aspect, flow direction, profile curvature, local high point, slope variation rate, slope aspect variation rate, slope length and elevation variation coefficient; Step S5, inputting the training set obtained in step S2 and the multi-channel feature information obtained in step S4 into the improved deep learning image semantic segmentation network for training, thereby obtaining a trained deep learning semantic segmentation model; In step S5, the improvement process of the deep learning image semantic segmentation network is as follows: Step S501, the encoding layer goes through 5 stages in total, each stage consists of two convolutional layers + normalization layer + ReLU layer, one bottleneck attention mechanism module, and the last layer is the maximum pooling layer, which uses a 2×2 convolution kernel and a step size of 2; Step S502, a pooling module is added between the decoding layer and the encoding layer. The module is composed of four layers of convolution kernels, and the sizes are 1×1, 2×2, 3×3, and 6×6 respectively; Step S503, the decoding layer corresponds to the encoding layer and is divided into 5 stages. Each stage consists of a bottleneck attention mechanism module, an upsampling layer, two convolutional layers + normalization layer + ReLU layer; Step S504, optimizing the loss function in the original SegNet backbone network architecture, using a composite weighted loss function Loss; Step S6, collect image data of the watershed to be tested of different landform types, and preprocess them according to the preprocessing method of step S1 to obtain multiple sub-images to be tested of preset sizes. The sub-images to be tested are input into the deep learning semantic segmentation model trained in step S5 to obtain the corresponding predicted image, thereby realizing the segmentation image result of the watershed to be tested.

2. The watershed division method based on deep learning semantic segmentation according to claim 1, characterized in that: In step S1, the watershed image data adopts DEM elevation data.

3. The watershed division method based on deep learning semantic segmentation according to claim 1, characterized in that: In step S1, the preprocessing includes: Step S101, using Gaussian filtering method to remove noise; Step S102, using Kriging interpolation to fill in the outliers by using a clustering method; Step S103, using Global Mapper raster processing software to perform clipping and resampling; Step S104, performing normalization processing using a minimum-maximum normalization method.

4. The watershed division method based on deep learning semantic segmentation according to claim 2, characterized in that: Step S3 specifically includes the following steps: Step S301, extracting boundaries: Firstly, the DEM elevation data in the watershed feature dataset was imported into the Global Mapper software for visualization of pseudo-color shading images, and then exported as an 8-bit single-channel grayscale image. The edge detection method Canny operator was used to extract boundary information. Step S302, post-processing boundary: The post-processing process uses a threshold parameter of 10 to remove spurs and boundary breaks on the boundary. The post-processing result generates a binary image of the mountain background and the watershed boundary. The pixel value of the mountain background is set to 0, and the pixel value of the watershed boundary is set to 1. Step S303, enhancement: Two enhancement methods are used: one is to introduce random transformation, and the other is to enhance by combining semantic information; The random transformation includes mirror flipping, rotation transformation, random translation, random rotation and random scaling; The enhancement by combining semantic information includes randomly deleting some watershed boundary pixels in the watershed boundary extraction task to simulate noise and missing data in the actual watershed, so as to increase the robustness of the model to noise and missing data.

5. The watershed division method based on deep learning semantic segmentation according to claim 1, characterized in that: The final optimized loss function suitable for the watershed division task is: Where: Represents the cross entropy loss function for binary classification of pixel categories; express Loss function; represents the composite weighted loss function; Indicates pixels, ; Indicates the number of pixels; Represents the pixel label value; Represents the predicted value of a single pixel; represents the weighted hyperparameter, which is set to 0.7.