Financial risk prediction method and device, storage medium and equipment
By using multimodal feature extraction and causal graph neural network training, the problem of insufficient explicit modeling of causal mechanisms in financial risk prediction is solved, thereby improving the accuracy and interpretability of risk prediction and enhancing the stability and risk response capabilities of the financial system.
Patent Information
- Application Number
- CN202510835459.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-20
- Publication Date
- 2025-11-11
AI Technical Summary
Existing technologies for financial risk prediction suffer from insufficient explicit modeling of causal mechanisms, interpretability and robustness issues, difficulty in handling nonlinear dynamics and multimodal data, and inability to meet the requirements of financial regulation for model transparency and stability.
We employ multimodal feature extraction and a constraint-based causal discovery algorithm to generate a causal graph. We combine structural equation modeling to quantify causal strength, utilize counterfactual generative adversarial networks to simulate risk transmission paths, and train and interpretability analysis through a causal graph neural network.
It enables precise construction and interpretable analysis of financial risks, improves the accuracy and interpretability of risk prediction, and enhances the stability and risk response capabilities of the financial system.
Smart Images

Figure CN120931389A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of financial risk prediction technology, specifically to a financial risk prediction method, apparatus, storage medium, and device. Background Technology
[0002] In the field of financial risk prediction, traditional methods, based on linear regression, analysis of variance, and other methods, predict risk through variable correlation analysis. While simple to operate, these methods only reach the level of data correlation. Shallow machine learning models, such as random forests and support vector machines, can capture non-linear patterns, but their data-driven, black-box nature limits their in-depth application in financial scenarios.
[0003] Existing technologies for financial risk prediction suffer from three core shortcomings: First, traditional statistical models and shallow machine learning models lack explicit modeling of causal mechanisms, failing to distinguish between genuine causal relationships and spurious associations. For example, linear regression is susceptible to confounding variables, and random forests struggle to explain the causal direction between variables, leading to insufficient reliability of predictions in complex market environments. Second, early deep learning models such as multilayer perceptrons and recurrent neural networks suffer from severe interpretability bottlenecks and robustness issues, are highly sensitive to data quality, and are easily affected by distribution shifts in extreme event predictions. Third, existing technologies are insufficient in handling the nonlinear dynamics and feedback mechanisms of financial markets. Traditional causal discovery algorithms struggle to capture time-varying causal relationships in non-stationary time series and lack multimodal data fusion capabilities, failing to integrate heterogeneous information such as textual semantics and market microstructure. This results in insufficient diversity and robustness in risk prediction, making it difficult to meet the stringent requirements of financial regulation regarding model transparency and stability. Summary of the Invention
[0004] In view of this, the present invention provides a financial risk prediction method, apparatus, storage medium and device to solve the problem that the existing technology for financial risk prediction is difficult to meet the requirements.
[0005] In a first aspect, the present invention provides a financial risk prediction method, the method comprising: acquiring financial data and extracting multimodal features of the financial data; generating a causal graph based on the multimodal features using a constraint-based causal discovery algorithm and quantifying the causal strength using a structural equation model; using the quantified causal graph as a constraint for a counterfactual generative adversarial network to generate counterfactual scenarios and analyze risk transmission paths; training a causal graph neural network model based on the multimodal features, the causal graph, and the risk transmission paths; and performing interpretability analysis and risk monitoring based on the prediction results of the trained causal graph neural network model.
[0006] In this invention, by extracting multimodal features, discovering and quantifying causality, and combining counterfactual generation and neural network training, the causal relationships of financial risks can be accurately constructed, and clear transmission paths of counterfactual scenarios can be generated. Through interpretable analysis and monitoring, the accuracy and interpretability of risk prediction can be improved, which can help prevent and control financial risks in a timely manner and enhance the stability and risk response capabilities of the financial system.
[0007] In one optional implementation, acquiring financial data and extracting multimodal features from the financial data includes: acquiring financial data and cleaning and standardizing the financial data; using a temporal convolutional network to extract the cyclical features of macroeconomic indicators from the processed financial data; using an improved Transformer model to extract long text dependencies from the processed financial data; using a graph attention network to extract market microstructure features from the processed financial data, with cyclical features, long text dependencies, and market microstructure features serving as single-modal features; using a variational autoencoder to map the features in the single-modal features to the same latent variable space to obtain the mapped features; using a cross-modal attention distillation method to calculate the similarity of different modal features and generate cross-modal fusion features; and using an inter-modal causal entropy maximization algorithm to compress redundant features in the cross-modal fusion features.
[0008] In this invention, temporal convolutional networks and improved Transformers are used to extract multi-dimensional single-modal features. Through operations such as variational autoencoders and cross-modal attention distillation, cross-modal feature fusion and redundancy compression are achieved. This can accurately mine multi-modal information from financial data and provide high-quality, redundancy-free multi-modal fusion features for subsequent tasks such as financial risk prediction, thereby improving data utilization efficiency and analysis accuracy.
[0009] In one optional implementation, a constraint-based causal discovery algorithm is used to generate a causal graph, and a structural equation model is used to quantify the causal strength. This includes: generating an initial causal graph based on the multimodal features using a constraint-based causal algorithm; reducing the dimensionality of the initial causal graph using a Markov blanket algorithm; segmenting the non-stationary time-series data in the multimodal features into pseudo-stationary segments, calculating the transition probability matrix of the pseudo-stationary segments using a Bayesian network, and generating a dynamic causal graph by combining the pseudo-stationary segments with the dimensionality-reduced causal graph using a constraint-based causal algorithm; identifying nonlinear causal relationships in the dynamic causal graph using Boolean logic gates; determining the causal transit probability in the causal graph using a Markov chain Monte Carlo method; and quantifying the direct and indirect effects between variables in the causal graph using a structural equation model to obtain the causal strength.
[0010] In this invention, based on Bayesian networks and Markov blanket algorithms, the causal dependencies between nodes are updated in real time, supporting feedback loops and conditional dependencies, and capturing nonlinear market dynamics.
[0011] In one optional implementation, a quantized causal graph is used as a constraint for the counterfactual generative adversarial network (PGA) to generate counterfactual scenarios and analyze risk transmission paths. This includes: generating virtual scenarios using the quantized causal graph as a constraint for the PGA; simulating the impact of different intervention intensities using soft intervention modeling within the virtual scenarios to obtain a counterfactual scenario dataset; visualizing risk transmission paths using a causal sandbox tool based on the counterfactual scenario dataset; and calculating the difference between the counterfactual scenarios and the actual scenarios using the difference-in-differences method based on the counterfactual scenario dataset to quantify the risk contribution of different intervention measures.
[0012] In this invention, a counterfactual generative adversarial network constrained by a quantitative causal graph is used to generate virtual and counterfactual scenario datasets. The impact of intervention is simulated through soft intervention, and the risk transmission is visualized by combining a causal sandbox. The difference-in-differences method is used to quantify the differences and measure the contribution of intervention risk. This can effectively uncover potential risk paths, provide support for financial risk prevention and control and intervention strategy evaluation, and improve the scientific nature of risk analysis and response.
[0013] In one optional implementation, the causal graph neural network model includes a graph convolutional layer, an attention layer, and a fully connected layer. Training the causal graph neural network model based on multimodal features, a causal graph, and risk transmission paths includes: based on multimodal features and the causal graph, the graph convolutional layer aggregates features of each node's neighboring nodes according to weights; the attention layer calculates the attention weights between nodes, dynamically adjusting the interaction strength of different neighboring nodes; the fully connected layer maps the node features processed by the graph convolutional layer and the attention layer to the target space for model training; and a few-shot learning mechanism is used to train the model based on extreme event data stored in causal memory units, wherein the extreme event data is determined based on counterfactual scenarios.
[0014] In one optional implementation, interpretability analysis and risk monitoring are performed based on the prediction results of the trained causal graph neural network model, including: when using the trained causal graph neural network model for financial risk prediction, using the integral gradient algorithm to calculate the contribution of the model input to the model output and generating a causal attribution tree; using GPT-4 to construct a causal chain generation model and converting the causal attribution tree into a natural language explanation.
[0015] In this invention, the integral gradient algorithm is used to calculate the contribution of the input to the output to generate a causal attribution tree, and then GPT-4 is used to convert it into natural language interpretation. This not only clarifies the model's decision-making logic through attribution, improving the interpretability of financial risk prediction and making the results of complex models easy to understand, but also helps to accurately monitor risks, enabling financial practitioners to clearly grasp the risk transmission path, providing intuitive and understandable basis for risk prevention and control decisions, and enhancing the effectiveness of risk control.
[0016] In an optional implementation, the method further includes: using a causal graph neural network model as an environment simulator, employing an agent to learn the optimal hedging operation under different counterfactual scenarios; and employing a quantum approximation optimization algorithm to solve for the optimal portfolio.
[0017] Secondly, the present invention provides a financial risk prediction system, the system comprising: a data input module for acquiring financial data and extracting multimodal features of the financial data; a processing module for generating a causal graph based on the multimodal features using a constraint-based causal discovery algorithm, and quantifying the causal strength using a structural equation model; using the quantified causal graph as a constraint for a counterfactual generative adversarial network to generate counterfactual scenarios and analyze risk transmission paths; training a causal graph neural network model based on the multimodal features, the causal graph, and the risk transmission paths; and an output module for performing interpretability analysis and risk monitoring based on the prediction results of the trained causal graph neural network model.
[0018] Thirdly, the present invention provides a computer device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the financial risk prediction method of the first aspect or any corresponding embodiment described above.
[0019] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the financial risk prediction method of the first aspect or any corresponding embodiment thereof.
[0020] Fifthly, the present invention provides a computer program product, including computer instructions for causing a computer to execute the financial risk prediction method of the first aspect or any corresponding embodiment thereof. Attached Figure Description
[0021] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0022] Figure 1 This is a flowchart illustrating a financial risk prediction method according to an embodiment of the present invention;
[0023] Figure 2 This is a schematic diagram of the processing flow of the financial risk prediction method according to an embodiment of the present invention in an application scenario.
[0024] Figure 3 This is a schematic diagram of the processing flow of another application scenario of the financial risk prediction method according to an embodiment of the present invention;
[0025] Figure 4 This is a structural block diagram of a financial risk prediction device according to an embodiment of the present invention;
[0026] Figure 5 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0028] According to an embodiment of the present invention, a financial risk prediction method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0029] This embodiment provides a financial risk prediction method that can be used on electronic devices such as computers, mobile phones, and tablets. Figure 1 This is a flowchart of a financial risk prediction method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps:
[0030] Step S101: Obtain financial data and extract the multimodal features of the financial data.
[0031] Specifically, the financial data obtained includes: market transaction data, macroeconomic data, corporate financial data, news and public opinion data, and regulatory policy data, etc.
[0032] Market trading data includes transaction data for financial products such as stocks, bonds, futures, and options, including but not limited to transaction prices, trading volumes, buy and sell orders, market depth, and limit order book data. This data reflects real-time market trading activity and investor sentiment. Market trading data also includes foreign exchange and commodity trading data. Foreign exchange trading data includes exchange rates, trading volumes, and order flows, reflecting the international economic situation and capital flows. Commodity trading data includes transaction data for commodities such as crude oil and gold, reflecting global economic demand and inflation levels.
[0033] Macroeconomic data includes: Gross Domestic Product (GDP) and its growth rate: reflecting the overall trend of economic growth; Consumer Price Index (CPI) and Producer Price Index (PPI): reflecting the level of inflation; Unemployment rate and non-farm payroll data: reflecting the state of the labor market; Interest rates and money supply: reflecting the orientation of monetary policy; Industrial production index and manufacturing purchasing managers' index (PMI): reflecting the prosperity of industry and manufacturing; Balance of payments and trade balance: reflecting international trade and capital flows.
[0034] Corporate financial data includes: financial statement data of listed companies: including balance sheets, income statements, cash flow statements, etc., reflecting the company's profitability, solvency, operating efficiency and growth potential; financial data of non-listed companies (if available): financial information of non-listed companies obtained through various channels; credit rating data: reflecting the company's credit risk.
[0035] News and public opinion data includes: Financial news data: News reports related to financial markets, economic policies, and corporate operations collected from major financial media outlets and news websites. Social media data: Public discussions and sentiment expressions regarding financial markets and economic events collected from social media platforms such as Weibo and Twitter. Public opinion analysis data: Sentiment analysis and topic modeling using Natural Language Processing (NLP) technology to extract public sentiment and trending topics from news and social media data.
[0036] Regulatory policy data includes: central bank policies: such as interest rate adjustments, reserve requirement ratio adjustments, and open market operations; policies from regulatory agencies such as the China Securities Regulatory Commission (CSRC) and the State Financial Regulatory Commission (SFC): such as industry regulatory policies and risk warnings; and policies from international financial organizations: such as policy statements and reports from the International Monetary Fund (IMF) and the World Bank.
[0037] Specifically, the purpose of collecting this data is to identify potential financial risks and predict their probability and impact through analysis. Market transaction data can be used to analyze market volatility, liquidity risk, and market manipulation risk. Macroeconomic data can be used to analyze systemic risk, economic cycle risk, and policy risk. Corporate financial data can be used to analyze credit risk, default risk, and operational risk. News and public opinion data can be used to analyze market sentiment, herding effects, and black swan event risks. Regulatory policy data can be used to analyze policy risk and compliance risk. Structured data, unstructured data, image data, and audio data are also included.
[0038] The acquired financial data can be further categorized according to data type. For example, structured data includes transaction records, balance sheets, and credit scores of the entity being evaluated. Unstructured data includes news texts, social media sentiment, and market opinion. Image data includes scanned copies of financial statements and market trend charts. Audio data includes recordings of earnings conferences. Different feature extraction methods can be used for different types of data.
[0039] Additionally, it's worth noting that a microservice architecture can be configured, employing multiple collector instances to access different data sources. For example, transaction data can be obtained via exchange APIs (such as Tushare), news text can be scraped using web crawlers, macroeconomic data can be synchronized via database interfaces, and a unified JSON-formatted data stream can be output using an adapter pattern. The output data can be stored in a distributed storage system.
[0040] Step S102: Based on the multimodal features, a constraint-based causal discovery algorithm is used to generate a causal graph, and structural equation modeling is used to quantify the causal strength. The constraint-based causal discovery algorithm can be the Peter-Clark (PC) algorithm, which discovers the causal skeleton through conditional independence tests. Specifically, the PC algorithm first constructs a completely undirected graph, removes non-independent edges through tests (such as the chi-square test), and then uses a directional propagation algorithm to determine the causal direction (e.g., "monetary policy statement → exchange rate fluctuations" rather than the reverse). The PC algorithm uses a significance level of α = 0.05 for edge selection and combines stability selection to improve the robustness of the causal graph. Alternatively, in other implementations, a score-based algorithm, such as the GES (Optimal Structure Identification With Greedy Search) algorithm, can be used to search for the optimal causal structure by maximizing the data likelihood function, balancing complexity and fit. In the generated causal graph, nodes represent financial variables, and variables represent causal relationships.
[0041] Furthermore, after generating the causal graph, structural equation modeling (SEM) can be used to quantify the causal strength. Specifically, SEM can be used to calculate the direct and indirect effects between variables.
[0042] Step S103 involves using a quantified causal graph as a constraint for the counterfactual generative adversarial network (PGA), generating counterfactual scenarios, and analyzing risk transmission paths. The PGA can simulate the dynamics and risk transmission paths following a specific intervention or event. Specifically, it generates virtual market scenarios. For example, it generates market state data under the counterfactual scenario of "if an investment bank goes bankrupt," and then simulates market intervention to generate the risk evolution path within the counterfactual scenario.
[0043] Step S104: The causal graph neural network model is trained based on multimodal features, causal graphs, and risk transmission paths. Specifically, the causal graph neural network includes graph convolutional layers, attention layers, and fully connected layers. Through training the causal graph neural network model, the model can predict financial risks based on multimodal fusion features.
[0044] Step S105 involves interpretability analysis and risk monitoring based on the prediction results of the trained causal graph neural network model. Specifically, when using the trained model for prediction, interpretability analysis can be performed on the prediction results, and risk monitoring can be conducted based on these results. For example, transparent predictions can be generated using SHAP values and causal attribution trees to meet the financial regulatory requirements for model interpretability.
[0045] This embodiment provides a financial risk prediction method, which includes the following steps:
[0046] Step S201: Obtain financial data and extract the multimodal features of the financial data.
[0047] Specifically, step S201 includes:
[0048] Step S2011: Acquire financial data and clean and standardize it. Specifically, a data cleaning engine can be built based on Spark Streaming to clean and standardize the financial data. During processing, missing order records in the transaction data can be filled using KNN interpolation (e.g., estimating missing values based on the prices of the previous five transactions); an isolated forest algorithm can be used to detect abnormal transactions (e.g., orders with price jumps exceeding three standard deviations). Noise removal (removing advertisements and garbled text) can be performed on the news text, and key events can be extracted using regular expressions, etc.
[0049] Step S2012: Use a temporal convolutional network to extract the cyclical characteristics of macroeconomic indicators from the processed financial data.
[0050] Step S2013: Use the improved Transformer model to extract the long text dependencies of the processed financial data.
[0051] Step S2014: Use graph attention network to extract market microstructure features, cycle features, long text dependencies and market microstructure features as single-modal features from the processed financial data.
[0052] Specifically, when performing the above feature extraction, a DAG (Directed Acyclic Graph) structure can be used. Meanwhile, Transformer-XL is used to handle the long-range dependencies of news text, Graph Attention Network (GAT) is used to capture the microstructure network of the market (such as order book topology), and Temporal Convolutional Network (TCN) is used to extract the cyclical features of macroeconomic indicators.
[0053] Furthermore, for structured data, graph neural networks can be used to extract features; for unstructured data, such as news text, NLP is used for feature extraction; for social media sentiment, Transformer encoding is used; and for market sentiment, BERT entity recognition is used. For image data, such as scanned financial statements, ResNet is used for feature extraction, and CNN image segmentation is used for feature extraction in market trend charts. For audio data, Automatic Speech Recognition (ASR) and Wav2Vec2 feature encoding are used for feature extraction.
[0054] Step S2015 involves using a variational autoencoder (VAE) to map features from a single modality to the same latent variable space, resulting in mapped features. Introducing a VAE between structured data (e.g., balance sheets) and unstructured data (e.g., social media sentiment) addresses data distribution shift issues and improves the signal-to-noise ratio. Specifically, the VAE maps structured and unstructured features to the same latent variable space, resolving data distribution discrepancies. Furthermore, instrumental variable constraints can be embedded in the loss function of the VAE to effectively remove confounding factors.
[0055] Step S2016 employs a cross-modal attention distillation method to calculate the similarity of features across different modalities, generating cross-modal fusion features. Specifically, the cross-modal attention distillation method uses contrastive learning to calculate the similarity of features across different modalities (e.g., calculating the correlation between news of "crude oil price decline" and energy stock trading features) to generate a cross-modal fusion feature vector. For example, this method can be used to design an inter-modal alignment loss function, achieving semantic-level fusion of text, images, and transaction streams through contrastive learning.
[0056] Step S2017 involves using the intermodal causal entropy maximization algorithm to compress redundant features in the cross-modal fusion features. Specifically, when using the intermodal causal entropy maximization algorithm, redundant modal features can be compressed using the information bottleneck theory, thereby improving the causal signal-to-noise ratio in high-dimensional space.
[0057] Step S202: Based on the multimodal features, a constraint-based causal discovery algorithm is used to generate a causal graph, and a structural equation model is used to quantify the causal strength.
[0058] Specifically, step S202 includes:
[0059] Step S2021: Based on the multimodal features, an initial causal graph is generated using a constraint-based causal algorithm.
[0060] Step S2022 involves using the Markov blanket algorithm to reduce the dimensionality of the initial causal graph. Specifically, the Markov blanket algorithm can be used to identify the conditionally independent set of a specific node (variable), that is, given the Markov blanket of a node, that node is conditionally independent from other nodes outside the blanket. This helps simplify the causal model and improves the interpretability and computational efficiency of the model. In this step, using the Markov blanket algorithm to identify key variables allows for the construction of a more concise causal graph.
[0061] Step S2023: The non-stationary time series data in the multimodal features are segmented into pseudo-stationary segments. A Bayesian network is used to calculate the transition probability matrix of the pseudo-stationary segments. A constraint-based causal algorithm is used to combine the pseudo-stationary segments with the dimensionality-reduced causal graph to generate a dynamic causal graph.
[0062] Specifically, employing the assumption of local stationarity, for non-stationary sequences, a sliding time window is used to segment the data into multiple pseudo-stationary segments. For each pseudo-stationary segment, a time-varying transition probability matrix is constructed by introducing a dynamic Bayesian network to capture the volatility clustering effect in high-frequency foreign exchange market data. That is, the transition probability matrix of each pseudo-stationary segment is calculated, and the latent causal topology is reconstructed using the latent variable space of the VAE, addressing the deficiency of the traditional Granger test in capturing nonlinear dependencies. Furthermore, for each pseudo-stationary segment, the causal relationships between financial variables within each segment can be further identified, generating a timestamped dynamic causal graph that displays the causal structure between variables within that time period.
[0063] Step S2024 involves using Boolean logic gates to identify nonlinear causal relationships in the dynamic causal graph. Specifically, Boolean logic gates (AND / OR) are introduced to explicitly express nonlinear causal chains and conditional relationships. For example, a "decline in bank capital adequacy ratio" may require both "increased credit losses" (AND condition) and "increased regulatory requirements" (OR condition) to trigger "credit tightening." This can be seen as an enhanced representation or supplement to the explanatory rules of the basic causal graph.
[0064] Step S2025 involves using the Markov chain Monte Carlo (MCMC) method to determine the causal transit probabilities in the causal graph. Specifically, MCMC can effectively sample from the posterior distribution to estimate the strength of causal relationships between variables, particularly those within feedback loops. For example, to estimate the indirect impact of "falling house prices" on "declining bank capital adequacy ratios" (through "mortgage defaults" and "credit crunch"), MCMC can help quantify the total effect and the strength of each link in this loop.
[0065] Step S2026 involves using structural equation modeling to quantify the direct and indirect effects between variables in the causal graph, thereby obtaining the causal strength. It should be noted that when calculating the direct and indirect effects between variables using structural equation modeling, the Markov blanket algorithm is used to identify the key parent nodes of each node, compressing the computational dimensionality.
[0066] Step S203: The quantified causal graph is used as a constraint for the counterfactual generation adversarial network to generate counterfactual scenarios and analyze the risk transmission path;
[0067] Specifically, step S203 includes:
[0068] Step S2031: The quantized causal graph is used as a constraint for the counterfactual generative adversarial network to generate virtual scenarios; specifically, a counterfactual generative adversarial network (CFGAN) is constructed, and a conditional generative model (CGAN) is used to synthesize data samples under different market scenarios.
[0069] Step S2032: In the virtual scene, soft intervention modeling is used to simulate the effects of different intervention intensities to obtain a counterfactual scenario dataset; specifically, unlike hard intervention modeling, this embodiment uses soft intervention modeling to add a probability distribution to the intervention intensity and simulates the effects of different intensities through Monte Carlo sampling.
[0070] Step S2033: Based on the counterfactual scenario dataset, a causal sandbox tool is used to visualize the risk transmission path. Specifically, this causal sandbox tool supports interactive adjustment of intervention nodes (such as modifying property tax rates), dynamically renders the risk transmission path diagram, and quantifies the confidence of each path using Bayesian factors. This causal sandbox tool can also be understood as a sandbox test or stress test, that is, by setting extreme scenarios (such as liquidity crises or black swan events), and then using system models (including causal models and predictive models) to simulate the system's performance under these scenarios.
[0071] Furthermore, stress testing conducted after deploying the system in a simulated environment (such as simulating a liquidity crisis) rigorously verifies the robustness, accuracy, and stability of the system model (especially causal and predictive models) under extreme conditions. Test results are used to assess whether the model can make reasonable and reliable predictions and warnings under stress. Besides model validation, stress testing also examines the stability, fault tolerance, and performance of the entire system architecture (including data flow, computation modules, and communication mechanisms) under extreme loads or abnormal inputs. For example, it checks whether the system can continue to operate when simulating extreme market fluctuations, whether data is lost, and whether processing latency remains within acceptable limits. While stress testing primarily focuses on results, the decision-making process under extreme scenarios should also be interpretable. Test results need to be interpretable to understand the model's behavioral logic under stress. The results of sandbox testing (whether the model performs poorly or the system is unstable) are fed back to the development and optimization phases, such as optimizing the model, driving improvements to the model and system, forming a closed loop.
[0072] Step S2034: Based on the counterfactual scenario dataset, the difference between the counterfactual and actual scenarios is calculated using the difference-in-differences (DID) method to quantify the risk contribution of different intervention measures. Specifically, the risk transmission path under extreme market scenarios is quantified using the difference-in-differences (DID) method, the risk difference between the counterfactual and actual scenarios is calculated, and "if-then" type decision suggestions (such as the impact of adjusting interest rates on default rates) are generated to support "if-then" type stress tests, thereby quantifying the systemic risk contribution of different intervention measures.
[0073] Step S204: Train the causal graph neural network model based on multimodal features, causal graph, and risk transmission path.
[0074] Specifically, step S204 includes:
[0075] Step S2041: Based on multimodal features and causal graphs, the graph convolutional layer aggregates features from each node's neighboring nodes according to weights. An attention layer calculates the attention weights between nodes, dynamically adjusting the interaction strength of different neighboring nodes. A fully connected layer maps the node features processed by the graph convolutional and attention layers to the target space for model training. Specifically, the causal graph neural network model is implemented using the GAT-v2 model, which includes graph convolutional layers, attention layers, and fully connected layers. Specifically, the graph convolutional layer, based on the graph attention mechanism, aggregates features from each node's neighboring nodes according to weights. The attention layer calculates the attention weights between nodes, dynamically adjusting the interaction strength of different neighboring nodes to enhance the extraction of key related features. The fully connected layer maps the node features processed by the graph convolutional and attention mechanisms to the target space to achieve the final prediction or classification task.
[0076] Furthermore, during model training, an attention mechanism (Transformer) is applied to adaptively fuse multimodal features, and reinforcement learning is used to dynamically adjust modality weights. Simultaneously, prediction errors are monitored in real time, and Bayesian optimization is used to dynamically adjust model parameters and data weights. A feedback loop is constructed to feed the prediction results back to the data layer, optimizing feature selection and sampling strategies.
[0077] Step S2042: Based on the extreme event data stored in the causal memory unit, a few-shot learning mechanism is used to train the model. The extreme event data is determined based on counterfactual scenarios. Specifically, a few-shot learning mechanism can also be used for training extreme events. For example, in the Black Swan event prediction task, by storing patterns of historical extreme events through the causal memory unit, when the current multimodal data distribution is detected to deviate from the training set, the few-shot learning mechanism is automatically triggered, thus advancing the warning time window for events like the 2008 financial crisis by 72 hours.
[0078] Step S205: Perform interpretability analysis and risk monitoring based on the prediction results of the trained causal graph neural network model.
[0079] Specifically, step S205 includes:
[0080] Step S2051: When using the trained causal graph neural network model for financial risk prediction, the integral gradient algorithm is used to calculate the contribution of the model input to the model output and generate a causal attribution tree. Specifically, the contribution of the input features to the prediction results is calculated through Integrated Gradients to generate a hierarchical attribution tree to support regulatory auditing.
[0081] Step S2052: A causal chain generation model is constructed using GPT-4 to convert the causal attribution tree into a natural language explanation. Specifically, using generative pre-trained models such as GPT-4, complex causal graph structures or identified key causal chains (e.g., "Why did a certain technology company's stock price plummet?") are transformed into natural language explanations that are easy for humans to understand (e.g., "Supply chain disruption (due to the pandemic) → increased production costs → pressure on profit margins").
[0082] Furthermore, the generated natural language causal explanations can be presented to risk managers along with risk warning signals, helping them quickly understand the root causes of risks, rather than simply observing changes in risk indicators. When validating model and system performance, generative causal explanations can be used to verify the rationality of model decisions. For example, checking whether the explanations provided by the model conform to financial logic and common sense. The explanation results can also be indirectly used for model optimization; if the explanations are frequently unreasonable or unclear, it may indicate problems with the underlying causal model or data, requiring adjustment. The generated explanations can be integrated into user interfaces or reports, improving the system's usability and transparency.
[0083] Step S206 involves using the causal graph neural network model as an environment simulator, employing an agent to learn optimal hedging operations under different counterfactual scenarios, and using a quantum approximate optimization algorithm to solve for the optimal portfolio. Specifically, the causal model (short for the causal graph neural network model) serves as an environment simulator to train the agent for the risk hedging strategy. Furthermore, drawing on the characteristics of quantum walks, a quantum approximate optimization algorithm (QAOA) can be designed to accelerate portfolio optimization. For example, constructing a risk-return balanced portfolio among 1000 stocks can be done 3-5 times faster than traditional algorithms.
[0084] The quantum approximation optimization algorithm, drawing on the advantages of quantum annealing in global optimization, designs a large-scale causal network optimization paradigm. By compressing the high-dimensional parameter space through tensor networks and combining it with the objective function of minimizing causal entropy, it achieves optimal portfolio selection under complex constraints, improving solution efficiency by three orders of magnitude compared to traditional heuristic algorithms.
[0085] In one alternative implementation, this financial risk prediction method can be applied to the following different scenarios:
[0086] 1. Credit risk assessment and management.
[0087] Scenario description: When banks or other credit institutions conduct loan approvals, they need to assess the borrower's repayment ability and willingness to repay in order to predict their default risk.
[0088] System Application: This embodiment utilizes historical credit data, borrower personal information, financial data, and behavioral data, combined with causal models, to identify key factors influencing default (e.g., income level, debt situation, industry prospects, etc.) and quantify the causal relationship between these factors and default risk. Through deep learning models, it captures complex nonlinear relationships and predicts the borrower's default probability.
[0089] Advantages: Compared with traditional scorecard models, this embodiment can more accurately identify causal relationships, reduce the impact of confounding variables, improve the accuracy and reliability of risk assessment, and provide more convincing explanations, thereby enhancing the credibility of the model.
[0090] 2. Portfolio risk management.
[0091] Scenario Description: When managing investment portfolios, financial institutions need to assess the risk levels of different assets or asset portfolios, as well as the correlations between them, in order to optimize asset allocation and control overall risk exposure.
[0092] System Application: This embodiment can analyze macroeconomic data, market data, company financial data, industry news, etc., and use causal models to identify key risk factors affecting asset returns, and quantify the causal relationship between these factors and asset returns. Through deep learning models, it captures market fluctuation patterns and predicts the future returns and risks of different assets or asset portfolios.
[0093] Advantages: This implementation can help financial institutions gain a deeper understanding of the sources of risk, identify potential systemic risks, optimize investment portfolios, reduce risk exposure, and improve investment returns.
[0094] 3. Financial market risk warning.
[0095] Scenario Description: Regulatory agencies or financial institutions need to monitor the overall risk level of the financial market, promptly identify potential systemic risks, and take preventive measures to maintain financial stability.
[0096] System Application: This embodiment can collect and analyze large-scale financial market data, including transaction data, price data, news data, social media data, etc. It utilizes causal models to identify key factors affecting market stability and quantifies the causal relationship between these factors and market risk. Through deep learning models, it captures market volatility patterns and predicts the probability and scope of impact of extreme market events (e.g., market crashes, liquidity crises).
[0097] Advantages: This embodiment can provide more accurate risk warning signals, helping regulatory agencies and financial institutions to take timely countermeasures, reduce the probability and impact of systemic risks, and maintain the stability of the financial market.
[0098] 4. Insurance fraud detection.
[0099] Scenario Description: When processing claims, insurance companies need to identify and prevent fraudulent activities in order to control claims costs and maintain a fair insurance environment.
[0100] System Application: This embodiment can analyze historical claims data, policyholder information, case characteristics, etc., and use causal models to identify key indicators related to fraudulent behavior (e.g., claim frequency, claim amount, policyholder history, etc.), and quantify the causal relationship between these indicators and fraud probability. Through deep learning models, it captures complex patterns of fraudulent behavior and predicts the probability of fraud in new claims.
[0101] Advantages: This embodiment can more effectively identify potential fraudulent activities, reduce insurance company payouts, and improve anti-fraud efficiency.
[0102] The specific meaning of risk prediction:
[0103] In this invention, risk prediction refers to the quantitative assessment of the probability of a specific financial risk event occurring and its potential impact. Specifically, it includes the following aspects:
[0104] 1. Probability Prediction: Predicting the likelihood of a specific risk event (e.g., borrower default, asset price decline, market crash, insurance fraud, etc.) occurring within a specific timeframe. This is typically represented by a probability value between 0 and 1, for example, predicting a 5% probability that a borrower will default within the next year.
[0105] 2. Impact Assessment: Assessing the potential impact of a specific risk event, such as the magnitude of economic losses and the scope of the ripple effect. This can be expressed in specific numerical values, for example, predicting that a bank may face a loss of 100,000 yuan if a borrower defaults.
[0106] 3. Causal analysis: Identifying the key factors that lead to a specific risk event and quantifying the causal relationship between these factors and the risk event. This helps us understand the mechanisms by which risks arise and to take targeted measures to mitigate them.
[0107] This invention can more accurately predict the probability and impact of financial risk events and provide more convincing explanations, helping financial institutions improve their risk management and make more informed decisions. The system has broad application prospects in areas such as credit risk assessment, portfolio management, financial market risk early warning, and insurance fraud detection.
[0108] In one alternative implementation, such as Figure 2 As shown, the causal diagram in this financial risk prediction corresponds to the following stages:
[0109] Data Input: The process begins with inputting millions of financial indicators, which cover a large amount of financial data such as interest rates, exchange rates, and asset prices, providing a foundation for subsequent analysis.
[0110] Causal chain extraction: Using the TCDA algorithm, causal relationships are extracted from massive amounts of data to clarify the intrinsic connections between different financial variables, laying the foundation for risk transmission analysis.
[0111] Risk transmission map generation: Using a specific example, “Federal Reserve interest rate hike → US Treasury yield → real estate company dollar bond default”, the risk transmission path is shown, making the complex transmission of financial risks visible.
[0112] Dynamic causal strength quantification: Dynamically quantifies the strength of causal relationships among various factors in the risk transmission process, and measures the degree of impact and changing trends.
[0113] Critical Path Identification: By using technical means to identify critical risk transmission paths, the accuracy rate reaches 92%, which is 35% higher than the Granger causal method, and can more accurately locate the critical links of risk.
[0114] In one alternative implementation, such as Figure 3 As shown, the risk projection stages in this financial risk forecast include:
[0115] Developing a Counterfactual Risk Simulator (CF-Sim): This is the starting point of the entire process. The Counterfactual Risk Simulator can build risk scenarios under different assumptions to help analyze the risk situation in the absence of events or under different policy environments.
[0116] Quantifying the effects of policy intervention: Based on the developed simulator, the potential effects of various policy intervention measures are quantitatively assessed in order to measure the impact of policies on risk control and economic indicators.
[0117] Integrated Risk Contagion Model (RC-Net): This model integrates different types of risk factors to simulate the propagation path and scope of risk in the financial system or other systems, helping to identify key risk nodes.
[0118] Improved Stress Testing Efficiency: By leveraging the previous models and quantification results, the stress testing process is optimized to improve the efficiency and accuracy of stress testing in assessing the system's ability to withstand extreme risks.
[0119] Application scenarios: Apply the above analysis and models to real-world financial or economic scenarios, such as bank risk management and financial market stability assessment, to support decision-making.
[0120] This risk simulation framework provides a systematic approach to risk assessment, policy making, and decision-making, helping to address potential risks in advance and enhance system stability.
[0121] In one alternative implementation, 1000 retail investors are selected and randomly divided into an experimental group (using a real-time risk dashboard, i.e., the financial risk prediction method of this invention) and a control group (relying on traditional analysis tools). Market volatility scenarios (such as sudden geopolitical events) are set up in a simulated trading environment, and investment decision data is recorded.
[0122] Results analysis:
[0123] Decision quality indicators: The experimental group improved by 22%, 35%, and 41% in "risk-adjusted return", "maximum drawdown control", and "irrational trading frequency", respectively.
[0124] Improved behavioral deviations: Overconfidence effect decreased by 58%, and herding effect decreased by 47% (quantified based on regret aversion coefficient and conformity psychological index).
[0125] This embodiment also provides a financial risk prediction system for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0126] This embodiment provides a financial risk prediction system, such as Figure 4 As shown, it includes:
[0127] The data input module 41 is used to acquire financial data and extract the multimodal features of the financial data;
[0128] Processing module 42 is used to generate a causal graph based on the multimodal features using a constraint-based causal discovery algorithm, and to quantify the causal strength using a structural equation model; to use the quantified causal graph as a constraint for a counterfactual generative adversarial network, generate counterfactual scenarios and analyze risk transmission paths; and to train a causal graph neural network model based on the multimodal features, the causal graph, and the risk transmission paths.
[0129] Output module 43 is used for interpretability analysis and risk monitoring based on the prediction results of the trained causal graph neural network model.
[0130] The system employs high-throughput message queues (such as Kafka) for asynchronous communication between modules, ensuring efficient data processing and fault tolerance. Furthermore, it utilizes containerization technology (Docker) to encapsulate model components and leverages Kubernetes for elastic scaling. Federated learning (FL) frameworks are applied to protect data privacy, and differential privacy (DP) techniques are used to inject noise and prevent model reverse engineering attacks. A model performance monitoring dashboard is built, and statistical process control (SPC) methods are used to detect prediction bias in real time.
[0131] Further functional descriptions of the above modules are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0132] This invention also provides a computer device having the above-described features. Figure 4 The financial risk prediction device shown.
[0133] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 5 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 5 Take a processor 10 as an example.
[0134] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0135] The memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to perform the method shown in the above embodiments.
[0136] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device as shown by a landing page for an app. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, which can be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0137] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0138] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.
[0139] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
[0140] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0141] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A financial risk prediction method, characterized in that, The method includes: Acquire financial data and extract multimodal features from the financial data; Based on the aforementioned multimodal features, a constraint-based causal discovery algorithm is used to generate a causal graph, and a structural equation model is used to quantify the causal strength. A quantified causal graph is used as a constraint for the counterfactual generative adversarial network to generate counterfactual scenarios and analyze risk transmission paths. The causal graph neural network model is trained based on multimodal features, causal graphs, and risk transmission paths; Interpretability analysis and risk monitoring are performed based on the prediction results of the trained causal graph neural network model.
2. The method according to claim 1, characterized in that, Acquire financial data and extract multimodal features from the financial data, including: Acquire financial data, and clean and standardize the financial data; The cyclical characteristics of macroeconomic indicators in processed financial data are extracted using a temporal convolutional network. An improved Transformer model is used to extract long-text dependencies from processed financial data; The micro-market structure features, cyclical features, long text dependencies, and market micro-structure features of the processed financial data are extracted using graph attention networks as single-modal features. A variational autoencoder is used to map the features in a single modality to the same latent variable space to obtain the mapped features. A cross-modal attention distillation method is used to calculate the similarity of features from different modalities and generate cross-modal fusion features. The intermodal causal entropy maximization algorithm is used to compress redundant features in cross-modal fusion features.
3. The method according to claim 1, characterized in that, Based on the aforementioned multimodal features, a constraint-based causal discovery algorithm is used to generate a causal graph, and a structural equation model is used to quantify the causal strength, including: Based on the aforementioned multimodal features, an initial causal graph is generated using a constraint-based causal algorithm. The initial causal graph is reduced in dimensionality using the Markov blanket algorithm; The non-stationary time series data in the multimodal features are segmented into pseudo-stationary segments. A Bayesian network is used to calculate the transition probability matrix of the pseudo-stationary segments. A constraint-based causal algorithm is used to combine the pseudo-stationary segments with the dimensionality-reduced causal graph to generate a dynamic causal graph. Boolean logic gates are used to identify nonlinear causal relationships in dynamic cause-effect graphs; The causal transit probability in the causal graph is determined using the Markov chain Monte Carlo method. Structural equation modeling is used to quantify the direct and indirect effects between variables in the causal graph, and the causal strength is obtained.
4. The method according to claim 1, characterized in that, A quantized causal graph is used as a constraint for the counterfactual generative adversarial network to generate counterfactual scenarios and analyze risk transmission paths, including: A quantized causal graph is used as a constraint for the counterfactual generative adversarial network to generate virtual scenarios; In a virtual scenario, soft intervention modeling is used to simulate the effects of different intervention intensities, resulting in a counterfactual scenario dataset. Based on the aforementioned counterfactual scenario dataset, a causal sandbox tool is used to visualize the risk transmission path; Based on the aforementioned counterfactual scenario dataset, the difference between the counterfactual scenarios and the actual scenarios is calculated using the difference-in-differences method, thereby quantifying the risk contribution of different intervention measures.
5. The method according to claim 1, characterized in that, The causal graph neural network model includes graph convolutional layers, attention layers, and fully connected layers. It is trained based on multimodal features, causal graphs, and risk propagation paths, including: Based on multimodal features and causal graphs, the graph convolutional layer aggregates features of each node's neighboring nodes according to weights, and the attention layer calculates the attention weights between nodes to dynamically adjust the interaction strength of different neighboring nodes; a fully connected layer maps the node features processed by the graph convolutional layer and the attention layer to the target space for model training. The model is trained using a few-shot learning mechanism based on extreme event data stored in causal memory units, where the extreme event data is determined based on counterfactual scenarios.
6. The method according to claim 1, characterized in that, Interpretability analysis and risk monitoring are performed based on the prediction results of the trained causal graph neural network model, including: When using a trained causal graph neural network model for financial risk prediction, the integral gradient algorithm is used to calculate the contribution of the model input to the model output and generate a causal attribution tree. A causal chain generation model was constructed using GPT-4, and the causal attribution tree was converted into a natural language explanation.
7. The method according to claim 1, characterized in that, The method further includes: Using the causal graph neural network model as an environment simulator, an agent learns the optimal hedging operation under different counterfactual scenarios; The optimal portfolio is solved using a quantum approximation optimization algorithm.
8. A financial risk prediction system, characterized in that, The system includes: The data input module is used to acquire financial data and extract the multimodal features of the financial data; The processing module is used to generate a causal graph based on the multimodal features using a constraint-based causal discovery algorithm, and to quantify the causal strength using a structural equation model; to use the quantified causal graph as a constraint for a counterfactual generative adversarial network, generate counterfactual scenarios and analyze risk transmission paths; and to train a causal graph neural network model based on the multimodal features, the causal graph, and the risk transmission paths. The output module is used for interpretability analysis and risk monitoring based on the prediction results of the trained causal graph neural network model.
9. A computer device, characterized in that, include: A memory and a processor are interconnected, the memory storing computer instructions, and the processor executing the computer instructions to perform the financial risk prediction method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to execute the financial risk prediction method according to any one of claims 1 to 7.
Citation Information
Cited By
Adaptive credit risk assessment and interpretable decision support method and system
CN121258670A
Enterprise fund income and expenditure prediction method based on AI large model and multi-modal interaction
CN121280161A
Website abnormal behavior detection method and device based on multi-source data fusion and medium
CN121664538A
Authentication risk supervision decision-making method and device capable of explaining attribution and optimizing
CN122022449A
Risk measurement method, device and equipment based on multi-modal data and causal hypergraph
CN122264937A