A magnetoencephalography (MEG) source localization method based on attention mechanism
Patent Information
- Application Number
- CN202311778182.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-21
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2043-12-21
AI Technical Summary
同时脑磁图MEG也具有其空间分辨率较低、信号噪声比低等不足之处
[0042](1)利用先验MRI成像信息与脑磁图数据相结合,实现跨模态信息融合,提高源定位的准确性。
Smart Images

Figure CN117653124B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of biomedical signal analysis and processing, and in particular to a method for locating MEG sources based on attention mechanisms. Background Technology
[0002] Magnetoencephalography (MEG) is a non-invasive neurophysiological technique used to record neural activity in the brain. MEG achieves high spatiotemporal resolution imaging of brain function by detecting the weak magnetic fields generated by the brain. MEG technology uses magnetic field sensors such as superconducting quantum interference devices (SQUIDs) or optical pumping magnetometers (OPMs) based on spin-exchange relaxation-free (SERF) to detect these weak magnetic fields. These magnetic fields are closely related to neural activity in different functional states of the brain; by analyzing these magnetic field signals, the functional state of the brain can be understood. MEG signal acquisition typically requires an array of multiple sensors to cover multiple areas of the brain surface.
[0003] Compared to electroencephalography (EEG) and functional magnetic resonance imaging (MRI), magnetoencephalography (MEG) has certain advantages, including high spatiotemporal resolution, direct reflection of neural activity, no radiation damage, and applicability to different age groups. However, MEG also has drawbacks, such as lower spatial resolution and a lower signal-to-noise ratio.
[0004] As mentioned above, new magnetoencephalography (MEG) source localization methods are needed to determine the source location and intensity of brain activity. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention provides a method for MEG source localization based on an attention mechanism. Without altering other detector devices or their installation, machine learning methods are used to construct an input-output model for MEG data processing, thereby improving the real-time performance and accuracy of MEG source localization.
[0006] The technical solution of this invention is:
[0007] An attention-based approach to MEG source localization using magnetoencephalography (MEG) first acquires structural MRI images using a magnetic resonance imaging (MRI) scanner, and then obtains MEG data using a superconducting quantum interference device (SQU) or an atomic magnetometer. The acquired data undergoes preprocessing, including sparsification of the structural image data and noise and artifact removal from the MEG data. An attention-based source localization model is constructed, performing multimodal fusion and multi-feature representation of the MRI structural images and MEG data. The localization model is trained and aligned with the MEG data for localization. Finally, MEG data localization analysis and feedback optimization are performed, and the accuracy and consistency of the localization results are verified.
[0008] This invention improves source localization accuracy by fusing modal information and multi-feature representation from MRI structural image data and MEG data. It leverages the global context awareness of the Transformer model, with its core attention mechanism, to capture long-range dependencies in MEG data, reducing localization errors. Furthermore, the parallel computing capabilities of the Transformer model enable the processing of large amounts of data in a shorter time, improving computational efficiency. This invention features a clear workflow, better real-time performance, and higher accuracy.
[0009] Furthermore,
[0010] Preprocessing with filtering: The initial magnetoencephalogram (MEG) data is passed through a bandpass filter of 0.1Hz-40Hz to remove low-frequency and high-frequency noise and improve the accuracy of MEG source localization;
[0011] Artifact removal: Independent component analysis (ICA) is used to remove artifacts by separating several observed signals into several independent source signals, each of which represents a specific physiological activity. By finding a linear transformation that makes the transformed components independent of each other, the aforementioned artifact noise can be separated from the magnetoencephalogram (MEG) source signals, thereby removing artifacts.
[0012] Furthermore,
[0013] Coordinate systems were established for the brain structure images constructed from MRI and the collected magnetoencephalogram datasets, and then transformed. First, they were converted into one-dimensional vectors, and then the matrix scale was defined and converted into two-dimensional matrices.
[0014] Define a time window threshold for the magnetoencephalogram (MEG) signal, and use the MEG signal segments within the window as an element of a matrix to obtain the initial source spatial signal distribution of the MEG signal, which is then arranged according to the aforementioned structural image rules.
[0015] The source localization of the spatially filtered and spectrally analyzed signal is performed using mathematical models and optimization algorithms.
[0016] Structure-based spatial source localization methods utilize brain anatomical information as prior structural image knowledge, combined with magnetoencephalography (MEG) signals for source localization.
[0017] Source localization is achieved by fusing cross-modal information from both of the above methods and using a position alignment algorithm.
[0018] The input to the localization model is the detected magnetoencephalogram (MEG) signal, and the output is a rearranged and aligned signal matrix, which is the result of localizing the MEG signal source.
[0019] The underlying structure of the localization model is Transformer. Transformer stores data in Tensors and uses self-attention layers to capture the correlation between different positions in the input sequence.
[0020] The model's encoder is used to extract features from the input data, and the decoder is used to generate source localization results; during the construction process, model parameters and hyperparameters need to be adjusted.
[0021] The Transformer model is trained using the extracted feature data; the training process employs self-supervised learning or other unsupervised learning methods, enabling the model to learn information from the raw MRI and MEG data.
[0022] The downsampled MRI structural image is input into the Transformer model, where the rows and columns represent the height and width of the image, respectively.
[0023] In the encoder section, features are extracted from the input image through the encoder layer;
[0024] In each encoder layer, the multi-head self-attention mechanism helps the model capture the correlation information at different locations in the image, while the position-fully connected feedforward network can perform non-linear transformations on the sequence.
[0025] In the Transformer model, the input image needs to be positionally encoded so that the model can recognize information at different locations in the image;
[0026] Positional encoding is achieved by adding positional information to the pixel values of the input image;
[0027] Position encoding is implemented using sin-cos position encoding and linear position encoding methods;
[0028] These location encoding methods enable the model to better capture the correlation information between different locations in the image during training.
[0029] In the decoder part of the Transformer model, the next output can be predicted based on the encoder's output and the already decoded portion;
[0030] The output position information here can be the position information corresponding to each pixel in the input image, or it can be the pixel value at a specific location in the image; at the same time, position index information is obtained; this position information is used for subsequent positioning and alignment of the MEG signal.
[0031] For the preprocessed magnetoencephalogram (MEG) data, a time window threshold for the MEG signal is defined. The MEG signal segments within the window are used as elements of a matrix to obtain the initial source spatial signal distribution of the MEG signal. The signals are then arranged according to the aforementioned structural image rules for feature extraction.
[0032] The matrix elements are defined to include time-domain standard deviation and mean amplitude, frequency-domain power spectral density and frequency components.
[0033] The aforementioned MEG data features, distance features between elements, and location features of MRI structural images are used as inputs into the Transformer model to train a neural network model with an attention mechanism.
[0034] The model encoder extracts the input MRI location information and MEG definition features, and uses a trained model with an attention mechanism to perform source localization analysis on the MEG data, outputting spatial alignment information.
[0035] The results are evaluated by comparing the source localization results with the actual brain structure;
[0036] Evaluate model performance using cross-validation;
[0037] The model is optimized based on the evaluation results.
[0038] For the same sample, the magnetoencephalogram (MEG) data acquired by the same group of sensors within a set time period are sampled. Different time window thresholds are defined to obtain the spatial distribution of MEG source data of different sequences. MEG source localization is performed more than once, and the consistency of the results is verified.
[0039] For different samples, under different times and conditions, the consistency of source localization results is verified according to the above verification process;
[0040] The accuracy of the positioning was verified by using the weak magnetic signal detector and MRI and fMRI to verify the MEG positioning results.
[0041] The beneficial effects of this invention are
[0042] (1) By combining prior MRI imaging information with magnetoencephalography data, cross-modal information fusion can be achieved to improve the accuracy of source localization.
[0043] (2) By leveraging the global contextual awareness of visual attention, long-range dependencies in MEG data can be captured. The attention mechanism enables the model to focus on regions closely related to the source localization task based on the correlation in MEG data, thereby improving localization accuracy.
[0044] (3) The model built by Transformer has parallel computing capabilities that enable it to complete a large amount of data processing in a short time, with good real-time performance and improved computing efficiency.
[0045] (4) For the localization of elements in the matrix, the attention mechanism helps the model resist noise and interference, and improves the robustness of the source localization results.
[0046] This invention improves the accuracy of magnetoencephalography (MEG) source localization by utilizing attention mechanisms and global contextual awareness. As a machine learning method, it optimizes the model using historical data to verify the accuracy and consistency of the localization results. Attached Figure Description
[0047] Figure 1 This is a schematic diagram of the workflow of the present invention;
[0048] Figure 2 This is a schematic diagram of the core data processing for magnetoencephalography (MEG) source localization in this invention. Detailed Implementation
[0049] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0050] To address the challenges of source localization in MEG (Magnetic Encephalography) technology and its practical applications, this invention provides an attention-based method for MEG source localization. Without altering other detector devices or their installation, machine learning methods are used to construct an input-output model for MEG data processing, thereby improving the real-time performance and accuracy of MEG source localization.
[0051] This invention utilizes a magnetic resonance imaging (MRI) scanner to acquire structural MRI images and a superconducting quantum interference device (SQI) or atomic magnetometer to acquire magnetoencephalography (MEG) data. The acquired data undergoes preprocessing, including sparsification of the structural image data and noise and artifact removal from the MEG data. An attention-based source localization model is constructed, and multimodal fusion and multi-feature representation are performed on the MRI structural images and MEG data. The localization model is trained to align and locate the MEG data. Finally, MEG data localization analysis and feedback optimization are conducted, and the accuracy and consistency of the localization results are verified.
[0052] As attached Figure 1 The method flow shown is as follows:
[0053] 1. Acquisition and preprocessing of magnetoencephalography (MEG) signal data
[0054] It should be noted that this invention establishes the necessary measurement environment and key measurement equipment, including a magnetic resonance imaging (MRI) scanner, before acquiring the magnetoencephalogram (MEG) signal. Furthermore, prior to the MEG scan, a dataset of magnetic resonance structural images has been acquired using an MRI scanner, and these magnetic resonance structures are used to reconstruct brain structural images, serving as subsequent reference images and prior information.
[0055] First, weak magnetic field information was measured in an electromagnetically shielded room using a flexible helmet and either a superconducting quantum interference device (SQUID) or an atomic magnetometer (OPM). Magnetoencephalogram (MEG) data from each data channel was then acquired.
[0056] Data preprocessing: The acquired magnetic field signals undergo preprocessing to reduce noise and interference and improve signal quality. Preprocessing methods include filtering for noise reduction, artifact removal, and baseline drift removal. The acquired magnetoencephalogram (MEG) signal matrix M and the preprocessed MEG signal matrix M′ are presented.
[0057] Preprocessing: The initial magnetoencephalogram (MEG) data is passed through a bandpass filter of 0.1Hz-40Hz, such as a Butterworth filter or a Chebyshev filter, to remove low-frequency and high-frequency noise and improve the accuracy of MEG source localization.
[0058] Artifact Removal: Independent Component Analysis (ICA) is used to eliminate artifacts caused by electrooculography (EOG), muscle activity, and environmental electromagnetic interference. The goal of ICA is to separate multiple observed signals into several independent source signals, each representing a specific physiological activity. ICA seeks a linear transformation that makes the transformed components independent of each other. This allows the separation of the aforementioned artifact noise from the magnetoencephalogram (MEG) source signals, thus removing artifacts.
[0059] 2. Magnetoencephalogram (MEG) signal conversion and processing
[0060] Coordinate systems were established for the brain structure images constructed from MRI and the collected magnetoencephalogram datasets, and then transformed. First, they were converted into one-dimensional vectors, and then the matrix scale was defined and converted into two-dimensional matrices, labeled as M and ∑, respectively.
[0061] Define a time window threshold for the magnetoencephalogram (MEG) signal, and use the MEG signal segments within the window as an element of a matrix to obtain the initial source spatial signal distribution of the MEG signal, which is then arranged according to the aforementioned structural image rules.
[0062] 3. Location of magnetoencephalogram (MEG) data source
[0063] Source localization uses mathematical models and optimization algorithms to locate the source of signals after spatial filtering and spectral analysis. These models and algorithms can help determine the location and intensity of brain activity.
[0064] Structure-based spatial source localization methods utilize brain anatomical information, such as MRI images, as prior structural image knowledge, combined with magnetoencephalography (MEG) signals for source localization. This can improve the accuracy and reliability of localization, enabling functional studies of different regions, especially in cases involving brain structural damage or abnormalities.
[0065] This method utilizes the cross-modal information fusion of the two methods and the position alignment algorithm to perform source localization.
[0066] Construction of source localization model
[0067] In this method, the attention mechanism refers to the key technology for sorting matrix points and relocating spatial positions in machine learning models.
[0068] The localization model takes the detected magnetoencephalogram (MEG) signal as input and outputs a rearranged and aligned signal matrix, thus obtaining the result of localizing the MEG signal source.
[0069] The underlying structure of the localization model is the Transformer, whose core is an Encoder-Decoder architecture, comprising an encoding component and a decoding component. The core of the encoding component includes a self-attention layer and a position-wise feed-forward network (FFN). The core of the decoding component includes the aforementioned self-attention layer, feed-forward network, and an attention layer (Encoder-Decoder Attention).
[0070] Transformer uses Tensors to store data and self-attention layers to capture the correlations between different positions in the input sequence.
[0071] The model's encoder extracts features from the input data, while the decoder generates the source localization results. During the model setup process, it's necessary to adjust model parameters and hyperparameters, such as hidden layer dimensions, number of layers, and learning rate.
[0072] The Transformer model is trained using the extracted feature data. The training process employs self-supervised learning or other unsupervised learning methods, enabling the model to learn useful information from the raw MRI and MEG data.
[0073] MRI structural image location coding
[0074] The downsampled MRI structural images are input into the Transformer model, where rows and columns represent the image's height and width, respectively. Pixel values in the image represent the type or density information of the subject's brain tissue.
[0075] In the encoder section, features are extracted from the input image through multiple encoder layers. Within each encoder layer, a multi-head self-attention mechanism helps the model capture the correlation information at different locations in the image, while a positionally fully connected feedforward network performs non-linear transformations on the sequence, further enhancing the feature representation capability.
[0076] In the Transformer model, positional encoding of the input image is required so that the model can recognize information at different locations within the image. Positional encoding is achieved by adding positional information to the pixel values of the input image. Sin-cos positional encoding and linear positional encoding methods are used to implement positional encoding. These methods allow the model to better capture the correlation information between different locations in the image during training.
[0077] In the decoder part of the Transformer model, the next output can be predicted based on the encoder's output and the already decoded portion. The output position information here can be the position information corresponding to each pixel in the input image, or it can be the pixel value at a specific location in the image. Simultaneously, position index information is acquired. This position information is used for subsequent localization and alignment of the MEG signal.
[0078] MEG location alignment
[0079] For the preprocessed magnetoencephalogram (MEG) data, a time window threshold for the MEG signal is defined. The MEG signal segments within the window are used as elements of a matrix to obtain the initial source spatial signal distribution of the MEG signal. The signals are then arranged according to the aforementioned structural image rules for feature extraction.
[0080] The characteristics of the matrix elements are defined as follows: time-domain standard deviation and average amplitude, frequency-domain power spectral density and frequency components.
[0081] The aforementioned MEG data features, distance features between elements, and location features of MRI structural images are used as inputs into the Transformer model to train a neural network model with an attention mechanism.
[0082] The model encoder extracts the input MRI location information and MEG definition features, and uses a trained model with an attention mechanism to perform source localization analysis on the MEG data, outputting spatial alignment information.
[0083] 4. Magnetoencephalogram (MEG) signal analysis and feedback optimization
[0084] The results are evaluated by comparing the source localization results with actual brain structures, such as functional images. Model performance is assessed through cross-validation. Based on the evaluation results, the model is optimized.
[0085] For the same subject, using the same set of sensors to acquire magnetoencephalogram (MEG) data within a certain period of time, different time window thresholds were defined to obtain the spatial distribution of MEG source data of different sequences, and MEG source localization was performed multiple times to verify the consistency of the results.
[0086] For different subjects, at different times and under different conditions, the consistency of source localization results was verified according to the above verification process.
[0087] The accuracy of the positioning was verified by using the weak magnetic signal detector and MRI and fMRI to verify the MEG positioning results.
[0088] This invention utilizes modal information fusion and multi-feature representation of MRI structural image data and MEG data to improve the accuracy of source localization.
[0089] By leveraging the global context awareness capabilities of the Transformer model, which is based on an attention mechanism, long-distance dependencies in MEG data can be captured, reducing localization errors.
[0090] By leveraging the parallel computing capabilities of the Transformer model, large amounts of data can be processed in a shorter time, thus improving computational efficiency.
[0091] The above description is merely a preferred embodiment of the present invention and is used only to illustrate the technical solution of the present invention, and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A method for locating MEG sources based on attention mechanisms, characterized in that, First, magnetic resonance imaging is used to obtain magnetic resonance structural images, and then superconducting quantum interference devices or atomic magnetometers are used to obtain magnetoencephalogram (MEG) data. The acquired data is preprocessed, including sparsification of structural image data and noise and artifact removal from magnetoencephalogram data. Preprocessing using filtering: The initial magnetoencephalogram (MEG) data is passed through a bandpass filter to remove low-frequency and high-frequency noise; during artifact removal, independent component analysis (ICA) is used to eliminate artifacts, separating the observed signal into several independent source signals, each representing a specific physiological activity; by finding a linear transformation that makes the transformed components independent of each other, artifact noise can be separated from the MEG source signals, thereby removing artifacts; Coordinate systems were established for the brain structure images constructed from MRI and the acquired magnetoencephalogram (MEG) datasets, and then transformed. First, the data was converted into one-dimensional vectors, then the matrix scale was defined and converted into a two-dimensional matrix. The time window threshold of the MEG signal was defined, and the MEG signal segments within the window were used as elements of the matrix to obtain the initial source spatial signal distribution of the MEG signal, which was arranged according to the MRI structural images. We constructed an attention-based source localization model, performed multimodal fusion and multi-feature representation on MRI structural images and magnetoencephalography (MEG) data, trained the localization model, and aligned the MEG data for localization. Finally, magnetoencephalography (MEG) data localization analysis and feedback optimization were performed, and the accuracy and consistency of the localization results were verified.
2. The method according to claim 1, characterized in that, The source localization of the spatially filtered and spectrally analyzed signal is performed using mathematical models and optimization algorithms. Structure-based spatial source localization methods utilize brain anatomical information as prior structural image knowledge, combined with magnetoencephalography (MEG) signals for source localization. Source localization is achieved by using cross-modal information fusion and position alignment algorithms.
3. The method according to claim 1, characterized in that, The input to the localization model is the detected magnetoencephalogram (MEG) signal, and the output is a rearranged and aligned signal matrix, which is the result of localizing the MEG signal source. The underlying structure of the localization model is Transformer. Transformer stores data in Tensors and uses self-attention layers to capture the correlation between different positions in the input sequence. The model's encoder is used to extract features from the input data, and the decoder is used to generate source localization results; during the construction process, model parameters and hyperparameters need to be adjusted. The extracted feature data is used to train the Transformer model; The training process employs self-supervised learning or other unsupervised learning methods, enabling the model to learn information from raw MRI and MEG data.
4. The method according to claim 3, characterized in that, The downsampled MRI structural image is input into the Transformer model, where the rows and columns represent the height and width of the image, respectively. In the encoder section, features are extracted from the input image through the encoder layer; In each encoder layer, the multi-head self-attention mechanism helps the model capture the correlation information at different locations in the image, while the position-fully connected feedforward network can perform non-linear transformations on the sequence. In the Transformer model, the input image needs to be positionally encoded so that the model can recognize information at different locations in the image; Positional encoding is achieved by adding positional information to the pixel values of the input image; Position encoding is implemented using sin-cos position encoding and linear position encoding methods; These location encoding methods enable the model to better capture the correlation information of different locations in the image during training; In the decoder part of the Transformer model, the next output can be predicted based on the encoder's output and the already decoded parts.
5. The method according to claim 4, characterized in that, The output position information here can be the position information corresponding to each pixel in the input image, or it can be the pixel value at a specific location in the image; at the same time, position index information is obtained; this position information is used for subsequent positioning and alignment of the MEG signal.
6. The method according to claim 3 or 5, characterized in that, For the preprocessed magnetoencephalogram (MEG) data, a time window threshold for the MEG signal is defined, and the MEG signal segments within the window are used as elements of a matrix to obtain the initial source spatial signal distribution of the MEG signal, which is then arranged and features extracted according to the MRI structural images. The matrix elements are defined to include time-domain standard deviation and mean amplitude, frequency-domain power spectral density and frequency components. The aforementioned MEG data features, distance features between elements, and location features of MRI structural images are used as inputs into the Transformer model to train a neural network model with an attention mechanism. The model encoder extracts the input MRI location information and MEG definition features, and uses a trained model with an attention mechanism to perform source localization analysis on the MEG data, outputting spatial alignment information.
7. The method according to claim 6, characterized in that... The results are evaluated by comparing the source localization results with the actual brain structure; Evaluate model performance using cross-validation; The model is optimized based on the evaluation results.
8. The method according to claim 7, characterized in that For the same sample, the magnetoencephalogram (MEG) data acquired by the same group of sensors within a set time period are sampled. Different time window thresholds are defined to obtain the spatial distribution of MEG source data of different sequences. MEG source localization is performed more than once, and the consistency of the results is verified. For different samples, under different times and conditions, the consistency of source localization results is verified according to the above verification process; The accuracy of the positioning was verified by using the weak magnetic signal detector and MRI and fMRI to verify the MEG positioning results.
Citation Information
Patent Citations
Location method for dynamic neuromagnetic source
CN105212895A
Brain-computer interface instruction issuing method and device based on electroencephalogram and brain magnetism fusion
CN116449964A