Neural pulse signal processing method, system and electronic device for brain-computer interface

CN122593633BActive Publication Date: 2026-09-25SHENZHEN MANST TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611081434.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-07-21
Publication Date
2026-09-25
Estimated Expiration
2046-07-21

AI Technical Summary

Technical Problem

[0003]随着神经网络技术的发展,利用神经网络来对神经脉冲信号进行解码的方式逐渐成为脑电解码的主流,但神经网络固有的高计算量和高延迟问题,使其难以满足便携式、低功耗脑机接口设备的严苛要求

Benefits of technology

[0017]本发明的其他特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明而了解。本发明的目的和其他优点在说明书以及附图中所特别指出的结构来实现和获得。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122593633B_ABST
    Figure CN122593633B_ABST
Patent Text Reader

Abstract

The application provides a neural pulse signal processing method and system for a brain-computer interface and an electronic device, and relates to the field of brain-computer interface control. The method creatively adopts a dynamically adjustable membrane time factor, can adjust the neuron integral time in real time according to the statistical characteristics of the neural pulse signal, and thus solves the adaptation problem of the fixed parameter model in the prior art when processing the non-stationary characteristics of the electroencephalogram signal. In addition, the method introduces a spatio-temporal joint attention mechanism based on a pulse timing-dependent plasticity rule, can accurately capture the long-range dependence relationship in the electroencephalogram signal by synchronously calculating the attention weights in the spatial and temporal dimensions, and realizes higher neural pulse signal decoding performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of brain-computer interface control, and in particular to a method, system, and electronic device for processing neural impulse signals for brain-computer interfaces. Background Technology

[0002] In the field of brain-computer interfaces, non-invasive brain-computer interfaces, which collect brain signals through scalp electrodes, have become the mainstream technology due to their advantages of safety, non-invasiveness, and ease of operation. However, non-invasive brain signals have inherent defects such as low signal-to-noise ratio, strong non-stationarity, large individual differences, and limited spatiotemporal resolution, which have become the core technical bottleneck restricting high-precision brain signal decoding.

[0003] With the development of neural network technology, the method of using neural networks to decode neural pulse signals has gradually become the mainstream of EEG decoding. However, the inherent high computational load and high latency of neural networks make it difficult to meet the stringent requirements of portable, low-power brain-computer interface devices.

[0004] Specifically, the traditional leaky integral firing (LIF) neurons in existing technologies use a fixed membrane time factor, which cannot adapt to the non-stationary characteristics of EEG signals. In addition, existing spiking neural network architectures mostly rely on convolutional layers and pooling layers to extract local features, making it difficult to effectively capture long-range spatial dependencies across brain regions and long-range temporal correlations across time steps in EEG signals. Summary of the Invention

[0005] In view of this, the purpose of this invention is to provide a neural pulse signal processing method, system, and electronic device for brain-computer interfaces. This method creatively employs a dynamically adjustable membrane time factor, which can adjust the neuron integral time in real time according to the statistical characteristics of the neural pulse signal, thereby solving the adaptation problem of fixed parameter models in the prior art when processing the non-stationary characteristics of EEG signals. In addition, this method introduces a spatiotemporal joint attention mechanism based on the pulse temporal dependence plasticity rule, which can accurately capture the long-range dependence in EEG signals by synchronously calculating the attention weights in the spatial and temporal dimensions, thereby achieving more efficient neural pulse signal decoding performance.

[0006] In a first aspect, embodiments of the present invention provide a method for processing neural impulse signals for a brain-computer interface, the method comprising: After performing a Hilbert transform on the neural pulse signals acquired by the target brain-computer interface to obtain the analyzed signal of the EEG signal, the instantaneous phase and instantaneous amplitude in the analyzed signal are extracted simultaneously; based on preset sampling points, the instantaneous phase is mapped to the firing time interval of the neural pulse signal, and the pulse firing probability of the neural pulse signal is calculated through the instantaneous amplitude; The membrane time factor of the neural pulse signal is calculated based on the firing time interval and pulse firing probability. The neuronal membrane potential of the neural pulse signal at the current moment is calculated using the membrane time factor, and the target pulse tensor corresponding to the neural pulse signal is obtained based on the neuronal membrane potential. The query tensor, key tensor, and value tensor of the target impulse tensor are obtained. The attention weight score of the neural impulse signal is calculated using the difference between the query tensor and the key tensor. The feature output tensor corresponding to the value tensor is then calculated using the attention weight score. Finally, the feature decoding result of the neural impulse signal is obtained through the feature output tensor.

[0007] Optionally, after performing a Hilbert transform on the neural impulse signals acquired by the target brain-computer interface to obtain the analyzed EEG signal, the instantaneous phase and instantaneous amplitude in the analyzed signal are extracted simultaneously, including: After sequentially filtering, denoising, and standardizing the neural impulse signals acquired by the single channel of the target brain-computer interface, the EEG signals of the target brain-computer interface are obtained. After performing a Hilbert transform on the electroencephalogram (EEG) signal, the transformed signal of the neural impulse signal is obtained; An analytical signal for EEG signals is constructed using EEG signals and transformed signals; The oscillation phase extracted from the analytical signal is taken as the instantaneous phase, and the energy intensity extracted from the analytical signal is taken as the instantaneous amplitude.

[0008] Optionally, the instantaneous phase is mapped to the firing time interval of the neural pulse signal based on preset sampling points, and the pulse firing probability of the neural pulse signal is calculated through the instantaneous amplitude, including: By mapping the instantaneous phase to the firing time of the neural pulse signal through preset sampling points, and keeping the pulse firing rhythm synchronized with the oscillation rhythm of the EEG signal, the firing time interval of the neural pulse signal is obtained. The theoretical firing time of the neural pulse signal at the preset sampling point is obtained, and the pulse firing probability of the neural pulse signal is calculated by using the theoretical firing time and instantaneous amplitude.

[0009] Optionally, the membrane time factor of the neural impulse signal is calculated based on the firing time interval and the impulse firing probability, including: When the pulse firing probability at the target sampling point is not less than the preset firing probability threshold, the input pulse of the neural pulse signal is generated according to the firing time interval corresponding to the target sampling point, and the input current amplitude of the neural pulse signal is obtained based on the input pulse. The membrane time factor of the neural impulse signal is calculated using the input current amplitude; the membrane time factor is obtained by the following formula: ; for Membrane time factor at a given time; This is the lower limit of the membrane time factor; This is the upper limit of the membrane time factor; Use the Sigmoid activation function; This is the amplitude scaling factor; The sliding time window length is used to calculate the average amplitude of the input current; For the first Input current amplitude at each target sampling point; This is the bias parameter.

[0010] Optionally, the neuronal membrane potential at the current moment can be calculated using the membrane time factor, including: Based on the input pulse, the neuronal membrane resistance and resting reset potential of the neuronal pulse signal at a preset time step are obtained; The neuronal membrane potential at the current moment is calculated using neuronal membrane resistance, neuronal resting reset potential, and membrane time factor.

[0011] Optionally, the target pulse tensor corresponding to the neural pulse signal is obtained based on the neuronal membrane potential, including: When the neuron membrane potential is greater than a preset membrane potential threshold, a target pulse of the neural pulse signal is generated based on the neuron membrane potential. The number of time steps and the number of channels of the neural impulse signal contained in the sliding time window length are obtained, and the feature dimensions of the neural impulse signal are obtained through instantaneous phase and instantaneous amplitude. A three-dimensional pulse tensor for the target pulse is constructed based on the number of time steps, the number of channels, and the feature dimension. After performing a linear transformation on the three-dimensional pulse tensor using a preset weight matrix, the target pulse tensor of the neural pulse signal is determined using the obtained query tensor, key tensor, and value tensor.

[0012] Optionally, the attention weight score of the neural impulse signal can be calculated using the difference between the query tensor and the key tensor, including: The pulse timing dependency value is calculated based on the time difference between the target query pulse in the query tensor and the target key pulse in the key tensor. Get the first cumulative pulse count of the query tensor in the first channel before the first time, and get the second cumulative pulse count of the key tensor in the second channel before the second time. The attention weight scores of the neural impulse signal at the first time, the first channel, the second time, and the second channel are calculated using the impulse time-dependent value.

[0013] Optionally, the feature output tensor corresponding to the value tensor is calculated using the attention weight scores, including: An attention score matrix for neural impulse signals is constructed based on the number of time steps and the number of channels. The attention weights in the attention score matrix are calculated using a pre-defined normalization function; Obtain the feature vectors of the second time and second channel value tensors, and obtain the feature output tensor of the value tensor based on the product of the feature vectors and the attention weights.

[0014] In a second aspect, the present invention provides a neural impulse signal processing system for a brain-computer interface, the system comprising: The pulse firing probability calculation module is used to perform Hilbert transform on the neural pulse signals acquired by the target brain-computer interface to obtain the analyzed signal of the EEG signal, and simultaneously extract the instantaneous phase and instantaneous amplitude from the analyzed signal; based on preset sampling points, the instantaneous phase is mapped to the firing time interval of the neural pulse signal, and the pulse firing probability of the neural pulse signal is calculated through the instantaneous amplitude; Neuron integral processing module: used to calculate the membrane time factor of the neural pulse signal based on the firing time interval and pulse firing probability, use the membrane time factor to calculate the neuronal membrane potential of the neural pulse signal at the current moment, and obtain the target pulse tensor corresponding to the neural pulse signal based on the neuronal membrane potential; The neural pulse signal decoding module is used to obtain the query tensor, key tensor, and value tensor of the target pulse tensor. It calculates the attention weight score of the neural pulse signal using the difference between the query tensor and the key tensor, and then calculates the feature output tensor corresponding to the value tensor using the attention weight score. Finally, it obtains the feature decoding result of the neural pulse signal through the feature output tensor.

[0015] Thirdly, embodiments of the present invention also provide an electronic device, which includes a processor and a memory, the memory storing computer-executable instructions that can be executed by the processor, the processor executing the computer-executable instructions to implement the steps of the neural impulse signal processing method for brain-computer interface provided in the first aspect.

[0016] This invention provides a method, system, and electronic device for processing neural pulse signals in a brain-computer interface. In the process of decoding neural pulse signals from a brain-computer interface, the method first performs a Hilbert transform on the neural pulse signals acquired by the target brain-computer interface to obtain an analytical signal of the electroencephalogram (EEG). Then, it simultaneously extracts the instantaneous phase and instantaneous amplitude from the analytical signal. Based on preset sampling points, the instantaneous phase is mapped to the firing time interval of the neural pulse signal, and the firing probability of the neural pulse signal is calculated using the instantaneous amplitude. Next, the membrane time factor of the neural pulse signal is calculated based on the firing time interval and the firing probability. The neuronal membrane potential of the neural pulse signal at the current moment is calculated using the membrane time factor, and the target pulse tensor corresponding to the neural pulse signal is obtained based on the neuronal membrane potential. Then, the query tensor, key tensor, and value tensor of the target pulse tensor are obtained. The attention weight score of the neural pulse signal is calculated using the difference between the query tensor and the key tensor. The feature output tensor corresponding to the value tensor is calculated using the attention weight score, and the feature decoding result of the neural pulse signal is obtained through the feature output tensor. This method creatively employs a dynamically adjustable membrane time factor, which can adjust the neuronal integration time in real time according to the statistical characteristics of neural impulse signals, thereby solving the adaptation problem of fixed parameter models in the prior art when dealing with the non-stationary characteristics of EEG signals. In addition, this method introduces a spatiotemporal joint attention mechanism based on the pulse temporal dependence plasticity rule, which can accurately capture long-range dependencies in EEG signals by synchronously calculating attention weights in the spatial and temporal dimensions, thereby achieving more efficient neural impulse signal decoding performance.

[0017] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained through the structures particularly pointed out in the description and the drawings.

[0018] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0019] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0020] Figure 1 A flowchart illustrating a neural impulse signal processing method for a brain-computer interface, provided as an embodiment of the present invention; Figure 2This is a structural diagram of a spiking neural network model in a neural spiking signal processing method for brain-computer interfaces provided in an embodiment of the present invention; Figure 3 This is a flowchart of the attention mechanism in a neural impulse signal processing method for brain-computer interface provided in an embodiment of the present invention; Figure 4 A flowchart illustrating the workflow of a neuron model with dynamically adjustable membrane time factor in a neural pulse signal processing method for brain-computer interface provided in an embodiment of the present invention. Figure 5 A flowchart of another neural impulse signal processing method for brain-computer interface provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of a neural pulse signal processing system for brain-computer interface provided in an embodiment of the present invention; Figure 7 A schematic diagram of another neural pulse signal processing system for brain-computer interface provided in an embodiment of the present invention; Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.

[0021] icon: 100 - Pulse firing probability calculation module; 200 - Neuron integral processing module; 300 - Neural pulse signal decoding module; 101 - Processor; 102 - Memory; 103 - Bus; 104 - Communication interface. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0023] To facilitate understanding of this embodiment, a detailed description of a neural impulse signal processing method for brain-computer interfaces disclosed in this embodiment of the invention will be provided first. The method is as follows: Figure 1 As shown, it includes: Step S101: After performing Hilbert transform on the neural pulse signal acquired by the target brain-computer interface to obtain the analyzed signal of the EEG signal, the instantaneous phase and instantaneous amplitude in the analyzed signal are extracted simultaneously; the instantaneous phase is mapped to the firing time interval of the neural pulse signal based on the preset sampling points, and the pulse firing probability of the neural pulse signal is calculated through the instantaneous amplitude.

[0024] This step converts the preprocessed continuous multichannel EEG signals into discrete pulse sequences that simultaneously carry phase and amplitude information. The specific implementation process is as follows: Analyzing Signal Construction and Feature Decoupling: Continuous EEG Signals with Single-Channel Input Perform the Hilbert transform to obtain the corresponding transformed signal. A complex analytic signal is constructed based on the original EEG signal and the Hilbert transform result, and the instantaneous amplitude at each sampling time is synchronously calculated from the analytic signal. With instantaneous phase The instantaneous amplitude represents the signal energy intensity at that moment, and the instantaneous phase reflects the oscillation phase state of the EEG signal.

[0025] Phase-mapped firing rhythm: Instantaneous phases are mapped to pulse firing intervals, synchronizing the pulse firing rhythm with the oscillation rhythm of the EEG signal itself. The pulse firing interval is longest when the instantaneous phase is 0; when the instantaneous phase is... At this time, the pulse firing interval is the shortest, so that the generated pulse sequence naturally retains the oscillatory rhythm characteristics of the EEG signal.

[0026] Amplitude modulation pulse transmission probability: Construct an amplitude modulation pulse transmission probability function, set a reference pulse transmission probability to ensure the transmission of the basic pulse under low amplitude signals; combine the instantaneous amplitude with the transmission intensity through a nonlinear function, and set a phase decay time constant to limit the effective range of phase information, so that the signal amplitude is positively correlated with the pulse transmission probability, and realize the embedding of amplitude information into the pulse sequence.

[0027] Pulse sequence generation: At each time step, a random number between 0 and 1 is generated and compared with the pulse firing probability at the current time. If the random number is less than the firing probability, a pulse is fired at that time step; otherwise, no pulse is fired. After traversing all sampling points of all channels, a complete discrete pulse sequence is output, completing the conversion from continuous EEG signals to the pulse domain.

[0028] Step S102: Calculate the membrane time factor of the neural pulse signal based on the firing time interval and pulse firing probability, calculate the neuronal membrane potential of the neural pulse signal at the current moment using the membrane time factor, and obtain the target pulse tensor corresponding to the neural pulse signal based on the neuronal membrane potential.

[0029] This step uses a leak-integral firing neuron model with a dynamically adjustable membrane time factor to process the pulse sequence, adapting to the non-stationary characteristics of EEG signals, and finally outputting a standardized three-dimensional target pulse tensor. The specific implementation process is as follows: Local statistical calculation of input signal: At each time step t, a sliding time window of length W before the current time is taken, and the average amplitude of the input current within the window is statistically analyzed as the input basis for dynamic adjustment of the membrane time factor.

[0030] Adaptive adjustment of the membrane time factor: Based on the local average amplitude of the input signal, the amplitude feature is normalized to the 0-1 range using the Sigmoid activation function. Linear interpolation is then performed between a preset lower and upper limit for the membrane time factor to obtain the adaptive membrane time factor for the current moment. When the local average amplitude of the input signal is large and the signal change rate is fast, the membrane time factor automatically decreases to improve the neuronal response speed; when the local average amplitude of the input signal is small and the signal change rate is slow, the membrane time factor automatically increases to extend the integration time and fully accumulate effective information, achieving dynamic adaptation of the neuronal integral characteristics to non-stationary EEG signals.

[0031] Precise Discrete Update of Membrane Potential: The differential equation of neuronal membrane potential dynamics is precisely discretized and solved using the integral factor method to obtain a recursive membrane potential update formula; based on the membrane potential of the previous moment, the adaptive membrane time factor, and the input current, the natural discharge term of the membrane potential and the charging term of the input current are calculated respectively to update the neuronal membrane potential at the current moment.

[0032] Pulse firing and state reset: Determine whether the membrane potential has reached the preset firing threshold at the current moment. If the threshold is reached, the neuron fires a pulse and resets the membrane potential to the resting reset potential, and enters a refractory period of fixed duration, during which it does not respond to any input stimulus. If the threshold is not reached, the membrane potential remains in a state of natural decay.

[0033] Target impulse tensor output: After being processed layer by layer by multiple feature extraction neurons, the generated dimension is... The three-dimensional target impulse tensor, where T is the time step, C is the number of channels, and D is the feature dimension, is used as the input to the subsequent attention decoding module.

[0034] Step S103: Obtain the query tensor, key tensor, and value tensor of the target impulse tensor. Calculate the attention weight score of the neural impulse signal using the difference between the query tensor and the key tensor. Calculate the feature output tensor corresponding to the value tensor using the attention weight score. Then, obtain the feature decoding result of the neural impulse signal through the feature output tensor.

[0035] This step constructs a spatiotemporal joint attention mechanism based on the impulse temporal dependence plasticity rule, simultaneously capturing the long-range spatial dependence of EEG signals across brain regions and the long-range temporal correlation across time steps, ultimately outputting the user intent decoding result. The specific implementation process is as follows: Query / key / value pulse tensor generation: The three-dimensional target pulse tensor is input into three independent linear transformation layers, batch normalized, and then fed through a leaky integral neuron layer to generate query tensor Q, key tensor K, and value tensor V, respectively. All three types of tensors are in the form of discrete pulse sequences, and the temporal encoding information of the pulses is completely preserved.

[0036] Spatiotemporal Joint Attention Score Calculation: A four-dimensional spatiotemporal attention score matrix is ​​constructed, simultaneously covering the temporal and channel spatial dimensions. Matrix elements represent the attentional correlation strength between a channel at a given time step and another channel at a different time step. The attention score is calculated entirely based on the impulse temporal dependence plasticity rule: all impulse pairs in the query and key tensors are traversed, the firing time difference of each impulse pair is calculated, and the weight score of a single impulse pair is obtained through the STDP learning window function; the weight scores of all impulse pairs are accumulated to obtain the attention score at the corresponding spatiotemporal position. When query impulses are generally later than key impulses, the attention score is positive, indicating a positive correlation between the two; when query impulses are generally earlier than key impulses, the attention score is negative, indicating a negative correlation between the two. The calculation process fully utilizes the temporal encoding characteristics of impulses, combining biological rationality with feature representation capabilities.

[0037] Attention weight normalization and feature weighting: Softmax normalization is performed on the spatiotemporal attention score matrix to obtain standardized spatiotemporal attention weights; the attention weights and the features at the corresponding positions of the value tensor are weighted and summed to obtain the attention output features at each spatiotemporal position, thus completing the feature aggregation of long-range spatiotemporal dependencies.

[0038] Multi-head attention feature integration: A multi-head attention mechanism is introduced, which splits the query, key, and value tensors into multiple independent attention heads along the feature dimension and completes the above attention calculation process in parallel; the output features of all attention heads are concatenated along the feature dimension, and then integrated through a linear transformation to obtain a high-level spatiotemporal feature tensor that integrates multi-view features.

[0039] Decoding output: Global average pooling is performed on the high-level spatiotemporal feature tensor to convert the three-dimensional features into a one-dimensional feature vector; the feature vector is input into the classification output layer, and the total number of pulses fired by each class neuron within the complete time window is counted. The class corresponding to the neuron with the most pulses fired is taken as the final user intent decoding result, thus completing the decoding of the neural pulse signal.

[0040] The raw acquired EEG signals are then purified, and amplitude-phase decoupling is performed using Hilbert transform to extract transient features suitable for subsequent pulse coding. Optionally, after performing Hilbert transform on the neural pulse signals acquired by the target brain-computer interface to obtain the analyzed EEG signal, the transient phase and transient amplitude in the analyzed signal are extracted simultaneously, including the following steps: Step S201: After sequentially filtering, denoising, and standardizing the neural impulse signals acquired by the single channel of the target brain-computer interface, the electroencephalogram (EEG) signals of the target brain-computer interface are obtained. .

[0041] The raw neural electrical signals acquired by the target brain-computer interface via a single-channel scalp electrode are sequentially subjected to bandpass filtering, artifact denoising, and amplitude normalization to obtain a preprocessed single-channel continuous EEG signal x(t).

[0042] Specifically, firstly, bandpass filtering is used to remove DC drift and high-frequency random noise from the signal, retaining the effective frequency band rhythmic components corresponding to the EEG task. Secondly, independent component analysis is used to separate and remove physiological artifacts such as electrooculography (EOG) and electromyography (EMG), as well as environmental interference signals, improving the signal-to-noise ratio of the input signal. Finally, the signal is standardized to unify the amplitude distribution scale, eliminate the interference of individual acquisition differences and electrode impedance differences on the subsequent encoding process, and output a standardized continuous EEG signal. .

[0043] Step S202: Analyze the EEG signals After performing the Hilbert transform, the transformed signal of the neural impulse signal is obtained.

[0044] Preprocessed continuous EEG signals Performing the Hilbert transform yields the corresponding orthogonal transform signal; the calculation relationship of the Hilbert transform satisfies: ; The signal represents the change in EEG signal at time t. For integration time; for The amplitude of the EEG signal at a given time is determined. The 90° phase-shifted orthogonal components of the original EEG signal are obtained through Hilbert transform, providing a computational basis for subsequent construction of complex analytic signals and separation of instantaneous amplitude and phase characteristics.

[0045] Step S203: Construct an analytical signal of the EEG signal using EEG signals and transformation signals.

[0046] By utilizing the original EEG signal and the orthogonal signal obtained from the Hilbert transform, a complex analytic signal of the EEG signal is constructed to achieve decoupling and separation of amplitude and phase information; wherein, the analytic signal satisfies: In the formula, Let be the analytic signal at time t, and j be the imaginary unit; To analyze the instantaneous amplitude of the signal at time t, and characterize the energy intensity of the EEG signal at that time, ; To analyze the instantaneous phase of the signal at time t, reflecting the current oscillation phase state of the EEG signal, .

[0047] By mapping one-dimensional time-domain signals to the complex plane, this step can simultaneously extract two independent features, energy and phase, from single-channel EEG signals, breaking through the limitation of traditional coding that only utilizes amplitude information, and preserving richer EEG rhythm information for subsequent pulse coding.

[0048] Step S204: Take the oscillation phase extracted from the analytical signal as the instantaneous phase, and take the energy intensity extracted from the analytical signal as the instantaneous amplitude.

[0049] The oscillation phase obtained from the analytical signal is used as the instantaneous phase, and the energy intensity corresponding to the analytical signal is used as the instantaneous amplitude. The instantaneous phase sequence and instantaneous amplitude sequence of the full time step are generated according to the sampling time sequence and output synchronously, which are used as the input parameters for subsequent pulse firing time interval mapping and pulse firing probability modulation, respectively.

[0050] Optionally, the instantaneous phase is mapped to the firing time interval of the neural pulse signal based on preset sampling points, and the pulse firing probability of the neural pulse signal is calculated through the instantaneous amplitude, including the following steps: Step S301: Map the instantaneous phase to the emission time of the neural pulse signal through preset sampling points, and after keeping the pulse emission rhythm synchronized with the oscillation rhythm of the EEG signal, obtain the emission time interval of the neural pulse signal.

[0051] For the instantaneous phase of the k-th preset sampling point, the phase value is converted into the theoretical firing time interval of the neural pulse through the phase-time mapping function, so that the pulse firing rhythm is synchronized with the oscillation rhythm of the EEG signal itself, and the pulse firing time interval corresponding to each sampling point is output.

[0052] The transmission time interval and the instantaneous phase satisfy the following mapping relationship: In the formula, This represents the theoretical pulse delivery time interval corresponding to the k-th sampling point; The reference time constant is a preset fixed parameter used to calibrate the basic rhythm of pulse delivery; Let be the instantaneous phase of the kth sampling point.

[0053] Under this mapping mechanism, when the instantaneous phase is 0, When the value is 1, the pulse firing interval reaches its maximum value of 2. The issuance frequency is the lowest; when the instantaneous phase is hour, When the value is -1, the pulse firing interval reaches its minimum, and the firing frequency is the highest. Thus, the pulse firing frequency dynamically fluctuates with the oscillation phase of the EEG signal, ensuring that the firing rhythm of the pulse sequence is strictly synchronized with the inherent oscillation rhythm of the EEG. This directly encodes the phase rhythm information of the EEG into the pulse time interval structure, fully preserving the oscillation phase characteristics of the EEG signal and providing temporal dimension information that traditional amplitude encoding cannot cover for subsequent decoding.

[0054] Step S302: Obtain the theoretical firing time of the neural pulse signal at the preset sampling point, and calculate the pulse firing probability of the neural pulse signal through the theoretical firing time and instantaneous amplitude.

[0055] The theoretical firing time of the corresponding pulse is calculated based on the firing time interval of each sampling point. By combining the instantaneous amplitude at the current moment, the pulse firing probability at time t is calculated together with the amplitude modulation function and the phase decay window, thereby realizing the fusion encoding of amplitude energy information and phase rhythm information.

[0056] The pulse firing probability is calculated using the following formula: ; In the formula, Let be the pulse firing probability at time t; is the baseline pulse firing probability, which is a preset fixed value used to ensure that the baseline pulse firing still exists when the EEG signal amplitude is low, and to avoid feature loss under weak signals; m is the amplitude sensitivity coefficient, used to adjust the sensitivity of the firing probability to instantaneous amplitude changes; The instantaneous amplitude of the EEG signal at time t; This represents the theoretical firing time corresponding to the k-th pulse; This is the phase decay time constant, used to limit the effective time range of phase information.

[0057] in the formula The amplitude modulation unit is composed of: the larger the instantaneous amplitude, the closer the output of the tanh function is to 1, and the higher the overall probability of firing. It encodes the energy intensity information of the EEG signal into the probability of pulse firing. Constructing phase time window units: based on theoretical release time An exponentially decaying window is formed around the theoretical firing time. The further away from the firing time, the weaker the modulation effect of the phase on the firing probability, thus maintaining the temporal accuracy of the phase encoding. Through the synergistic effect of the baseline probability, amplitude intensity modulation, and phase time window, the final generated pulse sequence can simultaneously carry the phase rhythm information and amplitude energy information of the EEG signal, providing multi-dimensional input features for subsequent spiking neural network decoding.

[0058] Steps S301 to S302 map the instantaneous phase of the EEG signal to the time rhythm of pulse firing, and combine the instantaneous amplitude modulation pulse firing probability to realize pulse coding of EEG phase and amplitude dual-dimensional information, which solves the defects of traditional pulse coding method that only utilizes amplitude features and loses phase rhythm information.

[0059] Optionally, the membrane time factor of the neural impulse signal is calculated based on the firing time interval and the impulse firing probability, including the following steps: Step S401: When the pulse firing probability at the target sampling point is not less than the preset firing probability threshold, the input pulse of the neural pulse signal is generated according to the firing time interval corresponding to the target sampling point, and the input current amplitude of the neural pulse signal is obtained based on the input pulse.

[0060] At each target sampling time, the pulse firing probability corresponding to the current sampling point is compared with a preset firing probability threshold. When the pulse firing probability is not less than the preset firing probability threshold, a neural pulse is generated at the corresponding time according to the firing time interval corresponding to the sampling point, which serves as the input pulse of the neuron. Based on the generated input pulse sequence, the amplitude of the neuron's input current at the corresponding time step is obtained, and a continuous time step input current sequence is constructed to provide a data basis for the dynamic calculation of the membrane time factor.

[0061] Specifically, discrete input pulses are mapped to input currents of corresponding amplitudes and injected into neurons through synaptic weights: in time steps where input pulses are present, the input current takes the amplitude corresponding to the synaptic weight; in time steps where there are no input pulses, the input current is zero or maintains the baseline leakage current level, thereby converting the discrete pulse sequence into an input current signal that can drive the updating of the neuronal membrane potential.

[0062] Step S402: Calculate the membrane time factor of the neural impulse signal using the input current amplitude.

[0063] Take a sliding time window of length W, and calculate the average absolute value of the input current amplitude at each time step within the window. Combined with the preset upper and lower limits of the membrane time factor and the learnable adjustable parameters, the adaptive membrane time factor at the current moment is calculated.

[0064] The formula for calculating the membrane time factor is as follows: ; In the formula, The membrane time factor is dynamically adjusted at time t; This is the lower limit of the membrane time factor. The upper limit of the membrane time factor is set by both of them based on the typical frequency range of EEG signals, thus limiting the regulatory boundary of the membrane time factor. The Sigmoid activation function is used to normalize the statistical features of the input to the (0,1) interval, achieving smooth interpolation between the upper and lower limits. This is the amplitude scaling factor. Both are bias parameters and are trainable parameters used to adjust the response sensitivity of the membrane time factor to changes in the amplitude of the input current and the reference threshold; W is the sliding time window length, used to limit the time range of local statistics. This represents the input current amplitude at the k-th time step.

[0065] This step extracts the local average amplitude of the input current through a sliding window to characterize the local rate of change of the EEG signal: when the average amplitude of the input current within the window is large, it indicates that the current EEG signal is in a rapidly changing state with abundant high-frequency components. At this time, the Sigmoid output approaches 1, and the membrane time factor shifts towards... Convergence, faster neuronal integration speed, and timely response to rapid signal fluctuations, avoiding the loss of fast-changing details due to excessive integration time; when the average amplitude of the input current within the window is small, it indicates that the current EEG signal is in a slow-changing state with low-frequency components, at which point the Sigmoid output approaches 0, and the membrane time factor converges. Convergence, with its extended neuronal integration time, allows for the full accumulation of effective information from slowly varying signals, preventing feature loss due to insufficient integration. Through this adaptive adjustment mechanism, the neuron's integral characteristics can dynamically adapt to the non-stationary changes in EEG signals, effectively enhancing the spiking neural network's ability to extract features from time-varying EEG signals.

[0066] Steps S401 and S402 dynamically adjust the membrane time factor of the neuron in real time based on the local statistical characteristics of the input pulse, so that the integral response characteristics of the neuron match the time-varying characteristics of the EEG signal, thus solving the defect that the fixed membrane time factor of the traditional missed integral firing neuron cannot adapt to the non-stationary characteristics of the EEG signal.

[0067] Optionally, the neuronal membrane potential at the current moment can be calculated using the membrane time factor, including the following steps: Step S501: Based on the input pulse, obtain the neuronal membrane resistance and neuronal resting reset potential of the neural pulse signal at a preset time step.

[0068] Based on the discretization requirements of the input pulse sequence, the basic electrical parameters and numerical calculation parameters of the neuron model are configured, including the preset time step, neuron membrane resistance, and neuron resting reset potential.

[0069] Specifically, the preset time step is the smallest time unit for numerical discrete calculation, set according to the sampling rate of the EEG signal and the time accuracy requirements of pulse coding; the neuronal membrane resistance characterizes the leakage characteristics of the neuronal cell membrane and determines the charging gain of the membrane potential by the input current; the neuronal resting reset potential is the steady-state membrane potential of the neuron when there is no external stimulus input, and also serves as the reference value for membrane potential reset after pulse firing. These basic parameters provide a constant electrical reference for the recursive calculation of the membrane potential, ensuring the physical consistency of the neuron model.

[0070] Step S502: Calculate the neuronal membrane potential at the current moment using neuronal membrane resistance, neuronal resting reset potential, and membrane time factor.

[0071] Using the adaptive membrane time factor, neuronal membrane resistance, resting reset potential, and input current amplitude from the previous time step, the neuronal membrane potential at the current time step is recursively calculated through a discretized membrane potential dynamic equation. The recursive calculation formula for the neuronal membrane potential is as follows: ; In the formula, For the present The neuronal membrane potential at a given time, for The neuronal membrane potential at a given time, for Membrane time factor at time t, To preset the time step, This is the resting reset potential of the neuron. For neuronal membrane resistance, for The amplitude of the input current at a given time.

[0072] This recursive formula is obtained by precisely discretizing the membrane potential differential equation of the leaky-integrating neuron using the integrating factor method. Unlike the traditional Euler method approximation, this method improves the accuracy of membrane potential calculation while maintaining computational efficiency, making it more suitable for implementation in digital circuits and embedded hardware. The formula involves two physical processes: Corresponding to the natural leakage decay process of the membrane potential, when the membrane potential deviates from the resting reset potential, it will spontaneously fall back to the resting potential, and the decay rate is regulated by the dynamic membrane time factor. The charging process of the membrane capacitor corresponding to the input current drives the membrane potential to rise, and the charging rate is also dynamically determined by the membrane time factor.

[0073] Because the membrane time factor adaptively adjusts according to the local statistical characteristics of the input signal, when the input signal changes rapidly and is rich in high-frequency components, the membrane time factor automatically decreases, and the decay of the membrane potential and the charging rate accelerate synchronously, enabling neurons to respond quickly to dynamic changes in the input and avoiding the loss of details in rapid changes. When the input signal changes slowly and is dominated by low-frequency components, the membrane time factor automatically increases, and the membrane potential changes tend to be gentle, allowing neurons to fully accumulate effective information from the input signal and avoiding feature weakening caused by insufficient integration. Ultimately, this achieves dynamic adaptation of neuronal response characteristics to non-stationary EEG signals.

[0074] Optionally, obtaining the target pulse tensor corresponding to the neural pulse signal based on the neuronal membrane potential includes the following steps: Step S601: When the neuron membrane potential is greater than the preset membrane potential threshold, the target pulse of the neural pulse signal is generated based on the neuron membrane potential.

[0075] Pre-configured neuron fixed parameters: pulse firing threshold Resting reset potential Neuronal refractory period duration Read the membrane potential at the current moment after iterative updates using the dynamic membrane time factor. Execute pulse firing determination logic: If the current membrane potential Determine the trigger pulse firing of the neuron and output a pulse identifier. Simultaneously, the membrane potential is forcibly reset to... and enter duration During the refractory period, neurons block all input currents, cease updating membrane potentials, and do not generate pulses, thus avoiding the loss of fine temporal features due to dense pulse stacking. If the current membrane potential If no pulse is detected, output a pulse indicator. The membrane potential decays exponentially with the membrane resistance, and the membrane potential is continuously updated by receiving the input current at the next moment.

[0076] The above judgment is executed cyclically step by step and channel by channel, and the binary pulse identifiers corresponding to all channels and all discrete moments are output as the basic filling units of the three-dimensional pulse tensor.

[0077] Step S602: Obtain the number of time steps and the number of channels of the neural impulse signal contained in the sliding time window length, and obtain the feature dimensions of the neural impulse signal through instantaneous phase and instantaneous amplitude.

[0078] The three-dimensional pulse tensor comprises a time dimension T, a spatial channel dimension C, and a signal feature dimension D. These three types of parameters are calculated using the front-end acquisition and pulse coding processes, respectively. Time step T: determined by the discrete sampling step size of the EEG signal. The total duration of the pulse statistical sliding window is calculated, covering the complete time interval of a single EEG intention recognition and carrying all time-varying dynamic information of the EEG signal. Number of EEG channels C: Corresponds one-to-one with the actual number of acquisition channels in the multi-channel electrode cap. Each channel corresponds to a scalp acquisition point, representing the spatial dimensional relationship between different brain regions. Feature dimension D: It is generated by the instantaneous phase and instantaneous amplitude dual-class feature mapping extracted by Hilbert phase modulation coding, and simultaneously integrates EEG oscillation rhythm and signal energy features to form the intrinsic feature dimension of the pulse.

[0079] This step determines the three-dimensional tensor. Full dimensions provide a dimensional constraint baseline for tensor initialization and filling.

[0080] Step S603: Construct a three-dimensional pulse tensor for the target pulse based on the number of time steps, the number of channels, and the feature dimension.

[0081] Using the time step T, channel number C, and feature dimension D obtained in step S602 as boundaries, a three-dimensional pulse tensor containing only discrete values ​​of 0 and 1 is constructed. The build process is as follows: Initial size is A blank tensor matrix, with all coordinates filled with 0 by default (representing no impulse). Traverse all time steps All acquisition channels The pulse identifier output by S601 Fill to the coordinates of the tensor All feature dimensions are located; if a pulse is generated in this channel at this moment, the corresponding position is assigned a value of 1; After all timing and channel traversal filling is completed, a complete three-dimensional pulse tensor is obtained.

[0082] This tensor uniformly encapsulates full-time, whole-brain region channels, and phase-amplitude joint pulse features, achieving standardization of the front-end pulse coding output data format. It can be directly connected to the temporal convolution, spatial convolution, and attention layers of the spiking neural network to complete feature extraction.

[0083] Step S604: After performing a linear transformation on the three-dimensional pulse tensor using a preset weight matrix, the target pulse tensor of the neural pulse signal is determined using the obtained query tensor, key tensor, and value tensor.

[0084] The three-dimensional impulse tensor is subjected to linear mapping and neuron transformation in three independent branches to generate a query tensor Q, a key tensor K, and a value tensor V in impulse form. These three tensors together serve as the target impulse tensor supplied to the attention module. The specific implementation process is as follows: Configure three sets of independent trainable weight matrices , , The linear mapping calculations correspond to the query branch, key branch, and value branch, respectively. The three-dimensional pulse tensor X is fed into three transformation branches, and matrix multiplication linear transformation and batch normalization (BN) processing are performed sequentially. Batch normalization unifies the feature distribution of the branches, reducing training difficulty and improving the decoding stability of the spiking neural network. The normalized branch features are input into the LIF neuron layer with adjustable dynamic membrane time factor in this scheme, and the continuous floating-point features are converted into discrete 0 / 1 pulse sequences. Finally, the query tensor Q, key tensor K, and value tensor V in pulse format are output. The generated pulse-type Q, K, and V signals are integrated and output as the input target pulse tensor for the subsequent spatiotemporal joint attention calculation module based on the STDP synaptic plasticity rule. Unlike the continuous floating-point QKV features of traditional artificial neural networks, the output tensors in this step are all discrete pulse sequences, making full use of the pulse time-coding characteristics and matching the hardware implementation advantages of low power consumption and high real-time performance of spiking neural networks.

[0085] Steps S601 to S604 above are used to generate pulse identifiers based on the adaptive leak integral firing neuron output state, construct a standardized three-dimensional pulse tensor by combining EEG timing, acquisition channel, and phase amplitude features, and generate query, key, and value pulse tensors adapted to pulse timing encoding through three independent linear transformations. This provides a unified pulse domain input for subsequent spatiotemporal joint attention calculation based on STDP rules, solving the technical defects of traditional attention mechanisms that rely on continuous floating-point features and cannot adapt to the timing encoding characteristics of spiking neural networks.

[0086] Optionally, the attention weight score of the neural impulse signal can be calculated using the difference between the query tensor and the key tensor, including the following steps: Step S701: Calculate the pulse timing dependency value based on the time difference between the target query pulse in the query tensor and the target key pulse in the key tensor.

[0087] For the m-th target query pulse in the query tensor and the n-th target key pulse in the key tensor, the difference in their firing times is calculated. Based on the pulse temporal dependency plasticity learning window function, the pulse temporal dependency value of the corresponding pulse is calculated, thus realizing the temporal correlation quantization at the single-pulse level.

[0088] The formula for calculating the pulse timing dependency value is as follows: ; The impulse temporal dependency values ​​between the m-th query tensor and the n-th key tensor; and These respectively enhance the amplitude and suppress the amplitude, thereby regulating the upper limit of the intensity of positive and negative correlations; For time difference results, , For the m-th query tensor , For the nth key tensor ; To enhance the first time constant corresponding to the amplitude, The second time constant corresponding to the suppression amplitude determines the effective time range of the positive and negative time series correlations, respectively.

[0089] This window function has a clear biophysical meaning: when the query pulse firing time is later than the key pulse... When the time-dependent value is positive, corresponding to the long-term potentiation effect of biological synapses, it indicates a positive causal relationship between the two; when the query pulse firing time is earlier than the bond pulse... At this time, the corresponding long-term inhibitory effect of biological synapses is negative, indicating a negative inhibitory association between the two. This calculation method relies entirely on the temporal encoding information of the pulses, which is different from the attention calculation method based on continuous value dot products in artificial neural networks. It is highly compatible with the information transmission mechanism of spiking neural networks and has stronger biological rationality.

[0090] Step S702: Obtain the first cumulative pulse emission count of the query tensor under the first channel before the first time, and obtain the second cumulative pulse emission count of the key tensor under the second channel before the second time.

[0091] Choose any two spatiotemporal locations as the computation endpoints for attention association: the first spatiotemporal point is the first time. First Channel The corresponding statistical position of the query tensor; the second spatiotemporal point is the second time. Second Channel , corresponding to the statistical position of the key tensor.

[0092] Statistically count the historical cumulative pulse output at two spatiotemporal points: In the statistical query tensor, at the first time... Previously, the first channel The total number of pulses emitted under the current conditions is recorded as the first cumulative pulse emission count. In the statistical key tensor, at the second time... Previously, the second channel The total number of pulses emitted below is recorded as the second cumulative pulse emission count. .

[0093] The aforementioned cumulative pulse count will serve as the boundary parameter for subsequent pulse pair traversal calculations, ensuring that all pulse pairs between two spatiotemporal locations are included in the attention association calculation, fully covering all association information in the temporal and channel dimensions. At the same time, by simultaneously selecting statistical endpoints in both the temporal and channel dimensions, attention calculations naturally model long sequence associations in the temporal dimension and cross-brain region associations in the spatial channel dimension, providing a foundation for spatiotemporal joint feature extraction.

[0094] Step S703: Calculate the attention weight scores of the neural impulse signal at the first time, the first channel, the second time, and the second channel using the impulse timing dependency value.

[0095] Based on the first and second cumulative pulse emission counts, all query pulses and key pulses between the two spatiotemporal locations are traversed, and the pulse temporal dependency value corresponding to each pulse pair is accumulated to obtain the attention weight score corresponding to the spatiotemporal location. Finally, a complete four-dimensional spatiotemporal joint attention score matrix is ​​constructed.

[0096] The attention weight score is calculated using the following formula: ; For the first time First Channel Second time Second Channel Attention weight score; To query tensors in the first instance and the first passage The first cumulative pulse firing count at that time; For the second time Second Channel The second cumulative pulse firing count at that time; This represents the pulse timing dependency value between the m-th query pulse and the n-th key pulse.

[0097] This attention score simultaneously characterizes the strength of the spatiotemporal correlation: a positive score indicates a temporally enhancing positive correlation between neural activities at two spatiotemporal locations, while a negative score indicates a temporally inhibiting negative correlation; the larger the absolute value of the score, the stronger the correlation. By traversing all time steps and all channels, a dimension of [missing information] can be generated. The four-dimensional attention score matrix, where T is the total number of time steps and C is the total number of channels, fully models the long-range spatiotemporal dependencies between any time step and any channel in the EEG signal. It breaks through the limitation of traditional convolutional layers that can only extract local neighborhood features, and can effectively capture global correlation features across brain regions and time periods, providing support for high-precision EEG decoding.

[0098] Steps S701 to S703 above are based on the pulse temporal dependent plasticity (STDP) biological synaptic rule. They perform pulse-by-pulse pair temporal correlation calculations on the query pulse tensor and the bond pulse tensor, covering both the time dimension and the spatial channel dimension. This generates a four-dimensional spatiotemporal joint attention score matrix, which provides a basis for subsequent attention weight normalization and feature weighting. This solves the technical defects of existing spiking neural network attention mechanisms that directly copy the artificial neural network framework, do not fully utilize the pulse temporal encoding characteristics, and are difficult to capture long-range spatiotemporal dependencies simultaneously.

[0099] Optionally, the feature output tensor corresponding to the value tensor is calculated using the attention weight scores, including the following steps: Step S801: Construct the attention score matrix of the neural impulse signal based on the number of time steps and the number of channels.

[0100] Based on the total number of time steps T of the pulse sequence and the total number of channels C of the EEG signal, a dimension is constructed. The four-dimensional spatiotemporal joint attention score matrix. The first two dimensions of the score matrix correspond to the time index and channel index of the query end, and the last two dimensions correspond to the time index and channel index of the key end; each element in the matrix... Characterizing the first time First Channel The query pulse sequence for the second time Second Channel The temporal correlation strength of the key pulse sequence.

[0101] This score matrix covers both the time dimension and the spatial channel dimension. Unlike attention structures that are calculated along only a single dimension, it can completely model the relationship between any two spatiotemporal nodes in the EEG signal. This provides a complete basis for the weighted aggregation of long-range spatiotemporal features and supports the feature extraction of global dependencies across brain regions and time periods.

[0102] Step S802: Calculate the attention weights in the attention score matrix using a preset normalization function.

[0103] The attention score matrix is ​​normalized per query point using the Softmax normalization function, mapping the original attention scores (which include both positive and negative values) to standardized attention weights ranging from 0 to 1, where the sum of all weights for the same query point is 1. The calculation formula is as follows: ; For the first time First Channel Second time Second Channel The attention weights are defined as follows: T is the number of time steps in the pulse sequence, and C is the total number of channels in the EEG signal.

[0104] In practice, each query time-space point Using a normalized denominator, the exponential operation is performed on all attention scores pointing to all time steps and all channels at that point, and then the sum is obtained. The normalized weight is then obtained by dividing the exponential score at the corresponding position by this denominator. Through normalization, the original scores, which contain both enhancement and suppression semantics based on impulse temporal dependence plasticity, can be converted into probabilistic weights that can be used for feature weighting. This preserves the relative strength of temporal correlations and ensures the numerical stability of subsequent feature weighting summation, enabling the model to selectively strengthen strongly correlated spatiotemporal features and weaken weakly correlated interference information.

[0105] Step S803: Obtain the second time Second Channel The feature vector of the value tensor is used to obtain the feature output tensor of the value tensor based on the product of the feature vector and the attention weight.

[0106] For each query time-space point traverse all second time intervals With the second channel The feature vectors corresponding to the spatiotemporal locations in the value tensor are extracted. Each feature vector is multiplied by the standardized attention weights at the corresponding locations and then summed to obtain the output feature vector of the query spatiotemporal point. After traversing all query spatiotemporal points, a complete feature output tensor is generated.

[0107] Specifically, the second time in the value tensor Second Channel The eigenvectors under are denoted as The colon ":" is the tensor slicing operator, which means taking all elements along the feature dimension; first time First Channel The corresponding output feature vector satisfies: ; Through the above weighted aggregation process, the output features of each spatiotemporal location are fused with the feature information of all spatiotemporal locations globally, and the fusion weight is determined by the pulse temporal dependence strength. This achieves the synchronous capture of long-range spatial dependence and long-sequence correlation of EEG signals, effectively breaking through the limitation of traditional convolutional pooling structures that can only extract local neighborhood features, and improving the ability of spiking neural networks to extract and decode global spatiotemporal features of EEG signals.

[0108] Steps S801 to S803 above standardize and normalize the spatiotemporal attention scores calculated based on the pulse temporal dependence plasticity rule, and perform global weighted aggregation with the value tensor to generate a feature output tensor that integrates long-range spatiotemporal dependence information, thereby completing the feature extraction of the pulse attention layer. This solves the technical defects of existing spiking neural network dependent convolutional layers that can only extract local features and cannot effectively aggregate global correlation information across brain regions and time periods.

[0109] like Figure 2 The diagram shows the structure of the spiking neural network model. This spiking neural network decoding module adopts a hierarchical spatiotemporal feature extraction architecture. It is constructed entirely based on Leaky Integral Fire (LIF) neurons with dynamically adjustable membrane time factors. Along the data flow, it sequentially completes temporal local feature extraction, cross-channel spatial feature fusion, long-range spatiotemporal dependency modeling, high-level spatiotemporal feature deepening, global feature aggregation, and classification decoding, achieving end-to-end decoding of EEG pulse sequences from low-level signal features to high-level intention semantics. The specific configuration and functions of each layer are as follows: 1. Input Layer. The input layer receives the discrete pulse sequence output by the front-end pulse coding module, with an input dimension of... Where T is the total number of time steps in the pulse sequence, and C is the number of EEG signal acquisition channels; the input tensor is a binary discrete tensor, with elements taking values ​​of 0 or 1, corresponding to the two states of no pulse emission and pulse emission at the corresponding time and channel, respectively. This layer completes the format alignment and dimension normalization of the pulse sequence, providing standardized pulse domain input for feature extraction in subsequent layers, and ensuring the compatible transmission of data between different layers of the network.

[0110] 2. Temporal Feature Extraction Layer. This layer is configured with 32 LIF neurons whose membrane time factor is dynamically adjustable, using a size of [missing information - likely a specific size]. The convolution kernel performs temporal convolution operations with a stride of 1 and edge padding of 2, resulting in an output feature dimension of . .

[0111] in The convolutional kernel slides along the time dimension to extract local temporal features from continuous temporal pulse sequences within a single channel, capturing short-term rhythmic fluctuations and pulse firing patterns in the EEG signal. Thirty-two neurons correspond to 32 independent temporal feature channels, enriching the expression dimensions of temporal features. Padding is set to 2 to ensure the time dimension remains unchanged before and after convolution, avoiding the loss of temporal boundary information. The neurons in this layer employ a dynamic membrane time factor mechanism, which adaptively adjusts the integration time based on the local statistical characteristics of the input pulses, adapting to the non-stationary temporal characteristics of EEG signals and improving the accuracy of temporal feature extraction.

[0112] 3. Spatial Feature Extraction Layer. This layer is configured with 64 LIF neurons whose membrane time factor is dynamically adjustable, using a size of [missing information - likely a specific size]. The convolution kernel performs channel-dimensional convolution operations with a stride of 1 and edge padding of 0, resulting in an output feature dimension of [missing value]. .

[0113] in The convolutional kernel covers all acquisition channels along the channel dimension, performs full-channel weighted fusion of multi-channel temporal features, realizes cross-brain region spatial feature aggregation, extracts the collaborative association pattern of neural activities in different brain regions, eliminates spatial redundancy in the channel dimension, and completes the abstraction from multi-channel temporal features to spatial fusion features; 64 neurons correspond to 64 sets of spatial fusion features, and the channel dimension of the output features is compressed to 1, realizing feature dimensionality reduction and semantic abstraction in the spatial dimension.

[0114] 4. Pulsed Attention Layer. This layer employs an 8-head spatiotemporal joint pulsed attention mechanism, with a total feature dimension of 64. Each attention head corresponds to an 8-dimensional feature subspace, and the output feature dimension is... .

[0115] This layer calculates spatiotemporal joint attention weights based on the temporal dependence plasticity (STDP) rule, and simultaneously models the long-range order dependence of EEG signals across time steps and the long-range spatial associations across brain regions. This breaks through the limitation of the aforementioned convolutional layers, which can only extract local neighborhood features, and achieves global spatiotemporal feature association capture. The 8-head attention parallel model models differentiated spatiotemporal association patterns in different feature subspaces, improving the richness and robustness of feature representation. This enables the network to selectively strengthen key spatiotemporal features that are highly relevant to the decoding task and weaken irrelevant interference information.

[0116] 5. Spatiotemporal Feature Extraction Layer. This layer is configured with 128 LIF neurons whose membrane time factor is dynamically adjustable, using a size of [missing information - likely a specific size]. The convolution kernel performs temporal convolution operations with a stride of 1 and edge padding of 1, and the output feature dimension is [dimensionality missing]. .

[0117] Based on the attention-enhanced global features, this layer further extracts local high-level spatiotemporal joint features along the time dimension to mine refined temporal patterns after global weighting; 128 neurons increase the feature dimension to 128 dimensions, deepen the feature abstraction level, and realize high-order representation of complex spatiotemporal patterns of EEG signals; padding is set to 1 to ensure that the time dimension size is consistent with the input and maintain the integrity of temporal information.

[0118] 6. Global Average Pooling Layer. This layer performs a global average pooling operation along the time dimension on the input 3D feature map, reducing the time dimension to a minimum. The spatiotemporal feature map is compressed into a one-dimensional global feature vector of length 128.

[0119] This layer eliminates the length difference of the time dimension through global temporal aggregation, integrating the spatiotemporal features within the complete time window into a fixed-length global representation. While preserving the overall feature information, it significantly reduces the data dimension, reduces the computational load of subsequent classification layers, and can also suppress the risk of model overfitting and improve the model's generalization ability.

[0120] 7. Output Layer. This layer is configured with N LIF neurons, where N corresponds one-to-one with the number of classification categories in the EEG decoding task. The final decoding result is output using a pulse counting voting mechanism.

[0121] In the actual inference process, the total number of pulses fired by each classification neuron within the complete time window is counted, and the category corresponding to the neuron with the most pulses fired is taken as the final user intent decoding result. This classification method is fully adapted to the discrete operation characteristics of spiking neural networks, requiring no additional analog-to-digital conversion steps, and can achieve end-to-end spiking domain operations, meeting the application requirements of low power consumption and high real-time performance for portable brain-computer interface devices.

[0122] like Figure 3 The flowchart shown illustrates the attention mechanism. This flow represents the execution logic of the multi-head spatiotemporal joint pulse attention layer in the spiking neural network decoding module, based on the pulse temporal dependent plasticity (STDP) rule. Its core function is to simultaneously capture long-range sequential associations across time steps and long-range spatial dependencies across channels in the EEG pulse sequence. Through parallel computation with multiple attention heads, it achieves differentiated extraction and fusion of multi-scale spatiotemporal features, overcoming the limitation of traditional convolutional structures that can only extract local neighborhood features. The entire computation is based on discrete pulse sequences, adapting to the inherent low-power and high-real-time characteristics of spiking neural networks. The specific implementation flow is as follows: 1. Three-way parallel pulse feature mapping of input pulse tensor.

[0123] The input is a three-dimensional discrete impulse tensor. Where T is the total number of time steps in the pulse sequence, C is the number of EEG signal channels, and D is the feature dimension. The input pulse tensor is simultaneously fed into three independent feature transformation branches to generate query, key, and value pulse tensors, respectively. Query branch: Input impulse tensor via learnable weight matrix After performing a linear transformation, the feature distribution is first unified through batch normalization (BN) to accelerate training convergence. Then, the LIF neuron layer with a dynamically adjustable membrane time factor is input to convert the continuous floating-point features into a query tensor Q in the form of discrete pulses. Key branch: Input impulse tensor via a learnable weight matrix After performing a linear transformation, the signal is batch normalized and then generated as a discrete pulse-form bond tensor K through a LIF neuron layer of the same specification. Value branch: Input impulse tensor via a learnable weight matrix After performing a linear transformation, the data is batch normalized and then generated as a discrete pulse-form value tensor V through a LIF neuron layer of the same specification.

[0124] Unlike the continuous-value query, key, and value tensors in traditional artificial neural networks, the three types of tensors generated in this step are all binary discrete pulse sequences, which fully preserve the temporal encoding information of the pulses. This allows subsequent attention calculations to be directly based on the temporal characteristics of pulse firing, which is highly consistent with the information transmission mechanism of spiking neural networks.

[0125] 2. Feature subspace decomposition of multi-attention head.

[0126] The query tensor Q, key tensor K, and value tensor V are uniformly partitioned into H independent attention head sub-tensors along the feature dimension, with each attention head corresponding to a low-dimensional feature subspace. After partitioning, the feature dimensions of each attention head are independent, allowing subsequent attention operations to be performed in parallel. Through multi-subspace partitioning, different attention heads can focus on capturing spatiotemporal correlation features of different patterns (such as temporal rhythms of different frequency bands and spatial correlations of different brain region combinations), improving the feature representation richness and model robustness of the attention mechanism.

[0127] 3. Parallel computation of spatiotemporal joint attention scores.

[0128] Within each attention head, based on the impulse temporal dependency plasticity rule, spatiotemporal joint attention scores are calculated for the query subtensor and key subtensor of the corresponding subspace to generate the attention score matrix A corresponding to each head.

[0129] Specifically, the attention score is obtained by accumulating the output time differences of each pulse pair using the STDP learning window function: if the query pulses are generally later than the key pulses, the corresponding attention score is positive, indicating an enhancing positive correlation between the two; if the query pulses are generally earlier than the key pulses, the corresponding attention score is negative, indicating an inhibiting negative correlation between the two. This calculation process covers both the temporal and spatial channel dimensions, enabling a complete modeling of the association strength between any two spatiotemporal locations and achieving global capture of long-range spatiotemporal dependencies. The score calculation processes for H attention heads are executed in parallel, effectively improving computational efficiency and ensuring the real-time response performance of the system.

[0130] 4. Weighted feature aggregation of value tensors.

[0131] Softmax normalization is performed on the attention score matrix of each attention head, mapping the original scores containing positive and negative values ​​to standardized attention weights ranging from 0 to 1, with a sum of 1. The normalized attention weights are then weighted and summed with the corresponding attention head's sub-tensor, fusing the output features of each spatiotemporal location with feature information from all spatiotemporal locations globally. The fusion weights are determined by the temporal correlation strength. This weighted aggregation process selectively strengthens key spatiotemporal features highly relevant to the decoding task, suppresses irrelevant interference information, and completes the integration of long-range spatiotemporally dependent features.

[0132] 5. Multi-head feature splicing and output transformation.

[0133] The feature sub-tensors output by H attention heads are concatenated along the feature dimensions to obtain a high-dimensional integrated feature that fuses features from multiple subspaces; then, the concatenated feature is processed by a learnable output weight matrix. A linear transformation is performed to fuse, calibrate, and adapt the multi-head features, ultimately outputting a complete attention output tensor Y, which is then passed to the subsequent spatiotemporal feature extraction layer for further processing.

[0134] This mechanism retains the inherent temporal coding advantages and biological rationality of spiking neural networks, while achieving efficient extraction of long-range spatiotemporal features through multi-head design and global spatiotemporal correlation calculation. It effectively solves the technical problem that existing spiking neural network architectures are unable to capture the long-range spatiotemporal dependence of EEG signals.

[0135] like Figure 4 The flowchart shown illustrates the workflow of a dynamically adjustable membrane time factor neuron model. This workflow represents a single-time-step iterative execution process for a leaky integral firing (LIF) neuron with a dynamically adjustable membrane time factor. This neuron model addresses the limitation of traditional fixed membrane time factor LIF neurons in adapting to the non-stationary characteristics of EEG signals. By dynamically adjusting the membrane integral time in real time through the local statistical characteristics of the input signal, it achieves dynamic adaptation of the neuron's response characteristics to time-varying EEG signals. The workflow is executed sequentially in discrete time steps, covering the entire process from input statistics, parameter adaptation, membrane potential update, pulse firing determination, and state reset. The specific implementation steps are as follows: 1. Local statistical calculation of input signal.

[0136] After entering the t-th time step, first take a sliding time window of length W before the current time, count the absolute value of the input current amplitude of all time steps in the window, and calculate the average amplitude of the input current in the window.

[0137] The sliding time window W is a preset statistical window length used to extract the local time-domain statistical features of the input pulse signal. The average amplitude of the input current characterizes the rate of change of the EEG signal in the current time period: the larger the average amplitude, the more intense the signal fluctuation and the richer the high-frequency components; the smaller the average amplitude, the smoother the signal change and the more predominant the low-frequency components. This statistical result serves as the input basis for the adaptive adjustment of the membrane time factor, enabling real-time perception of the characteristics of the input signal by the neuron parameters.

[0138] 2. Adaptive membrane time factor calculation.

[0139] The adaptive membrane time factor at the current moment is calculated based on the average amplitude of the input current within the sliding window. Specifically, the normalized amplitude features are mapped to the (0,1) interval using the Sigmoid activation function, within a preset lower limit of the membrane time factor. and upper limit Linear interpolation is performed between them, combined with a learnable magnitude scaling factor. With bias parameters Finally, the membrane time factor is dynamically adjusted to the current moment.

[0140] The technical effect of this adaptive adjustment mechanism is that when the local average amplitude of the input signal is large and the signal changes rapidly, the membrane time factor adjusts accordingly. Convergence shortens the neuron's integration time, accelerates the response speed, and allows it to promptly follow rapid signal fluctuations, avoiding the loss of high-frequency details. When the local average amplitude of the input signal is small and the signal changes slowly, the membrane time factor... Convergence, with its extended neuronal integration time, allows for the full accumulation of effective low-frequency information, avoiding feature weakening caused by insufficient integration. This adapts to the non-stationary characteristics of the dynamic changes in the frequency components and amplitude of EEG signals over time.

[0141] 3. Neuronal membrane potential is updated recursively.

[0142] Based on the membrane potential state, dynamic membrane time factor, neuronal membrane resistance, resting reset potential, and input current amplitude from the previous moment, the neuronal membrane potential at the current moment is calculated using a recursive formula for membrane potential dynamics that is precisely discretized using the integral factor method. .

[0143] This recursive process comprises two physical processes: first, the natural leakage decay of the membrane potential, where the membrane potential spontaneously falls back to the resting reset potential, with the decay rate determined by the dynamic membrane time factor; and second, the charging process of the input current, where the input current drives the membrane potential to rise, with the charging rate also controlled by the dynamic membrane time factor. Unlike the traditional Euler method approximation, the precise discretization of the integral factor method improves the accuracy of membrane potential calculations, while also adapting to the implementation requirements of digital circuits and embedded hardware, ensuring the numerical stability of the computation.

[0144] 4. Pulse firing threshold determination.

[0145] Update the current membrane potential With the preset pulse firing threshold Perform a comparison and execute the branch decision: If satisfied The neuron is determined to have met the firing condition, and a pulse flag is output at the current time. This means that a neural impulse is emitted; immediately after the impulse is emitted, the neuronal membrane potential is forcibly reset to the resting reset potential. The neuron initiates a refractory period of preset duration. During this refractory period, the neuron blocks all input current stimulation, does not update the membrane potential, and does not generate new pulses, thus avoiding the loss of temporal coding precision due to dense pulse stacking, while also conforming to the physiological characteristics of biological neurons.

[0146] If not satisfied If the neuron has not met the firing condition, output a pulse flag at the current time. That is, without issuing pulses, the membrane potential remains in the current updated state, continuously retaining the input integration information, waiting for the input of the next time step to continue accumulating.

[0147] 5. Iterative advancement based on time sequence.

[0148] After completing all state updates and pulse outputs at the current time step, proceed to the next time step t+1 and repeat the complete process of input statistics, parameter adaptation, membrane potential update, and threshold determination until all time steps have been traversed and a complete neuronal pulse sequence is output.

[0149] like Figure 5 The flowchart shown is another neural pulse signal processing method for brain-computer interfaces. This process is an asynchronous pulse coding scheme for EEG input adapted to the front-end input of a spiking neural network. It mines the instantaneous rhythmic features of EEG signals through Hilbert transform, and realizes the bio-coding of continuous EEG signals into discrete pulse sequences from two dimensions: firing timing and firing probability. It fully preserves the temporal regularity and activity intensity information of EEG oscillations. The detailed steps are as follows: 1. Process initiation and standardized EEG signal input.

[0150] Once the process is officially started, input the pre-processed EEG timing signal. .

[0151] Preprocessing can include operations such as power frequency interference filtering, removal of physiological artifacts such as electrooculography / electromyography, target frequency band bandpass filtering, and amplitude normalization. The purpose is to eliminate noise pollution introduced during the acquisition process, obtain a regular signal with a signal-to-noise ratio that meets the requirements and is suitable for subsequent decoding tasks, and avoid interference factors from damaging the coding accuracy.

[0152] 2. Use Hilbert transform to find the quadrature components of a signal.

[0153] For input real-valued EEG signals Performing the Hilbert transform yields the orthogonal conjugate components. .

[0154] This transformation can achieve a 90° global phase shift of the original signal, separating the envelope evolution and phase change information of the signal, and providing an orthogonal basis for subsequent complex domain analytical signal construction and instantaneous feature extraction.

[0155] 3. Construct complex domain analytic signals.

[0156] According to the formula We construct analytical signals corresponding to EEG, extending one-dimensional real-time signals into complex forms.

[0157] The analytical signal can completely encapsulate all the amplitude and phase information of the original signal as it changes over time, avoiding the negative frequency aliasing problem that occurs when directly extracting instantaneous features from the real signal, thus ensuring the rigor of feature extraction.

[0158] 4. Extract the dual features of instantaneous amplitude and instantaneous phase.

[0159] From analyzing signals The instantaneous amplitude A(t) and instantaneous phase, which change dynamically with time, are obtained by solving the equation. : Instantaneous amplitude represents the strength of the brain electrical oscillation rhythm at the current moment, corresponding to the level of activity of neural activity in the corresponding brain region; Instantaneous phase characterizes the periodic process of brain electrical oscillations and carries the core information of rhythmic temporal evolution; the two features will respectively regulate the timing and probability of pulse firing.

[0160] 5. Phase mapping determines the pulse candidate firing interval.

[0161] Based on instantaneous phase Phase mapping calculations were performed to obtain the candidate firing intervals for pulse theory. .

[0162] This step relies on the periodicity of brainwave oscillations to define the candidate firing window for pulses, for example, by completing a phase. Using the oscillation period as an interval benchmark to set candidate times allows the candidate firing rhythm of pulses to match the natural oscillation rhythm of EEG, replicating the physiological characteristics of biological neural clusters based on oscillatory phase-synchronized discharge.

[0163] 6. Dynamically calculate the pulse firing probability using amplitude modulation.

[0164] Based on instantaneous amplitude Perform amplitude modulation calculations to obtain the pulse firing probability at the current candidate time. The larger the instantaneous amplitude, the more intense the neural activity during the corresponding time period, and the higher the probability of firing is set; the lower the amplitude, the lower the probability of firing is set, so as to convert the intensity of brain electrical activity into a probability parameter of pulse firing, and retain the physiological information carried by the amplitude.

[0165] 7. Random sampling branch determines pulse firing behavior.

[0166] Generate a random number uniformly distributed within the interval [0,1] in the current candidate distribution window, and then combine it with... Compare and execute the branch logic: If the random number < If the conditions for issuance are met, output a discrete pulse to complete the encoding of this sampling point; If random number If the conditions for issuing the pulse are not met, pulse output will be suppressed in this window and no pulse will be generated.

[0167] 8. Sampling point iteration loop and process termination judgment.

[0168] After completing the encoding of the current sampling point, a global judgment is performed: If there are still unprocessed sampling points in the entire EEG: jump to the beginning of the process, repeat the full-process encoding operation for the next sampling point, and traverse the entire time sequence signal point by point; Once all sampling points have been processed: the encoding process officially ends, and a complete asynchronous pulse sequence is output for use by subsequent network modules such as the pulse attention layer.

[0169] This solution employs a dual-modulation asynchronous coding architecture with phase-controlled timing and amplitude-controlled probability. Compared to traditional fixed-frequency rate coding, it not only aligns with the biological mechanisms of brain neural oscillations and discharges, offering greater interpretability, but also fully preserves the refined rhythmic characteristics of EEG. The asynchronous random firing mode also reduces the average firing density of pulses, decreasing the power consumption of subsequent computations and data transmission. This aligns with the low-power, long-battery-life application requirements of wearable brain-computer interfaces. The generated pulse timing can seamlessly adapt to spatiotemporal attention computation based on STDP rules, achieving end-to-end processing across the entire pulse domain.

[0170] As can be seen from the neural pulse signal processing method for brain-computer interfaces mentioned in the above embodiments, this method creatively adopts a dynamically adjustable membrane time factor, which can adjust the neuron integral time in real time according to the statistical characteristics of neural pulse signals, thereby solving the adaptation problem of fixed parameter models in the prior art when processing the non-stationary characteristics of EEG signals. In addition, this method introduces a spatiotemporal joint attention mechanism based on the pulse temporal dependence plasticity rule, which can accurately capture the long-range dependence in EEG signals by synchronously calculating the attention weights in the spatial and temporal dimensions, thereby achieving more efficient neural pulse signal decoding performance.

[0171] Corresponding to the neural impulse signal processing method for brain-computer interfaces provided in the foregoing embodiments, this invention provides a neural impulse signal processing system for brain-computer interfaces, such as... Figure 6 As shown, the system includes: Pulse firing probability calculation module 100: After performing Hilbert transform on the neural pulse signal acquired by the target brain-computer interface to obtain the analytical signal of the EEG signal, it simultaneously extracts the instantaneous phase and instantaneous amplitude from the analytical signal; based on preset sampling points, it maps the instantaneous phase to the firing time interval of the neural pulse signal, and calculates the pulse firing probability of the neural pulse signal through the instantaneous amplitude; Neuron integration processing module 200: used to calculate the membrane time factor of the neural pulse signal based on the firing time interval and pulse firing probability, calculate the neuronal membrane potential of the neural pulse signal at the current moment using the membrane time factor, and obtain the target pulse tensor corresponding to the neural pulse signal based on the neuronal membrane potential; The neural pulse signal decoding module 300 is used to obtain the query tensor, key tensor, and value tensor of the target pulse tensor. It calculates the attention weight score of the neural pulse signal using the difference between the query tensor and the key tensor, and calculates the feature output tensor corresponding to the value tensor using the attention weight score. Finally, it obtains the feature decoding result of the neural pulse signal through the feature output tensor.

[0172] As can be seen from the neural pulse signal processing system for brain-computer interfaces mentioned in the above embodiments, the system creatively adopts a dynamically adjustable membrane time factor, which can adjust the neuron integral time in real time according to the statistical characteristics of neural pulse signals, thereby solving the adaptation problem of fixed parameter models in the prior art when processing the non-stationary characteristics of EEG signals. In addition, the system introduces a spatiotemporal joint attention mechanism based on the pulse temporal dependence plasticity rule, which can accurately capture the long-range dependence in EEG signals by synchronously calculating the attention weights in the spatial and temporal dimensions, thereby achieving more efficient neural pulse signal decoding performance.

[0173] like Figure 7Another neural pulse signal processing system for brain-computer interfaces is shown. This system adopts a modular hierarchical architecture, with five functional units arranged sequentially along the signal processing link: an EEG signal acquisition module, a signal preprocessing module, a pulse coding module, a spiking neural network decoding module, and an output control module. This achieves end-to-end closed-loop processing from scalp EEG signal acquisition to brain-controlled output from external devices. The entire process relies on the inherent low-power characteristics of spiking neural networks and customized encoding and decoding mechanisms to solve the technical problems of insufficient decoding accuracy and excessive computational overhead caused by low signal-to-noise ratio and strong non-stationarity of non-invasive EEG signals. The specific composition and function of each module are as follows: I. Electroencephalogram (EEG) signal acquisition module.

[0174] The acquisition module is the system's signal input unit, used for non-invasive acquisition of the user's scalp EEG signals. It consists of a multi-channel EEG electrode cap, a signal amplifier, and an analog-to-digital converter connected in series.

[0175] The multi-channel EEG electrode cap is equipped with several scalp electrodes arranged according to standard EEG distribution, which can simultaneously collect weak neural electrical signals from multiple brain regions without surgical implantation, and features safety, non-invasiveness, and convenient operation; the signal amplifier is used to amplify the microvolt-level analog EEG signals collected by the electrodes, increasing the signal amplitude to adapt to subsequent sampling and processing; the analog-to-digital converter is used to convert the amplified analog EEG signals into discrete digital signals, and output the raw digital EEG data to the signal preprocessing module according to the preset sampling rate.

[0176] II. Signal Preprocessing Module.

[0177] The preprocessing module is used to purify and standardize the raw digital EEG signal. It consists of a bandpass filter unit, an independent component analysis denoising unit, and a standardization unit connected in series.

[0178] The bandpass filter unit is used to filter out DC drift, high-frequency random noise and power frequency interference in the original signal, retain the effective frequency band signal corresponding to the EEG decoding task, and initially improve the signal-to-noise ratio. The independent component analysis denoising unit separates and removes physiological artifacts and environmental interference signals such as electrooculography, electromyography, and electrocardiography through independent component analysis algorithm, further purifying the effective components of EEG. The standardization unit performs amplitude standardization processing on the filtered and denoised signal, unifies the numerical distribution scale of the signal, eliminates amplitude deviation caused by individual differences and electrode impedance fluctuations, and outputs a standardized continuous EEG signal to the pulse coding module.

[0179] III. Pulse Code Module.

[0180] The pulse coding module is a conversion unit from continuous signals to the pulse domain. Its core adopts the Hilbert phase modulation pulse coding method to convert preprocessed continuous EEG signals into discrete pulse sequences, which are adapted to the input format of spiking neural networks.

[0181] Unlike traditional threshold coding and rate coding schemes that only utilize amplitude features, this module constructs an analytical signal of the EEG signal through Hilbert transform, simultaneously extracting the instantaneous phase and instantaneous amplitude of the signal; it maps the instantaneous phase to the pulse firing time interval, synchronizing the pulse firing rhythm with the EEG's own oscillation rhythm, thus fully preserving the phase rhythm characteristics of the EEG; at the same time, it modulates the pulse firing probability by instantaneous amplitude, encoding the signal energy information into the pulse firing density, and finally generating a discrete pulse sequence that carries both phase and amplitude information, which is then output to the spiking neural network decoding module.

[0182] IV. Spike Neural Network Decoding Module.

[0183] The decoding module is the core computing unit of the system. It adopts a spiking neural network architecture with a dynamically adjustable membrane time factor to extract features and classify intents from the input pulse sequence, and decode the user's control intent.

[0184] This network uses Leaky Integral Fire (LIF) neurons with dynamically adjustable membrane time factors as its basic computational units. It can adjust the neuron integration time in real time based on the local statistical characteristics of the input pulses, adapting to the non-stationary nature of EEG signals and overcoming the adaptation defects of traditional fixed-parameter neurons, such as delayed response to rapidly changing signals and insufficient integration for slowly changing signals. The network deploys a spatiotemporal joint impulse attention mechanism based on the temporal dependence plasticity (STDP) rule, which can simultaneously capture long-range spatial dependencies across brain regions and long-order correlations across time steps in EEG signals, overcoming the limitation of traditional convolutional architectures that can only extract local neighborhood features. The network sequentially completes temporal feature extraction, spatial feature fusion, global attention enhancement, high-order feature abstraction, and classification decoding along the data flow direction, ultimately outputting the user intent classification result to the output control module.

[0185] V. Output Control Module.

[0186] The output control module is the system's instruction output unit, used to convert the decoding results into control instructions that can drive external devices. It consists of an instruction conversion unit and an external device interface connected in series.

[0187] The instruction conversion unit is used to map the intent classification results output by the spiking neural network into standardized control instructions for the corresponding external devices, thus completing the conversion from intent semantics to device control instructions. The external device interface is used to connect various external terminal devices, including medical rehabilitation equipment, assistive devices for the disabled, and intelligent human-computer interaction terminals, and transmit control instructions to them to drive the devices to perform corresponding operations, thereby realizing the physical implementation of user intent.

[0188] The neural pulse signal processing system for brain-computer interfaces provided in this embodiment of the invention has the same implementation principle and technical effects as the aforementioned neural pulse signal processing method for brain-computer interfaces. For the sake of brevity, any parts not mentioned in the system embodiment can be referred to the corresponding content in the aforementioned neural pulse signal processing method for brain-computer interfaces.

[0189] This embodiment also provides an electronic device, the structural schematic diagram of which is shown below. Figure 8 As shown, the device includes a processor 101 and a memory 102; wherein, the memory 102 is used to store one or more computer instructions, which are executed by the processor to implement the above-described neuron signal decoding steps.

[0190] Figure 8 The electronic device shown also includes a bus 103 and a communication interface 104, with the processor 101, communication interface 104 and memory 102 connected via the bus 103.

[0191] The memory 102 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. The bus 103 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 8 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0192] The communication interface 104 is used to connect to at least one user terminal and other network units through a network interface, and to send encapsulated IPv4 packets or IPv4 packets to the user terminal through the network interface.

[0193] Processor 101 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 101 or by instructions in software form. The processor 101 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this disclosure can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 102. The processor 101 reads the information in memory 102 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.

[0194] This invention also provides a storage medium storing a computer program, which, when run by a processor, executes the steps of the neural impulse signal processing method for brain-computer interface described in the foregoing embodiments.

[0195] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, devices, and methods can be implemented in other ways. The system embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0196] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0197] In addition, the functional units in the various embodiments of the present invention 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.

[0198] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion 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 several instructions to cause a computer device (which may be a personal computer, electronic device, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0199] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for processing neural impulse signals for brain-computer interfaces, characterized in that, The method includes: After performing a Hilbert transform on the neural pulse signals acquired by the target brain-computer interface to obtain the analytical signal of the EEG signal, the instantaneous phase and instantaneous amplitude in the analytical signal are extracted simultaneously; the instantaneous phase is mapped to the firing time interval of the neural pulse signal based on preset sampling points, and the pulse firing probability of the neural pulse signal is calculated through the instantaneous amplitude; The membrane time factor of the neural pulse signal is calculated based on the firing time interval and the pulse firing probability. The neuronal membrane potential of the neural pulse signal at the current moment is calculated using the membrane time factor. The target pulse tensor corresponding to the neural pulse signal is obtained based on the neuronal membrane potential. The query tensor, key tensor, and value tensor of the target impulse tensor are obtained. The attention weight score of the neural impulse signal is calculated using the difference between the query tensor and the key tensor. The feature output tensor corresponding to the value tensor is calculated using the attention weight score. The feature decoding result of the neural impulse signal is obtained through the feature output tensor. Calculating the membrane time factor of the neural pulse signal based on the firing time interval and the pulse firing probability includes: When the pulse firing probability at the target sampling point is not less than a preset firing probability threshold, the input pulse of the neural pulse signal is generated according to the firing time interval corresponding to the target sampling point, and the input current amplitude of the neural pulse signal is obtained based on the input pulse. The membrane time factor of the neural pulse signal is calculated using the input current amplitude; wherein the membrane time factor is calculated using the following formula: ; for The membrane time factor at that time; This is the lower limit of the membrane time factor; This is the upper limit of the membrane time factor; Use the Sigmoid activation function; This is the amplitude scaling factor; The sliding time window length is used to calculate the average amplitude of the input current; For the first The input current amplitude at each target sampling point; These are bias parameters; Calculating the neuronal membrane potential at the current moment using the membrane time factor includes: Based on the input pulse, the neuronal membrane resistance and resting reset potential of the neural pulse signal at a preset time step are obtained; The neuronal membrane potential at the current moment is calculated using the neuronal membrane resistance, the neuronal resting reset potential, and the membrane time factor.

2. The neural impulse signal processing method for brain-computer interface according to claim 1, characterized in that, After performing a Hilbert transform on the neural impulse signals acquired by the target brain-computer interface to obtain the analyzed signal of the EEG signal, the instantaneous phase and instantaneous amplitude of the analyzed signal are extracted simultaneously, including: After sequentially filtering, denoising, and standardizing the neural pulse signals acquired by the single channel of the target brain-computer interface, the electroencephalogram (EEG) signal of the target brain-computer interface is obtained. After performing a Hilbert transform on the electroencephalogram (EEG) signal, the transformed signal of the neural impulse signal is obtained; An analytical signal of the EEG signal is constructed using the EEG signal and the transformed signal; The oscillation phase extracted from the analytical signal is taken as the instantaneous phase, and the energy intensity extracted from the analytical signal is taken as the instantaneous amplitude.

3. The neural impulse signal processing method for brain-computer interfaces according to claim 2, characterized in that, Based on preset sampling points, the instantaneous phase is mapped to the firing time interval of the neural pulse signal, and the pulse firing probability of the neural pulse signal is calculated using the instantaneous amplitude, including: The instantaneous phase is mapped to the firing time of the neural pulse signal by a preset sampling point, and the firing rhythm of the pulse is kept synchronized with the oscillation rhythm of the EEG signal to obtain the firing time interval of the neural pulse signal. The theoretical firing time of the neural pulse signal at the preset sampling point is obtained, and the pulse firing probability of the neural pulse signal is calculated using the theoretical firing time and the instantaneous amplitude.

4. The neural impulse signal processing method for brain-computer interface according to claim 1, characterized in that, Obtaining the target pulse tensor corresponding to the neural pulse signal based on the neuronal membrane potential includes: When the neuron membrane potential is greater than a preset membrane potential threshold, the target pulse of the neural pulse signal is generated based on the neuron membrane potential; The number of time steps contained in the length of the sliding time window and the number of channels of the neural pulse signal are obtained, and the feature dimensions of the neural pulse signal are obtained through the instantaneous phase and the instantaneous amplitude. The three-dimensional pulse tensor of the target pulse is constructed based on the number of time steps, the number of channels, and the feature dimension; After performing a linear transformation on the three-dimensional pulse tensor using a preset weight matrix, the target pulse tensor of the neural pulse signal is determined using the obtained query tensor, key tensor, and value tensor.

5. The neural impulse signal processing method for brain-computer interface according to claim 4, characterized in that, Calculating the attention weight score of the neural impulse signal using the difference between the query tensor and the key tensor includes: The pulse timing dependency value is calculated based on the time difference between the target query pulse in the query tensor and the target key pulse in the key tensor. Obtain the first cumulative pulse emission count of the query tensor in the first channel before the first time, and obtain the second cumulative pulse emission count of the key tensor in the second channel before the second time; The attention weight score of the neural pulse signal at the first time, the first channel, the second time, and the second channel is calculated using the pulse timing dependency value.

6. The neural impulse signal processing method for brain-computer interface according to claim 5, characterized in that, Calculating the feature output tensor corresponding to the value tensor using the attention weight scores includes: Construct the attention score matrix of the neural impulse signal based on the number of time steps and the number of channels; The attention weight score is calculated in the attention score matrix using a preset normalization function; Obtain the feature vector of the value tensor under the second time and the second channel, and obtain the feature output tensor of the value tensor based on the product of the feature vector and the attention weight.

7. A neural impulse signal processing system for brain-computer interfaces, characterized in that, The system includes: Pulse firing probability calculation module: After performing Hilbert transform on the neural pulse signal acquired by the target brain-computer interface to obtain the analytical signal of the EEG signal, it simultaneously extracts the instantaneous phase and instantaneous amplitude from the analytical signal; based on preset sampling points, it maps the instantaneous phase to the firing time interval of the neural pulse signal, and calculates the pulse firing probability of the neural pulse signal through the instantaneous amplitude; Neuron integral processing module: used to calculate the membrane time factor of the neural pulse signal based on the firing time interval and the pulse firing probability, use the membrane time factor to calculate the neuronal membrane potential of the neural pulse signal at the current moment, and obtain the target pulse tensor corresponding to the neural pulse signal based on the neuronal membrane potential; The neural pulse signal decoding module is used to obtain the query tensor, key tensor, and value tensor of the target pulse tensor, calculate the attention weight score of the neural pulse signal using the difference between the query tensor and the key tensor, calculate the feature output tensor corresponding to the value tensor using the attention weight score, and obtain the feature decoding result of the neural pulse signal through the feature output tensor. In the process of calculating the membrane time factor of the neural pulse signal based on the firing time interval and the pulse firing probability, the neuron integral processing module is further configured to: generate an input pulse of the neural pulse signal according to the firing time interval corresponding to the target sampling point when the pulse firing probability at the target sampling point is not less than a preset firing probability threshold, and obtain the input current amplitude of the neural pulse signal based on the input pulse; calculate the membrane time factor of the neural pulse signal using the input current amplitude; wherein, the membrane time factor is calculated by the following formula: ; for The membrane time factor at that time; This is the lower limit of the membrane time factor; This is the upper limit of the membrane time factor; Use the Sigmoid activation function; This is the amplitude scaling factor; The sliding time window length is used to calculate the average amplitude of the input current; For the first The input current amplitude at each target sampling point; These are bias parameters; In the process of calculating the neuronal membrane potential of the neural pulse signal at the current moment using the membrane time factor, the neuron integral processing module is also used to: obtain the neuronal membrane resistance and neuronal resting reset potential of the neural pulse signal at a preset time step based on the input pulse; and calculate the neuronal membrane potential of the neural pulse signal at the current moment using the neuronal membrane resistance, the neuronal resting reset potential, and the membrane time factor.

8. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing computer-executable instructions that can be executed by the processor, the processor executing the computer-executable instructions to implement the steps of the neural impulse signal processing method for brain-computer interface according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Cortical peak potential signal motion decoding method and decoding equipment based on recurrent pulse neural network

    CN119646453A

  • Hyperspectral image change detection method based on spiking neural network

    CN121860920A