Geological disaster risk assessment method and system fusing random forest and attention

By integrating a deep learning network model with random forest and attention mechanisms, the problem of unresolved inter-indicator dependencies in geological disaster risk assessment is solved, achieving higher accuracy in risk assessment.

CN116167617BActive Publication Date: 2026-01-02FUZHOU UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211711675.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-29
Publication Date
2026-01-02
Estimated Expiration
2042-12-29

AI Technical Summary

Technical Problem

Existing geological hazard risk assessment models fail to fully consider the dependencies and implicit relationships between indicators, resulting in insufficient assessment accuracy.

Method used

A deep learning network model that integrates random forest and attention mechanisms is adopted to generate geological disaster risk levels by extracting features from basic geographic information, meteorological data and socio-economic data and calculating the contribution of risk assessment indicators, combined with self-attention and cross-attention mechanisms.

Benefits of technology

It improves the accuracy of geological hazard risk assessment and enables more accurate prediction of geological hazard risk levels in different regions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116167617B_ABST
    Figure CN116167617B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of geological disaster risk assessment method and system fusing random forest with attention, the method includes the following steps: step A: basic geographic information data, meteorological data and social and economic data are collected as risk assessment index, geological disaster risk grade, geological disaster type as label, training set TS is constructed;Step B: using training set TS, random forest model RF and deep learning network model G based on attention mechanism are trained, for predicting geological disaster risk grade;Step C: risk assessment index and geological disaster type are input into random forest model RF and deep learning network model G, obtain geological disaster risk grade.The method and system are beneficial to improve the accuracy of geological disaster risk assessment.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the field of geological disaster risk assessment, and particularly relates to a geological disaster risk assessment method and system fusing random forest and attention. BACKGROUND

[0002] Geological disasters refer to geological phenomena that directly or indirectly cause loss of human life and property and damage to the environment due to natural or human factors. Common geological disasters include floods, landslides, and mudslides. There are many factors that contribute to geological disasters, such as rainfall, slope, vegetation coverage, population, etc. The distribution of geological disasters in time and space is closely related to natural environment and human activities, and is often the result of their interaction. With the development of modern civilization, humans are more dependent on nature and increasingly demand natural resources, which has led to more frequent and severe geological disasters, posing a significant threat to human life and property. Therefore, it is necessary to assess the risk of geological disasters.

[0003] With the rapid development of artificial intelligence technology, many researchers have applied machine learning models to the field of geological disaster risk assessment. Geological disaster risk assessment models based on BP neural networks take indicators as input, pass through a hidden layer, and obtain the risk level of each region. Geological disaster risk assessment models based on random forests establish decision trees for indicators, and the weights of the indicators are automatically determined based on the training model, which can accurately determine the risk level. However, existing research has not considered the dependency between indicators, and has not fully considered the implicit relationship between different disasters and different indicators. SUMMARY

[0004] The present application aims to provide a geological disaster risk assessment method and system that fuses random forest and attention, which can improve the accuracy of geological disaster risk assessment.

[0005] To achieve the above-mentioned purpose, the technical solution adopted by the present application is as follows: a geological disaster risk assessment method fusing random forest and attention, comprising the following steps:

[0006] Step A: Collect basic geographic information data, meteorological data, and social and economic data as risk evaluation indicators, and geological disaster risk levels and types as labels to construct a training set TS;

[0007] Step B: Use the training set TS to train a random forest model RF and a deep learning network model G based on attention mechanism for predicting geological disaster risk levels;

[0008] Step C: input the risk evaluation indexes and the geological disaster types into the random forest model RF and the deep learning network model G to obtain a geological disaster risk level.

[0009] Further, the step B specifically comprises the following steps:

[0010] Step B1: divide the training set TS according to the geological disaster types, train the random forest model according to the geological disaster types respectively, calculate the contribution degrees of the risk evaluation indexes, rank the risk evaluation indexes according to the contribution degrees, and reserve the top K risk evaluation indexes; process the training set according to the K risk evaluation indexes reserved by different types of geological disasters, reserve the corresponding risk evaluation indexes, and construct a new training set T after simplifying the risk evaluation indexes;

[0011] Step B2: input all training samples of the new training set T after simplifying the risk evaluation indexes into the deep learning network model based on the attention mechanism, perform two types of initial encoding through the encoding module, and thus obtain initial representation vectors E e1 and E e2 ;

[0012] Step B3: input the two initial representation vectors E e1 and E e2 obtained in step B2 into the multi-channel convolutional neural network, extract important features, and obtain a multi-channel representation vector H c ;

[0013] Step B4: input the multi-channel representation vector H c obtained in step B3 into the self-attention module to obtain a correlation representation vector H self between the risk evaluation indexes;

[0014] Step B5: randomly initialize the disaster types as a set of vectors E type , select a corresponding disaster vector from the set of vectors E type as a query vector q according to the current disaster type; take the correlation representation vector H self obtained in step B4 as a key vector k and a value vector v; input the query vector q, the key vector k and the value vector v into the attention mechanism module to obtain a cross-attention representation vector H cross between the risk evaluation indexes and the disaster types;

[0015] Step B6: input the cross-attention representation vector H crossThe input is normalized by a linear classification layer and a sofimax function to generate scores f(type, s, p) of different risk levels of disasters, and the risk level is obtained according to the scores; then, according to a target loss function loss, the gradients of parameters in the deep learning network model are calculated by a back propagation method, and the parameters are updated by a stochastic gradient descent method;

[0016] Step B7: When the change of the loss value generated by the deep learning network model in each iteration is less than a given threshold value or the maximum number of iterations is reached, the training process of the deep learning network model is terminated.

[0017] Further, the step B1 specifically comprises the following steps:

[0018] Step B11: The training set TS is traversed and divided into different classification training sets k according to the types of geological disasters i , and a random forest model RF is trained according to different types of geological disasters i ;

[0019] Step B12: The random forest model trained in step B11 is used to calculate the contribution degree of each risk evaluation index by a Gini index:

[0020]

[0021]

[0022]

[0023] Wherein, VIM represents the risk evaluation index contribution score, GI represents the Gini index, C represents the classification category, I represents the number of decision trees, J represents the number of risk evaluation indexes, P qc represents the proportion of the category in the node q, represents the Gini index of the i-th tree node q, represents the risk evaluation index X j in the i-th tree node q, the importance of the i-th tree node q, that is, the change amount of the Gini index before and after the branching of the node q, and respectively represent the Gini indexes of the two new nodes after branching, Q represents the risk evaluation index X j in the i-th tree node set, represents the X j importance of the i-th tree;

[0024]

[0025]

[0026] Contribution degree of risk evaluation index X j ;

[0027] Step B13: The contribution degree obtained in step B12 is sorted in descending order, and for each disaster type, the top K risk evaluation indexes with the highest contribution degree are retained. The training set T after simplifying the risk evaluation indexes is obtained by traversing the training set TS and retaining the corresponding K risk evaluation indexes according to the disaster type.

[0028] Further, the step B2 specifically comprises the following steps:

[0029] Step B21: Traverse the new training set T after simplifying the risk evaluation indexes obtained in step B13, and each training sample in T is represented as t = (type, s, p); wherein type represents the geological disaster type, s represents the simplified risk evaluation index, and p represents the geological disaster risk level, including {high risk, medium risk, low risk};

[0030] The risk evaluation index s is represented as:

[0031] s = {s 1 , s 2 , …, s K}

[0032] Step B22: Randomly initialize the encoding of the risk evaluation index s = {s 1 , s 2 , …, s K} obtained in step B21; first, use the Logarithm Discretization method to take the logarithm of s i , and then take the integer part;

[0033]

[0034] Then, use one-hot encoding to convert the risk evaluation index into a high-dimensional sparse vector, i.e. [0, 0, 0, 1..., 0], and use embedding technology to convert the high-dimensional binary vector into a low-dimensional dense representation; is a randomly initialized embedding dictionary, where D i represents has D i unique values, and d represents the vector dimension;

[0035] The embedding representation of s i is obtained by looking up in L ; The entire input feature embedding representation, i.e. the initial representation vector of the risk evaluation index, is:

[0036]

[0037] in,

[0038] Step B23: Apply the risk assessment index s = {s} obtained in step B21 1 s 2 , ..., s K Encode;

[0039] s i Consider it as a length of |s i sequence of | Through the pre-trained word vector matrix The sequence s was found in the search. i initial characterization Where V represents the number of words in the dictionary, d represents the dimension of the word vector, and the initial representation Represented as:

[0040]

[0041] in,

[0042] Step B24: Apply the initial representation obtained in step B23 The input is given to the forward and backward layers of a bidirectional long short-term memory neural network, which respectively yield the forward hidden layer state vector sequence. and the reverse hidden layer state vector sequence in,

[0043] The forward hidden state vector and the backward hidden state vector are concatenated and then average pooled to obtain the digital hidden state:

[0044]

[0045]

[0046] in,

[0047] A self-attention mechanism is used to capture the relationships and dependencies between metrics, and to hide all numerical states. Compute context digital hidden state

[0048]

[0049]

[0050] in, is the attention weight of the index s i W1 is a trainable parameter matrix,

[0051] aggregate and to obtain an initialized feature representation E based on the pre-trained word vector e2 , i.e. another initial representation vector of the risk evaluation index:

[0052]

[0053]

[0054] wherein,

[0055] Further, the step B3 specifically comprises the following steps:

[0056] Step B31: input the two different initial representation vectors E e1 and E e2 obtained in steps B23 and B24 into a multi-channel convolutional neural network to obtain a multi-channel convolutional representation h c , and the calculation formula is as follows:

[0057] h c = MultichannelCNN(f stack (E e1 , E e2 ))

[0058] wherein, f stack (·) is a stacking function, MultichannelCNN(·) is a multi-channel convolutional neural network, d1 is the vector dimension;

[0059] Step B32: input the multi-channel convolutional representation h c into a linear layer to obtain a multi-channel representation vector:

[0060] H c = h c W2 + b1

[0061] wherein, W2 is a trainable parameter matrix, is a bias vector.

[0062] Further, the step B4 specifically comprises the following steps:

[0063] Step B41: perform attention on the multi-channel representation vector H​c The attention score is calculated, and the attention degree between each risk evaluation index is calculated to obtain a self-attention score score self , score self The calculation formula is as follows:

[0064] score self = tanh(H c W3x (H c W4) T )

[0065] Wherein, tanh is an activation function, W3, W4 are trainable parameter matrices;

[0066] Step B42: Normalizing the self-attention score score self , the self-attention weight of the i-th risk evaluation index is calculated The calculation formula is as follows:

[0067]

[0068] Step B43: Calculate the correlation representation vector between each risk evaluation index through the self-attention weight The calculation formula is as follows;

[0069]

[0070] Wherein,

[0071] Step B44: Input the correlation representation vector between risk evaluation indexes Into the linear layer to obtain the index representation H self of self-attention H self The calculation formula is as follows:

[0072] H self = h self W5+b2

[0073] Wherein, W5 is a trainable parameter matrix, is a bias vector.

[0074] Further, the step B5 specifically includes the following steps:

[0075] Step B51: Randomly initialize the disaster type as a set of representation vector set E type Each vector in it represents a disaster type, and the corresponding disaster vector is selected according to the disaster type of the current training set r query vectors of cross attention;

[0076] wherein E type is represented as:

[0077]

[0078] wherein, n is the number of disaster types;

[0079] Step B52: the index of self-attention obtained in step B44 is represented as H self and the disaster vector The cross-attention score is calculated to calculate the attention degree between each risk evaluation index and disaster type, and the cross-attention score score cross is obtained. cross The calculation formula of score

[0080]

[0081] wherein tanh is an activation function, W6 and W7 are trainable parameter matrices;

[0082] Step B53: the cross-attention score score cross is normalized to calculate the cross-attention weight a cross between the ith risk evaluation index and disaster type. cross The calculation formula of a

[0083]

[0084] Step B54: the correlation representation vector between each risk evaluation index and disaster type is calculated through the cross-attention weight The calculation formula is as follows.

[0085]

[0086] wherein,

[0087] Step B55: the correlation representation vector between the risk evaluation index and the disaster type is input into the feedforward neural network to obtain the cross-attention representation vector H cross The calculation formula of H cross is as follows.

[0088] H cross = Relu(h cross W8+b3)W9+b4

[0089] wherein, W8, W9 are trainable parameter matrices, is a bias vector.

[0090] Further, the step B6 specifically comprises the following steps:

[0091] Step B61: inputting the cross-attention representation vector H cross to a linear classification layer and performing normalization processing using a softmax function to generate scores f(type, s, p) [0, 1] of different risk levels, and the calculation formula is as follows:

[0092] f(type, s, p) = softamx(H cross )

[0093] Step B62: using cross-entropy as a loss function to calculate a loss value, updating a learning rate through a gradient optimization algorithm Adam, updating model parameters through back propagation iteration, and training the model to minimize the loss function, and the calculation formula of minimizing the loss function L is as follows:

[0094]

[0095] where f(type, s, p) n [0, 1] is the risk level score calculated by the softmax classifier, N is the number of disaster levels, p in is a real label, which is 1 if the real class of sample i is equal to n, and 0 otherwise.

[0096] The application also provides a geological disaster risk assessment system using the above method, comprising:

[0097] A data collection module is configured to collect basic geographic information data, meteorological data and social and economic data as risk evaluation indexes, geological disaster risk levels and geological disaster types as labels, and construct a training set.

[0098] A random forest model training module is configured to train random forest models according to the types of the risk evaluation indexes, obtain the contribution degrees of the indexes of different geological disaster types, sort the indexes of different geological disaster types according to the contribution degrees, retain the first K risk evaluation indexes, and obtain the risk evaluation indexes of different geological disaster types.

[0099] The neural network model training module is configured to input risk evaluation indexes of different geological disaster types and geological disaster types into a deep learning network based on an attention mechanism, obtain a final feature vector of the risk evaluation indexes, and train the deep learning network based on the feature vector, use a probability that the feature vector belongs to a certain category and labels in a training set as a loss, train the entire deep learning network to minimize the loss, and obtain a deep learning network model based on the attention mechanism.

[0100] The risk assessment module is configured to analyze and process the input risk evaluation indexes and geological disaster types by using the trained random forest model and the deep learning network model based on the attention mechanism, and output a risk level of the corresponding geological disaster type.

[0101] Compared with the prior art, the present application has the following technical effects: a geological disaster risk assessment method and system are provided, which fuse a random forest and attention, the method fuses a random forest model and a deep learning network model based on an attention mechanism, trains a random forest model according to types of risk evaluation indexes, trains a deep learning network model based on an attention mechanism by using obtained risk evaluation indexes of different geological disaster types, and then analyzes and processes input risk evaluation indexes and geological disaster types by using the trained model, and outputs a risk level of the corresponding geological disaster type, thereby improving the accuracy of geological disaster risk assessment. BRIEF DESCRIPTION OF DRAWINGS

[0102] Figure 1 is a method implementation flowchart of an embodiment of the present application;

[0103] Figure 2 is a model architecture diagram of an embodiment of the present application;

[0104] Figure 3 is a system structure schematic diagram of an embodiment of the present application. DETAILED DESCRIPTION

[0105] The present application will be further described below in combination with the drawings and embodiments.

[0106] It should be pointed out that the following detailed description is exemplary and is intended to provide further description of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as generally understood by those skilled in the art to which the present application belongs.

[0107] It is to be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of example embodiments according to the present application. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, steps, operations, elements, components, and / or groups thereof, but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, and / or groups thereof.

[0108] As shown in Figure 1 , 2 , the embodiment provides a geological disaster risk assessment method fusing random forest and attention, comprising the following steps:

[0109] Step A: Collecting basic geographic information data, meteorological data and social economic data as risk assessment indexes, geological disaster risk grade and geological disaster type as labels, and constructing a training set TS.

[0110] Step B: Using the training set TS to train a random forest model RF and a deep learning network model G based on an attention mechanism for predicting the geological disaster risk grade.

[0111] Step C: Inputting the risk assessment indexes and the geological disaster type into the random forest model RF and the deep learning network model G to obtain the geological disaster risk grade.

[0112] In the embodiment, the step B specifically comprises the following steps:

[0113] Step B1: Dividing the training set TS according to the geological disaster type, training the random forest model according to the geological disaster type respectively, calculating the contribution degree of the risk assessment indexes, ranking the risk assessment indexes according to the contribution degree, retaining the top K risk assessment indexes; processing the training set according to the K risk assessment indexes retained by different types of geological disasters, retaining the corresponding risk assessment indexes, and constructing a new training set T after simplifying the risk assessment indexes.

[0114] Step B2: Inputting all training samples of the new training set T after simplifying the risk assessment indexes into the deep learning network model based on the attention mechanism, performing two different types of initial encoding through an encoding module based on a sequence neural network and Logarithm Discretization, so as to obtain initial representation vectors E e1 and E e2 .

[0115] Step B3: Inputting the two initial representation vectors E e1 and E e2 obtained in step B2 into a multi-channel convolutional neural network, extracting important features, and obtaining a multi-channel representation vector H c.

[0116] Step B4: input the multi-channel feature vector H c obtained in step B3 into the self-attention module to obtain a correlation feature vector H self .

[0117] Step B5: randomly initialize the disaster type as a set of vector sets E type , and select a corresponding disaster vector type from the vector set E according to the current disaster type as a query vector q; input the correlation feature vector H self obtained in step B4 as a key vector k and a value vector v; input the query vector q, the key vector k and the value vector v into the attention mechanism module to obtain a cross-attention feature vector H cross .

[0118] Step B6: input the cross-attention feature vector H cross obtained in step B5 into a linear classification layer and perform normalization processing using a softmax function to generate scores f(type, s, p) of different risk levels of disasters, and obtain the risk level according to the scores; then calculate the gradient of each parameter in the deep learning network model by the back propagation method according to the target loss function loss, and update each parameter by using the stochastic gradient descent method.

[0119] Step B7: when the loss value generated by each iteration of the deep learning network model changes less than a given threshold value or reaches a maximum iteration number, terminate the training process of the deep learning network model.

[0120] In this embodiment, the step B1 specifically comprises the following steps:

[0121] Step B11: traverse the training set TS, and divide it into different classification training sets k i according to the geological disaster types; and train a random forest model RF i according to different geological disaster types.

[0122] Step B12: calculate the contribution degree of each risk evaluation index by using the Gini index for the random forest model trained in step B11:

[0123]

[0124]

[0125]

[0126] Where VIM represents the contribution score of risk assessment indicators, GI represents the Gini index, C represents the classification category, I represents the number of decision trees, J represents the number of risk assessment indicators, and P represents the contribution score of risk assessment indicators. qc This represents the proportion of each category in node q. Let q represent the Gini index of the i-th tree node. Indicates risk assessment indicator X j The importance of the i-th tree node q is the change in the Gini index before and after the branch at node q. and Let X represent the Gini index of the two new nodes after the branch, and Q represent the risk assessment indicator. j The set of nodes that appear in decision tree i X represents j The importance of the i-th tree.

[0127]

[0128]

[0129] Indicates risk assessment indicator X j The degree of contribution.

[0130] Step B13: Sort the contribution scores obtained in step B12 in descending order. For each disaster type, retain the top K risk assessment indicators with the highest contribution scores. Traverse the training set TS and retain the corresponding K risk assessment indicators according to the disaster type to obtain a new training set T with simplified risk assessment indicators.

[0131] In this embodiment, step B2 specifically includes the following steps:

[0132] Step B21: Traverse the new training set T obtained in step B13 after simplifying the risk assessment indicators. Each training sample in T is represented as t = (type, s, p); where type represents the geological disaster type, s represents the simplified risk assessment indicator, and p represents the geological disaster risk level, including {high risk, medium risk, low risk}.

[0133] Risk assessment indicator s is represented as:

[0134] s={s 1 s 2 , ..., s K}

[0135] Step B22: Apply the risk assessment index s = {s} obtained in step B21 1 s 2 , ..., s KRandomly initialized encoding. First, the Logarithm Discretization method is used to first take the logarithm of s i , and then take the floor.

[0136]

[0137] Then, the one-hot encoding is used to convert the risk evaluation index into a high-dimensional sparse vector, i.e., [0, 0, 0, 1..., 0], and the embedding technique is used to convert the high-dimensional binary vector into a low-dimensional dense representation; is a randomly initialized embedding dictionary, where D i represents D i unique values, and d represents the vector dimension.

[0138] The embedding representation of s i is obtained by looking up in L . The entire input feature embedding representation, i.e., the initial representation vector of the risk evaluation index, is:

[0139]

[0140] where,

[0141] Step B23: Encode the risk evaluation index s 1 ={s 2 , s K} obtained in step B21.

[0142] s i is regarded as a sequence of length |s i |. The initial representation of the sequence s i is obtained by looking up in the pre-trained word vector matrix . where V represents the number of words in the dictionary, d represents the dimension of the word vector, and the initial representation is represented as:

[0143]

[0144] where,

[0145] Step B24: Input the initial representation obtained in step B23 to the forward layer and the reverse layer of a bidirectional long short-term memory neural network, respectively, to obtain the forward hidden layer state vector sequence and the reverse hidden layer state vector sequence wherein,

[0146] The forward hidden state vector and the backward hidden state vector are spliced and average-pooled to obtain a numerical hidden state:

[0147]

[0148]

[0149] wherein,

[0150] The self-attention mechanism is used to capture the relationship and dependency between indicators, and all numerical hidden states The context numerical hidden state is calculated

[0151]

[0152]

[0153] wherein, is the attention weight of the indicator s i , W1 is a trainable parameter matrix,

[0154] The and are aggregated to obtain an initialized feature representation E based on the pre-trained word vector e2 , that is, another initial representation vector of the risk evaluation indicator:

[0155]

[0156]

[0157] wherein,

[0158] In the embodiment, the step B3 specifically comprises the following steps:

[0159] Step B31: input the two different initial representation vectors E e1 and E e2 obtained in steps B23 and B24 into a multi-channel convolutional neural network to obtain a multi-channel convolutional representation h c , and the calculation formula is as follows:

[0160] h c = MultichannelCNN(fstack (E e1 , E e2 ))

[0161] where f stack (·) is a stacking function, MultichannelCNN(·) is a multi-channel convolutional neural network, d1 is the dimension of the vector.

[0162] Step B32: input the multi-channel convolutional representation h c to a linear layer to obtain a multi-channel representation vector:

[0163] H c = h c W2+b1

[0164] where W2 is a trainable parameter matrix, and b1 is a bias vector.

[0165] In this embodiment, the step B4 specifically comprises the following steps:

[0166] Step B41: calculate the attention score of the multi-channel representation vector H c obtained in step B32, calculate the attention degree between each risk evaluation indicator, and obtain a self-attention score score self , score self is calculated according to the following formula:

[0167] score self = tanh(H c W3x (H c W4) T )

[0168] where tanh is an activation function, W3, W4 are trainable parameter matrices.

[0169] Step B42: normalize the self-attention score score self , and calculate the self-attention weight of the i-th risk evaluation indicator The calculation formula of

[0170]

[0171] Step B43: calculate the correlation representation vector between each risk evaluation indicator through the self-attention weight

[0172]

[0173] wherein,

[0174] Step B44: input the correlation representation vector between the risk evaluation indexes into a linear layer to obtain the index representation H of self-attention self self The calculation formula of H is as follows:

[0175] self self W5+b2

[0176] wherein, W5 is a trainable parameter matrix, and b2 is a bias vector.

[0177] In the embodiment, the step B5 specifically comprises the following steps:

[0178] Step B51: randomly initialize the disaster type as a set of representation vector set E type Each vector in E represents a disaster type, and the corresponding disaster vector is selected according to the disaster type of the current training set T as the query vector of cross-attention.

[0179] wherein, E type is expressed as:

[0180]

[0181] wherein, n is the number of disaster types.

[0182] Step B52: calculate the cross-attention score between the self-attention index representation H self obtained in step B44 and the disaster vector to calculate the attention degree between each risk evaluation index and the disaster type, and obtain the cross-attention score score cross The calculation formula of score cross is as follows:

[0183]

[0184] wherein, tanh is an activation function, W6 and W7 are trainable parameter matrices.

[0185] Step B53: normalize the cross-attention score score cross to calculate the cross-attention weight a cross between the i-th risk evaluation index and the disaster type, and a​​​​​cross The calculation formula of h

[0186]

[0187] Step B54: Calculate the correlation representation vector between each risk evaluation index and disaster type through cross attention weight The calculation formula of h

[0188]

[0189] Wherein,

[0190] Step B55: Input the correlation representation vector between risk evaluation index and disaster type into a feedforward neural network to obtain cross attention representation vector H cross , the calculation formula of H cross is as follows:

[0191] H cross = Relu(h cross W8+b3)W9+b4

[0192] Wherein, W8, W9 are trainable parameter matrices, and b3, b4 are bias vectors.

[0193] In this embodiment, the step B6 specifically comprises the following steps:

[0194] Step B61: Input the cross attention representation vector H cross obtained in step B55 into a linear classification layer, and use the softmax function for normalization processing to generate scores f(type, s, p) ∈ [0, 1] of different risk levels, and the calculation formula is as follows:

[0195] f(type, s, p) = softamx(H cross )

[0196] Step B62: Use cross entropy as the loss function to calculate the loss value, update the learning rate through the gradient optimization algorithm Adam, and update the model parameters through back propagation iteration to train the model to minimize the loss function, and the calculation formula of minimizing the loss function L is as follows:

[0197]

[0198] Wherein, f(type, s, p) n ​is the risk level score calculated by the softmax classifier, N is the number of disaster levels, p in is the true label, which takes 1 if the true class of sample i equals n, and 0 otherwise.

[0199] As shown in Figure 3 The embodiment also provides a geological disaster risk assessment system employing the method, which comprises a data collection module, a random forest model training module, a neural network model training module, and a risk assessment module.

[0200] The data collection module is configured to collect basic geographic information data, meteorological data, and social and economic data as risk assessment indexes, and geological disaster risk levels and geological disaster types as labels, to construct a training set.

[0201] The random forest model training module is configured to train random forest models according to the types of the risk assessment indexes, to obtain the contribution degrees of the indexes of different geological disaster types, to sort the indexes of different geological disaster types according to the contribution degrees, to retain the first K risk assessment indexes, and to obtain risk assessment indexes of different geological disaster types.

[0202] The neural network model training module is configured to input the risk assessment indexes of different geological disaster types and the geological disaster types into a deep learning network based on an attention mechanism, to obtain a final representation vector of the risk assessment indexes and train the deep learning network based on the representation vector, to use the probability that the representation vector belongs to a certain category and the labels in the training set as a loss, to train the entire deep learning network to minimize the loss, and to obtain a deep learning network model based on the attention mechanism.

[0203] The risk assessment module is configured to analyze and process input risk assessment indexes and geological disaster types by using the trained random forest model and the deep learning network model based on the attention mechanism, and to output a risk level corresponding to a geological disaster type.

[0204] Those skilled in the art will understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage, etc.) containing computer-usable program code.

[0205] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 means for functionally implementing the steps in one or more flow or blocks

[0206] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 means for functionally implementing the steps in one or more flow or blocks

[0207] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 means for functionally implementing the steps in one or more flow or blocks

[0208] The above description is only preferred embodiments of the present application, and is not intended to limit the present application to other forms described above. Any person skilled in the art can make modifications or improvements without departing from the technical scope of the present application. Any modifications, equivalent replacements, and improvements made to the above embodiments based on the technical ideas disclosed in the present application shall fall within the scope of protection of the present application.

Claims

1. A geological hazard risk assessment method integrating random forest and attention, characterized in that, Includes the following steps: Step A: Collect basic geographic information data, meteorological data, and socioeconomic data as risk assessment indicators, and use geological hazard risk level and geological hazard type as labels to construct a training set. ; Step B: Using the training set Training a random forest model and deep learning network models based on attention mechanisms Used to predict the risk level of geological disasters; Step C: Input the risk assessment indicators and geological hazard types into the random forest model. and deep learning network models In the process, the geological disaster risk level is obtained; Step B specifically includes the following steps: Step B1: For the training set The geological hazard types are categorized, and random forest models are trained for each type to calculate the contribution of risk assessment indicators. These indicators are then ranked according to their contribution, and the top K indicators are retained. The training set is then processed according to the K risk assessment indicators retained for each geological hazard type, retaining the corresponding indicators to construct a new training set with simplified risk assessment indicators. ; Step B2: Use the new training set after simplifying the risk assessment indicators. All training samples are input into an attention-based deep learning network model, where two different types of initial encoding are performed through the encoding module to obtain the initial representation vector of the risk assessment index. and ; Step B3: Combine the two initial representation vectors obtained in step B2. and The input is fed into a multi-channel convolutional neural network to extract key features and obtain a multi-channel representation vector. ; Step B4: Convert the multi-channel representation vector obtained in step B3 into a multi-channel representation vector. The input is fed into the self-attention module to obtain the correlation representation vectors between various risk assessment indicators. ; Step B5: Randomly initialize the disaster type as a set of vectors. Based on the current disaster type, from the vector set Select the corresponding disaster vector As the query vector q; the relevant representation vector obtained in step B4 is used as the query vector q; As the key vector k and value vector v, the query vector q, key vector k, and value vector v are input into the attention mechanism module to obtain the final cross-attention representation vector between the risk assessment index and the disaster type. ; Step B6: Convert the cross-attention representation vector obtained in step B5 into a single vector. The input is fed into a linear classification layer and normalized using the softmax function to generate scores for different disaster risk levels. The risk level is obtained based on the score; then, based on the target loss function, the gradient of each parameter in the deep learning network model is calculated through backpropagation, and the parameters are updated using stochastic gradient descent. Step B7: When the change in loss value generated by the deep learning network model in each iteration is less than the given threshold or the maximum number of iterations is reached, the training process of the deep learning network model is terminated.

2. The geological hazard risk assessment method integrating random forest and attention as described in claim 1, characterized in that, Step B1 specifically includes the following steps: Step B11: For the training set The process involves iterating through the geological hazards and dividing the data into different training sets based on their type. Train a random forest model based on different types of geological hazards. ; Step B12: Calculate the contribution of each risk assessment indicator using the Gini coefficient for the random forest model trained in Step B11. Wherein, VIM represents the contribution score of risk assessment indicators, GI represents the Gini index, C represents the classification category, I represents the number of decision trees, and J represents the number of risk assessment indicators. This represents the proportion of each category in node q. Let q represent the Gini index of the i-th tree node. Indicators of risk assessment The importance of the i-th tree node q is the change in the Gini index before and after the branch at node q. and These represent the Gini coefficients of the two new nodes after the branch, respectively, and Q is the risk assessment indicator. The set of nodes that appear in decision tree i express The importance of the i-th tree; Indicators of risk assessment The degree of contribution; Step B13: Sort the contribution scores obtained in Step B12 in descending order. For each disaster type, retain the top K risk assessment indicators with the highest contribution scores, and iterate through the training set. Based on the disaster type, retain the corresponding K risk assessment indicators to obtain a new training set with simplified risk assessment indicators. .

3. The geological hazard risk assessment method integrating random forest and attention as described in claim 2, characterized in that, Step B2 specifically includes the following steps: Step B21: Iterate through the new training set T obtained from step B13 with the simplified risk assessment indicators. Each training sample in T is represented as... Where type represents the type of geological hazard, s represents the simplified risk assessment index, and p represents the geological hazard risk level, including {high risk, medium risk, low risk}. Risk assessment indicator s is represented as: Step B22: Apply the risk assessment indicators obtained in step B21 Perform random initialization encoding; first, use the Logarithm Discretization method to first... Take the logarithm, then round down to the nearest integer; Then, one-hot encoding is used to convert the risk assessment indicators into high-dimensional sparse vectors, i.e., [0,0,0,1…,0], and embedding technology is used to convert the high-dimensional binary vectors into low-dimensional dense representations. yes A randomly initialized embedding dictionary, in which express There is A unique value, where d represents the vector dimension; Through Find it in Embedded representation The feature embedding representation of the entire input, i.e., an initial representation vector of the risk assessment index, is as follows: in, ; Step B23: Apply the risk assessment indicators obtained in step B21 Encode; Will Consider it as a length of sequence Through the pre-trained word vector matrix The sequence was found in the middle. initial characterization Where V represents the number of words in the dictionary, d represents the dimension of the word vector, and the initial representation... Represented as: in, ; Step B24: Apply the initial representation obtained in step B23 The input is given to the forward and backward layers of a bidirectional long short-term memory neural network, which respectively yield the forward hidden layer state vector sequence. and the reverse hidden state vector sequence ,in, , , , , ; The forward hidden state vector and the backward hidden state vector are concatenated and then average pooled to obtain the digital hidden state: in, , ; A self-attention mechanism is used to capture the relationships and dependencies between metrics, and to hide all numerical states. Compute context digital hidden state : in, , It is an indicator Attention weights , It is a trainable parameter matrix. ; Will and Aggregation is performed to obtain an initial feature representation based on pre-trained word vectors. That is, another initial representation vector of the risk assessment indicators: in, , .

4. The geological hazard risk assessment method integrating random forest and attention as described in claim 3, characterized in that, Step B3 specifically includes the following steps: Step B31: Combine the two different initial representation vectors obtained in steps B23 and B24. and The input is fed into a multi-channel convolutional neural network to obtain a multi-channel convolutional representation. The calculation formula is as follows: in, It is a stacked function. It is a multi-channel convolutional neural network. , It is the vector dimension; Step B32: Represent the multi-channel convolution The input is fed into a linear layer to obtain a multi-channel representation vector: in, , , It is a trainable parameter matrix. It is the bias vector.

5. The geological hazard risk assessment method integrating random forest and attention as described in claim 4, characterized in that, Step B4 specifically includes the following steps: Step B41: Process the multi-channel representation vector obtained in step B32 Calculate the attention score by assessing the degree of attention among various risk assessment indicators, and obtain the self-attention score. , The calculation formula is as follows: Where tanh is the activation function. , , , It is a trainable parameter matrix; Step B42: Calculate self-attention scores Perform normalization processing and calculate the self-attention weight of the i-th risk assessment indicator. , The calculation formula is as follows: Step B43: Calculate the correlation representation vectors among various risk assessment indicators using self-attention weights. , The calculation formula is as follows; in, ; Step B44: Represent the correlation vectors between risk assessment indicators. The input is fed into a linear layer to obtain a self-attention index representation. , The calculation formula is as follows: in, , , It is a trainable parameter matrix. It is the bias vector.

6. The geological hazard risk assessment method integrating random forest and attention as described in claim 5, characterized in that, Step B5 specifically includes the following steps: Step B51: Randomly initialize the disaster type as a set of representation vectors. Each vector in it Representing a disaster type, the corresponding disaster vector is selected based on the disaster type in the current training set T. As a query vector for cross-attention; in, Represented as: in, , where n is the number of disaster types; Step B52: Characterization of the self-attention index obtained in step B44 and disaster vector The cross-attention score is calculated by determining the degree of attention among various risk assessment indicators and disaster types. , The calculation formula is as follows: Where tanh is the activation function. , , , It is a trainable parameter matrix; Step B53: Calculate the cross-attention score After normalization, calculate the cross-attention weight between the i-th risk assessment indicator and the disaster type. , The calculation formula is as follows: Step B54: Calculate the correlation representation vector between each risk assessment indicator and disaster type using cross-attention weights. , The calculation formula is as follows; in, ; Step B55: Establish the correlation representation vector between risk assessment indicators and disaster types. The input is fed into a feedforward neural network to obtain a cross-attention representation vector. , The calculation formula is as follows: in, , , , , It is a trainable parameter matrix. , It is the bias vector.

7. The geological hazard risk assessment method integrating random forest and attention as described in claim 6, characterized in that, Step B6 specifically includes the following steps: Step B61: The cross-attention representation vector obtained in step B55... The input is fed into a linear classification layer and normalized using the softmax function to generate scores for different risk levels. The calculation formula is as follows: Step B62: Calculate the loss value using cross-entropy as the loss function, update the learning rate using the Adam gradient optimization algorithm, and iteratively update the model parameters using backpropagation to train the model by minimizing the loss function. The formula for minimizing the loss function L is as follows: in, The risk level score is calculated by the softmax classifier, where N is the number of disaster levels. It is the true label. If the true category of sample i is equal to n, it is 1; otherwise, it is 0.

8. A geological hazard risk assessment system employing the method described in any one of claims 1-7, characterized in that, include: The data collection module is used to collect basic geographic information data, meteorological data, and socio-economic data as risk assessment indicators, and geological disaster risk level and geological disaster type as labels to construct a training set; The random forest model training module is used to train a random forest model according to the risk assessment indicators, obtain the contribution degree of the indicators for different geological disaster types, sort the indicators for different geological disaster types according to their contribution degree, retain the top K risk assessment indicators, and obtain the risk assessment indicators for different geological disaster types. The neural network model training module is used to input risk assessment indicators and geological hazard types of different geological hazard types into a deep learning network based on an attention mechanism, obtain the final representation vector of the risk assessment indicator, and use it to train the deep learning network. The probability of the representation vector belonging to a certain category and the labels in the training set are used as the loss, and the entire deep learning network is trained with the goal of minimizing the loss, so as to obtain a deep learning network model based on an attention mechanism. The risk assessment module uses a trained random forest model and an attention-based deep learning network model to analyze and process the input risk assessment indicators and geological hazard types, and outputs the risk level of the corresponding geological hazard type.

Citation Information

Patent Citations

  • Geological disaster multi-disaster comprehensive risk evaluation method based on random forest

    CN111582386A

  • Catalytic cracking device key index modeling method fused with time sequence feature extraction

    CN115188429A