Personalized magnetoencephalography signal generation and enhancement for brain-computer interfaces
By integrating paired EEG-MEG data with prior knowledge of electromagnetic neurodynamics, a scenario-adaptive MEG signal generation model was constructed. This solved the problem of personalized generation across task scenarios and subjects, achieving high-precision MEG signal generation and enhancement, and improving the performance of the BCI system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN INST OF ADVANCED TECH CHINESE ACAD OF SCI
- Filing Date
- 2026-05-15
- Publication Date
- 2026-07-24
AI Technical Summary
Existing methods for generating MEG signals lack the ability to adapt to different tasks and scenarios and to generate personalized signals for different subjects. Furthermore, the theoretical modeling is detached from physical constraints, resulting in insufficient accuracy and adaptability of the generated MEG signals in practical applications.
By integrating paired EEG-MEG data with prior knowledge of electromagnetic neurodynamics through end-to-end joint training, a basic model of EEG-MEG representation is constructed. Combined with scene-adaptive fine-tuning and multidimensional neurophysiological fingerprinting, personalized MEG signals are generated.
It achieves high-precision signal generation across mission scenarios and subjects, enhances the spatial resolution and noise resistance of MEG signals, and improves the decoding accuracy and adaptability of the BCI system.
Smart Images

Figure CN122195268B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of non-invasive brain-computer interface technology, and in particular relates to a method for generating and enhancing personalized magnetoencephalogram (MEG) signals for brain-computer interfaces. Background Technology
[0002] As a core hub connecting biological intelligence and machine intelligence, non-invasive brain-computer interface (BCI) technology aims to establish a direct information interaction channel between the human brain and external devices. In recent years, the combination of neuroelectrophysiology and advanced artificial intelligence algorithms has greatly expanded the application boundaries of BCI, enabling breakthroughs in scenarios such as medical rehabilitation, neural situational awareness, and human-machine collaborative work. However, the actual usability of BCI systems is highly dependent on the quality of neural data input. High-quality signal acquisition and multi-dimensional neural feature representation are fundamental to improving BCI performance, significantly affecting the recognition accuracy of BCI decoding algorithms, the real-time nature of control command issuance, and the system's adaptability in diverse application environments.
[0003] In existing non-invasive neural signal acquisition paradigms, electroencephalography (EEG) and magnetoencephalography (MEG) are two of the most core methods for observing electromagnetic physiological signals of the brain. EEG, by non-invasively recording the electrical activity of the cerebral cortex using electrodes placed on the scalp, offers advantages such as ease of operation, low cost, and portability, and is therefore widely used in consumer and clinical BCI systems. However, EEG signals undergo severe volumetric conduction effects when passing through tissues with different conductivities, such as the meninges, skull, and scalp, resulting in low spatial resolution (typical localization error greater than 2 cm) and difficulty in separating independent neural sources from adjacent brain regions. In contrast, MEG records the spatial magnetic field generated by dendritic currents within neurons using highly sensitive sensors deployed outside the head. Because the magnetic field signal is almost unaffected by the conductivity heterogeneity of tissues such as the skull, MEG possesses millimeter-level spatial fidelity and excellent high-frequency dynamic tracking capabilities, demonstrating significant superiority in tasks such as fine motion decoding and source localization. However, traditional high-fidelity MEG devices are extremely expensive to acquire and heavily rely on large magnetically shielded chambers; while emerging portable MEG devices, although reducing size limitations, often face pain points such as sparse channel count and susceptibility to ECG / ECG and environmental magnetic noise interference, making it difficult to provide high-quality signals in everyday real-world scenarios.
[0004] To alleviate the decoding challenges posed by data quality and modality limitations in brain-computer interfaces (BCIs), researchers have conducted extensive research in the fields of BCI signal augmentation and cross-modal generation. However, existing cross-modal generation algorithms largely rely on purely data-driven approaches, with theoretical modeling detached from physical constraints, and lack the ability to adapt to cross-task scenarios and generate personalized data for different subjects. Summary of the Invention
[0005] In view of this, embodiments of this application provide a method, apparatus, computer-readable storage medium, and electronic device for generating and enhancing personalized magnetoencephalogram (MEG) signals for brain-computer interfaces, in order to solve the problems of existing MEG signal generation methods, such as theoretical modeling being detached from physical constraints and lacking cross-task scenario adaptability and cross-subject personalized generation capabilities.
[0006] The first aspect of this application provides a method for generating and enhancing personalized magnetoencephalogram (MEG) signals for brain-computer interfaces, which may include: By integrating paired EEG-MEG data with prior knowledge of electromagnetic neurodynamics through end-to-end joint training, a basic model for EEG-MEG representation is constructed. Based on the aforementioned EEG-MEG representation model, scenario-adaptive fine-tuning is performed for the target brain-computer interface task to obtain a scenario-based model corresponding to the target brain-computer interface task. Based on the aforementioned scenario-based model, the multidimensional neurophysiological fingerprint of the target subject is integrated as a priori guidance to generate the magnetoencephalogram (MEG) signal of the target subject.
[0007] In one specific implementation of the first aspect, the construction of an EEG-MEG-MEG paired data and prior knowledge of electromagnetic neurodynamics through end-to-end joint training to build an EEG-MEG-MEG representation basic model may include: Spatiotemporal topological alignment of the synchronously acquired EEG and MEG signals is performed to obtain the EEG-MEG paired data; By integrating the prior knowledge of electromagnetic neurodynamics, the EEG-MEG pairing data is trained using a self-supervised mask reconstruction task to obtain the basic model of the EEG-MEG representation; wherein, the overall loss of the self-supervised mask reconstruction task is composed of the physical prior reconstruction loss, the source current consistency loss, and the mask self-supervised reconstruction loss in weighted combination.
[0008] In one specific implementation of the first aspect, the step of performing scene-adaptive fine-tuning based on the EEG-MEG representation model to obtain a scene-based model corresponding to the target brain-computer interface task may include: Acquire the electroencephalogram (EEG) signal corresponding to the target brain-computer interface task, and extract the scene-specific global context condition vector from the EEG signal; With paired EEG-MEG data corresponding to the target brain-computer interface task, the pre-training parameters of the diffusion generator and bidirectional encoder are kept frozen, and the bottom feature extraction layer is not updated. Only a low-rank adapter is inserted as a bypass for the semantic feature layer to fit the scene-specific global context condition vector and fine-tuned to obtain the scene-specific model.
[0009] In one specific implementation of the first aspect, it may also include: In the case where only EEG signals corresponding to the target brain-computer interface task are available, the scene-specific global context conditional vector is mapped to scaling and offset factors through a conditional projection network. Based on the scaling factor and the offset factor, a feature affine transformation is performed on the latent representation of the EEG signal to obtain the conditional state variables of the target brain-computer interface task. Guided by the conditional state variables, the EEG-MEG characterization model is used to generate a MEG signal corresponding to the target brain-computer interface task through a diffusion-backward generation process.
[0010] In one specific implementation of the first aspect, the step of generating the magnetoencephalogram (MEG) signal of the target subject based on the scenario-based model and fusing the multidimensional neurophysiological fingerprint of the target subject as prior guidance may include: In the case of only the electroencephalogram (EEG) signals of the target subject, the multidimensional neurophysiological fingerprint is extracted from the EEG signals; Based on the multidimensional neurophysiological fingerprint and the scene-specific global contextual condition vector of the target brain-computer interface task, multi-conditional semantic fusion and feature modulation are performed to obtain the joint conditional variables of the target subject. Guided by the joint conditional variables, the magnetoencephalogram (MEG) signal of the target subject is generated through the diffusion-backward generation process of the scenario-based model.
[0011] In one specific implementation of the first aspect, it may also include: With the EEG-MEG pairing data of the target subject, a physical adjacency matrix reflecting the spatial topological constraints of the sensor is constructed based on the three-dimensional physical coordinate matrix of the MEG sensor of the target subject using the Gaussian radial basis kernel function. Based on the physical adjacency matrix, the initial predicted magnetoencephalogram (MEG) signal generated by the contextualized model is calibrated using a graph attention network to obtain a calibrated MEG signal. Based on the calibrated magnetoencephalogram (MEG) signal and the actual MEG signal of the target subject, the calibration loss of the graph attention network is determined, and the parameters of the graph attention network are optimized based on the calibration loss to obtain the optimized graph attention network. Based on the scenario-based model and the optimized graph attention network, the magnetoencephalogram (MEG) signal of the target subject is generated.
[0012] In one specific implementation of the first aspect, it may also include: In cases where the target subject has paired EEG-MEG data, but the MEG signal has sparse channels or is affected by environmental interference, the latent representation of the EEG signal is used as a cross-modal spatiotemporal anchor point. Spatial graph Laplacian regularization constraints based on channel physical distance are applied during the diffusion reverse generation process to reconstruct super-resolution enhanced MEG signals.
[0013] A second aspect of this application provides a personalized magnetoencephalography (MEG) signal generation and enhancement device for brain-computer interfaces, which may include: The basic model building module is used to construct a basic model of EEG-MEG pairing data and electromagnetic neurodynamics prior knowledge by integrating EEG-MEG pairing data with electromagnetic neurodynamics through end-to-end joint training. The scene adaptive fine-tuning module is used to perform scene adaptive fine-tuning for the target brain-computer interface task based on the EEG-MEG representation basic model, so as to obtain a scene-based model corresponding to the target brain-computer interface task. A personalized magnetoencephalogram (MEG) generation module is used to generate the MEG signal of the target subject based on the scenario-based model and by integrating the multidimensional neurophysiological fingerprint of the target subject as a priori guidance.
[0014] In one specific implementation of the second aspect, the basic model construction module can be specifically used to: perform spatiotemporal topological alignment on synchronously acquired EEG and MEG signals to obtain the EEG-MEG paired data; fuse the prior knowledge of electromagnetic neurodynamics to train the EEG-MEG paired data on a self-supervised mask reconstruction task to obtain the basic model of EEG-MEG representation; wherein, the overall loss of the self-supervised mask reconstruction task is composed of the physical prior reconstruction loss, the source current consistency loss, and the mask self-supervised reconstruction loss in weighted combination.
[0015] In one specific implementation of the second aspect, the scene adaptive fine-tuning module can be specifically used to: acquire the electroencephalogram (EEG) signal corresponding to the target brain-computer interface task, and extract the scene-specific global contextual condition vector from the EEG signal; when there is EEG-MEG pairing data corresponding to the target brain-computer interface task, keep the pre-training parameters of the diffusion generator and bidirectional encoder in a frozen state, and do not update the bottom feature extraction layer, only insert a low-rank adapter for the semantic feature layer bypass to fit the scene-specific global contextual condition vector, and fine-tune to obtain the scene-based model.
[0016] In one specific implementation of the second aspect, the scene adaptive fine-tuning module can also be specifically used to: when only EEG signals corresponding to the target brain-computer interface task are available, map the scene-specific global context condition vector to a scaling factor and an offset factor through a conditional projection network; perform feature affine transformation on the latent representation of the EEG signal according to the scaling factor and the offset factor to obtain the conditional state variables of the target brain-computer interface task; and generate a magnetoencephalogram (MEG) signal corresponding to the target brain-computer interface task through the diffusion inverse generation process of the EEG-MEG representation basic model, guided by the conditional state variables as priors.
[0017] In one specific implementation of the second aspect, the personalized magnetoencephalogram (MEG) generation module can be specifically used to: extract the multidimensional neurophysiological fingerprint from the MEG signal when only the target subject's MEG signal is available; perform multi-conditional semantic fusion and feature modulation based on the multidimensional neurophysiological fingerprint and the scene-specific global contextual condition vector of the target brain-computer interface task to obtain the joint conditional variable of the target subject; and generate the target subject's MEG signal through the diffusion reverse generation process of the scene-based model, guided by the joint conditional variable as a priori.
[0018] In one specific implementation of the second aspect, the personalized magnetoencephalogram (MEG) generation module can further be used to: given the EEG-MEG pairing data of the target subject, construct a physical adjacency matrix reflecting the spatial topological constraints of the sensor using a Gaussian radial basis function based on the three-dimensional physical coordinate matrix of the target subject's MEG sensor; based on the physical adjacency matrix, perform signal calibration on the initial predicted MEG signal generated by the contextualized model using a graph attention network to obtain a calibrated MEG signal; determine the calibration loss of the graph attention network based on the calibrated MEG signal and the actual MEG signal of the target subject, and optimize the parameters of the graph attention network based on the calibration loss to obtain an optimized graph attention network; and generate the MEG signal of the target subject based on the contextualized model and the optimized graph attention network.
[0019] In one specific implementation of the second aspect, the personalized magnetoencephalogram (MEG) generation module can also be specifically used to: when there is EEG-MEG paired data of the target subject, but the MEG signal therein has sparse channels or is subject to environmental interference, use the latent representation of the EEG signal as a cross-modal spatiotemporal anchor point, and apply a spatial graph Laplacian regularization constraint based on channel physical distance in the diffusion reverse generation process to reconstruct a super-resolution enhanced MEG signal.
[0020] A third aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the above-described methods for generating and enhancing personalized magnetoencephalogram (MEG) signals for brain-computer interfaces.
[0021] A fourth aspect of this application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any of the above-described methods for generating and enhancing personalized magnetoencephalogram (MEG) signals for brain-computer interfaces.
[0022] The fifth aspect of this application provides a computer program product that, when run on an electronic device, causes the electronic device to perform the steps of any of the above-described methods for generating and enhancing personalized magnetoencephalogram (MEG) signals for brain-computer interfaces.
[0023] The beneficial effects of this application's embodiments compared to existing technologies are as follows: In this application's embodiments, by fusing paired EEG-MEG data with prior knowledge of electromagnetic neurodynamics, a generalized EEG-MEG representation model with generalization ability and electrophysiological interpretability is constructed to overcome the inherent limitations of purely data-driven algorithms. Based on this foundation, a scenario-adaptive fine-tuning mechanism is designed for the target brain-computer interface task, giving it good cross-task scenario adaptability. Furthermore, by fusing the target subject's multidimensional neurophysiological fingerprint as prior guidance, it possesses good cross-subject personalized generation capabilities. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1This is a flowchart of one embodiment of a personalized magnetoencephalogram (MEG) signal generation and enhancement method for brain-computer interfaces in this application. Figure 2 This is a structural diagram of one embodiment of a personalized magnetoencephalogram (MEG) signal generation and enhancement device for brain-computer interfaces, as described in this application. Figure 3 This is a schematic block diagram of an electronic device according to an embodiment of this application. Detailed Implementation
[0026] To make the inventive objectives, features, and advantages of this application more apparent and understandable, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0027] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0028] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0029] It should also be further understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0030] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [the described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [the described condition or event] is detected," or "in response to detection of [the described condition or event]."
[0031] Furthermore, in the description of this application, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0032] EEG, as a widely used non-invasive neural signal acquisition method, has the advantages of portability and low cost. However, its spatial resolution is limited by the volume conduction effect of the skull and brain tissue, making it difficult to accurately locate the actual electrical activity of the cortex. In contrast, MEG directly records the spatial magnetic field generated by the electrical activity of neurons, which is not affected by the ambiguity effect of the skull. It has extremely high spatial positioning accuracy and rich spectral characteristics, making it a core tool for cutting-edge brain function decoding. However, traditional high-precision MEG acquisition relies on expensive superconducting quantum interference devices and stringent magnetic shielding rooms, which greatly limits its applicability. Even emerging portable MEGs face the dilemma of limited channel count and susceptibility to environmental artifacts. Therefore, constructing a method to generate MEG signals from easily acquired EEG signals across modalities not only has theoretical value but also has clinical and commercial translational potential.
[0033] Existing cross-modal mapping networks heavily rely on purely data-driven fitting, lacking electromagnetic physics priors and struggling to collaboratively model the complex spatiotemporal dynamics of neural signals. Current generative models fail to delve into the multi-scale coupling characteristics of EEG and MEG signals across time, frequency, and spatial domains, and fail to explicitly incorporate the underlying physical coupling relationships revealed by Maxwell's electromagnetic theory into the signal reconstruction optimization objective. This modeling approach, detached from neurophysiological foundations, results in a severe lack of physiological rationality when performing cross-modal feature mapping. Consequently, the generated MEG signals deviate significantly from the actual brain magnetic field distribution characteristics in terms of temporal waveform dynamic evolution and cortical spatial activation coherence, failing to meet the requirements of homologous physical constraints and high-precision neural representation.
[0034] Existing cross-modal mapping networks (BCIs) suffer from severe domain adaptation bottlenecks when facing cross-task paradigm transfer. Practical engineering applications of BCIs heavily rely on extremely diverse task paradigms, and the activation topology and temporal oscillation patterns of cortical neural clusters in subjects exhibit significant differences in underlying data distribution across different task states. Current models often employ full-parameter fine-tuning strategies when adapting to new target scenarios. This mechanism not only incurs enormous computational costs but also readily triggers the catastrophic forgetting effect inherent in deep neural networks, thereby disrupting the shared cortical electromagnetic priors internalized during pre-training.
[0035] Current brain-computer interface (BCI) signal generation and enhancement technologies lack personalized mechanisms tailored to the specific head anatomical geometry and neurophysiological fingerprint characteristics of individual subjects, severely limiting the cross-subject generalization capability of BCI systems. Due to the significant individual heterogeneity among subjects in physical structures such as skull thickness and cortical spatial folding morphology, as well as neurodynamic characteristics such as specific frequency band energy baselines and brain region functional network co-topology, traditional generative models that rely solely on fitting to the population average data distribution struggle to capture these crucial differences. Such methods fail to inject highly individual-specific multidimensional neurophysiological fingerprints and physical spatial geometric mapping relationships as strong prior conditions into the generative network. Consequently, when faced with zero-sample inference environments lacking real MEG data or scenarios with only minimal calibration data, the generated brain signals severely deviate from the subject's actual brain neuroanatomical and physiological dynamics.
[0036] Current technologies lack a joint evaluation system for the physiological interpretability and downstream decoding efficiency of enhanced or generated brain signals. Current validation paradigms for brain signal generation quality rely solely on traditional mathematical statistical errors or temporal waveform correlation coefficients, fundamentally severing the deep, intrinsic connection between the cross-modal reconstruction process of brain signals and the actual BCI decoding task. Such superficial evaluation methods cannot effectively quantify the neurophysiological consistency of cross-modal generated signals in terms of source space cortical current activation distribution and the topological connectivity of multi-node functional networks throughout the brain. Furthermore, this evaluation method cannot objectively and systematically quantify the substantial gains and robustness improvements that super-resolution enhancement or cross-modal mapping brings to the downstream BCI instruction decoding system in terms of actual intent classification accuracy and overall information transmission efficiency.
[0037] In this embodiment, a general EEG-MEG representation model with generalization ability and electrophysiological interpretability is constructed by integrating large-scale EEG-MEG paired data with prior knowledge of neurodynamics, overcoming the inherent limitations of purely data-driven algorithms. Based on this foundation, a scenario-adaptive fine-tuning mechanism is designed for specific BCI interaction tasks. Utilizing a parameter-efficient low-rank adapting network and global contextual conditional modulation prior, high-precision cross-paradigm feature transfer is achieved with extremely low computational overhead, effectively avoiding catastrophic forgetting. To further address the technical bottleneck of cross-subject generalization applications, this embodiment deeply analyzes and extracts individual-specific multidimensional neurophysiological fingerprints, combining multi-conditional semantic fusion and physical space affine calibration mechanisms. In environments with zero samples or very little calibration data lacking target real data, high-fidelity personalized MEG generation and super-resolution enhancement are achieved. Finally, this embodiment constructs a joint evaluation system covering neurophysiological fidelity, multi-scale physical consistency, and downstream task decoding performance, connecting the complete technical chain from physiological-physical mapping to intent decoding. This provides technical support for promoting the large-scale application of low-cost, high-precision portable BCI systems.
[0038] Please see Figure 1 One embodiment of a personalized magnetoencephalography (MEG) signal generation and enhancement method for brain-computer interfaces in this application may include: Step S101: By integrating paired EEG-MEG data with prior knowledge of electromagnetic neurodynamics through end-to-end joint training, a basic model of EEG-MEG representation is constructed.
[0039] In this embodiment of the application, spatiotemporal topology alignment can be performed on synchronously acquired EEG and MEG signals to obtain EEG-MEG paired data.
[0040] Specifically, it can integrate a large amount of synchronously acquired EEG-MEG data, covering diverse mainstream brain-computer interface evoked paradigms and interaction scenarios, such as motor imagery, steady-state visual evoked potentials (SSVEP), and event-related potentials (P300 / ERP). Channel topology alignment technology is used to unify the electrode and sensor layout across different devices, and a high-quality paired training dataset is constructed through spatiotemporal resampling. Simultaneously, MEG samples containing artifact interference and sparse channels are introduced to provide the base model with sufficient neural activity samples across subjects, scenarios, and signal-to-noise ratios.
[0041] In the spatial domain synchronization dimension, individual-level adaptation can be achieved using structural magnetic resonance imaging data of the subject's head or a standard skull template. Let the three-dimensional spatial coordinate matrix of the original EEG electrodes be... The three-dimensional spatial coordinate matrix of the MEG sensor is ,in, and These represent the number of channels for EEG and MEG, respectively. An affine transformation matrix is used to map the physical coordinates of both devices to a standard scalp-cortex reference space, thereby establishing a precise geometric topological mapping relationship for the cross-modal sensor.
[0042] In the time-domain synchronization dimension, system hardware-triggered event stamps can be used to align signal flows under different paradigms, and anti-aliasing low-pass filters can be used to resample to a unified reference sampling rate. To obtain a high-quality spatiotemporal paired data matrix, i.e., EEG signals. With brain magnetic signals ,in, This represents the number of sampling points in the time dimension.
[0043] To construct MEG samples that include artifact interference and sparse channels, a random Boolean mask matrix can be set. With additive noise matrix that follows a Gaussian distribution Damaged MEG sample matrices are generated through a degenerate operation of element-wise multiplication. This simulates the channel loss and environmental interference phenomena in real brain-computer interface applications.
[0044] After obtaining EEG-MEG paired data, prior knowledge of electromagnetic neurodynamics can be integrated to train the EEG-MEG paired data on a self-supervised mask reconstruction task, thereby obtaining the basic model of EEG-MEG representation.
[0045] Specifically, by combining the self-supervised mask reconstruction task of EEG and MEG signals with physical priors based on quasi-static Maxwell's electromagnetic theory, joint optimization of data-driven and physical law constraints is achieved. Compared to a purely data-driven model, this embodiment introduces a forward-guided field matrix to explicitly embed the volume conduction effect, which conforms to real biophysical laws, into the network mapping, significantly reducing the solution space of the highly ill-conditioned inverse problem. This mechanism effectively overcomes the shortcomings of purely data-driven models, which are prone to overfitting to surface sensor noise and specific individual skull geometric features, and enhances the model's generalization ability across subjects. Simultaneously, this design achieves physical coupling and strict alignment of the EEG and MEG bimodal latent representations within the latent source space, thereby constructing a physically interpretable neural representation foundation model for downstream brain-computer interface complex intent decoding and cross-modal signal generation. The overall loss of the self-supervised mask reconstruction task is composed of a weighted joint of the physical prior reconstruction loss, the source current consistency loss, and the mask self-supervised reconstruction loss. Overall Loss Function It can be defined as:
[0046] in, This represents the physical prior reconstruction loss based on the pre-computed lead field matrix. Represents the source current consistency loss in dual-mode operation. This represents the mask self-supervised reconstruction loss based on conditional diffusion networks. and These are hyperparameters used to balance the magnitudes of various optimization gradients.
[0047] Regarding prior physical constraints, a forward-guided field matrix pre-calculated based on Maxwell's quasi-static electromagnetic theory and the boundary element method can be introduced to achieve lightweight embedding of physical laws. Specifically, a parallel bidirectional feature encoder based on a spatiotemporal attention mechanism, namely an EEG feature encoder, can be constructed. With MEG feature encoder The two sets of encoders described above map multi-channel surface sensor signals to a low-dimensional latent source space, obtaining a bimodal neural latent representation:
[0048]
[0049] in, and The latent representation matrix represents the actual acquired EEG and MEG signals, respectively. , The preset number of cortical source dipoles, This represents the number of sampling points in the time dimension. To ensure that the latent representation of the network output is physically equivalent to the main neuron current density in the cortex, this embodiment introduces a pre-calculated EEG lead field matrix. With MEG lead field matrix ,variable and These matrices represent the total number of channels in the EEG and MEG sequences, respectively. They incorporate the subject's skull insulation boundary conditions and the actual physical laws of volumetric conduction. The resulting physical prior reconstruction loss function is:
[0050] in, This represents the squared Frobenius norm of the matrix. This term forces the source current distribution derived in cortical space by the network through linear projection. and After attenuation and refraction through the actual physical conduction matrix, the signal should be consistent with the signal actually observed on the instrument surface. and A perfect match.
[0051] To further eliminate ill-conditioned solutions in high-dimensional space and achieve EEG-EMG feature fusion, this application introduces a source current consistency loss function:
[0052] Both the potential fluctuations and magnetic flux changes recorded on the scalp surface originate from the source currents generated by the synchronous firing of the same batch of pyramidal neurons in the cerebral cortex of the same subject. Therefore, this constraint forces the network to shorten the distance of EEG-MEG features in the three-dimensional physical source space, requiring the derived... and Maintain high consistency to filter artifacts caused by noise from single-modal devices.
[0053] Considering that real cortical neural activity often exhibits high spatial sparsity, the L2-norm-based source current consistency loss function can be replaced with an L1-norm loss function that introduces sparsity constraints. This alternative, by minimizing the absolute error and imposing a latent space sparsity penalty, can more effectively suppress source ambiguity effects in cortical source activity estimation.
[0054] While improving the underlying physical constraints, this application's embodiments introduce an autoencoder prior mechanism and end-to-end optimization of conditional projection networks. When constructing training batches, the covariance features of the task scenario in which the current sample is located can be dynamically extracted. and the neurophysiological fingerprint characteristics of the subjects Utilizing the conditional modulation of the multilayer perceptron network to be trained The joint semantic information containing environmental and individual differences is mapped to a scaling factor for adaptive layer normalization. With offset factor :
[0055] Subsequently, the input MEG latent representation Perform affine transformations on the features to construct conditional guiding variables for the current training state:
[0056] in, Represents element-wise product. The normalization operation represents the representation layer. This mechanism uses subject information and task state as prior knowledge, hard-coded into the microscopic MEG latent representation. Finally, this conditional variable is input into a generator based on a conditional diffusion network. In the middle, the decoder is forced to denoise and reconstruct the MEG prediction signal. The corresponding mask self-supervised reconstruction loss function can be defined as:
[0057] This self-supervised reconstruction process endows the model with the ability to express the spatial topology and noise resistance features of EEG and MEG systems in a general way, and enables the conditional projection network to learn to translate multidimensional physiological conditions across modalities into guiding signals that the diffusion network can understand.
[0058] The first stage process described above serves as the cornerstone of the entire framework. Through end-to-end joint training, it integrates large-scale EEG-MEG paired data with prior knowledge of electromagnetic neurodynamics to construct a general neural activity representation space with strong generalization capabilities. This provides a physiologically constrained model foundation for subsequent scene fine-tuning and personalized MEG generation.
[0059] Step S102: Based on the EEG-MEG representation model, perform scene-adaptive fine-tuning for the target brain-computer interface task to obtain a scene-based model corresponding to the target brain-computer interface task.
[0060] In this embodiment of the application, an EEG signal corresponding to the target brain-computer interface task can be obtained, and a scene-specific global context condition vector can be extracted from the EEG signal.
[0061] Specifically, EEG samples can be collected for new target scenarios, and pre-trained encoders can be used to extract general neural representations. Scene-specific neurodynamic features can be identified through comparative analysis, and scene-specific neural patterns can be automatically captured in a data-driven manner. EEG signal samples of subjects under specific tasks are collected and denoted as... ,in, The number of sampling points for the target scene. Simultaneously, baseline EEG signals were collected from the subject in a resting state, denoted as [missing information]. The two types of EEG signals were respectively input into the EEG feature encoder that had completed end-to-end joint training and frozen the main parameters in the first stage. In the process, the latent representations of the target neural network are extracted respectively. Compared with the baseline neural latent representation Both have dimensions. .
[0062] To accurately perform comparative analysis and identify scene-specific neurodynamic features, a differential mapping method can be used to obtain the neural activation increment matrix between the task state and the resting state. Next, the spatial covariance matrix of the increment matrix is calculated. and the time-domain covariance matrix These are used to quantitatively characterize the topological structure of cortical functional areas specifically activated under specific tasks and the characteristic temporal neural oscillation patterns.
[0063] Furthermore, the aforementioned spatial and temporal covariance matrices can be flattened into one-dimensional vectors and concatenated. These vectors are then input into a feature aggregation network composed of multiple fully connected layers. After nonlinear projection mapping, the resulting dimensionality-reduced scene-specific global context condition vector is output. This serves as a priori guiding condition for data-driven processes in subsequent generative networks, automatically capturing scene-specific neurodynamic patterns, thereby providing highly distinctive task feature priors for downstream brain-computer interface decoding tasks.
[0064] In this embodiment, two scenario-based generation paradigms based on a base model can be executed according to the completeness of available data for the target brain-computer interface task: (1) Fine-tuning of BCI scenario adaptation for EEG-MEG paired data With EEG-MEG paired data corresponding to the target brain-computer interface task, the pre-trained parameters of the diffusion generator and bidirectional encoder can be kept frozen, and the bottom feature extraction layer is not updated. Only a low-rank adapter is inserted as a bypass for the semantic feature layer to fit the scene-specific global context condition vector and fine-tune it to obtain the scene-specific model.
[0065] Specifically, under a task adaptation paradigm with a limited amount of synchronous bimodal EEG-MEG paired data, a parameter-efficient fine-tuning mechanism is triggered. This mechanism, while maintaining the inherent generalization characteristics of the base model, fits new scene features with low computational overhead and follows physical and electromagnetic laws. In this embodiment, a conditional diffusion generator network can be introduced as the core framework, defining the high-fidelity real-world MEG signal distribution in the target scene as... During the forward diffusion noise addition stage, the variance is calculated according to a pre-set table. As time goes by Standard Gaussian noise is gradually injected into the original signal at any time step. The noisy edge distribution is defined as ,in This gradually transforms the MEG signal into a pure noise distribution.
[0066] To ensure that the generative network does not deviate from the true neurophysiological laws during the inverse denoising process, embodiments of this application may introduce physical coupling priors. This is achieved by utilizing pre-computed EEG forward guiding field matrices. Combined with the subject's task-state EEG signals The cortical source current estimation matrix is calculated using an inverse problem solver with Tikhonov regularization. ,in, For regularization parameters, This is the identity matrix. Then, the estimated values... MEG forward guiding field matrix Combined, and setting the conditional guiding variable for the current fine-tuning phase as the extracted target neural latent representation. Construct a neurophysiological consistency regularization loss function:
[0067] in, Represents all time steps and corresponding noisy states The mathematical expectation operator, This represents the sum of squares of the absolute values of the matrix elements. This function constrains the expected value of the noiseless MEG signal predicted by the network. This ensures that it maintains a high degree of consistency with the theoretical MEG signal based on the topological mapping of real physical space.
[0068] Considering that directly applying Tikhonov regularization to the cortical source space requires inverting a dipole space matrix of tens of thousands of dimensions, the computational complexity is extremely high and ill-conditioned. To meet the stringent requirements of BCI systems for real-time performance and extremely low computational cost, this can be replaced by a kernel matrix minimum modulus estimation derivation scheme based on the sensor space dimension. By utilizing the matrix inversion lemma, the inversion of the high-dimensional source space is equivalently transferred to the low-dimensional sensor space, significantly reducing computational complexity while maintaining physical equivalence.
[0069] Regarding the network weight update strategy, the pre-trained parameters of the diffusion generator backbone and the bidirectional encoder can be kept frozen, and low-rank adapters can be inserted only for the bypass of the mid-to-high-level semantic feature layers. Let the... The original pre-trained weight matrix of the layer is Introducing a parameter increment matrix consisting of the product of two low-rank matrices. The dimension-reduced projection matrix is The upgraded projection matrix is , and rank Fine-tuning the forward propagation feature calculation reconstructs it into... ,in, For input features, The scaling factor is used. The overall optimization objective of the fine-tuning phase is a weighted fusion of the generation loss and the physical loss. ,in, This is the penalty coefficient. Using the backpropagation mechanism, it is calculated based on the learning rate. Independently compute gradients and update local parameter subsets :
[0070]
[0071] in, For learning rate, For gradient operators, represents the partial derivative of the loss function with respect to a specific parameter matrix.
[0072] By optimizing only the incremental parameters in the low-rank space, this mechanism ensures that the system can quickly and accurately adapt to the new control paradigm of the target brain-computer interface with extremely low computational overhead, while effectively avoiding the catastrophic forgetting of the original shared general representation of cortical dynamics, thus balancing the real-time computational efficiency and instruction decoding generalization performance of the online brain-computer system.
[0073] (2) MEG generation specific to BCI scenarios with only EEG data With only EEG signals corresponding to the target brain-computer interface task available, zero-sample cross-modal generation can be performed directly using the generalization ability of the first-stage basic model and the prior of the high-dimensional electromagnetic manifold, without using parameter fine-tuning procedures.
[0074] Specifically, to establish conditional constraints for the diffusion network, the scene-specific global context condition vector constructed above can be extracted. To avoid dimensionality mismatch issues caused by direct concatenation, this application embodiment can introduce an adaptive layer normalization mechanism to modulate the input features. The scene-specific global context conditional vector is mapped to scaling and offset factors through a conditional projection network, i.e., the conditional projection network in the base model trained in the first stage is used. , scene condition vector With zero-initialized pseudo-physiological fingerprint vector The data is concatenated and mapped to scaling and offset factors that match the dimensions of the EEG latent representation:
[0075] in, and Channel number and cortical source space dimension Maintain consistency.
[0076] Subsequently, the latent representation of the EEG signal can be derived based on the scaling factor and the offset factor. Perform affine transformations on the features to obtain the conditional state variables for the target brain-computer interface task:
[0077] in, This represents element-wise matrix multiplication. Representative layer normalization operation.
[0078] Building upon this, guided by conditional state variables, a MEG signal corresponding to the target brain-computer interface task can be generated through a diffusion-based inverse generation process of the EEG-MEG representation base model. Specifically, an inverse denoising network with its parameters frozen can be activated. The generation process begins with a random noise state and initializes a pure noise matrix that follows a standard normal distribution. During the iterative process of reverse denoising, the network Condition variables modulated by scenario prior Guided by this, predict and gradually strip away the current time step. The corresponding noise distribution. Its core diffusion-reverse generation loss logic is expressed as:
[0079] in, Represents the mathematical expectation operator. This represents the injected Gaussian noise. This represents the initial high-fidelity, noise-free signal used to generate the target. For the forward diffusion process at time step The corresponding cumulative noise retention parameter, This represents the sum of squares of the absolute values of all elements in the matrix. The logically constrained network accurately estimates the injected Gaussian noise. Through multiple consecutive time steps The iterative denoising calculation ultimately transforms the initial disordered pure noise. The signal is reconstructed into a high-fidelity MEG signal that conforms to a specific task mode and is highly aligned with the spatiotemporal topology of the input single-mode EEG.
[0080] The second stage described above builds upon the cross-modal representation foundation model constructed in the first stage. It designs flexible task adaptation and generalization inference mechanisms to address the complex and varied specific task scenarios in downstream applications of brain-computer interfaces. This not only provides a network foundation with scenario-based priors for the next stage but also possesses scenario-level generation capabilities. Depending on the completeness of the dataset, it can directly generate MEGs for specific scenarios through bimodal fine-tuning or unimodal generalization.
[0081] Step S103: Based on the scenario-based model, the multidimensional neurophysiological fingerprint of the target subject is integrated as a priori guidance to generate the magnetoencephalogram signal of the target subject.
[0082] This embodiment operates based on the second-stage scene adaptation output. At this point, feature extraction for a specific BCI task has been achieved through a fine-tuned low-rank adaptation network or extracted scene conditional priors. This embodiment can use these network parameters or prior cues with accompanying scene features as a unified scene base, further introducing a personalized generation mechanism tailored to individual differences in the subject's head geometry and neurodynamics. Depending on the completeness of available data for the target subject, three scene-based personalized generation and enhancement paradigms are executed, outputting personalized MEG signals: (1) Zero-sample personalized MEG generation based on neurophysiological fingerprints In cases where only the target subject's EEG signal is available, a multidimensional neurophysiological fingerprint can be extracted from the EEG signal and used as a priori guide. Let the target subject's EEG signal be... First, the power spectral density of the EEG signal is calculated in the frequency domain to extract the classical frequency bands (such as...). The baseline characteristics of ) are denoted as the frequency domain feature matrix. ,in, The number of frequency bands is determined. Secondly, in the spatial topology dimension, by calculating the Pearson correlation coefficient or phase-locking value between channels, the unique brain region network cooperative topology of the subject is characterized, and the spatial functional connectivity matrix is obtained. .
[0083] Flatten the above frequency domain features and spatial connectivity features ( And perform multimodal feature fusion, through a multilayer perceptron (...) Mapping generates highly personalized multidimensional neurophysiological fingerprint vectors. :
[0084] Subsequently, multi-conditional semantic fusion and feature modulation can be performed based on the multi-dimensional neurophysiological fingerprint and the scene-specific global contextual condition vector of the target brain-computer interface task to obtain the joint conditional variables of the target subject.
[0085] Specifically, in order to incorporate multidimensional neurophysiological fingerprints Compared with the scene-specific global context condition vector extracted in the second stage Using both as prior guidance and without compromising the input dimension requirements of the pre-trained diffusion model, the embodiments of this application can employ a multi-condition semantic fusion and feature modulation strategy.
[0086] Conditional projection network using the frozen weights of the first-stage base model The concatenated features of individual fingerprints and scene context are used as input to generate modulation parameters specific to the subject and the current task. Subsequently, an adaptive layer normalization (AdaLN) mechanism is used to fuse the EEG latent representation into individualized and scene-specific features, constructing joint conditional variables. :
[0087]
[0088] After obtaining the joint condition variables, the MEG signal of the target subject can be generated through the diffusion-backward generation process of the scenario-based model, guided by the joint condition variables as a priori.
[0089] Specifically, joint condition variables can be injected as strongly guided priors into the conditional diffusion network. In the cross-modal generation stage, the inverse denoising process uses pure noise. Starting from this point, the logic follows a reverse diffusion generation process:
[0090] By utilizing the high-dimensional electromagnetic manifold internalized by this network, MEG signals that conform to the subject's unique neural dynamic patterns and anatomical structures can be directly generated across modalities, thereby providing the subject with a personalized brain-computer interface signal feature source under the harsh condition of zero training data.
[0091] (2) Personalized MEG generation based on small sample EEG-MEG paired data calibration With EEG-MEG paired data of the target subject, a physical adjacency matrix reflecting the spatial topological constraints of the sensor can be constructed using a Gaussian radial basis function based on the three-dimensional physical coordinate matrix of the target subject's MEG sensor. Based on the physical adjacency matrix, the initial predicted MEG signal generated by the contextualization model is calibrated using a graph attention network to obtain a calibrated MEG signal. The calibration loss of the graph attention network is determined based on the calibrated MEG signal and the actual MEG signal of the target subject, and the parameters of the graph attention network are optimized based on the calibration loss to obtain an optimized graph attention network. Based on the contextualization model and the optimized graph attention network, the MEG signal of the target subject is generated.
[0092] Specifically, in the context of synchronous EEG-MEG paired data for a small number of target subjects. In fine-tuning scenarios, differences in skull thickness, cortical folding patterns, and sensor placement between individuals can lead to highly nonlinear and locally spatially correlated volumetric conduction distortion. To correct this positive physical mapping bias without disrupting the deep semantic weights of the base model, embodiments of this application can use a graph attention network based on the spatial physical distance of the sensor.
[0093] First, based on the true three-dimensional physical coordinate matrix of the target subject's MEG sensor. A physical adjacency matrix reflecting the spatial topological constraints of the sensor is constructed using Gaussian radial basis kernel functions. Its matrix elements Defined as:
[0094] in, and Representing the first With the The three-dimensional spatial coordinates of each sensor To control the bandwidth parameter of the physical sensing receptive field, this adjacency matrix explicitly encodes the physical law of the continuous distribution of the electromagnetic field in three-dimensional space and its attenuation with distance into the network topology.
[0095] Subsequently, the initial predicted MEG signal generated by the scene diffusion model is denoted as... , construct from parameters Controlled graph attention operator When performing individualized calibration of the predicted signal for a specific channel, this operator is affected by the adjacency matrix. The constraint involves nonlinear attention aggregation of channel features that are physically adjacent to each other, thereby outputting a calibrated MEG signal tailored to a specific subject. :
[0096] Finally, the individual-specific graph network topology calibration loss is calculated using real pairing data:
[0097] in, The squared Frobenius norm of the matrix is used to constrain the data fidelity of microscopic time-domain waveforms; These are L2 regularization weights used to constrain parameters. To prevent overfitting with small samples, during the small sample calibration phase, all parameters of the base network and scene adapter are strictly fixed, and gradients are calculated and parameters are optimized independently only. :
[0098] After anchoring the subject-specific three-dimensional spatial mapping manifold through a very small number of real paired samples, in the actual online application stage, the system only needs to input a single-modal EEG, and can generate a personalized MEG signal with high spatial fidelity through a fine-tuned graph attention network.
[0099] (3) MEG signal super-resolution enhancement for low-quality EEG-MEG paired data In cases where there is EEG-MEG paired data of the target subject, but the MEG signal is sparse or affected by environmental interference, the latent representation of the EEG signal can be used as a cross-modal spatiotemporal anchor point. Spatial graph Laplacian regularization constraints based on channel physical distance can be applied during the diffusion inverse generation process to reconstruct the super-resolution enhanced MEG signal.
[0100] Specifically, in augmentation scenarios where paired data is available but MEG signals suffer from sparse channels or severe environmental interference, a damaged MEG sample matrix can be extracted. The embodiments of this application rely on the aforementioned diffusion denoising network calibrated for scene and individual structure to avoid additional training overhead.
[0101] During the enhancement process, the high signal-to-noise ratio synchronous EEG signal can be latently represented. As a cross-modal spatiotemporal anchor, a masked low-quality MEG co-input denoising network is jointly mapped to a high-resolution standard grid. To ensure the smoothness of the reconstructed signal in spatial topology and the regularity of cortical physical proximity, a spatial graph Laplacian regularization mechanism is used. First, the physical three-dimensional spatial coordinates of the MEG sensor are... The sensor spatial adjacency matrix is constructed using the Gaussian kernel function. Its elements And calculate the degree matrix. Thus, the Laplace matrix is defined. .
[0102] Considering that static adjacency matrices constructed using Gaussian kernel functions cannot capture dynamic changes in brain region functional connectivity, they can be replaced with a data-driven dynamic graph adjacency matrix construction scheme based on self-attention mechanisms. This scheme uses network adaptive learning to predict high-dimensional feature similarities between channel signals, thereby constructing a Laplace matrix that can dynamically evolve with neural activity.
[0103] In the inverse generation iteration of the diffusion model, for the predicted multi-channel MEG signal Apply graph Laplacian regularization constraints:
[0104] in, Represents the Laplacian regularization loss. The trace of a matrix is the sum of the elements on the main diagonal of the square matrix. This represents the transpose of the predicted MEG signal matrix. This constraint requires that physically adjacent MEG sensor channels output similar signal waveforms to ensure spatial smoothness. The overall objective function for super-resolution enhancement is expressed as:
[0105] in, The overall objective function representing super-resolution enhancement, The inverse generation loss represents the diffusion model. The coefficients represent spatial smoothing control. By combining cross-modal spatiotemporal anchor guidance with Laplace spatial constraints, missing MEG channels are accurately filled and additive noise is filtered out, reconstructing super-resolution enhanced MEG data.
[0106] The aforementioned third-stage process operates based on the second-stage scene adaptive fine-tuning module. Through the low-rank adaptation network fine-tuned in the second stage or the extracted scene conditional priors, feature extraction for specific task patterns has been successfully achieved. In this embodiment, these network parameters or prior cues with accompanying scene features are used as a unified scene base, further introducing a personalized generation mechanism tailored to individual differences in the subject's head geometry and neurodynamics. Depending on the completeness of available data for the target subject, three scene-based personalized generation paradigms are executed, ultimately outputting a high-fidelity MEG signal.
[0107] Furthermore, in this embodiment, a multi-dimensional signal quality and decoding evaluation framework for brain-computer interface applications is constructed to verify the actual improvement effect of generated MEG or enhanced real MEG signals on downstream tasks of brain-computer interfaces. By introducing multi-level quantitative indicators covering the underlying physical features of the signal, cortical network topology, and high-level task semantics, the decoding applicability of cross-modal generation and same-modal enhancement features is established. (1) Neurophysiological fidelity and homomodal enhancement quality assessment The embodiments of this application can quantitatively quantify the physiological rationality of the generated signal in spatial, spectral, and temporal dimensions. Regarding the fidelity of the time-domain waveform, the generated MEG signal is calculated. With ideal high-fidelity real MEG signal The Pearson correlation coefficient and relative root mean square error between them. The time-dimensional series means are set as follows: and The correlation coefficient is measured by the following formula:
[0108] For same-modal MEG enhancement scenarios, the performance of noise reduction and super-resolution enhancement can be further quantized. This involves calculating noisy, damaged samples. initial signal-to-noise ratio With the reconstructed output signal signal-to-noise ratio ,in accordance with Evaluate the effectiveness of environmental artifact filtering. For physical nodes that are removed due to channel sparsity or severe interference, a random Boolean mask matrix defined in the first stage can be used. Where a value of 0 represents a region with missing channels, the spatial topology recovery error on the set of unobserved nodes is calculated separately:
[0109] This error calculation mechanism avoids the dilution of evaluation metrics by known channels and accurately measures the reconstruction accuracy of graph Laplacian regularization in sparse space interpolation.
[0110] (2) Quantitative assessment of cross-modal multi-scale physical consistency This application's embodiments can examine the consistency between synthesized or enhanced MEGs and real high-fidelity MEGs at two scales: local cortical source activation and whole-brain network connectivity. At the cortical source current distribution scale, the MEG forward guiding field matrix is used... By having the same regularization parameter The inverse problem solver backprojects the real MEG and the generated MEG onto a preset object, respectively. A cortical source dipole space is used to obtain the true source current distribution matrix. With the predicted source current distribution matrix Through calculation and The spatial correlation between them is used to verify whether the cross-modal eigenmaps follow the physical constraints of electromagnetic common source.
[0111] At the functional connectivity brain network scale, for the acquired source spatial signals and Phase-locked values or bandpass-filtered envelope correlations between nodes in each brain region of interest are extracted, and adjacency matrices of real and generated whole-brain functional connectivity networks are constructed respectively. and The Frobenius norm is used to measure the deviation of network topological characteristics:
[0112] This indicator is used to verify whether the generated signal retains the complex network coordination mechanism at the bottom of the individual's brain, ensuring that the enhanced signal can serve as a substitute input for high-quality brain physiological signals.
[0113] (3) Validation of downstream tasks of brain-computer interface This application embodiment can use actual decoding performance as the final evaluation criterion to compare task performance under different signal qualities and input configurations. The original single EEG input... Low-quality MEG input and the enhanced high-fidelity MEG features. The data is input into a pre-defined standard brain-computer interface decoder. In a specific brain-computer interface task, the accuracy of classification decoding is calculated. ,in, The sample size of the test set. As input features, This is a label representing the true intent. To comprehensively evaluate communication efficiency, the information transmission rate is calculated.
[0114] in, The time window size for a single trial. The total number of categories for the classification target. This represents the actual classification accuracy.
[0115] Furthermore, by controlling the amount of paired data samples involved in fine-tuning calibration, convergence curves of accuracy versus calibration data volume under different modality configurations can be plotted. The specific gains of this enhancement method in shortening calibration time for new users and improving robustness in cross-subject transfer scenarios are quantified, thereby verifying the practical value of this feature enhancement framework in improving the overall decoding performance of brain-computer interfaces.
[0116] The core advantage of this application lies in proposing a personalized MEG cross-modal generation and signal enhancement method based on a three-layer architecture. Existing cross-modal brain signal processing technologies often struggle to simultaneously address the physical plausibility of the generated data, the complexity of downstream tasks, and individual differences among subjects. This application systematically solves the technical bottleneck in practical BCI applications caused by limited decoding performance due to missing MEG signals, significant differences in subject anatomical structures, and severe environmental interference by constructing a progressive three-layer architecture of "general basic representation - scene-adaptive fine-tuning - individualized precise generation." Existing neural representation basic models rely on pure data-driven approaches, which are prone to overfitting to surface sensor noise or specific skull geometric features, resulting in a lack of biophysical interpretability in the generated neural signals. This application innovatively combines electromagnetic neurodynamic physical priors, such as the forward-guided field matrix based on Maxwell's theory, with large-scale EEG-MEG paired data to force the bimodal latent representation to map to a shared cortical source activity space, significantly reducing the solution space of the highly pathological inverse problem. By combining the self-supervised mask reconstruction task, this module endows the model with the ability to express complex spatiotemporal topology and noise resistance features in a general way, laying a solid physiological model foundation for subsequent cross-scenario and cross-subject applications.
[0117] To address the challenges of diverse downstream applications of brain-computer interfaces, such as paradigm shifts between motor imagery and visual stimulation, existing methods often require full-scale model fine-tuning. This is not only computationally expensive but also prone to catastrophic forgetting of existing general representations. This application addresses this issue by designing a scenario-specific neurodynamic feature extraction mechanism to quantitatively capture the spatiotemporal topology and temporal oscillation patterns under specific tasks. In terms of parameter update strategy, a lightweight low-rank adapter and physically coupled priors are cleverly introduced. With the backbone network completely frozen, new scenarios can be accurately fitted using only a minimal subset of parameters. Furthermore, when only single-modal EEG data is available, zero-sample cross-modal generation can be directly performed based on conditional priors, perfectly balancing the computational efficiency and decoding generalization performance of the online system.
[0118] Due to significant differences in skull thickness, cortical folding morphology, and sensor placement among different subjects, signals generated by general models often fail to accurately match individual characteristics. This application provides flexible and progressive personalized solutions for different data completeness levels: In the pure EEG zero-sample scenario, it innovatively extracts individual multidimensional neurophysiological fingerprints containing frequency band baselines and spatial connectivity as prior guidance for generating a unique MEG; in the small-sample scenario, it introduces a graph attention calibration network based on sensor spatial physical distance, using the physical adjacency matrix to force the network to perform nonlinear attention aggregation only on its physically neighboring nodes when correcting target channel features; in the low-quality paired data scenario, it uses high-frequency EEG latent representations as spatiotemporal anchors, combined with a graph Laplacian regularization mechanism, to strictly ensure the spatial smoothness and cortical physical proximity patterns of the generated signals, achieving high-precision super-resolution enhancement of severely damaged or channel-deficient MEG signals.
[0119] Based on the high-fidelity MEG features generated or enhanced by the aforementioned three-layer architecture, the embodiments of this application effectively overcome the shortcomings of single-modal EEG in terms of spatial resolution. In downstream actual intent decoding tasks, compared with single EEG input or low-quality signal input, the multi-dimensional joint representation provided by the embodiments of this application shows superior performance in physiological fidelity, source spatial physical consistency, and functional network synergy. This not only fundamentally improves the classification decoding accuracy and information transmission rate of the brain-computer interface system, but also significantly shortens the cross-subject calibration time for new users, greatly promoting the implementation and practical application of high-performance non-invasive brain-computer interfaces.
[0120] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0121] Corresponding to the personalized magnetoencephalography (MEG) signal generation and enhancement method for brain-computer interfaces described in the above embodiments, Figure 2 This illustration shows a structural diagram of an embodiment of a personalized magnetoencephalogram (MEG) signal generation and enhancement device for brain-computer interfaces provided in this application.
[0122] In this embodiment, a personalized magnetoencephalogram (MEG) signal generation and enhancement device for brain-computer interfaces may include: The basic model building module 201 is used to construct a basic model of EEG-MEG pairing data and electromagnetic neurodynamics prior knowledge by fusing EEG-MEG pairing data and electromagnetic neurodynamics through end-to-end joint training. The scene adaptive fine-tuning module 202 is used to perform scene adaptive fine-tuning for the target brain-computer interface task based on the EEG-MEG representation basic model, so as to obtain a scene-based model corresponding to the target brain-computer interface task. The personalized magnetoencephalogram (MEG) generation module 203 is used to generate the MEG signal of the target subject based on the scenario-based model and by fusing the multidimensional neurophysiological fingerprint of the target subject as a priori guidance.
[0123] In one specific implementation of this application, the basic model construction module can be specifically used to: perform spatiotemporal topological alignment on synchronously acquired EEG signals and MEG signals to obtain the EEG-MEG paired data; fuse the prior knowledge of electromagnetic neurodynamics to train the EEG-MEG paired data on a self-supervised mask reconstruction task to obtain the EEG-MEG representation basic model; wherein, the overall loss of the self-supervised mask reconstruction task is composed of the physical prior reconstruction loss, the source current consistency loss, and the mask self-supervised reconstruction loss in weighted combination.
[0124] In one specific implementation of this application, the scene adaptive fine-tuning module can be specifically used to: acquire an EEG signal corresponding to the target brain-computer interface task, and extract a scene-specific global contextual condition vector from the EEG signal; when there is EEG-MEG pairing data corresponding to the target brain-computer interface task, keep the pre-training parameters of the diffusion generator and bidirectional encoder in a frozen state, and do not update the bottom feature extraction layer, only insert a low-rank adapter for the semantic feature layer bypass to fit the scene-specific global contextual condition vector, and fine-tune to obtain the scene-based model.
[0125] In one specific implementation of this application, the scene adaptive fine-tuning module can be further configured to: when only EEG signals corresponding to the target brain-computer interface task are available, map the scene-specific global context condition vector to a scaling factor and an offset factor through a conditional projection network; perform feature affine transformation on the latent representation of the EEG signal according to the scaling factor and the offset factor to obtain the conditional state variables of the target brain-computer interface task; and generate a magnetoencephalogram (MEG) signal corresponding to the target brain-computer interface task through the diffusion inverse generation process of the EEG-MEG representation basic model, guided by the conditional state variables as priors.
[0126] In one specific implementation of this application, the personalized magnetoencephalogram (MEG) generation module can be specifically used to: extract the multidimensional neurophysiological fingerprint from the MEG signal when only the target subject's MEG signal is available; perform multi-conditional semantic fusion and feature modulation based on the multidimensional neurophysiological fingerprint and the scene-specific global contextual condition vector of the target brain-computer interface task to obtain the joint conditional variable of the target subject; and generate the target subject's MEG signal through the diffusion reverse generation process of the scene-based model, guided by the joint conditional variable as a priori.
[0127] In one specific implementation of this application, the personalized magnetoencephalogram (MEG) generation module can be further configured to: given the EEG-MEG pairing data of the target subject, construct a physical adjacency matrix reflecting the spatial topological constraints of the sensor using a Gaussian radial basis function based on the three-dimensional physical coordinate matrix of the target subject's MEG sensor; calibrate the initial predicted MEG signal generated by the contextualized model using a graph attention network based on the physical adjacency matrix to obtain a calibrated MEG signal; determine the calibration loss of the graph attention network based on the calibrated MEG signal and the actual MEG signal of the target subject, and optimize the parameters of the graph attention network based on the calibration loss to obtain an optimized graph attention network; and generate the MEG signal of the target subject based on the contextualized model and the optimized graph attention network.
[0128] In one specific implementation of this application, the personalized magnetoencephalogram (MEG) generation module can also be specifically used to: when there is EEG-MEG paired data of the target subject, but the MEG signal therein has sparse channels or is subject to environmental interference, use the latent representation of the EEG signal as a cross-modal spatiotemporal anchor point, and apply spatial graph Laplacian regularization constraints based on channel physical distance in the diffusion reverse generation process to reconstruct super-resolution enhanced MEG signals.
[0129] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0130] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0131] Figure 3 A schematic block diagram of an electronic device provided in an embodiment of this application is shown. For ease of explanation, only the parts related to the embodiment of this application are shown.
[0132] like Figure 3 As shown, the electronic device 3 in this embodiment includes: a processor 30, a memory 31, and a computer program 32 stored in the memory 31 and executable on the processor 30. When the processor 30 executes the computer program 32, it implements the steps in the various embodiments of the personalized magnetoencephalography (MEG) signal generation and enhancement methods for brain-computer interfaces described above, for example... Figure 1 Steps S101 to S103 are shown. Alternatively, when the processor 30 executes the computer program 32, it implements the functions of each module / unit in the above-described device embodiments, for example... Figure 2 The functions of modules 201 to 203 are shown.
[0133] For example, the computer program 32 may be divided into one or more modules / units, which are stored in the memory 31 and executed by the processor 30 to complete this application. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program 32 in the electronic device 3.
[0134] The electronic device 3 may include, but is not limited to, computing devices such as desktop computers, laptops, handheld computers, and servers. Those skilled in the art will understand that... Figure 3 This is merely an example of electronic device 3 and does not constitute a limitation on electronic device 3. It may include more or fewer components than shown, or combine certain components, or different components. For example, electronic device 3 may also include input / output devices, network access devices, buses, etc.
[0135] The processor 30 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0136] The memory 31 can be an internal storage unit of the electronic device 3, such as a hard disk or memory. The memory 31 can also be an external storage device of the electronic device 3, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 3. Furthermore, the memory 31 can include both internal and external storage units of the electronic device 3. The memory 31 is used to store the computer program and other programs and data required by the electronic device 3. The memory 31 can also be used to temporarily store data that has been output or will be output.
[0137] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0138] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0139] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0140] In the embodiments provided in this application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings or direct couplings or communication connections may be through some interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0141] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0142] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0143] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable storage medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc. It should be noted that the content included in the computer-readable storage medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable storage medium does not include electrical carrier signals and telecommunication signals.
[0144] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for generating and enhancing personalized magnetoencephalogram (MEG) signals for brain-computer interfaces, characterized in that, include: By fusing paired EEG-MEG data with prior knowledge of electromagnetic neurodynamics through end-to-end joint training, a basic model for EEG-MEG representation is constructed. This includes: performing spatiotemporal topological alignment on synchronously acquired EEG and MEG signals to obtain the paired EEG-MEG data; and fusing the prior knowledge of electromagnetic neurodynamics to train the paired EEG-MEG data using a self-supervised mask reconstruction task to obtain the basic EEG-MEG representation model. The overall loss of the self-supervised mask reconstruction task is composed of a weighted combination of physical prior reconstruction loss, source current consistency loss, and mask self-supervised reconstruction loss. Acquire the EEG signal corresponding to the target brain-computer interface task, and extract the scene-specific global context condition vector from the EEG signal; when there is EEG-MEG pairing data corresponding to the target brain-computer interface task, keep the pre-training parameters of the diffusion generator and bidirectional encoder in a frozen state, and do not update the bottom feature extraction layer. Only insert a low-rank adapter for the semantic feature layer bypass to fit the scene-specific global context condition vector, and fine-tune to obtain the scene-specific model corresponding to the target brain-computer interface task; In the case where only the EEG signal of the target subject is available, a multidimensional neurophysiological fingerprint is extracted from the EEG signal of the target subject; based on the multidimensional neurophysiological fingerprint and the scene-specific global contextual condition vector of the target brain-computer interface task, multi-conditional semantic fusion and feature modulation are performed to obtain the joint conditional variable of the target subject; with the joint conditional variable as a priori guide, the magnetoencephalogram (MEG) signal of the target subject is generated through the diffusion inverse generation process of the scene-based model.
2. The method for generating and enhancing personalized magnetoencephalogram (MEG) signals for brain-computer interfaces according to claim 1, characterized in that, Also includes: In the case where only EEG signals corresponding to the target brain-computer interface task are available, the scene-specific global context conditional vector is mapped to scaling and offset factors through a conditional projection network. Based on the scaling factor and the offset factor, a feature affine transformation is performed on the latent representation of the EEG signal to obtain the conditional state variables of the target brain-computer interface task. Guided by the conditional state variables, the EEG-MEG characterization model is used to generate a MEG signal corresponding to the target brain-computer interface task through a diffusion-backward generation process.
3. The method for generating and enhancing personalized magnetoencephalogram (MEG) signals for brain-computer interfaces according to claim 1, characterized in that, Also includes: With the EEG-MEG pairing data of the target subject, a physical adjacency matrix reflecting the spatial topological constraints of the sensor is constructed based on the three-dimensional physical coordinate matrix of the MEG sensor of the target subject using the Gaussian radial basis kernel function. Based on the physical adjacency matrix, the initial predicted magnetoencephalogram (MEG) signal generated by the contextualized model is calibrated using a graph attention network to obtain a calibrated MEG signal. Based on the calibrated magnetoencephalogram (MEG) signal and the actual MEG signal of the target subject, the calibration loss of the graph attention network is determined, and the parameters of the graph attention network are optimized based on the calibration loss to obtain the optimized graph attention network. Based on the scenario-based model and the optimized graph attention network, the magnetoencephalogram (MEG) signal of the target subject is generated.
4. The method for generating and enhancing personalized magnetoencephalogram (MEG) signals for brain-computer interfaces according to any one of claims 1 to 3, characterized in that, Also includes: In cases where the target subject has paired EEG-MEG data, but the MEG signal has sparse channels or is affected by environmental interference, the latent representation of the EEG signal is used as a cross-modal spatiotemporal anchor point. Spatial graph Laplacian regularization constraints based on channel physical distance are applied during the diffusion reverse generation process to reconstruct super-resolution enhanced MEG signals.
5. A personalized magnetoencephalography (MEG) signal generation and enhancement device for brain-computer interfaces, characterized in that, include: The basic model construction module is used to construct a basic EEG-MEG representation model by fusing paired EEG-MEG data and prior knowledge of electromagnetic neurodynamics through end-to-end joint training. This includes: performing spatiotemporal topological alignment on synchronously acquired EEG and MEG signals to obtain the paired EEG-MEG data; fusing the prior knowledge of electromagnetic neurodynamics to train the paired EEG-MEG data using a self-supervised mask reconstruction task to obtain the basic EEG-MEG representation model; wherein the overall loss of the self-supervised mask reconstruction task is jointly composed of physical prior reconstruction loss, source current consistency loss, and mask self-supervised reconstruction loss according to weights. The scene-adaptive fine-tuning module is used to acquire EEG signals corresponding to the target brain-computer interface task and extract scene-specific global contextual condition vectors from the EEG signals. When there is EEG-MEG pairing data corresponding to the target brain-computer interface task, the pre-training parameters of the diffusion generator and bidirectional encoder are kept frozen, and the bottom feature extraction layer is not updated. Only a low-rank adapter is inserted as a bypass for the semantic feature layer to fit the scene-specific global contextual condition vector and fine-tun it to obtain a scene-based model corresponding to the target brain-computer interface task. A personalized magnetoencephalogram (MEG) generation module is used to extract a multidimensional neurophysiological fingerprint from the target subject's EEG signal when only the target subject's EEG signal is available; based on the multidimensional neurophysiological fingerprint and the scene-specific global contextual condition vector of the target brain-computer interface task, multi-conditional semantic fusion and feature modulation are performed to obtain the joint conditional variable of the target subject; using the joint conditional variable as a priori guide, the MEG signal of the target subject is generated through the diffusion reverse generation process of the scene-based model.
6. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the personalized magnetoencephalogram (MEG) signal generation and enhancement method for brain-computer interfaces as described in any one of claims 1 to 4.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the personalized magnetoencephalogram (MEG) signal generation and enhancement method for brain-computer interfaces as described in any one of claims 1 to 4.