Professional Documents
Culture Documents
FPGA Implementation of Second-Order Difference Plot For Epileptic Seizure Detection in EEG Signals
FPGA Implementation of Second-Order Difference Plot For Epileptic Seizure Detection in EEG Signals
FPGA Implementation of Second-Order Difference Plot For Epileptic Seizure Detection in EEG Signals
1
2
3
4
FPGA Implementation of Second-Order Difference
5
6
Plot for Epileptic Seizure Detection in EEG Signals
7
8
9
10
Ardra Singh, A. Amalin Prince*
11
Electrical and Electronics Engineering Department
12
Birla Institute of Technology and Science Pilani,
13
K. K. Birla Goa Campus, Goa, India
14
*amalinprince@gmail.com
15
16
17
Abstract—Field-programmable gate arrays (FPGAs) are to give accurate results. An algorithm utilizing EMD [8] and
18
being extensively used for a wide range of digital applications due second-order difference plot (SODP) [9] has provided an
to their flexibility and reprogrammability. This paper presents a average classification accuracy of 97.75% [6]. However, so
19
FPGA implementation of the second-order difference plot far, there are very few hardware implementations of seizure
20
(SODP) technique which can be used for the classification of ictal detection algorithms. A digital circuit capable of performing
21
and seizure-free electroencephalogram (EEG) signals. Empirical automatic real-time seizure detection can be used to filter out
22
mode decomposition (EMD) can break down an EEG signal into EEG data and transmit only ictal data for further analysis. This
23
simple oscillatory modes called intrinsic mode functions (IMFs). can immensely reduce transmission traffic and relieve trained
24
The hardware design developed takes a sampled IMF of an EEG
professionals from the time-consuming task of detecting
25
signal as input and generates its SODP while simultaneously
calculating the 95 percent confidence ellipse area of the SODP.
seizures by visual inspection of EEG signals. Also, hardware
26
implementation of a seizure detection algorithm can be used in
The ellipse area can be used as a parameter for detecting
27
epileptic seizures in EEG signals. The digital circuit was designed implantable chips allowing wireless closed-loop seizure
28
in the Vivado integrated development environment (IDE) using control [10-11].
29
Verilog hardware description language (HDL) and a Xilinx This paper presents a novel digital design that generates
30
Artix-7 xc7a100tcsg324 FPGA was used to verify operation of the the SODP of a time series and simultaneously calculates its
31
physical implementation. The hardware was tested on EEG data 95% confidence ellipse area. The design can be used in
32
made publicly available by the University of Bonn and the results
conjunction with a hardware implementation of the EMD
33
were found to be consistent with MATLAB simulations.
algorithm for developing an instrument for real-time seizure
34
Keywords—field-programmable gate array; epileptic seizure; detection. The use of SODP is not just limited to classifying
35
electroencephalogram signal; second-order difference plot; 95% EEG signals as epileptic and seizure-free [6]. It has been
36
confidence ellipse area applied to electrocardiogram (ECG) signals for detecting
37
congestive heart failure [12] and to center of pressure (COP)
38
signals for differentiating vibration frequencies [13]. The
I. INTRODUCTION
39
digital circuit was designed in the Vivado integrated
Epilepsy, a chronic neurological disorder marked by development environment (IDE) [14] using Verilog hardware
40
unprovoked seizures, affects at least 65 million people in the description language (HDL). Verification of the hardware
41
world [1]. Anti-epileptic drugs prevent seizures by implementation was done on a Xilinx Artix-7 xc7a100tcsg324
42
suppressing excessive electrical activity of the neurons in the field-programmable gate array (FPGA). FPGA prototyping is
43
brain and have helped around two-thirds of all epilepsy popular because in addition to their speed and flexibility,
44
patients, while one-third remain unresponsive [2]. To benefit FPGAs can be reprogrammed any number of times.
45
the latter, new solutions are emerging from the field of
46
neuroengineering, many of which use electroencephalogram The rest of the paper is structured as follows. Section II
47
(EEG) signals for detecting epileptic seizures. The main idea presents the mathematical framework for SODP and ellipse
48
behind these solutions is to generate a feedback circuit which, area calculation. In section III, the proposed architecture for
upon detecting the onset of a seizure, delivers electrical FPGA implementation has been discussed. The results
49
stimuli to the focal point resulting in the cessation of the obtained from simulation and implementation have been
50
compared and the hardware resource utilization has been
51
seizure [3].
tabulated in section IV. Finally, the conclusion has been drawn
52
For the purpose of seizure detection, various algorithms in section V.
53
based on wavelet analysis [4], time-frequency analysis [5] and
54
empirical mode decomposition [6-7] have been demonstrated II. MATHEMATICAL ANALYSIS
55
56
A. Second-Order Difference Plot
57
978-1-4673-6540-6/15/$31.00 ©2015 IEEE
60
61
62
63
64
65
1
The second-order difference plot is a graphical method
originating from chaos theory that is used to study the amount
of variability present in a time series. The degree of variability
or chaos is an important attribute of complex nonlinear
systems and can be used for classifying them. The SODP of a
time series x(n) of length N plots consecutive rates X(n) and
Y(n) against each other, which are defined as [9]:
X(n) = x(n+1) – x(n) (1)
Sy2 = {Y(n)2}/N (4) multiply/divide and 3 square root operations are required to
compute the final ellipse area. Although the total number of
operations can be reduced by carrying out some mathematical
Sxy = {X(n)Y(n)}/N (5) simplifications, this begets intractably large bit widths of
intermediate variables. Keeping this trade-off in mind, the
The major and minor radii, a and b, of the 95% confidence flow depicted in Fig. 1 was adopted for the implementation.
ellipse are computed as:
B. Proposed Architecture
a = 1.7321 * sqrt(Sx2 + Sy2 + D) (6) The proposed architecture for implementing the DFG
shown in Fig. 1 is represented in block diagram form in Fig. 2.
The data path has been has been split into 3 subunits, each of
b = 1.7321 * sqrt(Sx2 + Sy2 − D) (7) which has its own control unit. The control units start and stop
the operation of the corresponding subunits by sending
The parameter D in (6) and (7) is given as: appropriate flags. Subunit (i) generates the signals X(n) and
Y(n), which can be sent to an oscilloscope though a digital-to-
analog converter (DAC) for generating the SODP. Subunit (ii)
D = sqrt{ Sx2 + Sy2 − 4(Sx2Sy2 − Sxy2)} (8) generates the mean square values of X(n) and Y(n), i.e. S x2,
Sy2, and Sxy. For implementation purposes we have fixed the
The area of the ellipse, A_ellipse is simply the product of the length of the time series, N as 1024. Thus division by N
two radii multiplied by pi. becomes a simple right shift operation. Subunit (iii) performs
the remaining arithmetic for calculating the 95% confidence
A_ellipse = π * a * b (9) ellipse area. All multiplications are carried out by embedded
digital signal processing (DSP) blocks. The square root
operation is carried out by a separate module which uses an
III. ARCHITECTURE FOR SODP AND ELLIPSE AREA algorithm based on successive approximation. In this
CALCULATION algorithm, an initial trial root is iteratively increased or
decreased depending on whether its square is smaller or larger
A. Data Flow Graph than the input number. To preserve accuracy, 4 bits of the
The computations required to generate the SODP and decimal part of intermediate variables are kept and the rest are
calculate its 95% confidence ellipse area, as given in (1) discarded. This truncation helps avoid lengthy calculations
through (9), are modeled in a data flow graph (DFG) shown in which slow down the entire design and leads to a very slight
Fig. 1. As can be seen from the DFG, 10 add/subtract, 9 loss in the accuracy of the final area.
2
Fig. 2. Block diagram of the proposed architecture for FPGA implementation
3
Fig. 3. Comparison of results from MATLAB simulations and FPGA implementation for seizure-free (a-d) and ictal EEG data (e-f)
ACKNOWLEDGMENT REFERENCES
The authors would like to acknowledge the Department of
Epileptology, University of Bonn for providing the EEG [1] D.J. Thurman, E. Beghi, C.E. Begley, A.T. Berg, J.R. Buchhalter, D.
database which was extensively used to test the efficacy of the Ding, et al., “Standards for epidemiologic studies and surveillance of
hardware design developed. epilepsy,” Epilepsia, vol. 52(S7), pp. 2-26, September 2011.
4
[2] W.C. Stacey and B. Litt, “Technology insight: euroengineering and [11] S. Raghunathan, S.K. Gupta, M.P. Ward, R.M. Worth, K. Roy, and P.P.
epilepsyy—designing devices for seizure control,” Nature Clinical Irazoqui, “The design and harware implementation of a low-power real-
Practice Neurology, vol. 4(4), pp. 190-201, April 2008. time seizure detection algorithm,” Journal of Neural Engineering, vol. 6,
[3] E.H. Kossoff, E.K. Ritzl, J.M. Politsky, A.M. Murro, J.R. Smith, R.B. article ID 056005, 13 pages, 2009.
Duckrow, et al., “Effect of an external responsive neurostimulator on [12] R.A. Thuraisingham, “A classification system to detect congestive heart
seizures and electrographic discharges during subdural electrode failure using second-order difference plot of RR intervals,” Cardiology
monitoring,” Epilepsia, vol. 45(12), pp. 1560-1567, December 2004. Research and Practice, vol. 2009, Article ID 807379, 7 pages, 2009.
[4] H. Ocak, “Automatic detection of epileptic seizures in EEG using [13] R.B. Pachori, D. Hewson, H. Snoussi, and J. Duchene, “Postural time-
discrete wavelet transform and approximate entropy,” Expert Systems series analysis using empirical mode decomposition and second-order
with Applications, vol. 36(2), pp. 2027-2036, March 2009. difference plots,” in Proc. IEEE International Conference on Acoustics,
[5] A.T. Tzallas, M.G. Tsipouras, and D.I. Fotiadis, “Automatic seizure Speech, and Signal Processing, Taipei, TW, 2009, pp. 537-540.
detection based on time-frequency analysis and artificial neural [14] Xilinx. (2015, June 1). UltraFast Design Methodology Guide for the
networks,” Computational Intelligence and Neuroscience, vol. 2007, Vivado Design Suite (v2015.1) [Online]. Available:
article ID 80510, 13 pages, 2007. http://www.xilinx.com/support/documentation/sw_manuals/ug949-
[6] R.B. Pachori and S. Patidar, “Epileptic seizure classification in EEG vivado-design-methodology.pdf
signals using second-order difference plot of intrinsic mode functions,” [15] R.G. Andrzejak, K. Lehnertz, F. Mormann, C. Rieke, P. David, and C.E.
Computer Methods and Programs in Biomedicine, vol. 113(2), pp. 494- Elger, “Indications of nonlinear deterministic and finite-dimensional
502, February 2014. structures in time-series of brain electrical activity: dependence on
[7] R.B. Pachori, “Discrimination between ictal and seizure-free EEG recording region and brain state,” Physical Review E, vol. 64, article ID
signals using empirical mode decomposition,” Research Letters in 061907, 2001.
Signal Processing, vol 2008, article ID 293056, 5 pages, 2008. [16] T.E. Prieto, J.B. Myklebust, R.G. Hoffmann, and E.G. Lovett,
[8] N.E. Huang, Z. Shen, S.R. Long, M.C. Wu, H.H. Shih, Q. Zheng, et al., “Measures of postural steadiness: differences between healthy young
“The empirical mode decomposition and the Hilbert spectrum for and elderly adults,” IEEE Transactions on Biomedical Engineering, vol.
nonlinear and non-stationary time series analysis,” Proceedings of the 43(9), pp. 956-966, September 1996.
Royal Society of London A, vol. 454(1971), pp. 903-995, March 1998. [17] G.L. Cavalheiro, M.F.S. Almeida, A.A. Pereira, and A.O. Andrade,
[9] M.E. Cohen, D.L. Hudson, and P.C. Deedwania, “Applying continuous “Study of age-related changes in postural control during quiet standing
chaotic modeling to cardic signal analysis,” IEEE Engineering in through linear discriminant analysis,” BioMedical Engineering OnLine,
Medicine and Biology Magazine, vol. 15(5), pp. 97-102, September vol. 8(35), November 2009.
1996. [18] Patrick Flandrin. (2007). Matlab/C codes for EMD and EEMD with
[10] C.P. Young, S.F. Liang, D.W. Chang, Y.C. Liao, F.Z. Shaw, and C.H. examples [Online]. Available: http://perso.ens-
Hsieh, “A portable wireless online closed-loop seizure controller in lyon.fr/patrick.flandrin/emd.html
freely moving rats,” IEEE Transactions on Instrumentation and
Measurement, vol. 60(2), pp. 513-521, February 2011.