Method for predicting influence of flood discharge on vibration of residential building by using deep learning
Through deep learning technology, a deep learning model based on the Transformer model is established to predict the impact of flood discharge on residential building vibration, solving the problems of low prediction accuracy and poor robustness in the existing technology, and achieving more accurate flood discharge decisions and a more complete urban flood control system.
Patent Information
- Application Number
- CN202411815951.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-04-08
AI Technical Summary
The existing prediction methods have low accuracy and poor robustness when predicting the impact of flood discharge on residential buildings, and cannot provide accurate reference for future flood discharge decisions.
Deep learning technology is adopted to collect and preprocess data about flood discharge and residential building vibration, establish a deep learning model based on the Transformer model, introduce local attention mechanism and time series characteristics, and train predictive models to predict the impact of flood discharge on residential building vibration.
It has achieved accurate and effective prediction of the impact of flood discharge on residential buildings, improved the scientificity and accuracy of flood discharge decisions, and enhanced the perfection of urban flood control systems.
Smart Images

Figure CN119782731A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of water conservancy, and in particular to a method for predicting the impact of flood discharge on vibration of residential buildings by using deep learning. Background Art
[0002] In recent years, global climate change has become increasingly serious, and extreme weather has occurred frequently, leading to more frequent flood disasters around the world. Flood discharge has become one of the important measures to avoid floods. However, large-scale flood discharge activities often have a great impact on the surrounding environment and buildings, especially for residential buildings located near the flood discharge area. The ground floor and foundation are impacted by the flood discharge flow from the dam area, which in turn causes vibration of the residential buildings, abnormal noises from doors and windows, and other adverse effects.
[0003] Most existing prediction methods can only rely on the feelings of surrounding residents, the experience of engineering personnel or intuitive observation to judge the possible impact of flood discharge on surrounding residential buildings. They lack systematicness and accuracy, and cannot provide accurate reference for future flood discharge decisions.
[0004] In addition, traditional prediction methods often rely on empirical formulas and statistical models, requiring that the assumptions of the model must strictly meet the distribution of actual data. However, actual flood discharge data are often affected by many factors, including but not limited to flood discharge volume, flood discharge time, land quality, building characteristics, etc., and their data distribution presents a complex nonlinear relationship. Therefore, traditional prediction methods often have low accuracy and poor robustness. Summary of the invention
[0005] The present invention aims to provide a method for predicting the impact of flood discharge on the vibration of residential buildings by using deep learning, so as to solve the problems of low accuracy and poor robustness of traditional prediction methods.
[0006] The present invention provides a method for predicting the impact of flood discharge on the vibration of residential buildings by using deep learning, comprising the following steps:
[0007] S1. Collect relevant data on flood discharge and vibration of residential buildings;
[0008] S2, preprocessing the collected data to obtain a data set;
[0009] S3. Build a deep learning model;
[0010] S4. Use the data set to train a deep learning model, and obtain a prediction model after the training is completed;
[0011] S5, using the prediction model to predict the impact of flood discharge on the vibration of residential buildings.
[0012] In some embodiments, in step S1, the relevant data on flood discharge and residential building vibration include flood discharge volume, flood discharge duration, location, height, structural information of the residential building, and real-time vibration data of the residential building.
[0013] In some embodiments, in step S2, the data preprocessing includes data cleaning, data standardization, data normalization and data splitting.
[0014] In some embodiments, in step S3, establishing a deep learning model includes:
[0015] The local attention mechanism and time series characteristics are introduced on the basis of the Transformer model to obtain the deep learning model.
[0016] In some embodiments, the deep learning model includes an encoder, a decoder and a prediction part; the encoder is used to process input data, and the decoder is used to generate prediction results; the prediction part is used to perform a linear transformation on the prediction results of the encoder to obtain the degree of vibration impact of residential buildings; wherein, the encoder and decoder introduce local attention mechanism and time series characteristics.
[0017] In some embodiments, the encoder comprises:
[0018] Define n-dimensional input flood discharge data X = [x 1 ,x 2 ,...,x n ], representing the flood discharge at each time point, and the corresponding position code PE = [pe 1 ,pe 2 ,...,pe n ], represents the relative position of each time point in the sequence or the time information; the flood discharge data X is added to the corresponding position code PE to obtain the position-coded sequence X'=X+PE;
[0019] The sequence X' is transformed through a series of linear transformations to generate the query matrix Q, key matrix K, and value matrix V. The corresponding calculation formula is: Q = X'W q ,K=X'W k , and V = X'W v ; Among them, W q , W k , W v is the weight matrix learned by the model;
[0020] Then, based on the local attention mechanism, the local attention score matrix A is calculated; when calculating the attention score, the local attention score is only calculated within the specified window. The calculation formula is as follows: For any i, j, if j is not in the local window of i, then a {ij} =0, otherwise a {ij} represents the contribution weight of position j when encoding position i, that is, the attention weight; T represents the transpose operation of the matrix; the parameter d represents the dimension of the vector;
[0021] Finally, the local attention score matrix A is multiplied by the value matrix V to obtain the encoder output Z = AV.
[0022] In some embodiments, the decoder comprises:
[0023] The encoder output Z is input into the decoder, and the query matrix Q, key matrix K, and value matrix V are generated through linear transformation. The corresponding calculation formula is: Q = ZW' q , K=ZW' k , V=ZW' v Among them, W' q , W' k , and W' v is the weight matrix that the model needs to learn;
[0024] Then, based on the local attention mechanism, the local attention score matrix is calculated. When calculating the attention score, the local attention score is only calculated within the specified window. The calculation formula is as follows: For any i, j, if j is not in the local window of i, then a' {ij} =0, otherwise a' {ij} Represents the contribution weight of position j when decoding position i, that is, the attention weight;
[0025] Finally, the local attention score matrix A' is multiplied by the value matrix V to obtain the decoder output H: H = A'V.
[0026] In some embodiments, the prediction part is: performing a linear transformation on the output H of the decoder to obtain a final prediction result Y, which is expressed as Y=HW, where W is a weight matrix to be learned.
[0027] In some embodiments, step S4 includes the following sub-steps:
[0028] S401, forward propagation: the data X is sent to the deep learning model, and each layer of the deep learning model performs calculations layer by layer until the prediction result Y' is obtained;
[0029] S402, calculating the loss, the loss function is the mean square error MSE;
[0030] S403, back propagation: Use the chain rule to calculate the partial derivatives of the loss function L with respect to all model parameters, that is, the gradient of each parameter;
[0031] S404, updating parameters: updating each parameter of the model based on the gradient of each parameter;
[0032] S405. Repeat S401-S404 until the model performance reaches a preset number of iterations.
[0033] In some embodiments, step S4 further includes the following sub-steps:
[0034] S406, based on the difference between the prediction result of the model and the true value, the mean square error (MSE) and the root mean square error (RMSE) are used as evaluation indicators of the regression problem to evaluate the trained model.
[0035] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:
[0036] The present invention can accurately and effectively predict the impact of flood discharge on the vibration of residential buildings through deep learning technology. First, by collecting rich data related to flood discharge and residential building vibration in a targeted manner, we can fully understand the potential impact of flood discharge on the safety of residential buildings, which is conducive to making more reasonable flood discharge decisions, avoiding or reducing the vibration of residential buildings and building damage that may be caused by flood discharge, and improving housing safety; at the same time, for natural disasters such as severe floods, it can provide more scientific and accurate data support, which is helpful to build a more complete urban flood control system. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 This is a flow chart of a method for predicting the impact of flood discharge on vibration of residential buildings using deep learning in an embodiment of the present invention.
[0038] Figure 2 Flow chart of model training in an embodiment of the present invention. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0040] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] Example
[0042] like Figure 1 As shown, this embodiment proposes a method for predicting the impact of flood discharge on the vibration of residential buildings by using deep learning, including the following steps:
[0043] S1. Collect relevant data on flood discharge and vibration of residential buildings;
[0044] S2, preprocessing the collected data to obtain a data set;
[0045] S3. Build a deep learning model;
[0046] S4. Use the data set to train a deep learning model, and obtain a prediction model after the training is completed;
[0047] S5, using the prediction model to predict the impact of flood discharge on the vibration of residential buildings.
[0048] In some embodiments, in step S1: the relevant data regarding flood discharge and vibration of residential buildings include flood discharge volume, flood discharge duration, location, height, structural information of residential buildings, and real-time vibration data of residential buildings.
[0049] Data source selection: Data sources include on-site vibration monitoring, flood discharge dispatch center, government data platform, meteorological bureau, environmental protection department, etc.
[0050] Data collection methods: Data collection is carried out according to data requirements and data sources. Possible data collection methods include web crawling, API interface calls, manual downloads, questionnaires, cloud monitoring databases, etc. When collecting data, it is necessary to ensure the integrity, accuracy and timeliness of the data.
[0051] In some embodiments, in step S2, the data preprocessing includes data cleaning, data standardization, data normalization and data splitting to ensure data quality and data validity; specifically as follows:
[0052] The data cleaning is to remove outliers using IQR (interquartile range); IQR is a powerful tool for identifying outliers, which works based on quartiles (Q1, i.e. 25% quantile; Q3, i.e. 75% quantile) and the distance between these two values.
[0053] The specific steps to use IQR to remove outliers in data cleaning are as follows:
[0054] First, calculate the first quartile Q1 and the third quartile Q3 of the data.
[0055] Then, the interquartile range IQR is calculated, that is, the first quartile Q1 and the third quartile Q3, expressed as:
[0056] IQR=Q3-Q1
[0057] Finally, find out the data that is lower than (Q1-α*IQR) or higher than (Q3+α*IQR), which are regarded as outliers and are deleted from the data.
[0058] Among them, α is a set coefficient, which is set as needed. For example, based on the knowledge of normal distribution, in normal distribution, about 99.3% of the values fall within the range of (Q1-1.5IQR) to (Q3+1.5*IQR), and values outside this range can be regarded as outliers.
[0059] The data standardization makes the data on the same level to avoid some features dominating the model due to excessively large values. The mathematical formula is:
[0060] Z=(X-μ) / σ
[0061] Among them, Z is the standardized data, X is the original data, μ is the mean of the data, and σ is the standard deviation of the data.
[0062] The data is normalized so that the data is between [0,1], which is conducive to the convergence of the deep learning model. The mathematical formula is:
[0063] Y=(X-min) / (max-min)
[0064] Among them, Y is the normalized data, X is the original data, min is the minimum value of the data, and max is the maximum value of the data;
[0065] The data splitting refers to splitting the data set into a training set, a validation set and a test set for model training, parameter adjustment and testing. The split ratio can be set as needed, for example, the ratio of the training set, the validation set and the test set is 7:2:1.
[0066] In some embodiments, in step S3, establishing a deep learning model includes:
[0067] The local attention mechanism and time series characteristics are introduced on the basis of the Transformer model to obtain the deep learning model. The Transformer model is a deep learning model based on the self-attention mechanism. However, the original Transformer model may not be suitable for predicting the impact of flood discharge on the vibration of residential buildings, and some improvements need to be made to it.
[0068] Improvement 1: Introducing local attention mechanism
[0069] The attention mechanism of the native Transformer model is global, that is, the model takes into account the influence of all positions when calculating the representation of each position in the sequence. However, in the problem of predicting the impact of flood discharge, the impact of flood discharge at adjacent times on the vibration of residential buildings may be more important. A local attention mechanism can be introduced so that when the model calculates the representation of a certain time point, it only considers the information of its adjacent time.
[0070] Improvement 1: The formula of the attention mechanism is as follows:
[0071]
[0072] Among them, i and j represent a position in the input sequence, a {ij} Indicates the attention weight given to position i when considering the information of position j. The parameter d indicates the dimension of the vector. {ij} is a mask function that limits the model to consider only information within the local window. If position j is not within the local window of position i, then mask {ij} is 0, otherwise mask {ij} is 1.
[0073] Improvement 2: Introducing time series features:
[0074] The native Transformer model does not explicitly model the characteristics of time series. By introducing methods such as position embedding or time embedding, the model can better capture the characteristics of time series.
[0075] The formula for improving position embedding is as follows:
[0076]
[0077] pos represents the time point. For example, in a 24-hour data series, pos may represent the time of each hour from 0:00 to 23:00. It can be considered that this represents the specific time when the flood discharge occurs, which will affect the vibration of the residential building.
[0078] i represents dimension, which refers to the characteristics of data related to the flood discharge system, such as flood discharge volume, flood discharge speed and other different dimensions.
[0079] PE {(pos,2i)} and PE {(pos,2i+1)}It is an encoding process that converts the two digital information pos and i into a feature vector (embedding vector) that can be used by the model. At the same time, the periodicity of the sin function and cos function also allows the model to recognize and learn the periodic characteristics of time (or location), such as the beginning and end of a natural day, or the beginning and end of a quarter, which will be an important feature in flood discharge prediction.
[0080] The improved model mentioned above is more suitable for predicting the impact of flood discharge on the vibration of residential buildings. The obtained deep learning model includes an encoder, a decoder and a prediction part; the encoder is used to process the input data, while the decoder is used to generate prediction results; the prediction part is used to perform a linear transformation on the prediction results of the encoder to obtain the degree of impact of residential building vibration.
[0081] The encoder is as follows:
[0082] First define the n-dimensional input flood discharge data X = [x 1 ,x 2 ,...,x n ], representing the flood discharge at each time point, and the corresponding position code PE = [pe 1 ,pe 2 ,...,pe n ] represents the relative position or time information of each time point in the sequence. The flood discharge data X is added to the corresponding position code PE to obtain the position-coded sequence X'=X+PE; this means that the flood discharge data and the corresponding position code are superimposed to allow the model to understand the continuity and order of time.
[0083] First, the sequence X' is transformed through a series of linear transformations to generate the query matrix Q, key matrix K, and value matrix V. The corresponding calculation formula is: Q = X'W q ,K=X'W k , and V = X'W v ; Among them, W q , W k , W v is the weight matrix learned by the model;
[0084] Then, based on the local attention mechanism, when calculating the attention score, the local attention score is only calculated within the specified window. The calculation formula is as follows: For any i, j, if j is not in the local window of i, then a {ij} =0, otherwise a {ij}represents the contribution weight of position j when encoding position i, i.e., the attention weight. According to the setting of this deep learning model, if i and j are not in the same window, its value is 0, indicating that position j has no effect on position i. T represents the transpose operation of the matrix. For this deep learning model, The T in is to transpose the vector of K and then dot-multiply it with the vector of Q to get a scalar result, which represents the attention weight of the corresponding position i.
[0085] In this deep learning model, i and j are used to represent the position index in the input data sequence. Specifically, in the flood discharge problem, suppose there is a time series of flood discharge data X = [x 1 ,x 2 ,...,x n ], then i and j are used to specifically refer to the position of each data point in this sequence. For example, when i = 1, it represents the flood discharge at the first moment; when j = 3, it represents the flood discharge at the third moment.
[0086] Then, in the process of introducing the local attention mechanism, when encoding the flood discharge at the i-th moment, only the flood discharge of j within a set window range of i is considered, and the flood discharge outside the window is not considered. This is to enable the model to better grasp the connection between adjacent time points and ignore the information of time points that are farther away and may have weaker correlation. In general, i and j are indexes used to help specify and locate the data position in the sequence.
[0087] Finally, the encoder output Z = AV is obtained by multiplying the generated local attention score matrix A with the value matrix V.
[0088] In this step, the attention matrix A is obtained by first multiplying the query matrix Q and the key matrix K, and then performing a softmax operation, and then multiplying it with the value matrix V to obtain the encoder output Z. The attention matrix is responsible for understanding the relationship between each element in the input sequence, and the value matrix is responsible for extracting the characteristics of each element itself.
[0089] The decoder is as follows:
[0090] The input of the decoder is the output Z of the encoder, Z = [z 1 ,z 2 ,...,z n ], and generate the query matrix Q, key matrix K, and value matrix V through linear transformation. The corresponding calculation formula is: Q = ZW' q , K=ZW' k , V=ZW' v Among them, W' q , W'k , and W' v is the weight matrix that the model needs to learn.
[0091] Then, based on the local attention mechanism, the local attention score matrix A' is calculated. When calculating the attention score, the local attention score is only calculated within the specified window. The calculation formula is as follows: For any i, j, if j is not in the local window of i, then a' {ij} =0, otherwise
[0092] Finally, the local attention score matrix A' is multiplied by the value matrix V to obtain the decoder output H: H = A'V.
[0093] Prediction part:
[0094] Finally, the decoder output H is linearly transformed to obtain the final prediction result Y, the formula is Y = HW, where W is the weight matrix to be learned.
[0095] The above weight matrix W q , W k , W v , W' q , W' k , W' v And the final weight matrix W is the parameter to be learned in the model training phase. Their specific values are obtained by iterative updating through back propagation and optimization algorithms (such as gradient descent, Adam, etc.).
[0096] In the initial stage, these weight matrices are usually randomly initialized and then gradually optimized during the model training process. In each iteration, the difference between the predicted output and the actual output of the model (the loss function value) is calculated, and then the gradient of each weight matrix is calculated through the back propagation algorithm, that is, the partial derivative of the loss function value with respect to the weight matrix. Then, the optimization algorithm is used to update the weight matrix value according to the calculated gradient so that the loss function value of the next iteration can be reduced.
[0097] The basic formula for updating the weight matrix is as follows:
[0098]
[0099] Among them, W old is the weight matrix value of the current iteration, η is the learning rate, is the gradient of the weight matrix, W new is the updated weight matrix value.
[0100] In some embodiments, in step S4, Figure 2 As shown, using the data set to train a deep learning model includes:
[0101] S401, forward propagation: send the data X to the deep learning model, and each layer of the deep learning model performs calculations layer by layer until the prediction result Y' is obtained.
[0102] S402, calculate the loss: the loss function is the mean square error MSE, the formula is as follows:
[0103]
[0104] Among them, Y is the real vibration level data, Y' is the vibration level data predicted by the model, and n represents the total number of samples;
[0105] S403, back propagation: Use the chain rule to calculate the partial derivatives of the loss function L with respect to all model parameters, that is, the gradient of each parameter;
[0106] The formula used by the back-propagation algorithm to calculate the gradient of the loss function L with respect to the model parameters is: θ is the model parameter, including W q , W k , W v All weight matrices, including θ, are related to the depth and complexity of the model. i Represents the i-th parameter. Used to express the loss function L relative to θ i The gradient of L at θ i If the trend and speed of change Greater than 0, indicating an increase in θ i Can increase L, and vice versa.
[0107] Therefore, the task of back propagation is to calculate the partial derivatives of the loss function L with respect to all parameters, that is, the gradient of the point. According to the gradient descent method or other optimization algorithms, the parameters will be updated in the opposite direction of the gradient in order to reduce the loss L.
[0108] Mathematically, this process mainly applies the chain rule, which can be written as In the form of, by deriving layer by layer, the partial derivatives of each subsequent layer can use the previous calculation results.
[0109] S404, update parameters: based on the gradient of each parameter, update each parameter of the model according to the following formula, where η is the learning rate, which is a small positive number, θ represents the model parameters, which represents the collection of all weight matrices W that appear in the deep learning model; Represents the gradient of the loss function L to the model parameter θ, which is the above
[0110] S405. Repeat S401-S404 until the model performance reaches a preset number of iterations.
[0111] In some embodiments, it also includes:
[0112] S406, based on the difference between the model's prediction results and the true values, use the mean square error (MSE) and the root mean square error (RMSE) as evaluation indicators for the regression problem to evaluate the trained model and confirm the model's generalization ability and prediction ability on new data.
[0113] Assume that y is the true vibration value, y' is the vibration value predicted by the model, and n is the number of test samples, then:
[0114]
[0115] In some embodiments, step S5 specifically includes: based on the prediction model, inputting current or future data related to flood discharge in real time to predict the vibration of residential buildings that may be caused.
[0116] The current or future flood discharge data is used as input data x and input into the prediction model. In the prediction model, the data will be calculated and transformed at each level, and finally a prediction result y will be output, which represents the expected vibration of the residential building. At this time, the model can obtain the vibration results of the residential building that may be caused by the current or future flood discharge behavior. This result can help to better prevent disasters. For example, when it is predicted that the vibration is too large and may cause danger, safety measures can be taken in advance to prevent possible problems.
[0117] An example:
[0118] S1, Data Collection: Collect relevant data on flood discharge and residential building vibration.
[0119] First, collect information about flood discharge volume, duration of flood discharge, location, height, structure of residential buildings, and real-time vibration data of residential buildings from data sources such as on-site vibration monitoring, flood discharge dispatch center, government data platform, meteorological bureau, and environmental protection department. Sample data is shown in Table 1:
[0120] Table 1 shows part of the collected data (just an example, there will be a lot of data and more parameters in reality):
[0121]
[0122]
[0123] S2, data preprocessing: perform data preprocessing on the collected data to obtain a data set.
[0124] The collected data is cleaned, standardized, normalized, and split. For example, the flood discharge volume, flood discharge duration, and other field data are normalized to make their values between [0,1], which is conducive to the training of deep learning models. Then, the data set is split into a ratio of 7:2:1, which are training set, validation set, and test set.
[0125] S3, establishing a deep learning model: introducing the local attention mechanism and time series characteristics on the basis of the Transformer model to obtain the deep learning model, which can well capture the relationship between the predicted vibration degree and the flood discharge amount, flood discharge duration, etc.
[0126] S4, model training: Use the data set to train the deep learning model so that the model can fit the correct mapping relationship, and the prediction model is obtained after the training is completed. For example, in the forward propagation stage, the flood discharge volume, flood discharge duration, etc. are used as input data, and the vibration degree of residential buildings is used as output data, and the model parameters are gradually updated. And the model is tested and evaluated: the model is evaluated using an independent test set, and MSE and RMSE are used as evaluation indicators to measure the prediction effect of the model.
[0127] S6, prediction: using the prediction model to predict the impact of flood discharge on the vibration of residential buildings.
[0128] After the model is trained and evaluated, the model is fed with current (real-time) or future flood discharge data to predict the vibrations that may be caused to residential buildings. For example, if the flood discharge volume is 3600, the flood discharge duration is 2 hours, and the data of a reinforced concrete residential building located 3.0 km from the dam area and 20 meters high is fed into the model, the model predicts that the vibration may reach 0.025m / s. 2 .
[0129] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0130] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for predicting the impact of flood discharge on residential building vibration using deep learning, characterized in that: The steps include: S1. Collect relevant data on flood discharge and vibration of residential buildings; S2, preprocessing the collected data to obtain a data set; S3. Build a deep learning model; S4. Use the data set to train a deep learning model, and obtain a prediction model after the training is completed; S5, using the prediction model to predict the impact of flood discharge on the vibration of residential buildings.
2. The method for predicting the impact of flood discharge on residential building vibration using deep learning according to claim 1 is characterized in that: In step S1, the relevant data on flood discharge and residential building vibration include flood discharge volume, flood discharge duration, location, height, structural information of residential buildings, and real-time vibration data of residential buildings.
3. The method for predicting the impact of flood discharge on residential building vibration using deep learning according to claim 1, characterized in that: In step S2, the data preprocessing includes data cleaning, data standardization, data normalization and data splitting.
4. The method for predicting the impact of flood discharge on residential building vibration using deep learning according to claim 1, characterized in that: In step S3, establishing a deep learning model includes: The local attention mechanism and time series characteristics are introduced on the basis of the Transformer model to obtain the deep learning model.
5. The method for predicting the impact of flood discharge on residential building vibration using deep learning according to claim 4 is characterized in that: The deep learning model includes an encoder, a decoder and a prediction part; the encoder is used to process input data, and the decoder is used to generate prediction results; the prediction part is used to linearly transform the prediction results of the encoder to obtain the degree of vibration impact of residential buildings; wherein, the encoder and decoder introduce local attention mechanism and time series characteristics.
6. The method for predicting the impact of flood discharge on residential building vibration using deep learning according to claim 5 is characterized in that: The encoder comprises: Define n-dimensional input flood discharge data X = [x1, x2, ..., x n ], representing the flood discharge at each time point, and the corresponding position code PE = [pe1, pe2, ..., pe n ], represents the relative position or time information of each time point in the sequence; the flood discharge data X is added to the corresponding position code PE to obtain the position-coded sequence X'=X+PE; The sequence X' is transformed through a series of linear transformations to generate the query matrix Q, key matrix K, and value matrix V. The corresponding calculation formula is: Q = X'W q ,K=X'W k , and V = X'W v ; Among them, W q , W k , W v is the weight matrix learned by the model; Then, based on the local attention mechanism, the local attention score matrix A is calculated; when calculating the attention score, the local attention score is only calculated within the specified window. The calculation formula is as follows: For any i, j, if j is not in the local window of i, then a {ij} =0, otherwise a {ij} represents the contribution weight of position j when encoding position i, that is, the attention weight; T represents the transpose operation of the matrix; the parameter d represents the dimension of the vector; Finally, the local attention score matrix A is multiplied by the value matrix V to obtain the encoder output Z = AV.
7. The method for predicting the impact of flood discharge on residential building vibration using deep learning according to claim 6, characterized in that: The decoder comprises: The encoder output Z is input into the decoder, and the query matrix Q, key matrix K, and value matrix V are generated through linear transformation. The corresponding calculation formula is: Q = ZW' q , K=ZW' k , V=ZW' v Among them, W' q , W' k , and W' v is the weight matrix that the model needs to learn; Then, based on the local attention mechanism, the local attention score matrix is calculated. When calculating the attention score, the local attention score is only calculated within the specified window. The calculation formula is as follows: For any i, j, if j is not in the local window of i, then a' {ij} =0, otherwise a' {ij} Represents the contribution weight of position j when decoding position i, that is, the attention weight; Finally, the local attention score matrix A' is multiplied by the value matrix V to obtain the decoder output H: H = A'V.
8. The method for predicting the impact of flood discharge on residential building vibration using deep learning according to claim 7 is characterized in that: The prediction part is: the output H of the decoder is linearly transformed to obtain the final prediction result Y, which is expressed as Y=HW, where W is the weight matrix to be learned.
9. The method for predicting the impact of flood discharge on residential building vibration using deep learning according to claim 1, characterized in that: Step S4 includes the following sub-steps: S401, forward propagation: the data X is sent to the deep learning model, and each layer of the deep learning model performs calculations layer by layer until the prediction result Y' is obtained; S402, calculating the loss, the loss function is the mean square error MSE; S403, back propagation: Use the chain rule to calculate the partial derivatives of the loss function L with respect to all model parameters, that is, the gradient of each parameter; S404, updating parameters: updating each parameter of the model based on the gradient of each parameter; S405. Repeat S401-S404 until the model performance reaches a preset number of iterations.
10. The method for predicting the impact of flood discharge on residential building vibration using deep learning according to claim 9, characterized in that: Step S4 also includes the following sub-steps: S406, based on the difference between the prediction result of the model and the true value, the mean square error (MSE) and the root mean square error (RMSE) are used as evaluation indicators of the regression problem to evaluate the trained model.