Multiscale seizure-cross-subject detection method based on power spectral density

By developing a seizure detection method based on power spectral density and multi-scale spatiotemporal depth convolutional networks, we have solved the problems of traditional detection methods being time-consuming and susceptible to subjective factors, and achieved efficient and accurate seizure detection with adaptation to individual differences.

CN120296490BActive Publication Date: 2025-12-26ZHENGZHOU UNIVERSITY OF LIGHT INDUSTRY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510342363.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-21
Publication Date
2025-12-26
Estimated Expiration
2045-03-21

AI Technical Summary

Technical Problem

Traditional epilepsy seizure detection relies on manual analysis of EEG signals, which is time-consuming and easily affected by subjective factors, making it difficult to detect in a timely and accurate manner. The large physiological differences between individuals also pose challenges to the application of automated detection technology in patients with unknown conditions.

Method used

A multi-scale epileptic seizure detection method based on power spectral density is adopted. Adaptive multi-band power spectral density and multi-scale spatiotemporal deep convolutional network are used to extract spatiotemporal features at different scales, and epilepsy detection is performed through the MSSTDCN model.

Benefits of technology

It improves the accuracy and efficiency of epilepsy detection, reduces the time cost for medical staff, enhances the generalization ability of the model, makes it applicable to different patients, and reduces computational costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120296490B_ABST
    Figure CN120296490B_ABST
Patent Text Reader

Abstract

The application discloses a multi-scale seizure cross-subject detection method based on power spectral density, and steps are as follows: acquiring multi-channel electroencephalogram data of a patient with epilepsy and performing pretreatment; performing regularization processing on the pretreated electroencephalogram data; self-adaptive power spectral density construction; balancing the electroencephalogram data using an SMOTE oversampling method according to power spectral density characteristics to form a balanced data set; multi-scale spatiotemporal deep convolution network model building and training; and dividing data in the balanced data set into a training set and a verification set, and inputting the training data and the verification data into the multi-scale spatiotemporal deep convolution network model for training. The application can reduce dependence on a large amount of labeled data, reduce complexity and calculation cost of a model, and improve applicability of the model among different patients.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of biomedical signal processing and artificial intelligence, and particularly relates to a multi-scale seizure cross-subject detection method based on power spectral density. BACKGROUND

[0002] Epilepsy is a temporary brain dysfunction caused by sudden abnormal discharge of neurons in the brain. Patients may experience temporary symptoms such as loss of consciousness or perception, motor dysfunction, etc. Currently, there are about 50 million epilepsy patients worldwide, regardless of age. The onset of epilepsy is sudden and recurrent, causing great physical and mental distress to patients and their families. Therefore, accurate detection of seizures is crucial for the diagnosis, treatment and management of patients.

[0003] Traditional seizure detection mainly relies on neurologists' manual analysis of electroencephalogram (EEG) signals. Electroencephalogram can capture the complex dynamic electrical activity of the brain, identify the type of epilepsy, assist in diagnosing epilepsy syndrome, and assess the risk of recurrence of epilepsy. However, this method is time-consuming and easily affected by subjective factors, making it difficult to detect seizures in a timely and accurate manner. Therefore, it is particularly important to automatically process electroencephalogram signals for seizure detection.

[0004] In recent years, with the development of deep learning technology, more and more research attempts to use artificial intelligence for seizure prediction, mainly by analyzing electroencephalogram (EEG) signals to discover potential abnormal patterns. However, due to the huge physiological differences between individuals, electroencephalogram signals have highly personalized characteristics in time domain, frequency domain and spatial domain, and are easily affected by noise, which poses challenges to the application of automatic seizure detection technology in unknown patients. SUMMARY

[0005] To solve the above problems, the purpose of the present application is to provide a multi-scale seizure cross-subject detection method based on power spectral density, which significantly improves the accuracy of seizure detection by using adaptive multi-band power spectral density; through a multi-scale spatio-temporal deep convolutional network, different scale spatio-temporal features are extracted, thereby improving the flexibility of seizure detection; reducing the time cost of medical staff, and greatly protecting the safety of patients.

[0006] To achieve the above-mentioned purpose of the application, the technical scheme adopted by the present application is as follows:

[0007] A multi-scale seizure cross-subject detection method based on power spectral density, comprising the following steps:

[0008] S1, acquiring multi-channel electroencephalogram signal data of epilepsy patients and performing preprocessing;

[0009] S2, normalizing the electroencephalogram signal data preprocessed in step S1;

[0010] S3, adaptive power spectral density construction, i.e. reconstructing power spectral density characteristics;

[0011] S4, balancing the electroencephalogram signal data using the SMOTE oversampling method according to the power spectral density characteristics obtained in step S3, to form a balanced data set;

[0012] S5, MSSTDCN model building and training

[0013] The MSSTDCN model is a multi-scale spatio-temporal deep convolutional network model, which is composed of a time feature extraction network, a spatial feature extraction network, a first multi-branch attention layer, a second multi-branch attention layer, a feature adaptive fusion module, a deep convolutional network, and a multi-layer fully connected layer. The balanced adaptive PSD features obtained in step S4 are first input into the parallel double-branch module composed of the time feature extraction network and the spatial feature extraction network for time and spatial feature extraction, respectively. The extracted time features are fused according to the corresponding frequency bands and input into the first multi-branch attention layer, and the spatial features are fused according to the corresponding frequency bands and input into the second multi-branch attention layer. The first multi-branch attention layer and the second multi-branch attention layer respectively perform feature mapping on the corresponding input features to obtain corresponding refined features. The feature adaptive fusion module fuses the output results of the first multi-branch attention layer and the second multi-branch attention layer to obtain fused features, which are input into the deep convolutional network. The deep convolutional network extracts high-dimensional features. All features are flattened and classified through the multi-layer fully connected layer to obtain the epilepsy detection results.

[0014] S6, dividing the data obtained in step S4 into a training set and a validation set, i.e. combining and shuffling X-1 object reconstructed PSD data as the training set, and shuffling 1 object reconstructed PSD data as the validation set, X representing the total number of objects; input the training data and validation data into the MSSTDCN model in step S5 for training.

[0015] Further, the step S1 is operated as follows: first, the multi-channel electroencephalogram signal data of the epilepsy patient is collected at a set sampling rate, and the electroencephalogram signal data is filtered by a 0.5-50Hz band-pass filter; then, the electroencephalogram signal data is divided into multiple segments of a set time, and the long-period signal is divided into multiple small windows.

[0016] Further, in step S2, the electroencephalogram signal data is processed by the Z-score normalization method, which is operated as follows:

[0017]

[0018] Wherein, X(t) represents the original signal; μ and σ respectively represent the mean and standard deviation of the original signal X(t); X'(t) represents the normalized signal.

[0019] Further, the step S3 described above comprises the following sub-steps:

[0020] S3.1, the electroencephalogram signal processed in step S2 is subjected to frequency division processing, and is divided into σ frequency band with frequency of 0.5-4 Hz, θ frequency band with frequency of 4-8 Hz, α frequency band with frequency of 8-13 Hz, β frequency band with frequency of 13-30 Hz, and γ frequency band with frequency of 30-50 Hz;

[0021] S3.2, the PSD value of the corresponding frequency band is calculated by using the Multitaper method, and the PSD values of the σ frequency band, the θ frequency band, the α frequency band, the β frequency band and the γ frequency band are obtained respectively;

[0022] S3.3, the obtained PSD values are averaged in the channel dimension;

[0023] S3.4, the physiological characteristics of the five frequency bands are spliced in order to obtain the adaptive PSD characteristics.

[0024] Further, in the step S3 described above, the PSD value of the corresponding frequency band is calculated by using the Multitaper method, and the steps are as follows:

[0025] S3.11, selecting an orthogonal window

[0026] Selecting a group of K mutually orthogonal data windows Wherein, n=0, 1,..., M-1, N represents the length of the time sequence;

[0027] S3.12, single PSD estimation value

[0028] For each taper, multiply the original time sequence by the taper to obtain a new time sequence, then perform Fourier transform on the new time sequence to obtain the corresponding PSD estimation value; assuming that there is a time sequence x(n), using the kth taper V k (n) is:

[0029]

[0030] Wherein, f represents frequency; j represents imaginary unit; e -i2πfn represents complex exponential function;

[0031] S3.13, averaging processing

[0032] The PSD estimation values generated by all K tapers are added to obtain the average PSD:

[0033]

[0034] Further, in step S5 above, the spatial feature extraction network in the MSSTDCN model consists of five wavelet convolutional layers. First, features of the σ-band, θ-band, α-band, β-band, and γ-band are extracted through the five wavelet convolutional layers respectively. Second, the features of each band are concatenated. Finally, the fused features are input into the second multi-branch attention layer, and the features F extracted by the spatial convolutional network are obtained through the second multi-branch attention layer. s Specifically, for a given input EEG representation x at time sample t, the first wavelet convolutional layer performs a discrete wavelet transform, defined as:

[0035]

[0036] Where u(r) and v(r) represent the approximation filter and the detail filter, respectively; x A (t) and x D (t) represents the approximation coefficient and detail coefficient, respectively; r represents the filter index, r = 0, 1, 2, ..., R; s represents the scaling factor; k represents the wavelet convolution layer number;

[0037] Approximation coefficient x A (t) is fed back layer by layer to the next wavelet convolutional layer, and spectral analysis is performed iteratively through five wavelet convolutional layers.

[0038] Furthermore, in step S5 above, the MSSTDCN model's temporal feature extraction network consists of multiple standard two-dimensional convolutional layers with different kernel sizes, which extract temporal features at different scales from the signal. The fused features are then input into a first multi-branch attention layer, which processes the features F extracted by the temporal convolutional network. t .

[0039] Furthermore, in step S5 above, each multi-branch attention layer in the MSSTDCN model includes three attention branches, targeting the input tensor X. in ∈R C×H×W Where C represents the number of channels, i.e., the number of input feature maps, and H and W represent the height and width of the input feature maps, respectively; the operation is as follows:

[0040] S5.1, The multi-branch attention layer's response to the input temporal spectral features X in ∈R C×H×W Perform group convolution;

[0041] S5.2, the feature maps are respectively passed into three attention branches, the first attention branch is used to capture the interaction between (H, W) dimensions and transform the output tensor at the end into the original input shape, the second attention branch is used to permute the input tensor into the second input tensor X HW ∈R C×H×W is executed; the second attention branch is used to permute the input tensor into the second input tensor X CW ∈R H×C×W , capture the interaction between (C, W) dimensions, and transform the output tensor at the end into the original input shape; the third attention branch is used to permute the input tensor into the third input tensor X HC ∈R W×H×C , capture the interaction between (H, C) dimensions, and transform the output tensor at the end into the original input shape;

[0042] S5.3, the outputs of the three attention branches are aggregated by average pooling to generate refined features.

[0043] Further, the operation performed by the first attention branch described above includes the following steps:

[0044] S5.21, channel max pooling and average pooling are applied to reduce the channel dimension, and the pooled features are concatenated to define as follows:

[0045]

[0046] wherein X pool ∈R 2×H×W represents the pooled features; Max Pool(·) and AvgPool(·) represent the channel-wise max pooling and average pooling, respectively; is the channel-wise concatenation; X HW represents the first input tensor;

[0047] S5.22, the pooled features X pool are fed into a standard convolution with a sigmoid activation layer, which provides intermediate attention weights X w ∈R 1×H×W ;

[0048] S5.23, the generated attention weights X w ∈R 1×H×W are applied to the first input tensor X HW by element-wise multiplication.

[0049] Further, in the MSSTDCN model, the refined features X in ∈R C×H×W are obtained from the input tensor X ref , and the operation of each multi-branch attention layer is represented as:

[0050]

[0051] where the first input tensor X HW is equal to the input tensor X in ; the second input tensor X CW and the third input tensor X HC represent the permutation results from the input tensor X in , respectively; represents the attention weight generated from the i-th attention branch; is the broadcast element multiplication; represents the permutation operation.

[0052] Further, the step S5, in the MSSTDCN model, the feature adaptive fusion module fuses the feature F t extracted by the time convolution network of the first multi-branch attention layer and the feature F s extracted by the spatial convolution network of the second multi-branch attention layer; specifically, for the feature F t extracted by the time convolution network, the adaptive time feature Z t is expressed by the formula:

[0053] Z t = λF t + (1-λ)∈

[0054] where ∈ represents random noise; λ represents the proportion of control signal and noise;

[0055] For the feature F s extracted by the spatial convolution network, the adaptive spatial feature Z s is expressed by the formula:

[0056] Z s = λF s + (1-λ)∈

[0057] The obtained adaptive features are fused, wherein the feature fusion strategy is expressed by:

[0058] F fusion = w t Z t + w s Z s

[0059] where w t , w s represent the weight of the time feature and the weight of the spatial feature, respectively; both of which are dynamically adjusted according to the model classification loss.

[0060] Further, in the step S5, the deep convolutional network in the MSSTDCN model comprises a plurality of deep convolutional modules, each of which is composed of a convolutional layer, a batch normalization layer and a max-pooling layer connected in sequence, and is used for extracting the fusion features output by the feature adaptive fusion module.

[0061] Due to the technical solutions described above, the present application has the following advantages:

[0062] The multi-scale seizure cross-subject detection method based on power spectral density of the present application adopts power spectral density (PSD) to capture non-stationary EEG brain electrical signals with time-varying statistical characteristics, and then uses a deep convolutional network to process the non-stationary time series data, which can not only improve the accuracy and efficiency of seizure detection, but also to a certain extent, solve the problem of individual differences, making the model more generalizable. The MSSTDCN model extracts the time and spatial features in the EEG signal through a double-branch network, which makes up for the problem of information loss caused by single features. The MSSTDCN model can solve the problem of low performance in cross-subject seizure detection, improve the performance of the model in seizure detection by reconstructing the PSD features of different frequency bands, reduce the dependence on a large amount of labeled data, reduce the complexity and computational cost of the model, and improve the applicability of the model to different patients, providing a new and effective technical path for the automation of seizure detection. BRIEF DESCRIPTION OF DRAWINGS

[0063] Figure 1 is a flowchart of the multi-scale seizure cross-subject detection method based on power spectral density of the present application;

[0064] Figure 2 is Figure 1 a flowchart of the adaptive power spectral density construction step in

[0065] Figure 3 is a structural schematic diagram of an embodiment of the MSSTDCN model. DETAILED DESCRIPTION

[0066] The technical solutions of the present application will be further described in detail below in combination with the drawings and specific embodiments, so that those skilled in the art can fully understand and implement the present application.

[0067] The multi-channel EEG signals of the epilepsy patients in the embodiment contain 940h long-term continuous multi-channel scalp EEG records from 23 epilepsy subjects aged 1.5-22 years old; according to the international 10 / 20 standard, the EEG signals are sampled at a frequency of 256HZ, including at least 19 EEG channels. The above records include 198 seizures, in which the onset and end are accurately annotated by clinicians with neuroscientific knowledge.

[0068] As Figure 1 、 2 , 3 shows a multi-scale seizure cross-subject detection method based on power spectral density, which comprises the following steps:

[0069] S1, acquiring multi-channel electroencephalogram data of epilepsy patients and preprocessing;

[0070] First, the multi-channel electroencephalogram signals of the epilepsy patients are collected at a set sampling rate, and a 0.5-50Hz band-pass filter is used to filter the electroencephalogram signals to remove low-frequency and high-frequency noise and electrocardiogram signals, and retain the effective information related to seizures; Then, the electroencephalogram signals are divided into multiple segments according to a 4s time window, and the long period signal is divided into multiple small windows, which is convenient for feature extraction;

[0071] S2, the electroencephalogram signals after step S1 preprocessing are subjected to regularization processing to ensure the consistency of the signals, so as to reduce the differences between individuals and help the deep learning model converge more efficiently; The Z-score normalization method is used to process the electroencephalogram signals, which can effectively deal with abnormal fluctuations in the data and provide stable and reliable signal representation; The operation is:

[0072]

[0073] Wherein, X(t) represents the original signal; μ and σ represent the mean and standard deviation of the original signal X(t) respectively; X'(t) represents the normalized signal;

[0074] S3, adaptive power spectral density construction, that is, reconstructing the power spectral density feature; The operation is:

[0075] S3.1, the electroencephalogram signals after step S2 processing are subjected to frequency division processing, which is divided into σ frequency band with frequency of 0.5-4Hz, θ frequency band with frequency of 4-8Hz, α frequency band with frequency of 8-13Hz, β frequency band with frequency of 13-30Hz, and γ frequency band with frequency of 30-50Hz;

[0076] S3.2, the Multitaper method is used to calculate the PSD value of the corresponding frequency band, and the PSD values of σ frequency band, θ frequency band, α frequency band, β frequency band and γ frequency band are obtained respectively; The steps are as follows:

[0077] S3.11, selecting orthogonal windows

[0078] Select a group of K mutually orthogonal data windows Wherein, n=0,1,...,N-1, N represents the length of time series;

[0079] S3.12, single PSD estimation value

[0080] For each taper, multiply the original time series by this taper to obtain a new time series, then perform Fourier transform on the new time series to obtain the corresponding PSD estimate; assuming there is a time series x(n), using the kth taper V k The PSD estimate of V

[0081]

[0082] Where f represents frequency; j represents imaginary unit; e -j2πfn represents the complex exponential function, used to convert the time domain signal to the frequency domain;

[0083] S3.13, averaging processing

[0084] Add the PSD estimates generated by all K tapers to obtain the average PSD:

[0085]

[0086] S3.3, average the obtained PSD values in the channel dimension;

[0087] S3.4, splice the obtained physiological features of the 5 frequency bands in order to obtain adaptive PSD features;

[0088] S4, balance the power spectrum density features obtained in step S3 using the SMOTE (Synthetic Minority Over-sampling Technique) oversampling method to form a balanced data set, which can enhance the training of seizure data and alleviate the class imbalance problem; the operation is:

[0089] SMOTE selects a minority class sample, calculates its M nearest neighbors, and then randomly selects a neighbor B to generate a synthetic sample for the minority class; specifically, first select a sample A from the minority class, then generate a new synthetic sample C using the following formula:

[0090] C = A + r x (B-A)

[0091] Where r is a random number between 0 and 1, representing the position along the AB direction; repeat this process until the desired class balance ratio is reached;

[0092] S5, MSSTDCN model building and training

[0093] The MSSTDCN model is a multi-scale space-time deep convolutional network model, which is composed of a time feature extraction network, a space feature extraction network, a first multi-branch attention layer, a second multi-branch attention layer, a feature self-adaptive fusion module, a deep convolutional network, and a multi-layer fully connected layer; and the operation is as follows:

[0094] S5-1, the balanced adaptive PSD features obtained in step S4 are respectively subjected to time and space feature extraction by a parallel double-branch module composed of a time feature extraction network and a space feature extraction network, specifically, the space feature extraction network is composed of five wavelet convolution layers, first, σ band, θ band, α band, β band, and γ band features are respectively extracted by the five wavelet convolution layers; second, the features of each band are connected; the fused features are input into the second multi-branch attention layer; specifically, for a given input EEG representation x at time sample t, the first wavelet convolution layer performs discrete wavelet transform, defined as:

[0095]

[0096]

[0097] wherein u(r) and v(r) represent an approximation filter and a detail filter respectively; x A (t) and x D (t) represent approximation coefficients and detail coefficients respectively; r represents the index of the filter r=0, 1, 2, …, R, preferably, R=5 is set; s represents a scaling factor for controlling the scale of wavelet transform, preferably, 0.6 is set; k represents the serial number of the wavelet convolution layer;

[0098] The approximation coefficients x A (t) are fed back to the next wavelet convolution layer layer by layer, and the continuous spectrum analysis is iteratively performed through the five wavelet convolution layers;

[0099] The time convolution network is composed of a plurality of standard two-dimensional convolution layers with different sizes of convolution kernels, preferably, the size of the specific convolution kernel is set to 1, 3, 5, 7, and 9, and the step size is set to 2, different scale time features in the signal are extracted, and finally the fused features are input into the first multi-branch attention layer;

[0100] S5-2, each multi-branch attention layer in the first multi-branch attention layer and the second multi-branch attention layer includes three attention branches, which can effectively model the channel attention and spatial attention at low cost, and does not involve dimension reduction, and the operation is as follows: in ∈R C×H×W wherein C represents the channel, that is, the number of input feature maps, H and W represent the height and width of the input feature map respectively; and the operation is as follows:

[0101] S5.1, considering the heterogeneity between multi-domain feature maps, the multi-branch attention layer is applied to the input time-spectrum feature X in ∈R C×H×W Group convolution is performed with a parameter group of 2, which can reduce the computational cost and eliminate the aliasing effect.

[0102] S5.2, the feature maps are respectively transmitted to three attention branches, the first attention branch is used to capture the interaction between (H, W) dimensions and perform on X HW ∈R C×H×W ; the second attention branch is used to permute the input tensor into a second input tensor X CW ∈R H×C×W , capture the interaction between (C, W) dimensions, and transform the output tensor at the end into the original input shape; the third attention branch is used to permute the input tensor into a third input tensor X HC ∈R W×H×C , capture the interaction between (H, C) dimensions, and transform the output tensor at the end into the original input shape.

[0103] The first attention branch performs the following steps:

[0104] (1) Apply channel max pooling and average pooling to reduce the channel dimension, then concatenate the pooled features, which can reduce the feature map and further lighten the calculation, defined as follows:

[0105]

[0106] where X pool ∈R 2×H×W represents the pooled feature; Max Pool(·) and AvgPool(·) represent the maximum pooling and average pooling by channel respectively; is the concatenation by channel; X HW represents the first input tensor;

[0107] (2) The pooled feature X pool is fed into a standard convolution with a sigmoid activation layer, which provides the intermediate attention weight X w ∈R 1×H×W ;

[0108] (3) The generated attention weight X w ∈R 1×H×W is applied to the first input tensor X HW by element-wise multiplication.

[0109] The second attention branch performs similar operations as the first attention branch, with the difference that a permutation operation is added to permute the input tensor into the second input tensor X CW ∈R H×C×W with the purpose of capturing the dependencies between the (C, W) dimensions, and another permutation operation at the end of the second attention branch transforms the output tensor into the original input shape;

[0110] The third attention branch is built in the same way, with a first permutation operation on the third input tensor X HC ∈R W×H×C to build dependencies between the (H, C) dimensions, and another permutation operation at the end of the third attention branch transforms the output tensor into the original input shape;

[0111] S5.3, aggregate the outputs of the three branches by average pooling to generate refined features;

[0112] From the input tensor X in ∈R C×H×W obtain refined features X ref The operations of each multi-branch attention layer are represented as:

[0113]

[0114] where the first input tensor X HW is equal to the input tensor X in ; the second input tensor X CW and the third input tensor X HC represent the permutation results from the input tensor X in represents the attention weights generated from the i-th attention branch; ⊙ is the broadcast element multiplication; — represents the permutation operation;

[0115] S5-3, the feature adaptive fusion module fuses the features F t extracted by the temporal convolution network from the output of the first multi-branch attention layer, s extracted by the spatial convolution network from the output of the second multi-branch attention layer; Specifically, for the features F t extracted by the temporal convolution network, the adaptive temporal feature Z t is represented by the formula:

[0116] Z t = λF t +(1-λ)∈

[0117] where ∈ represents random noise; λ represents the proportion of control signal to noise;

[0118] For the features Z s ​, adaptive spatial feature Z s The formula is expressed as:

[0119] Z s = lambda F s + (1 - lambda) epsilon

[0120] The obtained adaptive features are fused, wherein the feature fusion strategy is expressed as:

[0121] F fusion = w t Z t + w s Z s

[0122] Wherein, w t , w s respectively represent the weight of the time feature and the weight of the spatial feature; both are dynamically adjusted according to the model classification loss.

[0123] By constructing adaptive features, it is beneficial to confirm the most important features for the final classification decision, thereby improving the transparency of the model.

[0124] S5-4, the deep convolutional network comprises a plurality of deep convolutional modules, each deep convolutional module is composed of a convolutional layer, a batch normalization layer and a maximum pooling layer connected in sequence, preferably, the specific kernel size is set to 3, used for extracting the fusion features output by the feature adaptive fusion module; in Figure 3 , the deep convolutional network takes four deep convolutional modules as an example for illustration;

[0125] S5-5, all features are flattened, and two fully connected layers are used to complete the final classification of the attack period and the attack interval.

[0126] S6, the data obtained in step S4 is divided into a training set and a validation set, i.e., the X-1 object reconstructed PSD data combination is shuffled as the training set, and the 1 object reconstructed PSD data is shuffled as the validation set, X represents the total number of objects; the training data and the validation data are input into the MSSTDCN model for training of related tasks.

[0127] The protection scope of the present application is not limited to the above specific embodiments. Any form of change based on the core principle of the present application, including but not limited to equivalent replacement of technical solutions, structural improvement, etc., should be considered as falling within the protection scope of the claims of the present application. Various modifications and adjustments made by those skilled in the art without departing from the design idea of the present application also fall within the protection scope of the present application.

Claims

1. A power spectral density based multi-scale seizure-cross-subject detection method characterized by: It comprises the following steps: S1, acquiring multi-channel electroencephalogram data of epilepsy patients and preprocessing; S2, regularizing the electroencephalogram data after preprocessing in step S1; S3, adaptive power spectral density construction, i.e. reconstructing power spectral density features; S4, balancing the electroencephalogram data using the SMOTE oversampling method according to the power spectral density features obtained in step S3 to form a balanced data set; S5, MSSTDCN model building and training The MSSTDCN model is a multi-scale space-time deep convolutional network model, which is composed of a time feature extraction network, a space feature extraction network, a first multi-branch attention layer, a second multi-branch attention layer, a feature adaptive fusion module, a deep convolutional network, and a multi-layer fully connected layer. The balanced adaptive PSD features obtained in step S4 are first input into the parallel double-branch module composed of the time feature extraction network and the space feature extraction network for time and space feature extraction. The extracted time features are fused according to the corresponding frequency bands and input into the first multi-branch attention layer, and the space features are fused according to the corresponding frequency bands and input into the second multi-branch attention layer. The first multi-branch attention layer and the second multi-branch attention layer respectively perform feature mapping on the corresponding input features to obtain corresponding refined features. The feature adaptive fusion module fuses the output results of the first multi-branch attention layer and the second multi-branch attention layer to obtain fused features, which are input into the deep convolutional network. The deep convolutional network extracts high-dimensional features. All features are flattened and classified through a multi-layer fully connected layer to obtain epilepsy detection results. S6, divide the data obtained in step S4 into a training set and a validation set, i.e. combine X-1 object reconstructed PSD data and shuffle as a training set, and 1 object reconstructed PSD data and shuffle as a validation set, X represents the total number of objects; input the training data and validation data into the MSSTDCN model in step S5 for training.

2. The power spectral density based multi-scale seizure cross-subject detection method of claim 1, wherein: The step S3 comprises the following sub-steps: S3.1, frequency division processing of the electroencephalogram signal processed in step S2, which is divided into σ frequency band with frequency of 0.5-4Hz, θ frequency band with frequency of 4-8Hz, α frequency band with frequency of 8-13Hz, β frequency band with frequency of 13-30Hz, and γ frequency band with frequency of 30-50Hz; S3.2, calculate the PSD values of the corresponding frequency bands using the Multitaper method to obtain the PSD values of the σ frequency band, the θ frequency band, the α frequency band, the β frequency band, and the γ frequency band; S3.3, average the obtained PSD values in the channel dimension; S3.4, splice the physiological features of the five frequency bands in order to obtain adaptive PSD features.

3. The power spectral density based multi-scale seizure cross-subject detection method of claim 2, wherein: In step S3, the Multitaper method is used to calculate the PSD values of the corresponding frequency bands, and the steps are as follows: S3.11, select an orthogonal window selecting a set of K mutually orthogonal data windows where n = 0, 1,..., N - 1, N denotes the length of the time series; S3.12, single PSD estimation value For each taper, multiply the original time series by this taper to get a new time series, then perform Fourier transform on the new time series to get the corresponding PSD estimate; suppose there is a time series x(n), using the kth taper V k (n) the PSD estimate is: where f represents frequency; j represents the imaginary unit; e -j2πfn represents the complex exponential function; S3.13, average processing Add all K taper generated PSD estimation values to obtain the average PSD:

4. The power spectral density based multi-scale seizure cross-subject detection method of claim 1, wherein: In the step S5, the spatial feature extraction network in the MSSTDCN model is composed of five wavelet convolution layers. Firstly, the σ band, θ band, α band, β band and γ band features are extracted through the five wavelet convolution layers respectively. Secondly, the features of each band are connected. Finally, the fused features are input into the second multi-branch attention layer, and the features F extracted by the spatial convolution network are obtained through the second multi-branch attention layer s ; specifically, for a given input EEG representation x at a time sample t, the first wavelet convolution layer performs a discrete wavelet transform, defined as: where u(r) and v(r) represent the approximation filter and the detail filter, respectively; x A (t) and x D (t) represent the approximation coefficient and the detail coefficient, respectively; r represents the index of the filter, r = 0, 1, 2,..., R; s represents the scaling factor; k represents the serial number of the wavelet convolution layer; Approximation coefficients x A (t) is fed back layer by layer to the next wavelet convolution layer, and the continuous passing through five wavelet convolution layers iteratively performs spectral analysis.

5. The power spectral density based multi-scale seizure cross-subject detection method of claim 4, wherein: In the step S5, the time feature extraction network in the MSSTDCN model is composed of multiple standard two-dimensional convolution layers with different size convolution kernels, which respectively extract different scale time features in the signal, and the fused features are input into the first multi-branch attention layer, and the features F extracted by the time convolution network are obtained through the first multi-branch attention layer t .

6. The power spectral density based multi-scale seizure cross-subject detection method of claim 4 or 5, characterized in that: In the step S5, each multi-branch attention layer in the MSSTDCN model includes three attention branches, and the input tensor X in ∈R C×H×W wherein C represents a channel, i.e., a number of input feature maps, H and W represent a height and a width of the input feature map, respectively; and the operation is: S5.1, the multi-branch attention layer is applied to the input time spectrum feature X in ∈R C×H×W group convolution is performed; S5.2, the feature maps are passed into three attention branches respectively, the first attention branch is used to capture the interaction between (H, W) dimensions and transform the output tensor at the end into the original input shape; the second attention branch is used to permute the input tensor into the second input tensor X HW ∈R C×H×W is executed; the second attention branch is used to permute the input tensor into the second input tensor X CW ∈R H×C×W , capture the interaction between (C, W) dimensions, and transform the output tensor at the end into the original input shape; the third attention branch is used to permute the input tensor into the third input tensor X HC ∈R W×H×C , capture the interaction between (H, C) dimensions, and transform the output tensor at the end into the original input shape; S5.3, generating refined features by aggregating the outputs of the three attention branches through average pooling.

7. The power spectral density based multi-scale seizure cross-subject detection method of claim 6, characterized in that: The operations performed by the first attention branch include the following steps: S5.21, applying channel max-pooling and average-pooling to reduce the channel dimension, and then connecting the pooled features, defined as follows: wherein X pool ∈ R 2×G×W denotes the pooling feature; Max Pool(·) and Avg Pool(·) denote the max pooling and average pooling by channel, respectively; is the concatenation by channel; X HW denotes the first input tensor; S5.22, pooled features X pool fed into a standard convolution with a sigmoid activation layer, which provides intermediate attention weights X w ∈ R 1×H×W ; S5.23, multiply the generated attention weights X by element-wise multiplication w ∈R 1×H×W apply to the first input tensor X HW .

8. The power spectral density based multi-scale seizure cross-subject detection method of claim 6, wherein: The step S5, in the MSSTDCN model, from the input tensor X in ∈R C×H×W Obtain the refined feature X ref The operation of each multi-branch attention layer is represented as: where the first input tensor X HW is equal to the input tensor X in ; the second input tensor X CW and the third input tensor X HC respectively represent the permutation results from the input tensor X in ; represents the attention weight generated from the i-th attention branch; is the broadcast element multiplication; — represents the permutation operation.

9. The power spectral density based multi-scale seizure cross-subject detection method of claim 1 or 2, characterized in that: In the step S5, the feature adaptive fusion module in the MSSTDCN model fuses the feature F t extracted by the spatial convolution network of the second multi-branch attention layer s . Specifically, for the feature F t extracted by the time convolution network, the adaptive time feature Z t is obtained, and the formula is as follows: Z t = λF t + (1 - λ)∈ Wherein, ∈ represents random noise; λ represents the proportion of control signal and noise; For the feature F extracted by the spatial convolution network s , the adaptive spatial feature Z s The formula is expressed as: Z s = λF s + (1 - λ)∈ The obtained adaptive features are fused, and the feature fusion strategy is represented as: F fusion = w t Z t + w s Z s wherein w t , w s respectively represent the weight of the time feature and the weight of the space feature; both are dynamically adjusted according to the model classification loss.

10. The power spectral density based multi-scale seizure cross-subject detection method of claim 9, characterized in that: The deep convolutional network in the MSSTDCN model includes a plurality of deep convolutional modules, each of which is composed of a convolutional layer, a batch normalization layer, and a max-pooling layer connected in sequence, and is used to extract the fused features output by the feature adaptive fusion module.