Time sequence causal discovery method based on multi-scale attention fusion

By employing a time-series causal discovery method based on multi-scale attention fusion, this approach addresses the shortcomings of existing technologies in handling complex multi-scale periodic and dynamic dependencies, achieving higher accuracy and reliability. It is applicable to fields such as finance, meteorology, and biomedicine.

CN121434620APending Publication Date: 2026-01-30NANJING UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511514777.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-22
Publication Date
2026-01-30

AI Technical Summary

Technical Problem

Existing methods struggle to effectively handle complex, multi-scale periodic and dynamically dependent nonlinear time-series data, leading to incomplete or inaccurate causal discovery results.

Method used

A temporal causal discovery method based on multi-scale attention fusion is adopted, which uses a two-branch time series prediction network to collaboratively capture local and global dependencies, and combines the Enhanced Permutation Importance Test (EPIT) for causal verification.

Benefits of technology

It significantly improves the accuracy and reliability of causal discovery, enabling a better understanding of causal relationships in complex dynamic data, and is applicable to fields such as finance, meteorology, and biomedicine.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121434620A_ABST
    Figure CN121434620A_ABST
Patent Text Reader

Abstract

The invention discloses a time series data causal discovery method based on multi-scale attention fusion. The method comprises the following steps: firstly, receiving multivariate time series data; the dependency relationship is captured in parallel through a double-branch prediction network, a local module processes a multi-scale periodic mode by using multi-scale fragmentation and attention causal convolution, and a global module adopts an iTransform architecture to model long-term dependency among variables; the attention scores from the two branches are then fused to generate a unified potential causal intensity metric; secondly, performing strict statistical verification on the potential relationship by adopting enhanced permutation importance test (EPIT) to eliminate false correlation; and finally outputting the verified causal graph. According to the method, the causal relationship can be effectively discovered from complex time sequence data with multi-scale periodicity and nonlinear dynamic, and the causal discovery accuracy and reliability are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of data mining, machine learning, and time series analysis; more specifically, it relates to a method for discovering causal relationships from time series data. Background Technology

[0002] Causal discovery in time series data is a key research area in data mining and machine learning, aiming to identify causal relationships between variables from time series data. These causal relationships not only reveal the interaction mechanisms between variables but also provide a scientific basis for prediction, decision-making, and intervention.

[0003] Traditional causal discovery methods, such as Granger causality tests, PC algorithms, and their time series extensions (e.g., PCMCI and tsFCI), can identify causal relationships to some extent. However, the practical utility of these methods is often limited by their idealized statistical measurement framework and core assumptions. These assumptions include linear relationships between variables, noise-free data, and strict independence conditions, which are often difficult to meet in complex real-world scenarios. Therefore, in practical applications, the performance of traditional methods deteriorates significantly when dealing with nonlinear, high-dimensional, and confounding data, thus limiting their practical value.

[0004] In recent years, advances in deep learning have opened up new possibilities for causal discovery in time-series data. Neural network-based methods, such as TCDF and NTS-NOTEARS, utilize structures like convolutional neural networks (CNNs) to capture high-dimensional features in time-series data and often combine them with attention mechanisms to identify potential causal relationships. These methods have demonstrated superior performance compared to traditional approaches in handling complex time-series data.

[0005] However, existing technologies, including early deep learning methods, still face a core challenge: real-world time series data often exhibit complex multi-scale periodicity. For example, financial data may contain intraday trading patterns, weekly economic cycles, and annual seasonal fluctuations; traffic flow data shows daily peak hours, weekly weekend effects, and seasonal variations. These nested periodic features reflect the dynamic changes of the system at different time scales, and the dependencies between variables may also change with scale. Most existing methods rely on fixed time windows or single-scale analysis, making it difficult to effectively model this hierarchical time structure, leading to incomplete or inaccurate causal discovery results.

[0006] An inherent conflict exists in existing technical architectures. On the one hand, convolutional networks (such as those used in TCDF) excel at capturing local patterns, but their limited receptive field makes it difficult to model causal relationships between variables that are geographically distant. On the other hand, while standard Transformer models can capture global context, they may ignore fine-grained periodic features and incur significant computational costs. This trade-off between "local" and "global" limits the expressive power of the models. Therefore, there is an urgent need in this field for a new technical solution that can overcome these shortcomings and accurately discover causal relationships from complex time-series data with multi-scale periodicity and dynamic dependencies. Summary of the Invention

[0007] To address the shortcomings of the aforementioned technologies, this invention provides a novel method for temporal causal discovery, namely, a temporal causal discovery method based on multi-scale attention fusion. By constructing a temporal causal relationship discovery model based on multi-scale attention fusion, it is possible to solve a series of problems related to insufficient accuracy and reliability in causal discovery when processing nonlinear time-series data with complex multi-scale periodicity and dynamic dependencies.

[0008] The technical solution to the problem solved by this invention is: a temporal causal discovery based on multi-scale attention fusion, comprising the following steps:

[0009] S1: Receives multivariate time series data;

[0010] S2: The data is processed by a two-branch time series prediction network to predict the target variable, wherein the two-branch time series prediction network includes, in parallel, a local relation module for capturing local dependencies and a global relation module for capturing global dependencies.

[0011] S3: Generate local attention scores from the local relation module and extract the global attention matrix from the global relation module;

[0012] S4: Fuse the local attention score and the global attention matrix to generate a fused attention score that quantifies the potential causal relationship;

[0013] S5: Based on the fused attention score, the Enhanced Permutation Importance Test (EPIT) is used to perform rigorous statistical verification of potential causal relationships to eliminate spurious correlations, thereby identifying and outputting the final causal graph;

[0014] Compared with the prior art, the significant advantages of this invention are:

[0015] This invention captures local periodic features and global long-range dependencies through a dual-branch architecture and combines an attention fusion mechanism to gain a more comprehensive understanding of the complex dynamics in the data, thus significantly improving the accuracy of causal discovery.

[0016] The core advantage of this invention lies in its ability to process nonlinear, high-dimensional time-series data with multi-scale periodicity, which is precisely the main bottleneck of existing methods. Through adaptive multi-scale time-slice partitioning based on Fast Fourier Transform (FFT), this method can automatically identify and focus on the inherent periodic patterns (such as daily, weekly, and seasonal patterns) in the data, rather than relying on fixed, preset time windows. This makes the invention more robust and applicable in practical applications in multiple fields such as finance, meteorology, and biomedicine.

[0017] Furthermore, this invention introduces the Enhanced Permutation Importance Test (EPIT) for causal verification. Compared to simple permutation tests, EPIT employs a rigorous one-sample t-test to assess the statistical significance of causal effects, thereby more effectively filtering out spurious correlations and improving the reliability of the final causal graph. In addition, by analyzing the convolution kernel weights to estimate time delays, a finer granularity is provided for understanding the dynamic process of causal effects. Attached Figure Description

[0018] Figure 1 This is a flowchart illustrating the overall process framework of the temporal causal discovery method based on multi-scale attention fusion of the present invention. Detailed Implementation

[0019] To better understand the present invention, the embodiments of the present invention will be explained in detail below with reference to the accompanying drawings.

[0020] A temporal causal discovery method based on multi-scale attention fusion, the overall process framework of which is as follows: Figure 1 As shown, it includes the following steps:

[0021] S1: Receives multivariate time series data;

[0022] S2: The data is processed by a two-branch time series prediction network to predict the target variable, wherein the network includes in parallel a local relation module for capturing local dependencies and a global relation module for capturing global dependencies;

[0023] S3: Generate local attention scores from the local relation module and extract the global attention matrix from the global relation module;

[0024] S4: Fuse the local attention score and the global attention matrix to generate a fused attention score that quantifies the potential causal relationship;

[0025] S5: Based on the fused attention score, the Enhanced Permutation Importance Test (EPIT) is used to perform rigorous statistical verification of potential causal relationships to eliminate spurious correlations, thereby identifying and outputting the final causal graph;

[0026] Furthermore, in step S1, this step is the starting point of the entire causal discovery process. The multivariate time series data is a collection of observations of multiple variables (e.g., multiple financial indicators, activity signals from multiple brain regions, etc.) at consecutive time points, and its mathematical form can be expressed as... Here, N represents the number of variables, and L represents the length of the time series. This raw data forms the basis for all subsequent analysis, modeling, and causal inference.

[0027] Furthermore, in step S2, the core objective is to comprehensively capture the complex dependencies between variables from different but complementary perspectives. This is because real-world time-series data often simultaneously contains local periodic patterns and global long-range dependencies, which a single-structure network cannot adequately handle. Therefore, a parallel dual-branch structure is designed:

[0028] Local Relations Module: This module's specific process consists of two main steps: "multi-scale segmentation" and "multi-scale attention causal convolution." The multi-scale segmentation takes the input temporal data... The Fast Fourier Transform (FFT) is applied to calculate each variable. Frequency domain representation :

[0029]

[0030] in, It is the imaginary unit. Represents frequency index, It is the length of the time series.

[0031] Calculate the average spectral magnitude of all variables. :

[0032]

[0033] in, It represents the total number of variables.

[0034] After excluding the DC component, the component with the largest amplitude was identified. frequency The corresponding period Considered as significant periods, forming scale sets Based on each identified significant period The time slice length at this scale is determined by the following formula. and sliding step length :

[0035]

[0036]

[0037] in, It is the first A significant cycle. and These are hyperparameters that control the sharding strategy. Specifically, Controlling the coverage of each time slice is typically set to... This ensures that each time slice fully covers at least one period, thereby capturing all features within that period; Control the degree of overlap between adjacent time slices, i.e., the sliding step size.

[0038] The multi-scale attention causal convolution processing flow is as follows: for scale-related... The A time slice Apply the scale-specific trainable attention vector Weighting,

[0039]

[0040] in, It is aimed at the first Each scale-specific trainable attention vector This represents element-wise multiplication (Hadamard product).

[0041] Attention-weighted input Send to the AD-DSTCN network. In the... Within the layer, the calculations include:

[0042] Depthwise convolution:

[0043]

[0044] in, It is the position index within the convolution kernel. It is the kernel size. It is the first In the layer network The depthwise convolution kernel of each channel is located at... The weight, It is the first The dilation factor of a layer typically varies with the number of layers. Exponential growth is used to effectively expand the receptive field without increasing computational costs.

[0045] Pointwise convolution:

[0046]

[0047] in, It is the first The weights of pointwise convolutions in a layered network.

[0048] Residual connectivity and activation:

[0049]

[0050] Global Relationship Module: This module adopts the innovative iTransformer architecture. Its core process treats the complete time series of each variable as an independent token and applies a self-attention mechanism along the variable dimension. The overall prediction process can be formalized as follows: For the input data... For embedding, the formula is as follows:

[0051]

[0052] The embedding results are sequentially passed to multiple encoder modules (EncoderBlock) for processing, as shown in the following formula:

[0053]

[0054] in, It is the layer index of the encoder module. It is the total number of layers in the iTransformer encoder.

[0055] The output of the last encoder is passed through a projection layer to obtain the final prediction result, as shown in the following formula:

[0056]

[0057] Furthermore, in step S3, the purpose is to quantify and extract the dependencies learned by the two branch networks during the prediction process, as preliminary evidence of potential causal relationships. These attention values ​​are not byproducts of the prediction task, but rather core information for causal discovery in this invention.

[0058] From the local relations module, a set of scale-aware local attention scores is generated. This set of scores is specifically represented as a collection, denoted as . This includes information for each identified time scale. Each vector has its own dedicated attention vector. These are all trainable parameters learned through backpropagation during training, quantifying the parameters at a specific scale. Below, all The relative importance of each input variable to the target variable.

[0059] The global attention matrix extracted from the global relation module is denoted as follows. This matrix is ​​generated by the module's built-in iTransformer architecture, which treats the complete time series of each variable as an independent unit (token) and applies a self-attention mechanism along the variable dimension. Therefore, each element in the matrix... It directly quantifies what the model learns from a global perspective, from variables. to variable The strength of dependence.

[0060] Furthermore, in step S4, the purpose is to integrate the advantages of the dual-branch network to obtain a more comprehensive and reliable causal strength measure that includes both multi-scale local details and global context. The fusion process is implemented through a dedicated attention fusion module, which includes two parallel enhancement paths; path 1 uses a set of scale-aware attention vectors from the local relation module. By transforming it with a learnable adaptive weighting matrix and a boosting matrix, the local multi-scale information it contains is incorporated into the global attention matrix. In this process, an enhanced global attention matrix is ​​generated. Path 2 from the global attention matrix The column vectors related to the target variable are extracted and processed through a multilayer perceptron network, incorporating global contextual information into the local attention vector. In the process, a set of enhanced local attention vectors is generated. Finally, the enhanced global attention matrix... and the enhanced local attention vector By integrating the results (e.g., through weighted averaging), a final unified fusion attention score is obtained. .

[0061] Furthermore, in step S5, the purpose is to ensure the authenticity and reliability of the ultimately discovered causal relationship, because a high attention score may only represent a strong correlation, not a true causal relationship. To address this issue, this invention proposes an Enhanced Permutation Importance Test (EPIT) method for rigorous statistical validation. Specifically, for each potential causal variable... In the original dataset Execution Several independent random permutation operations are performed to generate the dataset. In these data sets, there are only variables The dataset is permuted, and then the computational model is used to calculate the dataset after each permutation. Predicted loss And record its relative to the original data. Model loss Increment ,this The total loss increment resulting from each permutation constitutes an empirical distribution, and a single-sample test is performed on this distribution. The test is used to check whether the mean is significantly greater than zero. The value is less than the preset significance level. If so, then we reject the null hypothesis and thus conclude that the random permutation variable... The temporal information did indeed significantly increase the model's prediction error, thus confirming... Even after establishing a statistically significant causal relationship for the target variable, it is still necessary to estimate the time delay in the influence of the causal variable on the outcome variable. This invention utilizes convolutional kernel weights learned in the local relation module to estimate this delay. Specifically, for each layer of the network... In the convolution kernel Wi corresponding to the causal variable Xi, determine the index of the position of the weight with the largest absolute value. Connect this index to the expansion factor of that layer. Multiplying these layers gives the contribution of that layer to the total delay. The final total delay is calculated by summing the contributions of each layer.

[0062]

[0063] Only potential relationships that pass this test are confirmed as true causal relationships and incorporated into the final causal graph.

Claims

1. A method for causal discovery of time series data based on multi-scale attention fusion, characterized in that, The method comprises the following steps: S1: receiving multivariate time series data; S2: processing the data to predict the target variable through a double-branch time series prediction network, wherein the double-branch time series prediction network comprises a local relationship module for capturing local dependency and a global relationship module for capturing global dependency in parallel; S3: generating a local attention score from the local relationship module and extracting a global attention matrix from the global relationship module; S4: fusing the local attention score and the global attention matrix to generate a fused attention score quantifying potential causal relationships; S5: based on the fused attention score, performing strict statistical verification on the potential causal relationships by using enhanced permutation importance test (EPIT) to eliminate pseudo-correlations, thereby identifying and outputting a final causal graph.

2. The method of claim 1, wherein the method is based on multi-scale attention fusion for time series causal discovery. In the step S1, the multivariate time series data is a set of observations of multiple variables at consecutive time points, which can be mathematically represented as where represents the number of variables, represents the length of the time series.

3. The method of claim 1, wherein the method is based on multi-scale attention fusion. In the step S2, a parallel double-branch structure is designed: Local Relations Module: This module is implemented in two steps: "multi-scale segmentation" and "multi-scale attention causal convolution". The multi-scale segmentation takes the input temporal data... Apply Fast Fourier Transform to calculate each variable Frequency domain representation : wherein is the imaginary unit, denotes the frequency index, is the length of the time series; Calculate the average spectral magnitude of all variables : wherein is the total number of variables; After excluding the direct current component, the first frequency with the largest amplitude is identified as the dominant frequency , and the corresponding period is considered as the dominant period, forming a scale set , based on each identified dominant period , the time slice length and the sliding step length at this scale are determined by the following formula : wherein, is the th significant period, and are hyperparameters that control the fragmentation strategy, controls the coverage of each time slice, set to to ensure that each time slice can cover at least one period completely, so as to capture all features in the period; controls the degree of overlap between adjacent time slices, i.e. the step size of the sliding. The multi-scale attention causal convolution processing procedure is as follows: for the scale of the first time slice , the scale-specific trainable attention vector is applied for weighting, wherein, is a trainable attention vector specific to the dimension, denotes element-wise multiplication; attentively weighted input into the AD-DSTCN network, at the layer, the computation includes: Deep convolution: in, It is the position index within the convolution kernel. It is the size of the convolution kernel. It is the first In the layer network The depthwise convolution kernel of each channel is located at... The weight, It is the first The expansion factor of a layer typically varies with the number of layers. Exponential growth is used to effectively expand the receptive field without increasing computational costs; Point-wise convolution: wherein, is the first weight of the point-wise convolution in the layer network; Residual connection and activation: Global relationship module: This module adopts an innovative iTransformer architecture, whose core process is to regard the complete time series of each variable as an independent token and apply a self-attention mechanism in the variable dimension. The overall prediction process can be formalized as follows: embedding of input data , formula as follows: The embedding result is sequentially transmitted into multiple encoder modules for processing, and the formula is as follows: wherein, is an index of the number of layers of the encoder module, is the total number of layers of the iTransformer encoder; The output of the last encoder is transmitted through a projection layer to obtain a final prediction result, and the formula is as follows:

4. The method of claim 1, wherein the method is based on multi-scale attention fusion. The step S3 generates a set of scale-aware local attention scores from the local relationship module, which is a set of trainable parameter vectors, denoted as where contains the dedicated attention vector for each identified time scale Each vector is a trainable parameter learned through backpropagation during training, which quantifies the relative importance of all input variables to the prediction target variable at that particular scale The final value is obtained directly from the trained local relationship module after the model converges. From the global relation module, a global attention matrix is extracted, denoted as , which is the result of the self-attention mechanism inside the iTransformer encoder calculated on the variable dimension. The matrix element directly quantifies the dependency strength learned by the model from a global perspective from variable to variable .

5. The method of claim 1, wherein the method is based on multi-scale attention fusion. The fusion process in step S4 is implemented by a special attention fusion module, the implementation of which includes two parallel enhanced paths; path 1 transforms a set of scale-aware attention vectors from the local relation module , through a learnable adaptive weighting matrix and a lifting matrix, to incorporate the local multi-scale information contained therein into a global attention matrix , generating an enhanced global attention matrix ; Path 2 extracts the column vector related to the target variable from the global attention matrix , processes it through a multi-layer perception network, and integrates the global context information into the local attention vector , generates a set of enhanced local attention vectors ; finally, the enhanced global attention matrix and the enhanced local attention vector are integrated to obtain the final unified fusion attention score .

6. The method of claim 1, wherein: In step S5, the Enhanced Permutation Importance Test (EPIT) specifically involves: for each potential causal variable... In the original dataset Execution Several independent random permutation operations are performed to generate the dataset. In these data sets, there are only variables The dataset is permuted, and then the computational model is used to calculate the dataset after each permutation. Predicted loss And record its relative to the original data. Model loss Increment ,this The total loss increment resulting from each permutation constitutes an empirical distribution, and a single-sample test is performed on this distribution. The test is used to check whether the mean is significantly greater than zero. The value is less than the preset significance level. If so, then we reject the null hypothesis and thus conclude that the random permutation variable... The temporal information did indeed significantly increase the model's prediction error, thus confirming... After establishing a statistically significant causal relationship for the target variable, it is still necessary to estimate the time delay in the influence of the causal variable on the outcome variable. This delay is estimated using the convolutional kernel weights learned in the local relation module. Specifically, for each layer of the network... In the convolution kernel Wi corresponding to the causal variable Xi, determine the index of the position of the weight with the largest absolute value. Connect this index to the expansion factor of that layer. Multiplying these layers gives the contribution of that layer to the total delay. The final total delay is calculated by summing the contributions of each layer. 。