Intracranial EEG Signal Processing Method Based on Hybrid Learning of Contrast Learning and Mask Reconstruction
By employing a hybrid learning approach combining contrastive learning and mask reconstruction, the problem of differences in electrode placement and quantity in intracranial EEG signal processing systems was addressed, enhancing the robustness and generalization ability of the model and enabling effective feature extraction and prediction in intracranial EEG modalities.
Patent Information
- Application Number
- CN202610426954.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-02
- Publication Date
- 2026-07-03
AI Technical Summary
Existing EEG processing systems are ill-equipped to handle the differences in electrode placement and number among different subjects with intracranial EEG signals. They also lack robustness, cannot be trained on unlabeled data, cannot extract the shape and statistical characteristics of raw EEG signals, and cannot resolve channel and electrode differences.
We adopted a hybrid learning approach based on contrastive learning and mask reconstruction to design a pre-training paradigm and model structure adapted to intracranial EEG modalities. We constructed an intracranial EEG signal processing network through convolutional networks, Transformer encoders, and linear prediction layers to enhance the robustness and generalization ability of the model. We also utilized cross-attention mechanisms to align and reconstruct EEG features.
The model's performance under intracranial EEG modalities was improved, its robustness to electrode spatial coordinates was enhanced, and it achieved effective training on unlabeled data and good prediction results for multiple downstream tasks.
Smart Images

Figure CN122320575A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a technology in the field of neural networks, specifically a method for processing intracranial electroencephalogram (EEG) signals based on a hybrid learning approach combining contrastive learning and mask reconstruction. Background Technology
[0002] Current EEG processing systems primarily design model structures based on the channel configuration of scalp EEG. Scalp EEG has specific electrode placement guidelines, and models designed based on scalp EEG generally do not consider variations in electrode placement. These models struggle to handle differences in electrode placement and number among different subjects in intracranial EEG data. Furthermore, the spatial coordinates of electrodes in intracranial EEG data may be missing, and typical model designs do not account for this, lacking robustness in handling such missing electrode spatial coordinates. Existing interventional EEG signal classification techniques are limited by feature extraction methods, restricting them to manually defined feature sets. They cannot extract other shape and statistical features from the raw EEG signals, cannot be trained on unlabeled data, and fail to address channel and electrode differences among different subjects. Summary of the Invention
[0003] To address the aforementioned shortcomings of existing technologies, this invention proposes a hybrid learning method for intracranial electroencephalogram (EEG) signal processing based on contrastive learning and mask reconstruction. Starting from two perspectives—pre-training paradigm and model structure design—it designs a pre-training paradigm and model structure adapted to intracranial EEG modalities, enhancing the model's performance on downstream tasks within intracranial EEG modalities, giving the model robustness to the spatial coordinates of adversarial electrodes, and simultaneously improving its generalization ability across subject settings.
[0004] This invention is achieved through the following technical solution:
[0005] This invention relates to an intracranial electroencephalogram (EEG) signal processing method based on a hybrid learning approach combining contrastive learning and mask reconstruction. After acquiring intracranial EEG signals and constructing a training set in the offline stage, an intracranial EEG signal processing network (IntraBraM) is constructed, which includes a convolutional network block encoder, a Transformer encoder, a decoder, and a linear prediction layer. After contrastive training and mask reconstruction training, real-time EEG signal classification is performed online using the trained IntraBraM.
[0006] The aforementioned intracranial EEG signal processing network includes: a convolutional network block encoder, a temporal location encoder, a ground-space location encoder, an indexed spatial location encoder, a Transformer encoder, a Transformer decoder, a linear decoder, and a linear prediction layer, wherein: the convolutional network block encoder processes the input block-based raw EEG signals. Block coding is performed to obtain intracranial EEG block codes. Time location coding is based on the time window of intracranial EEG block coding. Temporal location encoding is performed to obtain the temporal location encoding of intracranial EEG block encoding. The real spatial location coding is based on the spatial coordinates of the electrodes in the intracranial EEG, and the spatial location coding of the intracranial EEG block coding is obtained. The spatial location coding is based on the channel index of the intracranial EEG block coding, and performs index-based location coding to obtain the spatial location code of the intracranial EEG block coding. The Transformer encoder uses a block coding sequence that has incorporated temporal and spatial location coding. With trainable and fixed queries The system performs representation encoding based on intracranial EEG to obtain a fixed-size general intracranial EEG representation. The Transformer decoder then encodes the masked blocks. Using the general intracranial EEG representation, intracranial EEG block coding reconstruction was performed to obtain the reconstructed block codes. The linear decoder is based on the reconstructed block encoding Intracranial electroencephalogram (EEG) signal reconstruction was performed to obtain the reconstructed intracranial EEG signal. The linear prediction layer predicts classification labels based on general intracranial EEG representations, thus obtaining classification label probabilities.
[0007] Technical effect
[0008] This invention presents a customized model structure based on a cross-attention mechanism for intracranial EEG modalities. This structure can effectively generate uniformly sized intracranial EEG representations for intracranial EEG inputs with different electrode settings. A hybrid spatial encoding mechanism is also proposed to stably provide spatial location encoding in both cases where spatial location information is present and absent. Furthermore, a hybrid pre-training paradigm is employed, using a masked reconstruction task to enable the model to learn the local temporal features of intracranial EEG signals. Simultaneously, by contrastively learning and aligning intracranial EEG features with and without true spatial location encoding, the model generates the same location encoding information in cases where electrode spatial location information is absent as it does in cases where spatial location information is present. Pre-training on an unlabeled intracranial EEG dataset results in improved prediction performance across multiple downstream tasks. Attached Figure Description
[0009] Figure 1 This is a flowchart of the present invention;
[0010] Figure 2 This is a schematic diagram of the invention;
[0011] Figure 3 A schematic diagram of a multi-layer Transformer encoder structure without self-attention matrix masks;
[0012] Figure 4 A schematic diagram of a multi-layered Transformer decoder structure without self-attention matrix masks;
[0013] Figure 5 For comparison of the effects under different pre-training paradigms;
[0014] Figure 6 The performance (measured by AUC) on four downstream tasks on the Brain Treebank dataset is compared with and without spatial location information.
[0015] Figure 7 The results are from experiments on data and parameter scalability on the SWEC-ETHZ dataset.
[0016] In the figure: the left figure shows the data scalability experiment, where the model's performance on downstream tasks improves as the amount of pre-trained data increases; the right figure shows the scalability results of the model's parameter count, where the model's performance on downstream tasks improves as the number of model parameters increases. Detailed Implementation
[0017] like Figure 1 and Figure 2 As shown, this embodiment illustrates a method for classifying intracranial electroencephalogram (EEG) signals based on a hybrid learning approach combining contrastive learning and mask reconstruction, comprising:
[0018] Step 1: To extract local features of intracranial electroencephalogram (EEG) signals, for signals with a number of channels... ,common Multichannel intracranial electroencephalogram signals at each time step The raw signal of each channel is divided into non-overlapping blocks. ,in: , The length of the window.
[0019] Step 2: The raw EEG signals are segmented into blocks using a convolutional network-based block encoder. Mapping to corresponding Dimensional block encoding Specifically: .
[0020] Step 3: For each block, perform temporal position coding using a fixed sinusoidal position coding method and spatial position coding using a hybrid coding method, ultimately obtaining the result with added spatial position coding. and time location encoding Block encoding ,in: For the channel, For time window, For block encoding
[0021] The fixed sinusoidal position encoding method refers to: in: For time steps, For dimensions.
[0022] The aforementioned hybrid encoding method refers to: for codes with spatial location coordinates electrodes The corresponding block encoding transforms spatial location coordinates into normalized spatial location coordinates using zscore normalization. To obtain its true spatial location code For electrodes that do not have spatial location coordinates, a fixed sinusoidal position coding based on the electrode index is used to obtain the channel index position coding.
[0023] Step 4: As Figure 3 As shown, by stacking multiple layers of Transformer encoders without self-attention matrix masks, and utilizing a cross-attention mechanism, the block encoding obtained in step 3 is transformed into a fixed-size general intracranial EEG representation. Specifically, this includes constructing a trainable and fixed query. For block-coded sequences that have incorporated temporal and spatial location coding In each layer of the model, the query First, it goes through a multi-head self-attention layer to encode itself, and then through a multi-head cross-attention layer to encode the query using block position encoding.
[0024] The multi-head self-attention matrix of the multi-head self-attention layer is as follows: Among them: each attention head , For each dimension of attention head, To focus on the number of heads, satisfy the following conditions: .
[0025] The multi-head cross-attention matrix of the multi-head cross-attention layer is as follows: Among them: each attention head , For each dimension of attention head, To focus on the number of heads, satisfy the following conditions: .
[0026] Step 5: Perform comparative training to align intracranial EEG representations with channel spatial location information with those without spatial location information; simultaneously, enhance the model's robustness to signal noise by adding noise, specifically including:
[0027] 5.1 Obtaining block coding without adding spatial and temporal location codes Then, copy the two identical block codes. , ,
[0028] 5.2 Add different Gaussian noise to the two block codes respectively to obtain , .
[0029] 5.3 Add the same temporal location encoding, and add spatial location encoding generated from the real spatial location coordinates and index-based spatial location encoding respectively. Using a Transformer encoder without a self-attention matrix mask, construct a positive sample pair using a cross-attention mechanism. .
[0030] 5.4 The dimensionality of positive sample pairs was reduced by linear mapping to obtain the compressed intracranial EEG expression. The contrast loss is calculated using the compressed representation. Used for parameter optimization.
[0031] Step 6: As Figure 4 As shown, a mask reconstruction training is performed on the decoder based on masking and intracranial EEG expression to reconstruct the masked block encoding, enabling the model to learn intracranial EEG expressions with local features. Specifically, this includes:
[0032] 6.1 For block coding without spatiotemporal location coding, a random block mask is added to cover part of the block, resulting in the masked block code. Then, time location encoding and real spatial location encoding are added to it to obtain the block encoding of the mask. .
[0033] 6.2 Intracranial EEG Expression Obtained from Real Location via Decoder The cross-attention mechanism is used to reconstruct the masked block encoding;
[0034] 6.3 By stacking multiple Transformer decoders without self-attention matrix masks corresponding to the Transformer encoders in step 4, in each decoder layer, the masked block encoding is first encoded through a multi-head self-attention mechanism, and then multi-head cross-attention is used to utilize intracranial EEG expression. Encode the masked block code.
[0035] The multi-head self-attention matrix of the multi-head self-attention layer is as follows: Among them: each attention head , For each dimension of attention head, To focus on the number of heads, satisfy the following conditions: .
[0036] The multi-head cross-attention matrix of the multi-head cross-attention layer is as follows: Among them: each attention head , For each dimension of attention head, To focus on the number of heads, satisfy the following conditions: .
[0037] 6.4 Reconstructed block encoding was obtained through multi-layer attention. Then, through a trainable linear layer, it is reconstructed into intracranial electroencephalogram (EEG) signals.
[0038] 6.5 Based on the reconstructed intracranial electroencephalogram (EEG) signals The total loss is calculated by weighting the contrast loss and the reconstruction loss, as follows: Among them: mask reconstruction loss It is calculated using the Mean Square Error;
[0039] 6.6 Based on the total loss, AdamW is used to optimize the weights of the entire model to obtain the final pre-trained model.
[0040] Step 7: Perform downstream probabilistic prediction tasks through a finely tuned linear prediction layer, specifically: using a linear head to perform representations based on intracranial EEG. The data is mapped to logits to predict the probability of which EEG segments belong to a category.
[0041] The fine-tuning refers to: calculating the cross-entropy loss using samples and labels from downstream tasks, and optimizing the model and linear head using AdamW.
[0042] like Figure 2 As shown, the intracranial EEG signal processing system implementing the above method in this embodiment includes: a convolutional network block encoder, a temporal location encoder, a ground-space location encoder, an indexed spatial location encoder, a Transformer encoder, a Transformer decoder, a linear decoder, and a linear prediction layer, wherein: the convolutional network block encoder processes the input block-based raw EEG signals. Block coding is performed to obtain intracranial EEG block codes. Time location coding is based on the time window of intracranial EEG block coding. Temporal location encoding is performed to obtain the temporal location encoding of intracranial EEG block encoding. The real spatial location coding is based on the spatial coordinates of the electrodes in the intracranial EEG, and the spatial location coding of the intracranial EEG block coding is obtained. The spatial location coding is based on the channel index of the intracranial EEG block coding, and performs index-based location coding to obtain the spatial location code of the intracranial EEG block coding. The Transformer encoder uses a block coding sequence that has incorporated temporal and spatial location coding. With trainable and fixed queries The system performs representation encoding based on intracranial EEG to obtain a fixed-size general intracranial EEG representation. The Transformer decoder then encodes the masked blocks. Using the general intracranial EEG representation, intracranial EEG block coding reconstruction was performed to obtain the reconstructed block codes. The linear decoder is based on the reconstructed block encoding Intracranial electroencephalogram (EEG) signal reconstruction was performed to obtain the reconstructed intracranial EEG signal. The linear prediction layer predicts classification labels based on general intracranial EEG representations, thus obtaining classification label probabilities.
[0043] Table 1. Block Encoder Parameter Information
[0044] Table 2 Transformer encoder and Transformer decoder parameter information
[0045] As shown in Tables 1 and 2, the present invention proposes three sets of models with different parameter scales for specific experiments.
[0046] Table 3. Pre-training learning rate and weight decay information for each module.
[0047] As shown in Table 3, the above learning rate and weight decay were applied to each module in the model of this invention, and 15 epochs of pre-training were performed using the non-public intracranial EEG dataset from Ruijin Hospital, consisting of 98 anonymous subjects and approximately 600 hours of unlabeled intracranial EEG data.
[0048] Table 4. Fine-tuning learning rate and weight decay information for each module.
[0049] As shown in Table 4, the model of this invention uses the above-mentioned learning rate and weight decay to train each module for one epoch to complete the fine-tuning.
[0050] Table 5. Baseline Model Comparison Experiment Dataset Information
[0051] As shown in Table 5, the model's performance was validated using five publicly available datasets. Through practical application experiments, the model was tested on the SWEC-ETHZ dataset (which includes epileptic seizure phase annotations). Running this invention's intracranial EEG signal processing system, based on a hybrid learning approach combining contrastive learning and mask reconstruction, on the current mainstream pre-trained EEG models, the average F1-score improved from 0.6966 to 0.7312 and the average AUC improved from 0.6325 to 0.6522 under 4-fold cross-validation. On the Brain Treebank dataset (which includes speech task annotations), the model improved the average AUC from 0.5716 to 0.6320 in speech task-related EEG signal classification. Through pre-training based on intracranial EEG, this invention's model achieved performance improvements across multiple intracranial EEG modalities.
[0052] Table 6 shows the performance of IntraBraM on multiple epilepsy task datasets compared to the baseline EEG model.
[0053] Table 7 shows the performance of IntraBraM on multiple cognitive-related task datasets compared to the baseline EEG model.
[0054] As shown in Tables 6 and 7, experiments demonstrate that the model of this invention achieves significant performance improvements over the baseline model based on extracranial EEG design in tasks involving detection of EEG segments during seizures and neural pattern recognition related to specific cognitive states.
[0055] like Figure 5 As shown, compared to training using only mask reconstruction, training using only contrastive methods, or no pre-training, the pre-training paradigm of this invention makes the model perform more stably and better on multiple downstream tasks.
[0056] The performance of IntraBraM on the Brain Treebank dataset was compared with and without providing spatial location coordinates. The results are as follows: Figure 6 As shown, the performance of the model in this invention is extremely similar with and without spatial location coordinates, showing no significant difference. IntraBraM's model structure based on cross-attention design effectively eliminates data variability in the final representation caused by differences in electrode placement. Simultaneously, during the pre-training phase, contrastive learning successfully aligns the two representations generated by incorporating the true spatial location encoding and the channel index location encoding, enabling the model to perform in downstream tasks independently of electrode spatial location coordinates, demonstrating robustness to situations where electrode spatial location coordinates are missing.
[0057] like Figure 7 As shown, with the increase in the amount of data used for model pre-training, the model's performance on the SWEC-ETHZ episodic EEG segment detection task significantly improved. Furthermore, as the model's parameter count gradually increased from 630K to 14.6M, its performance also improved. The model structure of this invention is scalable; its performance can be improved by increasing the amount of training data and the model size.
[0058] Compared with existing technologies, this invention utilizes a Transformer encoder without self-attention matrix masks, designed based on intracranial EEG, to encode via cross-attention. This significantly improves the accuracy of classification tasks on intracranial EEG datasets compared to baseline pre-trained EEG models. A hybrid location encoding method is proposed, combining contrastive learning to eliminate the intracranial EEG model's dependence on spatial location information. Even with missing spatial coordinates, the model performs similarly to when spatial location information is present. Furthermore, a hybrid pre-training technique is proposed, which achieves better pre-training results on intracranial EEG data compared to contrastive learning and mask reconstruction learning, resulting in a stable improvement in accuracy for classification tasks on intracranial EEG datasets.
[0059] The above-described specific implementations can be partially adjusted by those skilled in the art in different ways without departing from the principles and purpose of the present invention. The scope of protection of the present invention is defined by the claims and is not limited to the above-described specific implementations. All implementation schemes within the scope of the claims are bound by the present invention.
Claims
1. A method for processing intracranial electroencephalogram (EEG) signals based on a hybrid learning approach combining contrastive learning and mask reconstruction, characterized in that: After collecting intracranial EEG signals and constructing a training set in the offline stage, an intracranial EEG signal processing network (IntraBraM) containing a convolutional network block encoder, a Transformer encoder, a decoder, and a linear prediction layer is constructed. After contrastive training and mask reconstruction training, real-time EEG signal classification is performed in the online stage using the trained IntraBraM. The aforementioned intracranial EEG signal processing network includes: a convolutional network block encoder, a temporal location encoder, a ground-space location encoder, an indexed spatial location encoder, a Transformer encoder, a Transformer decoder, a linear decoder, and a linear prediction layer, wherein: the convolutional network block encoder processes the input block-based raw EEG signals. Block coding is performed to obtain intracranial EEG block codes. Time location coding is based on the time window of intracranial EEG block coding. Temporal location encoding is performed to obtain the temporal location encoding of intracranial EEG block encoding. The real spatial location coding is based on the spatial coordinates of the electrodes in the intracranial EEG, and the spatial location coding of the intracranial EEG block coding is obtained. The spatial location coding is based on the channel index of the intracranial EEG block coding, and performs index-based location coding to obtain the spatial location code of the intracranial EEG block coding. The Transformer encoder uses a block coding sequence that has incorporated temporal and spatial location coding. With trainable and fixed queries The system performs representation encoding based on intracranial EEG to obtain a fixed-size general intracranial EEG representation. The Transformer decoder then encodes the masked blocks. Using the general intracranial EEG representation, intracranial EEG block coding reconstruction was performed to obtain the reconstructed block codes. The linear decoder is based on the reconstructed block encoding Intracranial electroencephalogram (EEG) signal reconstruction was performed to obtain the reconstructed intracranial EEG signal. The linear prediction layer predicts classification labels based on general intracranial EEG representations, thus obtaining classification label probabilities.
2. The intracranial EEG signal processing method based on a hybrid learning approach combining contrastive learning and mask reconstruction as described in claim 1, characterized in that, The training set is constructed as follows: for a number of channels... ,common Multichannel intracranial electroencephalogram signals at each time step The raw signal of each channel is divided into non-overlapping blocks. ,in: , The length of the window.
3. The intracranial EEG signal processing method based on a hybrid learning approach combining contrastive learning and mask reconstruction as described in claim 1, characterized in that, The aforementioned comparative training refers to aligning intracranial electroencephalogram (EEG) representations with channel spatial location information with intracranial EEG representations without spatial location information. Simultaneously, by adding noise, the model's robustness to signal noise is enhanced, specifically including: i obtains the block code without spatial and temporal location encoding. Then, copy the two identical block codes. , ; ii. Add different Gaussian noise to the two block codes respectively, and obtain , ; iii. Add the same temporal location encoding, and add spatial location encoding generated from real spatial location coordinates and index-based spatial location encoding respectively. Using a Transformer encoder without a self-attention matrix mask, construct a positive sample pair using a cross-attention mechanism. ; IV. By reducing the dimensionality of positive sample pairs through linear mapping, compressed intracranial EEG expressions are obtained. The contrast loss is calculated using the compressed representation. Used for parameter optimization.
4. The intracranial EEG signal processing method based on a hybrid learning approach combining contrastive learning and mask reconstruction as described in claim 1, characterized in that, The aforementioned mask reconstruction training refers to training a decoder based on a mask and intracranial EEG expression to reconstruct the masked block codes, enabling the model to learn intracranial EEG expressions with local features. Specifically, this includes: For block coding without spatiotemporal location encoding, a random block mask is added to cover part of the block, resulting in the masked block code. Then, time location encoding and real spatial location encoding are added to it to obtain the block encoding of the mask. ; ii. Through decoder and intracranial EEG expression obtained from real location The cross-attention mechanism is used to reconstruct the masked block encoding; iii. By stacking multiple layers of Transformer decoders without self-attention matrix masks, in each decoder layer, the masked block encoding is first performed through a multi-head self-attention mechanism, and then multi-head cross-attention is used to utilize intracranial EEG expression. Encode the block code that is being masked; The multi-head self-attention matrix of the multi-head self-attention layer is as follows: Among them: each attention head , For each dimension of attention head, To focus on the number of heads, satisfy the following conditions: . The aforementioned multi-head cross-attention mechanism is specifically as follows: Among them: each attention head , For each dimension of the attention head, satisfy ; IV. Reconstructed block encoding was obtained through multi-layer attention. Then, through a trainable linear layer, it is reconstructed into intracranial electroencephalogram (EEG) signals. v Based on the reconstructed intracranial electroencephalogram signals The total loss is calculated by weighting the contrast loss and the reconstruction loss, as follows: Among them: mask reconstruction loss It is calculated using the Mean Square Error; Based on the total loss, vi uses AdamW to optimize the weights of the entire model, resulting in the final pre-trained model.
5. The intracranial EEG signal processing method based on a hybrid learning approach combining contrastive learning and mask reconstruction as described in claim 1, characterized in that, The online phase refers to the execution of downstream probabilistic prediction tasks through a finely tuned linear prediction layer, specifically: using a linear head to analyze representations based on intracranial electroencephalography (EEG). The data is mapped to logits to predict the probability of which EEG segments belong to a category.
6. The intracranial EEG signal processing method based on hybrid learning of contrastive learning and mask reconstruction according to any one of claims 1-5, characterized in that, specifically include: Step 1: Extract local features of intracranial electroencephalogram (EEG) signals; Step 2: Using a block encoder based on a convolutional network, the raw EEG signals are segmented into blocks. Mapping to corresponding Dimensional block encoding Specifically: ; Step 3: For each block, perform temporal position coding using a fixed sinusoidal position coding method and spatial position coding using a hybrid coding method, ultimately obtaining the result with added spatial position coding. and time location encoding Block encoding ,in: For the channel, For time window, Block encoding; Step 4: Using a Transformer encoder without a self-attention matrix mask, and leveraging a cross-attention mechanism, the block encoding obtained in Step 3 is transformed into a fixed-size general intracranial EEG representation, specifically including: 4.1 Constructing trainable and fixed queries For block-coded sequences that have incorporated temporal and spatial location coding In each layer of the model, the query First, it goes through a multi-head self-attention layer to encode itself, and then through a multi-head cross-attention layer to encode the query using block position encoding; The multi-head self-attention matrix of the multi-head self-attention layer is as follows: Among them: each attention head , For each dimension of attention head, To focus on the number of heads, satisfy the following conditions: The multi-head cross-attention matrix of the multi-head cross-attention layer is as follows: Among them: each attention head , For each dimension of attention head, To focus on the number of heads, satisfy the following conditions: ; 4.2 Intracranial EEG representations are used to provide queries, and block encoding is used to provide keys. Intracranial EEG representations are obtained by encoding through multiple layers of Transformer Decoder Blocks without self-attention matrix masks. ; Step 5: Conduct comparative training; Step 6: Train the decoder based on masking and intracranial EEG expression to perform mask reconstruction. Step 7: Perform downstream probabilistic prediction tasks through a finely tuned linear prediction layer.
7. The intracranial EEG signal processing method based on hybrid learning of contrastive learning and mask reconstruction according to claim 6, characterized in that, The fixed sinusoidal position encoding method refers to: in: For time steps, For dimensions; The aforementioned hybrid encoding method refers to: for codes with spatial location coordinates electrodes The corresponding block encoding transforms spatial location coordinates into normalized spatial location coordinates using zscore normalization. To obtain its true spatial location code For electrodes that do not have spatial location coordinates, a fixed sinusoidal position coding based on the electrode index is used to obtain the channel index position coding. .
8. The intracranial EEG signal processing method based on hybrid learning of contrastive learning and mask reconstruction according to claim 6, characterized in that, The fine-tuning refers to: calculating the loss using samples and labels from downstream tasks, and optimizing the model and linear head using AdamW.
9. A system for processing intracranial electroencephalogram (EEG) signals based on a hybrid learning approach combining contrastive learning and mask reconstruction, implementing the method described in any one of claims 1-8, characterized in that, include: The system consists of a convolutional network block encoder, a temporal location encoder, a ground-space location encoder, an indexed spatial location encoder, a Transformer encoder, a Transformer decoder, a linear decoder, and a linear prediction layer. The convolutional network block encoder processes the input blocks of raw EEG signals. Block coding is performed to obtain intracranial EEG block codes. Time location coding is based on the time window of intracranial EEG block coding. Temporal location encoding is performed to obtain the temporal location encoding of intracranial EEG block encoding. The real spatial location coding is based on the spatial coordinates of the electrodes in the intracranial EEG, and the spatial location coding of the intracranial EEG block coding is obtained. The spatial location coding is based on the channel index of the intracranial EEG block coding, and performs index-based location coding to obtain the spatial location code of the intracranial EEG block coding. The Transformer encoder uses a block coding sequence that has incorporated temporal and spatial location coding. With trainable and fixed queries The system performs representation encoding based on intracranial EEG to obtain a fixed-size general intracranial EEG representation. The Transformer decoder then encodes the masked blocks. Using the general intracranial EEG representation, intracranial EEG block coding reconstruction was performed to obtain the reconstructed block codes. The linear decoder is based on the reconstructed block encoding Intracranial electroencephalogram (EEG) signal reconstruction was performed to obtain the reconstructed intracranial EEG signal. The linear prediction layer predicts classification labels based on general intracranial EEG representations, thus obtaining classification label probabilities.