A brain disease detection system based on multi-field feature fusion and attention mechanism

CN117084693BActive Publication Date: 2026-09-18JILIN UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311280333.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-07
Publication Date
2026-09-18
Estimated Expiration
2043-10-07

AI Technical Summary

Technical Problem

传统的方法是从单通道脑电信号中提取时域、频域和非线性特征,然后用机器学习方法进行检测和分类,但这些方法忽略了不同脑电图信号之间的相互通信

Benefits of technology

[0110] This invention extracts features from EEG signals in three domains: time domain, frequency domain, and brain connectivity network based on complex network indicators. It also constructs a multi-dimensional feature fusion network model with high accuracy and robustness to detect various brain diseases. The EEG signal analysis method of this invention can accurately describe the detailed features and states of the brain and effectively measure the feature indicators of the brain connectivity network, providing a new solution for the intelligent diagnosis and early warning of brain diseases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117084693B_ABST
    Figure CN117084693B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of electroencephalogram signal analysis, and particularly relates to a brain disease detection system based on multi-field feature fusion and an attention mechanism; electroencephalogram signals are respectively subjected to feature extraction from three fields, including a time domain, a frequency domain and a brain function network based on a complex network index; and a multi-dimensional feature fusion network model with high accuracy and strong robustness is constructed to detect various brain diseases; the electroencephalogram signal analysis method can accurately describe brain detail features and states and effectively measure characteristic indexes of a brain function network, thereby providing a new scheme for intelligent diagnosis and early warning of brain diseases.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of electroencephalogram (EEG) signal analysis technology, specifically relating to a brain disease detection system based on multi-domain feature fusion and attention mechanisms. Background Technology

[0002] Mental illnesses such as depression and anxiety are becoming increasingly prevalent due to rising societal pressures, and have become a major cause of global disease burden. If these illnesses are not diagnosed and treated promptly in their early stages, they can worsen and even lead to suicide. Attention deficit hyperactivity disorder (ADHD) is a neuropsychological and behavioral disorder characterized by inattention, hyperactivity, and impulsivity. It commonly occurs in early school-aged children and is one of the nine most common developmental behavioral problems in children. ADHD is often accompanied by conduct disorder, oppositional defiant disorder, learning disabilities, and other behavioral disorders. These clinical symptoms can have a lasting negative impact on children's cognitive and behavioral functions, not only impairing their growth and development but also placing a heavy economic and psychological burden on their families. Despite this, in some underdeveloped countries and regions, due to a lack of medical resources and professional medical personnel, as well as societal stigma surrounding mental disorders, more than 75% of patients do not receive timely and effective diagnosis and treatment.

[0003] Electroencephalography (EEG) is a technique that records and analyzes the weak electrical currents generated by the human brain. It can reflect the brain's functional and abnormal states and can be used to detect and diagnose various brain disorders, including depression, ADHD, Alzheimer's disease, epilepsy, neonatal brain injury, and Parkinson's disease. EEG has the advantages of low cost, non-invasiveness, painlessness, and ease of operation, allowing it to be performed in various situations and environments, increasing the feasibility and effectiveness of diagnosis. At the same time, EEG has high temporal resolution, capturing the brain's rapid response to stimuli. Therefore, using EEG for the rapid and reliable detection of mental illnesses such as depression and ADHD is a future trend.

[0004] Utilizing machine learning and EEG signals to diagnose brain diseases has become a research hotspot in recent years. Traditional methods extract time-domain, frequency-domain, and nonlinear features from single-channel EEG signals, then use machine learning for detection and classification. However, these methods neglect the communication between different EEG signals. Research shows that brain regions are not statically independent; continuous dynamic communication between regions is essential for normal brain function. Brain connectivity reflects the function of different brain regions and the complex cortical communication between them, which is of great significance for studying brain disorders such as ADHD and depression. Therefore, integrating EEG signal information from multiple perspectives and considering the characteristics of different domains will be a new trend in the future diagnosis of brain diseases; seeking an effective multi-domain feature fusion method and constructing a highly accurate and robust brain disease detection model are currently key issues. Summary of the Invention

[0005] To overcome the above problems, this invention provides a brain disease detection system based on multi-domain feature fusion and attention mechanisms, which can effectively analyze electroencephalogram (EEG) signals and improve the accuracy and robustness of brain disease detection.

[0006] A brain disease detection system based on multi-domain feature fusion and attention mechanisms includes a data acquisition and preprocessing module, a feature extraction module, and a brain disease identification module, wherein:

[0007] The data acquisition and preprocessing module preprocesses the acquired EEG signals and segments the EEG signals into different independent samples according to a fixed time length.

[0008] The feature extraction module is used to extract the time-domain feature matrix, frequency-domain feature matrix, and spatial-domain feature matrix of independent samples; the specific content is as follows:

[0009] Step 1, Extract temporal features

[0010] Each independent sample is used to extract time window samples using a sliding window method, and then time-domain features are extracted from the time window samples. Specifically, six time-domain features are extracted from the signals of all channels within each time window sample, including mean, variance, mean absolute voltage, number of zero crossings, root mean square, and waveform length.

[0011] Let s(k) represent the EEG signal value obtained by the kth sample in one channel within a time window sample, and K represent the total number of samples. The calculation method of the six time-domain features is as follows:

[0012] The mean refers to the average signal value of a channel within a time window sample. The calculation formula is:

[0013]

[0014] Variance refers to the degree to which the signal of a channel deviates from the mean within a time window of samples. The calculation formula is:

[0015]

[0016] The average absolute voltage refers to the average absolute value of the signal in one channel within a time window sample. The calculation formula is:

[0017]

[0018] The zero-crossing count refers to the number of times a channel's signal changes from positive to negative or vice versa within a certain time window. It reflects the speed of signal change and is calculated using the following formula:

[0019]

[0020] Where sgn is the sign function, that is:

[0021]

[0022] The root mean square (RMS) is the arithmetic square root of the average of the squares of the signals from one channel within a time window sample. It reflects the energy or effective value of the signal, and the calculation formula is:

[0023]

[0024] Waveform length refers to the sum of the amplitude changes of a channel's signal within a certain time window sample. It reflects the complexity and irregularity of the signal. The calculation formula is:

[0025]

[0026] The six time-domain features are extracted from the signals of all channels of each time window sample, and then all time window samples contained in each independent sample are stacked to obtain the time-domain feature matrix.

[0027] Step 2, extract frequency domain features

[0028] The power spectral density of all channels in each independent sample across five frequency bands is calculated using short-time Fourier transform. The formula for calculating the power spectral density of the signal in different frequency bands is as follows:

[0029]

[0030]

[0031] x(t) is the signal of one channel in an independent sample, w(t) is the window function, ω is the frequency, τ is the center position of the window function, t is the time variable, and j is a complex unit representing the coefficient of the imaginary part;

[0032] For each independent sample, the power spectral density of the signals in all channels is calculated for the five frequency bands: delta (1-4Hz), theta (4-7Hz), alpha (7-12Hz), beta (13-30Hz), and gamma (>30Hz), to obtain the frequency domain feature matrix.

[0033] Step 3, calculate the phase-locked loop value

[0034] Before calculating the phase-locked value, the instantaneous phase needs to be determined using an analytic signal based on the Hilbert transform; the analytic signal of the signal x(t) of one channel in an independent sample is:

[0035] z(t) = x(t) + iy(t)

[0036] Where y(t) is the Hilbert transform of x(t), then the instantaneous phase is:

[0037]

[0038] Therefore, the phase-locked loop value is:

[0039]

[0040] Where <·> represents the expected value, φ m (t)-φ n (t) represents the phase difference between the m and n channel signals; the value range of PLV is [0, 1], where 1 represents complete phase synchronization and 0 represents no phase synchronization; i is the imaginary unit;

[0041] By iterating through the signals of all channels in each independent sample, the phase-locked value between every two channels in each independent sample is calculated to obtain a matrix, which serves as the brain functional connectivity matrix.

[0042] Step 5: Establish a powerless brain functional network

[0043] The density method is used to transform the brain functional connectivity matrix into a binary network;

[0044] Step 6: Calculate the characteristic indices of complex networks

[0045] Based on the established brain connectivity network, characteristic metrics of the network are obtained. These metrics include node characteristics such as degree, betweenness centrality, eigenvector centrality, clustering coefficient, and local efficiency; and overall network characteristics such as global efficiency, transitivity, isomatch, small-world property, and characteristic path length. These metrics are calculated as follows:

[0046] 1. Degree: For a given node, the degree is the number of its connected neighboring nodes. The formula for calculating the degree of the i-th node is:

[0047]

[0048] Where C ij This represents the connection state between node i and node j. When there is a connection between node i and node j, C... ij =1, when there is no connection between node i and node j, C ij =0;

[0049] 2. Betweenness centrality represents the proportion of all shortest paths that pass through node i out of the total number of shortest paths. The formula is:

[0050]

[0051] Where σ st σ is the number of shortest paths from node s to node t, while σ st (i) is the number of paths from node s to node t that pass through node i;

[0052] 3. Eigenvector centrality is a way to measure the influence of nodes on a network; assuming a brain connectivity network G = (V, E), where V represents the set of network nodes, E represents the set of network edges, and x... i To represent the importance of node i, the formula for calculating the eigenvector centrality is:

[0053] EC i =x i =c∑ j∈G a ij x j

[0054] Where c is a proportionality constant; a is true if and only if node i is connected to node j. ij =1, otherwise 0;

[0055] 4. The clustering coefficient is an indicator that measures the degree to which nodes form close-knit groups in a network; for node i, the formula for calculating its clustering coefficient is:

[0056]

[0057] Where Ei Let be the number of edges between node i and its neighboring nodes. The transitivity of the network is equivalent to the average clustering coefficient. The calculation formula is:

[0058]

[0059] Where N is the total number of nodes in the brain's functional network;

[0060] 5. The characteristic path length is the average of the shortest distances between all pairs of nodes in the network, and its calculation formula is:

[0061]

[0062] Where, d ij This represents the shortest path length between nodes i and j;

[0063] 6. Isomatch refers to the correlation between the degree of a node in a network and the degrees of its neighbors. If nodes with higher degrees tend to connect to other nodes with higher degrees, the network is isomatched; if nodes with higher degrees tend to connect to nodes with lower degrees, the network is dissimilar; if the connections between nodes are independent of their degrees, the network is neutral. The formula for calculating isomatch r is:

[0064]

[0065] Among them, e jk It is the joint degree distribution, representing the probability that the degrees of the two endpoints of a randomly selected edge in the network are j and k, respectively. j It is a redundancy distribution, representing the probability that a randomly selected node in the network has random neighbor nodes of degree k. It is the variance of the redundancy distribution. r>0 represents network homogamy, r<0 represents network heterogamy, and the magnitude of |r| reflects the strength of network homogamy or heterogamy.

[0066] 7. The small-world coefficient is an indicator that characterizes whether a network exhibits small-world properties. It is determined by the ratio of the network's clustering coefficient and the length of its characteristic path to that of a random network. A random network is a network in which, given the number of nodes and edges, the probability of any two nodes being connected by an edge is equal. Its calculation formula is:

[0067]

[0068] in, and CPL real These are the clustering coefficient and feature path length of the brain's functional network, respectively. and CPL randThese are the clustering coefficient and feature path length of the random network, respectively. If SWC > 1, it indicates that the network has small-world properties.

[0069] 8. Local efficiency and global efficiency: Global efficiency measures the network's global transmission capacity and is defined as the inverse of the lengths of all shortest paths in a given network. Local efficiency is calculated at the level of a single node, not at the level of the entire network. Global efficiency E glob and local efficiency E loc (i) The calculation formula is:

[0070]

[0071] Where, d ij It is the shortest path length between nodes i and j;

[0072]

[0073] Where, N i Let d be the set of neighboring nodes of node i. jh D is the shortest path length between nodes j and h. i It is the degree of node i;

[0074] Five node features—degree, betweenness centrality, eigenvector centrality, clustering coefficient, and local efficiency—were extracted from all nodes in the brain connectivity network. Then, five network features—global efficiency, transitivity, isomatch, small-world property, and feature path length—were extracted from the brain connectivity network. The two sets of features were concatenated along the first dimension to obtain the spatial domain feature matrix.

[0075] The brain disease identification module detects brain diseases by constructing a highly robust deep learning network model on EEG signals. This model is a multi-dimensional feature fusion network based on an attention mechanism, consisting of a temporal attention module, a frequency domain attention module, a graph theory index attention module, and a fully connected module. Specific details are as follows:

[0076] 1. Temporal Attention Module

[0077] The temporal feature matrix extracted by the feature extraction module is input into this module, which uses an LSTM network with a self-attention mechanism to further extract the temporal features of the EEG signal.

[0078] The LSTM network includes a forget gate, an input gate, and an output gate, which are used to control the inflow, outflow, and update of information, respectively; its calculation process is represented by the following formula:

[0079]

[0080] Where, x tH is the input vector at time step t, i.e., the temporal feature matrix at time t. t C is the hidden state vector at time step t. t f is the unit state vector at time step t. t i t O t , is the forget gate, input gate, output gate and candidate unit state vector at time step t, σ is the sigmoid function, tanh is the hyperbolic tangent function, ⊙ is element-wise multiplication, and W, U and b are learnable parameter matrices or vectors.

[0081] The LSTM network contains the outputs O = [O1, O2, ..., O] at all time steps. T The hidden state H at the last time step T. T Where O = [O1, O2, ..., O T [H] is the matrix after extracting the temporal information of the features and before the nonlinear transformation tanh. T It is the last layer of the H matrix, and it is the output matrix of the LSTM network after integrating all the time information;

[0082] Therefore, H is established through a self-attention mechanism. T The relationship between the self-attention vector and OT, i.e., establishing the output O at each time step. t For H T Weights; Output O at each time step t After linear transformation, the values ​​are used as Key and Value, and the output H at the final time step is... T Multiply by matrix ω Q As a query; at time step t, the key t Value t Query, score e t and weight α t The calculation formulas are as follows:

[0083]

[0084] Where Query represents the query vector, indicating the target element to be followed; Key t The key vector represents the key vector at time step t, and the value represents the candidate elements that can be used to match the query vector; t The vector represents the values ​​at time step t, and the elements that can be used to generate the output; score e t This indicates the degree of matching between the query vector and the key vector, calculated using the scaled dot product; d k For Key t Dimensions The weight α is a scaling factor to prevent excessively large inner product values ​​from negatively impacting network learning. t This represents the contribution of each value vector to the output; the softmax function is used here to normalize the score. n is the number of time steps.

[0085] Among them, Query does not change with time step, ω Q ω V ω k These are the parameters of the neural network, which change during the backpropagation process, adjusting the weights α at each time step. t With Value t Weighted summation yields the weighted time-domain eigenvector FC1:

[0086]

[0087] 2. Network Frequency Domain Attention Module

[0088] This module takes the frequency domain feature matrix extracted by the feature extraction module as input. First, it trains the channel attention weights of all channels in the channel dimension through a channel attention network, and the output is a feature matrix with channel weights and unchanged dimension. Next, it trains the channel weighted feature matrix in the five frequency bands of the frequency band dimension through a frequency band attention network, and the output is a feature matrix with channel and frequency band weights and unchanged dimension. That is, it completes the weight allocation of the original feature vector and enhances the extraction of high-value features. Finally, the two feature dimensions are expanded into one dimension to obtain the frequency domain feature vector FC2.

[0089] 3. Graph Theory Indicator Attention Module

[0090] This module takes the spatial domain feature matrix extracted by the feature extraction module as input. This module trains channel attention weights on all channels in the channel dimension and the global feature channels of the network. The output is a feature matrix with channel weights whose dimension remains unchanged. Finally, the two feature dimensions are expanded into one dimension to obtain the spatial domain feature output vector FC3.

[0091] 3. Fully Connected Module

[0092] The feature vectors output by the three parallel networks are concatenated using a feature concatenation method to achieve the fusion of features in the time domain, frequency domain, and spatial domain. The formula is defined as follows:

[0093]

[0094] Where FC is the input vector of the fully connected module in the multi-feature fusion network;

[0095] The fully connected module's network structure consists of three fully connected layers and one output layer. Each fully connected layer is followed by a ReLU activation function and a dropout layer to prevent overfitting, with the dropout layer parameter set to 0.5. The output layer uses the Softmax activation function to output the probability of binary classification. This achieves a binary classification task between ADHD patients and a control group.

[0096] The training process of the multi-dimensional feature fusion network based on the attention mechanism in the brain disease identification module is as follows:

[0097] Step 1: Select EEG signals from 3657 non-ADHD patients and 4622 ADHD patients as the training set;

[0098] Step 2: Manually label the EEG signals belonging to non-ADHD patients in the training set as 0, and label the EEG signals belonging to ADHD patients in the training set as 1, thus obtaining the labeled training set;

[0099] Step 3: Input the labeled training set from Step 2 into the feature extraction module. The feature extraction module processes the data to obtain the time-domain feature matrix, frequency-domain feature matrix, and spatial-domain feature matrix.

[0100] Step four: Input the time-domain feature matrix, frequency-domain feature matrix, and spatial-domain feature matrix into the multi-dimensional feature fusion network based on the attention mechanism for training until the network's loss value tends to converge, at which point training is complete.

[0101] The data acquisition and preprocessing module specifically includes the following:

[0102] Step 1: Collect resting-state EEG signals from participants for at least 20 minutes;

[0103] Step 2: Preprocess the acquired EEG signals. The preprocessing steps are as follows: resample the EEG signals to 256Hz, remove the data from electrodes A1 and A2, remove 50Hz power line noise using a notch filter, and perform 0.5-70Hz bandpass filtering using an FIR filter to remove eye movement artifacts.

[0104] Step 3: The preprocessed EEG signal from Step 2 is segmented at fixed time intervals of 60 seconds, with each segment overlapping by 25%, and each segment is treated as an independent sample.

[0105] In step 1 of the feature extraction module, time-domain features are extracted by extracting time-window samples from each independent sample using a sliding window method, and then time-domain features are extracted from the time-window samples. In the sliding window segmentation part, a sliding window length of 4s and a sliding step size of 2s are selected to extract time-window samples.

[0106] In the frequency domain attention module of the network, the channel attention network first performs global average pooling on the input frequency domain feature moments across all channels H, then reduces the dimensionality through a fully connected layer of size H / 2; after activation using the ReLU function, it increases the dimensionality using a fully connected layer of size 2×H; after activation using the Sigmoid function, the calculated weights are summed with the original feature vector to output a weighted vector; finally, a residual module introduces a short-path connection to add the input and output features, thereby learning the residual function between the input and output, effectively preventing overfitting caused by a large number of parameters; resulting in a feature matrix with channel weights whose dimensionality remains unchanged.

[0107] The frequency band attention network performs the same operation on the frequency band channels in the input feature matrix with channel weights, that is, it completes the training of frequency band attention in the five frequency bands in the frequency band dimension, and outputs a feature matrix with channel and frequency band weights with unchanged dimension.

[0108] The graph theory index attention module performs the same operation on the spatial domain feature matrix as the channel attention network to obtain the spatial domain feature output vector FC3.

[0109] The beneficial effects of this invention are:

[0110] This invention extracts features from EEG signals in three domains: time domain, frequency domain, and brain connectivity network based on complex network indicators. It also constructs a multi-dimensional feature fusion network model with high accuracy and robustness to detect various brain diseases. The EEG signal analysis method of this invention can accurately describe the detailed features and states of the brain and effectively measure the feature indicators of the brain connectivity network, providing a new solution for the intelligent diagnosis and early warning of brain diseases. Attached Figure Description

[0111] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the content of the embodiments of the present invention and these drawings without creative effort.

[0112] Figure 1 This is the overall flowchart of the present invention.

[0113] Figure 2 This invention relates to EEG data acquisition diagrams and international 10-20 electrode placement standard diagrams.

[0114] Figure 3It is a brain functional connectivity matrix diagram and an unweighted brain connectivity network diagram.

[0115] Figure 4 This is a structural diagram of the proposed multidimensional feature fusion network model.

[0116] Figure 5 This is a diagram of the proposed TA-Net network model structure.

[0117] Figure 6 This is a diagram of the proposed FA-Net and GA-Net network model structures. Detailed Implementation

[0118] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.

[0119] A brain disease detection system based on multi-domain feature fusion and attention mechanisms includes a data acquisition and preprocessing module, a feature extraction module, and a brain disease identification module, wherein:

[0120] The data acquisition and preprocessing module preprocesses the acquired EEG signals and segments them into different independent samples according to a fixed time length; specifically, it includes the following:

[0121] Step 1: Develop a data collection plan. Following the pre-set experimental requirements and adhering to the international 10-20 electrode standard, collect at least 20 minutes of resting-state EEG signals from participants as raw data. This data is text-based. To ensure EEG signal quality, participants must abstain from caffeine, alcohol, and other abusive substances for one week prior to EEG recording and must not have any other mental health conditions. During recording, participants should sit in a quiet room, relaxed, and with their eyes closed. The EEG sensor is attached to the participant's scalp, and at least 10 minutes of resting-state data with eyes closed is collected. Twenty-one Ag / AgCl electrodes were used, with the average potential of both earlobes (a method of selecting reference electrodes by averaging the potentials of two electrodes placed on both earlobes as the reference potential; then the difference between the potentials of the other 19 electrodes and the reference potential is calculated, and the resulting EEG signal is used as the reference electrode to measure scalp voltage) employed. The 21 channels followed the international 10-20 electrode placement standard. The 19 electrodes covering the scalp included those in the frontal lobe (Fp1, Fp2, F3, F4, F7, F8, Fz), temporal lobe (T3, T4, T5, T6), parietal lobe (P3, P4, P7, P8), occipital lobe (O1, O2), and central (C3, C4) regions, plus two electrodes on the left and right earlobes (A1, A2). Figure 2 The acquisition process and the positions of the 21 electrodes are shown.

[0122] Step 2: Preprocess the acquired EEG signals. The preprocessing includes: resampling the EEG signals to 256Hz, removing data from electrodes A1 and A2, using a notch filter to remove 50Hz power line noise, using an FIR filter for 0.5-70Hz bandpass filtering, and using the ICLabel algorithm (a built-in plugin in MATLAB) to remove eye-movement artifacts. Specifically:

[0123] The signals measured by the electrodes covering the scalp are actually the difference between the active electrode and the reference electrode. The average potential of electrodes A1 and A2 was used as the reference potential to obtain the signals from the remaining 19 active electrodes. First, the sampling frequency of the acquired EEG signals (including 19 channels) was set to 256Hz, and a notch filter was used to suppress 50Hz power line noise. Next, all EEG signals were subjected to FIR bandpass filtering with cutoff frequencies of 0.5Hz and 70Hz. Finally, the ICLabel algorithm was used to remove artifacts related to eye movement, heartbeat, muscle activity, and line noise. All of these operations were performed using the EEGLAB plugin in Matlab.

[0124] Step 3: Deep learning methods require a large amount of data for training to achieve good generalization results. If the sample size is too small, overfitting is likely to occur. Due to privacy concerns regarding medical datasets, there are currently no open-source large-scale EEG datasets available for training. Therefore, to achieve better results, the collected EEG signals are segmented to expand the dataset.

[0125] The EEG signals preprocessed in step 2 are segmented at fixed time intervals of 60 seconds, with each segment overlapping by 25%. This strategy is a practical method to overcome the limited availability of data, treating each segmented EEG signal as an independent sample.

[0126] The feature extraction module is used to extract the time-domain feature matrix, frequency-domain feature matrix, and spatial-domain feature matrix of independent samples; the specific content is as follows:

[0127] Step 1, Extract temporal features

[0128] There is a certain relationship between signal sampling frequency and signal length for feature extraction. Generally speaking, the longer the signal length, the higher the frequency resolution, and the better it can reflect the frequency components of the signal. However, the signal length cannot be too long, otherwise it will lead to a decrease in temporal resolution and an inability to capture the time-varying characteristics of the signal. Therefore, when extracting the temporal features of EEG signals, each 60-second independent sample is extracted into a time window sample using the sliding window method, and then temporal features are extracted from the time window sample. In the sliding window segmentation part, a sliding window length of 4 seconds and a sliding step size of 2 seconds are used to extract the time window sample. That is, the overlapping part is 50% during the sliding window advancement, that is, the 60-second independent sample is segmented into 29 time window samples. Six temporal features are extracted from the signals of all channels in each time window sample, including mean, variance, mean absolute voltage, number of zero crossings, root mean square, and waveform length.

[0129] Let s(k) represent the EEG signal value obtained by the kth sample in one channel within a time window sample, and K represent the total number of samples. The calculation method of the six time-domain features is as follows:

[0130] The mean refers to the average value of the signal from one channel within a time window (i.e., the signal from one channel within 4 seconds). The formula is as follows:

[0131]

[0132] Variance refers to the degree to which the signal of a channel deviates from the mean within a time window of samples. The formula for calculation is:

[0133]

[0134] Mean Absolute Voltage (MAV) refers to the average absolute value of the signal in one channel within a time window sample. The calculation formula is:

[0135]

[0136] Zero-crossing rate (ZCR) refers to the number of times a channel's signal changes from positive to negative or vice versa within a certain time window. It reflects the speed of signal change and is calculated using the following formula:

[0137]

[0138] Where sgn is the sign function, i.e.

[0139]

[0140] The root mean square (RMS) is the arithmetic square root of the average of the squares of the signals in a single channel within a time window sample. It reflects the energy or effective value of the signal. The calculation formula is:

[0141]

[0142] Waveform length (WL) refers to the sum of the amplitude changes of a channel's signal within a certain time window sample. It reflects the complexity and irregularity of the signal. The calculation formula is:

[0143]

[0144] The six temporal features are extracted from the signals of all 19 channels of each time window sample, resulting in a total of 114-dimensional features. Then, all 29 time window samples contained in each independent sample are stacked to obtain a temporal feature matrix. The dimension of one sample is (29, 114). Finally, the array dimension of the TA-Net network model training is (number of samples, 29, 114).

[0145] Step 2, extract frequency domain features

[0146] Brain signals are always a mixture of several fundamental frequencies; depending on the frequency range or band, these signal values ​​are roughly divided into five types: delta (1-4Hz), theta (4-7Hz), alpha (7-12Hz), beta (13-30Hz), and gamma (>30Hz). These values ​​may vary slightly depending on the research question; since different frequency bands are associated with different diseases, these frequency bands play a crucial role in the study of various brain diseases.

[0147] Frequency domain analysis typically uses the Fourier transform method; however, the Fourier transform has a limitation: it is only applicable to steady-state data, while EEG data is non-steady-state data. Therefore, the Short-Time Fourier Transform (STFT) is used to calculate the power spectral density of all 19 channels in each independent sample across five frequency bands, as detailed below:

[0148] A sliding window mechanism is used for a single channel. The window size and step size are set, and the window slides across the time-domain signal. The Fourier transform of the signal within each sliding window is calculated, forming the frequency-domain signals corresponding to different time windows. These signals are then concatenated to obtain data showing the frequency variation over time. The specific details are as follows:

[0149] The short-time Fourier transform formula is:

[0150]

[0151] Where x(t) is the signal of one channel in an independent sample, w(t) is the window function, ω is the frequency, and τ is the center position of the window function. Window function w(t) The axis of symmetry in the time domain, which is also the center position of the window function, determines the... Signal x(t) In the time domain, the analysis location is to extract a slice of the signal near τ and perform a Fourier transform. ), where t is the time variable and j is a complex unit representing the coefficient of the imaginary part;

[0152] The sum of squares of S(ω,τ) in different frequency intervals is the power spectral density of the signal in different frequency bands. The formula for its calculation is as follows:

[0153]

[0154] Here, a Hamming window function ω is used, with a window length of 1 second and a window overlap of 50%. The power spectral density of the five frequency bands delta (1-4Hz), theta (4-7Hz), alpha (7-12Hz), beta (13-30Hz), and gamma (>30Hz) is calculated for the signals of the 19 channels in each independent sample. Therefore, the feature matrix dimension of each independent sample is (19, 5), and the array dimension of the final FA-Net network model training is (number of samples, 19, 5).

[0155] Step 3, calculate the phase-locked loop value

[0156] Phase-locked value (PLV) is an important method for studying the synchronicity of neural activity in the brain. It can be used to assess the functional connectivity of the brain. PLV first separates phase information from signals, and then calculates the absolute value of the average phase difference between two signals.

[0157] Before calculating the phase-locked value, the instantaneous phase needs to be determined using an analytic signal based on the Hilbert transform; the analytic signal of the signal x(t) of one channel in an independent sample is:

[0158] z(t) = x(t) + iy(t)

[0159] Where y(t) is the Hilbert transform of x(t), then the instantaneous phase is:

[0160]

[0161] Therefore, the phase-locked loop value is:

[0162]

[0163] Where <·> represents the expected value, φ m (t)-φ n (t) represents the phase difference between the m and n electrode channel signals; the value range of PLV is [0, 1], where 1 represents complete phase synchronization and 0 represents no phase synchronization; i is the imaginary unit;

[0164] Iterate through all channels of the signal in each independent sample, and calculate the phase-locked value between every two channels in each independent sample. The total number of such values ​​is... The possible results yield a 19*19 matrix, which serves as the brain functional connectivity matrix. The phase-locked value between any two channel signals is used as the connection strength between the two signals. That is, by traversing the data of 19 channels of a sample, the PLV value of each pair of channels is calculated in the above manner, thus calculating 19*19 values ​​and forming a 19*19 matrix.

[0165] Step 5: Establish a powerless brain functional network

[0166] The density method is used to transform the brain functional connectivity matrix into a binary network. The density method is a method for preserving matrix edges according to a percentage, which ensures consistency in the number of edges in the connectivity matrices of all individuals. Details are as follows:

[0167] The brain functional connectivity matrix is ​​binarized according to a certain ratio based on the connection strength of the edges. Finally, the weights of all retained edges are set to 1, and the weights of the discarded edges are set to 0. Here, a 50% density threshold is selected, meaning 50% of the connectivity edges in the brain functional connectivity matrix are retained, with the weights of the retained edges set to 1 and the weights of the discarded edges set to 0, resulting in the brain connectivity network. The brain functional connectivity matrix and the unweighted brain connectivity network are shown below. Figure 3 As shown.

[0168] Step 6: Calculate the characteristic indices of complex networks

[0169] Brain connectivity graphs based on complex network theory possess many valuable network features. Extracting these complex network feature parameters can effectively reflect the performance and characteristics of the brain network. Based on the established brain connectivity network, feature indices are obtained. These indices for network nodes (network nodes are electrode channels for EEG signals) include degree, betweenness centrality, eigenvector centrality, clustering coefficient, and local efficiency. Overall network feature indices include global efficiency, transitivity, isomatch, small-world property, and feature path length. These indices are calculated as follows:

[0170] 1. Degree: For a given node, the degree is the number of its connected neighboring nodes, where a node represents a specific EEG channel; the formula for calculating the degree of the i-th node is:

[0171]

[0172] Where C ij This represents the connection state between node i and node j. When there is a connection between node i and node j, C... ij =1, when there is no connection between node O and node j, C ij =0; This metric is only applicable to binary networks. It only considers the presence or absence of connections and does not consider any weight information.

[0173] 2. Betweenness Centrality: This is one of the metrics for graph centrality based on shortest paths. It represents the percentage of all shortest paths (the shortest path is the path between any two nodes) that pass through node i. It reflects the "bridging" role of a node in the network, i.e., its importance. The formula is:

[0174]

[0175] Where σ st σ is the number of shortest paths from node s to node t, while σ st(i) is the number of paths from node s to node t that pass through node i;

[0176] 3. Eigenvector centrality is a way to measure the influence of a node on a network; the importance of a node depends both on the number of its neighboring nodes (i.e., the degree of the node) and the importance of its neighboring nodes. Assume a brain connectivity network G = (V, E), where V represents the set of network nodes, E represents the set of network edges, and x... i To represent the importance of node i, the formula for calculating the eigenvector centrality is:

[0177] EC i =x i =c∑ j∈G a ij x j

[0178] Where c is a proportionality constant; a is true if and only if node i is connected to node j. ij =1, otherwise 0;

[0179] 4. Clustering Coefficient: This is a metric that measures the degree to which nodes form close-knit groups in a network; it considers that the more connections a node has among its neighbors, the higher its clustering coefficient. For node i, the formula for calculating its clustering coefficient is:

[0180]

[0181] Where E i Let be the number of edges between node i and its neighboring nodes, representing the network's transitivity, which is also the average clustering coefficient. The calculation formula is:

[0182]

[0183] Where N is the total number of nodes in the brain's functional network;

[0184] 5. Characteristic Path Length: This is the average of the shortest distances between all pairs of nodes in the network, reflecting the network's connectivity. Its calculation formula is:

[0185]

[0186] Where, d ij This represents the shortest path length between nodes i and j;

[0187] 6. Assortativity: This refers to the correlation between the degree of a node in a network and the degrees of its neighbors. If nodes with higher degrees tend to connect to other nodes with higher degrees, the network is assortative; if nodes with higher degrees tend to connect to nodes with lower degrees, the network is dissortative; if the connections between nodes are independent of their degrees, the network is neutral. The formula for calculating assortativity r is:

[0188]

[0189] Among them, e jk It is the joint degree distribution, representing the probability that the degrees of the two endpoints of a randomly selected edge in the network are j and k, respectively. j It is a redundancy distribution, representing the probability that a randomly selected node in the network has random neighbor nodes of degree k. It is the variance of the redundancy distribution. r>0 represents network homogamy, r<0 represents network heterogamy, and the magnitude of |r| reflects the strength of network homogamy or heterogamy.

[0190] 7. Small-World Coefficient: This is an indicator that characterizes whether a network exhibits small-world properties. It is determined by the ratio of the network's clustering coefficient and the length of its characteristic path to that of a random network. A random network is a network in which, given the number of nodes and edges, the probability of any two nodes being connected by an edge is equal. Its calculation formula is:

[0191]

[0192] in, and CPL real These are the clustering coefficient and feature path length of the brain's functional network, respectively. and CPL rand These are the clustering coefficient and feature path length of the random network, respectively. If SWC > 1, it indicates that the network has small-world properties.

[0193] 8. Local Efficiency and Global Efficiency: Global efficiency measures the overall transmission capacity of a network and is defined as the inverse of the lengths of all shortest paths in a given network. Local efficiency is calculated similarly to global efficiency, but it is calculated at the level of a single node, not the entire network. Global efficiency E... glob and local efficiency E loc (i) The calculation formula is:

[0194]

[0195] Where, dij It is the shortest path length between nodes i and j;

[0196]

[0197] Where, N i Let d be the set of neighboring nodes of node i. jh D is the shortest path length between nodes j and h. i It is the degree of node i;

[0198] Five node features—degree, betweenness centrality, eigenvector centrality, clustering coefficient, and local efficiency—were extracted from all 19 nodes in the brain connectivity network, resulting in (19, 5) dimensional features. Then, five network features—global efficiency, transitivity, isomatch, small-world property, and feature path length—were extracted from the brain connectivity network, resulting in (1, 5) dimensional features. The two sets of features were concatenated along the first dimension, resulting in a total of (20, 5) dimensional features extracted from each brain connectivity network. This yielded the spatial domain feature matrix used in training the GA-Net network model; its array dimensions are (number of samples, 20, 5).

[0199] The brain disease identification module detects brain diseases by constructing a highly robust deep learning network model on EEG signals. This model is a multi-dimensional feature fusion network based on an attention mechanism, consisting of a temporal attention module (TA-Net), a frequency domain attention module (FA-Net), a graph theory index attention module (GA-Net), and a fully connected module. The network structure is as follows: Figure 4 As shown, the temporal attention module employs an LSTM network incorporating a self-attention mechanism to further extract temporal features of EEG signals. The frequency domain attention module and graph theory index attention module, respectively, use frequency band attention networks and channel attention networks to weight the original feature vectors, enhancing the selection of high-value features. Finally, the feature vectors extracted by the three modules are concatenated in parallel along the first dimension to obtain a fused feature vector, which is then used by a fully connected module to achieve accurate detection of brain diseases. The specific details are as follows:

[0200] 1. Temporal Attention Module

[0201] The temporal feature matrix extracted by the feature extraction module is input into this module. The size of the temporal feature matrix is ​​(number of samples, 29, 114). This module uses an LSTM network with a self-attention mechanism to further extract the temporal features of the EEG signal. Its network structure is as follows: Figure 5 As shown.

[0202] Long Short-Term Memory (LSTM) networks can better solve the problems of gradient vanishing, gradient exploding, and long-term dependencies encountered by RNNs when processing long sequences. The characteristics of LSTM networks are that there is a unit state at each time step to store long-term information, and three gate controllers, namely the forget gate, input gate, and output gate, to control the inflow, outflow, and updating of information.

[0203] The LSTM network includes a forget gate, an input gate, and an output gate, which are used to control the inflow, outflow, and update of information, respectively; its calculation process is represented by the following formula:

[0204]

[0205] Where, x t H is the input vector at time step t, i.e., the temporal feature matrix at time t. t C is the hidden state vector at time step t. t It is the unit state vector (H) at time step t. t C t All in x t Substitute the intermediate variables generated during network computation (used to store the time-memory information learned along the way), f t i t O t , is the forget gate, input gate, output gate and candidate unit state vector at time step t, σ is the sigmoid function, tanh is the hyperbolic tangent function, ⊙ is element-wise multiplication, and W, U and b are learnable parameter matrices or vectors.

[0206] The self-attention mechanism was first proposed by the Google team in 2017 and applied to the Transformer language model. Self-attention can be used independently in encoding or decoding, and compared to regular attention mechanisms, it focuses more on the internal relationships within the input. An LSTM network contains the outputs O = [O1, O2, ..., O2] at all time steps. T The hidden state H at the last time step T. T Where O = [O1, O2, ..., O T [H] is the matrix after extracting the temporal information of the features and before the nonlinear transformation tanh. T It is the last layer of the H matrix, and it is the output matrix of the traditional LSTM network after integrating all time information;

[0207] Therefore, H is established through a self-attention mechanism. T The relationship between the self-attention vector and OT, i.e., establishing the output O at each time step.t For H T The weights; since the LSTM network itself considers location information, no additional location encoding is needed; the output H at each time step t After linear transformation, the values ​​are used as Key and Value, and the output H at the final time step is... T Multiply by matrix ω Q As a query; at time step t, the key t Value t Query, score e t and weight α t The calculation formulas are as follows:

[0208]

[0209] Where Query represents the query vector, indicating the target element that the model wants to focus on; Key t The key vector represents the key vector at time step t, indicating the candidate elements that the model can use to match the query vector; Value t The vector represents the values ​​at time step t, indicating the elements that the model can use to generate the output; the score e t This indicates the degree of matching between the query vector and the key vector, calculated using the scaled dot product; d k For Key t Dimensions The weight α is a scaling factor to prevent excessively large inner product values ​​from negatively impacting network learning. t This represents the contribution of each value vector to the output; the softmax function is used here to normalize the score. n is the number of time steps.

[0210] Among them, Query does not change with time step, ω Q ω V ω k These are the parameters of the neural network, which change during the backpropagation process, adjusting the weights α at each time step. t With Value t Weighted summation yields the weighted time-domain eigenvector FC1:

[0211]

[0212] For the LSTM network parameters, `hidden_dim` is set to 128, meaning each H matrix has a dimension of 128*1, and `num_layers` is set to 2 (meaning the LSTM runs twice). For the self-attention parameters, `d_model` is set to 128, `n_heads` is set to 4 (representing the number of heads in the multi-head self-attention sub-layer, i.e., how many parts the input vector is divided into for parallel computation; each head has its own query, key, and value matrix, and the outputs of each head are concatenated), and `num_layers` is set to 1 (the self-attention layer only runs once). Therefore, the final output vector FC1 has a dimension of 128*1.

[0213] 2. Network Frequency Domain Attention Module

[0214] This module takes the frequency domain feature matrix extracted by the feature extraction module as input, with a size of (number of samples, 19, 5). First, a channel attention network is used to train channel attention weights on all 19 channels, outputting a feature matrix with channel weights and unchanged dimensions. Next, a frequency band attention network is used to train frequency band attention on the 5 frequency bands, outputting a feature matrix with both channel and frequency band weights and unchanged dimensions. This completes the weight allocation of the original feature vector, enhancing the extraction of high-value features. The network structure is as follows: Figure 6 As shown. The FA-Net outputs a weighted feature vector matrix with a size of (number of samples, 19, 5). Finally, the last two feature dimensions are expanded into one dimension to obtain the frequency domain feature vector FC2, with a size of (number of samples, 95).

[0215] The channel attention network first performs global average pooling on all 19 channels in dimension H for the input frequency domain feature moments, then reduces the dimensionality through a fully connected layer of size H / 2; after activation using the ReLU function, it increases the dimensionality using a fully connected layer of size 2×H; after activation using the Sigmoid function, the calculated weights are summed with the original feature vector to output a weighted vector; finally, a residual module is introduced to introduce a short-path connection, which adds the input and output features to learn the residual function between the input and output, effectively preventing overfitting caused by a large number of parameters; resulting in a feature matrix with channel weights whose dimensionality remains unchanged.

[0216] The frequency band attention network performs the same operation on the frequency band channels in the input feature matrix with channel weights, that is, it completes the training of frequency band attention in the five frequency bands in the frequency band dimension, and outputs a feature matrix with channel and frequency band weights with unchanged dimension.

[0217] 3. Graph Theory Indicator Attention Module

[0218] This module takes the spatial domain feature matrix extracted by the feature extraction module as input, with a size of (number of samples, 20, 5). This module trains channel attention weights on all 19 channels of the channel dimension and the global feature channels of the network, and the output is a feature matrix with channel weights whose dimension remains unchanged; the structure of the channel attention network is as described in 3.2.

[0219] GA-Net ultimately outputs a weighted feature vector matrix (number of samples, 20, 5). Finally, the two feature dimensions are expanded into one dimension to obtain the spatial domain feature output vector FC3, with a size of (number of samples, 100).

[0220] The graph theory index attention module performs the same operation on the spatial domain feature matrix as the channel attention network to obtain the spatial domain feature output vector FC3.

[0221] 3. Fully Connected Module

[0222] The feature vectors output by three parallel networks (the three networks corresponding to the temporal attention module (TA-Net), the frequency domain attention module (FA-Net), and the graph theory index attention module (GA-Net)) are concatenated using a feature concatenation method to achieve the fusion of temporal, frequency, and spatial domain features. The formula is defined as follows:

[0223]

[0224] The dimension of FC is (128+95+100,1), which is (323,1). It is used as the input vector of the fully connected module in the multi-feature fusion network. FC1, FC2, and FC2 are the final output vectors of TA-Net, FA-Net, and GA-Net, respectively.

[0225] The fully connected module's network structure consists of three fully connected layers and one output layer. Each fully connected layer is followed by a ReLU activation function and a dropout layer to prevent overfitting, with the dropout layer parameter set to 0.5. The output layer uses the Softmax activation function to output the probability of binary classification. This achieves a binary classification task between ADHD patients and a control group.

[0226] The training process of the multi-dimensional feature fusion network based on the attention mechanism in the brain disease identification module is as follows:

[0227] Step 1: Select EEG signals from 3657 non-ADHD patients and 4622 ADHD patients as the training set;

[0228] Step 2: Manually label the EEG signals belonging to non-ADHD patients in the training set as 0, and label the EEG signals belonging to ADHD patients in the training set as 1, thus obtaining the labeled training set;

[0229] Step 3: Input the labeled training set from Step 2 into the feature extraction module. The feature extraction module processes the data to obtain the time-domain feature matrix, frequency-domain feature matrix, and spatial-domain feature matrix.

[0230] Step four: Input the time-domain feature matrix, frequency-domain feature matrix, and spatial-domain feature matrix into the multi-dimensional feature fusion network based on the attention mechanism for training until the network's loss value tends to converge, at which point training is complete.

[0231] The backpropagation algorithm and stochastic gradient descent method are used. The weights of each layer are updated iteratively based on the magnitude of the loss value of the forward propagation until the model's loss value tends to converge. The training of the model is stopped. The binary cross entropy loss function is used as the loss function of the model in the classification module.

[0232] The formula for the Binary Cross Entropy Loss function is as follows:

[0233]

[0234] Where y is a binary label 0 or 1, p(y) is the probability that the output belongs to the label y, and M is the number of samples.

[0235] This invention was validated on a dataset obtained from clinical cases, achieving feature fusion in three domains, including the time domain, frequency domain, and spatial domain. Furthermore, it constructed a multi-dimensional feature fusion network model with high accuracy and robustness to detect various brain diseases, providing a new solution for the intelligent diagnosis and early warning of brain diseases.

[0236] The preferred embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the scope of protection of the present invention is not limited to the specific details in the above embodiments. Within the scope of the technical concept of the present invention, any person skilled in the art can make equivalent substitutions or changes based on the technical solution and inventive concept of the present invention within the scope of the technology disclosed in the present invention. These simple modifications are all within the scope of protection of the present invention.

[0237] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present invention will not describe the various possible combinations separately.

[0238] Furthermore, various different embodiments of the present invention can be combined in any way, as long as they do not violate the spirit of the present invention, they should also be regarded as the content disclosed by the present invention.

Claims

1. A brain disease detection system based on multi-domain feature fusion and attention mechanisms, characterized in that, It includes a data acquisition and preprocessing module, a feature extraction module, and a brain disease identification module, among which: The data acquisition and preprocessing module preprocesses the acquired EEG signals and segments the EEG signals into different independent samples according to a fixed time length. The feature extraction module is used to extract the time-domain feature matrix, frequency-domain feature matrix, and spatial-domain feature matrix of independent samples; the specific content is as follows: Step 1: Extract temporal features Each independent sample is used to extract time window samples using a sliding window method, and then time-domain features are extracted from the time window samples. Specifically, six time-domain features are extracted from the signals of all channels within each time window sample, including mean, variance, mean absolute voltage, number of zero crossings, root mean square, and waveform length. set up This represents the EEG signal value obtained from the k-th sample within a channel of a time window sample, where K represents the total number of samples. The calculation methods for the six time-domain features are as follows: The mean refers to the average signal value of a channel within a time window sample. The calculation formula is: Variance refers to the degree to which the signal of a channel deviates from the mean within a time window of samples. The calculation formula is: The average absolute voltage refers to the average absolute value of the signal in one channel within a time window sample. The calculation formula is: The zero-crossing count refers to the number of times a channel's signal changes from positive to negative or vice versa within a certain time window. It reflects the speed of signal change and is calculated using the following formula: in It is a symbolic function, that is: The root mean square (RMS) is the arithmetic square root of the average of the squares of the signals from one channel within a time window sample. It reflects the energy or effective value of the signal, and the calculation formula is: Waveform length refers to the sum of the amplitude changes of a channel's signal within a certain time window sample. It reflects the complexity and irregularity of the signal. The calculation formula is: The six time-domain features are extracted from the signals of all channels of each time window sample, and then all time window samples contained in each independent sample are stacked to obtain the time-domain feature matrix. Step 2: Extract frequency domain features The power spectral density of all channels in each independent sample across five frequency bands is calculated using short-time Fourier transform. The formula for calculating the power spectral density of the signal in different frequency bands is as follows: It is the signal of one channel in an independent sample. It is a window function. It's frequency. It is the center position of the window function, and t is the time variable. It is a complex unit, representing the coefficient of the imaginary part; For each independent sample, the power spectral density of the signals in all channels is calculated for the five frequency bands: delta (1-4Hz), theta (4-7Hz), alpha (7-12Hz), beta (13-30Hz), and gamma (>30Hz), to obtain the frequency domain feature matrix. Step 3: Calculate the phase-locked loop value Before calculating the phase-locked value, the instantaneous phase needs to be determined using analytic signals based on the Hilbert transform; the signal of one channel in an independent sample. Its analytical signal is: in, yes The Hilbert transform gives the instantaneous phase as: Therefore, the phase-locked loop value is: in, Indicates the expected value. express and The phase difference of the channel signal; the value range of PLV is [0, 1], where 1 represents complete phase synchronization and 0 represents no phase synchronization; It is the imaginary unit; By iterating through the signals of all channels in each independent sample, the phase-locked value between every two channels in each independent sample is calculated to obtain a matrix, which serves as the brain functional connectivity matrix. Step 3: Establishing a powerless brain functional network The density method is used to transform the brain functional connectivity matrix into a binary network; Step 4: Calculate the characteristic indicators of complex networks Based on the established brain connectivity network, characteristic metrics of the network are obtained. These metrics include node characteristics such as degree, betweenness centrality, eigenvector centrality, clustering coefficient, and local efficiency; and overall network characteristics such as global efficiency, transitivity, isomatch, small-world property, and characteristic path length. These metrics are calculated as follows: S3.1, Degree: For a given node, the degree is the number of its connected neighboring nodes, the nth degree. The formula for calculating the degree of a node is: in Represents a node and nodes The connection state between nodes, when nodes and nodes When there is a connection between them, When node and nodes When there is no connection between them, ; S3.2, Betweenness centrality indicates that the nodes visited in all shortest paths are... The percentage of the number of paths to the total number of shortest paths is calculated using the following formula: in It is a node To the node The number of shortest paths, and It is a node To the node The shortest path passes through the nodes The number of entries; S3.3, eigenvector centrality is a way to measure the influence of nodes on a network; assuming the brain is connected to the network. , Represents a set of network nodes. Represents the set of network connection edges. Represents a node The importance of eigenvector centrality is determined by the following formula: in It is a proportionality constant; if and only if the nodes With nodes When connected, Otherwise, it is 0; S3.4, the clustering coefficient is an indicator that measures the degree to which nodes form close-knit groups in a network; for nodes The formula for calculating its clustering coefficient is: in For nodes The number of edges between a node and its neighbors indicates the transitivity of the network, which is also known as the average clustering coefficient. The calculation formula is: Where N is the total number of nodes in the brain's functional network; S3.5, the characteristic path length is the average of the shortest distances between all pairs of nodes in the network, and its calculation formula is: in, Represents a node and The shortest path length between them; S3.6, Isomatch refers to the correlation between the degree of a node in a network and the degrees of its neighbors. If nodes with higher degrees tend to connect to other nodes with higher degrees, the network is isomatched; if nodes with higher degrees tend to connect to nodes with lower degrees, the network is dissimilar; if the connections between nodes are independent of their degrees, the network is neutral. The calculation formula is: in, This is the joint degree distribution, representing the degree of the two endpoints of a randomly selected edge in the network. and The probability, This is a redundancy distribution, representing the degree of randomly selected nodes in the network whose random neighbor nodes are 0. The probability, It is the variance of the redundancy distribution. Represents online matching, Represents online heterosexuality. The size reflects the strength of homo- or hetero-matching in the network; S3.7, the small-world coefficient is an indicator that characterizes whether a network exhibits small-world properties. It is determined by the ratio of the network's clustering coefficient and the length of its characteristic path to that of a random network. A random network is a network in which, given the number of nodes and edges, the probability of any two nodes being connected by an edge is equal. Its calculation formula is: in, and These are the clustering coefficient and feature path length of the brain's functional network, respectively. and These are the clustering coefficients and feature path lengths of a random network, respectively. This demonstrates that networks exhibit small-world characteristics; S3.8, Local Efficiency and Global Efficiency: Global efficiency measures the network's global transmission capacity and is defined as the inverse of the lengths of all shortest paths in a given network. Local efficiency is calculated at the level of a single node, not at the level of the entire network; global efficiency... and local efficiency The calculation formula is: in, It is a node and The shortest path length between them; in, It is a node The set of neighboring nodes, It is a node and The shortest path length between them. It is a node The degree; Five node features—degree, betweenness centrality, eigenvector centrality, clustering coefficient, and local efficiency—were extracted from all nodes in the brain connectivity network. Then, five network features—global efficiency, transitivity, isomatch, small-world property, and feature path length—were extracted from the brain connectivity network. The two sets of features were concatenated along the first dimension to obtain the spatial domain feature matrix. The brain disease identification module detects brain diseases by constructing a highly robust deep learning network model on EEG signals. This model is a multi-dimensional feature fusion network based on an attention mechanism, consisting of a temporal attention module, a frequency domain attention module, a graph theory index attention module, and a fully connected module. Specific details are as follows: A. Temporal Attention Module The temporal feature matrix extracted by the feature extraction module is input into this module, which uses an LSTM network with a self-attention mechanism to further extract the temporal features of the EEG signal. The LSTM network includes a forget gate, an input gate, and an output gate, which are used to control the inflow, outflow, and update of information, respectively; its calculation process is represented by the following formula: in, It is the first The input vector at each time step is... The time-domain feature matrix, It is the first The hidden state vector at each time step It is the first The unit state vector at each time step, , , , It is the first The forget gate, input gate, output gate, and candidate cell state vector at each time step. It is the sigmoid function, and tanh is the hyperbolic tangent function. It is element-wise multiplication. , , They are all learnable parameter matrices or vectors; The LSTM network contains the output of all time steps. and the last time step Hidden state ,in It involves extracting the temporal information of the features and then performing a nonlinear transformation. The previous matrix, It is the last layer of the H matrix, and it is the output matrix of the LSTM network after integrating all the time information; Therefore, a self-attention mechanism is established. and The self-attention vector relationship, that is, establishing the output at each time step. for Weights; output at each time step After linear transformation, these are used as Key and Value, and the output at the final time step. Multiply by matrix As a query; at time step hour, , , ,Score and weight The calculation formulas are as follows: in This represents the query vector, indicating the target element that you want to focus on. express The key vector of a time step represents the candidate elements that can be used to match the query vector; express The value vector of each time step represents the elements that can be used to generate the output; score. This indicates the degree of matching between the query vector and the key vector, calculated using the scaled dot product. for Dimensions The weights are scaling factors to prevent excessively large inner product values ​​from negatively impacting network learning. This represents the contribution of each value vector to the output; the softmax function is used here to normalize the score. n is the number of time steps. in, It does not change over time. , , These are the parameters of the neural network, which change during the backpropagation process, adjusting the weights at each time step. and Weighted summation yields the time-domain eigenvectors with weights. : B. Network Frequency Domain Attention Module This module takes the frequency domain feature matrix extracted by the feature extraction module as input. First, it trains the channel attention network to assign channel attention weights to all channels in the channel dimension, outputting a feature matrix with channel weights of unchanged dimension. Next, it trains the feature matrix with channel weights to perform frequency band attention on the five frequency bands in the frequency band dimension, outputting a feature matrix with both channel and frequency band weights of unchanged dimension. This completes the weight assignment of the original feature vector, enhancing the extraction of high-value features. Finally, the two feature dimensions are expanded into one dimension to obtain the frequency domain feature vector. ; C. Graph Theory Indicators Attention Module This module takes the spatial domain feature matrix extracted by the feature extraction module as input. It trains channel attention weights on all channels and the network's global feature channels, outputting a dimensionless feature matrix with channel weights. Finally, the two feature dimensions are expanded into one dimension to obtain the spatial domain feature output vector. ; D. Fully Connected Module The feature vectors output by the three parallel networks are concatenated using a feature concatenation method to achieve the fusion of features in the time domain, frequency domain, and spatial domain. The formula is defined as follows: in This represents the input vector of the fully connected module in a multi-feature fusion network. The fully connected module's network structure consists of three fully connected layers and one output layer. Each fully connected layer is followed by a ReLU activation function and a dropout layer to prevent overfitting, with the dropout layer parameter set to 0.

5. The output layer uses the Softmax activation function to output the probability of binary classification. This achieves a binary classification task between ADHD patients and a control group.

2. The brain disease detection system based on multi-domain feature fusion and attention mechanisms according to claim 1, characterized in that, The training process of the multi-dimensional feature fusion network based on the attention mechanism in the brain disease identification module is as follows: Step 1: Select EEG signals from 3657 non-ADHD patients and 4622 ADHD patients as the training set; Step 2: Manually label the EEG signals belonging to non-ADHD patients in the training set as 0, and label the EEG signals belonging to ADHD patients in the training set as 1, thus obtaining the labeled training set; Step 3: Input the labeled training set from Step 2 into the feature extraction module. The feature extraction module processes the data to obtain the time-domain feature matrix, frequency-domain feature matrix, and spatial-domain feature matrix. Step four: Input the time-domain feature matrix, frequency-domain feature matrix, and spatial-domain feature matrix into the multi-dimensional feature fusion network based on the attention mechanism for training until the network's loss value tends to converge, at which point training is complete.

3. The brain disease detection system based on multi-domain feature fusion and attention mechanisms according to claim 1, characterized in that, The data acquisition and preprocessing module specifically includes the following: Step 1: Collect resting-state EEG signals from participants for at least 20 minutes; Step 2: Preprocess the acquired EEG signals. The preprocessing steps are as follows: resample the EEG signals to 256Hz, remove the data from electrodes A1 and A2, remove 50Hz power line noise using a notch filter, and perform 0.5-70Hz bandpass filtering using an FIR filter to remove eye movement artifacts. Step 3: Set the preprocessed EEG signals from Step 2 to a fixed time of 60 seconds. The signal was segmented at intervals, with each segment overlapping by 25%, and each segmented EEG signal was treated as an independent sample.

4. The brain disease detection system based on multi-domain feature fusion and attention mechanisms according to claim 1, characterized in that, In step one of the feature extraction module, which extracts time-domain features, each independent sample is used to extract time-window samples using a sliding window method, and then time-domain features are extracted from the time-window samples. In the sliding window segmentation part, a sliding window length of 4s and a sliding step size of 2s are used to extract time window samples.

5. A method based on multi-domain feature fusion and attention machine according to claim 1 The brain disease detection system developed by the manufacturer is characterized by, In the network's frequency domain attention module, the channel attention network first applies the input frequency domain feature moments across all channel dimensions. Perform global average pooling, then pass through a pool of size... Dimensionality reduction is performed using a fully connected layer; after activation via a ReLU function, a size of [missing information] is used. The fully connected layer is used to increase the dimensionality; the Sigmoid function is used for activation, and the calculated weights are summed with the original feature vector to output a weighted vector; finally, a short-path connection is introduced through a residual module to add the input features and output features, thereby learning the residual function between the input and output, effectively preventing overfitting caused by a large number of parameters; We obtain a feature matrix with channel weights whose dimensions remain unchanged; The frequency band attention network performs the same operation on the frequency band channels in the input feature matrix with channel weights as the channel attention network described above, that is, it trains frequency band attention on the five frequency bands in the frequency band dimension, and outputs a feature matrix with channel and frequency band weights with unchanged dimension.

6. The brain disease detection system based on multi-domain feature fusion and attention mechanisms according to claim 5, characterized in that, The graph theory-based attention module performs the same operations on the spatial domain feature matrix as the channel attention network to obtain the spatial domain feature output vector. .

Citation Information

Patent Citations

  • Electroencephalogram signal analysis method based on complex network characteristic index

    CN111227829A

  • Brainwave-based attention deficit hyperactivity disorder diagnostic system

    WO2018004028A1