Epileptic seizure prediction model construction system based on lightweight Transform

By introducing self-selected modules and lightweight decision networks into the epilepsy prediction model, the model structure is dynamically adjusted, and the problem of excessive computing complexity and memory requirements of existing models on resource-limited devices is solved, achieving efficient and accurate epilepsy prediction.

CN119517406APending Publication Date: 2025-02-25CHONGQING UNIV OF POSTS & TELECOMM
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411644083.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

Existing epilepsy prediction models are difficult to achieve lightweight operation on wearable devices with limited resources, resulting in excessive computational complexity and memory requirements, affecting the real-time and accuracy of predictions.

Method used

A seizure prediction model based on lightweight Transformer was designed. By introducing self-selected modules and lightweight decision networks, the model structure is dynamically adjusted, the calculation amount is reduced, while maintaining or improving prediction accuracy.

Benefits of technology

A model that adapts to different epileptic seizure prediction scenarios without significantly increasing the computational complexity is realized, which enhances the recognition of epileptic seizure precursors and maintains high prediction capabilities under lower parameters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119517406A_ABST
    Figure CN119517406A_ABST
Patent Text Reader

Abstract

The invention relates to an epileptic seizure prediction model construction system based on a lightweight Transform, and belongs to the technical field of medical systems. The epileptic seizure prediction model construction system is characterized in that EEG (electroencephalogram) signals are preprocessed, STFT (short-time Fourier transform) is utilized to extract time-frequency features, and the features are input into a lightweight Transform network. According to the network, important patches and attention heads are automatically screened through the self-selection module, so that the calculation complexity is reduced, and the prediction accuracy and the model efficiency are improved. The system is suitable for real-time epileptic seizure prediction of a wearable device, especially for a resource-limited environment, relatively high prediction accuracy and sensitivity are ensured, and meanwhile, the calculation amount and the energy consumption are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of medical systems and relates to an epileptic seizure prediction model construction system based on a lightweight Transformer. Background Art

[0002] Epileptic seizures are characterized by recurrent episodes of abnormal overactivity of networks of neurons in the brain. Seizures are characterized by sudden bursts of electrical activity that can cause disturbances in perception and loss of awareness of the surrounding environment. During a seizure, patients may lose control of their body movements and consciousness, putting them in potentially dangerous situations and increasing the likelihood of accidents and injuries.

[0003] Electroencephalogram (EEG) signals are commonly used by experts to diagnose neurological diseases. Scalp EEG is a non-invasive measurement of the potential generated by neuronal activity in the brain, collected by electrodes on the scalp. For doctors, long-term visual inspection of EEG is very time-consuming and laborious, and it is difficult to identify the characteristic patterns of epileptic seizures from multiple channels. Since patients lose consciousness during epileptic seizures, this can put patients in a catastrophic situation, so continuous monitoring of EEG signals in epilepsy patients is crucial. Once epilepsy patients leave the hospital and have an epileptic seizure, they will receive unsecured medical care in an environment without any emergency assistance. Therefore, for epilepsy patients, ultra-low power wearable devices that automatically detect epileptic seizures in non-hospital environments are very popular, and highly accurate lightweight detection algorithms are essential.

[0004] Epileptic seizures are marked by spikes and waves in EEG signals, and are detected using machine learning (ML) and deep learning (DL) algorithms through time domain, spectrum, and dynamic analysis. Traditional ML methods use trial and error to select features. DL can effectively learn features from raw EEG data, which are more unique and powerful than those extracted manually, and significantly outperform traditional machine learning methods. Therefore, it is necessary to use deep learning to learn features from EEG data to avoid misjudgments during manual extraction.

[0005] Vision Transformer (ViT) is a deep learning model based on the Transformer architecture, known for its high complexity. For wearable devices used for epileptic seizure prediction, the ViT model must be optimized in terms of lightweight and computational efficiency. In epileptic seizure prediction, ViT can comprehensively analyze brain images to gain a detailed understanding of the location and shape of epileptic foci, thereby improving prediction accuracy. However, brain images from different patients can vary greatly, and the adaptability of ViT makes it well suited to handle different data distributions, thereby improving the accuracy of cross-individual predictions. Despite its many advantages, ViT's high computational requirements and large memory requirements pose challenges to mobile and wearable devices, which have limited energy and computing resources. To achieve continuous and effective epileptic seizure prediction by monitoring EEG signals in real time, it is necessary to optimize the ViT model so that it can run lightweight on resource-limited devices. This ensures efficient execution of EEG classification tasks without compromising prediction capabilities. Summary of the invention

[0006] In view of this, the object of the present invention is to provide an epileptic seizure prediction model construction system based on a lightweight Transformer.

[0007] In order to achieve the above object, the present invention provides the following technical solutions:

[0008] A system for building an epileptic seizure prediction model based on a lightweight Transformer, comprising:

[0009] Data processing module: used to obtain epilepsy EEG data sets, pre-process the data sets, and classify them into three categories: epileptic interictal period, pre-epileptic seizure period, and epileptic seizure period; extract a part of the data from each of the three categories to construct training sets, test sets, and validation sets;

[0010] Epileptic seizure prediction model: Based on the Transformer network, it includes a convolution layer, a Seizure-MViT module, and a global pooling layer; the convolution layer includes a 3×3 downsampling convolution layer, a MobileNetV2 module, and a MobileNetV2 module with a downsampling step of 2; the Seizure-MViT module includes a local representation module, a global representation module, and a fusion layer; in the local representation module, the feature map is firstly subjected to local feature modeling through a convolution layer with a convolution kernel size of 3×3, and then the number of channels is adjusted through a convolution layer with a convolution kernel size of 1×1; in the global representation module, the global feature modeling is performed through the Unfold-Transformer-Fold structure; in the fusion layer, the number of channels is adjusted back to the original size through a convolution layer with a convolution kernel size of 1×1; a lightweight decision network is added to the MHA and MLP modules, and then the MHA and MLP are connected through a shortcut branch, and finally, the feature fusion is performed through a convolution layer with a convolution kernel size of 3×3 to obtain the output;

[0011] Training module: used for training the epileptic seizure prediction model using the training set;

[0012] Testing module: used to test the trained epileptic seizure prediction model using the test set to obtain early prediction indicators for epileptic seizures.

[0013] Furthermore, the preprocessing of the data processing module includes: EEG signal channel selection, baseline correction, artifact removal, low-pass filtering and sliding window data division, and then using short-time Fourier transform (STFT) to convert the EEG data into time-frequency signals.

[0014] Furthermore, in the convolution layer, a MobileNetV2 module connected to a MobileNetV2 module with a downsampling stride of 2 is called a downsampling module; after the data is input into the epileptic seizure prediction model, the data is first downsampled with a convolution kernel size of 3×3 and a stride of 2, and then the two downsampling modules are connected, and the output result is input into the Seizure-MViT module.

[0015] Furthermore, in the local representation module, the feature map is first passed through a convolution layer Conv-3×3 with a convolution kernel size of 3×3 to perform local feature modeling, and then the number of channels is adjusted through a convolution layer Conv-1×1 with a convolution kernel size of 1×1; the output data dimension is H×W×d as the input of the global module, where H represents the height of the data, W represents the width of the data, and d represents the number of data channels.

[0016] Furthermore, in the global representation module, X after local representation is expanded into N non-overlapping flat patches X UAfter the patches are unfolded by Unfold, the data enters the LWTransformer module, in which a lightweight decision network is added. The lightweight decision network is used to retain the patches and heads that contribute greatly to the epileptic seizure prediction results and remove the patches and heads that contribute little to the prediction results.

[0017] Furthermore, in the LWTransformer module, the decision network of the lth block consists of two linear layers with parameters W l P and W l h The calculation strategies used to generate patch selection and head selection are respectively used; given the l-th block Z l The input of the block usage strategy matrix is ​​expressed as in N and H represent the number of patches and self-attention heads in the Transformer block, respectively, l∈[1,L], L represents the number of Transformer blocks; and Each entry of is further passed to the sigmoid function, which represents the probability of retaining the corresponding patches and attention heads.

[0018] Furthermore, in the lightweight decision network, when The j-th patch embedding in the l-th block is retained when If the patch is selected automatically, for the lth block, If the corresponding entry in is equal to 0, then patch is removed from the input of this block.

[0019] Furthermore, in the lightweight decision network, heads are automatically selected depending on The operation of selecting what to keep or discard by applying a threshold to the entries during inference; defining a random variable Come through from Make a decision by sampling; when The j-th patch embedding in the l-th block is retained when If the head is selected automatically, for the lth block, If the corresponding entry in is equal to 0, then head is removed from the input of this block.

[0020] Furthermore, the fusion layer first transforms the globally characterized X G Fold to get X F, to restore its spatial dimension; then, use the point-by-point convolution method to convert X F Projected into a low C-dimensional space and combined with the initial data input to Seizure-MViT through a concatenation operation; another 3×3 convolutional layer is then used to fuse these union features.

[0021] Furthermore, the training module uses cross entropy loss and usage loss to guide the training objectives of the model, specifically including:

[0022] Through back propagation, the decision is fed back to the decision network, and the specific decision is expressed as:

[0023]

[0024] Among them, k∈[1,K], K is the number of categories, which is divided into epileptic seizure period, pre-ictal period and interictal period, K=3; G i =-log(-log(U i )) is the Gumbel distribution, τ is used to control M i Smoothness;

[0025] The usage loss is expressed as:

[0026]

[0027] Where D p =L×N,D h =L×H,D p and D h They represent the size of the flattened probability vector used to select patches and heads in the decision network, that is, the total number of patches and heads in the entire Transformer; p ,γ h ∈(0,1] represents the budget for target computation, i.e., the percentage of patches or heads to keep.

[0028] The beneficial effect of the present invention is that the present invention designs a novel epileptic seizure prediction model based on the self-attention mechanism, which combines the framework of ViT (Vision Transformer) and introduces a self-selected module to dynamically adjust the model structure to adapt to different epileptic seizure prediction scenarios without significantly increasing the computational complexity. The spatiotemporal characteristics of EEG signals are fully utilized to enhance the ability to identify the precursors of epileptic seizures.

[0029] The present invention introduces a self-selection module into the ViT model, which can intelligently and dynamically screen each header and patch according to their importance during the training process. The module decides to keep or delete specific headers and patches by evaluating the contribution of these components to the model performance, thereby effectively reducing the amount of calculation while maintaining or improving the prediction accuracy.

[0030] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:

[0032] Figure 1 A structural diagram of a system for building an epileptic seizure prediction model based on a lightweight Transformer according to an embodiment of the present invention;

[0033] Figure 2 A network structure diagram of a feature extraction module based on a lightweight Transformer according to an embodiment of the present invention;

[0034] Figure 3 A network structure diagram of a Seizure-MVit module according to an embodiment of the present invention;

[0035] Figure 4 2 is a network structure diagram of an LWTransformer module according to an embodiment of the present invention. DETAILED DESCRIPTION

[0036] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.

[0037] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0038] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.

[0039] like Figure 1 As shown, the present invention provides a system for constructing an epileptic seizure prediction model based on a lightweight Transformer, comprising:

[0040] Data processing module: pre-process the CHB-MIT data set and classify the denoised EEG into preictal, preictal and ictal phases. Then take 70% of the data as the training set, 20% of the data as the training set, and 10% of the data as the validation set.

[0041] According to a specific embodiment, the CHB-MIT data set is an internationally disclosed EEG data set for epilepsy patients. To ensure the reliability of the experiment and the balance of the samples, the present invention selects patient data with 22 EEG channels. Since multiple epileptic seizures may be closely connected to each other, the preictal period less than 30 minutes from the previous seizure is regarded as a preictal period. In addition, some patients have an average of one seizure every 2 hours, which is not enough to predict epileptic seizures. Therefore, only patients with less than 10 epileptic seizures per day are considered. According to these definitions, only 12 patients were selected from the CHB-MIT data set.

[0042] In order to avoid the baseline drift phenomenon in long-term EEG acquisition, the empirical mode decomposition algorithm is used for baseline calibration, and the direct removal method is used to remove noise and artifacts in the EEG signal. A 0-64Hz low-pass filter is used to remove high-frequency interference in the EEG signal. The data segment is divided into segments using a sliding window, and the length of an epilepsy data segment is set to 30s with an overlap rate of 50%. Finally, the preprocessed EEG is subjected to a short-time Fourier transform to convert the time domain signal into a time-frequency signal as the input of the model.

[0043] Transformer-based lightweight epileptic seizure prediction model: Using the PyTorch deep learning framework library in Python, a Transformer-based lightweight epileptic seizure prediction network (LightSeizureTransformer, LST) was built, which includes a convolution layer Conv-3×3 with a convolution kernel size of 3×3 and a stride of 2, a Seizure-MViT module, and a MobileNetV2 module. The Seizure-MViT module includes a local representation model, a global representation module, and a fusion model. The structure of the global representation model is the Unfold-Transformer-Fold structure. In the Transformer, a lightweight decision network is added to the MHA and MLP modules, and then the MHA and MLP are connected through shortcut branches. Specifically include:

[0044] In the LST network, a MobileNetV2 module connected to a MobileNetV2 module with a downsampling stride of 2 is called a downsampling module. Figure 2 As shown in the figure, after the data is input into LST, the input is first downsampled with a convolution kernel size of 3×3 and a stride of 2, then two downsampling modules are connected, and the downsampled output result is input into the Seizure-MViT module.

[0045] like Figure 3 As shown in the figure, the Seizure-MViT module mainly includes a local representation module, a global representation module and a fusion module. In the local representation module, the feature map is firstly passed through a convolution layer Conv-3×3 with a convolution kernel size of 3×3 for local feature modeling, and then the number of channels is adjusted through a convolution layer Conv-1×1 with a convolution kernel size of 1×1. The output data dimension is H×W×d as the input of the global module, where H represents the height of the data, W represents the width of the data, and d represents the number of data channels.

[0046] In the global representation module, X after local representation is expanded into N non-overlapping flat patches X U . Due to the local feature extraction, neither the order of the patch nor the spatial order of the pixels within each patch will be lost in the global representation module. This processing strategy enables the model proposed in this article to capture global information while not losing key local details. After the patches are unfolded by Unfold, the data enters the LWTransformer module, in which a lightweight decision network is added. The decision network retains the patches and heads that contribute more to the epileptic seizure prediction results, removes the patches and heads that contribute less to the prediction results, and improves computational efficiency. The specific decision process includes:

[0047] The output image after local representation is divided into a series of fixed-size two-dimensional patches, namely patches. Each patch consists of an equal number of tokens, and the h and w of each patch are equal. The input X is expanded into N non-overlapping flat patches X U As input to the LWTransformer module.

[0048] like Figure 4 As shown in the LWTransformer module, the decision network of the lth block consists of 2 linear layers with parameters W l P and W l h The calculation strategies used to generate patch selection and head selection are respectively used. Given the l-th block Z l The input of the block is expressed as in N and H represent the number of patches and self-attention heads in the Transformer block, respectively, l∈[1,L], and L represents the number of Transformer blocks. and Each entry of is further passed to the sigmoid function, which represents the probability of retaining the corresponding patches and attention heads. The l-th decision network shares the output of the previous l-1 transformer blocks, making the framework more efficient than using an independent decision network.

[0049] Since the decision is binary, the choice of keeping or discarding can be made by simply applying a threshold to the entries during inference. and Come through from and Make decisions based on sampling.

[0050] In the lightweight decision network of the present invention, it is necessary to automatically select patches or heads. When , the jth patch embedding in the lth block is preserved, while when In the case of automatic patch selection, our goal is to retain only the most informative patch embeddings and discard the rest to speed up inference. More formally, for the lth block, if If the corresponding entry in is equal to 0, then patch is removed from the input of this block.

[0051] For automatic selection of heads, it depends on Since the decision is binary, the choice of keeping or discarding can be made by simply applying a threshold to the entries during inference. Come through from When When , the jth patch embedding in the lth block is preserved, while when In the case of automatic head selection, our goal is to only retain the self-attention heads that contribute more to the prediction results and discard the self-attention heads that contribute less to the prediction to speed up reasoning. More formally, for the l-th block, if If the corresponding entry in is equal to 0, then head is removed from the input of this block.

[0052] The fusion module first transforms the globally represented X G Fold to get X F , to restore its spatial dimension. Then, the point-by-point convolution method is used to convert X F Projected to a low C-dimensional space and combined with the initial data of the input Seizure-MViT through a concatenation operation. Then another 3×3 convolutional layer is used to fuse these union features. The purpose of this step is to reduce the impact of redundant information while maintaining feature diversity.

[0053] Training module: Input the established training set data into the model, and use the cross entropy loss and usage loss to guide the training objectives of the entire model. During the training process, the model obtains the cross entropy loss by comparing the true label and the model's predicted probability, and feeds it back to the decision network through back propagation. The specific decision is given according to this formula: Wherein, k∈[1,K], K is the number of classifications, which are divided into epileptic seizure period, pre-seizure period and interictal period in the present invention, so K=3. i =-log(-log(U i )) is the Gumbel distribution, τ is used to control M i Smoothness.

[0054] To reduce computational cost, the following usage losses are used: Where D p =L×N,D h =L×H.D p and D h They represent the size of the flattened probability vector used to select patches and heads in the decision network, that is, the total number of patches and heads in the entire Transformer. p ,γ h ∈(0,1] represents the budget for target computation, i.e., the percentage of patches / headers to keep.

[0055] Test module: Input the established test set into the trained model to verify the performance of the model. In this embodiment, the training is completed by iterating 110 times, and the evaluation indicators accuracy (Accuracy), prediction sensitivity (Sensitivity), prediction specificity (Specificity), F1 score (F1 Score), FLOPs and parameter quantity (Parameters) are output to evaluate the seizure prediction effect of the model.

[0056] Finally, the evaluation indicators of the evaluation output are analyzed. The Transformer-based lightweight epilepsy seizure prediction network proposed in the present invention has an average accuracy of 95.66% on CHB-MIT, a sensitivity of 97.79%, a specificity of 94.41%, an F1 score of 94.89%, an average computational effort of 1.31 GFLOPs, and 2,248,779 parameters required for the model. This shows that the present invention can still maintain a high prediction ability under lower parameters.

[0057] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.

Claims

1. A system for building an epileptic seizure prediction model based on a lightweight Transformer, characterized by: include: Data processing module: used to obtain epilepsy EEG data sets, pre-process the data sets, and classify them into three categories: epileptic interictal period, pre-epileptic seizure period, and epileptic seizure period; extract a part of the data from each of the three categories to construct training sets, test sets, and validation sets; Epileptic seizure prediction model: Based on the Transformer network, it includes a convolution layer, a Seizure-MViT module, and a global pooling layer; the convolution layer includes a 3×3 downsampling convolution layer, a MobileNetV2 module, and a MobileNetV2 module with a downsampling step of 2; the Seizure-MViT module includes a local representation module, a global representation module, and a fusion layer; in the local representation module, the feature map is firstly subjected to local feature modeling through a convolution layer with a convolution kernel size of 3×3, and then the number of channels is adjusted through a convolution layer with a convolution kernel size of 1×1; in the global representation module, the global feature modeling is performed through the Unfold-Transformer-Fold structure; in the fusion layer, the number of channels is adjusted back to the original size through a convolution layer with a convolution kernel size of 1×1; a lightweight decision network is added to the MHA and MLP modules, and then the MHA and MLP are connected through a shortcut branch, and finally, the feature fusion is performed through a convolution layer with a convolution kernel size of 3×3 to obtain the output; Training module: used for training the epileptic seizure prediction model using the training set; Testing module: used to test the trained epileptic seizure prediction model using the test set to obtain early prediction indicators for epileptic seizures.

2. The system for constructing an epileptic seizure prediction model based on a lightweight Transformer according to claim 1, characterized in that: The preprocessing of the data processing module includes: EEG signal channel selection, baseline correction, artifact removal, low-pass filtering and sliding window data division, and then using short-time Fourier transform (STFT) to convert the EEG data into time-frequency signals.

3. The system for constructing an epileptic seizure prediction model based on a lightweight Transformer according to claim 1, characterized in that: In the convolutional layer, a MobileNetV2 module connected to a MobileNetV2 module with a downsampling stride of 2 is called a downsampling module; after the data is input into the epileptic seizure prediction model, the data is first downsampled with a convolution kernel size of 3×3 and a stride of 2, and then the two downsampling modules are connected, and the output result is input into the Seizure-MViT module.

4. The system for constructing an epileptic seizure prediction model based on a lightweight Transformer according to claim 1, characterized in that: In the local representation module, the feature map is first passed through a convolution layer Conv-3×3 with a convolution kernel size of 3×3 to perform local feature modeling, and then the number of channels is adjusted through a convolution layer Conv-1×1 with a convolution kernel size of 1×1; the output data dimension is H×W×d as the input of the global module, where H represents the height of the data, W represents the width of the data, and d represents the number of data channels.

5. The system for constructing an epileptic seizure prediction model based on a lightweight Transformer according to claim 1, characterized in that: In the global representation module, X after local representation is expanded into N non-overlapping flat patches X U After the patches are unfolded by Unfold, the data enters the LWTransformer module, in which a lightweight decision network is added. The lightweight decision network is used to retain the patches and heads that contribute greatly to the epileptic seizure prediction results and remove the patches and heads that contribute little to the prediction results.

6. The system for constructing an epileptic seizure prediction model based on a lightweight Transformer according to claim 1, characterized in that: In the LWTransformer module, the decision network of the lth block consists of 2 linear layers with parameters W l P and W l h The calculation strategies used to generate patch selection and head selection respectively; Given the lth block Z l The input of the block usage strategy matrix is ​​expressed as in N and H represent the number of patches and self-attention heads in the Transformer block, respectively, l∈[1,L], L represents the number of Transformer blocks; and Each entry of is further passed to the sigmoid function, which represents the probability of retaining the corresponding patches and attention heads.

7. The system for constructing an epileptic seizure prediction model based on a lightweight Transformer according to claim 1, characterized in that: In the lightweight decision network, when The j-th patch embedding in the l-th block is retained when If the patch is selected automatically, for the lth block, If the corresponding entry in is equal to 0, then patch is removed from the input of this block.

8. The system for constructing an epileptic seizure prediction model based on a lightweight Transformer according to claim 1, characterized in that: In the lightweight decision network, heads are automatically selected depending on The operation of selecting what to keep or discard by applying a threshold to the entries during inference; defining a random variable Come through from Make a decision by sampling; when The j-th patch embedding in the l-th block is retained when If the head is selected automatically, for the lth block, If the corresponding entry in is equal to 0, then head is removed from the input of this block.

9. The system for constructing an epileptic seizure prediction model based on a lightweight Transformer according to claim 1, characterized in that: The fusion layer first transforms the globally characterized X G Fold to get X F , to restore its spatial dimension; then, use the point-by-point convolution method to convert X F Projected into a low C-dimensional space and combined with the initial data input to Seizure-MViT through a concatenation operation; another 3×3 convolutional layer is then used to fuse these union features.

10. The system for constructing an epileptic seizure prediction model based on a lightweight Transformer according to claim 1, characterized in that: The training module uses cross entropy loss and usage loss to guide the training objectives of the model, specifically including: Through back propagation, the decision is fed back to the decision network, and the specific decision is expressed as: Among them, k∈[1,K], K is the number of categories, which is divided into epileptic seizure period, pre-ictal period and interictal period, K=3; G i =-log(-log(U i )) is the Gumbel distribution, τ is used to control M i Smoothness; The usage loss is expressed as: Where D p =L×N,D h =L×H,D p and D h They represent the size of the flattened probability vector used to select patches and heads in the decision network, that is, the total number of patches and heads in the entire Transformer; p ,γ h ∈(0,1] represents the budget for target computation, i.e., the percentage of patches or heads to keep.

Citation Information

Patent Citations

  • Epilepsy detection system based on CNN and Transform

    CN114129129A

  • Epileptic seizure detection system based on attention mechanism

    CN115359909A

  • Epileptic seizure prediction model training method and epileptic seizure prediction system

    CN117562551A

  • Epilepsy prediction method and device

    CN117752308A

  • Tannin containing tree cut embrocation composite

    KR1020250065978A