Inport and export enterprise financial risk prediction method based on space-time diagram neural network
Through the optimization of spatiotemporal graph neural network and particle swarm algorithm, combined with the enterprise's external hypergraph and internal risk heterogeneous graph, it solves the problem that traditional methods cannot capture the spatiotemporal correlation, and achieves more accurate financial risk prediction and management of import and export enterprises.
Patent Information
- Application Number
- CN202410800475.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-09-06
AI Technical Summary
Traditional financial ratio analysis and historical data analysis of import and export enterprises cannot effectively handle dynamic changes and spatio-temporal correlation, and ignore the dynamic impact of market environment and macroeconomic factors, resulting in inaccurate financial risk predictions.
Using a method based on spatiotemporal graph neural network, we collect and preprocess financial data to build a spatiotemporal graph neural network model, use particle swarm algorithm to optimize parameters, combine the enterprise's external hypergraph and internal risk heterogeneous graph, extract multi-scale features, and conduct risk analysis. Prediction and evaluation.
It improves the accuracy and adaptability of financial risk prediction, enables a more comprehensive understanding of the company's financial status, provides more effective risk management strategies, and adapts to the trends of global economic integration and digital transformation.
Smart Images

Figure CN118608307A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of deep learning and artificial intelligence, and in particular to a method for predicting financial risks of import and export enterprises based on spatiotemporal graph neural network. Background Art
[0002] With the deepening development of globalization, import and export enterprises, as direct participants in economic globalization, have increasingly frequent business activities and are also facing increasingly complex financial risks. These risks come from many aspects, including market fluctuations, exchange rate changes, policy adjustments, supply chain instability, etc., which not only increase the uncertainty of enterprise operations, but also put forward higher requirements for enterprise decision makers. Traditional financial risk assessment methods, such as financial ratio analysis and historical data analysis, although providing static analysis of financial status for enterprises, have limitations in dealing with dynamic changes and capturing time and space correlations. These methods often ignore the dynamic impact of market environment and macroeconomic factors, as well as the interaction between different financial indicators. Therefore, in order to more accurately predict and assess the financial risks of import and export enterprises, a more effective and accurate solution is needed.
[0003] In recent years, with the rapid development of artificial intelligence and machine learning technologies, especially the application of deep learning in the financial field, new ideas and methods have been provided for financial risk management. Spatial-temporal graph neural networks (ST-GNN), as an emerging deep learning model, have demonstrated their powerful spatiotemporal data processing capabilities in traffic flow forecasting, weather forecasting and other fields. By capturing the correlation of data in time and space dimensions, ST-GNN can effectively process the time dependency and space dependency in sequence data, thus providing the possibility for dynamic and complex data analysis. Applying ST-GNN to the financial risk prediction of import and export enterprises can take advantage of its processing of spatiotemporal sequence data to capture risk signals from multiple dimensions such as historical financial data, market dynamics, and macroeconomic indicators. Specifically, spatiotemporal graph neural networks can conduct in-depth analysis of the financial statement data, market transaction data, industry trends, etc. of each period of the enterprise, and identify potential risk factors and risk propagation paths. By learning the complex interactive relationship of the above data in time and space, ST-GNN can predict the financial risk trend of the enterprise in the future, provide decision support for the enterprise management, and help the enterprise formulate more effective risk management strategies and countermeasures. In addition, the financial risk prediction method for import and export enterprises based on spatiotemporal graph neural networks also has strong generalization and adaptability. It can process import and export enterprise data from different countries and regions and different industries, and can even adapt to the needs of enterprises of different sizes. By continuously learning market changes and the financial dynamics of the enterprise itself, the spatiotemporal graph neural network can continuously optimize the prediction model and improve the accuracy and reliability of the prediction. The financial risk prediction method for import and export enterprises based on spatiotemporal graph neural networks is not only a technological innovation, but also an inevitable product of adapting to the trend of global economic integration and digital transformation. As more and more companies begin to pay attention to and apply this method, it is expected to become an important tool for corporate financial risk management and provide strong support for the stable development of enterprises. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a financial risk prediction method for import and export enterprises based on spatiotemporal graph neural network, which can solve the limitations of traditional financial ratio analysis and historical data analysis of import and export enterprises, such as being unable to handle dynamic changes and capture spatiotemporal correlations;
[0005] The objective of the present invention is achieved through the following technical solutions:
[0006] The method for predicting financial risks of import and export enterprises based on spatiotemporal graph neural network includes the following steps:
[0007] Step S1: Collect and obtain financial data of different enterprises, build an enterprise risk indicator system to obtain a long-term financial risk prediction data set for import and export enterprises;
[0008] Step S2: preprocessing and cleaning the acquired enterprise financial data set to obtain risk prediction training and verification data;
[0009] Step S3: Divide the risks into internal and external risks of the enterprise, extract the multi-scale features of the company's financial indicators with the enterprise as the node, and construct a spatiotemporal graph neural network;
[0010] Step S4: Optimize the parameters and weights of the spatiotemporal graph neural network model using the particle swarm algorithm to obtain the enterprise financial risk prediction results;
[0011] Step S5: Based on the enterprise financial risk prediction results, construct an import and export enterprise risk assessment model.
[0012] Further, the step S1 specifically includes:
[0013] Step S101: Acquire financial information of multiple import and export industry fields;
[0014] Step S102: extracting, cleaning, and summarizing the collected data in multiple fields to obtain a structured data set;
[0015] Step S103: Construct a risk indicator system based on the collected data in multiple fields.
[0016] Further, the step S2 specifically includes:
[0017] Step S201: Process missing values of the collected financial data in multiple fields; Step 1: For features with more than 30% missing data, directly delete them; Step 2: For data samples with no more than 10% missing data, retain the original data; Step 3: For features with missing data between 10% and 30%, perform data filling. The filling method is as follows: first, calculate the K samples closest to the missing data samples, then take the average of the target label values of the K samples, and finally use this average as the filling value for the missing values of the target column. The specific calculation formula is as follows:
[0018]
[0019] Where d(x,y) is the distance between samples x and y, Π x,y -1 is the covariance matrix of the multidimensional random variable, μ x , μ y is the mean of samples x and y, s i 2 is the sample standard deviation;
[0020] Step S202: Based on the outliers in the sample data collected in S201, data preprocessing is required before training the model. First, outliers are removed and the data is dimensionless. Then, the indicator data is normalized. The formula is as follows:
[0021]
[0022] Among them, x' is the result obtained by normalization processing, is the mean of all feature variables in the same dimension of x, max(x) is the maximum value of the feature variable in the same dimension of x, and min(x) is the minimum value of the feature variable in the same dimension of x. After normalization, the data is converted into a number between [0,1] combined with range scaling. After normalization, the data obeys the normal distribution.
[0023] Step S203: Reduce the dimension of the data through linear transformation, eliminate redundant feature variables, and construct a data set for the financial risk prediction model of import and export enterprises; in data sample division, randomly select a part of the data as a training set and another part of the data as a test set.
[0024] Further, the step S3 comprises:
[0025] Step S301: constructing an external hypergraph of the enterprise and an internal risk heterogeneous graph of the enterprise based on the enterprise financial risk indicator system;
[0026] The specific method of constructing the enterprise external hypergraph and the enterprise internal risk heterogeneous graph in step S301 is as follows:
[0027] First, the enterprise external hypergraph is defined as G h =(V h ,E,η h ), where V h represents the set of import and export enterprises and their related enterprise nodes, E = {e h 1 ,e h 2 ,…,e h n} represents the hyperedge set of inter-enterprise relations, η h ={ω1,ω2,…,ω m} represents the set of hyperedge types, and |η h |>1, hyperedge mapping function π: The relationship between enterprise nodes is expressed in terms of the association matrix It is expressed as follows:
[0028]
[0029] The elements are defined as:
[0030]
[0031] Then, we construct a risk heterogeneity graph within the enterprise, defined as G r =(V r ,L r ,T r ,R r ,W r ), where V r Respectively represent the set of different risk nodes within the enterprise, L r represents the link set; T r Represents the node type mapping function: V r →T r , R r Indicates link type mapping function: L r →R r ; Each node v∈V r Belongs to the node type set T r A specific type in Indicates; W r represents the edge weight matrix.
[0032] Step S302: Based on step S301, a multi-scale feature extraction module is constructed, and feature maps of different dimensions obtained from the feature extraction network are merged between high and low layers, and then prediction operations are performed independently; two convolution kernels of different sizes are used to extract features of the top layer, and the extracted image features are fused to extract semantic feature information from different financial indicator combinations;
[0033] Step S303: construct an enterprise risk encoder, which consists of two sub-modules: using the enterprise external hypergraph to construct the HGNN module, and using the internal risk heterogeneous graph to construct the RGNN module;
[0034] The specific steps of constructing the HGNN module are as follows: first, extract the feature vectors between enterprises according to the external hypergraph of the enterprise constructed in step S301, and calculate the hypergraph convolution module θ h , the formula is as follows:
[0035]
[0036] Among them, D x represents the node degree matrix, which represents the number of hyperedges connecting each node. is the hypergraph type η h The correlation matrix, T represents the transpose of the matrix, W is the node weight matrix, D his the hyperedge degree matrix, representing the number of nodes contained in each hyperedge, and Att() is the graph attention mechanism, which dynamically learns the importance of interactions between different nodes; is the hypergraph type η at the l+1th layer h The learning representation is, I is the identity matrix, W h is the parameter matrix of hypergraph convolution, is another hypergraph convolution module with different adjacency or hyperedge definitions. α is a learnable parameter used to balance the features of the two scales.
[0037] Then, different types of hypergraph convolutional feature representations are aggregated as follows:
[0038]
[0039] Among them, L i is the comprehensive representation of the hypergraph learned by enterprise i, ε is a trainable parameter, ω m Represents different types of hypergraphs, q i Represents the hypergraph ω m The importance of the i-th enterprise node;
[0040] The specific steps of constructing the RGNN module are as follows: first, initialize the enterprise node and the relevant enterprise internal risk indicator nodes, then perform conversion according to the node type, and project the enterprise node and financial risk node representation into the same representation space. The formula is as follows:
[0041]
[0042] in, For node v i The new representation, that is, the representation obtained after the improved transformation, H i is the original node representation, For node v i The trainable weight matrix is used to linearly transform the original node representation, introduce the nonlinear transformation ReLU() to enhance the nonlinear expression ability of the node representation, and then weight the transformed node representation through the attention mechanism Att() to take into account the node v i The interaction relationship between nodes and their neighboring nodes; the attention mechanism can adjust the weights according to the correlation between nodes, so that more relevant neighboring nodes have a greater influence on the representation of the current node;
[0043] Then, the meta-path-based encoder learns the importance between the node and its neighbors, which is represented by the attention coefficient. It fuses the neighbor node information to get the representation of the current node. The calculation method of the attention coefficient is as follows:
[0044]
[0045] Among them, α ij is the attention coefficient from node j to node i, exp() represents the exponential function, N i is the set of neighbor nodes of node i, represents a shared linear transformation of each node, W represents the weight matrix, Represents node v i New representation, express The new representation of the neighbor nodes, LeRelu() is the activation function;
[0046] In order to fully capture the risk information implicit in different relationships, a multi-head attention mechanism is used, that is, S independent attention mechanisms are used to calculate the hidden state:
[0047] Q i =W q ·H i +b q
[0048] K i =W k α ij +b k
[0049] V i =W v ·H i +b v
[0050]
[0051] in, represents the hidden state corresponding to the risk information of node i, W q , W k , W v ∈R d×d is the trainable matrix, b q , b k , b v ∈R d is the bias of node i in other node relations, and λ is a trainable parameter used to adjust the learning importance; similarly, the softmax() function is used to normalize the learned attention and aggregate node relationship representation H i ', as shown below:
[0052]
[0053] Among them, || represents the aggregation operation of node relationship;
[0054] Finally, the risk information of the heterogeneous graph is obtained as follows:
[0055]
[0056] Among them, F i is the final risk information of node i, η is the learning weight matrix that balances the aggregated risk information and the initial risk information of the node, and ζ is the activation function.
[0057] Step S304: The vectors encoded by the HGNN and RGNN modules are fused and input into the decoder to obtain the enterprise risk prediction result. The specific steps are as follows:
[0058] First, the propagation risks of HGNN and RGNN are added together and the total risk information is calculated as follows:
[0059] R i total =(L i +F i )·w total
[0060] Among them, R i total is the total risk information, w total is a trainable weight matrix;
[0061] Then, in order to enhance the predictive ability of the decoder in the decoding stage, the total risk information R i total Input into the GRU (Gated Recurrent Unit) network as shown below:
[0062] d i t =GRU(d i t-1 ,GR i t ,W d )
[0063] Among them, d i t represents the node hidden state vector of GRU network node i at time t, W d Represents the weight of the GRU network. The hidden state vector output by the GRU network is input into the linear layer to obtain the final prediction result of each risk node:
[0064] y i t =δ(d i t ,W δ )
[0065] Among them, y i trepresents the final risk point prediction result, δ(·) represents the linear layer, and W δ are the weights of the linear layer.
[0066] Further, the step S4 comprises:
[0067] Step S401: Initialize the spatiotemporal graph neural network structure GNN, set the number of neurons in each layer of the network, the number of network layers, the learning rate and other parameters;
[0068] Step S402: Initialize the number of particles and the speed and position of each particle. The position of the particle corresponds to the weight and threshold in the GNN network. The speed and position calculation formula of the particle is as follows:
[0069] v i t+1 =w*v i t +c1*rand(pb i -x i t )+c2*rand(gb i -x i t )
[0070] x i t+1 =x i t +v i t+1
[0071] Among them, v i t is the velocity of particle i at time t, x i t is the position of particle i at time t, pb i is the individual optimal position of particle i, gb i is the global optimal position of particle i, w is the inertia weight, c1 and c1 are cognitive parameters and social parameters respectively, and rand() represents a random number in the interval [0,1];
[0072] Step S403: Use the loss function of the GNN network as the fitness function to calculate the fitness of each particle; for each sample, first input a particle, perform forward calculation through the GNN network, and calculate the error between the network output value and the actual value; use the same method to calculate the error of all samples, and calculate the mean square error of all samples as the fitness of the particle; add more particles until the fitness of all particles is calculated; in the forward propagation calculation of the GNN network model, the hidden layer uses the ReLu() function, and the output layer uses the linear function;
[0073] Step S404: Update individual extreme values and global optimal extreme values, compare fitness, and determine the individual extreme value point and global optimal extreme value point of each particle;
[0074] Step S405: updating the position and velocity of each particle according to the individual extreme value and the global optimal extreme value;
[0075] Step S406: Calculate the global optimal extreme point;
[0076] Step S407: Compare whether the number of iterations reaches the maximum number of iterations or whether the value of step S406 meets the set accuracy requirement. If the preset accuracy is met, output the optimal solution and update the GNN network weights. Otherwise, return to step S403 and the algorithm continues to iterate.
[0077] Further, the step S5 comprises:
[0078] Step S501: Based on the enterprise financial risk prediction result obtained in step S4, determine the weight of the financial risk evaluation index; the specific method of determining the weight of the financial risk evaluation index in step S501 is as follows:
[0079] First, construct a hierarchical structure of financial risk to divide the decision-making problems into three layers from top to bottom: target layer, criterion layer and plan layer; the steps to construct the hierarchical structure of financial risk are as follows:
[0080] The first step is to build the highest level of the hierarchical structure, that is, the financial risk assessment layer of the enterprise, and define the ultimate goal of the evaluation system; the second step is to build the criterion layer, which contains the main criteria or categories of the evaluation objectives, specifically the main dimensions of financial risk. In the context of financial risk evaluation, the criterion layer includes the following aspects: liquidity risk, profitability risk, debt-paying ability risk, investment risk, operating risk, market risk, etc.; finally, build the indicator layer. At this layer, there will be specific evaluation indicators under each criterion; for example, for the "liquidity risk" criterion, the indicator layer may include the "current ratio" and "quick ratio" indicators;
[0081] Then, an importance comparison matrix is established. For each criterion layer in the hierarchical structure, the criteria are compared pairwise, and their relative importance is quantified using a scale of 1 to m, where m is a constant representing relative importance. Based on the above comparison, a matrix is constructed, where each element a of the matrix is ij Indicates the importance of criterion i relative to criterion j. If i and j are equally important, a ij =1; if i is more important than j, then a ij greater than 1 and less than or equal to m; if j is more important, then a ijwill be the inverse of the ratio of their importance, and finally the importance comparison matrix at different levels is obtained. The corresponding importance comparison matrix A can be expressed as follows:
[0082]
[0083] For each row of matrix A, calculate the geometric mean E of all elements i , E i Normalized to get the calculated weight B i as follows:
[0084]
[0085] Where i = 1, 2, ..., n, n represents the size of the matrix A;
[0086] The following formula is used to calculate the weight of the index value of the i-th evaluation object under the j-th index:
[0087]
[0088] Calculate the entropy value S for the standardized value of each indicator j , as shown below:
[0089]
[0090] Among them, ρ ij is the standardized value of the i-th evaluation object on the j-th indicator, and k is a constant
[0091] Calculate the coefficient of difference G of the jth indicator j and weight w j , as shown below:
[0092] G j =1-S j
[0093]
[0094] Finally, the weight set is: in:
[0095] W i =λ*B i +(1-λ*w j )
[0096] Step S502: Evaluate the financial risk of the import and export enterprise using the secondary fuzzy evaluation method.
[0097] The step S502 uses a two-level fuzzy evaluation method to evaluate the financial risk of the import and export enterprise. The specific method is as follows:
[0098] First, define a two-level evaluation index set: the first-level evaluation index U Ⅰ =[u1 Ⅰ ,u2 Ⅰ ,…,u n Ⅰ ], secondary evaluation index U Ⅱ =[u1 Ⅱ ,u2 Ⅱ ,…,u n Ⅱ ], the corresponding evaluation set is: V = [V1, V2, …, V m ], establish the decision matrix Y, where y ij It represents the performance of the i-th evaluation indicator on the j-th evaluation set:
[0099]
[0100] Then calculate the membership matrix of each indicator, and the trapezoidal membership function is defined as:
[0101]
[0102] When x is less than a or greater than d, the membership is 0; when x is between a and b, the membership increases linearly from 0 to 1; when x is between b and c, the membership remains at 1; when x is between c and d, the membership decreases linearly from 1 to 0;
[0103] The process of calculating the membership of each evaluation object at each evaluation level is as follows: For each indicator value y of each evaluation object Y ij , substitute the above trapezoidal membership function μ(x) to calculate its membership at each evaluation level, and arrange the membership of all evaluation objects into a matrix in the following format:
[0104]
[0105] Where n is the number of evaluation objects; in order to ensure that the column vector of the membership matrix is a valid membership distribution, the membership vector of each object is normalized so that the membership value of each row adds up to 1;
[0106] Finally, a two-level evaluation model is constructed, and the first-level fuzzy evaluation model is:
[0107]
[0108] In the first-level fuzzy evaluation model M 1 Based on it, multiply it by the transpose of the index weight vector to obtain the corresponding secondary fuzzy evaluation model M 2 :
[0109] The beneficial effects of the present invention include:
[0110] (1) The present invention constructs a multi-field financial indicator evaluation model by collecting and integrating financial information from multiple import and export industry fields. This method enables the financial risk prediction model to fully understand the financial status of the enterprise from multiple perspectives, fully considering the characteristics and factors of different industries, thereby improving the prediction ability and scope of application of the model; by comprehensively considering data from multiple fields, the financial risk of the enterprise can be more accurately assessed, providing more powerful support for the enterprise's decision-making, and the prediction results are more accurate;
[0111] (2) In the preprocessing stage, the present invention processes missing values and removes outliers in the data, effectively improving the quality of the data; by cleaning and organizing the data, the noise and errors in the data can be reduced, and the accuracy and reliability of the data can be improved; it helps the model to better understand and utilize the data, improves the stability and credibility of the model, and lays a solid foundation for subsequent analysis and prediction work;
[0112] (3) The present invention constructs a multi-scale feature extraction module through a spatiotemporal graph neural network, which can extract semantic feature information from financial indicators of different scales. This method enables the model to better understand and express data, improves the model's perception and analysis capabilities of financial risks, and through the extraction of multi-scale features, can more comprehensively consider the relationship and impact between financial indicators, providing richer and deeper information for the prediction model;
[0113] (4) The present invention constructs an external hypergraph and an internal risk heterogeneous graph of the enterprise, and uses HGNN and RGNN modules to encode data to achieve in-depth mining and analysis of enterprise risks. This method enables the model to better understand the internal and external risk factors of the enterprise, providing a more comprehensive and detailed perspective for risk prediction. Through the application of the enterprise risk encoder, the risk status of the enterprise can be more accurately assessed, providing the enterprise with a more effective risk management and control strategy.
[0114] (5) The present invention optimizes the parameters and weights of the spatiotemporal graph neural network through the particle swarm optimization algorithm, which can find the global optimal solution of the model more quickly, thereby improving the training efficiency and prediction accuracy of the model; the particle swarm optimization algorithm can effectively explore the search space, accelerate the convergence process, and improve the stability and robustness of the model; the application of the particle swarm optimization algorithm makes the model more suitable for complex financial data prediction tasks, providing more powerful decision-making support for the development of enterprises.
[0115] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description and the preceding claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0116] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be further described in detail below with reference to the accompanying drawings, in which:
[0117] Figure 1 This is a flow chart of a method for predicting financial risks of import and export enterprises based on spatiotemporal graph neural network of the present invention;
[0118] Figure 2 This is a heat map of the results of the grey correlation analysis of financial indicators in an embodiment of the present invention;
[0119] Figure 3 This is a schematic diagram of a spatiotemporal graph neural network according to an embodiment of the present invention;
[0120] Figure 4 A schematic diagram of the process of optimizing graph neural network parameters by a particle swarm according to an embodiment of the present invention;
[0121] Figure 5 It is the comprehensive weight diagram of each indicator;
[0122] Figure 6 This is a preliminary selection table of financial forecast indicators according to an embodiment of the present invention;
[0123] Figure 7 This is the index ranking table after variance analysis of the embodiment of the present invention;
[0124] Figure 8 This is a financial risk hierarchy structure table of an embodiment of the present invention;
[0125] Fig. 9 It is an importance comparison matrix corresponding to different levels in the embodiment of the present invention. DETAILED DESCRIPTION
[0126] The preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the preferred embodiments are only for illustrating the present invention, rather than for limiting the protection scope of the present invention.
[0127] The present invention provides a method for predicting financial risks of import and export enterprises based on spatiotemporal graph neural network, such as Figure 1 As shown, the specific steps of the above method will be further described below through a specific embodiment.
[0128] Step S1: Collect and obtain financial data of different enterprises, build an enterprise risk indicator system to obtain a long-term financial risk prediction data set for import and export enterprises;
[0129] Step S1 specifically includes the following sub-steps:
[0130] Step S101: Obtain financial information of multiple import and export industries; collect data such as retail prices, production costs, sales, market share, loan amounts, interest expenses, balance sheets, cash flow statements, etc. of import and export products from industries such as manufacturing, retail, and finance;
[0131] Step S102: extracting, cleaning, and summarizing the collected data in multiple fields to obtain a structured data set;
[0132] Step S103: construct a risk indicator system based on the collected data in multiple fields. The specific method is as follows:
[0133] In this embodiment, the indicators of the risk warning indicator system preliminarily selected mainly include five primary indicators, namely, debt-paying ability, operating ability, profitability, development ability and cash flow, as well as secondary indicators under the primary indicators; in terms of debt-paying ability, secondary indicators such as current ratio, quick ratio and debt-to-asset ratio are selected; in terms of operating ability, secondary indicators such as inventory turnover rate, current asset turnover rate and total asset turnover rate are selected; in terms of profitability, secondary indicators such as return on assets, return on net assets and operating profit margin are selected; in terms of cash flow, two secondary indicators, namely, cash to total profit ratio and net cash content of operating income, are selected as preliminary risk assessment indicators, see the preliminary selection table of financial forecast indicators (i.e. Figure 6 );
[0134] Then, principal component analysis is performed on the risk indicators after preliminary screening to reduce the dimensionality of the indicators and transform the original indicators into a set of fewer comprehensive indicators. For the comprehensive indicators and target variables after dimensionality reduction, the grey correlation analysis method is used to calculate the correlation between each comprehensive indicator and the target variable. According to the results of the grey correlation analysis, the comprehensive indicators with a higher correlation with the target variable are selected as the final independent variables. Figure 7 is the ranking of indicators after variance analysis. Figure 2 It is the heat map of the results of grey correlation analysis, which is used to screen risk assessment indicators;
[0135] Step S2: preprocessing and cleaning the acquired enterprise financial data set to obtain risk prediction training and verification data;
[0136] Step S2 specifically includes the following sub-steps:
[0137] Step S201: Process missing values of the collected financial data in multiple fields; Step 1: For features with more than 30% missing data, directly delete them; Step 2: For data samples with no more than 10% missing data, directly use the original data; Step 3: For features with missing data between 10% and 30%, perform data filling. The filling method is as follows: first calculate the K samples closest to the missing data samples, then take the average value of the target label values of these K samples, and finally use this average value as the filling value for the missing values of the target column. The specific calculation formula is as follows:
[0138]
[0139] Where d(x,y) is the distance between samples x and y, Π x,y -1 is the covariance matrix of the multidimensional random variable, μ x , μ y is the mean of samples x and y, s i 2 is the sample standard deviation;
[0140] Step S202: Based on the outliers in the sample data collected in S201, data preprocessing is required before training the model; first, outliers are removed and the data is dimensionless; then the indicator data is normalized, and the formula is as follows:
[0141]
[0142] Among them, x' is the result obtained by normalization processing, is the mean data of all feature variables in the same dimension of x, max(x) is the maximum value of the feature variable in the same dimension of x, and min(x) is the minimum value of the feature variable in the same dimension of x. After normalization, the data is converted into a number between [0,1] combined with range scaling. After normalization, the data obeys the normal distribution.
[0143] Step S203: After reducing the dimension of the data through linear transformation and eliminating redundant feature variables, a data set of the financial risk prediction model for import and export enterprises is constructed; in terms of data sample division, 70% of the data is randomly selected as a training set and 30% of the data is randomly selected as a test set.
[0144] Step S3: Divide the risks into internal and external risks of the enterprise, extract the multi-scale features of the company's financial indicators with the enterprise as the node, and construct a spatiotemporal graph neural network;
[0145] The spatiotemporal graph neural network proposed in this embodiment is as follows: Figure 3As shown, it contains the following modules: Enterprise risk encoder and enterprise contagion risk decoder are equipped with two sub-models: a hypergraph neural network using an enterprise hypergraph and a heterogeneous graph neural network using an enterprise heterogeneous graph, as well as a predictor that integrates internal and external financial risks of the enterprise.
[0146] Step S3 specifically includes the following sub-steps:
[0147] Step S301: constructing an external hypergraph of the enterprise and an internal risk heterogeneous graph of the enterprise based on the enterprise financial risk indicator system;
[0148] Step S302: Based on step S301, a multi-scale feature extraction module is constructed, and feature maps of different sizes obtained from the feature extraction network are merged between high and low layers, and then prediction operations are performed independently; two convolution control images of different sizes are used to extract features of the top layer, and the extracted image features are fused to extract semantic feature information from different financial indicator combinations;
[0149] Step S303: construct an enterprise risk encoder, which consists of two sub-modules: construct an HGNN module using the enterprise's external hypergraph and construct an RGNN module using the internal risk heterogeneous graph;
[0150] Step S304: fusing the vectors encoded by the HGNN and RGNN modules and inputting them into the decoder to obtain a preliminary enterprise risk prediction result: Step S304: fusing the vectors encoded by the HGNN and RGNN modules and inputting them into the decoder to obtain a preliminary enterprise risk prediction result;
[0151] Step S4: using the parameters and weights of the model based on the spatiotemporal graph neural network and optimizing it using a particle swarm to obtain the enterprise financial risk prediction results;
[0152] The process of particle swarm optimization in this embodiment is as follows: Figure 4 As shown, first initialize the GNN spatiotemporal graph neural network structure, set the number of neurons in each layer of the network, the number of network layers, the learning rate and other parameters; in this embodiment, the neural network includes an input layer, three hidden layers and an output layer with a total of 5 layers, the number of neurons in the hidden layer is 10, the learning rate is set to 0.01, and the input data is the 12 features selected in step S103, that is, the network has 24 input neurons and 2 output neurons, and normal enterprises and risky enterprises are represented by (0,1) and (1,0) respectively; the particle swarm algorithm parameter settings are specifically as follows: particle scale N = 30, maximum number of iterations 1000 times, network training error δ = 1×10 -6 , the range of inertia weight is [0.3, 0.85], the learning factor c1 = c2 = 0.22, the maximum particle speed v max =1.
[0153] Step S5: Based on the prediction results of enterprise financial risks, construct an import and export enterprise risk assessment system;
[0154] Step S5 specifically includes the following steps:
[0155] Step S501: Determine the weight of the financial risk assessment indicator based on the enterprise financial risk prediction result obtained in step S4;
[0156] The specific method of determining the weight of the financial risk evaluation index in step S501 based on the enterprise financial risk prediction result obtained in step S4 is as follows:
[0157] First, a hierarchical structure of financial risk is constructed to divide the decision-making problem into three layers from top to bottom: the target layer, the criterion layer, and the solution layer. In this embodiment, the hierarchical structure of financial risk is constructed as follows: Figure 8 As shown: The first step is to build the highest level of the hierarchical structure, that is, the financial risk assessment layer of the enterprise, and define the ultimate goal of the evaluation system; the second step is to build the criterion layer, which contains the main criteria or categories of the evaluation objectives, specifically the main dimensions of financial risk. In the context of financial risk evaluation, the criterion layer includes the following aspects: liquidity risk, profitability risk, debt-paying ability risk, investment risk, operating risk, market risk, etc. Finally, the indicator layer is built. At this layer, there will be specific evaluation indicators under each criterion; for example, for the "liquidity risk" criterion, the indicator layer includes the "current ratio" and "quick ratio" indicators;
[0158] Then, the importance comparison matrix A is established. For each criterion layer in the hierarchical structure, the criteria are compared pairwise, and the subjective judgment of their relative importance is quantified using a scale of 1 to 9. Based on the above comparison, a matrix is constructed, and each element a of the matrix ij Indicates the importance of criterion i relative to criterion j. If i and j are equally important, a ij =1; if i is more important than j, then a ij greater than 1 and less than or equal to 9; if j is more important, then a ij will be the inverse of the ratio of their importance, and finally the importance comparison matrix at different levels is obtained. The corresponding importance comparison matrix is as follows Fig. 9 As shown;
[0159] In this embodiment, the weight calculation method is explained by calculating the element value of a row of matrix A. For each row of A, the geometric mean of all elements is calculated, and the geometric mean of each row E is converted to i Normalize to calculate the weight B i as follows:
[0160]
[0161] The normalization of the criterion layer importance comparison matrix and the calculation results of the corresponding weights are shown in the following table:
[0162]
[0163] After calculating the indicator layer weights accordingly, the criterion impact weights and indicator impact weights of the financial risk assessment system for import and export enterprises are obtained, as shown in the following table:
[0164]
[0165] From the above table, we can get the influence of each indicator from high to low, and express the comprehensive weight of each indicator with a histogram, such as Figure 5 shown.
[0166] Step S502: Evaluate the financial risk of the import and export enterprise using the secondary fuzzy evaluation method;
[0167] The step S502 uses a two-level fuzzy evaluation method to evaluate the financial risk of the import and export enterprise. The specific method is as follows:
[0168] In this embodiment, a two-level evaluation index set is first defined: the first-level evaluation index U Ⅰ =[asset-liability ratio, current ratio, quick ratio], secondary evaluation index U Ⅱ = [low risk, medium risk, high risk], and we get a decision matrix Y, where y ij It represents the performance of the i-th evaluation indicator on the j-th evaluation set.
[0169] Given three evaluation indicators and three evaluation sets, the decision matrix is as follows:
[0170]
[0171] Then calculate the membership matrix of each indicator, and the trapezoidal membership function is defined as:
[0172]
[0173] Given the membership function parameters: a = 0.2, b = 0.35, c = 0.55, d = 0.7, the membership function μ(x) is used to calculate the membership of each evaluation object at each evaluation level, and the membership matrix R is as follows:
[0174]
[0175] In order to ensure that the column vector of the membership matrix is a valid membership distribution, the membership vector of each object is normalized so that the membership values of each row add up to 1;
[0176] Finally, a two-level evaluation system is constructed, and the first-level fuzzy evaluation system is:
[0177]
[0178] In the first-level fuzzy evaluation system M 1 Based on it, it is multiplied by the transpose of the index weight vector to obtain the corresponding two-level fuzzy evaluation system M 2 :
[0179]
[0180] From the above calculation results, it can be found that there is a 24.4% chance that the financial risk is at a good level, a 4.5% chance that it is at an average level, and a 16.2% chance that it is at a low level.
[0181] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0182] A person skilled in the art may understand that all or part of the steps of the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0183] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0184] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0185] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.
Claims
1. A method for predicting financial risks of import and export enterprises based on spatiotemporal graph neural network, characterized by: The method comprises the following steps: Step S1: Collect and obtain financial data of different enterprises, build an enterprise risk indicator system to obtain a long-term financial risk prediction data set for import and export enterprises; Step S2: preprocessing and cleaning the acquired enterprise financial data set to obtain risk prediction training and verification data; Step S3: Divide the risks into internal and external risks of the enterprise, extract the multi-scale features of the company's financial indicators with the enterprise as the node, and construct a spatiotemporal graph neural network; Step S4: Optimize the parameters and weights of the spatiotemporal graph neural network model using the particle swarm algorithm to obtain the enterprise financial risk prediction results; Step S5: Based on the enterprise financial risk prediction results, construct an import and export enterprise risk assessment model.
2. The method for predicting financial risks of import and export enterprises based on spatiotemporal graph neural network according to claim 1 is characterized by: The step S1 specifically includes: Step S101: Acquire financial information of multiple import and export industry fields; Step S102: extracting, cleaning, and summarizing the collected data in multiple fields to obtain a structured data set; Step S103: Construct a risk indicator system based on the collected data in multiple fields.
3. The method for predicting financial risks of import and export enterprises based on spatiotemporal graph neural network according to claim 1 is characterized by: The step S2 comprises: Step S201: Processing missing values of the collected financial data in multiple fields; Step S202: Based on the outliers in the sample data collected in S201, data preprocessing is required before training the model; Step S203: Reduce the dimension of the data through linear transformation, eliminate redundant feature variables, and construct a data set for the financial risk prediction model of import and export enterprises; in data sample division, randomly select a part of the data as a training set and another part of the data as a test set.
4. The method for predicting financial risks of import and export enterprises based on spatiotemporal graph neural network according to claim 1 is characterized by: The step S3 comprises: Step S301: constructing an external hypergraph of the enterprise and an internal risk heterogeneous graph of the enterprise based on the enterprise financial risk indicator system; Step S302: Based on step S301, a multi-scale feature extraction module is constructed to obtain feature maps of different dimensions from the feature extraction network, merge features between high and low layers, and then independently perform prediction operations; use two convolution kernels of different sizes to extract features of the top layer, fuse the extracted image features, and extract semantic feature information from different financial indicator combinations; Step S303: construct an enterprise risk encoder, which consists of two sub-modules: using the enterprise external hypergraph to construct the HGNN module, and using the internal risk heterogeneous graph to construct the RGNN module; Step S304: fusing the vectors encoded by the HGNN and RGNN modules and inputting them into the decoder to obtain a preliminary enterprise risk prediction result; The specific method of constructing the enterprise external hypergraph and the enterprise internal risk heterogeneous graph in step S301 is as follows: First, the enterprise external hypergraph is defined as G h =(V h ,E,η h ), where V h represents the set of import and export enterprises and their related enterprise nodes, E = {e h 1 ,e h 2 ,…,e h n } represents the hyperedge set of inter-enterprise relations, η h ={ω1,ω2,…,ω m } represents the set of hyperedge types, and |η h |>1, hyperedge mapping function π:π(e h i )∈η h ; The relationship between enterprise nodes is represented by the association matrix It is expressed as follows: The elements are defined as: Then, we construct a risk heterogeneity graph within the enterprise, defined as G r =(V r ,L r ,T r ,R r ,W r ), where V r Respectively represent the set of different risk nodes within the enterprise, L r represents the link set; T r Represents the node type mapping function: V r →T r , R r Indicates link type mapping function: L r →R r ; Each node v∈V r Belongs to the node type set T r A specific type of r Indicates; W r represents the edge weight matrix.
5. The method for predicting financial risks of import and export enterprises based on spatiotemporal graph neural network according to claim 1 is characterized by: The step S4 comprises: Step S401: Initialize the spatiotemporal graph neural network structure GNN of step S3, and set parameters such as the number of neurons in each layer of the network, the number of network layers, and the learning rate; Step S402: Initialize the number of particles and the speed and position of each particle. The position of the particle corresponds to the weight and threshold in the GNN network. The speed and position calculation formula of the particle is as follows: v i t+1 =w*v i t +c1*rand(pb i -x i t )+c2*rand(gb i -x i t ) x i t+1 =x i t +v i t+1 in, is the velocity of particle i at time t, x i t is the position of particle i at time t, pb i is the individual optimal position of particle i, gb i is the global optimal position of particle i, w is the inertia weight, c1 and c2 are cognitive parameters and social parameters respectively, and rand() represents a random number in the interval [0,1]; Step S403: Use the loss function of the GNN network as the fitness function to calculate the fitness of each particle; for each sample, first input a particle, perform forward calculation through the GNN network, and calculate the error between the network output value and the actual value; use the same method to calculate the error of all samples, and calculate the mean square error of all samples as the fitness of the particle; add more particles until the fitness of all particles is calculated; in the forward propagation calculation of the GNN network model, the hidden layer uses the ReLu() function, and the output layer uses the linear function; Step S404: Update individual extreme values and global optimal extreme values, compare fitness, and determine the individual extreme value point and global optimal extreme value point of each particle; Step S405: updating the position and velocity of each particle according to the individual extreme value and the global optimal extreme value; Step S406: Calculate the global optimal extreme point; Step S407: Compare whether the number of iterations reaches the maximum number of iterations or whether the value of step S406 meets the set accuracy requirement. If the preset accuracy is met, the optimal solution is output and the GNN network weights are updated. Otherwise, return to step S403 and the algorithm continues to iterate.
6. The method for predicting financial risks of import and export enterprises based on spatiotemporal graph neural network according to claim 1 is characterized by: The step S5 comprises: Step S501: Determine the weight of the financial risk assessment indicator based on the enterprise financial risk prediction result obtained in step S4; Step S502: Evaluate the financial risk of the import and export enterprise using the secondary fuzzy evaluation method.
7. The method for predicting financial risks of import and export enterprises based on spatiotemporal graph neural network according to claim 4 is characterized by: The step S303 constructs an enterprise risk encoder, which consists of two submodules: an HGNN module is constructed using an external hypergraph of the enterprise, and an RGNN module is constructed using an internal risk heterogeneous graph; The specific steps of constructing the HGNN module are as follows: first, extract the feature vectors between enterprises according to the external hypergraph of the enterprise constructed in step S301, and calculate the hypergraph convolution module θ h , the formula is as follows: Among them, D x represents the node degree matrix, which represents the number of hyperedges connecting each node. is the hypergraph type η h The correlation matrix, T represents the transpose of the matrix, W is the node weight matrix, D h is the hyperedge degree matrix, representing the number of nodes contained in each hyperedge, and Att() is the graph attention mechanism, which dynamically learns the importance of interactions between different nodes; is the hypergraph type η at the l+1th layer h The learning representation is, I is the identity matrix, W h is the parameter matrix of hypergraph convolution, is another hypergraph convolution module with different adjacency or hyperedge definitions. α is a learnable parameter used to balance the features of the two scales. Then, different types of hypergraph convolutional feature representations are aggregated as follows: Among them, L i is the comprehensive representation of the hypergraph learned by enterprise i, ε is a trainable parameter, ω m Represents different types of hypergraphs, q i Represents the hypergraph ω m The importance of the i-th enterprise node; The specific steps of constructing the RGNN module are as follows: first, initialize the enterprise node and the relevant enterprise internal risk indicator nodes, then perform conversion according to the node type, and project the enterprise node and financial risk node representation into the same representation space. The formula is as follows: in, For node v i The new representation, that is, the representation obtained after the improved transformation, H i is the original node representation, For node v i The trainable weight matrix is used to linearly transform the original node representation, introduce the nonlinear transformation ReLU() to enhance the nonlinear expression ability of the node representation, and then weight the transformed node representation through the attention mechanism Att() to take into account the node v i The interaction relationship between nodes and their neighboring nodes; the attention mechanism can adjust the weights according to the correlation between nodes, so that more relevant neighboring nodes have a greater influence on the representation of the current node; Then, the meta-path-based encoder learns the importance between the node and its neighbors, which is represented by the attention coefficient. It fuses the neighbor node information to get the representation of the current node. The calculation method of the attention coefficient is as follows: Among them, α ij is the attention coefficient from node j to node i, exp() represents the exponential function, N i is the set of neighbor nodes of node i, represents a shared linear transformation of each node, W represents the weight matrix, Represents node v i New representation, express The new representation of the neighbor nodes, LeRelu() is the activation function; In order to fully capture the risk information implicit in different relationships, a multi-head attention mechanism is used, that is, S independent attention mechanisms are used to calculate the hidden state: Q i =W q ·H i +b q K i =W k ·a ij +b k V i =W v ·H i +b v in, represents the hidden state corresponding to the risk information of node i, W q , W k , W v ∈R d×d is the trainable matrix, b q 、b k 、b v ∈R d is the bias of node i in other node relations, and λ is a trainable parameter used to adjust the learning importance; similarly, the softmax() function is used to normalize the learned attention and aggregate node relationship representation H i ', as shown below: Among them, || represents the aggregation operation of node relationship; Finally, the risk information of the heterogeneous graph is obtained as follows: Among them, F i is the final risk information of node i, η is the learning weight matrix that balances the aggregated risk information and the initial risk information of the node, and ζ is the activation function.
8. The method for predicting financial risks of import and export enterprises based on spatiotemporal graph neural network according to claim 4 is characterized by: The step S304 fuses the vectors encoded by the HGNN and RGNN modules and inputs them into the decoder to obtain the enterprise risk prediction result. The specific steps are as follows: First, the propagation risks of HGNN and RGNN are added together and the total risk information is calculated as follows: Among them, R i total is the total risk information, w total is a trainable weight matrix; Then, in order to enhance the predictive ability of the decoder in the decoding stage, the total risk information R i total Input into the GRU (Gated Recurrent Unit) network as shown below: d i t =GRU(d i t-1 ,GR i t ,W d ) Among them, d i t represents the node hidden state vector of GRU network node i at time t, W d Represents the weight of the GRU network. The hidden state vector output by the GRU network is input into the linear layer to obtain the final prediction result of each risk node: y i t =δ(d i t ,W δ ) Among them, y i t represents the final risk point prediction result, δ(·) represents the linear layer, and W δ are the weights of the linear layer.
9. The method for predicting financial risks of import and export enterprises based on spatiotemporal graph neural network according to claim 6 is characterized by: The specific method for determining the weights of financial risk assessment indicators is as follows: First, a hierarchical structure of financial risk is constructed to divide decision-making issues into three layers from top to bottom: the target layer, the criteria layer, and the plan layer; Then, an importance comparison matrix is established. For each criterion layer in the hierarchical structure, the criteria are compared pairwise, and their relative importance is quantified using a scale of 1 to m, where m is a constant representing relative importance. Based on the above comparison, a matrix is constructed, and each element a of the matrix is ij Indicates the importance of criterion i relative to criterion j. If i and j are equally important, a ij =1; if i is more important than j, then a ij Greater than 1 and less than or equal to m; If j is more important, then a ij will be the inverse of the ratio of their importance, and finally the importance comparison matrix at different levels is obtained. The corresponding importance comparison matrix A can be expressed as follows: For each row of matrix A, calculate the geometric mean E of all elements i , E i Normalized to get the calculated weight B i as follows: Where i = 1, 2, ..., n, n represents the size of the matrix A; The following formula is used to calculate the weight of the index value of the i-th evaluation object under the j-th index: Calculate the entropy value S for the standardized value of each indicator j , as shown below: Among them, ρ ij is the standardized value of the i-th evaluation object on the j-th indicator, and k is a constant Calculate the coefficient of difference G of the jth indicator j and weight w j , as shown below: Finally, the weight set is: in: W i =λ*B i +(1-λ*w j )。 10. The method for predicting financial risks of import and export enterprises based on spatiotemporal graph neural network according to claim 6 is characterized by: The step S502 uses a two-level fuzzy evaluation method to evaluate the financial risk of the import and export enterprise. The specific method is as follows: First, define a two-level evaluation index set: the first-level evaluation index U Ⅰ =[u1 Ⅰ ,u2 Ⅰ ,…,u n Ⅰ ], secondary evaluation index U Ⅱ =[u1 Ⅱ ,u1 Ⅱ ,…,u n Ⅱ ], the corresponding evaluation set is: V = [V1, V2, …, V m ], establish the decision matrix Y, where y ij It represents the evaluation result of the i-th evaluation index on the j-th evaluation set: Then, the membership matrix of each indicator is calculated, and the trapezoidal membership function is defined as: When x is less than a or greater than d, the membership is 0; when x is between a and b, the membership increases linearly from 0 to 1; when x is between b and c, the membership remains at 1; when x is between c and d, the membership decreases linearly from 1 to 0; The process of calculating the membership of each evaluation object at each evaluation level is as follows: For each indicator value y of each evaluation object Y ij , substitute the above trapezoidal membership function μ(x) to calculate its membership at each evaluation level, and arrange the membership of all evaluation objects into a matrix in the following format: Where n is the number of evaluation objects; in order to ensure that the column vector of the membership matrix is a valid membership distribution, the membership vector of each object is normalized so that the membership value of each row adds up to 1; Finally, a two-level evaluation model is constructed, and the first-level fuzzy evaluation model is: In the first-level fuzzy evaluation model M 1 Based on it, multiply it by the transpose of the index weight vector to obtain the corresponding secondary fuzzy evaluation model M 2 :
Citation Information
Cited By
Transaction card swiping early warning method and device based on AI identification
CN119398787A
Energy system fault prediction method based on knowledge graph
CN119494467A
Enterprise default prediction method and system based on meta-path denoising and capsule network modeling
CN120069518A
High-voltage switch cabinet with intelligent safety device and control method
CN120109660A
Financial risk dynamic prediction method based on deep learning
CN120278527A
