Cortical signal reconstruction method based on physical constraint diffusion model and related device

By using a physical constraint diffusion model, ECoG is reconstructed from EEG signals, which solves the problems of missing high-frequency details and insufficient physical constraints in EEG-to-ECoG reconstruction, and achieves accurate recovery of high-frequency signals and physically interpretable mapping.

CN122132681APending Publication Date: 2026-06-02SUN YAT SEN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SUN YAT SEN UNIV
Filing Date
2026-01-30
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately reconstruct invasive electrocorticography (ECoG) using non-invasive electroencephalography (EEG), particularly in terms of recovering high-frequency signal details and adhering to the physical laws of electromagnetic propagation.

Method used

A method based on a physical constraint diffusion model is adopted to extract conditional feature vectors from EEG signals. Then, using a trained diffusion model and a physical sensing variational autoencoder, combined with the lead field matrix, generative denoising and signal reconstruction are performed to ensure that the generated signal conforms to the electromagnetic propagation law.

Benefits of technology

It effectively restores high-frequency neural oscillation details that are attenuated or lost due to the skull low-pass filtering effect, achieves accurate mapping from EEG to ECoG, and improves the spatial resolution and clinical reliability of the signal.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122132681A_ABST
    Figure CN122132681A_ABST
Patent Text Reader

Abstract

This application discloses a method and related equipment for cortical signal reconstruction based on a physically constrained diffusion model. The method includes: acquiring non-invasive EEG signals from the head of a target subject; extracting conditional feature vectors from the non-invasive EEG signals; inputting the conditional feature vectors into a trained diffusion model for denoising to obtain transient latent variables; obtaining transient ECoG estimates based on the transient latent variables and a trained physical-sensory variational autoencoder; calculating a theoretical signal based on the transient ECoG estimates and a preset lead field matrix; updating the transient latent variables based on the difference between the theoretical signal and the non-invasive EEG signal until a target latent variable is obtained; the preset lead field matrix represents the transmission relationship from the cortical source space to the scalp sensor space; and obtaining the ECoG reconstructed signal based on the target latent variable and the trained physical-sensory variational autoencoder. The embodiments of this application can accurately predict ECoG using EEG. This application can be widely applied in the field of electroencephalography (EEG) technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electroencephalography (EEG) technology, and in particular to a method and related equipment for cortical signal reconstruction based on a physically constrained diffusion model. Background Technology

[0002] In neuroscience research and the diagnosis and treatment of clinical neurological diseases (such as epilepsy and Parkinson's disease), obtaining high spatiotemporal resolution data on cortical electrical activity is crucial. Currently, the acquisition of EEG signals mainly relies on two modalities: non-invasive scalp EEG (Scalp EEG) and invasive electrocorticography (ECoG).

[0003] Scalp EEG, which records brain electrical activity using electrodes placed on the scalp, offers advantages such as being non-invasive, low-cost, and easy for long-term monitoring, making it the preferred method for constructing brain-computer interfaces (BCIs) and screening for neurological diseases. However, EEG signal quality is severely limited by the "volume conduction effect." Neural electrical signals generated in the cerebral cortex must pass through multiple media, including cerebrospinal fluid, meninges, skull, and scalp, to reach the scalp. The skull has extremely high resistivity (approximately 80 times that of soft tissue) and exhibits significant low-pass filtering characteristics. This results in severe spatial blurring and high-frequency attenuation of the signal reaching the scalp: on the one hand, a single scalp electrode records a weighted average of the activity of hundreds of millions of neurons within a few square centimeters, resulting in extremely low spatial resolution; on the other hand, high-frequency neural oscillations (such as the Gamma band, 30-150Hz) carrying rich cognitive and motor coding information are significantly filtered out by the skull, making the EEG primarily dominated by low-frequency components.

[0004] In contrast, ECoG involves surgically placing an electrode array directly under the dura mater or on the surface of the cortex, avoiding obstruction by the skull. This allows for the recording of local field potentials with high signal-to-noise ratio, high spatial resolution, and rich high-frequency information. However, ECoG implantation is invasive, carrying risks of bleeding, infection, and postoperative complications. Furthermore, the recording range is typically limited to the surgically exposed area, making it difficult to promote its use among a wide range of patients or healthy individuals. Summary of the Invention

[0005] The main objective of this application is to propose a cortical signal reconstruction method and related equipment based on a physically constrained diffusion model, which aims to accurately predict ECoG through EEG.

[0006] To achieve the above objectives, one aspect of this application proposes a cortical signal reconstruction method based on a physically constrained diffusion model, the method comprising:

[0007] Obtain the non-invasive EEG signal of the head of the target object, and extract conditional feature vectors based on the non-invasive EEG signal; The conditional feature vector is input into the trained diffusion model for denoising to obtain transient latent variables. The transient ECoG estimate is obtained based on the transient latent variables and the trained physical perception variational autoencoder. The theoretical signal is calculated based on the transient ECoG estimate and the preset lead field matrix. The transient latent variable is updated based on the difference between the theoretical signal and the non-invasive EEG signal until the target latent variable is obtained. The preset lead field matrix represents the transmission relationship from the cortical source space to the scalp sensor space. Based on the target latent variables and the trained physical perception variational autoencoder, the ECoG reconstructed signal is obtained.

[0008] In some embodiments, the preset lead field matrix is ​​determined by the following method: Acquire image data of the head of the target object, and construct a conductivity model of the brain based on the image data. The conductivity model includes geometric shape and conductivity distribution. Based on the aforementioned conductivity model, the quasi-static electromagnetic field equations are solved using Maxwell's equations to calculate the transfer function from the cortical source space to the scalp sensor space, thereby generating the preset lead field matrix.

[0009] In some embodiments, the physical-aware variational autoencoder includes an encoder and a decoder, and the physical-aware variational autoencoder is obtained through the following training method: ECoG signal samples from the training dataset are input into the encoder to obtain sample latent variables, and the sample latent variables are input into the decoder to obtain reconstructed ECoG samples; EEG prediction samples are calculated based on the reconstructed ECoG samples and the preset lead field matrix. The parameters of the encoder and the decoder are updated based on the difference between the EEG prediction samples and the EEG signal samples in the training dataset until the preset requirements are met.

[0010] In some embodiments, the training dataset is determined by the following method: Obtain non-invasive EEG signal sample data and ECoG signal sample data from the head of the target object, and preprocess the non-invasive EEG signal sample data and ECoG signal sample data; the preprocessing includes filtering and / or noise reduction. The preprocessed non-invasive EEG signal sample data and ECoG signal sample data were time-aligned and sliced.

[0011] In some embodiments, the diffusion model is trained using the following method: Input the ECoG signal samples from the training dataset into the trained encoder to obtain latent variable features; Serialized context vectors of EEG signal sample segments are extracted from the training dataset, and the context vectors are injected as cue information into various layers of a preset network using a cross-attention mechanism; Noisy latent features are generated based on preset noise and the latent variable features. The noisy latent features and time step information are used as input to a preset network to update the parameters of the preset network until the preset network predicts and removes the preset noise of the current noisy latent features.

[0012] To achieve the above objectives, another aspect of this application proposes a cortical signal reconstruction device based on a physically constrained diffusion model, the device comprising: The first module is used to acquire the non-invasive EEG signal of the head of the target object and extract conditional feature vectors based on the non-invasive EEG signal. The second module is used to input the conditional feature vector into the trained diffusion model for denoising to obtain transient latent variables, and to obtain transient ECoG estimates based on the transient latent variables and the trained physical perception variational autoencoder. The third module is used to calculate the theoretical signal based on the transient ECoG estimate and the preset lead field matrix, and update the transient latent variable based on the difference between the theoretical signal and the non-invasive EEG signal until the target latent variable is obtained; the preset lead field matrix represents the transmission relationship from the cortical source space to the scalp sensor space; The fourth module is used to obtain the ECoG reconstructed signal based on the target latent variables and the trained physical perception variational autoencoder.

[0013] To achieve the above objectives, another aspect of this application proposes a cortical signal reconstruction system based on a physically constrained diffusion model, comprising flexible electrodes and a processor, wherein, The flexible electrode is used to collect non-invasive EEG signals from the target object; The processor is used to execute the above-described method.

[0014] To achieve the above objectives, another aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the methods described above.

[0015] To achieve the above objectives, another aspect of the embodiments of this application proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods described above.

[0016] To achieve the above objectives, another aspect of the embodiments of this application proposes a computer program product, including a computer program that, when executed by a processor, implements the methods described above.

[0017] The embodiments of this application include at least the following beneficial effects: This application provides a cortical signal reconstruction method and related equipment based on a physically constrained diffusion model. This method extracts conditional feature vectors from non-invasive EEG signals, inputs these feature vectors into a trained diffusion model for denoising, obtains transient latent variables, obtains transient ECoG estimates based on the transient latent variables and a trained physical-sensory variational autoencoder, calculates the theoretical signal based on the transient ECoG estimates and a preset lead field matrix, updates the transient latent variables based on the difference between the theoretical signal and the non-invasive EEG signal, until the target latent variable is obtained. The preset lead field matrix characterizes the transmission relationship from the cortical source space to the scalp sensor space. Based on the target latent variable and the trained physical-sensory variational autoencoder... The encoder obtains the ECoG reconstructed signal; leveraging the powerful probability distribution modeling capabilities of the diffusion model, the process of inverting high-dimensional ECoG from low-dimensional EEG is effectively solved in the "one-to-many" mapping problem in the inverse problem under physical constraints. By performing generative denoising in the latent space, it is possible to infer and reconstruct high-frequency neural oscillation details that are attenuated or lost on the scalp surface due to the low-pass filtering effect of the skull based on the learned signal prior distribution. By explicitly embedding the lead field matrix into the training loss and inference sampling process of the deep learning network, the generated signal is forced to satisfy the electromagnetic propagation law of the head volume conductor, establishing a physically interpretable signal mapping relationship, thereby accurately predicting ECoG through EEG. Attached Figure Description

[0018] Figure 1 This is a flowchart of the cortical signal reconstruction method based on a physically constrained diffusion model provided in the embodiments of this application; Figure 2 This is a flowchart of data acquisition and data preprocessing provided in the embodiments of this application; Figure 3 This is a data processing flowchart of the physical sensing model and conditional diffusion model provided in the embodiments of this application; Figure 4 This is a flowchart of cortical signal reconstruction of ECoG signal based on physical constraint diffusion model provided in an embodiment of this application; Figure 5 This is a schematic diagram of the cortical signal reconstruction device based on a physically constrained diffusion model provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of the cortical signal reconstruction system based on the physical constraint diffusion model provided in the embodiments of this application; Figure 7This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit it. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this application; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.

[0020] It is understood that the terms “first,” “second,” etc., used in this application may be used herein to describe various concepts, but unless otherwise stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the words “if,” “when,” or “in response to a determination” as used herein may be interpreted as “when…” or “when…” or “in response to a determination.”

[0021] As used in this application, the terms "at least one", "multiple", "each", "any", etc., "at least one" includes one, two or more, "multiple" includes two or more, "each" refers to each of the corresponding multiples, and "any" refers to any one of the multiples.

[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0023] In related technologies, to achieve both the non-invasiveness of EEG and the high resolution of ECoG, solving the "EEG Inverse Problem"—that is, retrieving cortical source signals from scalp EEG—has become a research hotspot in recent years. Existing solutions mainly fall into two categories: The first category is traditional source localization methods based on biophysical models. These methods (such as Minimum Norm Estimation (MNE), LORETA, and dipole fitting) are based on Maxwell's equations and attempt to infer cortical sources by constructing a multi-layered head conduction model and solving for the inverse of the forward projection matrix. However, inferring three-dimensional cortical activity from two-dimensional scalp potentials is mathematically a classic "ill-posed problem," meaning that infinitely many cortical source distributions can produce identical scalp potential maps. To obtain a unique solution, traditional methods must introduce very strong mathematical assumptions (such as the smoothness and sparsity of the solution), which often leads to overly smooth reconstructions that fail to recover true focal discharges. Furthermore, these methods are extremely sensitive to noise, computationally complex, and difficult to apply in real time.

[0024] The second category is data-driven deep learning mapping methods. With the development of artificial intelligence, researchers have begun to utilize models such as convolutional neural networks (CNNs), recurrent neural networks (RNNs), Transformers, or graph neural networks (GCNs) to learn the nonlinear mapping relationship between synchronously acquired EEG and ECoG data. These methods, to some extent, break through the linear limitations of traditional physical models. However, existing deep learning reconstruction methods have the following significant structural defects: 1. "Smoothing effect" and high-frequency loss caused by deterministic regression: Most existing mainstream models (including U-Net, ResNet, ViT, etc.) adopt the "deterministic regression" framework, and their training objective is usually to minimize the mean squared error (MSE) or mean absolute error (MAE) between the predicted signal and the real ECoG. Since the mapping from EEG to ECoG is a one-to-many probabilistic process (i.e., a fuzzy EEG input may correspond to multiple reasonable ECoG high-frequency textures), regression models that aim to minimize the error tend to output the "statistical average" of all possible solutions. This averaging process results in signal waveforms that, while similar to the true values ​​in low-frequency contours, exhibit severe "over-smoothing" in detail. Key high-frequency oscillations (HFOs) and transient textures are smoothed out, failing to meet the demands of sophisticated brain-computer interface decoding. 2. "Black box illusion" due to lack of physical constraints: Existing AI models typically treat the brain as a black box, relying entirely on statistical data for end-to-end mapping, ignoring the explicit physical laws of electromagnetic propagation in the head (i.e., the forward conduction field model). This can lead to models generating physiologically impossible signal patterns—for example, the model's predicted cortical potential distribution, if projected forward onto the back skin according to physical formulas, may completely contradict actual EEG observations. This lack of physical consistency reduces the interpretability and clinical credibility of the results. 3. Insufficient ability to model noise distribution: Real EEG signals contain a large amount of non-Gaussian electromyographic and electrooculographic noise. Traditional discriminative models struggle to effectively decouple signal distribution from noise distribution, often misidentifying noise as neural features for mapping, resulting in a large number of spurious artifacts in the reconstructed ECoG signal.

[0025] In summary, there is currently a lack of a non-invasive high-resolution reconstruction method for EEG signals that can effectively address the ill-posedness of the inverse problem and strictly adhere to the physical laws of electromagnetic propagation while recovering high-frequency details.

[0026] 1) Loss of high-frequency texture in reconstructed signals: Existing techniques mostly employ deterministic regression models based on MSE / MAE loss functions. Since EEG loses high-frequency information, recovering ECoG from EEG is essentially predicting a probability distribution. The regression model forces a single deterministic output value (i.e., the mean of the distribution), resulting in the average filtering out of high-frequency texture and details with random characteristics. The generated signal, although smooth, lacks the complex dynamic characteristics of real neural signals.

[0027] 2) The generated results violate the laws of physics and electromagnetism: Existing deep learning methods are mainly pure data-driven "black box" models that do not incorporate the physical forward projection model of the head's volume conductor into the network architecture or constraints. The model only learns the statistical correlation between input and output, and cannot guarantee that the generated cortical signal can be mathematically restored to the input scalp signal after being conducted through the skull, which can easily produce physiologically inexplicable "hallucination" signals.

[0028] 3) Weak ability to handle the multiple solutions of ill-posed inverse problems: The EEG inverse problem is inherently ill-posed, meaning that a low-dimensional EEG corresponds to multiple possible high-dimensional ECoG states. Existing models attempt to find a unique "optimal" mapping function, ignoring the diversity and uncertainty of potential solutions. They cannot model the probability distribution of the solution space like generative models, resulting in limited generalization ability when facing complex brain activities.

[0029] In view of this, this application provides a method and related device for cortical signal reconstruction based on a physically constrained diffusion model. This method extracts conditional feature vectors from non-invasive EEG signals, inputs these feature vectors into a trained diffusion model for denoising, and obtains transient latent variables. Based on the transient latent variables and a trained physical-sensory variational autoencoder, transient ECoG estimates are obtained. Theoretical signals are calculated based on the transient ECoG estimates and a preset lead field matrix. The transient latent variables are updated based on the difference between the theoretical signal and the non-invasive EEG signal until a target latent variable is obtained. The preset lead field matrix represents the transmission relationship from the cortical source space to the scalp sensor space. Based on the target latent variable and the trained physical-sensory variational autoencoder, a... The system reconstructs signals from ECoG; leveraging the powerful probability distribution modeling capabilities of diffusion models, it inverts high-dimensional ECoG from low-dimensional EEG, effectively solving the "one-to-many" mapping problem in the inverse problem under physically constrained conditional generation tasks; through generative denoising in the latent space, it can infer and reconstruct high-frequency neural oscillation details that are attenuated or lost on the scalp surface due to the low-pass filtering effect of the skull based on the learned signal prior distribution; by explicitly embedding the lead field matrix into the training loss and inference sampling process of the deep learning network, it forces the generated signal to satisfy the electromagnetic propagation law of the head volume conductor, establishing a physically interpretable signal mapping relationship, thereby accurately predicting ECoG through EEG.

[0030] The cortical signal reconstruction method based on a physically constrained diffusion model provided in this application relates to the field of information technology. This method can be applied to terminals, servers, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, or in-vehicle terminal, but is not limited to these. The server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network. The software can be an application implementing the cortical signal reconstruction method based on a physically constrained diffusion model, but is not limited to the above forms.

[0031] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics devices, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0032] See Figure 1 This application provides a method for cortical signal reconstruction based on a physically constrained diffusion model, the method comprising: Step S101: Obtain the non-invasive EEG signal of the target object's head, and extract the conditional feature vector based on the non-invasive EEG signal; Step S102: Input the conditional feature vector into the trained diffusion model for denoising to obtain transient latent variables. Based on the transient latent variables and the trained physical perception variational autoencoder, obtain the transient ECoG estimate. Step S103: Calculate the theoretical signal based on the transient ECoG estimate and the preset lead field matrix, and update the transient latent variable based on the difference between the theoretical signal and the non-invasive EEG signal until the target latent variable is obtained; the preset lead field matrix represents the transmission relationship from the cortical source space to the scalp sensor space. Step S104: Obtain the ECoG reconstructed signal based on the target latent variables and the trained physical perception variational autoencoder.

[0033] In one specific embodiment, the physical sensing variational autoencoder includes an encoder and a decoder. When the EEG signal is used as input, this embodiment employs a physical gradient-guided sampling strategy to generate the ECoG signal. The process begins with randomly sampled pure Gaussian noise and uses a trained denoising network for multi-step iterative denoising. To further eliminate any illusions that the generative model might produce and ensure the physical authenticity of the result, a "manifold correction" mechanism is introduced in each denoising iteration: the intermediate latent feature variables generated in the current denoising step are restored to transient ECoG estimates by the decoder; the theoretical projection of this estimate onto the scalp is calculated using the lead field matrix; and the residual between this theoretical projection and the actual observed EEG signal is obtained. The gradient of this residual relative to the latent feature is calculated, and the latent feature is fine-tuned and updated using this gradient. This "prediction-correction" mechanism is equivalent to applying real-time physical navigation during the generation process, forcing the generation trajectory to always converge within the solution space that conforms to the laws of electromagnetic propagation. Finally, the latent feature after the full number of denoising steps is fed into the decoder, outputting the final high-resolution ECoG reconstructed signal. This signal not only maintains a high degree of consistency with EEG in the low-frequency envelope, but also realistically recovers the high-frequency oscillations and focal discharge characteristics of the Gamma band that were filtered out by the skull through the generation capability of the diffusion model.

[0034] While this embodiment primarily describes a latent diffusion model, the generative module can be replaced with other types of generative neural network architectures, such as normalizing flows or variants of generative adversarial networks (GANs). For example, a conditional generative adversarial network (cGAN) can be used to directly map the signal space end-to-end, incorporating physical constraints into the discriminator's loss function; or continuous-time score-based generative models can be used instead of the discrete-length diffusion model. This is possible as long as the alternative architecture can explicitly model the conditional probability distribution from EEG to ECoG and allows for the embedding of physical positive operators for gradient guidance or constraints during inference.

[0035] In some embodiments, the preset lead field matrix is ​​determined by the following method: Step S201: Obtain image data of the target object's head, and construct a conductivity model of the brain based on the image data. The conductivity model includes geometric shape and conductivity distribution. Step S202: Based on the conductivity model, the quasi-static electromagnetic field equations are solved using Maxwell's equations to calculate the transfer function from the cortical source space to the scalp sensor space, so as to generate a preset lead field matrix.

[0036] In one specific embodiment, head structure imaging data (such as MRI) of the subject and simultaneously acquired EEG and ECoG signals are obtained. Based on the imaging data, a multi-layer boundary element model (BEM) or finite element model (FEM) is constructed, encompassing the scalp, skull, cerebrospinal fluid, and cerebral cortex, to accurately characterize the geometry and conductivity distribution of each layer. Based on this geometric model, the quasi-static electromagnetic field equations are solved using Maxwell's equations to calculate the transfer function from the cortical source space (ECoG electrode location) to the scalp sensor space (EEG electrode location), generating the lead field matrix. This matrix, acting as a physical forward projection operator, linearly maps any given cortical potential distribution to a theoretical scalp potential distribution, thus providing a clear physical constraint boundary for subsequent deep learning models.

[0037] When constructing physical constraints, in addition to using the linear conduction field matrix calculated based on the boundary element method (BEM), nonlinear or anisotropic conduction models constructed based on the finite element method (FEM) or finite difference method (FDM) can also be used. For example, for special patients with uneven skull thickness or surgical bone window defects, a high-precision FEM model can be used to replace the standard BEM model to more accurately simulate the non-uniform conduction process of current in complex geometries and anisotropic media (such as white matter fiber bundles). Furthermore, the physical projection operator can also be replaced by a surrogate neural network pre-trained on massive electromagnetic simulation data to achieve faster forward inference speed than traditional numerical calculations, thereby accelerating the iterative sampling process.

[0038] In some embodiments, the training dataset is determined by the following method: Step S301: Obtain non-invasive EEG signal sample data and ECoG signal sample data from the head of the target object, and preprocess the non-invasive EEG signal sample data and ECoG signal sample data; the preprocessing includes filtering and / or noise reduction. Step S302: Perform time alignment and slicing on the preprocessed non-invasive EEG signal sample data and ECoG signal sample data.

[0039] The synchronously acquired signals are preprocessed, including but not limited to removing power frequency interference, baseline drift correction and outlier removal, and the EEG and ECoG signals are strictly aligned and segmented on the time axis to construct paired training datasets.

[0040] The synchronously acquired EEG and ECoG signals undergo preprocessing. For example, bandpass filters (e.g., 1Hz to 200Hz) are used to preserve the effective frequency band, and notch filters are applied to remove power frequency interference. For EEG signals acquired from flexible electrodes, if significant motion or electromyographic interference exists, independent component analysis (ICA) or wavelet thresholding is used for noise reduction. A key step is time alignment: using the hardware synchronization trigger signal of the data acquisition system, the flexible electrode signal and the threaded electrode signal are strictly synchronized with millisecond-level precision to construct paired training datasets.

[0041] In some embodiments, the physical-aware variational autoencoder includes an encoder and a decoder, and the physical-aware variational autoencoder is obtained through the following training method: Step S401: Input the ECoG signal samples from the training dataset into the encoder to obtain the sample latent variables, and input the sample latent variables into the decoder to obtain the reconstructed ECoG samples; Step S402: Calculate EEG prediction samples based on the reconstructed ECoG samples and the preset lead field matrix. Update the encoder and decoder parameters based on the difference between the EEG prediction samples and the EEG signal samples in the training dataset until the preset requirements are met.

[0042] To reduce the modeling complexity of high-dimensional ECoG signals and capture their nonlinear manifold structure, this embodiment of the invention constructs a physically-aware variational autoencoder (VAE). This network comprises an encoder and a decoder. The encoder employs a deep convolutional neural network to map the high-dimensional, high-sampling-rate original ECoG signal segments into a low-dimensional, compact latent distribution. The decoder is responsible for reconstructing the original ECoG signal from this latent distribution. Unlike traditional VAEs, this embodiment introduces a "physical consistency loss" during training. Specifically, in addition to minimizing the difference between the reconstructed ECoG and the real ECoG, the reconstructed ECoG signal output by the decoder is projected forward onto the scalp space through the aforementioned lead field matrix, and the error between this projection result and the real EEG signal is calculated. By jointly optimizing the reconstruction loss and the physical projection loss, the latent space features learned by the network are forced to not only contain the waveform information of the ECoG but also embed its corresponding far-field physical propagation properties, ensuring the electrophysiological rationality of the decoded signal.

[0043] In some embodiments, the diffusion model is trained using the following method: Step S501: Input the ECoG signal samples in the training dataset into the trained encoder to obtain latent variable features; Step S502: Extract the serialized context vectors of EEG signal sample segments from the training dataset, and use the cross-attention mechanism to inject the context vectors as cue information into each layer of the preset network; Step S503: Generate noisy latent features based on preset noise and latent variable features, use the noisy latent features and time step information as input to the preset network, update the parameters of the preset network until the preset network predicts and removes the preset noise of the current noisy latent features.

[0044] Within the extracted latent space, this embodiment of the invention constructs and trains a conditional diffusion model. This process consists of two stages: forward diffusion and reverse denoising. In the forward diffusion stage, Gaussian noise is progressively added to the latent features of the ECoG, and after a preset time step, it is transformed into isotropic pure Gaussian noise. In the reverse denoising stage, a noise prediction network based on the U-Net architecture is constructed. The input to this network includes the current noisy latent features and the time step embedding. The key is the introduction of EEG signals as conditional control. Specifically, a dedicated EEG feature extractor (such as a Transformer-based encoder) is designed to encode the synchronized EEG signals into context vectors, which are then injected into each layer of the U-Net through a cross-attention mechanism. The training objective is to enable the network to accurately predict and remove noise components from the current latent features given EEG contextual cues. In this way, the model learns the conditional probability distribution of the cortical ECoG signal given a blurred scalp EEG observation, thus gaining the ability to recover high-frequency texture details from noise.

[0045] Building upon the use of EEG as a conditionally guided diffusion model for ECoG generation, other modalities of neuroimaging data can be integrated as multimodal constraints. For example, functional magnetic resonance imaging (fMRI) activation maps or diffusion tensor imaging (DTI) structural connectivity matrices of the subject can be encoded as additional context vectors and incorporated into the cross-attention mechanism. The high spatial resolution blood oxygenation information provided by fMRI can offer spatial priors for ECoG source localization, while the neural fiber connectivity information provided by DTI can constrain the signal propagation path in the brain network. This further improves the spatial accuracy and anatomical plausibility of ECoG reconstruction, especially when the EEG signal-to-noise ratio is low or artifacts are present.

[0046] Below, refer to specific application examples. Figures 2 to 4 The following is a detailed description and explanation of the solutions in the embodiments of the present invention: A. Constructing a physical forward projection model of the rat head and preprocessing multimodal data First, a physical model describing the electromagnetic conduction characteristics of the rat head was constructed for the experimental subjects. Specifically, high-resolution structural magnetic resonance imaging (MRI) or CT data of the rat head were acquired, and the geometric boundaries of the scalp, skull, cerebrospinal fluid, and cerebral cortex were extracted using image segmentation algorithms. Considering the thin but high resistivity of the rat skull, a finite element model (FEM) or boundary element model (BEM) containing multiple layers of media was established. The conductivity of each tissue layer was set according to the anatomical parameters of the rat.

[0047] Subsequently, the spatial locations of the electrodes were determined. The three-dimensional coordinates of the threaded electrode implanted in the rat skull (as the ECoG recording end, typically contacting the dura mater or penetrating to the cortical surface) and the spatial coordinates of the flexible electrode attached to the outside of the skull (as the EEG recording end) were recorded. Using the Poisson equation under the quasi-static approximation of Maxwell's equations, the potential distribution from the point of generation of a unit current at each threaded electrode location (source point) to the point of generation of the flexible electrode (field point) was calculated, thus generating the lead field matrix L. This matrix L describes how the cortical potential is linearly conducted and attenuated to the scalp surface, satisfying the linear physical equation: the EEG signal equals the matrix L multiplied by the ECoG signal. This matrix will serve as the physical constraint operator in subsequent deep learning networks.

[0048] Simultaneously, the synchronously acquired rat EEG and ECoG signals were preprocessed. Since motion artifacts are easily generated during awake rat activity, they need to be carefully removed. Bandpass filters (e.g., 1Hz to 200Hz) were used to preserve the effective frequency band, and notch filters were applied to remove power frequency interference. For EEG signals acquired by flexible electrodes, if significant motion or electromyographic interference was present, independent component analysis (ICA) or wavelet thresholding denoising was used for purification. A key step was time alignment: using the hardware synchronization trigger signal of the data acquisition system, the flexible electrode signal and the threaded electrode signal were ensured to be strictly synchronized with millisecond-level precision, and they were divided into fixed-length time window segments (e.g., 2 seconds each) to construct paired training datasets.

[0049] B. Construction and Training of Physics-Informed VAE To address the computational burden of directly generating high-dimensional ECoG signals and to extract the signal's manifold features, this step constructs a physically-aware variational autoencoder. This network consists of an encoder and a decoder. The encoder employs a one-dimensional deep convolutional neural network to compress high-sampling-rate ECoG signal segments acquired from the threaded electrodes into low-dimensional latent variable distribution parameters (mean and variance), and samples these parameters to obtain latent feature vectors. The decoder uses a transposed convolutional network to reconstruct the ECoG signal from this latent feature vector.

[0050] The innovation of this step lies in the design of the loss function. In addition to the conventional reconstruction error loss and KL divergence loss, a "physical consistency loss term" is introduced. Specifically, the reconstructed ECoG signal output by the decoder is left-multiplied by a pre-calculated lead field matrix L to obtain the predicted scalp EEG signal; then, the Euclidean distance or correlation error between this predicted signal and the actually synchronously recorded flexible electrode EEG signal is calculated. Through this joint training, the latent space features learned by the network are forced to not only encode the waveform features of the threaded electrode signal but also embed its corresponding far-field physical projection properties, ensuring that the signal generated by the decoder is physically plausible.

[0051] C. Training of latent space diffusion models under EEG-guided conditions After obtaining the trained VAE, its parameters are frozen, and its encoder is used to convert all threaded electrode ECoG training data into latent features. This step aims to train a conditional diffusion model to learn the probability distribution of these latent features. The diffusion process is a process of progressively adding Gaussian noise to the latent features until they become purely random noise.

[0052] The core lies in training the inverse denoising process. A noise prediction network based on the U-Net architecture is constructed. The input of this network includes the noisy latent features at the current time step and time step information. To derive ECoG from EEG, a conditional control mechanism is introduced: an EEG feature extractor (e.g., an encoder based on a Transformer structure) is designed to encode synchronously acquired flexible electrode EEG signal segments into serialized context vectors. Using a cross-attention mechanism, this context vector is injected as cue information into various layers of the U-Net. The training objective is to enable the network to accurately predict and remove noise components from the current latent features under the guidance of given flexible electrode EEG signal features. Through training with a large number of samples, the model learns the conditional probability distribution of the corresponding cortical signal when given a blurred scalp signal, thus gaining the ability to recover high-frequency details.

[0053] D. Iterative Reasoning and Signal Reconstruction Guided by Physical Gradients In practical applications, the system only receives non-invasive EEG signals acquired by flexible electrodes. First, the EEG feature extractor converts these signals into conditional vectors. The sampling process begins with random Gaussian noise and involves multi-step iterative denoising. To further eliminate potential biases from the generative model and strictly constrain the results to conform to physical laws, "physical gradient guidance" is implemented in each denoising sampling step.

[0054] The specific operation is as follows: After obtaining the denoised estimate of the current step, it is mapped back to the signal space using a VAE decoder to obtain the transient ECoG estimate. The theoretical projection of the lead field matrix L onto the scalp is calculated, and the residual energy between this theoretical projection and the actually observed flexible electrode EEG signal is calculated. The gradient of this residual energy relative to the latent variable is calculated, and this gradient is applied back to the latent variable with a certain step size coefficient to fine-tune it. This step is equivalent to applying real-time physical navigation during the generation process, forcing the generated result to approximate the actual physical measurement value. Finally, the latent features after the complete denoising steps are fed into the decoder, outputting the final high-resolution ECoG reconstructed signal, which accurately reflects the high-frequency neural activity of the rat cortex.

[0055] The following is a detailed description and explanation of the solution of this invention embodiment, using another specific application example: I. Construction and Training of a High-Frequency Signal Reconstruction Network for Rat Cortex Based on a Physically Constrained Diffusion Model First, a dual-modal synchronous acquisition platform was constructed, comprising flexible electrodes on the skull surface and threaded electrodes under the dura mater. Adult male SD rats (weighing 250-300g) were selected as experimental subjects, and a delicate craniotomy was performed. For ECoG recording, which serves as a "truth label," a custom-designed 8-channel stainless steel threaded electrode (1mm in diameter, with the tip insulation layer removed) was screwed into the skull opening corresponding to the barrel area of ​​the right primary somatosensory cortex (S1) of the rat. The depth was controlled to just contact the dura mater without piercing the cortex, in order to obtain the "gold standard" signal containing broadband local field potentials and high-frequency Gamma oscillations. For EEG recording, which serves as the "observation input," a custom-designed 32-channel high-density flexible microelectrode array based on a polyimide (PI) substrate was used. A conductive gel was coated on the intact skull surface around the threaded electrodes. Utilizing the extremely thin and soft physical properties of this flexible array, it achieved micron-level conformal contact with the complex curved surface of the rat skull, thereby acquiring scalp EEG signals with high spatial resolution but severe attenuation of high-frequency components. Postoperatively, the rats underwent head CT scans to construct a four-layer finite element head model including the scalp, skull, cerebrospinal fluid, and brain parenchyma. The lead field matrix from the threaded electrode source point to the flexible electrode field point was calculated as a physical constraint operator.

[0056] During the data acquisition and model training phase, rats were allowed to freely explore within a soundproof enclosure, while signals from both systems were simultaneously acquired. The acquired data underwent rigorous preprocessing: the flexible EEG signal was subjected to 1-200Hz bandpass filtering and spatial Laplace filtering to improve the signal-to-noise ratio; the threaded ECoG signal retained its full-band information from 1-500Hz. The training process then consisted of two steps: First, a physical sensing variational autoencoder (VAE) was trained to compress the high-frequency threaded ECoG signal into a low-dimensional latent space. An explicit "physical projection error term" was added to its loss function, requiring that the decoded ECoG signal, after projection onto the lead field matrix, closely match the synchronous flexible EEG signal. Second, the VAE parameters were frozen, and a diffusion model conditioned on the flexible EEG signal was trained. This model receives the time-series features of the flexible EEG as conditioned guidance, learning how to progressively denoise and recover the corresponding ECoG latent features from Gaussian noise. After approximately 200 epochs of training, the model successfully established a probabilistic mapping relationship from fuzzy macroscopic scalp signals to fine cortical signals.

[0057] II. Online High-Resolution Cortical Signal Inversion and Beard Stimulation Verification Based on Flexible Electrodes During the online application and validation phase after model training, the system switches to a "flexible input only" inference mode. In this mode, a classic beard deflection stimulation experiment was designed to verify the physiological authenticity of the reconstructed signal. In the experiment, data is physically transmitted only in real time via a flexible EEG electrode array attached to the skull surface; the original threaded electrodes serve only as a control group for offline validation and do not participate in inference calculations. The system reads the voltage data collected by the flexible electrodes in real time and inputs it into the trained diffusion model. During each iterative sampling step of the inference generation, the system introduces a "physical gradient guidance" mechanism: the currently generated intermediate signal is projected forward through the built-in lead field matrix, the residual between it and the currently observed flexible EEG signal is calculated, and the gradient of this residual is used to reverse-correct the generation trajectory, forcing the reconstruction process to strictly adhere to the electromagnetic conduction laws of the rat head.

[0058] Experimental results show that although the energy of the input flexible EEG signal attenuates sharply above 40Hz, the virtual ECoG signal reconstructed using the method described in this embodiment accurately reproduces the somatosensory cortical evoked potential (SEP) waveform induced by beard stimulation in the time domain. More importantly, in frequency domain analysis, the reconstructed signal successfully recovered the characteristic oscillatory activity in the Gamma band (30-80Hz) and High-Gamma band (80-150Hz) that were filtered out by the skull. By comparing the reconstructed signal with the signal recorded by the actual implanted threaded electrode, the power spectral density (PSD) curves of the two signals in the Gamma band showed a match of over 80%, and the Pearson correlation coefficient between the reconstructed signal and the real signal exceeded 0.8 during the latency period after stimulation. This demonstrates that, with only non-invasive / minimally invasive flexible surface electrodes, this system can, under the constraints of a physical model, generate high-frequency neural information from scratch using generative AI technology, providing a novel technical approach for long-term, stable, high-throughput brain-computer interfaces that does not require penetrating the skull.

[0059] See Figure 5 This application also provides a cortical signal reconstruction device based on a physically constrained diffusion model, the device comprising: The first module is used to acquire the non-invasive EEG signal of the target object's head and extract conditional feature vectors based on the non-invasive EEG signal. The second module is used to input the conditional feature vector into the trained diffusion model for denoising, obtain transient latent variables, and obtain transient ECoG estimates based on the transient latent variables and the trained physical perception variational autoencoder. The third module is used to calculate the theoretical signal based on the transient ECoG estimate and the preset lead field matrix, and update the transient latent variable based on the difference between the theoretical signal and the non-invasive EEG signal until the target latent variable is obtained; the preset lead field matrix represents the transmission relationship from the cortical source space to the scalp sensor space; The fourth module is used to obtain the ECoG reconstructed signal based on the target latent variables and the trained physical perception variational autoencoder.

[0060] It is understood that the content of the above method embodiments is applicable to the present device embodiments. The specific functions implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0061] See Figure 6 This application also provides a cortical signal reconstruction system based on a physically constrained diffusion model, including flexible electrodes and a processor, wherein... Flexible electrodes are used to collect non-invasive EEG signals from target subjects. A processor, used to execute the methods described above.

[0062] It is understood that the content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0063] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.

[0064] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0065] Please see Figure 7 , Figure 7 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes: The processor 701 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The memory 702 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 702 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 702 and is called and executed by the processor 701 using the methods described in the embodiments of this application. The input / output interface 703 is used to implement information input and output; The communication interface 704 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 705 transmits information between various components of the device (e.g., processor 701, memory 702, input / output interface 703, and communication interface 704); The processor 701, memory 702, input / output interface 703, and communication interface 704 are connected to each other within the device via bus 705.

[0066] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.

[0067] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0068] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0069] It is understood that the content of the above method embodiments is applicable to the embodiments of this program product. The specific functions implemented by the embodiments of this program product are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0070] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0071] The cortical signal reconstruction method and related equipment based on the physically constrained diffusion model provided in this application have the following beneficial effects: 1. Solving the ill-posedness of the EEG inverse problem: The embodiments of this invention utilize the powerful probability distribution modeling capability of diffusion models to invert the process of high-dimensional cortical EEG from low-dimensional scalp EEG, transforming the traditional regression task of finding a unique solution into a conditional generation task under physical constraints, effectively solving the "one-to-many" mapping problem in the inverse problem.

[0072] 2. Recovery of High-Frequency Neural Information Filtered Out by the Skull: This invention, through generative denoising within the latent space, can infer and reconstruct the Gamma band (30-150Hz) and higher-frequency neural oscillation details on the scalp surface that are attenuated or lost due to the low-pass filtering effect of the skull, based on the learned signal prior distribution. Compared with existing deep learning regression methods, the ECoG signal generated by this method is not only accurate in low-frequency waveforms but also successfully recovers high-frequency texture details, eliminating the "oversmoothing" phenomenon common in traditional methods. This allows non-invasive techniques to capture fine local cortical field potential features, significantly improving the spatial resolution and spectral integrity of non-invasive EEG signals.

[0073] 3. Establishing a signal mapping that conforms to the laws of electrophysiology: In this embodiment of the invention, the lead field matrix derived from Maxwell's equations is explicitly embedded into the training loss and inference sampling process of the deep learning network, which forces the generated signal to satisfy the electromagnetic propagation law of the head volume conductor, thereby establishing a physically interpretable signal mapping relationship.

[0074] 4. Enhanced physical authenticity and clinical credibility of generated signals: By introducing physical gradient-guided sampling, this method effectively suppresses physiologically impossible "illusion" artifacts that are easily generated by pure data-driven AI models, ensuring that the reconstructed cortical activity can accurately interpret the actual observed scalp potentials after forward projection, and greatly improving the reliability of the results in clinical diagnosis.

[0075] 5. Improved decoding performance and noise robustness of brain-computer interface: Thanks to the excellent denoising characteristics and high-frequency information recovery of the diffusion model, the reconstructed signal of this method can provide richer neural coding features, thus showing higher accuracy and stability in downstream tasks such as motor intention decoding and epileptic focus localization than directly using EEG or traditional reconstruction methods.

[0076] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0077] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0078] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0079] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0080] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0081] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0082] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above 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 coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0083] The units described above 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.

[0084] 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.

[0085] If the integrated 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, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0086] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.

Claims

1. A cortical signal reconstruction method based on a physically constrained diffusion model, characterized in that, The method includes the following steps: Obtain the non-invasive EEG signal of the head of the target object, and extract conditional feature vectors based on the non-invasive EEG signal; The conditional feature vector is input into the trained diffusion model for denoising to obtain transient latent variables. The transient ECoG estimate is obtained based on the transient latent variables and the trained physical perception variational autoencoder. The theoretical signal is calculated based on the transient ECoG estimate and the preset lead field matrix. The transient latent variable is updated based on the difference between the theoretical signal and the non-invasive EEG signal until the target latent variable is obtained. The preset lead field matrix represents the transmission relationship from the cortical source space to the scalp sensor space. Based on the target latent variables and the trained physical perception variational autoencoder, the ECoG reconstructed signal is obtained.

2. The method according to claim 1, characterized in that, The preset lead field matrix is ​​determined by the following method: Acquire image data of the head of the target object, and construct a conductivity model of the brain based on the image data. The conductivity model includes geometric shape and conductivity distribution. Based on the aforementioned conductivity model, the quasi-static electromagnetic field equations are solved using Maxwell's equations to calculate the transfer function from the cortical source space to the scalp sensor space, thereby generating the preset lead field matrix.

3. The method according to claim 1, characterized in that, The physical-aware variational autoencoder includes an encoder and a decoder, and is obtained through the following training method: ECoG signal samples from the training dataset are input into the encoder to obtain sample latent variables, and the sample latent variables are input into the decoder to obtain reconstructed ECoG samples; EEG prediction samples are calculated based on the reconstructed ECoG samples and the preset lead field matrix. The parameters of the encoder and the decoder are updated based on the difference between the EEG prediction samples and the EEG signal samples in the training dataset until the preset requirements are met.

4. The method according to claim 3, characterized in that, The training dataset was determined using the following method: Obtain non-invasive EEG signal sample data and ECoG signal sample data from the head of the target object, and preprocess the non-invasive EEG signal sample data and ECoG signal sample data; the preprocessing includes filtering and / or noise reduction. The preprocessed non-invasive EEG signal sample data and ECoG signal sample data were time-aligned and sliced.

5. The method according to claim 3, characterized in that, The diffusion model was trained using the following method: Input the ECoG signal samples from the training dataset into the trained encoder to obtain latent variable features; Serialized context vectors of EEG signal sample segments are extracted from the training dataset, and the context vectors are injected as cue information into various layers of a preset network using a cross-attention mechanism; Noisy latent features are generated based on preset noise and the latent variable features. The noisy latent features and time step information are used as input to a preset network to update the parameters of the preset network until the preset network predicts and removes the preset noise of the current noisy latent features.

6. A cortical signal reconstruction device based on a physically constrained diffusion model, characterized in that, The device includes: The first module is used to acquire the non-invasive EEG signal of the head of the target object and extract conditional feature vectors based on the non-invasive EEG signal. The second module is used to input the conditional feature vector into the trained diffusion model for denoising to obtain transient latent variables, and to obtain transient ECoG estimates based on the transient latent variables and the trained physical perception variational autoencoder. The third module is used to calculate the theoretical signal based on the transient ECoG estimate and the preset lead field matrix, and update the transient latent variable based on the difference between the theoretical signal and the non-invasive EEG signal until the target latent variable is obtained; the preset lead field matrix represents the transmission relationship from the cortical source space to the scalp sensor space; The fourth module is used to obtain the ECoG reconstructed signal based on the target latent variables and the trained physical perception variational autoencoder.

7. A cortical signal reconstruction system based on a physically constrained diffusion model, characterized in that, Includes flexible electrodes and a processor, among which, The flexible electrode is used to collect non-invasive EEG signals from the target object; The processor is configured to execute the method according to any one of claims 1-5.

8. An electronic device, characterized in that, include: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method as described in any one of claims 1-5.

9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 5.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 5.