EEG channel effective connectivity analysis method based on fine-grained contrastive causal learning

By employing a fine-grained comparative causal learning approach, combined with Transformer multi-scale encoding and self-supervised verification, the nonlinear interactions and performance instability issues in EEG channel connectivity analysis under small sample scenarios are resolved. This approach achieves high-performance and highly interpretable EEG causal connectivity inference, making it suitable for emotion recognition and brain disease diagnosis.

CN122490195APending Publication Date: 2026-07-31XIAN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XIAN UNIV OF TECH
Filing Date
2026-04-30
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing methods for effective connectivity analysis of EEG channels struggle to capture complex nonlinear interactions, lack explicit encoding of neural temporal priors, have insufficient multi-scale feature fusion, lack systematic validation of causal results, and exhibit unstable performance in small-sample scenarios.

Method used

This method, based on fine-grained contrastive causal learning, achieves high-performance and highly interpretable EEG causal connection inference by combining a multi-scale temporal coding module and a self-supervised verification analysis module with Transformer multi-scale coding and triple self-supervised verification.

Benefits of technology

It achieves strong nonlinear modeling capabilities, clear temporal causal coding, good generalization performance with small samples, and high neural interpretability, making it suitable for fields such as emotion recognition, brain disease auxiliary diagnosis, and brain-computer interfaces.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122490195A_ABST
    Figure CN122490195A_ABST
Patent Text Reader

Abstract

This invention discloses a method for analyzing effective EEG channel connectivity based on fine-grained contrastive causal learning. First, multi-channel EEG signals are divided into frequency bands and time windows. Then, a multi-scale temporal coding module encodes the feature matrix of each channel. A contrastive causal learning module is constructed to learn the causal dependencies between channels through a contrastive learning task. A self-supervised verification analysis module is designed to verify the effectiveness of the discovered connections through a triple mechanism: causal similarity ranking, emotion classification performance evaluation, and consistency verification with traditional causal analysis methods. Finally, the causal strength matrix between channels and related verification indicators are output for use in brain network analysis or emotion recognition tasks. This invention achieves high-performance, highly interpretable, and strongly generalized EEG causal connectivity inference by reconstructing causal discovery into a temporally aware contrastive learning task, combined with Transformer multi-scale coding and triple self-supervised verification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the interdisciplinary field of biomedical signal processing and artificial intelligence, specifically involving a method for effective connectivity analysis of EEG channels based on fine-grained contrastive causal learning. Background Technology

[0002] Electroencephalography (EEG) is widely used in emotion recognition, cognitive assessment, and brain disease diagnosis due to its advantages such as high temporal resolution, non-invasiveness, and low cost. Effective connectivity analysis between EEG channels can reveal the information flow and temporal dependence between different brain regions, which is of great significance for understanding the neural mechanisms of higher brain functions such as emotion, attention, and memory.

[0003] Traditional effective connectivity analysis methods are mainly based on linear models such as Granger causality (GC) and directed transfer functions. While these methods are computationally simple and highly interpretable, they struggle to capture the complex nonlinear interactions in EEG signals, are sensitive to noise, and require pre-defined model orders, thus limiting their practical applications. In recent years, deep learning techniques, such as convolutional neural networks and recurrent neural networks, have been introduced into EEG analysis. However, these methods often neglect the causal temporal relationships between channels, suffer from fragmented feature learning, and lack generalization ability in small sample scenarios.

[0004] To address this, some studies have attempted to combine causal inference mechanisms with deep learning, such as LSTM-based causal modeling and graph neural networks combined with causal constraints. However, the following problems still exist: (1) Lack of explicit coding of neural temporal priors; (2) Insufficient fusion of multi-scale features; (3) The causal results lack systematic verification and have weak interpretability; (4) Performance is unstable in small sample and cross-subject scenarios. Summary of the Invention

[0005] The purpose of this invention is to provide an effective EEG channel connectivity analysis method based on fine-grained contrastive causal learning. By reconstructing causal discovery into a time-aware contrastive learning task, and combining Transformer multi-scale encoding with triple self-supervised verification, it achieves high-performance, highly interpretable, and strongly generalizable EEG causal connectivity inference.

[0006] The technical solution adopted in this invention is an EEG channel effective connectivity analysis method based on fine-grained contrastive causal learning, which is implemented according to the following steps: Step 1: Divide the multi-channel EEG signals into frequency bands and time windows, and extract the frequency band-time window feature matrix for each channel; Step 2: Encode the feature matrix of each channel using a multi-scale temporal coding module to obtain a channel-level global representation vector; Step 3: Construct a contrastive causal learning module, generate positive and negative sample pairs based on neural temporal priors, and learn the causal dependencies between channels through a contrastive learning task; Step 4: Design a self-supervised verification analysis module to verify the effectiveness of the discovered connections through a triple mechanism of causal similarity ranking, emotion classification performance evaluation, and consistency test with traditional causal analysis methods. Step 5: Output the causal strength matrix between channels and related validation metrics for use in brain network analysis or emotion recognition tasks.

[0007] The invention is further characterized in that, Step 1 is implemented in the following steps: Step 1.1: Preprocessing and trial division of raw EEG signals: Multichannel EEG signals were collected and divided into several independent samples according to the number of experimental trials. Each trial is represented as... ,in, For the number of channels, For each trial, denoising, baseline correction, and artifact removal are performed based on the number of time points. Step 1.2, Frequency Band Allocation: The preprocessed EEG signal was divided into five standard frequency bands by bandpass filtering: Delta (δ, 1–4 Hz), Theta (θ, 4–8 Hz), Alpha (α, 8–13 Hz), Beta (β, 13–30 Hz), and Gamma (γ, 30–45 Hz), with each band being retained independently. Step 1.3, Time Window Segmentation: For the time series under each frequency band, a sliding segmentation is performed using a fixed-length time window (5 time points), with adjacent windows not overlapping. For each channel, the following is obtained: A continuous time window; Step 1.4: Differential Entropy Feature Extraction Within each time window, differential entropy features are extracted from the signal in each frequency band. Differential entropy is defined as: (1) in, Let be the probability density function of the signal, and assume it follows a Gaussian distribution. This represents the variance of the signal in that frequency band. Step 1.5: Construct the frequency band-time window feature matrix: For each channel to put it in 5 frequency bands and The differential entropy features over each time window are organized into a two-dimensional matrix. The first dimension corresponds to the frequency band, and the second dimension corresponds to the time window. Step 1.6, Batch Data Organization: Organize the feature matrices of all channels into batch input data according to the trial dimension. ,in, For batch size, This represents the number of channels.

[0008] In step 2, the multi-scale temporal coding module consists of a linear projection layer, a sinusoidal position coding layer, a Transformer encoder, and a temporal average pooling layer. The Transformer encoder is composed of multiple stacked coding layers, each of which includes a multi-head self-attention layer, a residual connection and layer normalization layer, a feedforward network layer, and another residual connection and layer normalization layer.

[0009] Step 2 is implemented in the following steps: The input is the differential entropy feature matrix for each EEG channel. The first dimension represents 5 frequency bands (δ, θ, α, β, γ), and the second dimension represents 5 consecutive time windows; This represents the differential entropy energy distribution of the channel across 5 frequency bands and 5 time windows. The 5x5 real matrix space, after linear projection and sinusoidal position encoding, is input to the Transformer encoder: (2) in, This is the initial hidden layer representation. The linear projection weight matrix is For bias terms, For model dimensions.

[0010] Introducing position coding It adopts the form of a sine function: (3) in, Indicates the position of the time window. For dimensional indexing, For model dimensions; The encoder uses a multi-head self-attention mechanism to model inter-temporal window dependencies. An attention head, defined as: (4) in, For the first The layer's input representation; These are projection matrices for the query, key, and value, respectively. This represents the query vector, used to measure the degree of attention the current time window pays to other time windows; This represents the key vector, used to measure the weight of attention given to other time windows; Represents a value vector, used for weighted aggregation of information; Attention weights are calculated as follows: (5) in, Let be the dimension of the key vector. Used to scale the dot product result and prevent gradient vanishing; The outputs of all attention heads are concatenated and then subjected to a linear transformation: (6) in, For the total number of attention heads, To output the projection matrix; Each Transformer layer also contains a feedforward network: (7) in, , This is the weight matrix. For bias terms, The hidden layer dimension of the feedforward network; Stabilize training through residual connections and layer normalization: (8) (9) in, Presentation layer normalization operation; Finally, the channel global representation vector is obtained by performing average pooling on the time dimension: (10) in, This serves as a unified representation of the channel across multiple scales, which will be used for subsequent causal modeling. For the number of time windows (here) ), This represents the number of Transformer layers.

[0011] In step 3, the contrastive causal learning module consists of a positive and negative sample construction unit and a shared parameter encoder. Projector head It consists of a causality strength calculation unit, wherein the encoder Using the multi-scale timing coding module described in claim 3, the projection head It is a two-layer multilayer perceptron (MLP), consisting of a linear layer, a batch normalization layer, a ReLU activation layer, and another linear layer.

[0012] Step 3 is implemented in the following steps: In the contrastive causal learning module, positive samples are compared to previous frontal lobe channels within the time window. Internal activity is the cause, with the limbic system or temporal lobe pathway in the time window The activity within the brain is the result; negative sample pairs include time-reversed samples, samples paired within the same brain region, and randomly paired samples across trials, as detailed below: Based on the consensus of emotion neuroscience, the causal discovery task is transformed into a contrastive learning task by constructing positive and negative sample pairs: Positive samples, i.e., causal pairs, are defined as: (11) in, The feature matrix representing the source channel (cause) The feature matrix representing the target channel (result); For the prefrontal cortex channel, For the marginal / temporal lobe pathway; a delay of 10 time windows ensures temporal priority; Negative samples, i.e., non-causal pairs, include: 1. Time reversal:

[0013] 2. Matching within the same region:

[0014] 3. Random pairing across trials; channel pairs are randomly selected from different emotion trials. Define encoder With the projector head Causal strength is calculated using cosine similarity: (12) in, They represent channels respectively. The frequency band-time window feature matrix, This is the global representation vector output by the encoder. Low-dimensional embedding for the output of the projection head.

[0015] Step 3 uses the InfoNCE contrast loss and prediction loss to jointly optimize the model. The loss function is: (12) in, For InfoNCE contrast loss, To predict losses, These are weighting coefficients, typically .

[0016] Step 4, the self-supervised verification analysis module, consists of a causal similarity ranking unit, a feature aggregation unit, a logistic regression classifier, a Kendall's τ consistency calculation unit, and an Integrated Gradients attribution analysis unit, and is implemented according to the following steps: Step 4.1, Causal Similarity Ranking: For prefrontal channels With the marginal / temporal lobe channel All channel pairs are sorted from high to low according to the causal strength calculated in step 3, and the Top-K are selected as candidate causal paths. Step 4.2, Feature Aggregation and Sentiment Classification: Channel-level features are aggregated into sample-level vectors. Specifically, the mean and standard deviation of the encoder outputs for the prefrontal and limbic / temporal lobe channel sets are calculated separately and concatenated into a 64-dimensional vector. Input logistic regression classifier: (13) in, For the sigmoid function, For the weight vector, This is a bias term. Evaluation metrics include accuracy, F1 score, and AUC.

[0017] Step 4.3, Consistency test with traditional methods: Compare the FICCL ranking with the F-statistic ranking of the Granger causality test, and calculate Kendall's τ: (14) in, and These represent the number of consistent and inconsistent join pairs, respectively. The number of common connections; Step 4.4, Frequency Band Attribution Analysis: Integrated Gradients is used to quantify the contribution of each frequency band to causal decision-making. (15) in, As baseline input, For model output, For the first Input characteristics of each frequency band.

[0018] Step 5 outputs the following results: (1) Causality strength matrix ,in Number of channels; (2) Validation metrics: classification performance, consistency coefficient, and frequency band importance distribution; (3) Visualization results: such as brain network connectivity diagrams and frequency band contribution heatmaps.

[0019] The beneficial effects of this invention are as follows: The EEG channel effective connectivity analysis method based on fine-grained contrastive causal learning has the following advantages: 1. Strong nonlinear modeling capability: capturing complex causal dependencies through contrastive learning and Transformer architecture; 2. Clear temporal causal encoding: explicitly incorporating neural temporal priors of "cause precedes effect"; 3. Good generalization performance with small samples: self-supervised verification mechanism improves stability across subjects and datasets; 4. High neural interpretability: triple verification and frequency band attribution provide physiological rationality support; 5. Wide range of applications: applicable to multiple fields such as emotion recognition, brain disease auxiliary diagnosis, and brain-computer interfaces. Attached Figure Description

[0020] Figure 1 This is the overall framework diagram of FiCCL; Figure 2 Self-supervised verification analysis flowchart; Figure 3(a) shows the Sagittal causal connection patterns found on the DEAP dataset; Figure 3(b) shows the Axial causal connection patterns found on the DEAP dataset; Figure 3(c) shows the Coronal causal connection patterns found on the DEAP dataset; Figure 3(d) shows the Sagittal causal connection patterns found on the SEED dataset; Figure 3(e) shows the Axial causal connection patterns found on the SEED dataset; Figure 3(f) shows the Coronal causal connection patterns found on the SEED dataset; Figure 3(g) shows the Sagittal causal connection patterns found on the FACED dataset; Figure 3(h) shows the Axial causal connection patterns found on the FACED dataset; Figure 3(i) shows the Coronal causal connection patterns found on the FACED dataset; Figure 4(a) shows the classification performance metrics (F1-Score, Accuracy, and AUC) of FiCCL on three datasets. Figure 4(b) shows the convergence trend of the training loss of FiCCL on the three datasets; Figure 5(a) shows the consistency analysis of FiCCL and Granger causality test in the DEAP dataset across different frequency bands; Figure 5(b) shows the consistency analysis of FiCCL and Granger causality test in different frequency bands in the SEED dataset; Figure 5(c) shows the consistency analysis of FiCCL and Granger causality test in different frequency bands in the FACED dataset; Figure 5(d) shows the frequency band feature importance analysis—the frequency band attention weight distribution of FiCCL on the DEAP, SEED, and FACED datasets. Detailed Implementation

[0021] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.

[0022] Example 1 This invention is based on a fine-grained contrastive causal learning-based method for analyzing effective connectivity of EEG channels, combined with... Figure 1 The specific steps are as follows: Step 1: Divide the multi-channel EEG signals into frequency bands and time windows, and extract the frequency band-time window feature matrix for each channel; Step 1 is implemented in the following steps: Step 1.1: Preprocessing and trial division of raw EEG signals: Multichannel EEG signals were collected and divided into several independent samples according to the number of experimental trials. Each trial is represented as... ,in, For the number of channels, For each trial, denoising, baseline correction, and artifact removal are performed based on the number of time points. Step 1.2, Frequency Band Allocation: The preprocessed EEG signal was divided into five standard frequency bands by bandpass filtering: Delta (δ, 1–4 Hz), Theta (θ, 4–8 Hz), Alpha (α, 8–13 Hz), Beta (β, 13–30 Hz), and Gamma (γ, 30–45 Hz), with each band being retained independently. Step 1.3, Time Window Segmentation: For the time series under each frequency band, a sliding segmentation is performed using a fixed-length time window (5 time points), with adjacent windows not overlapping. For each channel, the following is obtained: A continuous time window; Step 1.4: Differential Entropy Feature Extraction Within each time window, differential entropy features are extracted from the signal in each frequency band. Differential entropy is defined as: (1) in, Let be the probability density function of the signal, and assume it follows a Gaussian distribution. This represents the variance of the signal in that frequency band. Step 1.5: Construct the frequency band-time window feature matrix: For each channel to put it in 5 frequency bands and The differential entropy features over each time window are organized into a two-dimensional matrix. The first dimension corresponds to the frequency band, and the second dimension corresponds to the time window. Step 1.6, Batch Data Organization: Organize the feature matrices of all channels into batch input data according to the trial dimension. ,in, For batch size, This represents the number of channels.

[0023] Step 2: Encode the feature matrix of each channel using a multi-scale temporal coding module to obtain a channel-level global representation vector; In step 2, the multi-scale temporal coding module consists of a linear projection layer, a sinusoidal position coding layer, a Transformer encoder, and a temporal average pooling layer. The Transformer encoder is composed of multiple stacked coding layers, each of which includes a multi-head self-attention layer, a residual connection and layer normalization layer, a feedforward network layer, and another residual connection and layer normalization layer.

[0024] Step 2 is implemented in the following steps: The input is the differential entropy feature matrix for each EEG channel. The first dimension represents 5 frequency bands (δ, θ, α, β, γ), and the second dimension represents 5 consecutive time windows; This represents the differential entropy energy distribution of the channel across 5 frequency bands and 5 time windows. The 5x5 real matrix space, after linear projection and sinusoidal position encoding, is input to the Transformer encoder: (2) in, This is the initial hidden layer representation. The linear projection weight matrix is For bias terms, For model dimensions.

[0025] Introducing position coding It adopts the form of a sine function: (3) in, Indicates the position of the time window. For dimensional indexing, For model dimensions; The encoder uses a multi-head self-attention mechanism to model inter-temporal window dependencies. An attention head, defined as: (4) in, For the first The layer's input representation; These are projection matrices for the query, key, and value, respectively. This represents the query vector, used to measure the degree of attention the current time window pays to other time windows; This represents the key vector, used to measure the weight of attention given to other time windows; Represents a value vector, used for weighted aggregation of information; Attention weights are calculated as follows: (5) in, Let be the dimension of the key vector. Used to scale the dot product result and prevent gradient vanishing; The outputs of all attention heads are concatenated and then subjected to a linear transformation: (6) in, For the total number of attention heads, To output the projection matrix; Each Transformer layer also contains a feedforward network: (7) in, , This is the weight matrix. For bias terms, The hidden layer dimension of the feedforward network; Stabilize training through residual connections and layer normalization: (8) (9) in, Presentation layer normalization operation; Finally, the channel global representation vector is obtained by performing average pooling on the time dimension: (10) in, This serves as a unified representation of the channel across multiple scales, which will be used for subsequent causal modeling. For the number of time windows (here) ), This represents the number of Transformer layers.

[0026] Step 3: Construct a contrastive causal learning module, generate positive and negative sample pairs based on neural temporal priors, and learn the causal dependencies between channels through a contrastive learning task; In step 3, the contrastive causal learning module consists of a positive and negative sample construction unit and a shared parameter encoder. Projector head It consists of a causality strength calculation unit, wherein the encoder Using the multi-scale timing coding module described in claim 3, the projection head It is a two-layer multilayer perceptron (MLP), consisting of a linear layer, a batch normalization layer, a ReLU activation layer, and another linear layer.

[0027] Step 3 is implemented in the following steps: In the contrastive causal learning module, positive samples are compared to previous frontal lobe channels within the time window. Internal activity is the cause, with the limbic system or temporal lobe pathway in the time window The activity within the brain is the result; negative sample pairs include time-reversed samples, samples paired within the same brain region, and randomly paired samples across trials, as detailed below: Based on the consensus of emotion neuroscience, the causal discovery task is transformed into a contrastive learning task by constructing positive and negative sample pairs: Positive samples, i.e., causal pairs, are defined as: (11) in, The feature matrix representing the source channel (cause) The feature matrix representing the target channel (result); For the prefrontal cortex channel, For the marginal / temporal lobe pathway; a delay of 10 time windows ensures temporal priority; Negative samples, i.e., non-causal pairs, include: 1. Time reversal:

[0028] 2. Matching within the same region:

[0029] 3. Random pairing across trials; channel pairs are randomly selected from different emotion trials. Define encoder With the projector head Causal strength is calculated using cosine similarity: (12) in, They represent channels respectively. The frequency band-time window feature matrix, This is the global representation vector output by the encoder. Low-dimensional embedding for the output of the projection head.

[0030] Step 3 uses the InfoNCE contrast loss and prediction loss to jointly optimize the model. The loss function is: (12) in, For InfoNCE contrast loss, To predict losses, These are weighting coefficients, typically .

[0031] Step 4: Design a self-supervised verification analysis module to verify the effectiveness of the discovered connections through a triple mechanism of causal similarity ranking, emotion classification performance evaluation, and consistency test with traditional causal analysis methods. Step 4, the self-supervised verification analysis module, consists of a causal similarity ranking unit, a feature aggregation unit, a logistic regression classifier, a Kendall's τ consistency calculation unit, and an Integrated Gradients attribution analysis unit, and is implemented according to the following steps: Step 4.1, Causal Similarity Ranking: For prefrontal channels With the marginal / temporal lobe channel All channel pairs are sorted from high to low according to the causal strength calculated in step 3, and the Top-K are selected as candidate causal paths. Step 4.2, Feature Aggregation and Sentiment Classification: Channel-level features are aggregated into sample-level vectors. Specifically, the mean and standard deviation of the encoder outputs for the prefrontal and limbic / temporal lobe channel sets are calculated separately and concatenated into a 64-dimensional vector. Input logistic regression classifier: (13) in, For the sigmoid function, For the weight vector, This is a bias term. Evaluation metrics include accuracy, F1 score, and AUC.

[0032] Step 4.3, Consistency test with traditional methods: Compare the FICCL ranking with the F-statistic ranking of the Granger causality test, and calculate Kendall's τ: (14) in, and These represent the number of consistent and inconsistent join pairs, respectively. The number of common connections; Step 4.4, Frequency Band Attribution Analysis: Integrated Gradients is used to quantify the contribution of each frequency band to causal decision-making. (15) in, As baseline input, For model output, For the first Input characteristics of each frequency band.

[0033] Step 5: Output the causal strength matrix between channels and related validation metrics for use in brain network analysis or emotion recognition tasks.

[0034] Step 5 outputs the following results: (1) Causality strength matrix ,in Number of channels; (2) Validation metrics: classification performance, consistency coefficient, and frequency band importance distribution; (3) Visualization results: such as brain network connectivity diagrams and frequency band contribution heatmaps.

[0035] Example 2 This invention is based on a fine-grained contrastive causal learning-based method for analyzing effective connectivity in EEG channels, and is implemented according to the following steps: Step 1: Divide the multi-channel EEG signals into frequency bands and time windows, and extract the frequency band-time window feature matrix for each channel; Step 2: Encode the feature matrix of each channel using a multi-scale temporal coding module to obtain a channel-level global representation vector; Step 3: Construct a contrastive causal learning module, generate positive and negative sample pairs based on neural temporal priors, and learn the causal dependencies between channels through a contrastive learning task; Step 4: Design a self-supervised verification analysis module to verify the effectiveness of the discovered connections through a triple mechanism of causal similarity ranking, emotion classification performance evaluation, and consistency test with traditional causal analysis methods. Step 5: Output the causal strength matrix between channels and related validation metrics for use in brain network analysis or emotion recognition tasks.

[0036] Example 3 This invention is based on a fine-grained contrastive causal learning-based method for analyzing effective connectivity of EEG channels, combined with... Figure 1 The specific steps are as follows: Step 1: Divide the multi-channel EEG signals into frequency bands and time windows, and extract the frequency band-time window feature matrix for each channel; Step 1 is implemented in the following steps: Step 1.1: Preprocessing and trial division of raw EEG signals: Multichannel EEG signals were collected and divided into several independent samples according to the number of experimental trials. Each trial is represented as... ,in, For the number of channels, For each trial, denoising, baseline correction, and artifact removal are performed based on the number of time points. Step 1.2, Frequency Band Allocation: The preprocessed EEG signal was divided into five standard frequency bands by bandpass filtering: Delta (δ, 1–4 Hz), Theta (θ, 4–8 Hz), Alpha (α, 8–13 Hz), Beta (β, 13–30 Hz), and Gamma (γ, 30–45 Hz), with each band being retained independently. Step 1.3, Time Window Segmentation: For the time series under each frequency band, a sliding segmentation is performed using a fixed-length time window (5 time points), with adjacent windows not overlapping. For each channel, the following is obtained: A continuous time window; Step 1.4: Differential Entropy Feature Extraction Within each time window, differential entropy features are extracted from the signal in each frequency band. Differential entropy is defined as: (1) in, Let be the probability density function of the signal, and assume it follows a Gaussian distribution. This represents the variance of the signal in that frequency band. Step 1.5: Construct the frequency band-time window feature matrix: For each channel to put it in 5 frequency bands and The differential entropy features over each time window are organized into a two-dimensional matrix. The first dimension corresponds to the frequency band, and the second dimension corresponds to the time window. Step 1.6, Batch Data Organization: Organize the feature matrices of all channels into batch input data according to the trial dimension. ,in, For batch size, This represents the number of channels.

[0037] Step 2: Encode the feature matrix of each channel using a multi-scale temporal coding module to obtain a channel-level global representation vector; In step 2, the multi-scale temporal coding module consists of a linear projection layer, a sinusoidal position coding layer, a Transformer encoder, and a temporal average pooling layer. The Transformer encoder is composed of multiple stacked coding layers, each of which includes a multi-head self-attention layer, a residual connection and layer normalization layer, a feedforward network layer, and another residual connection and layer normalization layer.

[0038] Step 2 is implemented in the following steps: The input is the differential entropy feature matrix for each EEG channel. The first dimension represents 5 frequency bands (δ, θ, α, β, γ), and the second dimension represents 5 consecutive time windows; This represents the differential entropy energy distribution of the channel across 5 frequency bands and 5 time windows. The 5x5 real matrix space, after linear projection and sinusoidal position encoding, is input to the Transformer encoder: (2) in, This is the initial hidden layer representation. The linear projection weight matrix is For bias terms, For model dimensions.

[0039] Introducing position coding It adopts the form of a sine function: (3) in, Indicates the position of the time window. For dimensional indexing, For model dimensions; The encoder uses a multi-head self-attention mechanism to model inter-temporal window dependencies. An attention head, defined as: (4) in, For the first The layer's input representation; These are projection matrices for the query, key, and value, respectively. This represents the query vector, used to measure the degree of attention the current time window pays to other time windows; This represents the key vector, used to measure the weight of attention given to other time windows; Represents a value vector, used for weighted aggregation of information; Attention weights are calculated as follows: (5) in, Let be the dimension of the key vector. Used to scale the dot product result and prevent gradient vanishing; The outputs of all attention heads are concatenated and then subjected to a linear transformation: (6) in, For the total number of attention heads, To output the projection matrix; Each Transformer layer also contains a feedforward network: (7) in, , This is the weight matrix. For bias terms, The hidden layer dimension of the feedforward network; Stabilize training through residual connections and layer normalization: (8) (9) in, Presentation layer normalization operation; Finally, the channel global representation vector is obtained by performing average pooling on the time dimension: (10) in, This serves as a unified representation of the channel across multiple scales, which will be used for subsequent causal modeling. For the number of time windows (here) ), This represents the number of Transformer layers.

[0040] Step 3: Construct a contrastive causal learning module, generate positive and negative sample pairs based on neural temporal priors, and learn the causal dependencies between channels through a contrastive learning task; Step 4: Design a self-supervised verification analysis module to verify the effectiveness of the discovered connections through a triple mechanism of causal similarity ranking, emotion classification performance evaluation, and consistency test with traditional causal analysis methods. Step 5: Output the causal strength matrix between channels and related validation metrics for use in brain network analysis or emotion recognition tasks.

[0041] Example 4 This invention is based on a fine-grained contrastive causal learning-based method for analyzing effective connectivity of EEG channels, combined with... Figure 1 The specific steps are as follows: Step 1: Divide the multi-channel EEG signals into frequency bands and time windows, and extract the frequency band-time window feature matrix for each channel; Step 1 is implemented in the following steps: Step 1.1: Preprocessing and trial division of raw EEG signals: Multichannel EEG signals were collected and divided into several independent samples according to the number of experimental trials. Each trial is represented as... ,in, For the number of channels, For each time point, denoising, baseline correction, and artifact removal are performed on the data from each trial. Step 1.2, Frequency Band Allocation: The preprocessed EEG signal was divided into five standard frequency bands by bandpass filtering: Delta (δ, 1–4 Hz), Theta (θ, 4–8 Hz), Alpha (α, 8–13 Hz), Beta (β, 13–30 Hz), and Gamma (γ, 30–45 Hz), with each band being retained independently. Step 1.3, Time Window Segmentation: For the time series under each frequency band, a sliding segmentation is performed using a fixed-length time window (5 time points), with adjacent windows not overlapping. For each channel, the following is obtained: A continuous time window; Step 1.4: Differential Entropy Feature Extraction Within each time window, differential entropy features are extracted from the signal in each frequency band. Differential entropy is defined as: (1) in, Let be the probability density function of the signal, and assume it follows a Gaussian distribution. This represents the variance of the signal in that frequency band. Step 1.5: Construct the frequency band-time window feature matrix: For each channel to put it in 5 frequency bands and The differential entropy features over each time window are organized into a two-dimensional matrix. The first dimension corresponds to the frequency band, and the second dimension corresponds to the time window. Step 1.6, Batch Data Organization: Organize the feature matrices of all channels into batch input data according to the trial dimension. ,in, For batch size, This represents the number of channels.

[0042] Step 2: Encode the feature matrix of each channel using a multi-scale temporal coding module to obtain a channel-level global representation vector; In step 2, the multi-scale temporal coding module consists of a linear projection layer, a sinusoidal position coding layer, a Transformer encoder, and a temporal average pooling layer. The Transformer encoder is composed of multiple stacked coding layers, each of which includes a multi-head self-attention layer, a residual connection and layer normalization layer, a feedforward network layer, and another residual connection and layer normalization layer.

[0043] Step 2 is implemented in the following steps: The input is the differential entropy feature matrix for each EEG channel. The first dimension represents 5 frequency bands (δ, θ, α, β, γ), and the second dimension represents 5 consecutive time windows; This represents the differential entropy energy distribution of the channel across 5 frequency bands and 5 time windows. The 5x5 real matrix space, after linear projection and sinusoidal position encoding, is input to the Transformer encoder: (2) in, This is the initial hidden layer representation. The linear projection weight matrix is For bias terms, For model dimensions.

[0044] Introducing position coding It adopts the form of a sine function: (3) in, Indicates the position of the time window. For dimensional indexing, For model dimensions; The encoder uses a multi-head self-attention mechanism to model inter-temporal window dependencies. An attention head, defined as: (4) in, For the first The layer's input representation; These are projection matrices for the query, key, and value, respectively. This represents the query vector, used to measure the degree of attention the current time window pays to other time windows; This represents the key vector, used to measure the weight of attention given to other time windows; Represents a value vector, used for weighted aggregation of information; Attention weights are calculated as follows: (5) in, Let be the dimension of the key vector. Used to scale the dot product result and prevent gradient vanishing; The outputs of all attention heads are concatenated and then subjected to a linear transformation: (6) in, For the total number of attention heads, To output the projection matrix; Each Transformer layer also contains a feedforward network: (7) in, , This is the weight matrix. For bias terms, The hidden layer dimension of the feedforward network; Stabilize training through residual connections and layer normalization: (8) (9) in, Presentation layer normalization operation; Finally, the channel global representation vector is obtained by performing average pooling on the time dimension: (10) in, This serves as a unified representation of the channel across multiple scales, which will be used for subsequent causal modeling. For the number of time windows (here) ), This represents the number of Transformer layers.

[0045] Step 3: Construct a contrastive causal learning module, generate positive and negative sample pairs based on neural temporal priors, and learn the causal dependencies between channels through a contrastive learning task; In step 3, the contrastive causal learning module consists of a positive and negative sample construction unit and a shared parameter encoder. Projector head It consists of a causality strength calculation unit, wherein the encoder Using the multi-scale timing coding module described in claim 3, the projection head It is a two-layer multilayer perceptron (MLP), consisting of a linear layer, a batch normalization layer, a ReLU activation layer, and another linear layer.

[0046] Step 3 is implemented in the following steps: In the contrastive causal learning module, positive samples are compared to previous frontal lobe channels within the time window. Internal activity is the cause, with the limbic system or temporal lobe pathway in the time window The activity within the brain is the result; negative sample pairs include time-reversed samples, samples paired within the same brain region, and randomly paired samples across trials, as detailed below: Based on the consensus of emotion neuroscience, the causal discovery task is transformed into a contrastive learning task by constructing positive and negative sample pairs: Positive samples, i.e., causal pairs, are defined as: (11) in, The feature matrix representing the source channel (cause) The feature matrix representing the target channel (result); For the prefrontal cortex channel, For the marginal / temporal lobe pathway; a delay of 10 time windows ensures temporal priority; Negative samples, i.e., non-causal pairs, include: 1. Time reversal:

[0047] 2. Matching within the same region:

[0048] 3. Random pairing across trials; channel pairs are randomly selected from different emotion trials. Define encoder With the projector head Causal strength is calculated using cosine similarity: (12) in, They represent channels respectively. The frequency band-time window feature matrix, This is the global representation vector output by the encoder. Low-dimensional embedding for the output of the projection head.

[0049] Step 3 uses the InfoNCE contrast loss and prediction loss to jointly optimize the model. The loss function is: (12) in, For InfoNCE contrast loss, To predict losses, These are weighting coefficients, typically .

[0050] Step 4: Design a self-supervised verification analysis module to verify the effectiveness of the discovered connections through a triple mechanism of causal similarity ranking, emotion classification performance evaluation, and consistency test with traditional causal analysis methods. Step 5: Output the causal strength matrix between channels and related validation metrics for use in brain network analysis or emotion recognition tasks.

[0051] Example 5 This invention is based on a fine-grained contrastive causal learning-based method for analyzing effective connectivity of EEG channels, combined with... Figure 1 The specific steps are as follows: Step 1: Divide the multi-channel EEG signals into frequency bands and time windows, and extract the frequency band-time window feature matrix for each channel; Step 1 is implemented in the following steps: Step 1.1: Preprocessing and trial division of raw EEG signals: Multichannel EEG signals were collected and divided into several independent samples according to the number of experimental trials. Each trial is represented as... ,in, For the number of channels, For each trial, denoising, baseline correction, and artifact removal are performed based on the number of time points. Step 1.2, Frequency Band Allocation: The preprocessed EEG signal was divided into five standard frequency bands by bandpass filtering: Delta (δ, 1–4 Hz), Theta (θ, 4–8 Hz), Alpha (α, 8–13 Hz), Beta (β, 13–30 Hz), and Gamma (γ, 30–45 Hz), with each band being retained independently. Step 1.3, Time Window Segmentation: For the time series under each frequency band, a sliding segmentation is performed using a fixed-length time window (5 time points), with adjacent windows not overlapping. For each channel, the following is obtained: A continuous time window; Step 1.4: Differential Entropy Feature Extraction Within each time window, differential entropy features are extracted from the signal in each frequency band. Differential entropy is defined as: (1) in, Let be the probability density function of the signal, and assume it follows a Gaussian distribution. This represents the variance of the signal in that frequency band. Step 1.5: Construct the frequency band-time window feature matrix: For each channel to put it in 5 frequency bands and The differential entropy features over each time window are organized into a two-dimensional matrix. The first dimension corresponds to the frequency band, and the second dimension corresponds to the time window. Step 1.6, Batch Data Organization: Organize the feature matrices of all channels into batch input data according to the trial dimension. ,in, For batch size, This represents the number of channels.

[0052] Step 2: Encode the feature matrix of each channel using a multi-scale temporal coding module to obtain a channel-level global representation vector; In step 2, the multi-scale temporal coding module consists of a linear projection layer, a sinusoidal position coding layer, a Transformer encoder, and a temporal average pooling layer. The Transformer encoder is composed of multiple stacked coding layers, each of which includes a multi-head self-attention layer, a residual connection and layer normalization layer, a feedforward network layer, and another residual connection and layer normalization layer.

[0053] Step 2 is implemented in the following steps: The input is the differential entropy feature matrix for each EEG channel. The first dimension represents 5 frequency bands (δ, θ, α, β, γ), and the second dimension represents 5 consecutive time windows; This represents the differential entropy energy distribution of the channel across 5 frequency bands and 5 time windows. The 5x5 real matrix space, after linear projection and sinusoidal position encoding, is input to the Transformer encoder: (2) in, This is the initial hidden layer representation. The linear projection weight matrix is For bias terms, For model dimensions.

[0054] Introducing position coding It adopts the form of a sine function: (3) in, Indicates the position of the time window. For dimensional indexing, For model dimensions; The encoder uses a multi-head self-attention mechanism to model inter-temporal window dependencies. An attention head, defined as: (4) in, For the first The layer's input representation; These are projection matrices for the query, key, and value, respectively. This represents the query vector, used to measure the degree of attention the current time window pays to other time windows; This represents the key vector, used to measure the weight of attention given to other time windows; Represents a value vector, used for weighted aggregation of information; Attention weights are calculated as follows: (5) in, Let be the dimension of the key vector. Used to scale the dot product result and prevent gradient vanishing; The outputs of all attention heads are concatenated and then subjected to a linear transformation: (6) in, For the total number of attention heads, To output the projection matrix; Each Transformer layer also contains a feedforward network: (7) in, , This is the weight matrix. For bias terms, The hidden layer dimension of the feedforward network; Stabilize training through residual connections and layer normalization: (8) (9) in, Presentation layer normalization operation; Finally, the channel global representation vector is obtained by performing average pooling on the time dimension: (10) in, This serves as a unified representation of the channel across multiple scales, which will be used for subsequent causal modeling. For the number of time windows (here) ), This represents the number of Transformer layers.

[0055] Step 3: Construct a contrastive causal learning module, generate positive and negative sample pairs based on neural temporal priors, and learn the causal dependencies between channels through a contrastive learning task; In step 3, the contrastive causal learning module consists of a positive and negative sample construction unit and a shared parameter encoder. Projector head It consists of a causality strength calculation unit, wherein the encoder Using the multi-scale timing coding module described in claim 3, the projection head It is a two-layer multilayer perceptron (MLP), consisting of a linear layer, a batch normalization layer, a ReLU activation layer, and another linear layer.

[0056] Step 3 is implemented in the following steps: In the contrastive causal learning module, positive samples are compared to previous frontal lobe channels within the time window. Internal activity is the cause, with the limbic system or temporal lobe pathway in the time window The activity within the brain is the result; negative sample pairs include time-reversed samples, samples paired within the same brain region, and randomly paired samples across trials, as detailed below: Based on the consensus of emotion neuroscience, the causal discovery task is transformed into a contrastive learning task by constructing positive and negative sample pairs: Positive samples, i.e., causal pairs, are defined as: (11) in, The feature matrix representing the source channel (cause) The feature matrix representing the target channel (result); For the prefrontal cortex channel, For the marginal / temporal lobe pathway; a delay of 10 time windows ensures temporal priority; Negative samples, i.e., non-causal pairs, include: 1. Time reversal:

[0057] 2. Matching within the same region:

[0058] 3. Random pairing across trials; channel pairs are randomly selected from different emotion trials. Define encoder With the projector head Causal strength is calculated using cosine similarity: (12) in, They represent channels respectively. The frequency band-time window feature matrix, This is the global representation vector output by the encoder. Low-dimensional embedding for the output of the projection head.

[0059] Step 3 uses the InfoNCE contrast loss and prediction loss to jointly optimize the model. The loss function is: (12) in, For InfoNCE contrast loss, To predict losses, These are weighting coefficients, typically .

[0060] Step 4: Design a self-supervised verification analysis module to verify the effectiveness of the discovered connections through a triple mechanism of causal similarity ranking, emotion classification performance evaluation, and consistency test with traditional causal analysis methods. Step 4, the self-supervised verification analysis module, consists of a causal similarity ranking unit, a feature aggregation unit, a logistic regression classifier, a Kendall's τ consistency calculation unit, and an Integrated Gradients attribution analysis unit, and is implemented according to the following steps: Step 4.1, Causal Similarity Ranking: For prefrontal channels With the marginal / temporal lobe channel All channel pairs are sorted from high to low according to the causal strength calculated in step 3, and the Top-K are selected as candidate causal paths. Step 4.2, Feature Aggregation and Sentiment Classification: Channel-level features are aggregated into sample-level vectors. Specifically, the mean and standard deviation of the encoder outputs for the prefrontal and limbic / temporal lobe channel sets are calculated separately and concatenated into a 64-dimensional vector. Input logistic regression classifier: (13) in, For the sigmoid function, For the weight vector, This is a bias term. Evaluation metrics include accuracy, F1 score, and AUC.

[0061] Step 4.3, Consistency test with traditional methods: Compare the FICCL ranking with the F-statistic ranking of the Granger causality test, and calculate Kendall's τ: (14) in, and These represent the number of consistent and inconsistent join pairs, respectively. The number of common connections; Step 4.4, Frequency Band Attribution Analysis: Integrated Gradients is used to quantify the contribution of each frequency band to causal decision-making. (15) in, As baseline input, For model output, For the first Input characteristics of each frequency band.

[0062] Step 5: Output the causal strength matrix between channels and related validation metrics for use in brain network analysis or emotion recognition tasks.

[0063] Example 6 1. Dataset Based on three EEG emotion datasets—DEAP, SEED, and FACED—this study comprehensively evaluates the generalization ability of the proposed method across different emotion induction paradigms, task types, and annotation formats. DEAP (32 participants) evoked emotions using 40 music videos, providing valence and arousal dimensions with continuous ratings from 1 to 9. SEED (15 participants) evoked emotions using 15 movie clips, with emotion labels categorized as positive, neutral, and negative, exhibiting clear category boundaries and a high signal-to-noise ratio. FACED (27 participants) provided continuous second-by-second valence and arousal ratings while watching movies, more closely reflecting dynamic emotional changes in real life and demonstrating high ecological validity. Unified validation on these three datasets systematically examines the robustness and adaptability of the method across different task paradigms, providing comprehensive evidence for its effectiveness across datasets and multiple scenarios.

[0064] 2. Experimental Setup In the specific experiments, Python 3.13 was chosen as the programming language, CUDA 12.8 was used, and PyTorch 2.7.1 was used as the deep learning framework. Detailed hardware and software parameters, including but not limited to CPU model, memory size, GPU model, and video memory capacity, are shown in Table 1 to ensure the reproducibility of the experimental results.

[0065] Table 1 Experimental Environment

[0066] 3. Model parameters This study constructs a FiCCL parameter system that balances performance and rationality. Regarding the model architecture: the input dimension is set to 5, corresponding to the five standard frequency bands from Delta to Gamma; the encoder's hidden layer dimension is 64, achieving a balance between model complexity and expressive power; a 4-head attention mechanism supports learning feature representations from multiple subspaces; a 2-layer encoder ensures feature depth while avoiding training difficulties; the feedforward network is extended to 128 dimensions to enhance nonlinear transformation capabilities; the positional encoding has a maximum length of 50 to cover the time-varying characteristics of the signal; the projection head uses a two-layer MLP to compress the 64-dimensional features into a 16-dimensional contrast space, and batch normalization and ReLU ensure training stability. Regarding training hyperparameters: the Adam optimizer is used with a learning rate of 1e. -4 Ensure smooth updates, with a weight decay of 1e. -5Suppressing overfitting; batch size of 64 balances training efficiency and memory consumption; temperature parameter of 0.1 optimizes the similarity distribution of positive and negative samples; 50 training cycles combined with an early stopping mechanism prevent overfitting; Gaussian noise (standard deviation 0.01) enhances data robustness; gradient clipping threshold of 1.0 avoids gradient explosion. The coordinated optimization of model architecture parameters and training hyperparameters has a decisive impact on the performance of FiCCL; reasonable parameter configuration can enhance the model's generalization ability across different datasets.

[0067] 4. Discovery of causal connections To verify the performance of FiCCL in discovering effective channel connections, this study conducted causal connection discovery experiments on three datasets. Figure 3 visually illustrates the top ten strongest causal connections discovered by FiCCL in each dataset, and Table 2 lists the corresponding channel pairs and their causal weights. Experimental results show that FiCCL can identify inter-channel causal patterns with explicit neural interpretations.

[0068] Table 2. Top ten causal connections and their strengths in the three datasets.

[0069] As shown in Figures 3(a) to 3(i) and Table 2, in DEAP, the path with the highest causal strength is AF4→P7 (weight = 1.0000), and other significant connections include FC5→CP6 (0.9944). Prefrontal cortex-related channels (such as AF4 and FC5) frequently appear as causal sources, reflecting their regulatory role in the emotion processing network. In SEED, the connection strength of F4→O1 is the highest (1.0000), followed closely by connections such as AF4→P7 (0.9315), further confirming the key position of prefrontal cortex-related channels in the emotion network. In FACED, connections from the central frontal lobe to the occipital lobe (such as FC6→O2 and FC5→PO4) are dominant, reflecting the information flow in visual emotion processing. The analysis reveals two key patterns: First, prefrontal cortex-related channels (AF3, AF4, F3, F4, FC5, and FC6) frequently appear as causal sources, consistent with the classic theory of "prefrontal cortex regulating emotion." Secondly, the target channels exhibited functional specificity: the occipital lobe channels (O1 / O2 / PO3 / PO4) served as nodes for visual emotion processing, the temporal lobe channels (T7 / T8) were associated with emotional memory, and the parietal lobe channels (P7 / P8) participated in spatial attention integration. The connection strengths across all datasets showed a continuous gradient distribution (top-level connection scores ranged from 1.0000 to 0.76–0.83), indicating that FiCCL can not only identify strong causal connections but also effectively rank connection strengths, validating its effectiveness in channel connectivity analysis.

[0070] 5. Classification performance After validating the effectiveness of FiCCL in causal connection discovery, this study further evaluates the discriminative power of its learned feature representations in downstream emotion classification tasks. Systematic testing on three datasets aims to verify the emotion discrimination ability of FiCCL features and analyze the impact of different experimental paradigms on classification performance, providing empirical support for the practical application value of the method. The results are shown in Figures 4(a) to 4(b).

[0071] As shown in Figure 4(a), FiCCL demonstrates stable classification performance across all three datasets. It achieves the best result on SEED, with an AUC of 0.879, showcasing FiCCL's effective feature extraction capabilities on high-quality data. In the DEAP arousal classification task, the AUC reaches 0.824, demonstrating FiCCL's adaptability and robustness to moderately complex tasks. On FACED, where the label is continuous rating, FiCCL still achieves an AUC of 0.792, confirming its ability to handle fine-grained, non-linear emotional changes and validating its applicability and generalization potential in handling complex tasks.

[0072] The stability of the training process is an important indicator for evaluating the reliability of a method. As shown in Figure 4(b), the training loss demonstrates that FiCCL exhibits stable convergence on all three datasets. Specifically, the DEAP loss decreased from 4.26 to 3.39, SEED from 4.95 to 2.99, and FACED from 4.67 to 3.75, with loss reductions of 0.87, 1.96, and 0.92, respectively. This convergence pattern not only verifies the synergistic optimization effect of the contrastive learning objective and the prediction auxiliary loss but also reflects the robustness of the model structure. The stable convergence across datasets indicates that FiCCL still possesses good optimization stability and generalization ability in small-sample, multi-task scenarios, providing a reliable basis for model deployment and tuning in practical applications.

[0073] 6. Consistency Analysis To verify whether the causal connections between channels discovered by FiCCL have physiological rationality, this invention performs a ranking consistency analysis (Kendall's τ) on five frequency bands with the GC test, thereby evaluating whether FiCCL can achieve interpretable consensus with traditional methods in key frequency bands while maintaining the advantages of nonlinear modeling. The multi-dimensional evaluation of the effective connection discovery by FiCCL is shown in Figures 5(a), 5(b), and 5(c).

[0074] As shown in Figures 5(a), 5(b), and 5(c), in DEAP, Delta (τ=0.1556) and Gamma (τ=0.1556) bands exhibit a significant positive correlation. Gamma is closely related to emotional integration, higher cognitive binding, and conscious processing, and its consistency better matches the high-frequency synchronous neural mechanisms during emotion induction, indicating that FiCCL successfully captures cross-channel phase coupling in emotional states. In SEED, Beta shows the highest consistency (τ=0.1556). Beta is typically associated with emotion maintenance, cognitive control, and sustained attention, matching the sustained emotional processing induced by film clips in SEED. The consistency between FiCCL and the GC method in this band indicates that it can adaptively focus on task-related rhythmic activities and identify connection patterns consistent with the neural model of emotion regulation, such as AF4→O1, which conforms to "top-down" regulatory pathways. In FACED, Gamma (τ=0.0245) was the highest among all frequency bands. The FACED task requires participants to continuously rate subjective emotions on dynamic facial expressions. As the core rhythm for the brain to achieve higher cognitive binding and conscious processing, Gamma's consistency not only verified the sensitivity of FiCCL to high-frequency neural synchronization mechanisms, but also indicated that FiCCL successfully captured the key neural information integration process in the continuous emotion assessment task.

[0075] To further explore the underlying working mechanism of FiCCL, the characteristic importance of FiCCL in each frequency band was analyzed using Integrated Gradients (Figure 5(d)). The results show that FiCCL can adaptively adjust the frequency bands it focuses on according to different task paradigms. In DEAP, the Gamma band has the highest importance (0.30), which is consistent with the highest causal consistency in this band; in SEED, the Beta band has the highest importance (0.35), which also corresponds to the high consistency in this band. For FACED, although its overall consistency with the GC method is low, the model still assigns the highest relative importance to the Gamma band (0.25) and the Beta band (0.25). This demonstrates that the effectiveness of FiCCL is not based on consistency with linear methods, but rather stems from its multi-scale encoder's ability to accurately capture the core neural rhythms required for the task, whether it is high-frequency synchronization in DEAP, continuous control in SEED, or rapid integration and cognitive monitoring in FACED. This consistency of "frequency band specificity and task relevance" not only provides external statistical validation for the validity of the connections discovered by FiCCL, but also further supports its practical value as an interpretable causal discovery framework.

[0076] 7. Comparative Experiment In the emotion recognition task, this study selects ACC as the core performance evaluation index and conducts a systematic comparative analysis between the proposed FiCCL and existing mainstream methods. ACC, as a key indicator for measuring the model's overall discriminative ability, reflects the correctness of the model's overall classification of samples. All comparative experiments are reported based on the results of five independent repeated runs, and detailed comparative experimental results are shown in Table 3.

[0077] Table 3. Comparative experimental results of FiCCL on three datasets.

[0078] As shown in Table 3, FiCCL achieved competitive classification performance on the DEAP, SEED, and FACED datasets. On DEAP, FiCCL significantly outperformed all baseline methods with an accuracy of 73.15%, improving upon the second-best model UDA-DDA (62.15%) by more than 11 percentage points, demonstrating its strong generalization and discriminative ability in cross-subject emotion recognition tasks. On SEED, FiCCL slightly outperformed the current best method GLGCN (77.75%) with an accuracy of 77.88%, maintaining its leading advantage and validating its effectiveness in temporal-spatial feature fusion and causal structure modeling. On FACED, FiCCL achieved an accuracy of 68.53%, significantly surpassing all comparable methods (the best baseline TSception was 61.9%), an improvement of approximately 6.6 percentage points, highlighting the framework's robustness and adaptability across datasets and scenarios. Overall, FiCCL demonstrates stable and leading classification performance across all three datasets, with a particularly significant advantage in generalization scenarios across subjects and datasets. This indicates that by combining fine-grained contrastive learning with inter-channel causal structure inference, FiCCL can more effectively capture the directional dynamic dependencies between channel pairs during emotion processing, thereby improving the accuracy of emotion state decoding.

[0079] 8. Ablation test To verify the effectiveness of each core module in FiCCL, ablation experiments were designed on DEAP, SEED, and FACED to quantitatively evaluate the contribution of the multi-scale temporal coding module, the contrastive causal learning module, and the self-supervised verification module to the overall performance. The experiments tested the following four model variants: (1) Baseline (only spatiotemporal feature extraction): only the basic Transformer encoder in the multi-scale temporal coding module is retained, and the extracted spatiotemporal frequency features are directly classified after global average pooling without contrastive causal learning and self-supervised verification. (2) FiCCL-NC (No Contrastive Learning) only spatiotemporal features + self-supervised verification: a self-supervised verification module is added on the basis of Baseline, but the contrastive causal learning module is removed, that is, no positive and negative sample pairs are constructed for contrastive learning, and only the classification task is used to verify the effectiveness of the features. (3) FiCCL-NV (No Validation) only spatiotemporal features + contrastive learning: a contrastive causal learning module is added on the basis of Baseline, but the self-supervised verification module is removed, that is, no triple verification mechanism is performed. (4) FiCCL: contains all three core modules. The ablation experiment was evaluated using three metrics: ACC, F1, and AUC. The results are shown in Table 4.

[0080] Table 4 Ablation experimental results of FiCCL on three datasets

[0081] Table 4 shows the ablation experiment results. Baseline exhibits stable basic performance across all datasets. While the spatiotemporal features extracted solely by the Transformer encoder possess some sentiment representation capabilities, direct global pooling leads to the loss of key temporal causal relationships. Furthermore, unoptimized feature representations struggle to effectively capture nonlinear causal interactions, particularly on FACED, where the AUC is only 0.692, reflecting the challenge that continuous scoring poses to traditional feature extraction methods. FiCCL-NC achieves limited performance improvement over Baseline, thanks to the self-supervised verification module's optimization and selection of features through classification tasks. However, the lack of a contrastive learning module for explicit modeling of causal relationships makes it difficult to effectively distinguish causal direction and temporal priority, limiting further performance improvement. FiCCL-NV achieves a more significant and balanced performance improvement thanks to its contrastive causal learning module, enabling the model to accurately extract causal-related feature patterns from complex EEG signals. The complete FiCCL achieves the best performance across all datasets, validating the necessity of the three modules working collaboratively. Compared to the baseline, the complete FiCCL improves the AUC on DEAP by 0.1, exceeding the expected sum of independent contributions from each module; the AUC on SEED improves by 0.066, slightly lower than the sum of independent contributions; and the AUC on FACED improves by 0.1, close to the sum of independent contributions. These results indicate a complex synergistic effect among the modules.

[0082] To further analyze the impact of each module on the quality of causal discovery, the consistency between the connections discovered by different variants and traditional GC analysis (Kendall's τ) was calculated, and the results are shown in Table 5.

[0083] Table 5. Consistency between causal connections found by different variants and traditional methods.

[0084] Table 5 shows that the causal connections discovered by FiCCL have the highest consistency with traditional GC analysis in key frequency bands. In the Gamma band of DEAP, FiCCL's Kendall's τ reaches 0.167±0.016, significantly higher than FiCCL-NC (0.102) and FiCCL-NV (0.145). This improvement verifies the effectiveness of the self-supervised verification module through a triple verification mechanism: cosine causal scoring ensures the connection strength threshold, downstream task verification guarantees the emotional relevance of the connections, and consistency checks with traditional methods enhance the neural interpretability of the results. FiCCL-NV has already shown a significant advantage in consistency metrics (DEAP: 0.145), indicating that contrastive learning itself can effectively capture causal patterns similar to traditional methods. However, the further improvement of FiCCL (0.145→0.167) shows that self-supervised verification not only filters out pseudo-connections but also optimizes the discovery quality of true connections through multi-angle verification. In the SEED Beta band, the consistency of the full model (0.164) is 8.2% higher than that of FiCCL-NV (0.152), which exceeds the performance improvement of AUC (1.97%), verifying the unique value of the verification module in improving the reliability of results.

[0085] Ablation studies confirmed the necessity and synergistic effect of each design module in FiCCL: the multi-scale temporal encoding module provides basic feature representation capabilities, but it is difficult to effectively capture nonlinear causal relationships when used alone. The contrast causal learning module significantly improves the model's causal discovery ability by constructing causal discovery as a representation learning task, but may generate pseudo-connections inconsistent with neural mechanisms. The self-supervised verification module ensures the reliability of discovered connections through a triple verification mechanism, significantly improving consistency with traditional causal analysis methods. FiCCL exhibits a significant synergistic effect, with each module reinforcing the others, achieving an optimal balance between causal discovery accuracy and classification task performance.

[0086] Industrial applicability This invention can be used for: 1. Emotion computing systems: improving the accuracy and interpretability of emotion recognition; 2. Auxiliary diagnosis of brain diseases: such as detection of brain network abnormalities in depression and Alzheimer's disease; 3. Brain-computer interface: Provides causal features to enhance control performance; 4. Neurofeedback training: targeting brain regions based on causal connections.

Claims

1. An EEG channel effective connectivity analysis method based on fine-grained contrastive causal learning, characterized in that, The specific steps are as follows: Step 1: Divide the multi-channel EEG signals into frequency bands and time windows, and extract the frequency band-time window feature matrix for each channel; Step 2: Encode the feature matrix of each channel to obtain the channel-level global representation vector; Step 3: Construct a contrastive causal learning module to learn the causal dependencies between channels through contrastive learning tasks; Step 4: Design a self-supervised verification analysis module to verify the effectiveness of the discovered connections; Step 5: Output the causal strength matrix between channels and related validation metrics for use in brain network analysis or emotion recognition tasks.

2. The EEG channel effective connectivity analysis method based on fine-grained contrastive causal learning according to claim 1, characterized in that, Step 1 is implemented in the following steps: Step 1.1: Preprocessing and trial division of raw EEG signals: Multichannel EEG signals were collected and divided into several independent samples according to the number of experimental trials. Each trial is represented as... ,in, For the number of channels, For each trial, denoising, baseline correction, and artifact removal are performed based on the number of time points. Step 1.2, Frequency Band Allocation: The preprocessed EEG signal was divided into five standard frequency bands by bandpass filtering: Delta (δ, 1–4 Hz), Theta (θ, 4–8 Hz), Alpha (α, 8–13 Hz), Beta (β, 13–30 Hz), and Gamma (γ, 30–45 Hz), with each band being retained independently. Step 1.3, Time Window Segmentation: For the time series under each frequency band, a fixed-length time window is used for sliding segmentation, with adjacent windows not overlapping. For each channel, the following is obtained: A continuous time window; Step 1.4: Differential Entropy Feature Extraction Within each time window, differential entropy features are extracted from the signal in each frequency band. Differential entropy is defined as: (1) in, Let be the probability density function of the signal, and assume it follows a Gaussian distribution. This represents the variance of the signal in that frequency band. Step 1.5: Construct the frequency band-time window feature matrix: For each channel to put it in 5 frequency bands and The differential entropy features over each time window are organized into a two-dimensional matrix. The first dimension corresponds to the frequency band, and the second dimension corresponds to the time window. Step 1.6, Batch Data Organization: Organize the feature matrices of all channels into batch input data according to the trial dimension. ,in, For batch size, This represents the number of channels.

3. The method for analyzing effective EEG channel connectivity based on fine-grained contrastive causal learning according to claim 2, characterized in that, In step 2, the feature matrix of each channel is encoded by a multi-scale temporal coding module. The multi-scale temporal coding module consists of a linear projection layer, a sinusoidal position coding layer, a Transformer encoder, and a temporal average pooling layer. The Transformer encoder is composed of multiple stacked coding layers. Each coding layer includes a multi-head self-attention layer, a residual connection and layer normalization layer, a feedforward network layer, and a residual connection and layer normalization layer.

4. The method for analyzing effective EEG channel connectivity based on fine-grained contrastive causal learning according to claim 3, characterized in that, Step 2 is implemented in the following steps: The input is the differential entropy feature matrix for each EEG channel. The first dimension represents five frequency bands δ, θ, α, β, γ, and the second dimension represents five consecutive time windows. This represents the differential entropy energy distribution of the channel across 5 frequency bands and 5 time windows. The 5x5 real matrix space, after linear projection and sinusoidal position encoding, is input to the Transformer encoder: (2) in, This is the initial hidden layer representation. The linear projection weight matrix is For bias terms, For model dimensions; Introducing position coding It adopts the form of a sine function: (3) in, Indicates the position of the time window. For dimensional indexing, For model dimensions; The encoder uses a multi-head self-attention mechanism to model inter-temporal window dependencies. An attention head, defined as: (4) in, For the first The layer's input representation; These are the projection matrices for the query, key, and value, respectively. This represents the query vector, used to measure the degree of attention the current time window pays to other time windows; This represents the key vector, used to measure the weight of attention given to other time windows; Represents a value vector, used for weighted aggregation of information; Attention weights are calculated as follows: (5) in, Let be the dimension of the key vector. Used to scale the dot product result and prevent gradient vanishing; The outputs of all attention heads are concatenated and then subjected to a linear transformation: (6) in, For the total number of attention heads, To output the projection matrix; Each Transformer layer also contains a feedforward network: (7) in, , This is the weight matrix. For bias terms, The hidden layer dimension of the feedforward network; Stabilize training through residual connections and layer normalization: (8) (9) in, Presentation layer normalization operation; Finally, the channel global representation vector is obtained by performing average pooling on the time dimension: (10) in, This serves as a unified representation of the channel across multiple scales, which will be used for subsequent causal modeling. For the number of time windows, This represents the number of Transformer layers.

5. The method for analyzing effective EEG channel connectivity based on fine-grained contrastive causal learning according to claim 4, characterized in that, In step 3, the contrastive causal learning module consists of a positive and negative sample construction unit and a shared parameter encoder. Projector head It consists of a causality strength calculation unit, wherein the encoder Using the multi-scale timing coding module described in claim 3, the projection head It is a two-layer multilayer perceptron (MLP), consisting of a linear layer, a batch normalization layer, a ReLU activation layer, and another linear layer.

6. The method for analyzing effective EEG channel connectivity based on fine-grained contrastive causal learning according to claim 5, characterized in that, Step 3 is implemented in the following steps: In the contrastive causal learning module, positive samples are compared to previous frontal lobe channels within the time window. Internal activity is the cause, with the limbic system or temporal lobe pathway in the time window The activity within the brain is the result; negative sample pairs include time-reversed samples, samples paired within the same brain region, and randomly paired samples across trials, as detailed below: By constructing positive and negative sample pairs, the causal discovery task is transformed into a contrastive learning task: Positive samples, i.e., causal pairs, are defined as: (11) in, The characteristic matrix representing the source channel, The feature matrix representing the target channel; For the prefrontal cortex channel, For the marginal / temporal lobe pathway; a 10-time-window delay ensures temporal priority; Negative samples, i.e., non-causal pairs, include: Time reversal: Same-region pairing: Random pairing across trials; channel pairs randomly selected from different emotion trials. Define encoder With the projector head Causal strength is calculated using cosine similarity: (12) in, They represent channels respectively. The frequency band-time window feature matrix, This is the global representation vector output by the encoder. Low-dimensional embedding for the output of the projection head.

7. The method for analyzing effective EEG channel connectivity based on fine-grained contrastive causal learning according to claim 6, characterized in that, In step 3, the InfoNCE contrastive loss and prediction loss are jointly optimized into a model, and the loss function is: (12) in, For InfoNCE contrast loss, To predict losses, These are the weighting coefficients.

8. The method for analyzing effective EEG channel connectivity based on fine-grained contrastive causal learning according to claim 7, characterized in that, The self-supervised verification analysis module in step 4 consists of a causal similarity ranking unit, a feature aggregation unit, a logistic regression classifier, a Kendall's τ consistency calculation unit, and an Integrated Gradients attribution analysis unit, and is implemented according to the following steps: Step 4.1, Causal Similarity Ranking: For prefrontal channels With the marginal / temporal lobe channel All channel pairs are sorted from high to low according to the causal strength calculated in step 3, and the Top-K are selected as candidate causal paths. Step 4.2, Feature Aggregation and Sentiment Classification: Channel-level features are aggregated into sample-level vectors. Specifically, the mean and standard deviation of the encoder outputs for the prefrontal and limbic / temporal lobe channel sets are calculated separately and concatenated into a 64-dimensional vector. Input logistic regression classifier: (13) in, For the sigmoid function, For the weight vector, For the bias term, the evaluation metrics include accuracy, F1 score, and AUC; Step 4.3, Consistency test with traditional methods: Compare the FICCL ranking with the F-statistic ranking of the Granger causality test, and calculate Kendall's τ: (14) in, and These represent the number of consistent and inconsistent join pairs, respectively. The number of common connections; Step 4.4, Frequency Band Attribution Analysis: Integrated Gradients is used to quantify the contribution of each frequency band to causal decision-making. (15) in, As baseline input, For model output, For the first Input characteristics of each frequency band.

9. The method for analyzing effective EEG channel connectivity based on fine-grained contrastive causal learning according to claim 8, characterized in that, Step 5 outputs the following result: (1) Causality strength matrix ,in Number of channels; (2) Validation metrics: classification performance, consistency coefficient, and frequency band importance distribution; (3) Visualization results: such as brain network connectivity diagrams and frequency band contribution heatmaps.