Grid adaptive optimization method for urban waterlogging simulation based on KNN-GAT-DDQN

The KNN-GAT-DDQN method is used to adaptively optimize the urban flooding simulation grid. Combining the KNN, GAT and DDQN algorithms solves the problem of difficulty in balancing accuracy and efficiency in grid optimization in the existing technology, and achieves a more efficient grid. Adaptive optimization improves the accuracy and computational efficiency of urban waterlogging simulation.

CN118246343BActive Publication Date: 2024-10-22TIANJIN UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410505866.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-25
Publication Date
2024-10-22
Estimated Expiration
2044-04-25

AI Technical Summary

Technical Problem

In urban flooding simulation, existing grid optimization methods are difficult to balance calculation accuracy and efficiency. Especially when the initial flood disaster changes drastically, the grid update time step cannot meet the needs, and the underlying surfaces such as different land use types are not fully considered. Conditional parameters lead to a decrease in simulation result accuracy and calculation speed.

Method used

The KNN-GAT-DDQN method is used to classify grid nodes through the K neighbor algorithm, the graph attention network extracts features, and uses the deep Q network for strategy selection to achieve grid adaptive optimization and retain the urban terrain and underlying surface to the maximum extent. surface information to improve model refinement and computational efficiency.

Benefits of technology

It improves the accuracy and efficiency of grid optimization, avoids the decrease in calculation speed caused by grid updates during the simulation process, and can iteratively coarsen the grid while maintaining the target properties, balancing the accuracy and calculation efficiency of waterlogging simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118246343B_ABST
    Figure CN118246343B_ABST
Patent Text Reader

Abstract

The present invention discloses a grid adaptive optimization method for urban waterlogging simulation based on KNN-GAT-DDQN. The method uses a grid generator to generate an initial high-precision grid in a study area, calculates the land use distribution and proportion in each grid according to the land use type, and obtains the initial state S of the grid. The KNN algorithm is used for feature classification. The multi-head attention mechanism of the graph attention network is used to calculate the feature vector h' of all N nodes. i (K), the grid feature vector #imgabs0# is obtained, and the improved deep Q network is used iteratively to select the strategy, and the final grid state and node selection scheme Q(S,a) are output. The present invention selects the best strategy based on the high-precision model grid, and realizes efficient adaptive grid optimization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to urban flood prevention and disaster reduction computer simulation technology and the field of machine learning technology, in particular to a grid optimization method for an urban waterlogging calculation model. Background Art

[0002] The accuracy of urban waterlogging simulation is most affected by terrain accuracy and grid quality. The accuracy and scale of the grid seriously restrict the accuracy of flood model simulation results. Due to the particularity of urban terrain, refined waterlogging simulation often requires smaller grids to ensure accuracy, but it will lead to a decrease in model calculation speed. How to optimize the grid efficiently and balance calculation efficiency and accuracy is a difficult problem that needs to be solved urgently. The optimization of urban waterlogging model calculation grids is generally adjusted manually, and only local encryption is performed on key areas of concern. There is a certain degree of subjectivity, and it is impossible to fully retain the effective information of urban terrain, and the accuracy of simulation results is difficult to guarantee. The adaptive grid generation method is to coarsen the grid according to the water level gradient or elevation gradient of adjacent grids during the model calculation process, realize the adaptive generation of the grid, and improve the grid accuracy. However, it is often necessary to use the results of the model solution as input to guide the generation of new grids, and specify the time step to update the grid. However, the degree of change of flood disasters in the early stage is large, and the grid update time step is difficult to meet the actual needs. The continuous update of the grid also requires high computing power, and the calculation rate is significantly reduced. This grid generation method does not take into account underlying surface condition parameters such as different land use types, but only considers changes in water level and elevation. Some of the coarsened grids are difficult to fully reflect the actual situation of the urban surface.

[0003] Therefore, there is a problem that it is difficult to balance the computational accuracy and efficiency for the grid optimization of the urban waterlogging model. On this basis, a new grid adaptive optimization method is proposed. Before the simulation starts, the modeling area features are fully explored and the grid is adaptively adjusted using artificial intelligence methods. This can not only improve the adaptability of the grid, but also avoid the problem of decreased computational speed caused by grid updates during the simulation. The deep reinforcement learning method combines the perception ability of deep learning and the decision-making ability of reinforcement learning. It has greater advantages in dealing with complex tasks and has been widely used. The K-nearest neighbor algorithm (KNN) is a machine learning algorithm for classification. It is suitable for multi-classification problems with high accuracy. The graph attention network (GAT) is a space-based graph convolutional network. Its attention mechanism is to use the attention mechanism to determine the weight of the node neighborhood when aggregating feature information. KNN is used to classify the grid node features of the underlying surface conditions of the urban model, such as different land use types and impervious surfaces, and the multi-head attention mechanism of GAT is used to extract grid node features. GAT can improve model performance and retain information about nodes and their neighbors, ensure the continuity of grid node information, and retain more effective information when optimizing the grid. The DDQN algorithm is a value-based reinforcement learning method. Given a policy evaluation function, the policy is updated according to the value function, that is, the state-action value function (state-action value function), also called the Q function. It has powerful feature extraction and generalization capabilities, and is stable. It has significant advantages in dealing with complex problems. DDQN is based on this and draws on the idea of ​​the double Q learning network to improve performance stability and reduce the risk of overestimation. Based on the above algorithm, it can be used to solve the grid optimization problem. While maintaining the target attribute calculation, the grid is iteratively coarsened. The initial grid node file is classified and extracted by the K-Nearest Neighbor (KNN) algorithm and the Graph attention network (GAT). The DDQN method is used to optimize the strategy selection of the grid nodes after feature extraction. It can improve the model refinement and computational efficiency on the basis of maximally retaining the urban terrain and underlying surface information. It is of great significance to seek a balance between the accuracy and computational efficiency of urban waterlogging simulation. Summary of the invention

[0004] Based on the problems existing in the above-mentioned prior art, the present invention aims to propose a grid adaptive optimization method for urban flood simulation based on KNN-GAT-DDQN, which classifies grid nodes based on the K-nearest neighbor algorithm (KNN), extracts features of grid nodes using a graph attention network (GAT), and selects the optimal strategy for grid nodes using DDQN, thereby achieving efficient grid-scale adaptive optimization and solving the problem of the contradiction between flood model accuracy and computational efficiency.

[0005] The present invention is achieved by the following technical solutions:

[0006] A grid adaptive optimization method for urban waterlogging simulation based on KNN-GAT-DDQN, comprising:

[0007] Step 1: Use the grid generator to generate the initial grid in the study area, calculate the land use distribution and proportion in each grid according to the land use type, and obtain the initial state S of the grid;

[0008] Step 2: Use KNN algorithm to classify grid nodes according to the characteristics including different underlying surface types, land use conditions, special landforms, flood-prone points, underground spaces, and special boundaries;

[0009] Step 3: The grid of the two-dimensional hydrodynamic model is represented as a graph M = (N, L), where N is the total number of nodes in the grid, L is the connection edge between the grid nodes, and the features of all nodes N include node elevation, elevation gradient between the node and the adjacent grid, and node classification. The multi-head attention mechanism of the graph attention network is used to calculate the node feature vector h' of all N nodes. i (K), get the grid node feature vector The mesh node feature extraction of the two-dimensional hydrodynamic model further includes:

[0010] a) For any node i, calculate the similarity coefficient e between the node's neighboring point j and the node i one by one ij , the node neighboring point j includes the node connected to the node i through an edge and the center point of the grid adjacent to the node i, j∈N i , the calculation formula is as follows:

[0011] e ij =a([Wh i ||Wh j ]),j∈N i

[0012] Where: W is the parameter used for feature enhancement, h i is the feature of any node i, h j is the feature of the node's adjacent point j, a() is a mapping function that maps the concatenated high-dimensional features to a real number, Ni is the total number of nodes adjacent to any node i;

[0013] b) Normalized attention coefficient α ij The expression is as follows:

[0014]

[0015] Where: LeakyReLU(*) is the activation function, exp() is the exponential function, e ij is the similarity coefficient of node i’s neighboring point j relative to it, e ix is the similarity coefficient of node i’s neighboring point x relative to it, N i is the total number of nodes adjacent to any node i, and x represents the neighboring point of the xth node;

[0016] c) Weighted summation of node features is performed to obtain the new feature h' output by GAT for any node i that incorporates neighborhood information i (K), the expression is as follows:

[0017]

[0018] Where: K is the number of attention heads, y represents the y-th head, σ(*) is the activation function, α ij is the normalized attention coefficient, W is the parameter for feature enhancement, and h j is the feature of node j’s neighboring points, N i is the total number of nodes adjacent to any node i;

[0019] Step 4, iteratively adopt the improved deep Q network to select the strategy, including the following processing:

[0020] Using the grid feature vector at the current state S in the improved deep Q network As input, the action value function Q value output corresponding to all actions of the improved deep Q network is obtained, and the corresponding action a, that is, the grid node to be deleted, is selected from the current action value function Q value output using the ε greedy method; the current action a, that is, the operation of deleting the grid node, is executed under the current state S, and the remaining grid nodes are reconstructed to generate a new grid state S', thereby obtaining the feature vector corresponding to the grid state S'. and reward function R; Update the current grid state S = S';

[0021] Step 5: Determine whether the iteration stop condition is met. If so, S' is in the termination state. When the current round of iteration is completed, the final grid state and node selection scheme Q(S, a) are output.

[0022] Compared with the prior art, the present invention can achieve the following beneficial technical effects:

[0023] 1) The KNN algorithm is used to classify the features of grid nodes. Compared with the existing adaptive grid generation method, it takes into account the differences in underlying surface conditions and surface information, and improves the model grid accuracy;

[0024] 2) The GAT graph attention network is used to extract features from the original grid data, which can integrate the surrounding information of the grid nodes, better consider parameters such as land use type when selecting grid nodes, avoid inappropriate grid merging, and ensure the rationality of the grid optimization process;

[0025] 3) The DDQN method is used to train the grid optimization process, and only the grid nodes are selected and removed, and the optimization only needs to be performed before the simulation, which avoids the problem of decreased computational efficiency caused by repeated optimization of the grid during the simulation process and improves the grid optimization efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 It is a training flow chart of the urban waterlogging simulation grid optimization method based on KNN-GAT-DDQN of the present invention;

[0027] Figure 2 Schematic diagram of mesh optimization effect, (a) mesh before optimization, (b) mesh after optimization. DETAILED DESCRIPTION

[0028] The technical solution of the present invention will be described in detail below in conjunction with the accompanying drawings.

[0029] like Figure 1 As shown, the present invention provides a grid optimization method for urban waterlogging simulation based on KNN-GAT-DDQN to achieve grid scale adaptive optimization. Specifically, the following steps are performed:

[0030] S1, construct the action value function Q, Q(S,a) = E[R+γmaxQ'(S',a')], Q is the expected value given the current grid state S and the current strategy selection a, R is the reward function, E() is the expectation function, γ is the decay factor, and the target action value function Q' is constructed synchronously. At the beginning of the process, the Q' function is the same as the Q function, and the parameters are also the same. The setting of the target action value function Q' is used to solve the problem of unstable algorithm training. S' is the target grid state, and a' is the target action;

[0031] S2, randomly initialize all parameters θ of the action value function Q, initialize all parameters θ'=θ of the target action value function Q', initialize the experience pool D, the experience pool capacity is Cap, set the parameter update interval C, update the parameters of the action value function Q every C steps, and define the iteration stop judgment condition as a function of the grid quality and the maximum grid size;

[0032] S3, using the grid generator to generate the initial high-precision grid in the study area, and interpolating the elevation data. To ensure the grid optimization effect, the scale of the grid should be as small as possible. The land use distribution and proportion in each grid are calculated according to the land use type to obtain the initial state S of the grid;

[0033] S4, marking grids containing special features, flood-prone points, underground spaces, special boundaries, etc., and using the KNN algorithm to classify nodes based on different underlying surface types and land use conditions;

[0034] S5, the grid of the two-dimensional hydrodynamic model is represented as a graph M = (N, L), where N is the total number of nodes in the grid, L is the connection edge between the grid nodes, and the features of all nodes N include node elevation, node and adjacent grid elevation gradient, node classification, and the node feature vector h' is extracted using the graph attention network i (K), get the grid feature vector Specifically, the node neighboring points refer to the nodes connected to the node through an edge and the center points of the grids adjacent to the node;

[0035] a) For any node i, calculate the similarity coefficient e between the node's neighboring point j and the node i one by one ij , the node neighboring point j includes the node connected to any node i through an edge and the center point of the grid adjacent to the node i, j∈N i , the calculation formula is as follows:

[0036] e ij =α([Wh i ||Wh j ]),j∈N i (1)

[0037] Where: W is the parameter used for feature enhancement, h i is the feature of any node i, h j is the feature of the node's adjacent point j, a() is a mapping function that maps the concatenated high-dimensional features to a real number, N i is the total number of nodes adjacent to any node i;

[0038] d) Normalized attention coefficient α ij The expression is as follows:

[0039]

[0040] Where: LeakyReLU(*) is the activation function, exp() is the exponential function, e ij is the similarity coefficient of node i’s neighboring point j relative to it, e ixis the similarity coefficient of node i’s neighboring point x relative to it, N i is the total number of nodes adjacent to any vertex i, and x represents the xth adjacent node;

[0041] b) The weighted sum of the node features is obtained by the graph attention mechanism GAT output, which integrates the neighborhood information for any node i. i (K), the expression is as follows:

[0042]

[0043] Where, for multiple attention pooling outputs, each attention pool is called a head, K is the number of attention heads, y represents the y-th head, σ(*) is the activation function, and α ij is the normalized attention coefficient, W is the parameter for feature enhancement, and h j is the feature of the adjacent node j, N i is the total number of nodes adjacent to any vertex i;

[0044] S6, iteratively adopts the improved deep Q network to select its strategy: the grid node feature vector under the current grid state S is used in the improved deep Q network (DDQN) As input, the action value function Q value output corresponding to all actions of the improved deep Q network is obtained, and the corresponding action a, that is, the grid node to be deleted, is selected from the current action value function Q value output using the ε greedy method;

[0045] S7, execute the current action a to delete the mesh nodes in the current state S, smooth the remaining mesh nodes until the mesh converges, perform parameter interpolation calculation, obtain new mesh nodes, obtain the new mesh state S', and then obtain the feature vector corresponding to the new state S' and reward function R;

[0046] S8, update the current grid S = S';

[0047] S9, whether the iteration stop threshold w is met, if it is met, S' is in the termination state, the current round of iteration is completed, and the final grid state and node selection scheme Q(S, a) are output, otherwise repeat and continue to the next step S10;

[0048] S10, Put them into the experience pool D, sample from the experience pool D, and sample m samples etc., calculate the target action value function Q value y of t samples of the current node selection scheme Q(S,a) t , as shown below:

[0049]

[0050] Where: m is the total number of samples, R t is the reward function of the tth sample, w indicates whether it is a terminal state, γ is the attenuation factor, Q(*) is the action value function value calculated by the action value function Q, Q'(*) is the decision target value calculated by the target action value function Q', argmax() is a function that finds the parameter set of the function, which is the set of parameters that make the function reach the maximum value, θ is all the parameters of the action value function Q network, θ' is all the parameters of the target action value function Q' network, a is the grid node selected by the Q network in S6, is the feature vector corresponding to the grid state S' of the tth sample, It is the feature vector corresponding to the grid state S of the t-th sample; Q'=Q is updated every C steps as the depth of improvement.

[0051] S11, using mean square error loss function All parameters θ of the action value function Q network are updated through the gradient back propagation of the neural network. In the formula, t represents the tth sample, m is the total number of samples, and y t The target action value function Q value of the t-th sample of the current node selection solution Q(S,a), is the feature vector corresponding to the grid state S of the t-th sample, a is the grid node selected by the Q network in S6, and θ is all the parameters of the action value function Q network;

[0052] S12, every C steps, update the parameter θ'=θ of the parameter target action value function Q'; repeat the calculation of the similarity coefficient from step 5 to step 9 until the termination state is reached.

[0053] The description of the KNN-GAT-DDQN algorithm involved in the above specific embodiments is only typical and is not intended to limit the present invention. For those skilled in the art, it can be improved and changed according to the above invention content. Any modification, equivalent substitution, improvement or change made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A grid adaptive optimization method for urban flooding simulation based on KNN-GAT-DDQN, It is characterized in that include: Step 1: Use the grid generator to generate the initial grid in the study area, calculate the land use distribution and proportion in each grid according to the land use type, and obtain the initial state S of the grid; Step 2: Use KNN algorithm to classify grid nodes according to the characteristics of different underlying surface types, land use conditions, special landforms, flood-prone points, underground spaces, and special boundaries; Step 3: The grid of the two-dimensional hydrodynamic model is represented as a graph M = (N, L), where N is the total number of nodes in the grid, L is the connection edge between the grid nodes, and the features of all nodes N include node elevation, elevation gradient between the node and the adjacent grid, and node classification. The multi-head attention mechanism of the graph attention network is used to calculate the node feature vector h' of all N nodes. i (K), get the grid node feature vector The mesh node feature extraction of the two-dimensional hydrodynamic model further includes: a) For any node i, calculate the similarity coefficient e between the node's neighboring point j and the node i one by one ij , the node neighboring point j includes the node connected to the node i by an edge and the center point of the grid adjacent to the node i, j∈N i , the calculation formula is as follows: e ij =a([Wh i ||Wh j ]),j∈N i Where: W is the parameter used for feature enhancement, h i is the feature of any node i, h j is the feature of the node's adjacent point j, a() is a mapping function that maps the concatenated high-dimensional features to a real number, N i is the total number of nodes adjacent to any node i; b) Normalized attention coefficient α ij The expression is as follows: Where: LeakyReLU(*) is the activation function, exp() is the exponential function, e ij is the similarity coefficient of node i’s neighboring point j relative to it, e ix is the similarity coefficient of node i’s neighboring point x relative to it, N i is the total number of nodes adjacent to any node i, and x represents the neighboring point of the xth node; c) Weighted summation of node features is performed to obtain the new feature h' output by GAT for any node i that incorporates neighborhood information i (K), the expression is as follows: Where: K is the number of attention heads, y represents the y-th head, σ(*) is the activation function, α ij is the normalized attention coefficient, W is the parameter for feature enhancement, and h j is the feature of node j’s neighboring points, N i is the total number of nodes adjacent to any node i; Step 4, iteratively adopt the improved deep Q network to select the strategy, including the following processing: Using the grid feature vector at the current state S in the improved deep Q network As input, the action value function Q value output corresponding to all actions of the improved deep Q network is obtained, and the corresponding action a, that is, the grid node to be deleted, is selected from the current action value function Q value output using the ε greedy method; the current action a, that is, the operation of deleting the grid node, is executed under the current state S, and the remaining grid nodes are reconstructed to generate a new grid state S', thereby obtaining the feature vector corresponding to the grid state S'. and reward function R; Update the current grid state S = S'; Step 5: Determine whether the iteration stop condition is met. If so, S' is in the termination state. When the current round of iteration is completed, the final grid state and node selection scheme Q(S, a) are output.

2. A KNN-GAT-DDQN-based urban waterlogging simulation grid adaptive optimization method as claimed in claim 1, It is characterized in that The method further includes randomly initializing all parameters θ of the action value function Q, initializing all parameters θ'=θ of the target action value function Q', initializing the experience pool D with a capacity of Cap, setting a parameter update interval C, updating the parameters of the target action value function Q' every C steps, and defining the iteration stop judgment condition as a function of the grid quality and the maximum grid size.

3. The grid adaptive optimization method for urban waterlogging simulation based on KNN-GAT-DDQN as claimed in claim 1, It is characterized in that If the iteration stop condition is not met, repeat the following steps: Will Put them into the experience pool D, sample from the experience pool D, sample m samples, and calculate the action value function Q value y of the tth sample of the current node selection solution Q(S,a) t , as shown below: Use mean square error loss function Update all parameters θ of the improved deep Q network through gradient backpropagation of the neural network; In the above formula: m is the total number of samples, R t is the reward function of the tth sample, w indicates whether it is a terminal state, γ is the attenuation factor, Q(*) is the action value function value calculated by the action value function Q, Q'(*) is the decision target value calculated by the target action value function Q', argmax() is a function that finds the parameter set of the function, which is the set of parameters that make the function reach the maximum value, θ is all the parameters of the action value function Q network, θ' is all the parameters of the target action value function Q' network, a is the grid node selected by the Q network, is the feature vector corresponding to the grid state S' of the tth sample, is the feature vector corresponding to the grid state S of the tth sample, y t is the target action value function Q value of the tth sample of the current node selection scheme Q(S,a); Update the parameter θ'=θ of the parameter target action value function Q' every C steps until the iteration termination state is reached.

4. The method for adaptive optimization of urban waterlogging simulation grid based on KNN-GAT-DDQN as claimed in claim 1, It is characterized in that It includes constructing the action-value function Q, Q(S,a) = E[R+γmaxQ'(s',a')], where E() is the expectation function, R is the reward function, Q' is the target action-value function, which is the same as Q, S' is the target grid state, and a' is the strategy selection of the target action-value function.