Artificial intelligence-based financial risk identification method and system
By constructing a financial knowledge graph and graph neural network, and integrating financial data with public opinion text, the problems of lagging risk identification and high false alarm rate in existing technologies have been solved, and high-precision dynamic identification of corporate financial risks has been achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-01
- Publication Date
- 2026-07-03
AI Technical Summary
Existing technologies rely on static financial indicators and simple linear logic, making it difficult to effectively handle unstructured market sentiment information. They also ignore the complex guarantee chains and implicit supply chain relationships between enterprises, resulting in delayed risk identification and a high false alarm rate.
An AI-based financial risk identification method is adopted. By constructing a financial knowledge graph, combining a BERT pre-trained language model and a graph neural network, and integrating structured financial data with unstructured public opinion text, non-linear correlation features are captured to generate risk representation vectors. Finally, logistic regression is used to generate risk warning signals.
It enables high-precision dynamic identification of potential and sudden risks, breaks down information silos, and improves the accuracy and timeliness of risk identification.
Smart Images

Figure CN121961761B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of financial data processing technology, and in particular to a method and system for identifying financial risks based on artificial intelligence. Background Technology
[0002] The field of financial data processing technology encompasses the general technical scope of collecting, cleaning, analyzing, and mining massive amounts of financial business data using computer systems and algorithm models. Its core lies in revealing the potential patterns and value in financial activities through digital means. Traditional financial risk identification methods involve calculating key financial indicators such as current ratio, quick ratio, and debt-to-equity ratio based on static financial reports like balance sheets and income statements using manual auditing or basic statistical software. These indicators are then combined with Altman Z-score models or simple linear regression algorithms to score and rate the company's current financial health.
[0003] However, existing technologies rely too heavily on static financial indicators and simple linear logic, making it difficult to effectively handle unstructured market sentiment information. They also ignore the complex implicit relationships between enterprises, such as guarantee chains and supply chains. As a result, when faced with risks concealed by complex transaction methods or sudden public opinion shocks, they cannot capture the non-linear transmission path of risks in the network in a timely manner, resulting in problems of identification lag and high false alarm rate. Summary of the Invention
[0004] The purpose of this invention is to address the shortcomings of existing technologies by proposing an artificial intelligence-based method and system for identifying financial risks.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: a financial risk identification method based on artificial intelligence, comprising the following steps:
[0006] S1: Obtain the company's financial statement data and market sentiment text data, perform noise reduction and standardization processing on the financial statement data to generate financial feature vectors, and use the BERT pre-trained language model to perform semantic parsing and sentiment judgment on the market sentiment text data to generate sentiment semantic embedding vectors.
[0007] S2: Construct a financial knowledge graph, establish enterprise entity nodes and business relationship edges in the financial knowledge graph, map the financial feature vector and the public opinion semantic embedding vector to the entity nodes, construct a node attribute matrix, and generate an edge weight matrix based on transaction amount and sentiment intensity.
[0008] S3: Input the financial knowledge graph, the node attribute matrix and the edge weight matrix into the graph neural network model, and use the graph attention mechanism layer to perform weighted message passing and feature aggregation operations between entity nodes to capture non-linear correlation features and generate risk representation vectors.
[0009] S4: Input the risk representation vector into the fully connected classification layer to perform logistic regression operation, calculate the financial risk probability value, compare the financial risk probability value with the risk warning threshold, and generate a risk warning signal if the result exceeds the risk warning threshold.
[0010] As a further aspect of the present invention, step S1 specifically comprises:
[0011] S11: Collect multidimensional financial statement data, including balance sheet, income statement and cash flow statement, from the enterprise resource planning system; fill missing values in the data using the median imputation method; perform dimensionless processing on the numerical data using the Z-Score standardization method; perform dimensionality reduction operation on the processed data using the principal component analysis algorithm; extract principal component features with a contribution rate exceeding a preset ratio; and generate the financial feature vector.
[0012] S12: Use web crawler technology to crawl news reports, social media comments and industry analysis reports related to the target company, use the Transformer encoder of the BERT pre-trained language model to perform bidirectional contextual semantic encoding on the cleaned text data, obtain the output vector of the CLS special marker position as the syntactic feature representation, and combine it with the sentiment classification layer to calculate the sentiment polarity score of the text to generate the public opinion semantic embedding vector.
[0013] As a further aspect of the present invention, step S2 specifically comprises:
[0014] S21: Define enterprise entities, supplier entities, customer entities and financial institution entities based on the ontology model in the financial field. Create multiple types of business relationship edges between the entities based on actual business transaction records, including equity investment relationships, supply chain transaction relationships and guarantee relationships. Use the financial feature vector as the inherent attribute of the enterprise entity and the public opinion semantic embedding vector as the dynamic attribute to the corresponding entity node to construct the node attribute matrix.
[0015] S22: Analyze the historical transaction data corresponding to each of the business relationship edges to extract the cumulative transaction amount value, and at the same time obtain the sentiment polarity score of the associated text data. Use a weighted fusion algorithm to calculate the degree of influence of each of the business relationship edges on risk propagation. Quantify and assign values to the connection strength between each node according to the magnitude of the degree of influence, and establish the edge weight matrix.
[0016] As a further aspect of the present invention, step S3 specifically comprises:
[0017] S31: Input the node attribute matrix and the edge weight matrix into the multi-layer graph convolutional layer of the graph neural network, use the message passing mechanism to drive each entity node to aggregate the feature information of its first-order neighbor nodes, dynamically adjust the contribution ratio of the neighbor node features according to the edge weights during the aggregation process, and transform the aggregated features through a non-linear activation function to generate intermediate layer node features.
[0018] S32: Calculate the attention coefficients between the current node and all its neighboring nodes using the graph attention mechanism layer. Based on the attention coefficients, perform a weighted summation on the feature vectors of the neighboring nodes. Concatenate the weighted summation result with the feature vector of the current node itself and perform a linear transformation. Through parallel computation and result concatenation of the multi-head attention mechanism, capture long-distance dependencies and high-order nonlinear association features across the entire graph to generate the risk representation vector.
[0019] As a further aspect of the present invention, step S4 specifically comprises:
[0020] S41: Input the risk representation vector into a classification network consisting of multiple fully connected layers and Dropout layers, map the network output value to a continuous interval between zero and one using the Sigmoid activation function, calculate the probability value of the target company experiencing a financial crisis using model parameters trained and optimized with historical default data, and generate the financial risk probability value.
[0021] S42: Obtain the preset risk warning threshold, calculate the difference between the financial risk probability value and the risk warning threshold. If the difference is positive, determine that the enterprise is in a high-risk state. Match the corresponding risk level label according to the size of the difference, and trigger an alarm command containing risk type, risk source node and risk level information to generate the risk warning signal.
[0022] As a further aspect of the present invention, the quantification and assignment process of the degree of correlation specifically includes:
[0023] The cumulative transaction amount, the sentiment polarity score, and the preset business type influence factor are obtained. Based on the preset mixed weight calculation formula, the normalized value of the transaction amount and the absolute value of the sentiment score are weighted and summed using the business type influence factor to calculate the comprehensive weight value of the business relationship edge and generate the edge weight matrix.
[0024] The specific formula for calculating the mixed weight is as follows:
[0025] ;
[0026] in, This represents the combined weight value between node i and node j. This represents the preset impact factor of the business type. This represents the cumulative transaction amount between node i and node j. This represents the maximum single transaction amount in the entire network. The sentiment polarity score represents the text associated with node i and node j.
[0027] As a further aspect of the present invention, the calculation process of the attention coefficient specifically includes:
[0028] The feature vectors of the current node and its neighboring nodes are obtained. The feature vectors are linearly transformed using a learnable weight matrix. The transformed feature vectors are concatenated and processed through a single-layer feedforward neural network. The original attention values are calculated using the LeakyReLU activation function, and the original attention values of all neighboring nodes are normalized using the Softmax function to generate attention coefficients.
[0029] The specific formula for calculating the attention coefficient is as follows:
[0030] ;
[0031] in, This represents the initial attention value of node i to its neighbor node j. This represents the weight vector of a single-layer feedforward neural network. Represents the learnable weight matrix. The feature vector representing the current node i. The feature vector representing neighbor node j, This represents a vector concatenation operation.
[0032] As a further aspect of the present invention, the bidirectional context semantic encoding process specifically includes:
[0033] The cleaned text data is segmented at the character level and positional and paragraph encodings are added to construct an input embedding vector sequence. This sequence is then input into a multi-layer bidirectional Transformer encoder structure. A multi-head self-attention mechanism is used to calculate the semantic association strength between each character in the text and all other characters in parallel. Contextual information is dynamically aggregated based on the association strength to update the feature representation of each character and generate a context encoding vector.
[0034] As a further aspect of the present invention, the optimization process of the model parameters specifically includes:
[0035] Obtain a historical enterprise sample dataset containing labeled normal and default. Calculate the error between the financial risk probability value predicted by the model and the actual label using the cross-entropy loss function. Construct a total objective function by combining L2 regularization. Use the Adam optimization algorithm to backpropagate according to the gradient direction of the total objective function to update the weight parameters of the fully connected classification layer and the graph neural network layer until the convergence value of the total objective function is less than the preset tolerance threshold, thus establishing a classification network model.
[0036] An artificial intelligence-based financial risk identification system, the system being used to implement the aforementioned artificial intelligence-based financial risk identification method, the system comprising:
[0037] The data processing module is used to acquire the company's financial statement data and market sentiment text data, perform noise reduction and standardization processing on the financial statement data to generate financial feature vectors, and use the BERT pre-trained language model to perform semantic parsing and sentiment judgment on the market sentiment text data to generate sentiment semantic embedding vectors.
[0038] The graph construction module is used to construct a financial knowledge graph, establish enterprise entity nodes and business relationship edges in the financial knowledge graph, map the financial feature vector and the public opinion semantic embedding vector to the entity nodes, construct a node attribute matrix, and generate an edge weight matrix based on transaction amount and sentiment intensity.
[0039] The risk analysis module is used to input the financial knowledge graph, the node attribute matrix and the edge weight matrix into the graph neural network model, and use the graph attention mechanism layer to perform weighted message passing and feature aggregation operations between entity nodes to capture nonlinear correlation features and generate risk representation vectors.
[0040] The early warning generation module is used to input the risk representation vector into a fully connected classification layer to perform logistic regression operation, calculate the financial risk probability value, compare the financial risk probability value with the risk warning threshold, and generate a risk warning signal if the result exceeds the risk warning threshold.
[0041] Compared with the prior art, the advantages and positive effects of the present invention are as follows:
[0042] In this invention, by constructing a multimodal financial knowledge graph that integrates structured financial data and unstructured public opinion text, the information silos of a single data source are broken down, and the explicit financial status of enterprises is deeply correlated with implicit market sentiment. Through the unique message passing and attention aggregation mechanism of the graph neural network model, the transmission strength of risks in complex guarantee chains and supply chains can be automatically mined and quantified along the relational edges in the graph, thereby achieving high-precision dynamic identification of potential related risks and sudden risks. Attached Figure Description
[0043] Figure 1 This is a flowchart of the financial risk identification method based on artificial intelligence according to the present invention;
[0044] Figure 2 This is a flowchart illustrating the generation process of financial feature vectors and public opinion semantic embedding vectors in this invention.
[0045] Figure 3 This is a flowchart illustrating the financial knowledge graph construction and matrix generation process of this invention.
[0046] Figure 4 This is a flowchart of the risk characterization vector generation process of the present invention;
[0047] Figure 5 This is a flowchart of the financial risk probability calculation and early warning process of the present invention. Detailed Implementation
[0048] To make the objectives, technical solutions, and advantages of this invention clearer, the software-based technical solution is described in detail below with reference to system architecture diagrams and embodiments. It should be understood that the specific embodiments described herein are only for explaining the technical solutions of this invention and do not constitute a limitation on the scope of protection.
[0049] In the description of this invention, the system architecture relationships or data processing flows indicated by terms such as "layer," "module," "interface," "data flow," "client," and "server" are all defined based on the architecture diagram or flowchart corresponding to the embodiments. This way of describing is only used to clearly illustrate the logical relationships between the elements in the technical solution, and not to limit the physical deployment form. The term "multiple" includes two or more technical units, including but not limited to multiple data nodes, processing threads, service instances, or functional components and other scalable elements. The specific number is determined according to the actual business scenario and needs to be specifically specified.
[0050] Please see Figure 1 and Figure 2 This invention provides a technical solution: a financial risk identification method based on artificial intelligence, comprising the following steps:
[0051] S1: Obtain the company's financial statement data and market sentiment text data, perform noise reduction and standardization on the financial statement data to generate financial feature vectors, and use the BERT pre-trained language model to perform semantic parsing and sentiment judgment on the market sentiment text data to generate sentiment semantic embedding vectors.
[0052] S11: Collect multidimensional financial statement data, including balance sheet, income statement and cash flow statement, from the enterprise resource planning system. Use the median imputation method to fill in the missing values in the data, and use the Z-Score standardization method to perform dimensionless processing on the numerical data. Use the principal component analysis algorithm to perform dimensionality reduction on the processed data, extract the principal component features with a contribution rate exceeding the preset ratio, and generate financial feature vectors.
[0053] S12: Use web crawling technology to crawl news reports, social media comments and industry analysis reports related to the target company. Use the Transformer encoder of the BERT pre-trained language model to perform bidirectional contextual semantic encoding on the cleaned text data, obtain the output vector of the CLS special marker position as the syntactic feature representation, and combine it with the sentiment classification layer to calculate the sentiment polarity score of the text and generate the public opinion semantic embedding vector.
[0054] The process of bidirectional context semantic encoding specifically includes:
[0055] The cleaned text data is segmented at the character level and positional and paragraph encodings are added to construct an input embedding vector sequence. This sequence is then input into a multi-layer bidirectional Transformer encoder structure. A multi-head self-attention mechanism is used to calculate the semantic association strength between each character in the text and all other characters in parallel. Contextual information is dynamically aggregated based on the association strength to update the feature representation of each character and generate a context encoding vector.
[0056] By configuring database connection interfaces, the system directly accesses the target company's Enterprise Resource Planning (ERP) system database and publicly available financial data API interfaces. The data collection time window is set to the past 36 months. Structured raw financial statement data is extracted from the ERP system, while a multi-threaded web crawler is launched to scrape unstructured text data from designated financial news portals, social media platforms, and industry forums. During the acquisition process, each data record is tagged with a timestamp and source label, constructing a heterogeneous source dataset containing both structured numerical data and unstructured text. The acquired financial statement data undergoes denoising and standardization to generate financial feature vectors. A BERT pre-trained language model is then used to perform semantic parsing and sentiment analysis on the market sentiment text data, generating sentiment semantic embedding vectors.
[0057] This study utilizes Python's data analysis libraries to retrieve key fields from the balance sheet (total assets, total liabilities, current assets, current liabilities), income statement (revenue, net profit, operating costs), and cash flow statement (net cash flow from operating activities). The raw data undergoes a completeness check. For any missing values, the historical data distribution of that field over time is obtained, and the median value of that field over the past 12 months is calculated. This median is then directly assigned to the missing values to preserve the statistical characteristics of the data. Subsequently, Z-Score standardization is performed on all numerical fields. The mean and standard deviation of all historical data for each field are obtained. The current data is subtracted from the mean and divided by the standard deviation, uniformly mapping financial indicators of different magnitudes to a distribution interval with a mean of 0 and a standard deviation of 1. A standardized data matrix is constructed, its covariance matrix is calculated, and eigenvalue decomposition is performed. The eigenvalues are arranged in descending order, and the cumulative contribution rate is calculated. The cumulative contribution rate threshold is set at 95%. The eigenvectors corresponding to the top 15 eigenvalues are selected as principal components. The high-dimensional financial data is projected to a low-dimensional space through matrix multiplication to generate a financial feature vector with a dimension of 15.
[0058] The Z-Score standardization mentioned above refers to a data processing method that transforms raw data into standardized scores, and its formula is: ,in This is the original data. The population mean The standard deviation is the overall standard deviation. This processing is used to eliminate dimensional differences between different financial indicators, making the data comparable.
[0059] Table 1 Comparison of Financial Data Preprocessing
[0060] ;
[0061] As shown in Table 1, the system fills in the missing net profit using the median and eliminates the influence of dimensions through standardization. All standardized features participate in subsequent principal component analysis to generate core features.
[0062] Configure the Scrapy crawler framework, setting the target URL list to include Sina Finance, Eastmoney.com, and the company's official Weibo account. Set up a User-Agent pool in the request header to simulate access from different browsers, and use a dynamic IP proxy pool to circumvent anti-crawling strategies. Scrape news headlines, article content, comments, and PDF research reports from professional analysts containing keywords related to the target company's name. Use regular expressions to remove HTML tags, URL links, special characters, and stop words from the text. Load the pre-trained BERT-base-chinese model, truncate or pad the cleaned text to a fixed length of 512 tokens, and use the model's Transformer encoder to perform bidirectional contextual semantic encoding on the cleaned text data. Extract the 768-dimensional vector corresponding to the CLS token position from the output of the last layer of the BERT model as the syntactic feature representation of the entire sentence. Input this feature representation into a fully connected layer connected to the BERT output, and use the Softmax function to output the probability distribution of the text belonging to three classes: positive, negative, and neutral. The category with the highest probability is selected. If the category is "positive," the probability value is positive; if the category is "negative," the opposite probability value (negative value) is taken; if the category is "neutral," the value is assigned to 0. This process generates the sentiment polarity score. The 768-dimensional syntactic features are concatenated with the 1-dimensional sentiment polarity score to generate a 769-dimensional semantic embedding vector for public opinion.
[0063] The aforementioned bidirectional contextual semantic encoding refers to segmenting the cleaned text string at the character level, converting it into an ID sequence corresponding to the model vocabulary, adding positional encoding to each character ID to mark its relative position in the sequence, and adding paragraph encoding to distinguish different sentences, thus constructing an input embedding vector sequence. This sequence is then input into a 12-layer bidirectional Transformer encoder structure. Within each encoder layer, a multi-head self-attention mechanism with 12 attention heads is used to calculate the semantic association strength between each character in the text and all other characters in parallel. Attention scores are calculated by querying the vector matrix, key vector matrix, and value vector matrix. The value vectors are then weighted and summed based on the scores to dynamically aggregate contextual information to update the feature representation of each character. After processing through a 12-layer feedforward network and residual connections, a contextual encoding vector rich in deep semantic information is generated.
[0064] Please see Figure 1 and Figure 3 S2: Construct a financial knowledge graph, establish entity nodes and business relationship edges of enterprises in the financial knowledge graph, map financial feature vectors and public opinion semantic embedding vectors to entity nodes, construct a node attribute matrix, and generate an edge weight matrix based on transaction amount and sentiment intensity.
[0065] S21: Based on the ontology model in the financial field, define enterprise entities, supplier entities, customer entities, and financial institution entities. Based on actual business transaction records, create multiple types of business relationship edges between the entities, including equity investment relationships, supply chain transaction relationships, and guarantee relationships. Use financial feature vectors as inherent attributes of enterprise entities and use public opinion semantic embedding vectors as dynamic attributes to map to the corresponding entity nodes, thus constructing a node attribute matrix.
[0066] S22: Analyze the historical transaction data corresponding to each business relationship edge to extract the cumulative transaction amount value, and at the same time obtain the sentiment polarity score of the associated text data. Use a weighted fusion algorithm to calculate the degree of influence of each business relationship edge on risk propagation. Quantify the connection strength between each node according to the magnitude of the influence value and establish an edge weight matrix.
[0067] The process of quantifying the degree of correlation includes:
[0068] The system obtains the cumulative transaction amount, sentiment polarity score, and preset business type influence factor. Based on the preset mixed weight calculation formula, it uses the business type influence factor to perform a weighted sum of the normalized transaction amount and the absolute value of the sentiment score to calculate the comprehensive weight value of the business relationship edge and generate an edge weight matrix.
[0069] The specific formula for calculating the mixed weights is as follows:
[0070] ;
[0071] in, This represents the combined weight value between node i and node j. This represents the pre-defined business type influencing factor. This represents the cumulative transaction amount between node i and node j. This represents the maximum single transaction amount in the entire network. The sentiment polarity score represents the text associated with node i and node j.
[0072] Initialize the graph storage space in the graph database environment and define the graph schema. Establish enterprise entity nodes and business relationship edges in the financial knowledge graph. Map the 15-dimensional financial feature vector and 769-dimensional public opinion semantic embedding vector generated in the previous steps to the corresponding entity node IDs using the database UPDATE operation, constructing a node attribute matrix. Each row of this matrix corresponds to an entity node, and each column corresponds to a feature dimension. Calculate edge weight matrices based on transaction amount and sentiment intensity; this matrix is used for subsequent adjacency weighting in the graph neural network.
[0073] Based on the ontology model of the financial field, enterprise entities, supplier entities, customer entities, and financial institution entities are defined, and a unique label is assigned to each entity. The system connects to the enterprise's supply chain management system and customer relationship management system, extracting historical business transaction records. Directed edges are created between entities based on the interaction type in the records. If entity A holds shares in entity B, an equity investment edge is created; if entity A sells goods to entity B, a supply chain transaction edge is created; if entity A provides loan guarantees for entity B, a guarantee edge is created. Financial feature vectors are stored as static attributes in enterprise nodes, and sentiment semantic embedding vectors are mapped as time-varying time-series attributes to the corresponding entity nodes, completing the construction of the node attribute matrix.
[0074] The historical transaction data for the past 12 months corresponding to each business relationship edge is analyzed, and the transaction amount for each transaction is accumulated to extract the cumulative transaction amount. Simultaneously, all text data generated by the interactions between the nodes at both ends of the edge is retrieved, and the corresponding sentiment polarity scores are obtained. A weighted fusion algorithm is used to calculate the degree of impact of each business relationship edge on risk propagation, and the connection strength between each node is quantified and assigned according to the magnitude of the impact, establishing an edge weight matrix.
[0075] The process of quantifying the degree of correlation is executed as follows: The cumulative transaction amount between node i and node j is read from the database. Sentiment polarity score of the text associated with the two nodes Set the business type impact factor. This factor is set based on an expert experience base and is used to define supply chain transaction relationships. The value is 0.6, for setting equity investment relationships. The value is 0.8. This retrieves the maximum single transaction amount across the entire network. This value is obtained by filtering transaction records across all edges of the entire graph and is used for normalization. Substituting these parameters into a preset mixed-weight calculation formula, the normalized value of the transaction amount based on the business type influence factor is weighted and summed with the absolute value of the sentiment score to calculate the comprehensive weight value of the business relationship edge. Then, fill the value into the i-th row and j-th column of the edge weight matrix to generate the edge weight matrix.
[0076] The formula for calculating the mixed weights is: ;
[0077] in, This represents the combined weight value between node i and node j; This represents a preset business type influencing factor, used to adjust the weighting ratio between financial and sentiment indicators. This represents the cumulative transaction amount between node i and node j. Represents the maximum single transaction amount in the entire network; The sentiment polarity score represents the text associated with node i and node j. The absolute value representing the emotional polarity score.
[0078] The following is a practical example illustrating this formula: Setting the business type impact factor. The value is set at 0.6, based on the belief that in risk transmission, hard indicators of capital flow are more critical than sentiment indicators. The cumulative transaction amount between node A and node B is obtained from the dataset. The amount is 5,000,000 yuan. The largest single transaction amount was obtained by searching the entire network. The amount is 50,000,000 yuan. The sentiment polarity score of the associated text between node A and node B is calculated using the sentiment analysis module. The value is -0.8. Substituting the above value into the formula, we first calculate the normalized portion of the transaction amount: Calculate the absolute value of the sentiment score: Calculate the weighted sum: Finally, the combined weight value between node A and node B is obtained. The value was 0.38. This result indicates that by introducing the absolute value of sentiment polarity, the weight of the edge can be enhanced regardless of whether the sentiment is extremely positive or extremely negative. In risk identification scenarios, strong negative emotions imply a strong correlation between two entities, and risk can easily spread through this channel of high attention. Experimental data shows that compared to the method of constructing weights using only transaction amount, introducing sentiment weighting improved the recall rate of related enterprise default risk by 12%.
[0079] Please see Figure 1 and Figure 4 S3: Input the financial knowledge graph, node attribute matrix and edge weight matrix into the graph neural network model, and use the graph attention mechanism layer to perform weighted message passing and feature aggregation operations between entity nodes to capture nonlinear correlation features and generate risk representation vectors.
[0080] S31: Input the node attribute matrix and edge weight matrix into the multi-layer graph convolutional layer of the graph neural network. Use the message passing mechanism to drive each entity node to aggregate the feature information of its first-order neighbor nodes. During the aggregation process, dynamically adjust the contribution ratio of the neighbor node features according to the edge weights. Transform the aggregated features through a non-linear activation function to generate intermediate layer node features.
[0081] S32: Calculate the attention coefficients between the current node and all its neighboring nodes using the graph attention mechanism layer. Based on the attention coefficients, perform a weighted summation on the feature vectors of the neighboring nodes. Concatenate the weighted summation result with the feature vector of the current node itself and perform a linear transformation. Through parallel computation and result concatenation of the multi-head attention mechanism, capture long-distance dependencies and high-order nonlinear association features across the entire graph and generate a risk representation vector.
[0082] The calculation process for the attention coefficient specifically includes:
[0083] The feature vectors of the current node and its neighboring nodes are obtained. The feature vectors are linearly transformed using a learnable weight matrix. The transformed feature vectors are concatenated and processed through a single-layer feedforward neural network. The original attention values are calculated using the LeakyReLU activation function, and the original attention values of all neighboring nodes are normalized using the Softmax function to generate attention coefficients.
[0084] The formula for calculating the attention coefficient is as follows:
[0085] ;
[0086] in, This represents the initial attention value of node i to its neighbor node j. This represents the weight vector of a single-layer feedforward neural network. Represents the learnable weight matrix. The feature vector representing the current node i. The feature vector representing neighbor node j, This represents a vector concatenation operation.
[0087] A graph neural network environment based on the PyTorchGeometric framework was built. The constructed financial knowledge graph structure, node attribute matrix, and edge weight matrix were input into the graph neural network model. The model architecture was designed to include two layers of graph convolutional networks and one layer of graph attention networks. The graph attention mechanism layer was used to perform weighted message passing and feature aggregation operations between entity nodes, capturing non-linear correlation features and generating risk representation vectors.
[0088] The node attribute matrix and edge weight matrix are input into the first two layers of the graph neural network—multi-layer graph convolutional layers. Using a message passing mechanism, each entity node aggregates the feature information of its first-order neighbors. For any node v, the feature vectors of all its neighbors u are collected. These neighbor feature vectors are then multiplied by the corresponding weight values in the edge weight matrix and weighted. The weighted neighbor features are then summed. During the aggregation process, the contribution ratio of neighbor node features is dynamically adjusted according to the edge weights. The aggregation result is merged with the feature vector of node v itself, and the aggregated features are transformed using the ReLU non-linear activation function to increase the model's non-linear expressive power, generating intermediate layer node features.
[0089] The features of the intermediate-layer nodes are input into the third layer—the graph attention mechanism layer. This layer calculates the attention coefficient between the current node and all its neighbors. This coefficient reflects the difference in importance of neighboring nodes to the current node from a risk propagation perspective. The feature vectors of neighboring nodes are weighted and summed based on these attention coefficients, assigning greater weight to nodes representing significant risk sources. The weighted sum is then concatenated with the current node's own feature vector, and its dimensions are adjusted using a learnable linear transformation matrix. Through parallel computation and result concatenation using the multi-head attention mechanism, long-distance dependencies and high-order nonlinear associations across the entire graph are captured, generating the final risk representation vector for classification.
[0090] The attention coefficient calculation process is as follows: Obtain the feature vector of the current node i. The feature vector of neighbor node j Using a learnable weight matrix Perform a linear transformation on the eigenvectors. Then transform the eigenvectors... and The vectors are concatenated to obtain a combined vector. This combined vector is then input into a single-layer feedforward neural network, which consists of a weight vector. Parameterization. The output of the feedforward neural network is processed using the LeakyReLU activation function to calculate the original attention values. Finally, the Softmax function is used to normalize the original attention values of all neighboring nodes, ensuring that the sum of the coefficients of all neighbors is 1, thus generating the attention coefficients.
[0091] The formula for calculating the attention coefficient is: ;
[0092] in, This represents the initial attention value of node i to its neighbor node j; Represents a linear unit activation function with leakage correction; The weight vector representing a single-layer feedforward neural network is used to map high-dimensional concatenated features to scalars. This represents the transpose operation; Represents the learnable weight matrix; The feature vector representing the current node i; The feature vector representing neighbor node j; This represents a vector concatenation operation.
[0093] The following is a practical example illustrating this formula: Setting the weight matrix... It has been initialized through training, assuming the transformed feature vectors The feature vector of the neighboring node is [0.5, 0.2]. The vector is set to [0.1, 0.9]. A vector concatenation operation is performed, resulting in a concatenated vector [0.5, 0.2, 0.1, 0.9]. The weight vectors of the single-layer feedforward neural network are then defined. Given [0.1, 0.1, 0.5, 0.5]. Calculate the dot product: The result 0.57 is input into the LeakyReLU activation function. Since the value is positive, the output is still 0.57, which is the original attention value. The value is 0.57. Assume node i has only two neighbors j and k, where... , Normalization is performed using Softmax: . The final calculated attention coefficient of node i to its neighbor node j is 0.584. This result indicates that, within the current feature context, the influence weight of neighbor node j on the risk state of node i is 0.584, which is higher than that of neighbor node k (0.416). The model suggests that the features of node j should be of greater interest and aggregation to node i.
[0094] Please see Figure 1 and Figure 5 S4: Input the risk representation vector into the fully connected classification layer to perform logistic regression operation, calculate the financial risk probability value, compare the financial risk probability value with the risk warning threshold, and generate a risk warning signal if the result exceeds the risk warning threshold.
[0095] S41: Input the risk representation vector into a classification network consisting of multiple fully connected layers and Dropout layers. Use the Sigmoid activation function to map the network's output value to a continuous interval between zero and one. Calculate the probability value of the target company experiencing a financial crisis using model parameters trained and optimized with historical default data, and generate a financial risk probability value.
[0096] The optimization process for model parameters specifically includes:
[0097] Obtain a historical enterprise sample dataset containing labeled normal and default. Calculate the error between the financial risk probability value predicted by the model and the true label using the cross-entropy loss function. Construct the overall objective function by combining L2 regularization. Use the Adam optimization algorithm to backpropagate according to the gradient direction of the overall objective function to update the weight parameters of the fully connected classification layer and the graph neural network layer until the convergence value of the overall objective function is less than the preset tolerance threshold, thus establishing a classification network model.
[0098] S42: Obtain the preset risk warning threshold, calculate the difference between the financial risk probability value and the risk warning threshold. If the difference is positive, the enterprise is determined to be in a high-risk state. Match the corresponding risk level label according to the size of the difference, and trigger an alarm command containing risk type, risk source node and risk level information to generate a risk warning signal.
[0099] Construct an output module for a binary classification task. Input the risk representation vector generated in the previous steps into a fully connected classification layer to perform logistic regression. This classification layer maps high-dimensional graphical features to one-dimensional real-valued outputs and calculates the financial risk probability value. Compare the financial risk probability value with a preset risk warning threshold. If the result exceeds the risk warning threshold, a risk warning signal is generated.
[0100] The 64-dimensional risk representation vector output from the graph neural network is input into a classification network consisting of two fully connected layers and a Dropout layer. The first fully connected layer reduces the dimension from 64 to 32, followed by a Dropout layer with a dropout rate of 0.5 to prevent overfitting. The second fully connected layer reduces the dimension from 32 to 1. A sigmoid activation function maps the network's final output value to a continuous interval of 0 to 1, directly representing the probability of the target company experiencing a financial crisis, thus generating a financial risk probability value. The probability value of the target company experiencing a financial crisis is calculated using model parameters trained and optimized with historical default data.
[0101] The Dropout layer mentioned above refers to a regularization technique that temporarily discards neural network units with a certain probability during neural network training, making them temporarily inactive, in order to reduce the co-adaptation relationship between nodes and enhance the model's generalization ability.
[0102] The optimization process for model parameters is as follows: A historical dataset containing samples of companies labeled as normal and defaulting over the past 5 years is obtained. This dataset is then divided into training, validation, and test sets in an 8:1:1 ratio. During training, the error between the model's predicted financial risk probability and the true label is calculated using the binary cross-entropy loss function. To prevent overfitting due to excessively large model parameters, an L2 regularization term is added to the loss function, with a weight decay coefficient set to... Construct the overall objective function. Utilize the Adam optimization algorithm, setting the initial learning rate to... The weight parameters of the fully connected classification layer and the graph neural network layer are updated via backpropagation based on the gradient direction of the overall objective function. A maximum of 200 iterations is set, and an early stopping mechanism is introduced: training stops when the loss value on the validation set no longer decreases for 10 consecutive epochs. This continues until the convergence value of the overall objective function is less than a preset tolerance threshold. Save the current optimal parameters and build a classification network model.
[0103] The system retrieves a preset risk warning threshold from the system configuration file. This threshold is derived through analysis of the receiver operating characteristic curves (ROCs) of historical test data, with the probability value corresponding to the maximum Youden index selected as the optimal threshold, set to 0.75. The difference between the financial risk probability value output by the model and the risk warning threshold is calculated. If the difference is positive, the enterprise is determined to be in a high-risk state. The corresponding risk level label is matched based on the magnitude of the difference. Probability values in the range [0.75, 0.85) are marked as yellow warnings, [0.85, 0.95) as orange warnings, and [0.95, 1.00] as red warnings. Once a risk is determined, an alarm command containing information on the risk type, risk source node, and risk level is immediately triggered. The alarm information is encapsulated in a JSON format data packet and pushed to the management terminal of the risk control personnel, generating a risk warning signal.
[0104] Table 2 Risk Warning and Response Classification Table
[0105] ;
[0106] As shown in Table 2, the system implements differentiated risk control measures based on specific probability intervals to ensure that resources are focused on high-risk targets.
[0107] An AI-based financial risk identification system is used to execute the aforementioned AI-based financial risk identification method. The system includes:
[0108] The data processing module is used to acquire the company's financial statement data and market sentiment text data, perform noise reduction and standardization on the financial statement data to generate financial feature vectors, and use the BERT pre-trained language model to perform semantic parsing and sentiment judgment on the market sentiment text data to generate sentiment semantic embedding vectors.
[0109] The graph construction module is used to build a financial knowledge graph. It establishes enterprise entity nodes and business relationship edges in the financial knowledge graph, maps financial feature vectors and public opinion semantic embedding vectors to entity nodes, constructs a node attribute matrix, and generates an edge weight matrix based on transaction amount and sentiment intensity.
[0110] The risk analysis module is used to input the financial knowledge graph, node attribute matrix and edge weight matrix into the graph neural network model, and use the graph attention mechanism layer to perform weighted message passing and feature aggregation operations between entity nodes to capture non-linear correlation features and generate risk representation vectors.
[0111] The early warning generation module is used to input the risk representation vector into the fully connected classification layer to perform logistic regression operation, calculate the financial risk probability value, compare the financial risk probability value with the risk warning threshold, and generate a risk warning signal if the result exceeds the risk warning threshold.
[0112] The above embodiments illustrate preferred embodiments of the present invention. Any equivalent adjustments to the technical solution based on software engineering methods are within the scope of protection, including but not limited to: implementing algorithm logic using different programming languages, refactoring functional modules into services, adjusting data interaction protocols, and optimizing resource scheduling strategies. Any implementation scheme derived from reasonable modifications to the data processing flow, service call chain, or system architecture layer without departing from the core technology of the present invention should be considered within the protection scope defined by the technical solution of the present invention.
Claims
1. A financial risk identification method based on artificial intelligence, characterized in that, Includes the following steps: S1: Obtain the company's financial statement data and market sentiment text data, perform denoising and standardization processing on the financial statement data to generate financial feature vectors, use the BERT pre-trained language model to perform semantic parsing and sentiment judgment on the market sentiment text data, calculate the sentiment polarity score of the text, and generate sentiment semantic embedding vectors. S2: Construct a financial knowledge graph, establish enterprise entity nodes and business relationship edges in the financial knowledge graph, map the financial feature vector and the public opinion semantic embedding vector to the entity nodes, construct a node attribute matrix, and generate an edge weight matrix based on transaction amount and sentiment intensity. The specific steps of S2 are as follows: S21: Define enterprise entities, supplier entities, customer entities and financial institution entities based on the ontology model in the financial field. Create multiple types of business relationship edges between the entities based on actual business transaction records, including equity investment relationships, supply chain transaction relationships and guarantee relationships. Use the financial feature vector as the inherent attribute of the enterprise entity and the public opinion semantic embedding vector as the dynamic attribute to the corresponding entity node to construct the node attribute matrix. S22: Analyze the historical transaction data corresponding to each of the business relationship edges to extract the cumulative transaction amount value, and at the same time obtain the sentiment polarity score of the associated text data. Use a weighted fusion algorithm to calculate the degree of influence of each of the business relationship edges on risk propagation. Quantify the connection strength between each node according to the magnitude of the degree of influence and establish the edge weight matrix. The quantification and assignment process for the degree of correlation specifically includes: The cumulative transaction amount, the sentiment polarity score, and the preset business type influence factor are obtained. Based on the preset mixed weight calculation formula, the normalized value of the transaction amount and the absolute value of the sentiment score are weighted and summed using the business type influence factor to calculate the comprehensive weight value of the business relationship edge and generate the edge weight matrix. The specific formula for calculating the mixed weight is as follows: ; in, This represents the combined weight value between node i and node j. This represents the preset impact factor of the business type. This represents the cumulative transaction amount between node i and node j. This represents the maximum single transaction amount in the entire network. The sentiment polarity score representing the text associated between node i and node j; S3: Input the financial knowledge graph, the node attribute matrix and the edge weight matrix into the graph neural network model, and use the graph attention mechanism layer to perform weighted message passing and feature aggregation operations between entity nodes to capture non-linear correlation features and generate risk representation vectors. S4: Input the risk representation vector into the fully connected classification layer to perform logistic regression operation, calculate the financial risk probability value, compare the financial risk probability value with the risk warning threshold, and generate a risk warning signal if the result exceeds the risk warning threshold.
2. The method for identifying financial risks based on artificial intelligence according to claim 1, characterized in that, The specific steps of S1 are as follows: S11: Collect multidimensional financial statement data, including balance sheet, income statement and cash flow statement, from the enterprise resource planning system; fill missing values in the data using the median imputation method; perform dimensionless processing on the numerical data using the Z-Score standardization method; perform dimensionality reduction operation on the processed data using the principal component analysis algorithm; extract principal component features with a contribution rate exceeding a preset ratio; and generate the financial feature vector. S12: Use web crawler technology to crawl news reports, social media comments and industry analysis reports related to the target company, use the Transformer encoder of the BERT pre-trained language model to perform bidirectional contextual semantic encoding on the cleaned text data, obtain the output vector of the CLS special marker position as the syntactic feature representation, and combine it with the sentiment classification layer to calculate the sentiment polarity score of the text to generate the public opinion semantic embedding vector.
3. The method for identifying financial risks based on artificial intelligence according to claim 1, characterized in that, The specific steps of S3 are as follows: S31: Input the node attribute matrix and the edge weight matrix into the multi-layer graph convolutional layer of the graph neural network, use the message passing mechanism to drive each entity node to aggregate the feature information of its first-order neighbor nodes, dynamically adjust the contribution ratio of the neighbor node features according to the edge weights during the aggregation process, and transform the aggregated features through a non-linear activation function to generate intermediate layer node features. S32: Calculate the attention coefficients between the current node and all its neighboring nodes using the graph attention mechanism layer. Based on the attention coefficients, perform a weighted summation on the feature vectors of the neighboring nodes. Concatenate the weighted summation result with the feature vector of the current node itself and perform a linear transformation. Through parallel computation and result concatenation of the multi-head attention mechanism, capture long-distance dependencies and high-order nonlinear association features across the entire graph to generate the risk representation vector.
4. The method for identifying financial risks based on artificial intelligence according to claim 1, characterized in that, The specific steps of S4 are as follows: S41: Input the risk representation vector into a classification network consisting of multiple fully connected layers and Dropout layers, map the network output value to a continuous interval between zero and one using the Sigmoid activation function, calculate the probability value of the target company experiencing a financial crisis using model parameters trained and optimized with historical default data, and generate the financial risk probability value. S42: Obtain the preset risk warning threshold, calculate the difference between the financial risk probability value and the risk warning threshold. If the difference is positive, determine that the enterprise is in a high-risk state. Match the corresponding risk level label according to the size of the difference, and trigger an alarm command containing risk type, risk source node and risk level information to generate the risk warning signal.
5. The method for identifying financial risks based on artificial intelligence according to claim 3, characterized in that, The calculation process of the attention coefficient specifically includes: The feature vectors of the current node and its neighboring nodes are obtained. The feature vectors are linearly transformed using a learnable weight matrix. The transformed feature vectors are concatenated and processed through a single-layer feedforward neural network. The original attention values are calculated using the LeakyReLU activation function, and the original attention values of all neighboring nodes are normalized using the Softmax function to generate attention coefficients. The specific formula for calculating the attention coefficient is as follows: ; in, This represents the initial attention value of node i to its neighbor node j. This represents the weight vector of a single-layer feedforward neural network. Represents the learnable weight matrix. The feature vector representing the current node i. The feature vector representing neighbor node j, This represents a vector concatenation operation.
6. The method for identifying financial risks based on artificial intelligence according to claim 2, characterized in that, The bidirectional context semantic encoding process specifically includes: The cleaned text data is segmented at the character level and positional and paragraph encodings are added to construct an input embedding vector sequence. This sequence is then input into a multi-layer bidirectional Transformer encoder structure. A multi-head self-attention mechanism is used to calculate the semantic association strength between each character in the text and all other characters in parallel. Contextual information is dynamically aggregated based on the association strength to update the feature representation of each character and generate a context encoding vector.
7. The method for identifying financial risks based on artificial intelligence according to claim 4, characterized in that, The optimization process for the model parameters specifically includes: Obtain a historical enterprise sample dataset containing labeled normal and default. Calculate the error between the financial risk probability value predicted by the model and the actual label using the cross-entropy loss function. Construct a total objective function by combining L2 regularization. Use the Adam optimization algorithm to backpropagate according to the gradient direction of the total objective function to update the weight parameters of the fully connected classification layer and the graph neural network layer until the convergence value of the total objective function is less than the preset tolerance threshold, thus establishing a classification network model.
8. A financial risk identification system based on artificial intelligence, characterized in that, The system is used to implement the artificial intelligence-based financial risk identification method according to any one of claims 1-7, and the system comprises: The data processing module is used to acquire the company's financial statement data and market sentiment text data, perform noise reduction and standardization processing on the financial statement data to generate financial feature vectors, and use the BERT pre-trained language model to perform semantic parsing and sentiment judgment on the market sentiment text data to generate sentiment semantic embedding vectors. The graph construction module is used to construct a financial knowledge graph, establish enterprise entity nodes and business relationship edges in the financial knowledge graph, map the financial feature vector and the public opinion semantic embedding vector to the entity nodes, construct a node attribute matrix, and generate an edge weight matrix based on transaction amount and sentiment intensity. The risk analysis module is used to input the financial knowledge graph, the node attribute matrix and the edge weight matrix into the graph neural network model, and use the graph attention mechanism layer to perform weighted message passing and feature aggregation operations between entity nodes to capture nonlinear correlation features and generate risk representation vectors. The early warning generation module is used to input the risk representation vector into a fully connected classification layer to perform logistic regression operation, calculate the financial risk probability value, compare the financial risk probability value with the risk warning threshold, and generate a risk warning signal if the result exceeds the risk warning threshold.
Citation Information
Patent Citations
Systems and methods for computer models for climate financial risk measurement
WO2022165612A1
Risk prediction method and apparatus, and device and storage medium
WO2023065545A1