# Market Risk Early Warning Based on Deep Learning and Fruit Fly Optimization

Authors: Liang Chen; Rui Ma
Journal: Mathematical Problems in Engineering
 (2022)

---

## Abstract

To improve the ability of market to avoid and prevent credit risk and strengthen the awareness of market risk early warning, SMOTE is used to process the unbalanced sample, and fruit fly optimization algorithm (FOA) is utilized to optimize the parameters of support vector machine (SVM), and thus an improved SVM market risk early warning model is proposed. The simulation results show that the proposed model has excellent stability and generalization ability, and it can predict market credit risk accurately. Compared with the prediction model based on FOA-SMOTE-BP and FOA-SMOTE-Logit, the proposed model performs better on the indicators of G value, F value, and AUC value, which provides a reference for market credit risk prediction.


---

## Body

## 1. Introduction

Market risk early warning is an important measure to prevent market risk and unknown loss and improve market normalization. In recent years, with the development of intelligent technology, deep learning has been widely used in various fields, including market risk warning. So far, the relevant researchers achieved market risk early warning through the use of deep learning. On the basis of in-depth study of rough set theory (RST), Guan et al. proposed a financial operation risk early warning model based on BP neural network, which effectively realizes the prediction of financial operation risk and profit risk of family farm [1]. In the cross-border environment, scholars put forward the marginal expected gap, delta conditional value at risk, and conditional capital gap to measure the system risk. The feature pair method based on bilateral balance sheet data is different from the paradoxical risk measurement method based on market price. Thus, a systemic risk early warning method based on the network spectral feature pair method analyzing the core global banking system is proposed. The method provides risk early warning for the unstable financial markets based on turning points similar to R numbers in popular models [2]. Figini et al. improved the sample performance of parametric models and nonparametric models in credit risk estimation, so as to propose a multivariable outlier detection technology based on local outliers, which can support financial institutions to make decisions and avoid falling into corporate credit risks [3]. In view of the credit risk assessment of the Internet finance industry, Yang and Yuan applied RBF network to analyze the statistical data of online peer-to-peer lending platform and evaluated the credit risk of the platform, and thus a new early warning method of RBF neural network model is proposed, which can reasonably predict the credit risk status of the industry development [4]. Based on the fuzzy theory and related theories of financial risk early warning management, Ding proposed the fuzzy comprehensive evaluation method, which realizes more accurate early warning and assessment of potential and obvious risks of financial enterprises. In addition, the safety of financial enterprise management is greatly improved, and the losses caused by various risks are reduced [5]. Based on BP neural network, Li constructed a risk assessment model of knowledge transfer in transforming enterprises to realize knowledge management risk warning [6]. Dong adopted the improved K-means algorithm of quantum evolution to divide the risk warning interval by combining the given initial value and the value at risk measured by well-known Chinese online financial companies [7, 8]. Zhang and Chen used the autoregressive conditional Fréchet (ACF) model to predict the tail risk of the capital market, so as to identify major crisis sources [9]. Ouyang et al. applied the deep learning algorithm to the early warning of market risk. The results show that the algorithm has high accuracy compared with the traditional BP and others [10].Among them, SVM algorithm is widely used in the field of classification because of its nonlinear and small sample advantages, but the parameter optimization of SVM is a research hotspot. For example, Jerlin Rubini and Perumal proposed to optimize the SVM algorithm by using the Drosophila algorithm and applied the optimized algorithm to the classification of chronic kidney disease, showing a good classification effect, indicating that the Drosophila algorithm has great advantages in optimizing SVM [11]. Tian and others used the fruit fly algorithm to optimize the echo state network, which greatly improved the accuracy of prediction [12]. Lu et al. applied the fruit fly algorithm and SVM to the prediction of urban gas load, which greatly improved the accuracy of short-term prediction. It can be seen from the above that the combination of Drosophila algorithm and SVM for classification or prediction has become the focus of current research [13]. The above early warning models based on deep learning realize the early warning of market risks to a certain extent. However, the prediction accuracy needs to be improved. To solve this problem, this paper applies the SVM model with excellent predictive performance and constructs a market risk early warning model by optimizing its parameters and unbalanced samples.


## 2. Basic Methods

### 2.1. SVM Model

SVM is a generalized linear classifier, which is proposed based on statistical learning theory and the principle of minimizing structural risk. Its basic principle is to construct an optimal hyperplane to maximize the distance between samples of two different categories, which is shown in Figure1 [14]. Here, circles and squares represent two different types, respectively, and the optimal hyperplane is to maximize the range between the two dotted lines.Figure 1
SVM for classification data example.Suppose, dataset=xi,yi,i=1,2,…,n, x∈R,y∈−1,1,y is the category number. When y = 1, it means that x belongs to the first category. Also, when y = −1, it means that x belongs to the second category. Its linear discriminant function is usually expressed as [15](1)gx=w′⋅x+b,where w′ is the inertia weight and b is a constant.The classification gap is2/w′2 . When w′2 is minimum, the classification spacing is maximum. The form of standard SVM is [16](2)mingw′=12w′2+c∑i=1nεi2,s.t.yiw′Txi+bTxi+b≥1−εi,εi≥0,i=1,2,…,n,where c is the penalty function and ε is the slack variable.SVM is used to perform nonlinear transformation for undivided linear sample data, namely,φ:Rd⟶H. Thus, the data sample space can be mapped in high-dimensional space. When solving, it should meet the requirement of [17](3)Qa=∑i=1nai−12∑i,j=1naiajyiyjKxi,xj,where ai is the Lagrange multiplier and ∑i=1nyiai=0. Since the above equation is constrained by the inequality, there is a unique optimal solution corresponding to the Lagrange multiplier ai∗. The optimal classification discriminant function is [18](4)fx=sgn∑i=1na∗yiKxi,yi+b∗,where b∗ is the b value obtained from formula (2) and Kxi,xi is the kernel function. Take the radial basis function (RBF) as an example, which can be expressed as [19](5)Kx,y=exp−σx−y2,where σ is the RBF kernel parameter. According to formulas (4) and (5), the optimal classification discriminant function is(6)fx=sgn∑i=1na∗yiexp−σxi−yi2+b∗.As can be seen from the above analysis, the classification effect of the SVM model mainly depends on two aspects: one is whether the number of classification samples is balanced, and the other is whether the kernel parameters and penalty factors of the model are optimal, while the standard SVM model does not consider the situation [20]. Therefore, in order to improve the classification effect of the SVM model, this paper improves the model from the above two aspects.


### 2.2. SVM Model Improvements

#### 2.2.1. Unbalanced Sample Processing

For the unbalanced classification samples, the Synthetic Minority Oversampling Technique (SMOTE) is used to deal with them from the data level [21]:(1)
Determine a few sample categoriesX, calculate the Euclidean distance d between samples in X, and select K samples with the smallest distance d.(2)
SampleX with the multiplier of N = minority sample/majority sample, and select Xi(i = 1, 2, …, N) from K samples.(3)
According to formula (7), Xi and X are synthesized into a new sample:(7)Xnew=X+rand0,1×Xi−X.(4)
CombineXnew and X as a new training set to learn on the SVM model.


#### 2.2.2. Optimization of Model Parameters

To optimize kernel parameters and penalty factors of the SVM model, this paper adopts fruit fly optimization algorithm (FOA) with high searching accuracy to process. Figure2 shows simulated behavior of fruit fly foraging process [22]. The basic operation is as follows.(1)
Initialize model maximum iteration, population size, fruit fly population location range (LR), and other parameters. In 2D coordinates (X, Y), the initial position of each individual fruit fly is(8)X_axis=randLR,Y_axis=randLR.(2)
Assign flight direction and distance to all fruit flies and olfactory search is utilized to update [23](9)Xi=X_axis+randFR,Yi=Y_axis+randFR,where FR represents the single flight range of fruit fly.(3)
According to formula (12), the distance between the individual position of fruit fly and the origin is calculated [24].(10)DISTi=Xi2+Yi2.(4)
Smelli and Si are calculated according to fitness:(11)Smelli=fitnessSi,Si=1DISTi,where fitness is the discriminant function, smelli is the flavor concentration value, and Si is the judgment value of smelli.(5)
Update bestSmell and bestIndex:(12)bestSmell,bestIndex=minSmell.(6)
Use visual search to make other fruit flies fly to the best position [25]:(13)SmellBest=BestSmell,X_axis=XbestIndex,Y_axis=YbestIndex.(7)
Repeat steps (2)–(6) until the algorithm iterates to the set number.Figure 2
Simulation of fruit fly foraging behavior.FOA guides the search by the current optimal solution and makes the result close to the optimal solution, so as to realize the parameter optimization.


## 2.1. SVM Model

SVM is a generalized linear classifier, which is proposed based on statistical learning theory and the principle of minimizing structural risk. Its basic principle is to construct an optimal hyperplane to maximize the distance between samples of two different categories, which is shown in Figure1 [14]. Here, circles and squares represent two different types, respectively, and the optimal hyperplane is to maximize the range between the two dotted lines.Figure 1
SVM for classification data example.Suppose, dataset=xi,yi,i=1,2,…,n, x∈R,y∈−1,1,y is the category number. When y = 1, it means that x belongs to the first category. Also, when y = −1, it means that x belongs to the second category. Its linear discriminant function is usually expressed as [15](1)gx=w′⋅x+b,where w′ is the inertia weight and b is a constant.The classification gap is2/w′2 . When w′2 is minimum, the classification spacing is maximum. The form of standard SVM is [16](2)mingw′=12w′2+c∑i=1nεi2,s.t.yiw′Txi+bTxi+b≥1−εi,εi≥0,i=1,2,…,n,where c is the penalty function and ε is the slack variable.SVM is used to perform nonlinear transformation for undivided linear sample data, namely,φ:Rd⟶H. Thus, the data sample space can be mapped in high-dimensional space. When solving, it should meet the requirement of [17](3)Qa=∑i=1nai−12∑i,j=1naiajyiyjKxi,xj,where ai is the Lagrange multiplier and ∑i=1nyiai=0. Since the above equation is constrained by the inequality, there is a unique optimal solution corresponding to the Lagrange multiplier ai∗. The optimal classification discriminant function is [18](4)fx=sgn∑i=1na∗yiKxi,yi+b∗,where b∗ is the b value obtained from formula (2) and Kxi,xi is the kernel function. Take the radial basis function (RBF) as an example, which can be expressed as [19](5)Kx,y=exp−σx−y2,where σ is the RBF kernel parameter. According to formulas (4) and (5), the optimal classification discriminant function is(6)fx=sgn∑i=1na∗yiexp−σxi−yi2+b∗.As can be seen from the above analysis, the classification effect of the SVM model mainly depends on two aspects: one is whether the number of classification samples is balanced, and the other is whether the kernel parameters and penalty factors of the model are optimal, while the standard SVM model does not consider the situation [20]. Therefore, in order to improve the classification effect of the SVM model, this paper improves the model from the above two aspects.


## 2.2. SVM Model Improvements

### 2.2.1. Unbalanced Sample Processing

For the unbalanced classification samples, the Synthetic Minority Oversampling Technique (SMOTE) is used to deal with them from the data level [21]:(1)
Determine a few sample categoriesX, calculate the Euclidean distance d between samples in X, and select K samples with the smallest distance d.(2)
SampleX with the multiplier of N = minority sample/majority sample, and select Xi(i = 1, 2, …, N) from K samples.(3)
According to formula (7), Xi and X are synthesized into a new sample:(7)Xnew=X+rand0,1×Xi−X.(4)
CombineXnew and X as a new training set to learn on the SVM model.


### 2.2.2. Optimization of Model Parameters

To optimize kernel parameters and penalty factors of the SVM model, this paper adopts fruit fly optimization algorithm (FOA) with high searching accuracy to process. Figure2 shows simulated behavior of fruit fly foraging process [22]. The basic operation is as follows.(1)
Initialize model maximum iteration, population size, fruit fly population location range (LR), and other parameters. In 2D coordinates (X, Y), the initial position of each individual fruit fly is(8)X_axis=randLR,Y_axis=randLR.(2)
Assign flight direction and distance to all fruit flies and olfactory search is utilized to update [23](9)Xi=X_axis+randFR,Yi=Y_axis+randFR,where FR represents the single flight range of fruit fly.(3)
According to formula (12), the distance between the individual position of fruit fly and the origin is calculated [24].(10)DISTi=Xi2+Yi2.(4)
Smelli and Si are calculated according to fitness:(11)Smelli=fitnessSi,Si=1DISTi,where fitness is the discriminant function, smelli is the flavor concentration value, and Si is the judgment value of smelli.(5)
Update bestSmell and bestIndex:(12)bestSmell,bestIndex=minSmell.(6)
Use visual search to make other fruit flies fly to the best position [25]:(13)SmellBest=BestSmell,X_axis=XbestIndex,Y_axis=YbestIndex.(7)
Repeat steps (2)–(6) until the algorithm iterates to the set number.Figure 2
Simulation of fruit fly foraging behavior.FOA guides the search by the current optimal solution and makes the result close to the optimal solution, so as to realize the parameter optimization.


## 2.2.1. Unbalanced Sample Processing

For the unbalanced classification samples, the Synthetic Minority Oversampling Technique (SMOTE) is used to deal with them from the data level [21]:(1)
Determine a few sample categoriesX, calculate the Euclidean distance d between samples in X, and select K samples with the smallest distance d.(2)
SampleX with the multiplier of N = minority sample/majority sample, and select Xi(i = 1, 2, …, N) from K samples.(3)
According to formula (7), Xi and X are synthesized into a new sample:(7)Xnew=X+rand0,1×Xi−X.(4)
CombineXnew and X as a new training set to learn on the SVM model.


## 2.2.2. Optimization of Model Parameters

To optimize kernel parameters and penalty factors of the SVM model, this paper adopts fruit fly optimization algorithm (FOA) with high searching accuracy to process. Figure2 shows simulated behavior of fruit fly foraging process [22]. The basic operation is as follows.(1)
Initialize model maximum iteration, population size, fruit fly population location range (LR), and other parameters. In 2D coordinates (X, Y), the initial position of each individual fruit fly is(8)X_axis=randLR,Y_axis=randLR.(2)
Assign flight direction and distance to all fruit flies and olfactory search is utilized to update [23](9)Xi=X_axis+randFR,Yi=Y_axis+randFR,where FR represents the single flight range of fruit fly.(3)
According to formula (12), the distance between the individual position of fruit fly and the origin is calculated [24].(10)DISTi=Xi2+Yi2.(4)
Smelli and Si are calculated according to fitness:(11)Smelli=fitnessSi,Si=1DISTi,where fitness is the discriminant function, smelli is the flavor concentration value, and Si is the judgment value of smelli.(5)
Update bestSmell and bestIndex:(12)bestSmell,bestIndex=minSmell.(6)
Use visual search to make other fruit flies fly to the best position [25]:(13)SmellBest=BestSmell,X_axis=XbestIndex,Y_axis=YbestIndex.(7)
Repeat steps (2)–(6) until the algorithm iterates to the set number.Figure 2
Simulation of fruit fly foraging behavior.FOA guides the search by the current optimal solution and makes the result close to the optimal solution, so as to realize the parameter optimization.


## 3. Market Credit Risk Early Warning Model Based on Improved SVM

Smin and Smaj are used to represent the samples of market credit risk and noncredit risk, andS is the set of all samples. Based on the above improvements, the construction process of the market credit risk early warning model is designed as follows:(1)
Calculatek nearest neighbor points of each sample point (xsmin,ysmin) in Smin, randomly select a neighbor point |Smaj-Smin|/2 to subtract (xsmin,ysmin) and multiply it by the random number δ in the interval [0, 1], and then add (xsmin,ysmin) to obtain a new credit risk sample xnew, and thus there is(14)xnew=xsmin+xmin¯−xsmin×δ.(2)
Repeat the above steps until the number ofxnew reaches |Smaj-Smin|/2.(3)
Initialize relevant parameters of SVM and FOA. In this paper, referring to reference [26], the maximum iteration number of FOA is set to 100, and the population size is set to 20.(4)
Use FOA to optimize the parameters of the SVM model, and the judgment value of flavor concentration is calculated according toDISTi=Xi2+Yi2 and Si=1/DISTi.(5)
Continue to iterate until the optimal bestsmell is less than the set value, and then the value is the optimal parameter.(6)
Plug optimal parameters andxnew to construct the improved SVM model and perform prediction.The above process is illustrated in Figure3.Figure 3
Prediction process of market credit risk early warning model based on improved SVM.


## 4. Simulation Experiment

### 4.1. Experimental Environment Construction

This experiment is run on 64-bit Windows 7 professional edition system. The CPU is Intel(R)Xeon(R) e5-2620v3 2.40ghz, and the GPU is Tesla K80. In addition, the memory is 16G. The model was built with MATLAB2018a.


### 4.2. Data Sources and Preprocessing

#### 4.2.1. Data Sources

The financial data of 260 listed manufacturing enterprises in Shenzhen and Shanghai from 2018 to 2020 are selected as the experiment data. Through references [21, 27, 28], there are a total of 20 financial indicators selected as credit risk warning indicators of listed companies, including 6 first-level indicators such as enterprise operation capacity, growth capacity, profitability, and so on, and 20 second-level indicators such as total asset turnover rate, net asset growth rate, return on net asset, and so on. The indicators are listed in detail in Table 1.Table 1
Index selection.
Index typeIndex nameDebt paying abilityCurrent ratio (X1)Quick ratio (X2)Net asset-liability ratio (X3)Operation abilityFixed asset turnover ratio(X4)Total asset turnover ratio (X5)Receivable turnover ratio (X6)Profit abilityReturn on net assets (X7)Return on total assets (X8)Net interest rate in sale (X9)Growth abilityGrowth rate of basic earnings per share (X10)Growth rate of total operating revenue (X11)Operating profit growth rate (X12)Growth rate of net assets (X13)Index per shareEarning per share (X14)Net assets per share (X15)Retained earnings per share (X16)Operating revenue per share (X17)Asset structureAsset-liability ratio (X18)Rights multiple (X19)Capital fixed ratio (X20)


#### 4.2.2. Data Preprocessing

(1) Descriptive Statistics. Since there are significant differences between the mean of the above indicator variables and standard deviation and maximum and minimum values, descriptive statistics of indicator variables are carried out, and the results are shown in Table 2.Table 2
Descriptive statistical results of indicators.
Financial indicatorsMeanStandard deviationMinimum valueMaximum valueX12.52172.98500.1533.17X22.09072.79810.1333.17X31.47011 1.5760−151.94231.66X43.59154.40360.1747.23X50.74710.37030.032.64X69.10169.07900.00108.47X72.7914134.5795−3106.24871.51X87.898697.8307−60.1148.03X97.841515.9206−222.31153.66X10−35.1845549.6023−6200.004550.49X1114.943537.1203−90.05467.03X121857.666252257.2278−41692.611398352.86X1325.454076.0995−1281.86691.26X140.41460.6626−5.754.37X154.75003.7401−3.0470.53X161.68472.6542−5.9551.75X176.17405.99620.0672.55X1838.598723.57123.03326.20X192.61289.86200.00232.68X20136 0941769.6847−12085.5013048.27(2) Normalization. Considering the dimensional level of index variables, z-score is adopted for normalization, which is shown in the following formula:(15)xj∗=xj−μxjσxj,where μxj and σxj represent the sample mean and standard deviation corresponding to index j, respectively.After normalization, descriptive statistics of each indicator variable are shown in Table3.Table 3
Descriptive statistics of index variables after normalization.
Financial indicatorsMeanStandard deviationMinimum valueMaximum valueX101−0.797610.2645X201−0.703211.1042X301−13.2512119.8845X401−0.77859.9074X501−1.97005.0861X601−1.002610.9445X701−23.10196.4551X801−8.68455.1242X901−14.45649.1595X1001−11.21708.3437X1101−2.828712.1791X1201−0.833526.7232X1301−17.17978.7492X1401−9.28815.9572X1501−2.079817.5859X1601−2.872918 8525X1701−1.021411.0679X1801−1.509712.2011X1901−0.265023.3276X2001−15.878816.7760(3) Significance Testing. For the selection of indicators that can distinguish credit risks and nonuse risks of listed companies, this paper adopts independent sample T-test to test them, and the results are shown in Table 4. The P value of 7 indicators, such as net asset-liability ratio and operating profit growth rate, is more than 10%, which indicates that it is unable to distinguish the credit risk and noncredit risk, so it is deleted in this paper.Table 4
Independent sampleT-test results of index variables.
Financial indicatorsT valueP valueFinancial indicatorsT valueP valueX19.0150.000X112.1630.032X29.9580.000X120.1740.864X30.2230.827X132.7720.014X42.1180.035X143.8620.002X52.5330.012X153.6010.000X62.0850.038X164.6950.000X71.7110.105X171.2460.215X87.6600.000X18−4.1820.002X96.1170.000X19−1.5040.153X101.5880.132X200.1760.863


### 4.3. Evaluation Indicators

Set average accuracy (G), F value, and AUC are used to evaluate the prediction performance of model. Confusion matrix is used to represent the dichotomous dataset of credit risk, which is shown in Table5.Table 5
Confusion matrix of credit risk dataset.
Judged as noncredit risk sampleJudged as credit risk sampleActually a noncredit risk sampleTSmajFSminActually a sample of credit riskFSmajTSminThe model sensitivity (SE), specificity (SP), and precision (P) can be calculated as follows:(16)SE=TSminTSmin+TSmin,SP=TSminTSmin+TSmin,P=TSminTSmin+FSmin.Through the above three indicators, the following can be calculated:(17)G=0.1044,F_measure=2∗SE∗SPSE+P.The larger the selected index value is, the better the model performance is.


### 4.4. Experimental Results

#### 4.4.1. Model Verification

The samples are divided into training sets and testing sets according to different proportions, and experiments are carried out under different kernel functions and different optimal parameter values. The results are shown in Table6. Under the division condition of different sample proportion, models corresponding to different kernel functions and optimal parameter values perform well in G value, F value, and AUC value, and the differences are small, which indicates that the proposed model has good prediction performance and strong generalization ability [29].Table 6
Prediction results.
Kernel functionProportion of trainingsamples (%)Proportion of testingsamples (%)Optimal parameter valueGFAUCRBF9010c = 0.6509, g = 0 66660.69540.20230.60718020c = 0.0836, g = 0.08060.76590.22240.79467030c = 0.0908, g = 0.07980.70830.45760.73386040c−0.7157, g−0.62590.75780.28880.78215050c = 0.1384, g = 0.13550.71510.21430.7490Polynomial9010c = 2.1547, g = 0.7367, d = 6.8425, r = 0.9121070710.26670.68438020c = 3.0080, g = 0.8021, d = 2.0911, r = 1.19000.61570.22220.54297030c = 4.5994, g = 0.4957, d = 0.9812, r = 1.88100.62790.40000.55146040c = 2.6578, g = 0.7339, d = 1.8111, r = 2.70770.66840.09090.57865050c = 0.2456, g = 0.0897, d = 0.0835, r = 0.08100.66730.23530.5677Linear9010c = 1.61330.70980.23490.74658020c = 0.10.76410.23110.79357030c = 0.08870.77610.42950.80246040c = 15.63920.64880.21270.65305050c = 0.10440.69540.21100.7108Sigmoid9010c = 5.7636, g = 0.7344, r = 0.76830.70110.28790.72438020c = 1.9080, g = 0.6945, r = 0.80520.69700.13190.71547030c = 3.3143, g = 0.5031 r = 0.85050.70610.30020.72126040c = 2.4913, g = 0.7543 r = 1.10810.62670.21990.54365050c = 0.2223, g = 0.0758, r = 0.07570.64430.19000.5981In order to more intuitively reflect the prediction performance of different kernel functions and optimal parameter values under different training sample proportions, the prediction results in the above table are plotted in Figures4–6. Figure 4 shows that under different ratios of training set and testing set, the fluctuation range of G values of different kernel functions is small. Compared with the sigmoid and polynomial models, linear and RBF models have higher G values, which indicates that linear and RBF models have slightly better performance. On the other hand, Figure 5 shows that under different proportions of training sets and testing sets, F values of different kernels fluctuate greatly, but the overall F value is high. There is no trend indicating that the model F value of certain kernels type has the highest value, and thus the proposed model has good generalization ability. As can be seen from Figure 6, the AUC value of the proposed model fluctuates greatly, but the proposed model also achieves good results on this index. To sum up, the model proposed in this paper has good generalization ability and good prediction performance.Figure 4
G values of the model under different kernel functions.Figure 5
F values of the model under different kernel functions.Figure 6
AUC values of the model under different kernel functions.Considering that evaluating the model performance only through evaluation indexes lacks a certain scientific character, paired sampleT test is adopted to test the prediction performance of different kernel function models, and the results are shown in Table 7. On the G value, the statistics of RBF and polynomial model, linear, and sigmoid model are all less than 10%, which rejects the null hypothesis, indicating that the performance of RBF and polynomial model is significantly different from that of linear and sigmoid model. On the F value, the statistics of all kernel function models are less than 10%, and all accept the null hypothesis, indicating that the performance of different kernel function models is less different. On the AUC value, the statistics of all models are less than 10%, which rejects the null hypothesis, indicating that the performance of linear and polynomial, sigmoid and polynomial, and RBF models is significantly different.Table 7
PairedT-test results of model prediction performance under different kernel functions.
EvaluationindicatorsKernel functionPolynomialRBFSigmoidGLinear0.1640.7540.023Polynomial0.0550.531RBF0.101FLinear0.4920.5140.324Polynomial0.4950.708RBF0.274AUCLinear0.0190.8710.008Polynomial0.0620.140RBF0.296In conclusion, the change of kernel function has little influence on the prediction performance of the proposed model, which means that the prediction performance of the proposed model is relatively stable.


#### 4.4.2. Model Comparison

To further verify the validity of the proposed model, the prediction performance of the proposed model is compared with that of other models. The results are shown in Table8. Compared with FOA-SMOTE-BP and FOA-SMOTE-Logit, the proposed model has the best performance on the indicators of G value, F value, and AUC value, indicating that the model proposed in this paper has the best prediction performance.Table 8
Comparison of prediction performance of different models.
ModelGFAUCFOA-SMOTE-SVM0.70830.45760.7338FOA-SMOTE-BP0.63770.17600.6855FOA-SMOTE-Logit0.70260.25630.7219In order to observe the prediction performance of different models intuitively, the results of the above table are drawn as shown in Figure7. It can be seen from the figure that the G value, F value, and AUC value curves of the proposed model are significantly higher than those of the comparison model, indicating that the proposed model has better prediction performance.Figure 7
Comparison of every indicator of different models.


## 4.1. Experimental Environment Construction

This experiment is run on 64-bit Windows 7 professional edition system. The CPU is Intel(R)Xeon(R) e5-2620v3 2.40ghz, and the GPU is Tesla K80. In addition, the memory is 16G. The model was built with MATLAB2018a.


## 4.2. Data Sources and Preprocessing

### 4.2.1. Data Sources

The financial data of 260 listed manufacturing enterprises in Shenzhen and Shanghai from 2018 to 2020 are selected as the experiment data. Through references [21, 27, 28], there are a total of 20 financial indicators selected as credit risk warning indicators of listed companies, including 6 first-level indicators such as enterprise operation capacity, growth capacity, profitability, and so on, and 20 second-level indicators such as total asset turnover rate, net asset growth rate, return on net asset, and so on. The indicators are listed in detail in Table 1.Table 1
Index selection.
Index typeIndex nameDebt paying abilityCurrent ratio (X1)Quick ratio (X2)Net asset-liability ratio (X3)Operation abilityFixed asset turnover ratio(X4)Total asset turnover ratio (X5)Receivable turnover ratio (X6)Profit abilityReturn on net assets (X7)Return on total assets (X8)Net interest rate in sale (X9)Growth abilityGrowth rate of basic earnings per share (X10)Growth rate of total operating revenue (X11)Operating profit growth rate (X12)Growth rate of net assets (X13)Index per shareEarning per share (X14)Net assets per share (X15)Retained earnings per share (X16)Operating revenue per share (X17)Asset structureAsset-liability ratio (X18)Rights multiple (X19)Capital fixed ratio (X20)


### 4.2.2. Data Preprocessing

(1) Descriptive Statistics. Since there are significant differences between the mean of the above indicator variables and standard deviation and maximum and minimum values, descriptive statistics of indicator variables are carried out, and the results are shown in Table 2.Table 2
Descriptive statistical results of indicators.
Financial indicatorsMeanStandard deviationMinimum valueMaximum valueX12.52172.98500.1533.17X22.09072.79810.1333.17X31.47011 1.5760−151.94231.66X43.59154.40360.1747.23X50.74710.37030.032.64X69.10169.07900.00108.47X72.7914134.5795−3106.24871.51X87.898697.8307−60.1148.03X97.841515.9206−222.31153.66X10−35.1845549.6023−6200.004550.49X1114.943537.1203−90.05467.03X121857.666252257.2278−41692.611398352.86X1325.454076.0995−1281.86691.26X140.41460.6626−5.754.37X154.75003.7401−3.0470.53X161.68472.6542−5.9551.75X176.17405.99620.0672.55X1838.598723.57123.03326.20X192.61289.86200.00232.68X20136 0941769.6847−12085.5013048.27(2) Normalization. Considering the dimensional level of index variables, z-score is adopted for normalization, which is shown in the following formula:(15)xj∗=xj−μxjσxj,where μxj and σxj represent the sample mean and standard deviation corresponding to index j, respectively.After normalization, descriptive statistics of each indicator variable are shown in Table3.Table 3
Descriptive statistics of index variables after normalization.
Financial indicatorsMeanStandard deviationMinimum valueMaximum valueX101−0.797610.2645X201−0.703211.1042X301−13.2512119.8845X401−0.77859.9074X501−1.97005.0861X601−1.002610.9445X701−23.10196.4551X801−8.68455.1242X901−14.45649.1595X1001−11.21708.3437X1101−2.828712.1791X1201−0.833526.7232X1301−17.17978.7492X1401−9.28815.9572X1501−2.079817.5859X1601−2.872918 8525X1701−1.021411.0679X1801−1.509712.2011X1901−0.265023.3276X2001−15.878816.7760(3) Significance Testing. For the selection of indicators that can distinguish credit risks and nonuse risks of listed companies, this paper adopts independent sample T-test to test them, and the results are shown in Table 4. The P value of 7 indicators, such as net asset-liability ratio and operating profit growth rate, is more than 10%, which indicates that it is unable to distinguish the credit risk and noncredit risk, so it is deleted in this paper.Table 4
Independent sampleT-test results of index variables.
Financial indicatorsT valueP valueFinancial indicatorsT valueP valueX19.0150.000X112.1630.032X29.9580.000X120.1740.864X30.2230.827X132.7720.014X42.1180.035X143.8620.002X52.5330.012X153.6010.000X62.0850.038X164.6950.000X71.7110.105X171.2460.215X87.6600.000X18−4.1820.002X96.1170.000X19−1.5040.153X101.5880.132X200.1760.863


## 4.2.1. Data Sources

The financial data of 260 listed manufacturing enterprises in Shenzhen and Shanghai from 2018 to 2020 are selected as the experiment data. Through references [21, 27, 28], there are a total of 20 financial indicators selected as credit risk warning indicators of listed companies, including 6 first-level indicators such as enterprise operation capacity, growth capacity, profitability, and so on, and 20 second-level indicators such as total asset turnover rate, net asset growth rate, return on net asset, and so on. The indicators are listed in detail in Table 1.Table 1
Index selection.
Index typeIndex nameDebt paying abilityCurrent ratio (X1)Quick ratio (X2)Net asset-liability ratio (X3)Operation abilityFixed asset turnover ratio(X4)Total asset turnover ratio (X5)Receivable turnover ratio (X6)Profit abilityReturn on net assets (X7)Return on total assets (X8)Net interest rate in sale (X9)Growth abilityGrowth rate of basic earnings per share (X10)Growth rate of total operating revenue (X11)Operating profit growth rate (X12)Growth rate of net assets (X13)Index per shareEarning per share (X14)Net assets per share (X15)Retained earnings per share (X16)Operating revenue per share (X17)Asset structureAsset-liability ratio (X18)Rights multiple (X19)Capital fixed ratio (X20)


## 4.2.2. Data Preprocessing

(1) Descriptive Statistics. Since there are significant differences between the mean of the above indicator variables and standard deviation and maximum and minimum values, descriptive statistics of indicator variables are carried out, and the results are shown in Table 2.Table 2
Descriptive statistical results of indicators.
Financial indicatorsMeanStandard deviationMinimum valueMaximum valueX12.52172.98500.1533.17X22.09072.79810.1333.17X31.47011 1.5760−151.94231.66X43.59154.40360.1747.23X50.74710.37030.032.64X69.10169.07900.00108.47X72.7914134.5795−3106.24871.51X87.898697.8307−60.1148.03X97.841515.9206−222.31153.66X10−35.1845549.6023−6200.004550.49X1114.943537.1203−90.05467.03X121857.666252257.2278−41692.611398352.86X1325.454076.0995−1281.86691.26X140.41460.6626−5.754.37X154.75003.7401−3.0470.53X161.68472.6542−5.9551.75X176.17405.99620.0672.55X1838.598723.57123.03326.20X192.61289.86200.00232.68X20136 0941769.6847−12085.5013048.27(2) Normalization. Considering the dimensional level of index variables, z-score is adopted for normalization, which is shown in the following formula:(15)xj∗=xj−μxjσxj,where μxj and σxj represent the sample mean and standard deviation corresponding to index j, respectively.After normalization, descriptive statistics of each indicator variable are shown in Table3.Table 3
Descriptive statistics of index variables after normalization.
Financial indicatorsMeanStandard deviationMinimum valueMaximum valueX101−0.797610.2645X201−0.703211.1042X301−13.2512119.8845X401−0.77859.9074X501−1.97005.0861X601−1.002610.9445X701−23.10196.4551X801−8.68455.1242X901−14.45649.1595X1001−11.21708.3437X1101−2.828712.1791X1201−0.833526.7232X1301−17.17978.7492X1401−9.28815.9572X1501−2.079817.5859X1601−2.872918 8525X1701−1.021411.0679X1801−1.509712.2011X1901−0.265023.3276X2001−15.878816.7760(3) Significance Testing. For the selection of indicators that can distinguish credit risks and nonuse risks of listed companies, this paper adopts independent sample T-test to test them, and the results are shown in Table 4. The P value of 7 indicators, such as net asset-liability ratio and operating profit growth rate, is more than 10%, which indicates that it is unable to distinguish the credit risk and noncredit risk, so it is deleted in this paper.Table 4
Independent sampleT-test results of index variables.
Financial indicatorsT valueP valueFinancial indicatorsT valueP valueX19.0150.000X112.1630.032X29.9580.000X120.1740.864X30.2230.827X132.7720.014X42.1180.035X143.8620.002X52.5330.012X153.6010.000X62.0850.038X164.6950.000X71.7110.105X171.2460.215X87.6600.000X18−4.1820.002X96.1170.000X19−1.5040.153X101.5880.132X200.1760.863


## 4.3. Evaluation Indicators

Set average accuracy (G), F value, and AUC are used to evaluate the prediction performance of model. Confusion matrix is used to represent the dichotomous dataset of credit risk, which is shown in Table5.Table 5
Confusion matrix of credit risk dataset.
Judged as noncredit risk sampleJudged as credit risk sampleActually a noncredit risk sampleTSmajFSminActually a sample of credit riskFSmajTSminThe model sensitivity (SE), specificity (SP), and precision (P) can be calculated as follows:(16)SE=TSminTSmin+TSmin,SP=TSminTSmin+TSmin,P=TSminTSmin+FSmin.Through the above three indicators, the following can be calculated:(17)G=0.1044,F_measure=2∗SE∗SPSE+P.The larger the selected index value is, the better the model performance is.


## 4.4. Experimental Results

### 4.4.1. Model Verification

The samples are divided into training sets and testing sets according to different proportions, and experiments are carried out under different kernel functions and different optimal parameter values. The results are shown in Table6. Under the division condition of different sample proportion, models corresponding to different kernel functions and optimal parameter values perform well in G value, F value, and AUC value, and the differences are small, which indicates that the proposed model has good prediction performance and strong generalization ability [29].Table 6
Prediction results.
Kernel functionProportion of trainingsamples (%)Proportion of testingsamples (%)Optimal parameter valueGFAUCRBF9010c = 0.6509, g = 0 66660.69540.20230.60718020c = 0.0836, g = 0.08060.76590.22240.79467030c = 0.0908, g = 0.07980.70830.45760.73386040c−0.7157, g−0.62590.75780.28880.78215050c = 0.1384, g = 0.13550.71510.21430.7490Polynomial9010c = 2.1547, g = 0.7367, d = 6.8425, r = 0.9121070710.26670.68438020c = 3.0080, g = 0.8021, d = 2.0911, r = 1.19000.61570.22220.54297030c = 4.5994, g = 0.4957, d = 0.9812, r = 1.88100.62790.40000.55146040c = 2.6578, g = 0.7339, d = 1.8111, r = 2.70770.66840.09090.57865050c = 0.2456, g = 0.0897, d = 0.0835, r = 0.08100.66730.23530.5677Linear9010c = 1.61330.70980.23490.74658020c = 0.10.76410.23110.79357030c = 0.08870.77610.42950.80246040c = 15.63920.64880.21270.65305050c = 0.10440.69540.21100.7108Sigmoid9010c = 5.7636, g = 0.7344, r = 0.76830.70110.28790.72438020c = 1.9080, g = 0.6945, r = 0.80520.69700.13190.71547030c = 3.3143, g = 0.5031 r = 0.85050.70610.30020.72126040c = 2.4913, g = 0.7543 r = 1.10810.62670.21990.54365050c = 0.2223, g = 0.0758, r = 0.07570.64430.19000.5981In order to more intuitively reflect the prediction performance of different kernel functions and optimal parameter values under different training sample proportions, the prediction results in the above table are plotted in Figures4–6. Figure 4 shows that under different ratios of training set and testing set, the fluctuation range of G values of different kernel functions is small. Compared with the sigmoid and polynomial models, linear and RBF models have higher G values, which indicates that linear and RBF models have slightly better performance. On the other hand, Figure 5 shows that under different proportions of training sets and testing sets, F values of different kernels fluctuate greatly, but the overall F value is high. There is no trend indicating that the model F value of certain kernels type has the highest value, and thus the proposed model has good generalization ability. As can be seen from Figure 6, the AUC value of the proposed model fluctuates greatly, but the proposed model also achieves good results on this index. To sum up, the model proposed in this paper has good generalization ability and good prediction performance.Figure 4
G values of the model under different kernel functions.Figure 5
F values of the model under different kernel functions.Figure 6
AUC values of the model under different kernel functions.Considering that evaluating the model performance only through evaluation indexes lacks a certain scientific character, paired sampleT test is adopted to test the prediction performance of different kernel function models, and the results are shown in Table 7. On the G value, the statistics of RBF and polynomial model, linear, and sigmoid model are all less than 10%, which rejects the null hypothesis, indicating that the performance of RBF and polynomial model is significantly different from that of linear and sigmoid model. On the F value, the statistics of all kernel function models are less than 10%, and all accept the null hypothesis, indicating that the performance of different kernel function models is less different. On the AUC value, the statistics of all models are less than 10%, which rejects the null hypothesis, indicating that the performance of linear and polynomial, sigmoid and polynomial, and RBF models is significantly different.Table 7
PairedT-test results of model prediction performance under different kernel functions.
EvaluationindicatorsKernel functionPolynomialRBFSigmoidGLinear0.1640.7540.023Polynomial0.0550.531RBF0.101FLinear0.4920.5140.324Polynomial0.4950.708RBF0.274AUCLinear0.0190.8710.008Polynomial0.0620.140RBF0.296In conclusion, the change of kernel function has little influence on the prediction performance of the proposed model, which means that the prediction performance of the proposed model is relatively stable.


### 4.4.2. Model Comparison

To further verify the validity of the proposed model, the prediction performance of the proposed model is compared with that of other models. The results are shown in Table8. Compared with FOA-SMOTE-BP and FOA-SMOTE-Logit, the proposed model has the best performance on the indicators of G value, F value, and AUC value, indicating that the model proposed in this paper has the best prediction performance.Table 8
Comparison of prediction performance of different models.
ModelGFAUCFOA-SMOTE-SVM0.70830.45760.7338FOA-SMOTE-BP0.63770.17600.6855FOA-SMOTE-Logit0.70260.25630.7219In order to observe the prediction performance of different models intuitively, the results of the above table are drawn as shown in Figure7. It can be seen from the figure that the G value, F value, and AUC value curves of the proposed model are significantly higher than those of the comparison model, indicating that the proposed model has better prediction performance.Figure 7
Comparison of every indicator of different models.


## 4.4.1. Model Verification

The samples are divided into training sets and testing sets according to different proportions, and experiments are carried out under different kernel functions and different optimal parameter values. The results are shown in Table6. Under the division condition of different sample proportion, models corresponding to different kernel functions and optimal parameter values perform well in G value, F value, and AUC value, and the differences are small, which indicates that the proposed model has good prediction performance and strong generalization ability [29].Table 6
Prediction results.
Kernel functionProportion of trainingsamples (%)Proportion of testingsamples (%)Optimal parameter valueGFAUCRBF9010c = 0.6509, g = 0 66660.69540.20230.60718020c = 0.0836, g = 0.08060.76590.22240.79467030c = 0.0908, g = 0.07980.70830.45760.73386040c−0.7157, g−0.62590.75780.28880.78215050c = 0.1384, g = 0.13550.71510.21430.7490Polynomial9010c = 2.1547, g = 0.7367, d = 6.8425, r = 0.9121070710.26670.68438020c = 3.0080, g = 0.8021, d = 2.0911, r = 1.19000.61570.22220.54297030c = 4.5994, g = 0.4957, d = 0.9812, r = 1.88100.62790.40000.55146040c = 2.6578, g = 0.7339, d = 1.8111, r = 2.70770.66840.09090.57865050c = 0.2456, g = 0.0897, d = 0.0835, r = 0.08100.66730.23530.5677Linear9010c = 1.61330.70980.23490.74658020c = 0.10.76410.23110.79357030c = 0.08870.77610.42950.80246040c = 15.63920.64880.21270.65305050c = 0.10440.69540.21100.7108Sigmoid9010c = 5.7636, g = 0.7344, r = 0.76830.70110.28790.72438020c = 1.9080, g = 0.6945, r = 0.80520.69700.13190.71547030c = 3.3143, g = 0.5031 r = 0.85050.70610.30020.72126040c = 2.4913, g = 0.7543 r = 1.10810.62670.21990.54365050c = 0.2223, g = 0.0758, r = 0.07570.64430.19000.5981In order to more intuitively reflect the prediction performance of different kernel functions and optimal parameter values under different training sample proportions, the prediction results in the above table are plotted in Figures4–6. Figure 4 shows that under different ratios of training set and testing set, the fluctuation range of G values of different kernel functions is small. Compared with the sigmoid and polynomial models, linear and RBF models have higher G values, which indicates that linear and RBF models have slightly better performance. On the other hand, Figure 5 shows that under different proportions of training sets and testing sets, F values of different kernels fluctuate greatly, but the overall F value is high. There is no trend indicating that the model F value of certain kernels type has the highest value, and thus the proposed model has good generalization ability. As can be seen from Figure 6, the AUC value of the proposed model fluctuates greatly, but the proposed model also achieves good results on this index. To sum up, the model proposed in this paper has good generalization ability and good prediction performance.Figure 4
G values of the model under different kernel functions.Figure 5
F values of the model under different kernel functions.Figure 6
AUC values of the model under different kernel functions.Considering that evaluating the model performance only through evaluation indexes lacks a certain scientific character, paired sampleT test is adopted to test the prediction performance of different kernel function models, and the results are shown in Table 7. On the G value, the statistics of RBF and polynomial model, linear, and sigmoid model are all less than 10%, which rejects the null hypothesis, indicating that the performance of RBF and polynomial model is significantly different from that of linear and sigmoid model. On the F value, the statistics of all kernel function models are less than 10%, and all accept the null hypothesis, indicating that the performance of different kernel function models is less different. On the AUC value, the statistics of all models are less than 10%, which rejects the null hypothesis, indicating that the performance of linear and polynomial, sigmoid and polynomial, and RBF models is significantly different.Table 7
PairedT-test results of model prediction performance under different kernel functions.
EvaluationindicatorsKernel functionPolynomialRBFSigmoidGLinear0.1640.7540.023Polynomial0.0550.531RBF0.101FLinear0.4920.5140.324Polynomial0.4950.708RBF0.274AUCLinear0.0190.8710.008Polynomial0.0620.140RBF0.296In conclusion, the change of kernel function has little influence on the prediction performance of the proposed model, which means that the prediction performance of the proposed model is relatively stable.


## 4.4.2. Model Comparison

To further verify the validity of the proposed model, the prediction performance of the proposed model is compared with that of other models. The results are shown in Table8. Compared with FOA-SMOTE-BP and FOA-SMOTE-Logit, the proposed model has the best performance on the indicators of G value, F value, and AUC value, indicating that the model proposed in this paper has the best prediction performance.Table 8
Comparison of prediction performance of different models.
ModelGFAUCFOA-SMOTE-SVM0.70830.45760.7338FOA-SMOTE-BP0.63770.17600.6855FOA-SMOTE-Logit0.70260.25630.7219In order to observe the prediction performance of different models intuitively, the results of the above table are drawn as shown in Figure7. It can be seen from the figure that the G value, F value, and AUC value curves of the proposed model are significantly higher than those of the comparison model, indicating that the proposed model has better prediction performance.Figure 7
Comparison of every indicator of different models.


## 5. Conclusion

In summary, the proposed market risk early warning method based on deep learning takes SVM as basic model and uses SMOTE to deal with unbalanced sample. In addition, minority samples are subjected to oversampling, and FOA is utilized to tune model parameters. Thus, the classification effect of the model is improved. The empirical results show that the proposed model has excellent stability and generalization ability and can accurately predict market credit risk. Compared with FOA-SMOTE-BP and FOA-SMOTE-Logit models, the proposed model performs better on G value, F value, and AUC value indicators and has better prediction performance, which provides a reference for market credit risk prediction research. The contribution of this study is to use a new improved SVM to predict the market risk. It provides a new reference for information management and prevention of the market. However, as the limitation of conditions, there are still some deficiencies to be improved. In the selection of market credit risk indicators, they are selected just through references, without considering the actual situation of China’s manufacturing industry, which may affect the final market risk prediction results. To avoid the influence of index selection on prediction accuracy, the next research will try to independently determine the relevant index variables affecting market credit risk.



---

*Source: 4844856-2022-05-09.xml*