A deep learning model training method for temporal lobe epilepsy lateralization classification
By constructing a multi-scale directed temporal graph convolutional network and combining directed graph convolution with multi-scale frequency band modeling, the problem of insufficient utilization of DTF brain network information in existing technologies is solved, and more efficient temporal lobe epilepsy lateral classification is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING UNIV OF TECH
- Filing Date
- 2026-05-27
- Publication Date
- 2026-07-10
Smart Images

Figure CN122365111A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of brain science signal processing, medical artificial intelligence and deep learning technology, and in particular relates to a deep learning model training method for lateral classification of temporal lobe epilepsy. Background Technology
[0002] Magnetoencephalography (MEG) is a non-invasive neuroimaging technique that records neural activity in the brain. Compared to techniques such as electroencephalography (EEG) and functional magnetic resonance imaging (fMRI), MEG offers both high temporal and spatial resolution, enabling it to more accurately reflect changes in neural activity across different brain regions over time.
[0003] In neuroscience, brain functional networks are a key concept for exploring the complex working mechanisms of the brain. Traditional network constructions, such as correlation coefficients, coherence, or phase synchronization, only indicate whether there is a connection or collaborative activity between two brain regions, without specifying the direction of information flow between them. For the nervous system, different brain regions not only differ in connection strength but also in the direction of information flow. Ignoring the direction of connection may lead to insufficient representation of brain network topology, affecting the accuracy and interpretability of subsequent classification tasks.
[0004] Directional Transfer Function (DTF) is a frequency-domain-based efficient connectivity analysis method used to measure the causal impact of signal transmission from brain region i to brain region j at a specific frequency. DTF can construct directional brain networks that can describe not only the strength of information interaction between brain regions but also the direction of information transmission. Currently, DTF-based brain networks are primarily used for graph theory analysis, with relatively few studies applying them to deep learning models. Therefore, it is necessary to further combine DTF directed networks with deep learning to fully explore the causal strength and frequency band interaction information contained within directed brain networks.
[0005] The DTF brain network matrix not only contains the strength of connections between brain regions but also the explicit direction of information flow. Furthermore, it can typically be constructed across multiple frequency bands. In addition, brain-to-brain communication is dynamic over time. Therefore, using a single basic graph neural network model is insufficient to fully explore the directed connectivity information, cross-frequency features, and temporal dynamics inherent in the DTF brain network.
[0006] In recent years, graph neural networks (Graph Neural Networks) have been widely used in brain network analysis. Graph Neural Networks use brain regions as nodes and the connection strength between brain regions as edges to learn the topological structure of brain networks. Building upon basic graph neural networks, many researchers have proposed various improved models to meet different task requirements, such as directed graph convolutional networks (DCNNs), multi-scale graph convolutional networks (MCNs), spatiotemporal graph convolutional networks (SPCCs), and graph attention networks (GANs). These models expand the expressive power of graph neural networks from the perspectives of introducing directionality, multi-scale information, and temporal dynamic features, and have been used to solve complex problems in different fields. Based on previous ideas, this invention develops a new model that combines the above advantages and is well-suited to the multi-frequency directed brain network structure containing more complex information. Summary of the Invention
[0007] To address the aforementioned shortcomings in existing technologies, this invention provides a deep learning model training method for lateral classification of temporal lobe epilepsy. This invention combines model design ideas such as directed graph convolution, multi-scale frequency band modeling, and spatiotemporal graph convolution to develop a multi-scale directed temporal graph convolutional network—i.e., a deep learning model—suitable for DTF multi-band directed brain networks. This enhances the model's ability to identify abnormal patterns in brain networks and provides a new technical approach for lateral classification of temporal lobe epilepsy.
[0008] To achieve the above objectives, the technical solution adopted by this invention is: a deep learning model training method for lateral classification of temporal lobe epilepsy, comprising the following steps: S1. Preprocessing and source reconstruction of the magnetoencephalogram (MEG) signals; S2. Based on the source reconstruction results, select brain regions of interest that are related to temporal lobe epilepsy lateralization and obtain the brain region time series matrix. S3. Construct an adjacency matrix for multiple frequency bands based on brain region time series matrices; S4. Construct a node feature matrix based on the adjacency matrix; S5. Based on the node feature matrix, define and train a deep learning model, whereby the deep learning model is used to classify temporal lobe epilepsy lateralization.
[0009] The beneficial effects of this invention are as follows: This invention preprocesses and reconstructs the source of the original magnetoencephalogram (MEG) signal; selects the default mode network as the brain region of interest; constructs adjacency matrices of directed brain networks across multiple frequency bands using a Directional Transfer Function (DTF); constructs node feature matrices based on the DTF brain network; and defines and trains a multi-scale directed temporal graph convolutional network to achieve temporal lobe epilepsy lateralization classification. This invention uses a DTF to construct a multi-band directed brain network, which not only reflects the connection strength between brain regions but also describes the direction of information flow between brain regions, possessing richer neurophysiological significance. Simultaneously, this invention combines directed graph convolution, multi-scale cross-band modeling, and GRU temporal modeling modules to fully extract directed spatial topological information, cross-band complementary information, and dynamic change features in continuous time slices from the DTF brain network. Experimental results show that the model constructed in this invention performs well in the temporal lobe epilepsy lateralization classification task, with classification performance superior to other commonly used models currently applied in this field, providing a new technical approach for constructing temporal lobe epilepsy lateralization classification models.
[0010] Further, S1 includes: Preprocessing of the magnetoencephalogram (MEG) signal yields a clean MEG signal. The clean MEG signals were processed by source reconstruction, and the maximum power information was selected as the MEG time series of the entire brain region of interest.
[0011] Furthermore, S3 includes: A time-domain multivariate autoregressive model (MVAR) was established for the time series of magnetoencephalograms (MEGs) of brain regions of interest. The MVAR was then transformed to the frequency domain using Fourier transform to obtain the frequency domain coefficient matrix. The frequency domain transfer function was obtained by inverting the frequency domain coefficient matrix and extracting the relative orientation influence intensity from it to obtain the orientation transfer function (DTF) matrix. Based on the Directed Transfer Function (DTF) matrix, the MEG time series of brain regions of interest are processed by normalized and non-normalized DTF transformations across multiple frequency bands to construct the adjacency matrix. The normalized DTF matrix represents the relative strength of connections between brain regions and is input into the deep learning model as the adjacency matrix; the non-normalized DTF matrix represents the absolute strength of connections between brain regions and is used to create the node feature matrix.
[0012] The beneficial effects of the above-mentioned further solutions are: By constructing an adjacency matrix, the present invention preserves both the relative relationship of connections and the absolute strength of connections, with the two types of information complementing each other, thereby improving the discriminative ability of subsequent classification.
[0013] Furthermore, S4 includes: Calculate the nodal input strength respectively and node output strength :
[0014]
[0015] in, Indicates the total number of nodes. Indicates the relationship with the first The node with a connection relationship 1 node Indicates from node Pointing to node The connection weights, Indicates from node Pointing to node Connection weights; Based on node input strength and node output strength Calculate the orientation preference of the nodes :
[0016] in, This indicates a number used to prevent division by zero; Compute node input power :
[0017] in, Indicates the total number of nodes. Indicates from node Pointing to node Connection weights; The computation node has asymmetric input intensity with the opposite side. :
[0018] in, Represents a node The corresponding node in the opposite hemisphere Input intensity; The output intensity of the compute node is asymmetrical with that of the opposite side. :
[0019] in, Represents a node The corresponding node in the opposite hemisphere ; output intensity; The receiving preferences of the computing node and the counterpart are asymmetric. :
[0020] in, Represents a node The corresponding node in the opposite hemisphere Reception preferences; Based on nodal input power The input power of the computing node is asymmetrical with that of the opposite side. :
[0021] in, Represents a node The corresponding node in the opposite hemisphere Input power; splice node input strength Node output strength Node direction preference Node input power Input intensity asymmetry Asymmetrical output intensity Asymmetric reception preferences and input power asymmetry The node feature matrix is obtained.
[0022] The beneficial effect of the above-mentioned further scheme is that by splicing the node input strength, node output strength, node orientation preference, node input power and their corresponding asymmetry features, it is possible to jointly characterize the connection strength, information flow direction and lateralization differences of brain regions at the node level, thereby making up for the insufficiency of fully characterizing the local attributes of nodes by using only the adjacency matrix.
[0023] Furthermore, the definition and training of the deep learning model includes: The adjacency matrix and node feature matrix are used as inputs to the deep learning model; Based on the input, a deep learning model is defined, which includes a directed graph convolution module, a multi-scale cross-band module, and a temporal module. Train the deep learning model.
[0024] The beneficial effects of the above-mentioned further scheme are: by constructing a deep learning model that includes a directed graph convolution module, a multi-scale cross-band module, and a temporal module, it is possible to jointly model the input data from three levels: directed connectivity between brain regions, multi-band feature interaction relationships, and cross-time slice dynamic evolution laws, thereby extracting more comprehensive differential features between the healthy group, the left temporal lobe epilepsy group, and the right temporal lobe epilepsy group.
[0025] Furthermore, the directed graph convolution module is used to extract spatial representations from node features and directed adjacency matrices based on each time slice and each adjacency matrix in each frequency band using directed graph convolution layers. The directed graph convolution layers include inbound branches, outbound branches, and their own feature paths. The multi-scale cross-band module is used to divide the frequency bands according to the frequency band range based on the extracted spatial representation to obtain frequency band groups. Self-attention modeling and dynamic weights within each frequency band group are performed to construct cross-band features between different frequency bands. Residual connections and layer normalization are added after the modeling self-attention module. The time-series module is used to extract global dynamic features within a time-series group based on cross-band features. In this module, a node attention pooling mechanism is introduced on each time slice to assign adaptive weights to the nodes.
[0026] The beneficial effects of the above-mentioned further scheme are: by constructing a deep learning model that includes a directed graph convolution module, a multi-scale cross-band module, and a temporal module, it is possible to jointly model the input data from three levels: directed connectivity between brain regions, multi-band feature interaction relationships, and cross-time slice dynamic evolution laws, thereby extracting more comprehensive differential features between the healthy group, the left temporal lobe epilepsy group, and the right temporal lobe epilepsy group.
[0027] Furthermore, the construction of cross-band features between different frequency bands includes: Based on the extracted spatial representation, the frequency band is divided according to the frequency band range to obtain frequency band groups including low frequency group and mid-high frequency group; Within each frequency band group, a multi-head self-attention mechanism is used to capture the correlation and frequency band interaction relationships between different frequency bands within the frequency band group. Residual connections and layer normalization are added after the self-attention module within the group. Based on the capture results, a lightweight multilayer perceptron is used to generate dynamic weights within the group. :
[0028] in, This represents the group weight generator. Indicates the first Within each frequency band group, the first Feature representation of each frequency band after intra-group interaction; Utilizing temperature coefficient The softmax algorithm transforms the dynamic weights within a group into normalized weights. :
[0029] in, Indicates the first Frequency band index within a frequency band group Indicates the first Within each frequency band group, the first The dynamic weight score corresponding to each frequency band.
[0030] Based on normalized weights, the within-group representation is obtained by weighted summation. :
[0031] in, Indicates the first Within each frequency band group, the first Characteristic representation of each frequency band Indicates the first The first frequency band group Frequency band index; Based on within-group representation By performing dynamic fusion between groups, cross-band characteristics between different frequency bands are constructed.
[0032] The beneficial effects of the above-mentioned further scheme are as follows: By using a multi-head self-attention mechanism to model the correlation and interaction between different frequency bands within each frequency band group, and combining it with a lightweight multilayer perceptron to generate dynamic weights within the group, it can adaptively highlight frequency band information that is more discriminative for the current task, avoiding the information loss caused by simple averaging or fixed weighting of each frequency band. Furthermore, by obtaining group representations through intra-group weighted fusion, and then constructing cross-frequency band features based on inter-group dynamic fusion, it is beneficial to jointly represent the differential patterns between the healthy group, the left temporal lobe epilepsy group, and the right temporal lobe epilepsy group at the frequency band level, thereby enhancing the model's ability to utilize multi-band information and improving the accuracy and stability of temporal lobe epilepsy lateralization classification.
[0033] Furthermore, the expression for fusion representation is as follows:
[0034]
[0035]
[0036] in, Indicates cross-band characteristics, This represents the baseline representation obtained by averaging the representations of the two frequency band groups. Indicates a scalar threshold. This represents the attention fusion representation obtained based on dynamic weights between groups. This represents the Sigmoid function. Indicates the use of scalar thresholds Lightweight multilayer perceptron network. This indicates the low-frequency group. This indicates the mid-to-high frequency group.
[0037] The beneficial effect of the above further scheme is that it introduces a basic representation. Attention fusion representation and scalar threshold The gated fusion mechanism can adaptively adjust the fusion intensity of cross-band interaction information while maintaining the basic common information between the low-frequency group and the mid-to-high-frequency group, avoiding information loss or excessive bias caused by simply using averaging or direct attention fusion. Furthermore, by using the basic representation as a reference and dynamically correcting the attention fusion result through gating coefficients, it is beneficial to enhance the stability and robustness of cross-band feature representation, thereby more effectively characterizing the frequency band difference patterns between the healthy group, the left temporal lobe epilepsy group, and the right temporal lobe epilepsy group, and improving the accuracy and reliability of deep learning models in classifying temporal lobe epilepsy lateralization.
[0038] Furthermore, the extraction of global dynamic features within the time series group includes: Based on cross-band characteristics, a score is calculated for each node to obtain the node score. In time slice Attention score ; For all attention scores Normalization is performed to obtain the node attention weights. ; Based on node attention weights The time slice level representation is obtained by weighted summation. ; Based on time-slice level representation The sequence is used to extract global dynamic features.
[0039] The beneficial effect of the above-mentioned further scheme is that the importance of nodes in different brain regions is not the same within the same time slice. If a simple average is applied to all nodes, the discriminative contribution of key brain regions will be weakened. Therefore, this paper introduces a node attention pooling mechanism at each time step to assign adaptive weights to nodes. The original node-level feature sequence is compressed into a time-slice-level feature sequence, while preserving the differences in the contribution of key brain regions at each time step.
[0040] Furthermore, the time slice level representation The expression is as follows:
[0041]
[0042]
[0043] in, This represents the total number of nodes contained in each time slice. Indicates the first The first time slice 1 node Indicates the first The first time in the film The feature representation of each node. and All of these represent learnable parameters. Indicates the first The first time in the film Attention score for each node Indicates the first The first time in the film Attention score for each node This indicates a random deactivation operation.
[0044] The beneficial effect of the above-mentioned further scheme is that the importance of nodes in different brain regions is not the same within the same time slice. If a simple average is applied to all nodes, the discriminative contribution of key brain regions will be weakened. Therefore, this paper introduces a node attention pooling mechanism at each time step to assign adaptive weights to nodes. The original node-level feature sequence is compressed into a time-slice-level feature sequence, while preserving the differences in the contribution of key brain regions at each time step. Attached Figure Description
[0045] Figure 1 This is a flowchart of the MEG preprocessing process.
[0046] Figure 2 This is a flowchart of a multi-scale directed temporal graph convolution model. Detailed Implementation
[0047] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.
[0048] Example This invention uses the Directed Transfer Function (DTF) method to construct brain networks in different frequency bands, and designs a multi-scale directed temporal graph convolutional network. The directed graph convolution is decomposed into incoming branches, outgoing branches, and self-feature paths, respectively modeling the node's information reception, outward information propagation, and the preservation of its own feature expression. Then, cross-band modeling is performed, dividing multiple frequency bands into low-frequency and mid-to-high-frequency groups, achieved through intra-group attention, intra-group dynamic weights, inter-group attention, and inter-group dynamic fusion. Finally, node attention pooling layers and gated recurrent units are designed to perform temporal modeling of the dynamic changes in the brain network in continuous time slices, thereby obtaining a more discriminative representation of brain network features. The deep learning network constructed in this invention—the multi-scale directed temporal graph convolutional network—is used to model the directed connections, cross-band dependencies, and temporal dynamic evolution features in the brain network, ultimately achieving lateral classification of temporal lobe epilepsy. Figure 1 and Figure 2 As shown, this invention provides a deep learning model training method for lateral classification of temporal lobe epilepsy, the implementation method of which is as follows: S1. Preprocessing and source reconstruction of the MEG signal from magnetoencephalography (MEG) are performed as follows: Preprocessing of the magnetoencephalogram (MEG) signal yields a clean MEG signal. The clean MEG signals were processed by source reconstruction, and the maximum power information was selected as the MEG time series of the entire brain region of interest.
[0049] In this embodiment, the original magnetoencephalogram (MEG) signal is processed by low-frequency filtering, 50Hz notch filtering, and independent component analysis to remove electrocardiogram (ECG) signals to obtain a pure MEG signal.
[0050] The head model and source model were constructed (these are fixed steps required for source reconstruction and are existing techniques, so they will not be elaborated here). The head model was constructed using the FieldTrip 2019 toolbox, which describes the geometry of the head and tissue conductivity; the source model was constructed using Freesurfer and HCP workbench, which describes the position and orientation of the current dipoles equivalent to the source. Beamforming was used for source reconstruction. Beamforming maps MEG signals in sensor space to brain source space, thus obtaining source space signals that more closely resemble the actual brain region activity. Subsequently, the entire brain was divided into 116 regions using an Automatic Anatomical Labeling (AAL) template, and the highest power signal in each region was selected as the representative time series for that region. Ultimately, each brain region time series contained 60,000 time points.
[0051] S2. Based on the source reconstruction results, select brain regions of interest that are related to temporal lobe epilepsy lateralization and obtain the brain region time series matrix. In this embodiment, after the extraction of the whole brain source spatial signal, the Default mode network (DMN) is selected as the Region of Interest (ROI) associated with the lateralization of temporal lobe epilepsy. A total of 26 ROIs are selected, which are 13 pairs of symmetrical brain regions, resulting in a time series of 26 × 60,000. Here, 26 represents the number of ROIs and 60,000 represents the number of time nodes corresponding to each brain region.
[0052] The default mode network is an important network in the study of resting-state brain activity. It is closely related to changes in various cognitive functions and brain diseases, and therefore is suitable as a key analysis object in brain network classification tasks.
[0053] S3. Based on the brain region time series matrix, construct a multi-frequency band adjacency matrix. The implementation method is as follows: A time-domain MVAR model was established for the time series of magnetoencephalograms (MEGs) of brain regions of interest. The MVAR model was then transformed to the frequency domain using Fourier transform to obtain the frequency domain coefficient matrix. The frequency domain transfer function was obtained by inverting the frequency domain coefficient matrix and extracting the relative orientation influence intensity from it to obtain the orientation transfer function (DTF) matrix. Based on the Directed Transfer Function (DTF) matrix, the MEG time series of brain regions of interest are processed by normalized and non-normalized DTF transformations across multiple frequency bands to construct the adjacency matrix. The normalized DTF matrix represents the relative strength of connections between brain regions and is input into the deep learning model as the adjacency matrix; the non-normalized DTF matrix represents the absolute strength of connections between brain regions and is used to create the node feature matrix.
[0054] In this embodiment, a DTF directed brain network matrix (i.e., an adjacency matrix) is constructed. Brain functional networks are models of brain activity. The brain networks of different categories of subjects are different. This step is to construct a brain network matrix that can characterize the differences in directional connection patterns between the healthy group, the left temporal lobe epilepsy group, and the right temporal lobe epilepsy group.
[0055] In this embodiment, the 26×60000 DMN time series was sliced, with each subject divided into 40 slices, each slice containing 1500 time nodes. Directed Transfer Function (DTF) was used to evaluate the causal relationship and connectivity strength between the two brain region time series. For each 26×1500 MEG slice, normalized and non-normalized DTF transformations were performed on the following six frequency bands: Delta (1-4 Hz), Theta (4-8 Hz), Alpha (8-13 Hz), Beta (13-30 Hz), low Gamma (30-80 Hz), and high Gamma (80-250 Hz). The normalized DTF matrix represents the relative strength of connections between brain regions and is input into the deep learning model as an adjacency matrix. The non-normalized DTF matrix represents the absolute strength of connections between brain regions and is used to create the node feature matrix. The construction of a Directed Transfer Function (DTF) brain network mainly includes: 1) a non-normalized DTF matrix; 2) a normalized DTF matrix.
[0056] The Directed Transfer Function (DTF) is calculated based on a time-domain multiple autoregressive (MVAR) model, which can be expressed as:
[0057] in, Represents an N-dimensional time series. The first term of the time-domain multiple autoregressive model is represented by the first term. Index of lag terms, This represents the coefficient matrix of an N×N dimensional time-domain multiple autoregressive model, symbolizing the influence of historical information on the present. Indicates the current time The first An N-dimensional time series vector at each moment. Let p represent the noise term, and p represent the lag order of the time-domain multiple autoregressive model, which indicates the dependence on... The above formula is used to predict future values from previous time series values. A Fourier transform is performed on the above formula to convert it to the frequency domain:
[0058] in, This represents the frequency domain coefficient matrix obtained by Fourier transforming the coefficient matrix of the time-domain multivariate autoregressive model. Representing time series The frequency domain representation, Noise term The frequency domain representation of .
[0059] beg The coefficient matrix is the inverse of the matrix, thus the system's directed transfer function (DTF) matrix H(f) is obtained as follows:
[0060] in, Represents the frequency domain coefficient matrix The inverse matrix, H represents the frequency domain transfer function matrix. ij (f) represents the information of the signal from channel j to channel i. The Directional Transfer Function (DTF) transformation is calculated using the eConnectome toolkit.
[0061] For each 26×1500 MEG slice, normalized and non-normalized Directional Transfer Function (DTF) transformations were performed on the following six frequency bands: Delta (1-4 Hz), Theta (4-8 Hz), Alpha (8-13 Hz), Beta (13-30 Hz), low Gamma (30-80 Hz), and high Gamma (80-250 Hz). The normalized DTF matrix represents the relative strength of connections between brain regions and is input into the deep learning model as the adjacency matrix. The non-normalized DTF matrix represents the absolute strength of connections between brain regions and is used to construct the node feature matrix. Logarithmic scaling and maximum normalization were used.
[0062] in, Represents the i-th value after logarithmic scaling and maximum value normalization. Nodes in each frequency band To the node The connection weights, Indicates the first Nodes in each frequency band To the node The original connection weights, Indicates the target node index. Indicates the source node index.
[0063] S4. Construct a node feature matrix based on the adjacency matrix; In this embodiment, S4 is the node feature matrix for constructing the adjacency matrix. The graph neural network (GNN) class requires the adjacency matrix and its corresponding node features. In this task, the adjacency matrix describes the association between brain regions, and the node feature matrix describes the features of the brain region itself.
[0064] In this embodiment, the following node features are constructed based on the non-normalized DTF brain network matrix: node input strength, node output strength, node orientation preference, node input power, asymmetric input strength between the node and the opposite side, asymmetric output strength between the node and the opposite side, asymmetric reception preference between the node and the opposite side, and asymmetric input power between the node and the opposite side.
[0065] In this embodiment, the construction of the node feature matrix includes the following steps: 1. Compute the information flow intensity and directional characteristics of nodes: Calculate node input strength Node input strength The formula for representing the total information flow received by this node from other nodes is:
[0066] Calculate node output strength Node output strength The formula for representing the information flow from this node to other nodes is:
[0067] in, This represents the total number of nodes, i.e., the number of brain regions (26 in this case). Indicates the relationship with the first The node with a connection relationship 1 node Indicates from node Pointing to node The connection weights, Indicates from node Pointing to node Connection weights.
[0068] Calculate node orientation preference Node direction preference This measures whether a node is "input-driven" or "output-driven." This defines the node's input preference. A value greater than 0 indicates that more information is received, suggesting that the node is more likely to be driven. A value less than 0 indicates that the output contains more information, suggesting that the node is more inclined to actively drive other nodes. The formula is:
[0069] in, This indicates a number used to prevent division by zero.
[0070] Compute node input power Node input power This emphasizes the contribution of "strong information pathways," where strong connections are amplified and the impact of weak connections is reduced. The formula is:
[0071] in, Indicates the total number of nodes. Indicates from node Pointing to node Connection weights; 2. Calculate the difference features of corresponding nodes in the left and right hemispheres. Assume nodes... For nodes Opposite node: The computation node exhibits asymmetric input strength with the opposite side. :
[0072] in, Represents a node The corresponding node in the opposite hemisphere Input intensity, This represents a constant, which is a very small number, preventing division by zero.
[0073] Input intensity asymmetry This measures the imbalance in information reception between the corresponding left and right brain regions. A positive value indicates that the first... The input intensity of one brain region is greater than the input intensity of its contralateral paired brain region.
[0074] The output strength of the compute node is asymmetric with that of the opposite node. :
[0075] in, Represents a node The corresponding node in the opposite hemisphere ; output intensity; Output intensity asymmetry To measure the difference in information output between corresponding left and right brain regions.
[0076] The computing node exhibits asymmetric reception preferences compared to the counterpart. :
[0077] in, Represents a node The corresponding node in the opposite hemisphere Reception preferences; Asymmetric reception preferences We can measure the difference in the "direction of information flow" between the corresponding brain regions on the left and right sides, whether one side is more inclined to receive information and the other side is more inclined to output information.
[0078] The input power of the computing node is asymmetric with that of the opposite side. :
[0079] Input power asymmetry To measure whether there is side-channeling in the information flow dominated by strong connections.
[0080] 3. Further process the calculated features: After calculating the features of 8 nodes, we get 8 26×1 column matrices. These are then concatenated to obtain a 26×8 node feature matrix. For the 1st, 2nd, and 4th columns of the node feature matrix... , , Perform the following transformation:
[0081] in, It is a very small number, used to prevent division by zero. Represents the transformed eigenvalues. This represents the original feature values before the transformation. For potentially negative values, they are first set to 0 before the transformation. This process can preserve the relative size patterns of features while reducing the impact of extreme values on subsequent deep learning.
[0082] S5. Based on the node feature matrix, define and train a deep learning model, whereby the deep learning model is used to classify temporal lobe epilepsy lateralization.
[0083] In this embodiment, defining and training a deep learning model includes: The adjacency matrix and node feature matrix are used as inputs to the deep learning model; Based on the input, a deep learning model is defined, which includes a directed graph convolution module, a multi-scale cross-band module, and a temporal module. The directed graph convolution module extracts spatial representations from node features and directed adjacency matrices for each time slice and each adjacency matrix within each frequency band using directed graph convolutional layers. These directed graph convolutional layers include inbound branches, outbound branches, and their own feature paths. The multi-scale cross-band module, based on the extracted spatial representations, divides the frequency bands according to their range, obtaining frequency band groups, and performs self-attention modeling within each frequency band group. The system generates dynamic weights within groups and constructs cross-band features across different frequency bands. This involves adding residual connections and layer normalization after the self-attention module for modeling. A temporal module is used to extract global dynamic features within a temporal group based on the cross-band features. A node attention pooling mechanism is introduced at each time slice to assign adaptive weights to nodes. After obtaining the global dynamic features, they are input into a classifier. A fully connected layer maps the global dynamic features, and the system outputs category scores for the healthy group, the left temporal lobe epilepsy group, and the right temporal lobe epilepsy group, thus achieving the classification of temporal lobe epilepsy lateralization.
[0084] Train the deep learning model.
[0085] In this embodiment, constructing cross-band features between different frequency bands includes: Based on the extracted spatial representation, the frequency band is divided according to the frequency band range to obtain frequency band groups including low frequency group and mid-high frequency group; Within each frequency band group, a multi-head self-attention mechanism is used to capture the correlation and frequency band interaction relationships between different frequency bands within the frequency band group. Residual connections and layer normalization are added after the self-attention module within the group. Based on the capture results, a lightweight multilayer perceptron is used to generate dynamic weights within the group. ; Utilizing temperature coefficient The softmax algorithm transforms the dynamic weights within a group into normalized weights. ; Based on normalized weights, the within-group representation is obtained by weighted summation. ; Based on intra-group representation, cross-band features between different frequency bands are constructed by performing dynamic inter-group fusion.
[0086] In this embodiment, global dynamic features are extracted within the time series group, including: Each node is scored to obtain the node score. In time slice Attention score ; For all attention scores Normalization is performed to obtain the node attention weights. ; Based on node attention weights The time slice level representation is obtained by weighted summation. ; Based on time-slice level representation The sequence is used to extract global dynamic features.
[0087] In this embodiment, the deep learning model definition and training includes the following modules: Data Input: The calculated adjacency matrix and node feature matrix are formatted to fit the input format of the deep learning model. The DTF matrices of the 6 frequency bands and their corresponding node feature matrices are grouped into sets of 4 consecutive slices. Each subject is then sequentially divided into 10 time-series groups. Therefore, the dimensionality of the time-series group samples formed by the adjacency matrix and node feature matrix is:
[0088]
[0089] in, Indicates the first Adjacency matrix samples of time series groups Indicates the first Node feature matrix samples of each time series group.
[0090] Deep learning model definition: Define a multi-scale directed temporal graph convolutional network—that is, a deep learning model, which consists of three parts: a directed graph convolutional module, a multi-scale cross-band module, and a temporal module.
[0091] The directed graph convolutional module is a core component of the intra-band spatial modeling module. For each time slice and each adjacency matrix within each frequency band, the deep learning model first extracts spatial representations from node features and the directed adjacency matrix using directed graph convolutional layers. The deep learning model decomposes the directed graph convolution into three parts: incoming edge branches, outgoing edge branches, and its own feature path.
[0092] in, This represents the output node feature representation of a directed graph convolutional layer. Represents a non-linear activation function, using ReLU. This represents the result of a linear transformation of the incoming edge aggregation information. It is used to model the information received by a node from its incoming edge neighbors, emphasizing the impact of "external input" on the node's state. This represents the result of a linear transformation of the outgoing edge aggregation information. It is used to model the propagation relationship between a node and its outgoing edge neighbors, emphasizing the role of the node as an information source. This represents the result of a linear transformation of the node's own features. It is used to preserve the original attributes of the node, avoid oversmoothing after multiple propagations, and enhance the expressive power of local features. For Directed Transfer Function (DTF) brain networks, this design is more consistent with the physical meaning of the original connection matrix and is more suitable for extracting disease-related spatial features.
[0093] To fully model the cross-band features between different frequency bands, a node-level multi-scale cross-band module is designed. To reduce the difficulty of direct fusion caused by the large span between different frequency bands, the six frequency bands are divided into two frequency band groups according to the frequency range: low frequency group: 1-4Hz, 4-8Hz, 8-13Hz; mid-high frequency group: 13-30Hz, 30-80Hz, 80-250Hz. First, intra-group self-attention modeling and intra-group dynamic weight generation are performed within each frequency band group. A multi-head self-attention mechanism is first used within the frequency band group to capture the correlation and frequency band interaction relationships between different frequency bands within the group. Then, residual connections and layer normalization are added after the intra-group attention module to improve training stability.
[0094]
[0095]
[0096] in, Indicates the first Feature representation of each frequency band group after in-group multi-head self-attention modeling. This refers to the multi-head attention function, used to model the correlation and interaction relationships between different frequency bands within the same frequency band group. Indicates the first Input feature representation of each frequency band group Indicates the first Feature representation of each frequency band group after residual connection and layer normalization The representation layer normalization function is used to normalize the feature representation to improve training stability.
[0097] After modeling the intra-group attention, instead of directly averaging the three frequency band features, a lightweight multilayer perceptron is used to generate dynamic intra-group weights.
[0098] Among them, among them, This refers to the intra-group weight generator, which is a lightweight multilayer perceptron used to generate dynamic weight scores for each frequency band based on frequency band characteristics within the same frequency band group. Indicates the first Within each frequency band group, the first Feature representation of each frequency band after intra-group interaction.
[0099] In-group weight generator It consists of two layers of linear mapping, ReLU activation, and Dropout, followed by a temperature coefficient. The softmax function transforms it into normalized weights:
[0100] in, Indicates the first Frequency band index within a frequency band group Indicates the first Within each frequency band group, the first The dynamic weight score corresponding to each frequency band.
[0101] When the temperature coefficient When the temperature coefficient is large, the weight distribution is smoother; when the temperature coefficient is large, the weight distribution is smoother. When the value is low, the model tends to highlight a few dominant frequency bands. This parameter can be used to adjust the intensity of frequency band competition within a group.
[0102] Finally, the within-group representation is obtained through weighted summation. In this way, the within-group attention is responsible for modeling the relationships between frequency bands, while the dynamic weight generator further determines "which frequency band is more important at the current node":
[0103] in, Indicates the first Within each frequency band group, the first Characteristic representation of each frequency band Indicates the first The first frequency band group Frequency band index.
[0104] The low-frequency group representation is obtained through the above method. and mid-to-high frequency group representation Subsequently, the interactions between different frequency layers are modeled at the inter-group level. Similar to obtaining the intra-group representation, residual connections and layer normalization are introduced after the multi-head self-attention module, enabling the model to establish connections between the two levels of "low-frequency overall regulation" and "mid-to-high-frequency local rapid activity," capturing complementary information across frequency layers. Then, dynamic inter-group fusion is performed, further calculating inter-group weights for the two frequency band groups. In this way, the model can not only adaptively select key frequency bands within each group, but also dynamically determine whether the current node relies more on low-frequency or mid-to-high-frequency information at the inter-group level.
[0105] Hierarchical attention fusion can significantly improve expressive flexibility, but relying solely on attention weights may lead to excessive bias and affect model performance. Therefore, this invention designs a gated residual correction mechanism. First, the mean of the two group representations is taken to obtain the baseline representation:
[0106] Generate a scalar gate value using a gating network:
[0107] in, Let g be the Sigmoid function, g∈(0,1). The final fusion representation is defined as:
[0108] in, Indicates cross-band characteristics, This represents the baseline representation obtained by averaging the representations of the two frequency band groups. Indicates a scalar threshold. This represents the attention fusion representation obtained based on dynamic weights between groups. This represents the Sigmoid function. Indicates the use of scalar thresholds Lightweight multilayer perceptron network. This indicates the low-frequency group. This indicates the mid-to-high frequency group.
[0109] This design is equivalent to adaptive interpolation between the "mean fusion representation" and the "attention fusion representation". When the scalar threshold... When the threshold is small, the model tends to be more conservative, retaining more basic information; when the scalar threshold is small... When the size is large, the model retains more of the dynamic fusion results learned by the attention mechanism.
[0110] To further characterize the dynamic changes of brain networks across consecutive time slices, after obtaining a unified spatial representation of each node in each time slice, a gated recurrent unit (GRU) is used to extract global dynamic features within the time series. The GRU can alleviate the vanishing gradient problem in traditional recurrent networks through a gating mechanism and effectively capture short- and medium-term sequence dependencies, making it suitable for learning the dynamic changes of short time series. Since the importance of nodes in different brain regions within the same time slice may vary, simply averaging all nodes would weaken the discriminative contribution of key brain regions. Therefore, a node attention pooling mechanism is introduced for each time slice, assigning adaptive weights to nodes. First, a two-layer perceptron is used to calculate a score for each node:
[0111] in, and All represent learnable parameters, output For nodes In time slice Attention scores are then calculated for each node. Softmax normalization is then applied to all node scores to obtain the node attention weights.
[0112] The time-slice level representation is obtained by weighted summation:
[0113] in, This represents the total number of nodes contained in each time slice. Indicates the first The first time slice Each node (brain region) Indicates the first The first time in the film The feature representation of each node. It represents a node, but it appears in the denominator of the softmax function, indicating "summing and normalizing over all nodes"; and All of these represent learnable parameters. Indicates the first The first time in the film Attention score for each node Indicates the first The first time in the film Attention score for each node This indicates a random deactivation operation, reducing the risk of overfitting.
[0114] Ultimately, the original node-level feature sequence is transformed into a time-slice-level feature sequence, while preserving the contribution differences of key brain regions at each time step.
[0115] The time-slice-level feature sequences are input into a gated recurrent unit (GRU). A two-layer GRU is designed here, and its recursive form can be written as:
[0116] in, Indicates the first Layer GRU at time The hidden state, Indicates the first Layer GRU in the previous moment The hidden state of 1 Indicates the first Layer GRU at time Input features, This represents a time-slice level representation. This indicates the number of gated recurrent unit (GRU) layers, with the first layer's input being... The input to higher layers is the hidden state of the previous layer, and dropout is introduced between layers to enhance generalization ability.
[0117] In this embodiment, the deep learning model training process is as follows: To prevent data leakage, the dataset is divided according to the subjects to avoid different time-series groups of the same subject being assigned to different datasets simultaneously. Five-fold cross-validation is used to evaluate model performance, and the following metrics are calculated: Accuracy, Precision, Recall, F1 score, and Area Under the Curve (AUC). The model parameters are set as follows: Number of classification categories = 3; Input feature dimension = 8; Hidden layer dimension = 24; Number of attention heads = 2; Bandwidth attention dropout = 0.1; Bandwidth attention temperature = 2.0; Temporal hidden dimension = 64; Temporal attention dropout = 0.1; GRU dropout = 0.3; Number of GRU layers = 2; Number of training epochs = 80; Batch size = 64; Learning rate = 5e-4; Model dropout = 0.5; Weight decay = 1e-3; L1 regularization coefficient = 1e-4.
[0118] In summary, this invention employs a Directed Transfer Function (DTF) to construct a multi-band directed brain network, which not only reflects the strength of connections between brain regions but also describes the direction of information flow between them, providing richer information compared to undirected brain networks. This invention combines directed graph convolution modules, multi-scale cross-band modules, and temporal modules to fully utilize the directional information in the adjacency matrix of the DTF, cross-band interaction information, and dynamic changes in continuous time slices, thereby improving the model's ability to identify abnormal patterns in brain networks and providing a new technical approach for the classification of temporal lobe epilepsy lateralization. The multi-scale directed temporal graph convolutional network constructed in this invention, i.e., the deep learning model, performs well in the temporal lobe epilepsy lateralization classification task, outperforming other commonly used models currently applied in this field, and has significant application value.
Claims
1. A deep learning model training method for lateral classification of temporal lobe epilepsy, characterized in that, Includes the following steps: S1. Preprocessing and source reconstruction of the magnetoencephalogram (MEG) signals; S2. Based on the source reconstruction results, select brain regions of interest that are related to temporal lobe epilepsy lateralization and obtain the brain region time series matrix. S3. Construct an adjacency matrix for multiple frequency bands based on brain region time series matrices; S4. Construct a node feature matrix based on the adjacency matrix; S5. Based on the node feature matrix, define and train a deep learning model, whereby the deep learning model is used to classify temporal lobe epilepsy lateralization.
2. The deep learning model training method for lateral classification of temporal lobe epilepsy according to claim 1, characterized in that, S1 includes: Preprocessing of the magnetoencephalogram (MEG) signal yields a clean MEG signal. The clean MEG signals were processed by source reconstruction, and the maximum power information was selected as the MEG time series of the entire brain region of interest.
3. The deep learning model training method for lateral classification of temporal lobe epilepsy according to claim 1, characterized in that, S3 includes: A time-domain multivariate autoregressive model (MVAR) was established for the time series of magnetoencephalograms (MEGs) of brain regions of interest. The MVAR was then transformed to the frequency domain using Fourier transform to obtain the frequency domain coefficient matrix. The frequency domain transfer function was obtained by inverting the frequency domain coefficient matrix and extracting the relative orientation influence intensity from it to obtain the orientation transfer function (DTF) matrix. Based on the Directed Transfer Function (DTF) matrix, the MEG time series of brain regions of interest are processed by normalized and non-normalized DTF transformations across multiple frequency bands to construct the adjacency matrix. The normalized DTF matrix represents the relative strength of connections between brain regions and is input into the deep learning model as the adjacency matrix; the non-normalized DTF matrix represents the absolute strength of connections between brain regions and is used to create the node feature matrix.
4. The deep learning model training method for lateral classification of temporal lobe epilepsy according to claim 1, characterized in that, S4 includes: Calculate the nodal input strength respectively and node output strength : in, Indicates the total number of nodes. Indicates the relationship with the first The node with a connection relationship 1 node Indicates from node Pointing to node The connection weights, Indicates from node Pointing to node Connection weights; Based on node input strength and node output strength Calculate the orientation preference of nodes : in, This indicates a number used to prevent division by zero; Compute node input power : in, Indicates the total number of nodes. Indicates from node Pointing to node Connection weights; The computation node has asymmetric input intensity with the opposite side. : in, Represents a node The corresponding node in the opposite hemisphere Input intensity; The output intensity of the compute node is asymmetrical with that of the opposite side. : in, Represents a node The corresponding node in the opposite hemisphere ; output intensity; The receiving preferences of the computing node and the counterpart are asymmetric. : in, Represents a node The corresponding node in the opposite hemisphere Reception preferences; Based on nodal input power The input power of the computing node is asymmetrical with that of the opposite side. : in, Represents a node The corresponding node in the opposite hemisphere Input power; splice node input strength Node output strength Node direction preference Node input power Input intensity asymmetry Asymmetrical output intensity Asymmetric reception preferences and input power asymmetry The node feature matrix is obtained.
5. The deep learning model training method for lateral classification of temporal lobe epilepsy according to claim 4, characterized in that, The definition and training of the deep learning model includes: The adjacency matrix and node feature matrix are used as inputs to the deep learning model; Based on the input, a deep learning model is defined, which includes a directed graph convolution module, a multi-scale cross-band module, and a temporal module. Train the deep learning model.
6. The deep learning model training method for lateral classification of temporal lobe epilepsy according to claim 5, characterized in that, The directed graph convolution module is used to extract spatial representations from node features and directed adjacency matrices based on each time slice and each adjacency matrix in each frequency band using directed graph convolution layers. The directed graph convolution layers include inbound branches, outbound branches, and their own feature paths. The multi-scale cross-band module is used to divide the frequency bands according to the frequency band range based on the extracted spatial representation to obtain frequency band groups. Self-attention modeling and dynamic weights within each frequency band group are performed to construct cross-band features between different frequency bands. Residual connections and layer normalization are added after the modeling self-attention module. The time-series module is used to extract global dynamic features within a time-series group based on cross-band features. In this module, a node attention pooling mechanism is introduced on each time slice to assign adaptive weights to the nodes.
7. The deep learning model training method for lateral classification of temporal lobe epilepsy according to claim 6, characterized in that, The construction of cross-band features between different frequency bands includes: Based on the extracted spatial representation, the frequency band is divided according to the frequency band range to obtain frequency band groups including low frequency group and mid-high frequency group; Within each frequency band group, a multi-head self-attention mechanism is used to capture the correlation and frequency band interaction relationships between different frequency bands within the frequency band group. Residual connections and layer normalization are added after the self-attention module within the group. Based on the capture results, a lightweight multilayer perceptron is used to generate dynamic weights within the group. : in, This represents the group weight generator. Indicates the first Within each frequency band group, the first Feature representation of each frequency band after intra-group interaction; Utilizing temperature coefficient The softmax algorithm transforms the dynamic weights within a group into normalized weights. : in, Indicates the first Frequency band index within a frequency band group Indicates the first Within each frequency band group, the first The dynamic weight score corresponding to each frequency band. Based on normalized weights, the within-group representation is obtained by weighted summation. : in, Indicates the first Within each frequency band group, the first Characteristic representation of each frequency band Indicates the first The first frequency band group Frequency band index; Based on within-group representation By performing dynamic fusion between groups, cross-band characteristics between different frequency bands are constructed.
8. The deep learning model training method for lateral classification of temporal lobe epilepsy according to claim 7, characterized in that, The expression for the cross-band feature is as follows: in, Indicates cross-band characteristics, This represents the baseline representation obtained by averaging the representations of the two frequency band groups. Indicates a scalar threshold. This represents the attention fusion representation obtained based on dynamic weights between groups. This represents the Sigmoid function. Indicates the use of scalar thresholds Lightweight multilayer perceptron network. This indicates the low-frequency group. This indicates the mid-to-high frequency group.
9. The deep learning model training method for lateral classification of temporal lobe epilepsy according to claim 6, characterized in that, The extraction of global dynamic features within a time series group includes: Based on cross-band characteristics, a score is calculated for each node to obtain the node score. In time slice Attention score ; For all attention scores Normalization is performed to obtain the node attention weights. ; Based on node attention weights The time slice level representation is obtained by weighted summation. ; Based on time-slice level representation The sequence is used to extract global dynamic features.
10. The deep learning model training method for lateral classification of temporal lobe epilepsy according to claim 9, characterized in that, The time slice level representation The expression is as follows: in, This represents the total number of nodes contained in each time slice. Indicates the first The first time slice 1 node Indicates the first The first time in the film The feature representation of each node. and All of these represent learnable parameters. Indicates the first The first time in the film Attention score for each node Indicates the first The first time in the film Attention score for each node This indicates a random deactivation operation.