Anti-epileptic electrical stimulation hardware-in-loop simulation system

文档序号:725207 发布日期:2021-04-20 浏览:4次 中文

阅读说明:本技术 抗癫痫电刺激硬件在环仿真系统 (Anti-epileptic electrical stimulation hardware-in-loop simulation system ) 是由 魏熙乐 赵美佳 周易非 常思远 伊国胜 王江 卢梅丽 于 2020-12-23 设计创作,主要内容包括:本发明为抗癫痫电刺激硬件在环仿真系统,其中:该仿真系统包括癫痫脑电实时发生器、信号采集模块、电刺激控制器以及上位机四个部分。癫痫脑电实时发生器将输入的癫痫患者脑电信号通过数据驱动辨识策略和模型的嵌入式实现,转化为癫痫样放电信号,并进行信号采集与处理,通过基于无迹卡尔曼滤波器的PI闭环控制策略抑制个性化神经集群模型的癫痫样放电,各模块的程序流程采用C语言编程实现,编译下载到DSP中,并通过LabVIEW平台完成上位机与电刺激控制器的通讯,上位机主要用于数据通信与波形显示,实现显示控制效果。该仿真系统的有益效果是该系统实现了电刺激闭环控制策略的实时仿真验证,对癫痫闭环控制临床化具有重要推动作用。(The invention relates to an anti-epileptic electrical stimulation hardware-in-loop simulation system, wherein: the simulation system comprises an epilepsia electroencephalogram real-time generator, a signal acquisition module, an electrical stimulation controller and an upper computer. The epilepsy electroencephalogram real-time generator converts an input electroencephalogram signal of an epileptic patient into an epilepsy sample discharge signal through a data drive identification strategy and embedded realization of a model, acquires and processes the signal, inhibits the epilepsy sample discharge of an individualized nerve cluster model through a PI closed-loop control strategy based on an unscented Kalman filter, adopts C language programming to realize the program flow of each module, compiles and downloads the program flow into a DSP, and finishes the communication between an upper computer and an electrical stimulation controller through a LabVIEW platform, and the upper computer is mainly used for data communication and waveform display to realize the display control effect. The simulation system has the advantages that the system realizes real-time simulation verification of an electrostimulation closed-loop control strategy, and has an important promotion effect on clinics of epilepsy closed-loop control.)

1. An anti-epileptic electrical stimulation hardware-in-the-loop simulation system is characterized in that: the simulation system also comprises an epilepsia electroencephalogram real-time generator (2), a signal acquisition module (18), an electrical stimulation controller (25) and an upper computer (38),

the epilepsia electroencephalogram real-time generator (2) is used for obtaining personalized model parameters in a physiological model of an epilepsia electroencephalogram patient through electroencephalogram data drive identification of the epilepsia patient, and further loading the personalized model parameters into a nerve cluster model to reproduce an epilepsia-like discharge signal (17);

the signal acquisition module (18) is used for converting a discharge signal (17) generated by the epilepsia electroencephalogram real-time generator (2) into a simulated electroencephalogram signal with the same amplitude-frequency characteristic as an electroencephalogram signal of a real epilepsia patient, converting the simulated electroencephalogram signal acquired in real time into a discrete digital signal and outputting the discrete digital signal to the electrical stimulation controller (25);

the electrical stimulation controller (25) is used for acquiring the digital signal output by the signal acquisition module, performing filtering processing on the digital signal, performing parameter identification and estimation on an individual neural cluster model by using an unscented Kalman filter, calculating an anti-epileptic stimulation signal through a PI control law, and applying the anti-epileptic stimulation signal to the epileptic electroencephalogram real-time generator (2) to reproduce the real response of a clinical epileptic patient after being electrically stimulated;

the upper computer (38) comprises a human-computer interaction interface (39), the human-computer interaction interface (39) is realized by the upper computer (38) through LabVIEW programming, and data interaction is carried out with the electrical stimulation controller (25) through the SCI serial port communication module (37) to complete data communication and waveform display.

2. The antiepileptic electrical stimulation hardware-in-the-loop simulation system according to claim 1, wherein: the epilepsia electroencephalogram real-time generator (2) is composed of a plurality of DSP chips, each DSP chip is responsible for reproduction of two epilepsia electroencephalogram signals, two personalized neural cluster models (9) are embedded into each DSP chip, the number of channels output by the epilepsia electroencephalogram real-time generator (2) corresponds to the epilepsia electroencephalogram derivative to be researched, and each personalized neural cluster model is identified by a unscented Kalman filter according to corresponding electroencephalogram signal parameters.

3. The antiepileptic electrical stimulation hardware-in-the-loop simulation system of claim 2, wherein: the epilepsia electroencephalogram real-time generator (2) has eight output channels in total, generates 8 paths of recurrent epilepsia-like discharge signals (17) which represent the individual specificity of an epileptic patient, and acquires anti-epilepsia stimulation signals generated by the electrical stimulation controller (25) in real time through the AD module of the corresponding DSP chip, thereby replicating the real response of a clinical patient after being electrically stimulated.

4. The antiepileptic electrical stimulation hardware-in-the-loop simulation system of claim 3, wherein: the signal acquisition module (18) comprises a signal conversion module (19) and a signal real-time acquisition amplification module (24), the signal conversion module uses a four-stage voltage division follower circuit, four low-noise two-channel AD8606 amplifiers are used as voltage followers, and the amplitude of an analog signal output by the epilepsia electroencephalogram real-time generator (2) is compressed to complete signal conversion;

the electroencephalogram signal real-time acquisition module (24) adopts ADS1299 as an acquisition chip, and selects an ADS1299-FE suite as a signal real-time acquisition amplification module (24), so that the acquisition, amplification, analog-to-digital conversion of 8 paths of analog signals and the communication with the signal processing module (26) are completed.

5. The antiepileptic electrical stimulation hardware-in-the-loop simulation system of claim 4, wherein: input voltage V of signal conversion moduleinAnd an output voltage VoutThe relationship between them is:

6. the antiepileptic electrical stimulation hardware-in-the-loop simulation system of claim 4, wherein: the electrical stimulation controller (25) comprises a signal processing module (26) and a controller module (27), wherein the signal processing module (26) is responsible for communicating with the signal real-time acquisition and amplification module (24) and filtering and eliminating acquired signals; the controller module (27) comprises an unscented Kalman filter (8) and a PI control law (30), completes the parameter identification of the unscented Kalman filtering data-driven personalized model, adjusts stimulation signals in real time by using the proportional integral PI control law, outputs anti-epileptic stimulation signals to the epileptic electroencephalogram real-time generator (2), and meanwhile, the controller module (27) performs data interaction with an upper computer (38).

7. The antiepileptic electrical stimulation hardware-in-the-loop simulation system of claim 2, wherein: the embedded implementation process of the personalized neural cluster model is as follows: a differential equation is solved on line by using a fourth-order Runge-Kutta algorithm in a DSP, and a simulated epileptic discharge signal is output in real time through a DAC of the DSP and is divided into five parts: firstly, setting an average excitatory synapse gain value in an individualized nerve cluster model, initializing all variables to complete parameter initialization (11) of the individualized nerve cluster model, then substituting stimulation signals collected by an AD module (13) in a DSP into a differential equation of the individualized nerve cluster model in order to simulate external input in the individualized nerve cluster model to generate white Gaussian noise (12), solving the model differential equation through a four-order Runge-Kutta numerical integration algorithm (14) to obtain an output solution at a corresponding moment, and finally, performing cyclic calculation (16) to complete conversion of output of the individualized nerve cluster model into voltage signals expressing rhythmic epileptic discharge by using a DAC in the DSP, namely generating simulated epileptic discharge signals (15).

8. The antiepileptic electrical stimulation hardware-in-the-loop simulation system of claim 2, wherein: the human-computer interaction interface (39) comprises a serial port parameter configuration interface (40) which is used for being communicated with the electric stimulation controller (25) and is arranged, a VISA resource configuration interface (41) which is used for reading and converting data and a waveform display interface (42), and serial port baud rate, data bits and stop bits are configured on the serial port parameter configuration interface (40); the VISA resource configuration interface (41) includes:

a port number, a stop button, a reading window, a reading buffer area, a data acquisition interface and a data acquisition interface which are used for configuring the communication between the upper computer and the electrical stimulation controller,

A result display area for collecting analog signal values of the data;

and the upper computer (38) judges the data type through the data identification bit, transmits the data of the corresponding channel to a waveform display interface (42), completes the waveform display of the data of the 8 channels, and finally clears the data in the reading buffer zone by means of a clear function in the VISA library.

9. The antiepileptic electrical stimulation hardware-in-the-loop simulation system of claim 6, wherein: the electrical stimulation controller (25) adopts a PI closed-loop control strategy based on an unscented Kalman filter, and the specific process is as follows: in order to control the parameter of the average excitatory synaptic gain which can not be directly observed, the method comprises the steps of calculating a parameter estimation value (36) by using an unscented Kalman filter (8) before control on an electroencephalogram signal measurement value (33) formed by measurement noise (32) and an output signal of a personalized neural cluster model and considering the interference of input noise (35) which possibly occurs in the system,

the controller module (27) adopts a PI control law (30) and adjusts a control signal according to an error signal (29) between a parameter expected value (28) and a parameter estimated value (36) of the unscented Kalman filter (8);

in closed-loop control, the output signal of the PI control law is input as an inhibitory external input into the personalized neural cluster model, while the average pre-synaptic pulse density of afferent action potentials from neighboring or distant clusters is used as a model input (34), the inhibitory external input and the model input being applied together into the personalized neural cluster model (9), enabling closed-loop control.

10. The antiepileptic electrical stimulation hardware-in-the-loop simulation system according to claim 1, wherein: the electroencephalogram data of the electroencephalogram signal (1) of the epileptic is derived from PhysioNet.

Technical Field

The invention relates to a biomedical engineering technology, in particular to an antiepileptic electrical stimulation hardware-in-loop simulation system.

Background

Epilepsy is one of the most common nervous system diseases in the world, and epileptic seizure is characterized in that electroencephalogram activity abnormality caused by abnormal synchronous discharge of a large group of neurons can be captured in electroencephalograms of patients, and epileptic detection, location and diagnosis are carried out according to the electroencephalogram abnormality. There are now 5 million patients with epilepsy worldwide, of which about 1/4 cannot be effectively treated by medication or surgery, and these are known as refractory epilepsy. Antiepileptic drugs are susceptible to drug resistance, dependence and side effects during treatment. Although the operation of cutting off the local focal area has a treatment effect on the local epilepsy, the operation treatment process is irreversible, and risks such as memory loss, language disorder and the like can be generated, so that the operation is not suitable for the whole brain seizure epilepsy.

The electromagnetic stimulation therapy has obvious advantages aiming at intractable epilepsy, can not damage specific cerebral regions, has less damage than surgical therapy, and has no side effects of antiepileptic drugs and surgery. At present, most of the existing electromagnetic stimulation schemes are open-loop stimulation, parameters cannot be adjusted in real time according to individual specificity and disease course development under an open-loop strategy, and stimulation optimization is very difficult. Compared with open-loop stimulation, the control strategy for constructing the closed loop by taking the observable electrophysiological signals capable of reflecting the epileptic state as feedback has robustness on personalized differences (brain structure, electrode implantation position, brain state and the like) among patients, and is favorable for improving the success rate of clinical anti-epileptic seizure. In recent years, how to establish an individualized stimulation-brain response calculation model for a patient to depict the influence of a stimulation signal on nerve activity becomes an important scientific problem for optimizing the antiepileptic electrical stimulation by designing a proper closed-loop control strategy on the basis. If the closed-loop control algorithm of the epilepsia is applied to a patient, a hardware-in-loop simulation system capable of simulating a clinical real environment is needed, and all performance indexes of the system are the same as those of a clinical experiment, so that the control effect of the anti-epilepsia seizure closed-loop controller is verified in real time.

The hardware-in-the-loop simulation technology means that when a system is tested, a controller is real, the rest parts simulate reality as much as possible, and when simulation cannot be carried out, a real-time digital model is adopted to simulate the external environment of the controller, so that the test and performance verification of the whole system are carried out. At present, a hardware-in-loop simulation platform used in the field of neural control engineering is rare.

Disclosure of Invention

Aiming at the problems to be solved, the invention aims to provide an anti-epileptic electrical stimulation hardware-in-loop simulation system, compared with the system for directly testing a patient, the hardware-in-loop simulation system can simulate the test conditions close to the real environment, can repeatedly carry out the verification work of a control algorithm, greatly reduces the risk of clinical tests, and has an important promotion effect on the pre-clinical optimization of electrical stimulation.

In order to achieve the purpose, the invention adopts the technical scheme that an anti-epileptic electrical stimulation hardware-in-loop simulation system is provided, and is characterized in that: the simulation system also comprises an epilepsia electroencephalogram real-time generator (2), a signal acquisition module (18), an electrical stimulation controller (25) and an upper computer (38),

the epilepsia electroencephalogram real-time generator (2) is used for obtaining personalized model parameters in a physiological model of an epilepsia electroencephalogram patient through electroencephalogram data drive identification of the epilepsia patient, and further loading the personalized model parameters into a nerve cluster model to reproduce an epilepsia-like discharge signal (17);

the signal acquisition module (18) is used for converting a discharge signal (17) generated by the epilepsia electroencephalogram real-time generator (2) into a simulated electroencephalogram signal with the same amplitude-frequency characteristic as an electroencephalogram signal of a real epilepsia patient, converting the simulated electroencephalogram signal acquired in real time into a discrete digital signal and outputting the discrete digital signal to the electrical stimulation controller (25);

the electrical stimulation controller (25) is used for acquiring the digital signal output by the signal acquisition module, performing filtering processing on the digital signal, performing parameter identification and estimation on an individual neural cluster model by using an unscented Kalman filter, calculating an anti-epileptic stimulation signal through a PI control law, and applying the anti-epileptic stimulation signal to the epileptic electroencephalogram real-time generator (2) to reproduce the real response of a clinical epileptic patient after being electrically stimulated;

the upper computer (38) comprises a human-computer interaction interface (39), the human-computer interaction interface (39) is realized by the upper computer (38) through LabVIEW programming, and data interaction is carried out with the electrical stimulation controller (25) through the SCI serial port communication module (37) to complete data communication and waveform display.

The epilepsia electroencephalogram real-time generator (2) is composed of a plurality of DSP chips, each DSP chip is responsible for reproduction of two epilepsia electroencephalogram signals, two personalized neural cluster models (9) are embedded into each DSP chip, the number of channels output by the epilepsia electroencephalogram real-time generator (2) corresponds to the epilepsia electroencephalogram derivative to be researched, and each personalized neural cluster model is identified by a unscented Kalman filter according to corresponding electroencephalogram signal parameters.

The epilepsia electroencephalogram real-time generator (2) has eight output channels in total, generates 8 paths of recurrent epilepsia-like discharge signals (17) which represent the individual specificity of an epileptic patient, and acquires anti-epilepsia stimulation signals generated by the electrical stimulation controller (25) in real time through the AD module of the corresponding DSP chip, thereby replicating the real response of a clinical patient after being electrically stimulated.

The signal acquisition module (18) comprises a signal conversion module (19) and a signal real-time acquisition amplification module (24), the signal conversion module uses a four-stage voltage division follower circuit, four low-noise two-channel AD8606 amplifiers are used as voltage followers, and the amplitude of an analog signal output by the epilepsia electroencephalogram real-time generator (2) is compressed to complete signal conversion;

the electroencephalogram signal real-time acquisition module (24) adopts ADS1299 as an acquisition chip, and selects an ADS1299-FE suite as a signal real-time acquisition amplification module (24), so that the acquisition, amplification, analog-to-digital conversion of 8 paths of analog signals and the communication with the signal processing module (26) are completed.

Compared with the prior art, the invention has the beneficial effects that:

the simulation system realizes real-time simulation verification of an electrostimulation closed-loop control strategy for epileptic patients. An individual nerve cluster model of an epileptic is identified based on data drive, an epileptic electroencephalogram real-time generator and a signal conversion module are designed by combining a hardware-in-loop idea, real-time epileptic electroencephalograms matched with physical characteristics (amplitude, time scale and noise) of electroencephalograms of the epileptic are reproduced, an in-loop real-time electrical stimulation controller is designed, a PI control strategy based on online identification of an unscented Kalman filter is realized, and the epileptic closed-loop control clinics is promoted. The research innovatively provides an anti-epileptic electrical stimulation hardware-in-the-loop simulation system, which has the following advantages:

1. the system can reproduce analog signals with the same characteristics of electroencephalogram signals of epileptics in time domains and frequency domains, and performs real-time closed-loop control;

2. the system adopts the DSP chip to process and transmit data, ensures a reliable data transmission mechanism in the experimental process and meets the real-time property and stability of mass data interaction;

3. in the epilepsia electroencephalogram real-time generator and the electrostimulation controller, the used high-speed memories are flash modules in the DSP, the modules have high reading and writing speed, internal programs cannot be erased due to re-electrification, high-speed storage is realized, the system has a memory space for storing a large amount of data and instructions, high-performance hardware resources (multifunctional peripheral interfaces and digital signal processing resources) which are easy to expand, and the realizability and the execution efficiency of the algorithm are ensured.

4. The invention adopts a lumped parameter model for simulating the interaction among different neuron clusters. The lumped parameter model models the neural cluster network by the idea of 'mean field approximation', and the sub-cluster state in the neural cluster model is described by the excitability or inhibitivity mean membrane potential and the mean discharge rate; the connection coefficient between the sub-clusters represents the average number of synaptic connections; adjusting the model parameters can alter the interaction of excitatory neuron sub-clusters and inhibitory neuron sub-clusters, thereby causing the model to produce rhythmic oscillations; the neural cluster model has the advantages that the rhythm characteristics of epileptic activity are simulated through the rhythm change of the cluster, so that overlarge calculated amount and high dimensionality in the micro model are avoided, and the neural cluster model is suitable for describing epileptic electroencephalogram states. The problems of complexity, high dimensionality and incapability of simulating larger-scale electrical activity caused by using detailed biophysical parameter research on a microscopic level are avoided.

The structure of the neural cluster model can be established according to the anatomical and electrophysiological bases, and the method adopts a data driving strategy to obtain corresponding model parameters from the electroencephalogram signals containing noise. The unscented Kalman filtering is used for the parameter identification problem of the epilepsy model, and the unscented Kalman filtering completes the estimation process of key parameters by calculating a state estimation value on line, observing the estimation value and updating Kalman gain. Compare in least square estimation to discern the EEG signal, be applicable to and discern complicated electrophysiological activity, for the PSO algorithm discerns the EEG signal, can not consume a large amount of memory in the numerical simulation, this application system has realized the preliminary verification of hardware in the loop simulation platform.

The invention completely utilizes real clinical electroencephalogram data drive of epileptics, uses a data drive identification strategy-unscented Kalman filter to identify an individualized nerve cluster model, establishes a model reflecting individual differences of different patients, builds an anti-epileptic seizure hardware-in-the-loop simulation system, completes an anti-epileptic electrical stimulation hardware-in-the-loop experiment, and has important significance for treating epilepsia in the later period.

An individual nerve cluster model of an epileptic is obtained based on a data-driven identification strategy, an epileptic electroencephalogram real-time generator and a signal conversion module (digital-to-analog conversion and four-stage voltage division following circuit) are designed by combining a hardware-in-the-loop idea, and real-time epileptic electroencephalogram matched with physical characteristics (amplitude, time scale and noise) of an electroencephalogram signal of the epileptic is reproduced.

The invention uses a plurality of DSPs, the DSPs are serial operation, the DSPs can carry out complex nonlinear operation and can complete high-precision floating point operation, and the development efficiency is faster by using C language programming. According to the invention, the core device is subjected to model selection, the design and the construction of interfaces among modules (DAC, ADC and SCI modules in DSP are used) and the PCB design of a signal conversion module according to the aspects of the computing performance and the real-time performance of the system. Because the digital signal received by the signal real-time acquisition and amplification module (24) and transmitted by the SPI is a microvolt brain electrical signal, a large amount of high-frequency noise and power frequency interference are mixed in the signal, in order to ensure the accuracy of the signal, a real-time digital filter needs to be designed in the signal processing module (26) to remove the high-frequency interference, and a Butterworth low-pass IIR digital filter is selected for filtering, so that the accuracy of the system is improved.

Drawings

FIG. 1 is a schematic diagram of a simulation system according to the present invention;

FIG. 2 is an epileptic brain electrical data driven identification strategy of the present invention;

FIG. 3 is an embedded implementation of the personalized neural cluster model of the present invention;

FIG. 4 is a voltage step-down circuit of the signal conversion module of the present invention;

FIG. 5 is a block diagram of the unscented Kalman filter based PI closed-loop control strategy of the present invention;

FIG. 6 is a human-computer interface of the present invention.

In the figure:

1. an epileptic electroencephalogram signal 2, an epileptic electroencephalogram real-time generator 3, data preprocessing 4, data interception 5, artifact removal 6, mean value elimination 7, a neural cluster model 8, an unscented Kalman filter 9, an individualized neural cluster model 10, embedded realization of the model 11, parameter initialization 12 of the individualized neural cluster model, Gaussian white noise generation 13, an AD module 14, model differential equation solving 15, simulated epileptic sample discharge signal generation 16, cyclic calculation 17, epileptic sample discharge signal reproduction 18, a signal acquisition module 19, a signal conversion module 20, a first-stage voltage division follower circuit 21, a second-stage voltage division follower circuit 22, a third-stage voltage division follower circuit 23, a fourth-stage voltage division follower circuit 24, a signal real-time acquisition amplifier module 25, an electrical stimulation controller 26, a controller module 28, parameter expected values 29, an error signal 30, a PI signal acquisition module 30, a signal acquisition module 18, a signal acquisition module parameter initialization Control law 31, system noise 32, measurement noise 33, electroencephalogram signal measurement value 34, model input 35, input noise 36, parameter estimation value 37, SCI serial port communication module 38, upper computer 39, human-computer interaction interface 40, serial port parameter configuration interface 41, VISA resource configuration interface 42 and waveform display interface

Detailed Description

The anti-epileptic electrical stimulation hardware-in-the-loop simulation system of the present invention is further described in detail with reference to the accompanying drawings.

The invention relates to a design idea of an anti-epileptic electrical stimulation hardware-in-the-loop simulation system, which is characterized in that firstly, an epileptic patient electroencephalogram signal (1) is subjected to data driving, a personalized nerve cluster model is established based on data driving identification, a differential equation of the model is solved in a DSP (digital signal processor) by using a four-order Runge Kutta algorithm, an epileptic sample discharge signal is simulated, embedded realization (10) of the model is completed, and a recurrent epileptic sample discharge signal (17) is output; then, a signal conversion module (19) reduces the voltage of a reproduced epileptic sample discharge signal generated by the epileptic electroencephalogram real-time generator (2), converts the reproduced epileptic sample discharge signal into a simulated electroencephalogram signal with the same amplitude-frequency characteristic as the real electroencephalogram signal, and reproduces the clinically acquired real electroencephalogram signal; weak analog electroencephalogram signals are acquired in real time by a signal real-time acquisition and amplification module (24), the continuously changed analog electroencephalogram signals are converted into discrete digital signals, communication with a signal processing module (26) is completed by a high-speed digital communication interface, and the signal processing module (26) filters the acquired signals to eliminate high-frequency interference; the controller module (27) calculates an anti-epileptic stimulation signal through a PI control law (30) based on the average excitatory synapse gain feedback of a key physiological parameter, and applies the anti-epileptic stimulation signal to the epileptic electroencephalogram real-time generator (2); and finally, designing a human-computer interaction interface (39) of the upper computer, transmitting the multi-channel discharge signals received in the controller module (27) to the upper computer (38) at the same time, and displaying the multi-channel discharge signals on the human-computer interaction interface (39) through different waveform charts.

The individuation in the application refers to identifying an individuation model parameter, namely average excitatory synapse gain, in a physiological model corresponding to an epileptic according to data driving of electroencephalogram signals of the epileptic, substituting the identified average excitatory synapse gain into a neural cluster model in a DSP (real-time generator for epileptic electroencephalogram), and constructing to obtain an individuation neural cluster model (9), wherein the identification of the individuation model parameter is also carried out by using an unscented Kalman filter.

The anti-epileptic electrical stimulation hardware-in-loop simulation system comprises an epileptic electroencephalogram real-time generator 2, a signal acquisition module 18, an electrical stimulation controller 25 and an upper computer 38, wherein the epileptic electroencephalogram real-time generator 2 converts an input EEG signal of an epileptic patient into a reproduced epileptic sample discharge signal through a data driving identification strategy and embedded implementation of a model, the discharge signal acquisition and processing are carried out, epileptic sample discharge of a personalized nerve cluster model is inhibited through a PI closed-loop control strategy (figure 5) based on an unscented Kalman filter, the program flow of each module is realized by C language programming and is compiled and downloaded into a DSP, communication between the upper computer and the electrical stimulation controller 25 is completed through a LabVIEW platform, and the upper computer is mainly used for data communication and waveform display and real-time display control effect.

The epilepsia electroencephalogram real-time generator (2) comprises an individualized nerve cluster model 9, an embedded implementation 10 of the model and a recurrent epileptic-like discharge signal 17, the epilepsia electroencephalogram real-time generator (2) uses DSP-TMS 320F28377DPTP as a Micro Control Unit (MCU) to replicate the physiological activity of a neuron cluster in a brain of a patient during epileptic seizure to obtain the individualized nerve cluster model (9), the embedded implementation (10) of the model converts the solving process of a nonlinear constant differential equation, namely the individualized nerve cluster model, into iterative calculation of a differential equation by adopting a four-step dragon-Kutta (Runge-Kutta) algorithm in the DSP, and generates 8 recurrent epileptic-like discharge signals (17) representing the individual specificity of the epileptic patient by using 8 DACs (Digital-to-Analog converters, DACs) of 4 DSPs as output channels, the signal is output to a signal conversion module (19), and an anti-epileptic stimulation signal generated by the electrical stimulation controller (25) is acquired in real time through an Analog-to-Digital Converter (ADC) and an AD module of the DSP chip, so that the real response of a clinical patient after being electrically stimulated is reproduced. The epilepsia electroencephalogram real-time generator is provided with four independent DSPs which work simultaneously, each DSP uses 2 DAC output channels, two personalized neural cluster models are embedded into each DSP, each DSP is responsible for construction of the personalized neural cluster models of two electroencephalogram signals (epilepsia signals), each personalized neural cluster model identifies corresponding electroencephalogram signal parameters through an unscented Kalman filter, corresponding epilepsia-like discharge signals are reproduced, the epilepsia electroencephalogram real-time generator outputs eight epilepsia-like discharge signals in total, each epilepsia-like discharge signal is connected with a signal acquisition module 18, and output signals of all the signal acquisition modules are sent to an electrical stimulation controller.

The signal conversion module (19) uses four-stage voltage division follower circuit, adopts four low-noise two-channel AD8606 amplifiers as voltage followers, compresses the amplitude of the simulated epileptic sample discharge signal output by the DAC of the output channel of the epileptic electroencephalogram real-time generator, completes signal conversion, and meets the design requirement.

The chip model of the signal real-time acquisition and amplification module (24) is ADS1299, the signal real-time acquisition and amplification module comprises an ADS1299 chip and an ADS1299-FE suite of TI company, can complete acquisition, amplification and analog-to-digital conversion of 8 paths of analog signals and communication with the signal processing module (26), and meets the design requirements. In the embodiment, the electroencephalogram data of the electroencephalogram signals (1) of the epileptic patients are derived from PhysioNet, the Ali Shoeb acquires the scalp electroencephalograms of 22 epileptic patients in the Boston child hospital, and uploads a data set to the PhysioNet, the acquired electroencephalogram signals are 23-lead data, and the acquisition frequency is 256 Hz.

The real electroencephalogram data of the epileptic patient used in the construction of the loop simulation system come from 8-lead electroencephalogram signals with more regular epileptic-like discharge in 23-lead data, and 8 paths of epileptic-like discharge signals need to be reproduced. In addition, the arrangement of 8 paths can meet the real-time requirement of a DSP chip, and the control signal (anti-epileptic stimulation signal) in one control period can be calculated by the electric stimulation controller within 4ms (ADS1299) of one sampling period.

The electric stimulation controller (25) is also realized by adopting a DSP, the model of a chip is TMS320F28377DPTP, and a DAC (digital-to-analog converter) of the TMS320F28377DPTP outputs analog signals, and the analog signals are subjected to data interaction with an upper computer (38) through an SCI (serial interface communication) module (37), so that the design requirement is met. The electrical stimulation controller (25) comprises a signal processing module (26) and a controller module (27),

the signal processing module (26) receives digital signals transmitted by the signal real-time acquisition and amplification module (24) through the SPI, the acquired signals are microvolt brain electrical signals, a large amount of high-frequency noise and power frequency interference are mixed in the signals, a Butterworth low-pass Infinite unit Impulse Response (IIR) digital filter is designed to remove the high-frequency interference, communication with the signal acquisition module (18) is completed, and data are processed.

The controller module (27) comprises an unscented Kalman filter (8) and a PI control law (30), and the identification of a key physiological parameter, namely average excitatory synaptic gain, is completed through an unscented Kalman filtering parameter estimation algorithm; and adjusting the stimulation signals in real time through an incremental PI control law according to the deviation of the parameter estimation value and the expected value, outputting anti-epileptic stimulation signals to an epileptic electroencephalogram real-time generator (2) which is a controlled object, calculating the control signals through the PI control law (30), and outputting the anti-epileptic stimulation signals to be applied to the personalized nerve cluster model through a DAC (digital-to-analog converter) of the electrical stimulation controller.

The human-computer interaction interface (39) is realized by using a LabVIEW platform, data interaction between the upper computer (38) and the SCI serial port communication module (37) of the DSP is realized by using a VISA (Virtual Instrument Software Architecture) library, and functions such as VISA serial port configuration, VISA reading and VISA writing are mainly applied. A data identification bit is added before the highest bit of the serial port sending data, and the upper computer (38) displays the waveform of the 8-channel data by identifying the data identification bit, so that the real-time communication with the controller module (27) is realized.

The overall implementation of the anti-epileptic electrical stimulation hardware-in-the-loop simulation system of the present invention is described below:

as shown in figure 1, the simulation system structure of the invention is designed, a DSP-TMS 320F28377DPTP chip of TI company is selected as the MCU of the epileptic electroencephalogram real-time generator, the epileptic electroencephalogram (1) establishes an individualized nerve cluster model (9) through a data drive identification strategy, the embedded realization (10) of the model is completed by adopting a four-stage Runge-Kutta algorithm in the DSP, the epileptic sample discharge signal (17) is reproduced, a signal conversion module (19) reduces the voltage of the simulated epileptic sample discharge signal generated by the epileptic electroencephalogram real-time generator (2) and converts the simulated epileptic sample discharge signal into a simulated electroencephalogram signal with the same amplitude-frequency characteristic as the real electroencephalogram signal, the clinically collected real electroencephalogram signal is reproduced, a signal real-time acquisition amplification module (24) is used for acquiring weak simulated electroencephalogram signals and converting the weak simulated electroencephalogram signals into discrete digital signals, and a high-speed digital communication interface of the DSP is used for completing the, and the acquired signals are amplified and eliminated through filtering, the controller module (27) calculates anti-epileptic stimulation signals through PI control based on average excitatory synapse gain which is a key physiological parameter feedback, the anti-epileptic stimulation signals are applied to the epileptic electroencephalogram real-time generator (2), the received 8-channel discharge signals are transmitted to an upper computer (38) through an SCI serial port communication module (37), and the signals are displayed on a human-computer interaction interface (39) through different waveform charts. After the loop simulation system is constructed, the real-time electroencephalogram signal of the epileptic can be used for the later-stage epileptic treatment, the real electroencephalogram signal of the epileptic is directly input into the signal real-time acquisition and amplification module 24 and then enters the electrical stimulation controller 25 for processing, and then the processed signal is directly acted on the electroencephalogram of the epileptic, so that the electrical stimulation controller can be used for clinical experiments.

In the embodiment of the invention, the used DSPs are TMS320F28377DPTP, the epileptic brain electrical real-time generator uses 4 TMS320F28377DPTP, and the electrical stimulation controller uses 1 TMS320F28377 DPTP.

As shown in fig. 2, for an epileptic patient electroencephalogram data driving identification strategy, firstly, to remove noise and artifacts of an epileptic patient electroencephalogram signal (1), data preprocessing (3) needs to be performed on the electroencephalogram signal, and data interception (4), artifact removal (5) and mean value elimination (6) are respectively performed to obtain preprocessed epileptic patient electroencephalogram data. The neural cluster model (7) can be used for generating simulated electroencephalogram signals of various states such as epileptic seizure and non-seizure, and is composed of a pyramidal neuron sub-cluster, an inhibitory interneuron sub-cluster and an excitatory interneuron sub-cluster, each sub-cluster is composed of two basic operators of a second-order linear transfer function and a nonlinear Sigmoid function (S (·)), and the dynamic characteristic of the neural cluster model (7) is represented by the following differential equation:

in the formula: x (t) represents the output signal of the second order linear transfer function, x represents six state variables, which satisfy the relationship of equation (1), "-" represents the derivative; c1,C2,C3,C4Representing the sub-clusters and the middle of pyramidal neuronsAn average number of synaptic connections between the subset of neurons; a represents the average excitatory synaptic gain, a parameter of physiological significance in the neural cluster model (7); a represents the mean excitability time constant; b represents the average inhibitory synaptic gain; b represents the average inhibitory time constant. The output equation of the model is:

y(t)=x1(t)-x2(t) (2)

in the formula: y (t) represents the post-synaptic membrane potential of the subset of pyramidal neurons simulating the brain electrical signal.

And secondly, integrating the electroencephalogram data of the patient and the neural cluster model (7) by using an unscented Kalman filter (8), completing state identification and parameter estimation in real time, and performing linear transformation on the electroencephalogram data before estimation to keep the range of the electroencephalogram data consistent with the range of output signals of the neural cluster model, thereby finally obtaining the personalized neural cluster model (9).

The estimation steps of the unscented Kalman filter (8) on the parameter A are as follows:

(1) initializing the filter: the initial value of the state vector estimate isCan be set to 0; state covariance matrixThe initialization of (a) is as follows:

in the formula: qrRepresenting parameter uncertainty; q represents process noise.

(2) And (3) state vector prediction: in order to solve the problem that the matrix is not positively definite when the square root of the state covariance matrix is solved, the state covariance matrix at the previous moment is subjected to SVD (singular value decomposition), and a Sigma point X is calculated as follows:

in the formula: x is (n)x+nq)×2(nx+nq) A matrix of (a); n isXThe number of model states; n isqThe number of the parameters to be estimated; n represents the sum of the number of model states and the number of parameters to be estimated. Substituting the Sigma point X into the nonlinear state equation f (namely formula (1)) of the nerve cluster model (7), and weighting to obtain a new vector point set Zn-1|n-1As follows:

in the formula: u. ofnIs an input to the system. State vector predictorAs follows:

state covariance matrix predictionAs follows:

(3) and (3) observation vector prediction:

in the formula: h represents an observation matrix; and R is observation noise.

(4) Updating a Kalman filter: gain K of P-KarmannUpdating:

for state vector estimation value-performing an update:

updating the state covariance matrix:

(5) and (4) returning to the step (2).

As shown in fig. 3, for the embedded implementation of the personalized neural cluster model, a differential equation is solved online by using a fourth-order Runge-Kutta algorithm in a DSP of the epileptic electroencephalogram real-time generator (2), and an analog epileptic-like discharge signal is output in real time through a DAC of the DSP, which is divided into five parts: firstly, setting an average excitability synapse gain value in an individualized nerve cluster model, initializing all variables (Gaussian white noise mean variance and parameters in the model) to complete parameter initialization of the individualized nerve cluster model (11), then, in order to simulate the external input in the personalized nerve cluster model, Gaussian white noise (12) is generated, a stimulation signal collected by an AD module (13) in the DSP is substituted into a differential equation of the personalized nerve cluster model, and (3) performing model differential equation solving (14) through a four-order Runge-Kutta numerical integration algorithm to obtain an output solution at a corresponding moment, and finally performing cyclic calculation (16) (calculation along with time lapse) to convert the model output into a voltage signal representing rhythmic epileptiform discharge by using a DAC (digital-to-analog converter) in a DSP (digital signal processor) of the epileptic brain electricity real-time generator (2), namely generating a simulated epileptiform discharge signal (15).

As shown in FIG. 4, the voltage reduction circuit of the signal conversion module (19) is provided, the amplitude range of the electroencephalogram signal of the epileptic is 0-1600 μ V, and the signal amplitude needs to be compressed in order to enable the platform to reproduce the real electroencephalogram signal of the epileptic. If directly aiming at personalized nerves in DSPDigital scaling is carried out on digital output signals of the cluster model, the range of analog signals output by the DAC is 0-3.3V, the range of digital quantity is 0-4095, and the data precision is seriously influenced by 1000-time reduction, so that a first-stage voltage division following circuit (20), a second-stage voltage division following circuit (21), a third-stage voltage division following circuit (22) and a fourth-stage voltage division following circuit (23) are used, and the four voltage division following circuits are completely identical and connected in sequence, wherein R1、R2、R3、R4、R5、R6、R7、R8For each stage of the resistor, V, of the voltage-dividing follower circuitinFor input voltage, VoutFor the output voltage, the relationship is as follows:

in order to improve the driving capability of the circuit and enhance the anti-interference characteristic, a low-noise dual-channel AD8606 amplifier of ADI company is selected for the chip, and four operational amplifiers are used as voltage followers to complete signal conversion.

As shown in FIG. 5, which is a block diagram of a PI closed-loop control strategy based on an unscented Kalman filter, in order to control a parameter of an average excitatory synaptic gain which cannot be directly observed, an EEG signal measurement value (33) formed by measurement noise (32) and an output signal of a personalized neural cluster model is calculated by using the unscented Kalman filter (8) in consideration of interference of input noise (35) which may occur in the system before control,

the controller module (27) uses a PI control law (30) to adjust the control signal based on an error signal (29) between a desired parameter value (28) and an estimated parameter value (36) of the unscented Kalman filter (8). In the closed-loop control strategy, an output signal of a controller module (27) (namely, an output signal of a PI control law) is input into an individualized nerve cluster model as an inhibitory external input, meanwhile, an average presynaptic pulse density of an incoming action potential from an adjacent or remote cluster is used as a model input (34), the inhibitory external input and the model input are jointly applied into the individualized nerve cluster model (9), the input of an unscented Kalman filter is a random signal, and therefore, system noise (31) needs to be added into the individualized nerve cluster model (9) to enable the unscented Kalman filter to have a good identification effect.

The man-machine interface (39) shown in fig. 6 uses a LabVIEW platform of NI corporation to complete data communication between the upper computer (38) and the controller module (27) and waveform display of data. The human-computer interaction interface (39) comprises a serial port parameter configuration interface (40), a VISA resource configuration interface (41) and a waveform display interface (42), and serial port baud rate, data bits and stop bits are configured on the serial port parameter configuration interface (40); a VISA resource configuration interface (41), wherein the reading controller module (27) outputs a signal to the human-computer interaction interface through the SCI serial port communication module (37) to complete data reading and conversion, and the interface in fig. 6 includes:

port number (com7, port for configuring communication between upper computer and electrical stimulation controller 25, fixed)

Stop button (stop communication, stop reading channel data)

A reading window (at the current moment, 8-bit unsigned integer data is received (serial port transmission, 8-bit data is transmitted once, decimal representation is carried out, 8 times are transmitted in one channel, single-channel data is displayed in the figure, the type is judged according to the first bit in the data, the data is numbered from 0, 0 represents a first channel, 1 represents a second channel, the like is carried out, the sampling period is 4ms, the processing is fast, and the acquisition of all eight channels is completed within 4 ms),

read buffer (64-bit floating-point data (hexadecimal representation) of the collected data, the data changing at any time during the data collection process)

Result display area (analog signal value of collected data, unit V));

the upper computer (38) judges the data type (8 channels including the channel 1 to the channel 8, and the 8 channels respectively correspond to the control effect corresponding to the selected 8-channel real epileptic electroencephalogram data), transmits the data to a waveform display interface (42), completes waveform display of the 8-channel data, and finally clears the data in the reading buffer zone by means of a clear function in a VISA library. The human-computer interaction interface can display in real time and observe the control effect.

The simulation system of the invention has the following advantages:

(1) the invention provides a hardware-in-loop-based real-time simulation scheme for simulating an electrical stimulation optimization experiment aiming at an epileptic under a near-real environment, repeatedly verifying a control algorithm and reducing the risk of a human body experiment, and develops a set of verification and optimization system of an anti-epileptic electrical stimulation control strategy;

(2) an individual nerve cluster model of an epileptic is identified based on data driving, an epileptic electroencephalogram real-time generator and a signal conversion module (digital-to-analog conversion and voltage reduction circuit) are designed by combining the idea of hardware-in-the-loop, and real-time epileptic electroencephalogram matched with physical characteristics (amplitude, time scale and noise) of an electroencephalogram signal of a patient is reproduced;

(3) an on-loop real-time electrical stimulation controller is designed, a PI control strategy based on unscented Kalman filter online identification is realized, and the system provides a real-time simulation verification platform for anti-epileptic closed-loop control.

The invention is described as being applicable to the prior art.

16页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种盆底肌肉训练器及训练方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!