Commercial bank mobility risk prediction method and device based on LSTM architecture
By applying a neural network model based on LSTM architecture in commercial banks' liquidity risk prediction, the problems of low prediction accuracy and insufficient sensitivity to data changes are solved in traditional methods, and higher prediction accuracy and sensitivity to data changes are achieved.
Patent Information
- Application Number
- CN202510517581.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-05-23
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The traditional commercial banks' liquidity risk prediction methods have low prediction accuracy and are not sensitive to changes in liquidity data.
A neural network model based on LSTM architecture is adopted to obtain the liquidity business data of commercial banks in real time, normalize and time series dimension upgrade processing are performed to form a three-dimensional input tensor, and a neural network model containing two LSTM layers is built for model training, and the next day position balance prediction results are output.
It improves the accuracy and fit of liquidity risk prediction, enhances sensitivity to changes in liquidity data, reduces the deviation of manual empirical prediction, and helps commercial banks to grasp liquidity risks more accurately.
Smart Images

Figure CN120031646A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a commercial bank liquidity risk prediction method and device based on LSTM architecture, and specifically to a commercial bank liquidity risk prediction method and device based on LSTM architecture for quantitative analysis of commercial bank liquidity risk, belonging to the technical field of financial data processing. Background Art
[0002] Liquidity risk is one of the main operating risks faced by commercial banks. Insufficient liquidity may lead to difficulties in repayment for commercial banks, while excess liquidity requires banks to make good fund planning to ensure maximum benefits. Therefore, reasonable liquidity risk prediction plays a vital role in the efficient operation of banks. Traditional liquidity risk prediction methods mainly rely on manual experience and linear models, but these methods often have problems such as low prediction accuracy and insufficient sensitivity to changes in liquidity data.
[0003] With the continuous application of machine learning in the financial industry, recurrent neural networks (RNN) and their variants LSTM have shown strong capabilities in time series prediction. The unique input gate, forget gate, and output gate design of LSTM enable it to effectively retain key information in historical data and improve the fit of prediction results.
[0004] Applying the LSTM architecture to the liquidity risk prediction of commercial banks is of great significance for improving the prediction accuracy and enhancing the sensitivity to changes in liquidity data. Therefore, the present invention proposes a commercial bank liquidity risk prediction method and device based on the LSTM architecture. Summary of the invention
[0005] In order to solve the above problems, the present invention proposes a commercial bank liquidity risk prediction method and device based on LSTM architecture, which can assist commercial banks in making accurate liquidity risk predictions, improve overall fund management capabilities, and promote the stable development of commercial banks.
[0006] The technical solution adopted by the present invention to solve the technical problem is: In a first aspect, an embodiment of the present invention provides a commercial bank liquidity risk prediction method based on an LSTM architecture, comprising the following steps: Step S1, obtaining liquidity business data of the core system of the commercial bank in real time through a data interface, wherein the liquidity business data includes clearing data, deposit data, loan data, capital data and settlement data; Step S2, normalizing the liquidity business data and performing time series dimensionality upscaling to form a three-dimensional input tensor; Step S3, building a neural network model including two LSTM layers and training the model, selecting the optimal weight and intercept; Step S4, using the trained neural network model to predict the input three-dimensional input tensor, and output the prediction result of the next day's position balance.
[0007] As a possible implementation of this embodiment, the clearing data includes the clearing date, the position balance on the day, the amount of pending receipts, and the amount of pending payments; the deposit data includes the deposit date, the current deposit amount, the amount due in 7 days, the amount due in 7-30 days, the amount due in 30 days to half a year, the amount due in half a year to 1 year, and the amount due in more than 1 year; the loan data includes the loan date, the amount due in 7 days, the amount due in 7-30 days, the amount due in 30 days to half a year, the amount due in half a year to 1 year, and the amount due in more than 1 year; the capital data includes the data date, the amount of capital outflow, and the amount of capital inflow; the settlement data includes the settlement date, the amount of remittance, and the amount of remittance.
[0008] As a possible implementation of this embodiment, the normalization process is applied to features other than the data date, and the data with different dimensions are changed into a data set with a range of (0, 1). The formula for the normalization process is: X scaled =(XX min ) / (X max -X min ), where X scaled is the result of normalization, X is the original data value, X max and X min are the maximum and minimum values of the original data respectively.
[0009] As a possible implementation of this embodiment, the time series dimensionality increase processing is to slice the normalized data according to the time step to form a three-dimensional tensor of the number of samples, the number of time steps and the number of features.
[0010] As a possible implementation of this embodiment, step S3, building a neural network model including two LSTM layers and performing model training, includes: Each LSTM layer of the neural network model is set with 200 neurons, and the input shape, loss function, number of hidden layers, number of training rounds, and batch size of training data are set. The input of the neural network model is set according to the three-dimensional input tensor; The loss function is established using the mean square error, and the model is trained by gradient descent to select the optimal weights and intercepts.
[0011] As a possible implementation of this embodiment, the loss function is: loss=1 / n∑(yY)2 , Among them, y is the true value, Y is the predicted value, and n is the number of samples involved in calculating the loss.
[0012] As a possible implementation of this embodiment, the neural network model is provided with an input gate, a forget gate, and an output gate, which process the input information X t 、Memory information C t , output information h t , using sigmoid and tanh as activation functions; the LSTM layer of the neural network model uses sigmoid and tanh as activation functions, and the calculation formulas of the forget gate, input gate and output gate are: f = sigmoid(W f [X t ,h t-1 ]+b f ), i = sigmoid(W i [X t ,h t-1 ]+b i ), o = sigmoid(W o [X t ,h t-1 ]+b o ), Among them, f, i and o are the outputs of the forget gate, input gate and output gate respectively, W f , W i and W o are the weight matrices of the forget gate, input gate, and output gate, respectively, and b f , b i and b o are the bias items of the forget gate, input gate and output gate respectively, X t For input information, h t-1 is the hidden state at the previous moment, Memory information C at time t t And the final output information h t The calculation formula is: C t =f·C t-1 +i·tanh(W c [X t ,h t-1 ]+b c ), h t = o·tanh(C t ), Among them, W c Update the weight matrix for memory, b cis the memory update bias term, Parameters [W f ,W i ,W o ,W c ,b f ,b i ,b o ,b c ]This is done through model training using gradient descent.
[0013] As a possible implementation of this embodiment, the forecast result includes the data date, the forecast date and the forecast position balance.
[0014] In a second aspect, an embodiment of the present invention provides a commercial bank liquidity risk prediction device based on an LSTM architecture, comprising: A data acquisition module is used to obtain liquidity business data of the core system of a commercial bank in real time through a data interface. The liquidity business data includes clearing data, deposit data, loan data, capital data and settlement data; A data processing module, used for normalizing the liquidity business data and performing time series dimensionality-upgrading processing to form a three-dimensional input tensor; The model training module is used to build a neural network model with two LSTM layers, perform model training, and select the optimal weights and intercepts; The risk prediction module is used to use the trained neural network model to predict the input three-dimensional input tensor and output the prediction result of the next day's position balance.
[0015] As a possible implementation of this embodiment, the model training module includes: The parameter setting module is used to set 200 neurons in each LSTM layer of the neural network model, and set the input shape, loss function, number of hidden layers, number of training rounds and batch size of training data, and set the input of the neural network model according to the three-dimensional input tensor; The optimal parameter selection module is used to establish the loss function using the mean square error, and to train the model by gradient descent to select the optimal weights and intercepts.
[0016] The beneficial effects of the technical solution of the embodiment of the present invention are as follows: The present invention makes full use of the liquidity business data of commercial banks, enhances the sensitivity to changes in liquidity data, improves the accuracy and fit of liquidity risk prediction, reduces the deviation of artificial experience prediction, and enables commercial banks to grasp liquidity risk more accurately. The present invention forms a three-dimensional input tensor through time series dimensionality increase processing, solves the problem of underfitting of linear prediction in liquidity risk prediction, and is applied to the prediction and control of commercial bank liquidity, so that commercial banks can manage future positions more directionally and provide commercial banks with more reliable prediction tools. The present invention can assist commercial banks in making accurate liquidity risk predictions, improve overall fund management capabilities, and promote the steady development of commercial banks. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a flow chart of a commercial bank liquidity risk prediction method based on LSTM architecture according to an exemplary embodiment; Figure 2 It is a schematic diagram of the structure of a commercial bank liquidity risk prediction device based on LSTM architecture according to an exemplary embodiment; Figure 3 is a schematic diagram of the corresponding structure of input data and labels of a neural network model according to an exemplary embodiment; Figure 4 It is a schematic diagram of a core unit structure of an LSTM (Long Short-Term Memory Network) according to an exemplary embodiment. DETAILED DESCRIPTION
[0018] In order to more clearly illustrate the technical features of the solution of the present invention, the present invention is described in detail below through specific implementation methods and in conjunction with the accompanying drawings.
[0019] like Figure 1 As shown, a commercial bank liquidity risk prediction method based on LSTM architecture provided by an embodiment of the present invention includes the following steps: Step S1, obtaining liquidity business data of the core system of the commercial bank in real time through a data interface, wherein the liquidity business data includes clearing data, deposit data, loan data, capital data and settlement data; Step S2, normalizing the liquidity business data and performing time series dimensionality upscaling to form a three-dimensional input tensor; Step S3, building a neural network model including two LSTM layers and training the model, selecting the optimal weight and intercept; Step S4, using the trained neural network model to predict the input three-dimensional input tensor, and output the prediction result of the next day's position balance.
[0020] As a possible implementation of this embodiment, the clearing data includes the clearing date, the position balance on the day, the amount of pending receipts, and the amount of pending payments; the deposit data includes the deposit date, the current deposit amount, the amount due in 7 days, the amount due in 7-30 days (7-30 days due, i.e., 7 days < deposit time ≤ 30 days), the amount due in 30 days to half a year, the amount due in half a year to 1 year, and the amount due in more than 1 year; the loan data includes the loan date, the amount due in 7 days, the amount due in 7-30 days, the amount due in 30 days to half a year, the amount due in half a year to 1 year, and the amount due in more than 1 year; the capital data includes the data date, the amount of capital outflow, and the amount of capital inflow; the settlement data includes the settlement date, the amount remitted in, and the amount remitted out.
[0021] As a possible implementation of this embodiment, the normalization process is applied to features other than the data date, and the data with different dimensions are changed into a data set with a range of (0, 1). The formula for the normalization process is: X scaled =(XX min ) / (X max -X min ), where X scaled is the result of normalization, X is the original data value, X max and X min are the maximum and minimum values of the original data respectively.
[0022] As a possible implementation method of this embodiment, the time series dimensionality increase processing is to slice the normalized data according to the time step to form a three-dimensional tensor of the number of samples, the number of time steps and the number of features. If the amount of data accessed by the neural network model is N, and the number of time steps is n days, then the number of samples is N-(n-1) and the number of features is 18, that is, 18 feature variables of n days are used to predict the value of n+1 days; at the same time, the label data is processed, and the position balance is used as the label data at the same time, maintaining the 2-dimensional data, and obtaining it from the original data n+1 rows will also form N-(n-1) data.
[0023] As a possible implementation of this embodiment, step S3, building a neural network model including two LSTM layers and performing model training, includes: Each LSTM layer of the neural network model is set with 200 neurons, and the input shape, loss function, number of hidden layers, number of training rounds, and batch size of training data are set. The input of the neural network model is set according to the three-dimensional input tensor; The loss function is established using the mean square error, and the model is trained by gradient descent to select the optimal weights and intercepts.
[0024] As a possible implementation of this embodiment, the loss function is: loss=1 / n∑(yY) 2 , Among them, y is the true value, Y is the predicted value, and n is the number of samples involved in calculating the loss.
[0025] As a possible implementation of this embodiment, the neural network model is provided with an input gate, a forget gate, and an output gate, which process the input information X t 、Memory information C t , output information h t , using sigmoid and tanh as activation functions; the LSTM layer of the neural network model uses sigmoid and tanh as activation functions, and the calculation formulas of the forget gate, input gate and output gate are: f = sigmoid(W f [X t ,h t-1 ]+b f ), i = sigmoid(W i [X t ,h t-1 ]+b i ), o = sigmoid(W o [X t ,h t-1 ]+b o ), Among them, f, i and o are the outputs of the forget gate, input gate and output gate respectively, W f , W i and W o are the weight matrices of the forget gate, input gate, and output gate, respectively, and b f , b i and b o are the bias items of the forget gate, input gate and output gate respectively, X t For input information, h t-1 is the hidden state at the previous moment, Memory information C at time t t And the final output information h t The calculation formula is: C t =f·C t-1 +i·tanh(W c [X t ,h t-1 ]+b c ), h t = o·tanh(C t ), Among them, W cUpdate the weight matrix for memory, b c is the memory update bias term, Parameters [W f ,W i ,W o ,W c ,b f ,b i ,b o ,b c ]This is done through model training using gradient descent.
[0026] As a possible implementation of this embodiment, the forecast result includes the data date, the forecast date and the forecast position balance.
[0027] like Figure 2 As shown, an embodiment of the present invention provides a commercial bank liquidity risk prediction device based on LSTM architecture, comprising: A data acquisition module is used to obtain liquidity business data of the core system of a commercial bank in real time through a data interface. The liquidity business data includes clearing data, deposit data, loan data, capital data and settlement data; A data processing module, used for normalizing the liquidity business data and performing time series dimensionality-upgrading processing to form a three-dimensional input tensor; The model training module is used to build a neural network model with two LSTM layers, perform model training, and select the optimal weights and intercepts; The risk prediction module is used to use the trained neural network model to predict the input three-dimensional input tensor and output the prediction result of the next day's position balance.
[0028] As a possible implementation of this embodiment, the model training module includes: The parameter setting module is used to set 200 neurons in each LSTM layer of the neural network model, and set the input shape, loss function, number of hidden layers, number of training rounds and batch size of training data, and set the input of the neural network model according to the three-dimensional input tensor; The optimal parameter selection module is used to establish the loss function using the mean square error, and to train the model by gradient descent to select the optimal weights and intercepts.
[0029] The specific process of building a commercial bank liquidity risk prediction system using the technical means of the present invention and conducting commercial bank liquidity prediction is as follows.
[0030] 1. Business data access.
[0031] The system needs to access business data related to liquidity, mainly including: clearing data, deposit data, loan data, fund data, and settlement data. ① Clearing data: mainly including data date, position balance on the day, pending collection amount, and pending payment amount. ② Deposit data: mainly including data date, current deposit amount, 7-day maturity amount, 7-30-day maturity amount, 30-day-half-year maturity amount, half-year-to-1-year maturity amount, and more than 1-year maturity amount. ③ Loan data: mainly including data date, 7-day maturity amount, 7-30-day maturity amount, 30-day-half-year maturity amount, half-year-to-1-year maturity amount, and more than 1-year maturity amount. ④ Fund data: mainly including data date, fund outflow amount, and fund inflow amount. ⑤ Settlement data: mainly including data date, remittance amount, and remittance amount. The above data is accessed from various business systems and stored in the database source layer after structured processing, forming the structured data shown in Table 1.
[0032] Table 1 Structural data
[0033] The present invention obtains liquidity business data of the core system of a commercial bank in real time through a data interface, thereby ensuring the timeliness and accuracy of the data.
[0034] 2. Data processing.
[0035] Since the dimensions of each data are different, which affects the comparability of the data, the accessed data needs to be normalized to make it comparable. At the same time, since the dimension of the data in the LSTM architecture is 3-dimensional, the normalized data is upgraded.
[0036] ① Normalization. Normalization changes data with different dimensions into a data set with a range of (0,1) without affecting the data distribution before processing. The formula for normalization is: X scaled =(XX min ) / (X max -X min ), the formula acts on 18 features except the data date to complete the data normalization.
[0037] ②Data dimensionality processing. The training data of the neural network model is 3D input tensor data, and the dimensions are composed of the number of samples, the number of time steps, and the number of features. If the amount of data received is N and the number of time steps is n, then the number of samples is N-(n-1) and the number of features is 18, that is, 18 feature variables of n days are used to predict the value of n+1 days. At the same time, the label data is processed, and the position balance is used as the label data at the same time. The 2-dimensional data is maintained and obtained from the original data n+1 rows, which will also form N-(n-1) data. The final result is as follows Figure 3 The structure data shown.
[0038] There is no need to perform dimensionality increase processing on the data required for model prediction. It is sufficient to generate data from n days ago to the current time.
[0039] The present invention utilizes the advantages of LSTM in processing time series data, improves the accuracy of prediction, provides timely liquidity risk warning for commercial banks, and helps reduce losses caused by liquidity risk.
[0040] 3. Model training.
[0041] The constructed model sets up two LSTM layers, each layer is set up with 200 neurons, the input is set according to the data dimension after dimensionality processing, and the loss function loss=1 / n∑(yY) is established using the mean square error 2 , select the optimal weight w and intercept b through gradient descent.
[0042] The model sets the input gate, forget gate, and output gate to process the input information X respectively. t 、Memory information C t , output information h t ,like Figure 4 shown.
[0043] The model uses sigmoid and tanh as activation functions. The calculation formulas for the forget gate (f), input gate (i), and output gate (o) are: Forget gate f=sigmoid(W f [X t ,h t-1 ]+b f ), Input gate i = sigmoid(W i [X t ,h t-1 ]+b i ), Output gate o = sigmoid (W o [X t ,h t-1 ]+b o ), Model calculation output C t With h t The calculation formula is as follows: C t =f·C t-1 +i·tanh(W c [X t ,h t-1 ]+b c ), h t = o·tanh(C t ), Through model training, the parameters [W f ,W i ,W o ,W c ,b f ,b i ,b o ,b c ] estimates.
[0044] The present invention adopts the LSTM neural network architecture to effectively capture the long-term dependencies in time series data and improve the prediction accuracy; adopts a neural network model structure containing two LSTM layers to enhance the expressiveness and generalization capabilities of the model; trains the model by gradient descent to optimize the model parameters and improve the prediction performance of the model.
[0045] 4. Model prediction.
[0046] Deploy the trained model and process the feature variables from n days ago to the current date according to the daily access data. At this time, the access data is two-dimensional data. Through model prediction, the forecast results of the position balance for the next day are output. The output fields mainly include data date (T), forecast date (T+1), and forecast position balance. Commercial banks can arrange funds for the next day based on the forecast results.
[0047] The present invention utilizes the LSTM neural network model for training and prediction, which can capture the long-term dependencies of time series data and improve prediction accuracy.
[0048] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A commercial bank liquidity risk prediction method based on LSTM architecture, characterized in that: The steps include: Step S1, obtaining liquidity business data of the core system of the commercial bank in real time through a data interface, wherein the liquidity business data includes clearing data, deposit data, loan data, capital data and settlement data; Step S2, normalizing the liquidity business data and performing time series dimensionality upscaling to form a three-dimensional input tensor; Step S3, building a neural network model including two LSTM layers and training the model, selecting the optimal weight and intercept; Step S4, using the trained neural network model to predict the input three-dimensional input tensor, and output the prediction result of the next day's position balance.
2. The commercial bank liquidity risk prediction method based on LSTM architecture according to claim 1 is characterized in that: The clearing data includes the clearing date, the position balance on the day, the amount of pending receipts, and the amount of pending payments; the deposit data includes the deposit date, the current deposit amount, the amount due in 7 days, the amount due in 7-30 days, the amount due in 30 days to half a year, the amount due in half a year to 1 year, and the amount due in more than 1 year; the loan data includes the loan date, the amount due in 7 days, the amount due in 7-30 days, the amount due in 30 days to half a year, the amount due in half a year to 1 year, and the amount due in more than 1 year; the capital data includes the data date, the amount of capital outflow, and the amount of capital inflow; the settlement data includes the settlement date, the amount of remittance, and the amount of remittance.
3. The commercial bank liquidity risk prediction method based on LSTM architecture according to claim 1 is characterized in that: The normalization process is applied to features other than the data date, and changes the data with different dimensions into a data set with a range of (0,1). The formula for the normalization process is: scaled =(XX min ) / (X max -X min ), where X scaled is the result of normalization, X is the original data value, X max and X min are the maximum and minimum values of the original data respectively.
4. The commercial bank liquidity risk prediction method based on LSTM architecture according to claim 1 is characterized in that: The time series dimensionality increase processing is to slice the normalized data according to the time step to form a three-dimensional tensor of the number of samples, the number of time steps and the number of features.
5. The commercial bank liquidity risk prediction method based on LSTM architecture according to any one of claims 1 to 4, characterized in that: The step S3, building a neural network model including two LSTM layers and performing model training, includes: Each LSTM layer of the neural network model is set with 200 neurons, and the input shape, loss function, number of hidden layers, number of training rounds, and batch size of training data are set. The input of the neural network model is set according to the three-dimensional input tensor; The loss function is established using the mean square error, and the model is trained by gradient descent to select the optimal weights and intercepts.
6. The commercial bank liquidity risk prediction method based on LSTM architecture according to claim 5 is characterized in that: The loss function is: loss=1 / n∑(y-Y) 2 , Among them, y is the true value, Y is the predicted value, and n is the number of samples involved in calculating the loss.
7. The commercial bank liquidity risk prediction method based on LSTM architecture according to claim 6 is characterized in that: The neural network model is provided with an input gate, a forget gate, and an output gate to process the input information X respectively. t 、Memory information C t , output information h t , using sigmoid and tanh as activation functions; the LSTM layer of the neural network model uses sigmoid and tanh as activation functions, and the calculation formulas of the forget gate, input gate and output gate are: f=sigmoid(W f [X t ,h t-1 ]+b f ), i=sigmoid(W i [X t ,h t-1 ]+b i ), o=sigmoid(W o [X t ,h t-1 ]+b o ), Among them, f, i and o are the outputs of the forget gate, input gate and output gate respectively, W f , W i and W o are the weight matrices of the forget gate, input gate, and output gate, respectively, and b f , b i and b o are the bias items of the forget gate, input gate and output gate respectively, X t For input information, h t-1 is the hidden state at the previous moment, Memory information C at time t t And the final output information h t The calculation formula is: C t =f·C t-1 +i·tanh(W c [X t ,h t-1 ]+b c ), h t =o·tanh(C t ) Among them, W c Update the weight matrix for memory, b c is the memory update bias term, Parameters [W f ,W i ,W o ,W c ,b f ,b i ,b o ,b c ]This is done through model training using gradient descent.
8. The commercial bank liquidity risk prediction method based on LSTM architecture according to claim 5 is characterized in that: The forecast results include data date, forecast date and forecast position balance.
9. A commercial bank liquidity risk prediction device based on LSTM architecture, characterized in that: include: A data acquisition module is used to obtain liquidity business data of the core system of a commercial bank in real time through a data interface. The liquidity business data includes clearing data, deposit data, loan data, capital data and settlement data; A data processing module, used for normalizing the liquidity business data and performing time series dimensionality-upgrading processing to form a three-dimensional input tensor; The model training module is used to build a neural network model with two LSTM layers, perform model training, and select the optimal weights and intercepts; The risk prediction module is used to use the trained neural network model to predict the input three-dimensional input tensor and output the prediction result of the next day's position balance.
10. The commercial bank liquidity risk prediction device based on LSTM architecture according to claim 9 is characterized in that: The model training module includes: The parameter setting module is used to set 200 neurons in each LSTM layer of the neural network model, and set the input shape, loss function, number of hidden layers, number of training rounds and batch size of training data, and set the input of the neural network model according to the three-dimensional input tensor; The optimal parameter selection module is used to establish the loss function using the mean square error, and to train the model by gradient descent to select the optimal weights and intercepts.
Citation Information
Cited By
Intelligent financial risk assessment optimization method
CN120634711A