CN112675428B - Anti-epileptic electrical stimulation hardware-in-the-loop simulation system - Google Patents

Anti-epileptic electrical stimulation hardware-in-the-loop simulation system Download PDF

Info

Publication number
CN112675428B
CN112675428B CN202011532349.1A CN202011532349A CN112675428B CN 112675428 B CN112675428 B CN 112675428B CN 202011532349 A CN202011532349 A CN 202011532349A CN 112675428 B CN112675428 B CN 112675428B
Authority
CN
China
Prior art keywords
signal
real
electroencephalogram
epileptic
electrical stimulation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011532349.1A
Other languages
Chinese (zh)
Other versions
CN112675428A (en
Inventor
魏熙乐
赵美佳
周易非
常思远
伊国胜
王江
卢梅丽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianjin University
Original Assignee
Tianjin University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianjin University filed Critical Tianjin University
Priority to CN202011532349.1A priority Critical patent/CN112675428B/en
Publication of CN112675428A publication Critical patent/CN112675428A/en
Application granted granted Critical
Publication of CN112675428B publication Critical patent/CN112675428B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Measurement And Recording Of Electrical Phenomena And Electrical Characteristics Of The Living Body (AREA)

Abstract

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.

Description

Anti-epileptic electrical stimulation hardware-in-the-loop simulation system
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 about 5 million patients with epilepsy worldwide, about 1/4 of which cannot be effectively treated by medication or surgery, and these epilepsy are referred to as refractory epilepsy. The antiepileptic drug is easy to generate drug resistance, dependence and side effect in the treatment process. Although the operation of cutting off the local focal area has a treatment effect on the local epilepsy, the operation treatment process is irreversible, risks such as memory loss and language disorder can be caused, and 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 the operation therapy, and has no side effects of antiepileptic drugs and operations. 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 a digital signal output by the signal acquisition module, filtering the digital signal, identifying and estimating parameters of a personalized nerve cluster model by using an unscented Kalman filter, calculating an anti-epileptic stimulation signal through a PI control law, applying the anti-epileptic stimulation signal to the epileptic electroencephalogram real-time generator (2), and finishing reproducing 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 epilepsy electroencephalogram real-time generator (2) has eight output channels in total, generates 8 paths of recurrent epilepsy-like discharge signals (17) which represent the individual specificity of an epilepsy patient, and acquires anti-epilepsy stimulation signals generated by the electrical stimulation controller (25) in real time through an AD module of a corresponding DSP chip, thereby recurrent 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 epileptics. 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 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 as 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 change 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 higher dimensionality in a microscopic model are avoided, and the neural cluster model is suitable for describing epileptic brain electrical state. 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 data driving strategy is adopted 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 the real clinical electroencephalogram data drive of epileptics, uses a data drive identification strategy-unscented Kalman filter to identify an individual nerve cluster model, establishes a model reflecting the individual difference of different patients, establishes an anti-epileptic seizure hardware-in-the-loop simulation system, completes the anti-epileptic electrical stimulation hardware-in-the-loop experiment, and has important significance for the later treatment of epilepsy.
An individualized 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 the idea of hardware-in-the-loop, and the 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 electroencephalogram signal 2 of an epileptic patient, 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, a personalized neural cluster model 10, embedded realization of the model 11, parameter initialization 12 of the personalized neural cluster model, gaussian white noise generation 13.AD module 14, model differential equation solving 15, simulated epileptic sample discharge signal generation 16, cyclic calculation 17, reproduced epileptic sample discharge signal 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 and amplification module 25, an electrical stimulation controller 26, a signal processing module 27, a parameter expected value 29, an error signal 30.PI control law 31, system noise 32, measurement noise 33, an electroencephalogram signal measurement value 34, model input 35, input noise estimation value 36, a parameter estimation value 37, a serial communication module 38, an upper computer 39, an upper computer interface 40, a parameter configuration interface 41, a VISA resource configuration interface 42, a configuration interface 42, and a resource 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, an individualized 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, an 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 recurrent epileptic discharge signal generated by the epileptic electroencephalogram real-time generator (2), converts the recurrent epileptic discharge signal into a simulated electroencephalogram signal with the same amplitude-frequency characteristic as the real electroencephalogram signal, and reproduces the real electroencephalogram signal acquired clinically; 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.
Individuation in the application refers to identifying an individualized model parameter, namely average excitatory synapse gain, in a physiological model corresponding to an epileptic according to data driving of electroencephalograms of the epileptic, substituting the identified average excitatory synapse gain into a neural cluster model in a DSP (epileptic electroencephalograms real-time generator), and constructing to obtain an individualized neural cluster model (9), wherein identification of the individualized 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 epilepsy electroencephalogram real-time generator (2) comprises an individual nerve cluster model 9, an embedded implementation 10 of the model and a recurrent epilepsy-like discharge signal 17, the epilepsy electroencephalogram real-time generator (2) uses DSP-TMS 320F28377DPTP as a Micro Control Unit (MCU), physiological activities of neuron clusters in a brain of a patient during epileptic seizure are reproduced to obtain the individual nerve cluster model (9), the embedded implementation (10) of the model converts a solving process of a nonlinear constant differential equation, namely the individual nerve cluster model, into iterative calculation of a differential equation by adopting a four-order dragon-Kutta (Runge-Kutta) algorithm in the DSP, 8 paths of recurrent epilepsy-like discharge signals (17) representing the individual specificity of the epilepsy patient are generated by using 8 DACs (Digital-to-Analog converters, DACs) of 4 DSPs as output channels, the 8 paths of recurrent epilepsy-like discharge signals are output to a signal conversion module (19), and the ADC (Analog-Digital-Analog-Digital converters, the DSP chip) is used for generating real-time electrical stimulation Control signals for the epilepsy patient to be stimulated by an AD acquisition module, and the real-time response of the epilepsy-like discharge signals is generated by the ADC (ADC), and the real-Analog-to be stimulated by the real-time stimulation of the epilepsy patient. 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 256Hz.
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 (ADS 1299) of one sampling period.
The electric stimulation controller (25) is also realized by adopting a DSP, the chip model is TMS320F28377DPTP, the DAC of the TMS320F28377DPTP outputs analog signals, and data interaction is carried out with an upper computer (38) through an SCI serial port 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 an MCU of an epilepsia electroencephalogram real-time generator, an epilepsia patient electroencephalogram signal (1) is used for establishing an individualized nerve cluster model (9) through a data drive identification strategy, the embedded realization (10) of the model is completed in the DSP by adopting a four-stage Runge-Kutta algorithm, an epilepsia-like discharge signal (17) is reproduced, a signal conversion module (19) is used for reducing the voltage of the simulated epilepsia-like discharge signal generated by the epilepsia electroencephalogram real-time generator (2) and converting the simulated epilepsia-like discharge signal into a simulated electroencephalogram signal with the same amplitude-frequency characteristic as a real electroencephalogram signal, a clinically acquired real electroencephalogram signal is reproduced, a signal real-time acquisition amplification module (24) is used for acquiring the simulated electroencephalogram signal which is weak and converting the simulated electroencephalogram signal into a discrete digital signal, a high-speed digital communication interface of the DSP is used for completing the communication with a signal processing module (26), the acquired signal is amplified and filtered and eliminated, a controller module (27) controls a PI based on average excitatory gain feedback to apply different synaptic gains to a brain-computer communication interface (39) for receiving an epilepsia resistance electroencephalogram signal generating signal and transmitting the epilepsia signal to a computer (8) through a synapse interface. 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.
The DSP used in the embodiment of the invention is TMS320F28377DPTP, the epileptic brain electricity real-time generator uses 4 TMS320F28377DPTP, and the electric stimulation controller uses 1 TMS320F28377DPTP.
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:
Figure BDA0002852405820000071
in the formula: x (t) represents an output signal of a second-order linear transfer function, x represents six state variables satisfying the relationship of the formula (1), "-" represents a derivative; c 1 ,C 2 ,C 3 ,C 4 Representing an average number of synaptic connections between the subset of pyramidal neurons and the subset of interneurons; 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)=x 1 (t)-x 2 (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) To filterAnd (3) initializing: the initial value of the state vector estimation is
Figure BDA0002852405820000072
Can be set to 0; state covariance matrix
Figure BDA0002852405820000073
The initialization of (a) is as follows:
Figure BDA0002852405820000074
in the formula: q r Representing 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:
Figure BDA0002852405820000075
in the formula: x is (n) x +n q )×2(n x +n q ) A matrix of (a); n is X The number of model states; n is q The number of the parameters to be estimated; and n represents the sum of the number of the model states and the number of the parameters to be estimated. The Sigma point X is substituted into the nonlinear state equation f (namely formula (1)) of the nerve cluster model (7), and a new vector point set Z is obtained after weighting n-1|n-1 As follows:
Figure BDA0002852405820000081
in the formula: u. of n Is an input to the system. State vector predictor
Figure BDA0002852405820000082
As follows:
Figure BDA0002852405820000083
state covariance matrix prediction
Figure BDA0002852405820000084
As follows:
Figure BDA0002852405820000085
(3) And (3) observation vector prediction:
Figure BDA0002852405820000086
in the formula: h represents an observation matrix; and R is observation noise.
(4) Updating a Kalman filter: gain K of p-Karman n Updating:
Figure BDA0002852405820000087
for state vector estimation value
Figure BDA0002852405820000088
-performing an update:
Figure BDA0002852405820000089
updating the state covariance matrix:
Figure BDA00028524058200000810
(5) And (3) returning to the step (2).
As shown in fig. 3, which is an 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 brain electrical 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 excitatory synapse gain value in an individualized nerve cluster model, initializing all variables (Gaussian white noise mean square difference and parameters in the model), completing parameter initialization (11) of the individualized nerve cluster model, then generating Gaussian white noise (12) in order to simulate external input in the individualized nerve cluster model, substituting stimulation signals collected by an AD module (13) in a DSP into a differential equation of the individualized nerve cluster model, solving the model differential equation (14) through a four-order Runge-Kutta numerical integration algorithm, obtaining an output solution at a corresponding moment, and finally completing cycle calculation (16) (calculation along with time lapse) to convert model output into voltage signals expressing rhythmic epileptic discharge by using a DAC in the DSP of an epileptic brain electrical real-time generator (2), namely generating simulated epileptic discharge signals (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 digital scaling is directly carried out on digital output signals of the personalized nerve cluster model in the DSP, as 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 times of reduction, a first-stage voltage division follower circuit (20), a second-stage voltage division follower circuit (21), a third-stage voltage division follower circuit (22) and a fourth-stage voltage division follower circuit (23) are used, and the four voltage division follower circuits are completely identical and connected in sequence, wherein R 1 、R 2 、R 3 、R 4 、R 5 、R 6 、R 7 、R 8 For each stage of the resistor, V, of the voltage-dividing follower circuit in For input voltage, V out For the output voltage, the relationship is as follows:
Figure BDA0002852405820000091
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, in order to control the parameter of the average excitatory synapse gain which cannot be directly observed, the block diagram of the PI closed-loop control strategy based on the unscented Kalman filter is shown, before the control, the EEG signal measurement value (33) formed by the measurement noise (32) and the output signal of the personalized neural cluster model is taken into consideration, the interference of the input noise (35) which may appear in the system is considered, the unscented Kalman filter (8) is used for calculating the parameter estimation value (36),
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 (com 7, 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 type data (hexadecimal representation) of the collected data, the data being changed at the moment in time during the data collection process)
Result display area (analog signal value of acquired data, unit V));
the upper computer (38) judges the data type (8 channels including the channel 1 to the channel 8, and the channel 8 respectively corresponds to the control effect corresponding to the selected electroencephalogram data of the 8-lead real epileptic patient) through the data identification position, 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.

Claims (10)

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 finish reproducing 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 epilepsy electroencephalogram real-time generator (2) is composed of a plurality of DSP chips, each DSP chip is responsible for reproduction of two paths of epilepsy electroencephalograms, two paths of personalized neural cluster models (9) are embedded into each DSP chip, the number of channels output by the epilepsy electroencephalogram real-time generator (2) corresponds to the derivative of the epilepsy electroencephalogram to be researched, and each personalized neural cluster model is identified by a corresponding electroencephalogram parameter through an unscented Kalman filter.
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 and amplification module (24) to complete acquisition, amplification, analog-to-digital conversion of 8 paths of analog signals and communication with the signal processing module (26).
5. The antiepileptic electrical stimulation hardware-in-the-loop simulation system of claim 4, wherein: input voltage V of signal conversion module in And an output voltage V out The relationship between them is:
Figure FDA0002852405810000021
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 a stimulation signal acquired 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 fourth-order Runge-Kutta numerical integration algorithm (14) to obtain an output solution at a corresponding moment, and finally, circularly calculating (16) to complete conversion of the output of the individualized nerve cluster model into a voltage signal representing rhythmic epileptic discharge by using a DAC in the DSP, namely generating an analog epileptic discharge signal (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) to set, a VISA (visual sense access architecture) resource configuration interface (41) which is used for reading and converting data and a waveform display interface (42), and the serial port parameter configuration interface (40) is used for configuring a serial port baud rate, a data bit and a stop bit; 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), and the inhibitory external input and the model input are applied together into the personalized neural cluster model (9), thereby realizing 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.
CN202011532349.1A 2020-12-23 2020-12-23 Anti-epileptic electrical stimulation hardware-in-the-loop simulation system Active CN112675428B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011532349.1A CN112675428B (en) 2020-12-23 2020-12-23 Anti-epileptic electrical stimulation hardware-in-the-loop simulation system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011532349.1A CN112675428B (en) 2020-12-23 2020-12-23 Anti-epileptic electrical stimulation hardware-in-the-loop simulation system

Publications (2)

Publication Number Publication Date
CN112675428A CN112675428A (en) 2021-04-20
CN112675428B true CN112675428B (en) 2023-02-28

Family

ID=75450803

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011532349.1A Active CN112675428B (en) 2020-12-23 2020-12-23 Anti-epileptic electrical stimulation hardware-in-the-loop simulation system

Country Status (1)

Country Link
CN (1) CN112675428B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113282009B (en) * 2021-05-20 2022-07-01 天津大学 Hardware-in-loop test system for Parkinson closed-loop nerve regulation and control
CN114521904B (en) * 2022-01-25 2023-09-26 中山大学 Brain electrical activity simulation method and system based on coupled neuron group
CN116224829B (en) * 2023-02-03 2023-10-20 广东工业大学 Digital twinning-based surgical robot puncture sampling operation semi-physical simulation method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104112066A (en) * 2014-08-18 2014-10-22 天津大学 Epilepsy state closed-loop control experiment platform based on FPGA
CN104173044A (en) * 2014-08-15 2014-12-03 浙江大学医学院附属第二医院 Closed-loop system used for epilepsy treatment
CN104375878A (en) * 2014-11-24 2015-02-25 天津大学 FPGA simulation system for modulating hippocampus network rhythm through weak electromagnetic stimulation
CN109875553A (en) * 2019-03-27 2019-06-14 北京脑陆科技有限公司 A kind of extensive epilepsy automatic detection early warning based on EEG equipment and treatment intelligence system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007075477A2 (en) * 2005-12-19 2007-07-05 University Of Florida Closed-loop state-dependent seizure prevention systems

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104173044A (en) * 2014-08-15 2014-12-03 浙江大学医学院附属第二医院 Closed-loop system used for epilepsy treatment
CN104112066A (en) * 2014-08-18 2014-10-22 天津大学 Epilepsy state closed-loop control experiment platform based on FPGA
CN104375878A (en) * 2014-11-24 2015-02-25 天津大学 FPGA simulation system for modulating hippocampus network rhythm through weak electromagnetic stimulation
CN109875553A (en) * 2019-03-27 2019-06-14 北京脑陆科技有限公司 A kind of extensive epilepsy automatic detection early warning based on EEG equipment and treatment intelligence system

Also Published As

Publication number Publication date
CN112675428A (en) 2021-04-20

Similar Documents

Publication Publication Date Title
CN112675428B (en) Anti-epileptic electrical stimulation hardware-in-the-loop simulation system
CN111317600B (en) Artificial limb control method, device, system, equipment and storage medium
Navajas et al. Minimum requirements for accurate and efficient real-time on-chip spike sorting
Chen A primer on neural signal processing
Chang et al. Model predictive control for seizure suppression based on nonlinear auto-regressive moving-average volterra model
Mouleeshuwarapprabu et al. Nonlinear vector decomposed neural network based EEG signal feature extraction and detection of seizure
Zhang et al. Homology characteristics of Eeg and Emg for lower limb voluntary movement intention
Donati et al. Neuromorphic bioelectronic medicine for nervous system interfaces: from neural computational primitives to medical applications
CN116549853B (en) Pulse generator, stimulator, storage medium, and program product
CN113282009A (en) Hardware-in-loop test system for Parkinson closed-loop nerve regulation and control
Chang et al. A data driven experimental system for individualized brain stimulation design and validation
Joublin et al. A columnar model of somatosensory reorganizational plasticity based on Hebbian and non-Hebbian learning rules
Trifonov et al. Biotechnical system for control to the exoskeleton limb based on surface myosignals for rehabilitation complexes
CN116263580A (en) Programmable closed-loop electrophysiology experiment hardware-in-loop real-time simulation system
Heelan et al. A mobile embedded platform for high performance neural signal computation and communication
CN113112017B (en) Electroencephalogram grading and prognosis FPGA decoding system based on neural manifold
Liu et al. A real-time hardware experiment platform for closed-loop electrophysiology
CN113967023B (en) Closed-loop optogenetic intervention system and intervention method
CN117860276A (en) Myoelectric signal blind separation model training method, application method and related system
Amalia et al. Identification Post-Stroke of Motor Imagery and Asynchrony of Channel Pairs using Multiple RNN
Islam et al. Neural Mass Model-Based Different EEG Signal Generation and Analysis in Simulink
CN106650793A (en) Method of controlling PWM (pulse-width modulation) duty cycle based on brain-computer interface
CN117437831A (en) Telescopic ring electrophysiology experiment system for acupuncture and moxibustion, neuropsychiatric diseases and the like
Li et al. A Signal Acquisition Approach for Implantable Brain-Machine Interface System
Wei et al. A Real-time Simulation Platform Design Based on Neural Mass Model for Deep Brain Stimulation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant