Local field potential signal generation method and system based on improved diffusion model

By combining the Transformer encoder and GRU diffusion model, the fidelity and stability problems of local field potential signal generation in the prior art are solved, and high-fidelity, conditionally controlled LFP signal generation is realized, which is suitable for multi-channel synchronization and behavior-related neural signal simulation.

CN120492795APending Publication Date: 2025-08-15SHENZHEN INST OF ADVANCED TECH CHINESE ACAD OF SCI
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510427310.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-07
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

When generating local field potential signals, the prior art has problems with low fidelity and stability, making it difficult to take into account the global timing mode and local dynamic details at the same time, as well as the lack of support for behavioral conditions and multi-channel data.

Method used

A diffusion model based on Transformer encoder and GRU is adopted, and a high-fidelity, conditional controllable LFP time series is generated through multi-head self-attention calculation, latent variable sampling, continuous ODE solution and discrete GRU rule update, combined with forward noise addition and reverse denoising sampling of the diffusion model.

Benefits of technology

The fidelity and physiological correlation of the generated signals are improved, making the synthetic LFP closer to real records in terms of statistical characteristics, spectral characteristics and behavior-related changes, and achieving high fidelity, controllable conditions and stable structural neural signal generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120492795A_ABST
    Figure CN120492795A_ABST
Patent Text Reader

Abstract

The invention discloses a local field potential signal generation method and system based on an improved diffusion model. The method comprises the following steps: acquiring and preprocessing an original noise-containing signal, timestamp information, a multi-channel behavior signal or a stimulation signal; performing multi-head self-attention calculation on the preprocessed data based on a Transform encoder to obtain a potential state of the LFP sequence in a potential space; carrying out potential variable sampling according to the potential state, carrying out continuous ODE solution and discrete GRU rule updating on the obtained initial potential variable, and generating a potential state sequence evolved along with time; performing forward noise addition and reverse noise reduction sampling on the potential state sequence based on a diffusion model to obtain a final potential sequence; and mapping a potential sequence finally obtained by the diffusion model back to an LFP signal of a preset dimension, and outputting LFP time sequence data generated by simulation. According to the invention, high-fidelity, controllable-condition and stable-structure neural signal generation is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of neural signal processing, and in particular to a method and system for generating local field potential signals based on an improved diffusion model. Background Art

[0002] In recent years, with the development of brain-computer interface technology, neuroelectrophysiological signals (such as spike, LFP, EEG, etc.) have been widely used in behavioral decoding, consciousness research, and neurorehabilitation system design. Among them, LFP signals are widely collected and applied in experimental and clinical scenarios due to their good stability and wide spatial coverage. Traditional research relies on real-world LFP data. However, the acquisition of real data is costly, time-consuming, and has ethical restrictions, making it difficult to obtain the large-scale, high-diversity samples required for training models. To address this problem, some studies have attempted to use artificial intelligence methods to simulate neural signals. The existing technical solutions are reviewed below: (1) Variational Autoencoder (VAE)-based methods: Typical examples include models such as LFADS (Latent Factor Analysis via Dynamical Systems), which encode neural sequences into a low-dimensional latent space and reconstruct the signal, or generate new sequences by introducing a temporal model into the latent space. VAE-based methods are effective in extracting low-dimensional latent structures, but the generated signals are often too smooth, making it difficult to restore high-frequency details. In addition, their generation quality is easily limited by the latent space distribution assumptions, resulting in poor fidelity of the generated signal.

[0003] (2) Methods based on generative adversarial networks (GANs): Some studies use GANs to generate neural signal sequences, including using convolutional or recurrent networks as generators and discriminators for time series. GANs can theoretically learn complex distributions and generate more diverse samples, but their training process is unstable and suffers from problems such as pattern collapse. It is particularly difficult to learn the distribution of long time series. For neural signals, the sequences generated by GANs may lack real statistical properties and are difficult to directly incorporate into explicit conditional control.

[0004] (3) Neural ODE method based on self-supervised learning: The latest literature proposes to combine a multi-head self-attention encoder with a neural ordinary differential equation (Neural ODE) and GAN to generate neural signals. The process of this method is: the original neural signal and its time and behavior information are encoded to obtain a low-dimensional latent variable, and then the latent state is trained and evolved through the neural ODE module. Then, Gaussian noise is introduced and a generative adversarial network (GAN) is used to generate a high-dimensional pseudo neural signal. This method uses a self-supervised strategy to extract neural dynamic features and uses GAN to generate future signals, which to a certain extent improves the diversity of the generated signals and the robustness of the decoder. However, it also has shortcomings: the GAN part may still cause training instability and requires careful multi-stage training (encoder / ODE / GAN training separately); in addition, this literature mainly focuses on discrete neural pulse signals, and the direct generation effect of continuous LFP signals is still unclear.

[0005] In summary, existing technologies have made some progress in neural signal generation: VAEs provide low-dimensional representations but have limited fidelity; GANs can generate details but are unstable during training; ODEs introduce continuous dynamics but still rely on the GAN generation process; and diffusion models offer high fidelity and conditional flexibility, but their application in the neural field is still in its infancy. The main drawbacks of existing approaches are the difficulty in simultaneously balancing global temporal patterns and local dynamical details, as well as incomplete support for behavioral conditions and multi-channel data, resulting in low fidelity and stability in LFP signal generation.

[0006] Therefore, the existing technology needs to be improved. Summary of the Invention

[0007] The technical problem to be solved by the present invention is that, in response to the defects of the existing technology, the present invention provides a local field potential signal generation method and system based on an improved diffusion model to solve the problems of low fidelity and stability of LFP signals simulated and generated by existing artificial intelligence methods.

[0008] The technical solutions adopted by the present invention to solve the technical problems are as follows: In a first aspect, the present invention provides a method for generating a local field potential signal based on an improved diffusion model, comprising: Acquire and preprocess original noisy signals, timestamp information, multi-channel behavioral signals or stimulus signals to obtain preprocessed data; Performing multi-head self-attention calculation on the preprocessed data based on the Transformer encoder to obtain the latent state of the LFP sequence in the latent space; Sampling latent variables according to the latent state, and continuously solving ODE and updating discrete GRU rules on the obtained initial latent variables to generate a latent state sequence that evolves over time; Performing forward denoising and reverse denoising sampling on the latent state sequence based on a diffusion model to obtain a final latent sequence; The latent sequence finally obtained by the diffusion model is mapped back to the LFP signal of the preset dimension, and the simulated LFP time series data is output.

[0009] In one implementation, the Transformer encoder-based multi-head self-attention calculation is performed on the preprocessed data to obtain the latent state of the LFP sequence in the latent space, including: Feature extraction and time series self-attention modeling are performed on the preprocessed data, and the latent state of the LFP sequence in the latent space is output based on the extracted features and the calculated multi-head self-attention.

[0010] In one implementation, the performing feature extraction and time series self-attention modeling on the preprocessed data, and outputting the latent state of the LFP sequence in the latent space based on the extracted features and the calculated multi-head self-attention, includes: Extracting temporal pattern features from the LFP sequence of the preprocessed data and performing self-attention modeling of the time series; Perform Transformer encoding based on the extracted features and calculated multi-head self-attention to obtain the hidden state; According to the latent state obtained after encoding, an aggregation operation is performed on the last moment of the LFP sequence or the entire LFP sequence to obtain the corresponding latent mean vector and latent variance vector; The latent state is obtained by reparameterized sampling based on the mean vector and the latent variance vector.

[0011] In one implementation, sampling latent variables according to the latent state, and continuously solving ODEs and updating discrete GRU rules on the obtained initial latent variables to generate a latent state sequence that evolves over time, includes: Input the potential state into the ODE model and use a multi-layer perceptron or convolutional network to simulate the evolution trajectory of the potential state in continuous time; Updating the latent state at discrete time steps based on a GRU module; The evolution trajectory is combined with the updated latent state to capture the continuous evolution and discrete jump characteristics of the latent dynamics of the LFP sequence, generating the latent state sequence that evolves over time.

[0012] In one implementation, the updating of the latent state based on the GRU module at discrete time steps includes: After each discrete time step, the potential state is updated based on the increment solved by the GRU module.

[0013] In one implementation, performing forward denoising and reverse denoising sampling on the potential state sequence based on the diffusion model to obtain a final potential sequence includes: Based on the diffusion model, forward noise is gradually added to the potential state sequence according to a preset noise scheduling coefficient and standard Gaussian noise to obtain a continuous-time diffusion sequence; Inputting the potential state of each diffusion step in the diffusion sequence, the diffusion time step indication, and the condition vector into the denoising network; Within the denoising network, the latent state of each diffusion step is passed through several layers of self-attention Transformer sublayers to extract global correlation features, and the implicit state of the previous moment is introduced. The representation of each time step is updated through the GRU unit to obtain the final noise-free latent sequence.

[0014] In one implementation, mapping the latent sequence ultimately obtained by the diffusion model back to an LFP signal of a preset dimension and outputting simulated LFP time series data includes: The latent sequence finally obtained by the diffusion model is mapped back to the LFP signal of the preset dimension according to the synchronous generation strategy of the multi-channel signal, and the LFP time series data generated by the simulation is output.

[0015] In a second aspect, the present invention provides a local field potential signal generation system based on an improved diffusion model, comprising: A data input module is used to acquire and preprocess the original noisy signal, time stamp information, multi-channel behavioral signal or stimulus signal to obtain preprocessed data; A Transformer encoder module is used to perform multi-head self-attention calculation on the preprocessed data to obtain the latent state of the LFP sequence in the latent space; a latent sampling module for sampling latent variables according to the latent state; The ODE-GRU evolution module is used to continuously solve the ODE and update the discrete GRU rules on the obtained initial latent variables to generate a latent state sequence that evolves over time; a diffusion generation module, configured to perform forward denoising and reverse denoising sampling on the latent state sequence based on a diffusion model to obtain a final latent sequence; The decoding and output module is used to map the potential sequence finally obtained by the diffusion model back to the LFP signal of preset dimensions and output the simulated LFP time series data.

[0016] In a third aspect, the present invention provides a terminal comprising: a processor and a memory, wherein the memory stores a local field potential signal generation program based on an improved diffusion model, and when the local field potential signal generation program based on the improved diffusion model is executed by the processor, it is used to implement the operation of the local field potential signal generation method based on the improved diffusion model as described in the first aspect.

[0017] In a fourth aspect, the present invention also provides a medium, which is a computer-readable storage medium, and which stores a local field potential signal generation program based on an improved diffusion model. When the local field potential signal generation program based on the improved diffusion model is executed by a processor, it is used to implement the operation of the local field potential signal generation method based on the improved diffusion model as described in the first aspect.

[0018] The present invention adopts the above technical solution to achieve the following effects: The present invention acquires and preprocesses raw noisy signals, timestamp information, multi-channel behavioral signals, or stimulus signals, and performs multi-head self-attention calculations on the preprocessed data based on a Transformer encoder. It samples latent variables based on the encoded latent state, and continuously solves the obtained initial latent variables and updates them with discrete GRU rules, thereby generating a latent state sequence that evolves over time. Furthermore, the latent state sequence is forward-noised and backward-noised based on a diffusion model, and the latent sequence ultimately obtained by the diffusion model is mapped back to an LFP signal of a preset dimension, outputting simulated LFP time series data. The present invention improves the fidelity and physiological relevance of the generated signal, making the synthesized LFP closer to real records in terms of statistical characteristics, spectral features, and behavioral-related changes, achieving high-fidelity, conditionally controllable, and structurally stable neural signal generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.

[0020] Figure 1 It is a flow chart of the local field potential signal generation method based on the improved diffusion model in the present invention.

[0021] Figure 2It is a schematic diagram of the overall process of the present invention.

[0022] Figure 3 It is a schematic diagram of the module structure in the present invention.

[0023] Figure 4 Schematic diagram of the LFP signal simulation generation process in the present invention.

[0024] Figure 5 Schematic diagram of the high-fidelity LFP sequence generated in the present invention.

[0025] Figure 6 3 is a schematic diagram of spectrum analysis for generating LFP signals in the present invention.

[0026] Figure 7 It is a functional principle diagram of a terminal in one implementation of the present invention.

[0027] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION

[0028] In order to make the purpose, technical solutions and advantages of the present invention more clear and distinct, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0029] Exemplary Methods The existing technologies for simulating neural signals using artificial intelligence methods mainly include the following: (1) Variational Autoencoder (VAE)-based methods: Typical examples include models such as LFADS (Latent Factor Analysis via Dynamical Systems), which encode neural sequences into a low-dimensional latent space and reconstruct the signal, or generate new sequences by introducing a temporal model into the latent space. VAE-based methods are effective in extracting low-dimensional latent structures, but the generated signals are often too smooth, making it difficult to restore high-frequency details. In addition, their generation quality is easily limited by the latent space distribution assumptions, resulting in poor fidelity of the generated signal.

[0030] (2) Methods based on generative adversarial networks (GANs): Some studies use GANs to generate neural signal sequences, including using convolutional or recurrent networks as generators and discriminators for time series. GANs can theoretically learn complex distributions and generate more diverse samples, but their training process is unstable and suffers from problems such as pattern collapse. It is particularly difficult to learn the distribution of long time series. For neural signals, the sequences generated by GANs may lack real statistical properties and are difficult to directly incorporate into explicit conditional control.

[0031] (3) Neural ODE method based on self-supervised learning: The latest literature proposes to combine a multi-head self-attention encoder with a neural ordinary differential equation (Neural ODE) and GAN to generate neural signals. The process of this method is: the original neural signal and its time and behavior information are encoded to obtain a low-dimensional latent variable, and then the latent state is trained and evolved through the neural ODE module. Then, Gaussian noise is introduced and a generative adversarial network (GAN) is used to generate a high-dimensional pseudo neural signal. This method uses a self-supervised strategy to extract neural dynamic features and uses GAN to generate future signals, which to a certain extent improves the diversity of the generated signals and the robustness of the decoder. However, it also has shortcomings: the GAN part may still cause training instability and requires careful multi-stage training (encoder / ODE / GAN training separately); in addition, this literature mainly focuses on discrete neural pulse signals, and the direct generation effect of continuous LFP signals is still unclear.

[0032] The above methods have the following shortcomings when applied to LFP signal generation: (1) Insufficient fidelity: VAE-type models often generate signals that tend to be averaged, making it difficult to reproduce the random fluctuations and spike details in real LFPs. Although GAN models can generate high-frequency components, due to unstable training, they may not be able to fully cover the distribution of real signals, resulting in statistical differences between the generated signals and real data. Although the self-supervised ODE+GAN method introduces dynamic constraints, the final GAN generation part may still distort the output signal or introduce pseudo-structures, making it difficult to ensure long-term temporal consistency.

[0033] (2) It is difficult to balance global and local dependencies: LFP signals contain features of different time scales, such as slow wave trends and fast transients. Traditional RNN or CNN generators can only capture short-term dependencies, while multi-head attention mechanisms, while taking into account the global picture, lack direct modeling of continuous-time dynamics. Existing solutions have difficulty simultaneously learning long-term dependencies (such as behavioral-related changes) and short-term dependencies (such as correlations between adjacent moments), resulting in the generated signal potentially lacking features in one aspect.

[0034] (3) Limited conditional generation: Many methods lack clear interfaces for injecting conditional information such as behavior and stimuli. Some GAN methods attempt to concatenate inputs with conditional vectors, but lack mechanisms to ensure that the generated signals strictly follow the conditions. Although the self-supervised ODE method utilizes behavioral information in the encoding phase, it lacks mandatory constraints on the conditions in the generation phase (GAN part). Diffusion models naturally support conditional generation, but current diffusion models for neural data mainly focus on offline conditions (such as trial conditions) or limited contexts, and there is still room for improvement in the processing of continuous behavioral signals as conditions.

[0035] (4) Insufficient multi-channel synchronization: For multi-channel LFP, previous methods may need to model each channel separately, making it difficult to ensure synchronization and correlation structure between signals from different channels. Although latent space methods can capture the common mode components of group activities to a certain extent, they lack a dedicated design for multi-channel joint generation, which easily leads to mismatches in the timing of the generated multi-channel signals or incorrect correlations.

[0036] In response to the above technical problems, an embodiment of the present invention provides a method for generating local field potential signals based on an improved diffusion model. The method obtains and preprocesses the original noisy signal, timestamp information, multi-channel behavioral signal or stimulus signal, and performs multi-head self-attention calculation on the preprocessed data based on the Transformer encoder. The method can sample latent variables according to the latent state obtained by encoding, and continuously solve the obtained initial latent variables and update the discrete GRU rules to generate a latent state sequence that evolves over time; and based on the diffusion model, the latent state sequence is forward denoised and reverse denoised. The latent sequence finally obtained by the diffusion model can be mapped back to the LFP signal of the preset dimension, and the simulated LFP time series data is output. The embodiment of the present invention improves the fidelity and physiological relevance of the generated signal, making the synthesized LFP closer to the real record in terms of statistical characteristics, spectral characteristics and behavior-related changes, and realizing high-fidelity, conditionally controllable, and structurally stable neural signal generation.

[0037] like Figure 1 As shown, an embodiment of the present invention provides a method for generating a local field potential signal based on an improved diffusion model, comprising the following steps: Step S100 , acquiring and preprocessing the original noisy signal, timestamp information, multi-channel behavior signal or stimulation signal to obtain preprocessed data.

[0038] In this embodiment, a framework is designed that integrates temporal dynamic modeling and diffusion probability generation. The framework integrates the diffusion denoising model of Transformer and GRU, and is used for denoising generation of neural signals by combining the global self-attention mechanism of Transformer with the sequential update mechanism of GRU. This architecture can capture long-range dependencies and short-term dynamics at the same time, so that the generated time series is highly realistic in both overall trends and local details. The model structure adopted in this embodiment is different from the existing diffusion model that uses pure Transformer or convolutional U-Net, and is particularly suitable for neural time series modeling. Based on the framework designed in this embodiment, multi-channel LFP signals that conform to real physiological characteristics and can be controlled by conditions can be efficiently learned and generated, thereby providing high-quality synthetic data support for downstream neural decoding, brain-computer interface and other applications.

[0039] Based on the aforementioned framework of a diffusion denoising model that integrates the Transformer and GRU, this example proposes a method for generating local field potential signals based on an improved diffusion model. This method simultaneously captures the signal's global dependencies and local dynamics by integrating a conditional diffusion denoising network with the Transformer and GRU. A conditional control interface is introduced to allow the generation process to be regulated by factors such as behavior and stimulation. Furthermore, the method supports the simultaneous generation of multi-channel LFPs. This example aims to improve the fidelity and physiological relevance of the generated signals, making the synthesized LFPs as close as possible to real recordings in terms of statistical properties, spectral characteristics, and behavioral-related changes. This method can be used to expand neural datasets, assist in model training, and verify hypotheses.

[0040] In this embodiment, the method includes two parts: model architecture and implementation steps. The overall scheme is based on the idea of "latent diffusion generation". First, the high-dimensional LFP sequence is encoded into a low-dimensional latent space, and then the diffusion model is used in the latent space for conditional generation. Finally, the high-dimensional synthetic LFP signal is decoded. Figure 2 As shown in the figure, the overall process of the method mainly includes: data encoding, latent variable sampling, latent state evolution (time series modeling), diffusion model training and reconstruction, conditional control mechanism and multi-channel LFP generation.

[0041] like Figure 3 As shown, corresponding to the above method, this embodiment also provides a system architecture for implementing the method. The system includes the following functional modules: A. Data input module: used to acquire and preprocess raw noisy signals, multi-channel behavioral (or stimulus) signals, and timestamp information, and format them into tensor form that can be input to the model.

[0042] B. Transformer Encoder Module: Receives preprocessed data, performs multi-head self-attention calculations, and outputs latent distribution parameters (mean, variance). This module can be implemented in hardware using a neural network acceleration chip.

[0043] C. Latent Sampling Module: It samples latent variables based on the encoder output to achieve the conversion from deterministic encoding to stochastic latent representation.

[0044] D.ODE-GRU Evolution Module: Apply a continuous ODE solver and a discrete GRU update rule to the initial latent variables, producing a sequence of latent states that evolves over time.

[0045] E. Diffusion Generation Module: This module implements the forward denoising and reverse denoising sampling processes of the diffusion model, and can include multiple denoising sub-network layers. It incorporates a conditional control mechanism to receive behavioral / stimulus conditional input during the generation process.

[0046] F. Decoding and Output Module: This module maps the latent sequence generated by the diffusion model back to a high-dimensional LFP signal and outputs the simulated LFP time series data. This module supports saving the results or providing them to downstream application modules.

[0047] In this embodiment, corresponding data sets are collected from public databases (e.g., Kaggle database, OpenNeuro database), and then the original noisy signals, multi-channel behavior (or stimulation) signals, and timestamp information are acquired and preprocessed through the above-mentioned data input module, and formatted into a tensor form that can be input into the model; wherein, the preprocessing process of the original noisy signals, timestamp information, multi-channel behavior signals, or stimulation signals can be processed using conventional data preprocessing methods, such as data cleaning and noise reduction, signal normalization and resampling, and feature extraction and data segmentation.

[0048] like Figure 1 As shown, an embodiment of the present invention provides a method for generating a local field potential signal based on an improved diffusion model, comprising the following steps: Step S200: Perform multi-head self-attention calculation on the preprocessed data based on the Transformer encoder to obtain the latent state of the LFP sequence in the latent space.

[0049] In this embodiment, for the preprocessed data, the preprocessed data is received through the Transformer encoder module, multi-head self-attention calculation is performed, and potential distribution parameters (mean, variance) are output.

[0050] Specifically, in one implementation of this embodiment, step S200 includes the following steps: Step S201, perform feature extraction and time series self-attention modeling on the preprocessed data, and output the latent state of the LFP sequence in the latent space based on the extracted features and the calculated multi-head self-attention.

[0051] In this embodiment, during the data encoding process, the original noisy signal sequence in the preprocessed data, along with its corresponding timestamp and behavioral signal (or simulated behavioral input), is input into a Transformer encoder. The Transformer encoder performs feature extraction and time series self-attention modeling on the multi-channel LFP sequence, outputting the corresponding implicit representation. The final layer of the Transformer encoder outputs a latent mean vector and a latent variance vector, representing the distribution parameters of the LFP sequence in the latent space.

[0052] In one implementation of this embodiment, step S201 includes the following steps: Step S201a, extracting temporal pattern features from the LFP sequence of the preprocessed data and performing self-attention modeling of the time series; Step S201b, performing Transformer encoding based on the extracted features and the calculated multi-head self-attention to obtain the hidden state; Step S201c, performing an aggregation operation on the last moment of the LFP sequence or the entire LFP sequence according to the implicit state obtained after encoding, to obtain the corresponding latent mean vector and latent variance vector; Step S201d: Based on the mean vector and the potential variance vector, obtain the potential state through reparameterized sampling.

[0053] In this example, the Transformer encoder module maps high-dimensional LFP time series to a low-dimensional latent representation without losing key information. Unlike traditional autoencoders, which consist solely of RNNs or CNNs, this example uses the Transformer architecture and leverages its multi-head self-attention mechanism to capture long-range dependencies in the sequence.

[0054] As an example, the Transformer encoder receives an input matrix of shape ,in is the number of time steps, is the number of channels (for single channel At the same time, conditional information such as behavior or stimulation can be used as additional input: one way is to attach the behavioral signal (if it is a time series, aligned with the LFP) as a new channel, so that the input dimension becomes (in The condition is the behavioral signal dimension); or the condition is input into the Transformer encoder together with the LFP sequence as a context sequence, allowing the attention mechanism to associate the two types of information. The encoder is composed of several self-attention layers and feedforward layers, which extract the temporal pattern of the input signal. After Transformer encoding, the hidden state is obtained. ( is the hidden dimension of the model). Subsequently, the potential mean vector corresponding to the sequence is obtained by performing an aggregation operation (such as average pooling or a special CLS tag representation) at the last moment or on the entire sequence. and the latent variance vector ,here is the dimension of the latent space. Finally, the latent variable is obtained by reparameterization sampling It is worth mentioning that and The introduction of allows the model to implicitly constrain the latent space through KL divergence regularization during training, which is similar to the training principle of variational autoencoders (VAEs), encouraging the distribution of latent representations to be close to the standard normal distribution, which is conducive to subsequent diffusion generation.

[0055] like Figure 1 As shown, an embodiment of the present invention provides a method for generating a local field potential signal based on an improved diffusion model, comprising the following steps: Step S300 , sampling latent variables according to the latent state, and performing continuous ODE solution and discrete GRU rule update on the obtained initial latent variables to generate a latent state sequence that evolves over time.

[0056] In this embodiment, the latent state of the LFP sequence output by the Transformer encoder in the latent space is first sampled through a latent sampling module, that is, latent variables are sampled based on the encoder output to achieve the conversion from deterministic encoding to stochastic latent representation; then, a continuous ODE solver and discrete GRU update rule are applied to the initial latent variables through the ODE-GRU evolution module to generate a latent state sequence that evolves over time.

[0057] Specifically, in one implementation of this embodiment, step S300 includes the following steps: Step S301, inputting the potential state into the ODE model, and using a multi-layer perceptron or convolutional network to simulate the evolution trajectory of the potential state in continuous time; Step S302, updating the potential state at discrete time steps based on the GRU module; Step S302a, updating the potential state based on the increment solved by the GRU module at each discrete time step; Step S303 : Combining the evolution trajectory with the updated latent state to capture the continuous evolution and discrete jump characteristics of the latent dynamics of the LFP sequence, and generating the latent state sequence evolving over time.

[0058] In this embodiment, during the processing of latent variable sampling, reparameterization technology can be used to sample the latent variable from the latent Gaussian distribution according to the mean and variance output by the encoder. This latent variable compactly represents the main features of the original LFP sequence in the form of low-dimensional continuous values.

[0059] After latent variable sampling, latent state evolution (time series modeling) is performed. The specific process is as follows: the sampled initial latent variables are input into an ordinary differential equation (ODE) module, combined with a gated recurrent unit (GRU) as a latent state evolver. The ODE module simulates the evolution of the latent state in continuous time, while the GRU unit updates the latent state at discrete time steps (for example, incorporating new input or truncated error feedback). This combination captures both the continuous evolution and discrete jump characteristics of the LFP latent dynamics, generating a latent state trajectory over a time series that reflects the temporal trend of the LFP signal.

[0060] As an example, in this embodiment, time series modeling is performed using the ODE+GRU latent state evolution module, specifically as follows: Get the initial latent vector Finally, how to reflect the dynamic evolution of LFP signals over time is the key. Reconstruction can only reproduce the input fragment itself. To generate longer sequences or simulate signals under new conditions, temporal extrapolation of the latent state is required. This embodiment introduces a Neural Ordinary Differential Equation (ODE) model in the latent space to simulate continuous dynamics, and combines it with a Gated Recurrent Unit (GRU) to handle discrete events and non-stationary dynamics.

[0061] In specific implementation, the sampled potential vector As the initial state, at time (usually 0 or a standard starting point.) The ODE module defines the derivative function of the potential state over time. , which can be represented by a small neural network (such as a multilayer perceptron or a convolutional network) with parameters Fitting is done by learning the underlying trajectory of the real data. Continuous-time superior On the other hand, the GRU module changes every time it passes a discrete time step. (or when external input changes) to update the state: ,here It can be that the ODE is in the interval The increments obtained by solving the above problem are summed up. In this way, the GRU can introduce jump-like corrections (for example, adjusting the state when encountering a behavioral event or stimulus pulse), while the ODE ensures smooth state evolution between events. The combination of ODE and GRU forms a hybrid dynamics model that can handle both continuous, slowly changing processes and discontinuous, sudden changes, making it particularly suitable for signals with complex dynamics such as LFP. By adjusting the parameters of the ODE module or the gating of the GRU, the latent state trajectory can be made to have an autocorrelation structure and spectral characteristics similar to those of the true LFP.

[0062] like Figure 1 As shown, an embodiment of the present invention provides a method for generating a local field potential signal based on an improved diffusion model, comprising the following steps: Step S400 : performing forward denoising and reverse denoising sampling on the latent state sequence based on a diffusion model to obtain a final latent sequence.

[0063] In this embodiment, for the potential state sequence that evolves over time generated by the ODE-GRU evolution module, the forward denoising and reverse denoising sampling processes of the diffusion model are implemented through the diffusion generation module, thereby reconstructing a high-fidelity LFP signal based on the potential trajectory; the diffusion generation module in this embodiment integrates a conditional control mechanism to receive behavioral / stimulus condition input during the generation process.

[0064] Specifically, in one implementation of this embodiment, step S400 includes the following steps: Step S401, based on the diffusion model, gradually adding forward noise to the potential state sequence according to a preset noise scheduling coefficient and standard Gaussian noise to obtain a continuous-time diffusion sequence; Step S402, inputting the potential state of each diffusion step in the diffusion sequence, the diffusion time step indicator and the condition vector into the denoising network; In step S403, within the denoising network, the potential state of each diffusion step is passed through several layers of self-attention Transformer sublayers to extract global correlation features, and the implicit state of the previous moment is introduced. The representation of each time step is updated through the GRU unit to obtain the final noise-free potential sequence.

[0065] In this embodiment, a diffusion probability model is introduced into the latent space during the diffusion model training and reconstruction process. The diffusion model acts as a denoising generative network, learning the distribution of latent variable trajectories through a repeated process of adding noise and denoising. During the training phase, varying degrees of Gaussian noise are added to the latent trajectories corresponding to the true LFP sequence, and the trained conditional diffusion model gradually restores the true latent trajectories. After sufficient training, the diffusion model is able to gradually generate realistic latent trajectories starting from pure noise. Combined with a decoder (the inverse process of the encoder), these latent trajectories can reconstruct high-fidelity LFP signals.

[0066] As an example, diffusion model training and potential reconstruction are as follows: The state trajectory obtained in the latent space (denoted as ) represents the evolution of the neural state over a period of time. This embodiment uses the diffusion generative model to model its high-dimensional distribution. The diffusion model consists of two parts: the forward diffusion process and the reverse generative process.

[0067] The forward process starts from the true potential trajectory and gradually adds noise: ,for , ,in is the noise scheduling coefficient, is standard Gaussian noise. After enough steps (or continuous time) of diffusion, Close to isotropic Gaussian distribution. The reverse process is to train a parameterized model To approximate the inverse distribution of forward diffusion, where Indicates the condition (can be empty). In specific implementation, a time series U-Net structure or an equivalent denoising network is used. , which receives the latent state of the current diffusion step , Diffusion time step indicator (can be encoded via positional embeddings) and the conditional vector , the output pair The training goal is usually to make the noise output by the network consistent with the actual noise added. Matching, i.e. optimizing loss By minimizing this loss, it is equivalent to learning how to remove noise and restore data. After training is completed, when generating, the random Gaussian noise Start, apply repeatedly Iterative Reasoning , and finally obtain a noise-free latent trajectory Due to the introduction of conditions during training , providing different The corresponding trajectory can be obtained. For example, when The intention signal represents "movement direction to the left", then the generated potential trajectory will show the characteristic pattern related to "left" movement in the corresponding time window. Input decoder (which can be regarded as the reverse network of Transformer encoder or another specially trained decoding network) to decode the synthesized LFP signal sequence .

[0068] The denoising network of the diffusion model is one of the core innovations of this embodiment. Its architecture combines the Transformer and GRU units to take into account both global dependency extraction and local state update. Specifically, within the denoising network, the input noisy latent sequence is first Globally relevant features are extracted through several layers of self-attention Transformer sublayers, while the implicit state of the previous moment is introduced. The representation of each time step is updated through GRU units. This design allows the network to retain contextual awareness of the entire sequence (provided by the Transformer) and a progressively updated memory of the current time step (provided by the GRU) at each diffusion step. The following pseudocode illustrates the logic of a denoising step:

[0069] The DenoiseStep process described in the pseudocode above combines the sequential update of GRU and the global processing of self-attention: first, each time step of the current noisy latent sequence is read in sequence, the conditional information and time step embedding are used as additional input, and a hidden state is gradually updated using GRUCell (simulating recursive time dependency); then, multi-head self-attention is applied to the entire updated sequence, and a new sequence representation is output, which is the true latent sequence of the previous diffusion step. The entire denoising network is composed of several stacked modules (similar to the multi-layer structure of a U-Net) and operates at different scales, thereby gradually refining denoising information. This Transformer + GRU fusion architecture effectively models the global consistency and local continuity of the LFP latent trajectory at each denoising step of the diffusion model, improving the generated precision and dynamic realism.

[0070] As a further example, this embodiment designs a conditional interface module within the diffusion model to support conditional generation based on behavioral, stimulus, or contextual information. Specifically, an encoding vector of behavioral signals or task conditions is incorporated into the input of the diffusion denoising network (for example, by using conditional embedding or a cross-attention mechanism in the Transformer). This allows the diffusion model to reference the conditional information at each denoising step, guiding the generated latent trajectory to adhere to the given conditions and ensuring that the synthesized LFP signal exhibits characteristics consistent with the desired conditions.

[0071] Specifically, the conditional control mechanism adopted in this embodiment is: In order to achieve controllability of the generation process, this embodiment introduces conditional control interfaces in both the encoding and generation stages of the model. In the encoding stage, as mentioned above, the behavior / stimulus signal can be incorporated into the input or context of the Transformer encoder, so that the potential representation already contains condition-related information. In the generation stage (diffusion denoising process), the generation trajectory can be adjusted in real time by adding the conditional embedding cond_emb to the denoising network input and using the embedding in the GRUCell or attention layer. For example, for discrete conditions (such as different experimental task labels), a conditional vector can be found using the condition ID , and in each denoising step with Splicing input networks; for continuous conditions (such as an expected motion speed curve), the condition can be treated as a time-aligned sequence input to the diffusion model and processed together with the main trajectory (influencing the main trajectory through cross-attention). The design of the condition control module ensures that during training, the model learns to associate conditions with output signal characteristics. During sampling, only the desired conditions need to be provided to generate signals with corresponding characteristics. This provides great flexibility for downstream applications. For example, users can specify "generate LFP patterns in the case of rapid movement" or "introduce rhythmic components caused by certain stimuli," and the model will output signals according to the conditional requirements.

[0072] like Figure 1 As shown, an embodiment of the present invention provides a method for generating a local field potential signal based on an improved diffusion model, comprising the following steps: Step S500 , mapping the latent sequence finally obtained by the diffusion model back to an LFP signal of a preset dimension, and outputting simulated LFP time series data.

[0073] In this embodiment, after the diffusion model finally outputs a noise-free latent sequence, the decoding and output module maps the resulting latent sequence back to a high-dimensional LFP signal, outputting simulated LFP time series data. The results can be saved or provided to downstream application modules.

[0074] Specifically, in one implementation of this embodiment, step S500 includes the following steps: Step S501 : Mapping the latent sequence finally obtained by the diffusion model back to the LFP signal of the preset dimension according to the synchronous generation strategy of the multi-channel signal, and outputting the simulated LFP time series data.

[0075] In this embodiment, multi-channel LFP signals are generated simultaneously through a multi-channel LFP generation method. In the encoding stage, the Transformer encoder can process multi-channel input (taking the signal of each channel at each time step as the input vector); in the decoding stage, the latent variable can be decoded back into a multi-channel signal with the same dimension as the original. Therefore, by performing diffusion modeling on the entire multi-channel signal in the latent space, LFP sequences with any number of channels can be generated synchronously, and the synchronization and correlation patterns between the channels can be maintained. There is no need to train a model for each channel separately, and the correlation between channels is jointly determined by the common factors in the model's latent representation.

[0076] Specifically, the process of synchronous generation of multi-channel signals is: The model of this embodiment naturally supports the joint generation of multi-channel LFP, which is achieved by modeling multiple variables simultaneously in the latent space. In actual implementation, it is only necessary to ensure that the encoder processes multi-channel inputs and the decoder outputs multi-channel signals, while the diffusion model processes the multi-channel LFP in the latent space. It represents the state of the entire multi-channel signal. For example, in the single-step denoising pseudo code, z_t[i] can be a length of A vector containing The potential state of all channels in the time step; when the GRU unit and the self-attention unit process it, they will naturally handle the correlation between channels. The model does not separate the channels, but regards them as part of an overall state vector. Therefore, when When adding noise or denoising, it is equivalent to operating on the joint distribution of multiple channels, so that the final generated channel signals are synchronized in time sequence and statistically correlated. This is very important for simulating real biological signals, because the LFPs of different areas of the brain will show a highly correlated or anti-phase relationship in certain frequency bands or moments. Through joint modeling, this embodiment can reproduce these relationships. If you need to generate a different number of channels, you only need to adjust the channel dimensions of the input and output accordingly during training. The main structure of the model does not need to be modified, and it has good scalability.

[0077] The system implementation and operation process in this embodiment is as follows: Based on the above modules, a complete software system for LFP signal generation can be constructed. The process of the training phase is: first prepare a training dataset containing LFP, behavior and timestamps, and send it to the Transformer encoder / decoder for unsupervised pre-training (similar to VAE reconstruction training) to initialize the latent space; then train the ODE+GRU model on the latent space to enable it to predict the latent state sequence (the latent sequence output by the encoder can be used as the approximate true value for supervised training); then train the diffusion model to learn denoising and reconstruction given the true latent sequence; finally, fine-tune the entire model together so that the encoder-ODE / GRU-diffusion-decoder work together to obtain the optimal result. The process of the generation phase (inference phase) is: the user provides the desired generation conditions (optional) and the necessary sampling configuration (such as sequence length, diffusion sampling steps, etc.); the system obtains the initial latent state through the decoder or manual settings. (generally set to random Gaussian); the diffusion module is guided by the conditions from Iteration generated to Get potential trajectory ; Finally, the decoder will The whole process can be completed offline and the results can be saved for subsequent analysis; or it can be run in real time each time the user specifies new conditions, realizing interactive neural signal simulation.

[0078] like Figures 4-6 As shown in Figure 1, this embodiment has been simulated and verified by a prototype system and tested with experimental data. The results show that this technical solution is feasible and effective. First, it is verified on a simulation data set: this embodiment constructs several simulated LFP sequences with known statistical characteristics, for example, signals containing specific frequency oscillations and noise components, and uses the method of this embodiment to learn and regenerate them; the LFP signal simulation generation process is as follows: Figure 4 As shown, the generated high-fidelity LFP sequence is as follows Figure 5 As shown, the spectrum analysis results of the generated LFP signal are as follows Figure 6 shown.

[0079] Based on the above solution of this embodiment, this embodiment can be modified or improved in the following ways: 1) Alternative implementations of encoder and denoising networks: Although this embodiment uses a combination of Transformer and GRU, other model units can be used as replacements without departing from the principle of "global + local" integration. For example, the Transformer can be replaced with other networks with long-term memory capabilities, such as the Long Short-Term Memory (LSTM) network combined with an attention mechanism, or the latest structured state-space model (S4) layer; the GRU can also be replaced with a variant of the LSTM unit or gated unit. If a more efficient new sequence modeling unit emerges, it can also be integrated into the diffusion denoising network. The above replacements are all changes to the implementation of the same function and are still within the scope of protection of this embodiment.

[0080] 2) Diffusion Model Variants: The diffusion probability model itself has various implementations, such as score-based models (diffusion based on score matching) or different sampling strategies (such as DDIM sampling). This embodiment is not limited to a specific diffusion model formula; any framework that can implement stepwise denoising generation can be used. If more efficient diffusion algorithms emerge in the future (such as those with faster sampling step scheduling or those combined with energy models), they can be introduced as an alternative to improve generation speed or quality.

[0081] 3) Changes to the Conditional Injection Method: This embodiment implements conditional control, but the specific injection method can vary. For example, in addition to concatenating the conditional vector at the input, it is also possible to conditionally modulate the network's intermediate features using the FiLM (Linear Modulation of Feature Maps) method, or to implement conditioning by introducing additional conditional noise channels during the diffusion process. These different implementation methods achieve similar effects and should also be included in the scope of protection.

[0082] 4) Expansion of applicable signal types: Although this embodiment focuses on LFP, its method is universally applicable to other continuous signal types. For example, biological signals with continuous time series characteristics, such as EEG signals, EMG signals, and ECG signals, can all serve as input and output of this model. In each case, simply adjusting the encoder / decoder (for example, changing the number of input channels or normalization method) and the training data based on the characteristics of the signal, can enable this method to generate the corresponding type of signal. Therefore, this embodiment also has potential applications in simulating a wider range of biomedical data.

[0083] 5) Online generation and interactive applications: Although this embodiment primarily considers offline batch generation, by optimizing the model and deploying it in a high-performance computing environment, this method can also be used for online, real-time signal generation. For example, in brain-computer interface training, the system can generate expected brain signal changes for simulation based on the real-time decoded intent, achieving real-time simulated feedback of human brain activity. In addition, in scientific research and teaching, the model can be used as an interactive tool. Users can adjust the conditional parameters to see the corresponding LFP pattern changes, thereby gaining a more intuitive understanding of neural dynamics.

[0084] 6) Alternatives to Some Modules: For latent state evolution, in addition to the ODE+GRU combination, discrete-time state-space models (such as the Kalman filter) can also be used to simulate it. This can reduce implementation complexity in certain simplified scenarios. Similarly, the encoder-decoder is not limited to a completely symmetric structure. Improvements such as skip connections or attention-guided decoding can be introduced to improve reconstruction accuracy. These adjustments are specific implementation details and do not affect the overall solution.

[0085] 7) Hardware Implementation and Packaging: This embodiment can also be provided as a software toolkit or embedded system module. For example, a trained model can be embedded in an edge computing device to generate simulated signals for an implantable neural interface device to test its performance. Alternatively, it can be packaged as a cloud service interface to generate data on demand for users.

[0086] All of the above improvements and modifications should fall within the protection scope of this embodiment.

[0087] This embodiment achieves the following technical effects through the above technical solution: 1) This example uses a diffusion model to finely model the latent space and combines it with the continuous dynamics constraints provided by ODE. The generated LFP signal is highly close to the real data in terms of waveform morphology and statistical properties. 2) This example pre-trains and integrates the Transformer+GRU denoising network structure, achieving stable model training and generation. Furthermore, it can flexibly generate conditional data for various types of conditions (discrete task labels, continuous behavior curves, stimulus timing, etc.), enabling customized generation of LFP data for specific scenarios. 3) This embodiment combines the Transformer and GRU to ensure that the model focuses on long-term dependencies and guarantees smooth connections and micro-dynamics between adjacent sampling points, achieving the advantages of taking both global and local features into account. 4) This embodiment jointly models multi-channel data, making the generated multi-channel LFP significantly superior to the solution of independently generating each channel in terms of inter-channel correlation. In addition, it makes fewer assumptions about the distribution of input data and can adapt to LFP data from different species and different brain regions, increasing the applicability and scalability of the model.

[0088] Exemplary devices Based on the above embodiments, the present invention further provides a local field potential signal generation system based on an improved diffusion model, comprising: A data input module is used to acquire and preprocess the original noisy signal, time stamp information, multi-channel behavioral signal or stimulus signal to obtain preprocessed data; A Transformer encoder module is used to perform multi-head self-attention calculation on the preprocessed data to obtain the latent state of the LFP sequence in the latent space; a latent sampling module for sampling latent variables according to the latent state; The ODE-GRU evolution module is used to continuously solve the ODE and update the discrete GRU rules on the obtained initial latent variables to generate a latent state sequence that evolves over time; a diffusion generation module, configured to perform forward denoising and reverse denoising sampling on the latent state sequence based on a diffusion model to obtain a final latent sequence; The decoding and output module is used to map the potential sequence finally obtained by the diffusion model back to the LFP signal of preset dimensions and output the simulated LFP time series data.

[0089] This embodiment achieves the following technical effects through the above technical solution: 1) This example uses a diffusion model to finely model the latent space and combines it with the continuous dynamics constraints provided by ODE. The generated LFP signal is highly close to the real data in terms of waveform morphology and statistical properties. 2) This example pre-trains and integrates the Transformer+GRU denoising network structure, achieving stable model training and generation. Furthermore, it can flexibly generate conditional data for various types of conditions (discrete task labels, continuous behavior curves, stimulus timing, etc.), enabling customized generation of LFP data for specific scenarios. 3) This embodiment combines the Transformer and GRU to ensure that the model focuses on long-term dependencies and guarantees smooth connections and micro-dynamics between adjacent sampling points, achieving the advantages of taking both global and local features into account. 4) This embodiment jointly models multi-channel data, making the generated multi-channel LFP significantly superior to the solution of independently generating each channel in terms of inter-channel correlation. In addition, it makes fewer assumptions about the distribution of input data and can adapt to LFP data from different species and different brain regions, increasing the applicability and scalability of the model.

[0090] Based on the above embodiment, the present invention further provides a terminal, whose principle block diagram can be shown as follows: Figure 7 shown.

[0091] The terminal includes: a processor, memory, interface, display screen and communication module connected via a system bus; wherein the processor of the terminal is used to provide computing and control capabilities; the memory of the terminal includes a storage medium and an internal memory; the storage medium stores an operating system and computer programs; the internal memory provides an environment for the operation of the operating system and computer programs in the storage medium; the interface is used to connect to external devices; the display screen is used to display corresponding information; and the communication module is used to communicate with a cloud server or other devices.

[0092] When the computer program is executed by a processor, the computer program is used to implement the operation of the local field potential signal generation method based on the improved diffusion model.

[0093] It will be understood by those skilled in the art that Figure 7 The principle block diagram shown in the figure is only a block diagram of a partial structure related to the solution of the present invention, and does not constitute a limitation on the terminal to which the solution of the present invention is applied. The specific terminal may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0094] In one embodiment, a terminal is provided, which includes: a processor and a memory, wherein the memory stores a local field potential signal generation program based on an improved diffusion model, and when the local field potential signal generation program based on the improved diffusion model is executed by the processor, it is used to implement the operation of the local field potential signal generation method based on the improved diffusion model as described above.

[0095] In one embodiment, a storage medium is provided, wherein the storage medium stores a local field potential signal generation program based on an improved diffusion model, and when the local field potential signal generation program based on the improved diffusion model is executed by a processor, it is used to implement the operation of the local field potential signal generation method based on the improved diffusion model as described above.

[0096] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile storage medium. When executed, the computer program can include the processes in the above-described method embodiments. Any reference to memory, storage, database, or other media used in the various embodiments provided herein may include both non-volatile and volatile memory.

[0097] In summary, the present invention provides a method and system for generating local field potential signals based on an improved diffusion model, including: acquiring and preprocessing original noisy signals, timestamp information, multi-channel behavioral signals, or stimulus signals; performing multi-head self-attention calculations on the preprocessed data based on a Transformer encoder to obtain the latent state of the LFP sequence in the latent space; sampling latent variables based on the latent state, and continuously solving the obtained initial latent variables with ODEs and updating discrete GRU rules to generate a latent state sequence that evolves over time; performing forward denoising and reverse denoising sampling on the latent state sequence based on the diffusion model to obtain the final latent sequence; mapping the latent sequence finally obtained by the diffusion model back to an LFP signal of a preset dimension, and outputting simulated LFP time series data. The present invention achieves high-fidelity, conditionally controllable, and structurally stable neural signal generation.

[0098] It should be understood that the application of the present invention is not limited to the above examples. For those skilled in the art, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.

Claims

1. A method for generating local field potential signals based on an improved diffusion model, characterized in that: include: Acquire and preprocess original noisy signals, timestamp information, multi-channel behavioral signals or stimulus signals to obtain preprocessed data; Performing multi-head self-attention calculation on the preprocessed data based on the Transformer encoder to obtain the latent state of the LFP sequence in the latent space; Sampling latent variables according to the latent state, and continuously solving ODE and updating discrete GRU rules on the obtained initial latent variables to generate a latent state sequence that evolves over time; Performing forward denoising and reverse denoising sampling on the latent state sequence based on a diffusion model to obtain a final latent sequence; The latent sequence finally obtained by the diffusion model is mapped back to the LFP signal of the preset dimension, and the simulated LFP time series data is output.

2. The method for generating local field potential signals based on an improved diffusion model according to claim 1, characterized in that: The Transformer encoder-based multi-head self-attention calculation is performed on the preprocessed data to obtain the latent state of the LFP sequence in the latent space, including: Feature extraction and time series self-attention modeling are performed on the preprocessed data, and the latent state of the LFP sequence in the latent space is output based on the extracted features and the calculated multi-head self-attention.

3. The method for generating local field potential signals based on an improved diffusion model according to claim 2, wherein: The process of performing feature extraction and time series self-attention modeling on the preprocessed data, and outputting the latent state of the LFP sequence in the latent space according to the extracted features and the calculated multi-head self-attention, includes: Extracting temporal pattern features from the LFP sequence of the preprocessed data and performing self-attention modeling of the time series; Perform Transformer encoding based on the extracted features and calculated multi-head self-attention to obtain the hidden state; According to the latent state obtained after encoding, an aggregation operation is performed on the last moment of the LFP sequence or the entire LFP sequence to obtain the corresponding latent mean vector and latent variance vector; The latent state is obtained by reparameterized sampling based on the mean vector and the latent variance vector.

4. The method for generating local field potential signals based on an improved diffusion model according to claim 1, wherein: The latent variable sampling is performed according to the latent state, and the obtained initial latent variables are continuously solved by ODE and updated by discrete GRU rules to generate a latent state sequence that evolves over time, including: Input the potential state into the ODE model and use a multi-layer perceptron or convolutional network to simulate the evolution trajectory of the potential state in continuous time; Updating the latent state at discrete time steps based on a GRU module; The evolution trajectory is combined with the updated latent state to capture the continuous evolution and discrete jump characteristics of the latent dynamics of the LFP sequence, generating the latent state sequence that evolves over time.

5. The method for generating local field potential signals based on an improved diffusion model according to claim 4, characterized in that: The GRU module is based on updating the potential state at discrete time steps, including: After each discrete time step, the potential state is updated based on the increment solved by the GRU module.

6. The method for generating local field potential signals based on an improved diffusion model according to claim 1, characterized in that: The forward denoising and reverse denoising sampling of the potential state sequence based on the diffusion model to obtain the final potential sequence includes: Based on the diffusion model, forward noise is gradually added to the potential state sequence according to a preset noise scheduling coefficient and standard Gaussian noise to obtain a continuous-time diffusion sequence; Inputting the potential state of each diffusion step in the diffusion sequence, the diffusion time step indication, and the condition vector into the denoising network; Within the denoising network, the latent state of each diffusion step is passed through several layers of self-attention Transformer sublayers to extract global correlation features, and the implicit state of the previous moment is introduced. The representation of each time step is updated through the GRU unit to obtain the final noise-free latent sequence.

7. The method for generating local field potential signals based on an improved diffusion model according to claim 1, wherein: Mapping the potential sequence finally obtained by the diffusion model back to the LFP signal of a preset dimension and outputting the simulated LFP time series data includes: The latent sequence finally obtained by the diffusion model is mapped back to the LFP signal of the preset dimension according to the synchronous generation strategy of the multi-channel signal, and the LFP time series data generated by the simulation is output.

8. A local field potential signal generation system based on an improved diffusion model, characterized in that: include: A data input module is used to acquire and preprocess the original noisy signal, time stamp information, multi-channel behavioral signal or stimulus signal to obtain preprocessed data; A Transformer encoder module is used to perform multi-head self-attention calculation on the preprocessed data to obtain the latent state of the LFP sequence in the latent space; a latent sampling module for sampling latent variables according to the latent state; The ODE-GRU evolution module is used to continuously solve the ODE and update the discrete GRU rules on the obtained initial latent variables to generate a latent state sequence that evolves over time; a diffusion generation module, configured to perform forward denoising and reverse denoising sampling on the latent state sequence based on a diffusion model to obtain a final latent sequence; The decoding and output module is used to map the potential sequence finally obtained by the diffusion model back to the LFP signal of preset dimensions and output the simulated LFP time series data.

9. A terminal, characterized in that: include: A processor and a memory, wherein the memory stores a local field potential signal generation program based on an improved diffusion model, and when the local field potential signal generation program based on the improved diffusion model is executed by the processor, it is used to implement the operation of the local field potential signal generation method based on the improved diffusion model as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a local field potential signal generation program based on an improved diffusion model, and when the local field potential signal generation program based on the improved diffusion model is executed by a processor, it is used to implement the operation of the local field potential signal generation method based on the improved diffusion model as described in any one of claims 1 to 7.

Citation Information

Cited By

  • EEG self-supervised representation learning method based on potential diffusion model

    CN121030338A

  • User potential intention modeling method and system based on continuous time dynamics

    CN121093798A