# Financial Crisis Prediction Based on Long-Term and Short-Term Memory Neural Network

Authors: Tang Ling; Yinying Cai
Journal: Wireless Communications and Mobile Computing
 (2022)

---

## Abstract

Enterprise financial crisis prediction analysis can predict the business process of enterprises, so that enterprises can take corresponding strategies in time. The financial crisis prediction of listed companies can effectively reflect the business situation, so as to give investors reasonable investment advice. In order to supervise the sustainable management ability of enterprises efficiently and accurately, this paper proposed a financial crisis prediction method based on long-term and short-term memory neural network, so as to provide valuable information for decision-makers. Firstly, the data in the enterprise financial system is analyzed and extracted, and the original data is cleaned and dimensionalized by normalization and feature selection. Then, the long-term and short-term memory neural network is used to build the financial early warning model, and the wolf pack algorithm is used to optimize the initial weight and bias parameters, so as to improve the efficiency of parameter optimization. Finally, the financial data of 20 large- and medium-sized enterprises from 2019 to 2021 are verified and analyzed. The experimental results show that compared with other common machine learning methods, the constructed wolf pack-optimized long-term and short-term memory neural network has the highest prediction performance in terms of root mean square error and goodness of fit, with the goodness of fit reaching 94.2%.


---

## Body

## 1. Introduction

In an expanding global market, enterprises have more opportunities for growth but at the same time face more serious challenges and crises. At present, there are many cases of enterprises falling into difficulties due to financial crises. On the other hand, with the rapid development of information technology, databases, networks, data mining, and other technologies are becoming increasingly mature, making it possible to build an efficient financial forecasting system. In today’s era of big data, it has become an inevitable trend to maintain the survival of enterprises and social stability by accurately and objectively digging out the financial situation of enterprises from the vast amount of enterprise data.However, the amount of enterprise financial data is huge, and it will change rapidly with time, which makes the analysis of enterprise financial data very difficult. In recent years, due to the wide use of big data platform, the method of solving complex problems through big data analysis technology has been deeply applied in enterprise financial analysis [1–5]. Financial analysis based on big data learning can complete the training and analysis of high-dimensional financial data and obtain effective training results. More importantly, the big data learning algorithm can not only solve the problem of timeliness of forecasting but also keep the relationship between historical time series (financial data) and current financial indicators, so as to obtain more accurate financial crisis forecasting results. In order to get a more accurate financial crisis prediction model, many researchers have done in-depth research on crisis prediction by using machine learning technology [6, 7]. However, up to now, there is still no general model that can predict the financial crisis well. However, in order to avoid huge economic losses and market shocks caused by frequent financial crises, the demand for reliable financial crisis prediction is increasingly urgent.With the rise of deep learning technology, some scholars apply deep learning technology to financial crisis prediction and get better performance on test data sets than traditional neural networks. However, the advantages of this technology have not been fully explored by previous methods and models. Among the current depth models, the recurrent neural network (RNN) model based on long short-term memory (LSTM) [8, 9] is more suitable for the processing of financial-related data because it can effectively utilize the long-distance dependent information in serial data. Therefore, this paper tries to apply LSTM model to the field of financial crisis prediction and adopts swarm intelligence algorithm to optimize the bias parameters, so as to improve the efficiency of parameter optimization.


## 2. Related Works

The current mainstream approach to financial crisis forecasting is to improve financial management systems to automate data analysis of finances through server-side records, statistics, and calculations in order to quickly obtain value data from the vast amount of financial information and make forecasts.Machine learning technology, as a hot direction in the computer field, has been closely integrated and applied with the financial field. Using reasonable machine learning technology can solve the problem of efficient and automatic data analysis in financial industry and provide valuable forecast information for managers, thus providing reliable forecast for healthy organization operation. For example, Zhu et al. [10] proposed to use Z-score index decision tree to build a financial crisis prediction model, and the accuracy rate of predicting financial crisis three years in advance reached 75.37%. Ismanto et al. [11] proposed C4.5 decision tree mining algorithm to forecast and analyze the flow of enterprise’s operating capital, which is more accurate than the traditional ID3 decision tree algorithm. Yao et al. [12] proposed a financial crisis prediction model based on genetic algorithm and least squares support vector machine, which effectively verified the effectiveness of machine learning technology in financial prediction. However, using the traditional machine learning technology mentioned above to predict the financial situation still has unsatisfactory accuracy, especially for the long-term prediction of complex data samples [13–15].Long-term memory (LSTM) network, as a deep learning model, can dig out the inherent laws in time series data by learning historical data and is more suitable for processing software failure time data. At present, LSTM is mainly used in image recognition, natural language processing, and other fields. For example, Marcella et al. [16] proposed a remarkable attention model based on LSTM network, which can be used to predict the gaze direction of human eyes. Alhagry et al. [17] proposed an EEG emotion recognition model based on LSTM recurrent neural network. Kim H et al. [18] combined LSTM-RNN with computational fluid dynamics simulation to realize rapid and automatic tracking of harmful substances. The above research has shown that LSTM networks are temporally recurrent neural networks suitable for processing and predicting the internal patterns of time series data, which fits well with the characteristics of financial data.Therefore, this paper attempts to use LSTM neural network to predict the financial crisis of enterprises. The main innovations and contributions include the following: (1) try to apply LSTM recurrent neural network architecture, which is excellent in the field of deep learning, to the field of financial crisis prediction, so as to make full use of LSTM’s advantages in dealing with historical time series. The time series data of enterprise financial history and the current input data samples are used as the input of activation operation to improve the prediction accuracy of enterprise financial crisis. (2) The wolf pack algorithm is used to optimize the initial weight and bias parameters of LSTM, so as to avoid falling into the local minimum, thus improving its crisis prediction performance.


## 3. Data Preprocessing and Sample Generation

In order to continue effective forecast analysis, it is necessary to analyze and extract all kinds of tables and report data in the financial system. The main method is to clean the data, so as to generate data in comma-separated values (CSV) format. This is because the use and format of data in the financial management system are quite different among departments. In addition, there are a lot of redundant data unrelated to financial forecast. Therefore, all the existing reports in the system must be cleaned before data analysis.


### 3.1. Data Cleaning

Aiming at the problems of missing values, inconsistent formats and repeated contents in financial data, this study adopts four processes to realize data cleaning, as follows:Step 1: complete the missing values. According to the empirical analysis, the condition for judging whether there is a defect is set to 0.8, and the input financial data feature sequence is classified according to the condition of 0.8. And filter and keep the feature column with the condition less than 0.8. It should be noted that the missing value of the deletion sequence here needs to be filled with “0” valueStep 2: standardize the format. Standardize the format of the input financial data; for example, the format of the input time of each piece of data is changed to “2020-11-08”Step 3: duplicate content deletion. After the end of step 2, the data is screened for the second time. The purpose of this screening is to eliminate the feature columns with duplicate contents [18–20]. It should be noted that one feature column must be kept when eliminating multiple duplicate feature columns in the process, so as to avoid excessive deletionStep 4: delete unnecessary data: Delete the data characteristic columns in the data sample that are not in the financial forecast cycle, thus greatly reducing the data scale to be processedFinally, comma is used to separate the processed data by a fixed length, so as to form text data. This method is beneficial to data dimensionality reduction.


### 3.2. Feature Selection

The features of each column in the data samples need to be reasonably selected, so as to reflect the required prediction mapping and avoid overfitting, thus strengthening the generalization ability of the model with multiple samples.As the financial forecasting task is a nonlinear application problem, this study tries to use L1 norm regularization which performs well in nonlinear problems to complete feature selection. Firstly, the L1 norm score value of the feature sequence after data cleaning is calculated. Then, the threshold of fitness is set to 0.6, that is to say, the features whose score value is less than 0.6 are filtered out, thus further promoting data dimensionality reduction. Finally, only the key information related to financial business is left in the filtered feature sequence.


### 3.3. Normalization Treatment

After cleaning and feature selection, the financial data has been effectively dimension-reduced, but the data features still have different value ranges, so the subsequent model prediction cannot be carried out. Therefore, in this study, the samples after cleaning and feature selection are normalized by a simple and quick mean variance normalization method, and the specific calculation formula is as follows:(1)Xscale=x−minmax−min,where min represents the lower bound, max represents the upper bound, X represents the input eigenvalue, and Xscale represents the normalized eigenvalue.


### 3.4. Sliding Sample Generation

As financial forecasting is a time-periodic work, it is necessary to set the time span, which is similar to the window frame in graphic image processing mechanism. In this paper, one year is set as the time span to select the data samples by sliding. Too short or too long time span will have certain influence on the prediction performance. One year is the selected value from many experiments. The specific operation process is shown in Figure1.Figure 1
Sliding sample generation.


## 3.1. Data Cleaning

Aiming at the problems of missing values, inconsistent formats and repeated contents in financial data, this study adopts four processes to realize data cleaning, as follows:Step 1: complete the missing values. According to the empirical analysis, the condition for judging whether there is a defect is set to 0.8, and the input financial data feature sequence is classified according to the condition of 0.8. And filter and keep the feature column with the condition less than 0.8. It should be noted that the missing value of the deletion sequence here needs to be filled with “0” valueStep 2: standardize the format. Standardize the format of the input financial data; for example, the format of the input time of each piece of data is changed to “2020-11-08”Step 3: duplicate content deletion. After the end of step 2, the data is screened for the second time. The purpose of this screening is to eliminate the feature columns with duplicate contents [18–20]. It should be noted that one feature column must be kept when eliminating multiple duplicate feature columns in the process, so as to avoid excessive deletionStep 4: delete unnecessary data: Delete the data characteristic columns in the data sample that are not in the financial forecast cycle, thus greatly reducing the data scale to be processedFinally, comma is used to separate the processed data by a fixed length, so as to form text data. This method is beneficial to data dimensionality reduction.


## 3.2. Feature Selection

The features of each column in the data samples need to be reasonably selected, so as to reflect the required prediction mapping and avoid overfitting, thus strengthening the generalization ability of the model with multiple samples.As the financial forecasting task is a nonlinear application problem, this study tries to use L1 norm regularization which performs well in nonlinear problems to complete feature selection. Firstly, the L1 norm score value of the feature sequence after data cleaning is calculated. Then, the threshold of fitness is set to 0.6, that is to say, the features whose score value is less than 0.6 are filtered out, thus further promoting data dimensionality reduction. Finally, only the key information related to financial business is left in the filtered feature sequence.


## 3.3. Normalization Treatment

After cleaning and feature selection, the financial data has been effectively dimension-reduced, but the data features still have different value ranges, so the subsequent model prediction cannot be carried out. Therefore, in this study, the samples after cleaning and feature selection are normalized by a simple and quick mean variance normalization method, and the specific calculation formula is as follows:(1)Xscale=x−minmax−min,where min represents the lower bound, max represents the upper bound, X represents the input eigenvalue, and Xscale represents the normalized eigenvalue.


## 3.4. Sliding Sample Generation

As financial forecasting is a time-periodic work, it is necessary to set the time span, which is similar to the window frame in graphic image processing mechanism. In this paper, one year is set as the time span to select the data samples by sliding. Too short or too long time span will have certain influence on the prediction performance. One year is the selected value from many experiments. The specific operation process is shown in Figure1.Figure 1
Sliding sample generation.


## 4. Financial Crisis Prediction Based on LSTM

### 4.1. Structure of LSTM Neural Network

The LSTM neural network structure is based on the recurrent neural network (RNN) structure [21–23], which is shown in Figure 2.Figure 2
RNN structure.U, V, and W in Figure2 are the connection weights of neurons in each layer. As can be seen from Figure 2, the output at time t is related to the hidden layer output at time t−1 and t−2 and the input at current time t. The output at each time takes into account the influence of historical time series. The LSTM neural network is generated by improving the recurrent neural network. Compared with RNN, LSTM neural network is more complex in cyclic operation, and it introduces memory nodes and related operations of forgetting gate, as shown in Figure 3.Figure 3
Core structure of LSTM neural network.In Figure3, σ represents sigmoid function. ht−1 and Ct−1 represent hidden layer output and memory node values at time t−1, respectively. ht and Ct represent hidden layer output and memory node output values at time t, respectively.The expression of forget gate is as follows:(2)ft=σWf⋅ht−1,xt+bf,where Wf and bf represent the forget gate weight matrix and bias, respectively.The expression of the input gate is as follows:(3)it=σWi⋅ht−1,xt+bi,where Wi and bi, respectively, represent the weight and offset of the input gate.The candidate memory valueC~t of the memory node is represented as follows [24]:
(4)C~t=tanWC⋅ht−1,xt+bC,where WC and bC are the weights and offsets of memory nodes, respectively.Use the resultCt−1 of the forgetting gate at the last moment and the sum of the candidate memory nodes to obtain a new memory node Ct. The expression method is as follows:
(5)Ct=ft∗Ct−1+it∗C~t.The expressionot of the output gate is as follows:
(6)ot=σWo⋅ht−1,xt+bo,where Wo and bo are the weight and offset of output gate, respectively.
(7)ht=ot∗tanhCt.Then, the propagation method is optimized according to the wolf pack algorithm, and the weights and offsets are continuously optimized to obtain a stable LSTM neural network model.


### 4.2. Wolf Pack Optimization of Weight Parameters

In order to reduce the output error of LSTM neural network model, the traditional method mainly uses gradient decreasing method to iterate the initial weight and offset parameters for many times, so as to find the best network architecture. However, the traditional method is easy to fall into the local minimum, which leads to the fact that the accuracy and work efficiency cannot meet the actual requirements.In order to solve the above problems, this study proposes to adopt the wolf pack algorithm [25] in swarm intelligence algorithm to effectively improve the efficiency of bias parameter optimization. Assume that the average value of the estimation error of personal medical expenses is expressed as follows:
(8)C_=∑i=1nCin,where Ci represents the prediction error of the i-th financial index.For the financial forecasting model, the required fitness function should be the reciprocal of the mean of each financial index (1/C¯). Let N represent the number of offset parameters in the prediction model, M represent the total number of wolves, and Q represent the coordinate set of other wolves except the head wolf.Tnum wolves are randomly selected as leaders in set Q; then, the migration process of leaders is as follows:
(9)StepYk=maxk−minkS,qi,kg=qi,k+sin2π×gh×StepYk,where h is the direction of migration and S is the weight value. i=1,2,..,Tnum, and g=1,2,..,h.According to the leader’s direction, the migration process of other wolves is as follows:(10)StepBk=2×maxk−minkS,qi,kz+1=qi,kz+StepBk⋅dk−qi,kzdk−qi,kz,where dk is the distance between the k-th wolf and the head wolf and dk∈0,Dk. i=1,2,..,N−Tnum−1.
(11)Dk=1J×ω×∑k=1Jmaxk−mink,where ω is the distance weight. The distance Dk is the basis for wolves to judge whether prey has entered the siege range.Finally, all wolves began to gather towards the target, and the migration process was as follows:(12)StepWk=maxk−mink2×S,qi,kz+1=qi,kz+λ⋅StepWk⋅dk−qi,k,where λ represents a random constant, and the range of values is −1,1. z=1,2,..,N−1.Finally, if1/C¯ meets the error threshold of the financial prediction model, and Rmax meet the constraint conditions, the wolf pack optimization process is stopped.


### 4.3. Process of Financial Crisis Prediction

According to the enterprise financial index data, obtain the enterprise financial crisis forecast sample. Firstly, the sample of enterprise financial crisis prediction is initialized by noise reduction, and then, the enterprise financial crisis prediction model is obtained by training wolf pack-optimized LSTM neural network. The specific process is shown in Figure4.Figure 4
Financial crisis prediction based on wolf pack-optimized LSTM neural network.


## 4.1. Structure of LSTM Neural Network

The LSTM neural network structure is based on the recurrent neural network (RNN) structure [21–23], which is shown in Figure 2.Figure 2
RNN structure.U, V, and W in Figure2 are the connection weights of neurons in each layer. As can be seen from Figure 2, the output at time t is related to the hidden layer output at time t−1 and t−2 and the input at current time t. The output at each time takes into account the influence of historical time series. The LSTM neural network is generated by improving the recurrent neural network. Compared with RNN, LSTM neural network is more complex in cyclic operation, and it introduces memory nodes and related operations of forgetting gate, as shown in Figure 3.Figure 3
Core structure of LSTM neural network.In Figure3, σ represents sigmoid function. ht−1 and Ct−1 represent hidden layer output and memory node values at time t−1, respectively. ht and Ct represent hidden layer output and memory node output values at time t, respectively.The expression of forget gate is as follows:(2)ft=σWf⋅ht−1,xt+bf,where Wf and bf represent the forget gate weight matrix and bias, respectively.The expression of the input gate is as follows:(3)it=σWi⋅ht−1,xt+bi,where Wi and bi, respectively, represent the weight and offset of the input gate.The candidate memory valueC~t of the memory node is represented as follows [24]:
(4)C~t=tanWC⋅ht−1,xt+bC,where WC and bC are the weights and offsets of memory nodes, respectively.Use the resultCt−1 of the forgetting gate at the last moment and the sum of the candidate memory nodes to obtain a new memory node Ct. The expression method is as follows:
(5)Ct=ft∗Ct−1+it∗C~t.The expressionot of the output gate is as follows:
(6)ot=σWo⋅ht−1,xt+bo,where Wo and bo are the weight and offset of output gate, respectively.
(7)ht=ot∗tanhCt.Then, the propagation method is optimized according to the wolf pack algorithm, and the weights and offsets are continuously optimized to obtain a stable LSTM neural network model.


## 4.2. Wolf Pack Optimization of Weight Parameters

In order to reduce the output error of LSTM neural network model, the traditional method mainly uses gradient decreasing method to iterate the initial weight and offset parameters for many times, so as to find the best network architecture. However, the traditional method is easy to fall into the local minimum, which leads to the fact that the accuracy and work efficiency cannot meet the actual requirements.In order to solve the above problems, this study proposes to adopt the wolf pack algorithm [25] in swarm intelligence algorithm to effectively improve the efficiency of bias parameter optimization. Assume that the average value of the estimation error of personal medical expenses is expressed as follows:
(8)C_=∑i=1nCin,where Ci represents the prediction error of the i-th financial index.For the financial forecasting model, the required fitness function should be the reciprocal of the mean of each financial index (1/C¯). Let N represent the number of offset parameters in the prediction model, M represent the total number of wolves, and Q represent the coordinate set of other wolves except the head wolf.Tnum wolves are randomly selected as leaders in set Q; then, the migration process of leaders is as follows:
(9)StepYk=maxk−minkS,qi,kg=qi,k+sin2π×gh×StepYk,where h is the direction of migration and S is the weight value. i=1,2,..,Tnum, and g=1,2,..,h.According to the leader’s direction, the migration process of other wolves is as follows:(10)StepBk=2×maxk−minkS,qi,kz+1=qi,kz+StepBk⋅dk−qi,kzdk−qi,kz,where dk is the distance between the k-th wolf and the head wolf and dk∈0,Dk. i=1,2,..,N−Tnum−1.
(11)Dk=1J×ω×∑k=1Jmaxk−mink,where ω is the distance weight. The distance Dk is the basis for wolves to judge whether prey has entered the siege range.Finally, all wolves began to gather towards the target, and the migration process was as follows:(12)StepWk=maxk−mink2×S,qi,kz+1=qi,kz+λ⋅StepWk⋅dk−qi,k,where λ represents a random constant, and the range of values is −1,1. z=1,2,..,N−1.Finally, if1/C¯ meets the error threshold of the financial prediction model, and Rmax meet the constraint conditions, the wolf pack optimization process is stopped.


## 4.3. Process of Financial Crisis Prediction

According to the enterprise financial index data, obtain the enterprise financial crisis forecast sample. Firstly, the sample of enterprise financial crisis prediction is initialized by noise reduction, and then, the enterprise financial crisis prediction model is obtained by training wolf pack-optimized LSTM neural network. The specific process is shown in Figure4.Figure 4
Financial crisis prediction based on wolf pack-optimized LSTM neural network.


## 5. Experimental Results and Analysis

### 5.1. Experimental Setup

In order to analyze and verify the financial crisis prediction method proposed in this paper, a concrete experiment was carried out. The experimental hardware environment is as follows: the processor is Intel Core i7 2.2GHz, the graphics and image processing equipment is GTX970@2G memory, and the memory is 8 G. The experimental software environment is Windows 7 operating system and Matlab7.0 simulation software.The data set used in the experiment is the real operations of 20 companies for 3 years (2019-2021). The selected 20 enterprises are from manufacturing, financial, and service industries. The financial data of 2019 and 2020 are selected as training samples, and the data of 2021 is selected as testing samples. By comparing the predicted value with the actual financial value in 2021, the accuracy of the financial crisis prediction method is verified. The parameters of LSTM neural network are set as follows: the time step is 12, the latitude of each time cloth is 4, the weights and offsets of memory nodes are 0.3 and 0.1, respectively, and the weights and offsets of the three gate are all 0.2.


### 5.2. Evaluation Indicators

In order to quantitatively evaluate the performance of financial forecast, this paper selects root mean square error (RMSE) and goodness of fit (R2) as evaluation indicators [26].RMSE is calculated as follows:(13)RMSE=1m∑i=1myi−y∧i2,where it represents the predicted value and the actual value.The calculation method ofR2 is as follows:
(14)R2=1−∑iyi−yi2∑iyi−yi2,where the value range of R2 is [0,1]. A smaller RMSE and a larger R2 indicate better model prediction results.


### 5.3. Analysis of the Best Layers of the Model

The comparison of predicted performance under different network layers is shown in Table1.Table 1
Comparison of prediction performance under different network layers.
The number of layersData typeR2RMSE1Training set96.62%1.023e-6Testing set95.02%1.073e-62Training set96.28%1.043e-6Testing set97.22%1.034e-63Training set97.85%1.011e-6Testing set98.57%1.012e-64Training set95.36%1.023e-6Testing set96.83%1.029e-6As can be seen from Table1, with the increase of layers, the prediction performance of test set gradually improves. When the number of layers is 3, it is the best, R2 is 98.57%, and RMSE is 1.012e-6. When the number of layers is 4, it begins to decrease again. Therefore, the optimal number of layers is set to 3, and the number of layers of LSTM neural network is set to 3 in subsequent experiments.


### 5.4. Forecast Performance of Asset-Liability Ratio and Gross Profit Margin of Sales

The realization of financial forecast is mainly based on historical financial data. The financial operation of an enterprise can be judged by the prediction results of important financial indicators. This paper chooses to compare two important indicators of corporate finance in 2021: (1) asset-liability ratio and (2) gross profit margin of sales, and the forecast results are shown in Figures5 and 6, respectively.Figure 5
Forecast results of asset-liability ratio.Figure 6
Forecast results of gross profit margin of sales.From Figures5 and 6, it can be seen that the prediction performance of LSTM neural network optimized by wolf pack on the test data set is better for the asset-liability ratio and gross profit margin. It is found that the prediction effect of asset-liability ratio is better than that of sales gross profit margin. In the asset-liability ratio forecast of Figure 5, the deviations of asset-liability ratio forecast of enterprises No. 5, No. 10, and No. 11 are obvious, and the errors of other enterprises are small. On the other hand, in the gross profit margin forecast of Figure 6, the deviation between the forecast and the actual situation is very small.In the forecasting model, the asset-liability ratio and sales gross profit margin threshold can be set separately. In this paper, the asset-liability ratio threshold is set to 1.0, and the sales gross profit margin threshold is set to 0.2. According to the prediction results and threshold setting of LSTM neural network optimized by wolves, the warning tips of crisis are given. For example, enterprises with asset-liability ratio greater than 1.0 should pay attention to debt crisis, while enterprises with gross profit margin lower than 0.2 should pay attention to market competition crisis and need to increase product R&D investment to improve product competitiveness.


### 5.5. Comparison of Prediction Accuracy

Next, the wolf pack optimization LSTM neural network is used to test the financial samples of 20 listed enterprises in 2021. Ten indicators such as property right ratio, business growth rate, asset-liability ratio, and sales gross profit margin are selected as the prediction targets, and the corresponding thresholds are set for early warning. The predicted value exceeds or falls below a set threshold; i.e., a crisis is determined to exist. Enterprise financial crisis prediction results are shown in Table2.Table 2
Forecast results of enterprise financial crisis.
No. of enterpriseActual number of alarmsR2RMSE11593.33%1.214e-62887.50%1.037e-631693.75%1.084e-647100.00%1.039e-655100.00%0.817e-661291.67%1.216e-672100.00%0.627e-68988.89%1.042e-691392.31%1.108e-6107100.00%1.015e-6119100.00%1.009e-6125100.00%0.913e-6131785.71%1.074e-6147100.00%1.017e-6151190.91%1.023e-616887.50%1.063e-6176100.00%0.924e-6182295.45%1.011e-6191090.00%1.107e-6207100.00%1.212e-6Table2 shows that the lowest and highest prediction accuracy rates of wolves optimizing LSTM neural network are 85.71% and 100%, respectively. Although the prediction performance of the 13-th enterprise was the worst, from the perspective of RMSE, the enterprise financial crisis prediction stability of wolf pack optimization LSTM neural network was high.


### 5.6. Prediction Accuracy Performance of Different Algorithms

In order to further verify the performance of wolf pack optimization LSTM neural network in the financial crisis prediction of large-scale enterprises, SVM [27], convolutional neural network (CNN) [28], and LSTM neural network [29] were used to predict the financial crisis with 417 alarm data from 300 enterprises, and the results are shown in Figure 7.Figure 7
Comparison of financial crisis prediction results of different methods.As shown in Figure7, the wolf pack-optimized LSTM neural network had the highest prediction accuracy, LSTM neural network took second place, and SVM was the worst. Compared with other models, the wolf pack optimization LSTM neural network has the largest R2 (94.2%) result, which shows that it has obtained the best prediction result, which is completely consistent with the business development trend of the enterprise.


## 5.1. Experimental Setup

In order to analyze and verify the financial crisis prediction method proposed in this paper, a concrete experiment was carried out. The experimental hardware environment is as follows: the processor is Intel Core i7 2.2GHz, the graphics and image processing equipment is GTX970@2G memory, and the memory is 8 G. The experimental software environment is Windows 7 operating system and Matlab7.0 simulation software.The data set used in the experiment is the real operations of 20 companies for 3 years (2019-2021). The selected 20 enterprises are from manufacturing, financial, and service industries. The financial data of 2019 and 2020 are selected as training samples, and the data of 2021 is selected as testing samples. By comparing the predicted value with the actual financial value in 2021, the accuracy of the financial crisis prediction method is verified. The parameters of LSTM neural network are set as follows: the time step is 12, the latitude of each time cloth is 4, the weights and offsets of memory nodes are 0.3 and 0.1, respectively, and the weights and offsets of the three gate are all 0.2.


## 5.2. Evaluation Indicators

In order to quantitatively evaluate the performance of financial forecast, this paper selects root mean square error (RMSE) and goodness of fit (R2) as evaluation indicators [26].RMSE is calculated as follows:(13)RMSE=1m∑i=1myi−y∧i2,where it represents the predicted value and the actual value.The calculation method ofR2 is as follows:
(14)R2=1−∑iyi−yi2∑iyi−yi2,where the value range of R2 is [0,1]. A smaller RMSE and a larger R2 indicate better model prediction results.


## 5.3. Analysis of the Best Layers of the Model

The comparison of predicted performance under different network layers is shown in Table1.Table 1
Comparison of prediction performance under different network layers.
The number of layersData typeR2RMSE1Training set96.62%1.023e-6Testing set95.02%1.073e-62Training set96.28%1.043e-6Testing set97.22%1.034e-63Training set97.85%1.011e-6Testing set98.57%1.012e-64Training set95.36%1.023e-6Testing set96.83%1.029e-6As can be seen from Table1, with the increase of layers, the prediction performance of test set gradually improves. When the number of layers is 3, it is the best, R2 is 98.57%, and RMSE is 1.012e-6. When the number of layers is 4, it begins to decrease again. Therefore, the optimal number of layers is set to 3, and the number of layers of LSTM neural network is set to 3 in subsequent experiments.


## 5.4. Forecast Performance of Asset-Liability Ratio and Gross Profit Margin of Sales

The realization of financial forecast is mainly based on historical financial data. The financial operation of an enterprise can be judged by the prediction results of important financial indicators. This paper chooses to compare two important indicators of corporate finance in 2021: (1) asset-liability ratio and (2) gross profit margin of sales, and the forecast results are shown in Figures5 and 6, respectively.Figure 5
Forecast results of asset-liability ratio.Figure 6
Forecast results of gross profit margin of sales.From Figures5 and 6, it can be seen that the prediction performance of LSTM neural network optimized by wolf pack on the test data set is better for the asset-liability ratio and gross profit margin. It is found that the prediction effect of asset-liability ratio is better than that of sales gross profit margin. In the asset-liability ratio forecast of Figure 5, the deviations of asset-liability ratio forecast of enterprises No. 5, No. 10, and No. 11 are obvious, and the errors of other enterprises are small. On the other hand, in the gross profit margin forecast of Figure 6, the deviation between the forecast and the actual situation is very small.In the forecasting model, the asset-liability ratio and sales gross profit margin threshold can be set separately. In this paper, the asset-liability ratio threshold is set to 1.0, and the sales gross profit margin threshold is set to 0.2. According to the prediction results and threshold setting of LSTM neural network optimized by wolves, the warning tips of crisis are given. For example, enterprises with asset-liability ratio greater than 1.0 should pay attention to debt crisis, while enterprises with gross profit margin lower than 0.2 should pay attention to market competition crisis and need to increase product R&D investment to improve product competitiveness.


## 5.5. Comparison of Prediction Accuracy

Next, the wolf pack optimization LSTM neural network is used to test the financial samples of 20 listed enterprises in 2021. Ten indicators such as property right ratio, business growth rate, asset-liability ratio, and sales gross profit margin are selected as the prediction targets, and the corresponding thresholds are set for early warning. The predicted value exceeds or falls below a set threshold; i.e., a crisis is determined to exist. Enterprise financial crisis prediction results are shown in Table2.Table 2
Forecast results of enterprise financial crisis.
No. of enterpriseActual number of alarmsR2RMSE11593.33%1.214e-62887.50%1.037e-631693.75%1.084e-647100.00%1.039e-655100.00%0.817e-661291.67%1.216e-672100.00%0.627e-68988.89%1.042e-691392.31%1.108e-6107100.00%1.015e-6119100.00%1.009e-6125100.00%0.913e-6131785.71%1.074e-6147100.00%1.017e-6151190.91%1.023e-616887.50%1.063e-6176100.00%0.924e-6182295.45%1.011e-6191090.00%1.107e-6207100.00%1.212e-6Table2 shows that the lowest and highest prediction accuracy rates of wolves optimizing LSTM neural network are 85.71% and 100%, respectively. Although the prediction performance of the 13-th enterprise was the worst, from the perspective of RMSE, the enterprise financial crisis prediction stability of wolf pack optimization LSTM neural network was high.


## 5.6. Prediction Accuracy Performance of Different Algorithms

In order to further verify the performance of wolf pack optimization LSTM neural network in the financial crisis prediction of large-scale enterprises, SVM [27], convolutional neural network (CNN) [28], and LSTM neural network [29] were used to predict the financial crisis with 417 alarm data from 300 enterprises, and the results are shown in Figure 7.Figure 7
Comparison of financial crisis prediction results of different methods.As shown in Figure7, the wolf pack-optimized LSTM neural network had the highest prediction accuracy, LSTM neural network took second place, and SVM was the worst. Compared with other models, the wolf pack optimization LSTM neural network has the largest R2 (94.2%) result, which shows that it has obtained the best prediction result, which is completely consistent with the business development trend of the enterprise.


## 6. Conclusions

This paper presents a financial crisis prediction method based on wolf pack optimization LSTM neural network. The pretreated financial data were trained using LSTM neural network, and the historical financial data were forgotten and filtered using the forgetting gate and the memory node, so that part of the retained data was substituted into the next neural network training. The optimal initial weights and bias parameters were obtained by the wolf pack optimization algorithm. Taking the accuracy of enterprise financial risk early warning as the fitness function, a stable enterprise financial crisis prediction model is obtained. The proposed method has achieved good prediction results on various evaluation criteria and verified its feasibility. However, the number (dimension) of features in the training and test sample sets is still large, and more efficient dimension reduction using principal component analysis will be considered in the future to further improve the performance of the prediction model.



---

*Source: 5728470-2022-05-29.xml*