<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Method of automated epileptiform seizures and sleep spindles detection in the wavelet spectrogram of rats' EEG</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>I.A. Kershner</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Yu.V. Obukhov</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>I.G. Komoltsev</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Institute of Higher Nervous Activity and Neurophysiology of RAS</institution>
          ,
          <addr-line>Butlerova 5A, 117485,Moscow</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Kotel'nikov Institute of Radio Engineering and Electronics of RAS</institution>
          ,
          <addr-line>Mokhovaya 11-7, 125009, Moscow</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2017</year>
      </pub-date>
      <fpage>104</fpage>
      <lpage>109</lpage>
      <abstract>
        <p>A method and algorithm for automatic detection of epileptiform seizures, sleep spindles, and other high voltage rhythmic activity were developed. They based on the analysis of the ridges of EEG wavelet-transformation. The uninformative points of the ridge are removed adaptively on the basis of power spectral density histograms analysis. The study of long-term electroencephalographic (EEG) signals of patients who have suffered from traumatic brain injury (TBI) to detect markers of posttraumatic epilepsy (PE) [1] is an unsolved issue. Immediate and early seizures within the first week after PTI are important risk factors for appearance of late convulsive seizures, which are a manifestation of PE. Early seizures are associated with brain damage, while late ones are associated with the processes of restructuring the neuronal connections and many other changes called epileptogenesis. Late convulsive seizures can develop months or even years after TBI, as epileptogenesis proceeds extremely slowly and asymptomatically. At the moment there are no clear EEG criteria for this pathological process. Therefore, the detection of biomarkers of PE in the acute period of TBI is of great importance fo r timely diagnosis, as well as researches of new methods of preventing epilepsy.</p>
      </abstract>
      <kwd-group>
        <kwd>Traumatic brain injury</kwd>
        <kwd>EEG</kwd>
        <kwd>Wavelet</kwd>
        <kwd>Spectrogram</kwd>
        <kwd>Ridges</kwd>
        <kwd>Epileptiform seizures</kwd>
        <kwd>Sleep spindles</kwd>
        <kwd>Event detection</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>In [6], the parameters for the seizure classification are skewness and kurtosis coefficients, the Fourier peak frequency of the
spectrum, the median of the frequency, entropy, correlation dimension, and variance of the EEG signals. However, as in [5],
epileptic discharge is distinguished from the background activity, but other high-amplitude events present in the signal were not
considered.</p>
      <p>In [7] studied sleep spindles (SS). To detect them, a method based on the analysis of the wavelet transform was used. The
calculation of the mean value over the time-frequency rectangles of the instantaneous energy of the wavelet transform was
carried out. After that, in comparison with the parameters inherent in EEG signal background activity, the conclusion was mad e
whether this event is a sleep spindle or not. This method does not consider the presence in the EEG signals of such high-energy
activity as epileptiform discharges. Although in works [8-10] it is said about the possibility of transformation the sleep spindle
into the peak wave’s discharge. In long-term EEG records (day, week), in addition to epileptiform discharges, there are other
high-energy activities that differ from the background EEG signal, such as sleep spindles. SS, as well as ED, belong to the group
of high-amplitude brain rhythmic electrical activity. In humans and animals with absence epilepsy, the frequency range of SS
and ED ranges from one to fifteen Hz [7,11-16].
Automatic detection of sleep spindles and epileptiform</p>
      <p>discharges in the early post-traumatic period, in which the
mechanisms of the occurrence of epileptiform activity differ from those that occur in epilepsy, is an unresolved task.</p>
      <p>As in [13-16], in order to investigate the time-frequency dynamics of the EEG, we use the ridges of the Morlet wavelet
transform. However, in contrast to these works, when the beginning of epileptiform discharges was set by the expert manually,
in this article we describe the method of automatically finding the beginning and end of high-amplitude activity, and calculating
its parameters.</p>
      <p>Matlab.</p>
    </sec>
    <sec id="sec-2">
      <title>2. The method of automatic detection of events containing high-amplitude rhythmic activity</title>
      <p>Long-term EEG records represent a large array of ~ 108 numeric data. Typically, the EEG is measured at a sampling rate of
250 Hz. EEG signals were divided into 10-minute intervals, as there is a limit to the amount of data that can be processed in the</p>
      <p>To remove linear trends, power supply noise and low-frequency noise, daily fragments of EEG records were filtered by a
16th-order Butterworth discrete filter with a bandwidth ranging from 2 Hz to 30 Hz. The bandwidth of the filter exceeds the
frequency range typical for ED and SS. The signal is filtered in two stages. At the first stage, synthesis of 8th order discrete
bandpass filter with a bandwidth ranging from 2 Hz to 30 Hz was realized by using function "butter". As a result, the transfe r
function H in decreasing order of powers of the variable z was obtained:
 ( ) =
 +1
∑ =1  ( )∗ 1−
1+∑ =+21∗ 1−
Where n = 8 is the order of the filter.</p>
      <p>In the second stage, the phase shift was compensated. By means of the "filtfilt" function, discrete filtering using the Fast
Fourier Transform (FFT) is implemented in conjunction with the division of the signal into blocks. The signal is filtered from
the beginning of record to its end, then obtained signal is filtered a second time - from the end to the beginning. Thus, the phase
shifts were compensated, and the resulting filter order was doubled: n = 16.</p>
      <p>
        The result of filtration of 10-minute signal fragment is shown in Fig. 1.
(
        <xref ref-type="bibr" rid="ref1">1</xref>
        )
(
        <xref ref-type="bibr" rid="ref2">2</xref>
        )
(
        <xref ref-type="bibr" rid="ref3">3</xref>
        )
(
        <xref ref-type="bibr" rid="ref4">4</xref>
        )
(
        <xref ref-type="bibr" rid="ref5">5</xref>
        )
      </p>
      <p>10 minute signal fragment after filtration. The sampling frequency is 250 Hz.</p>
      <p>
        The automatic detection method of high-amplitude brain rhythmic electrical activity is based on the analysis of wavelet
spectrogram ridges [17]. To calculate the wavelet spectrograms, a complex Morlet wavelet transform was used (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ):
function (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ):
spectrogram:
1
√
 ( ,  ) =
      </p>
      <p>∫  ( ) ∗  (
 ( ) =</p>
      <p>1
√</p>
      <p>2    

 = | ( ,  )|2
−
 2
 
 −</p>
      <p>)
 ( ) =</p>
      <p>
        ∈(2−20  )(  (  ,  ))
The coefficients Fb = Fc = 1. The power spectrum density (PSD) of a time-frequency signal is calculated according to
The ridge consists of the points y(i) with the maximum values of the power spectral density in each time count of the
waveletIn the formula (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) x(t) refers to the source signal, and ψ (η) refers to the Morlet mother function:
      </p>
      <p>Usually, the neurophysiologist examines long-term EEG recordings, in which he extracts fragments with high-amplitude
activity and, in his experience, classifies them into sleep spindles or epileptiform discharges. Fig. 2 shows examples of wavelet
spectrograms of rat EEG signals the day after TBI with ED and SS and their ridges y(i).</p>
      <p>The entire 10-minute time interval has both interesting events for us and background activity. Therefore, to extract the points
of ridges corresponding to SS or ED, it is necessary to delete the ridge points corresponding to the background.</p>
      <p>Wavelet spectrograms and their ridges of rat EEG signal the day after the traumatic brain injury. To the left is ED and to the right is SS.</p>
      <p>Wavelet-spectrogram ridge of a 10-minute rat EEG signal.</p>
      <p>SS and ED are characterized by an increased value of the spectral power density (PSD) as compared to the background. To
select a positive ridge background clipping threshold Tr &gt; 0, a histogram of the PSD at the points of the ridge is analyzed (Fig.
4). In the histogram, the PSD values are divided into 100 equal intervals.</p>
      <p>To calculate the histogram, the function "hist" was used. One of the output arguments of this function is an array of 100 PSD
values. Each PSD value from this array was considered as a threshold Tr. The ridge points y(i) &lt;Tr were assigned the value
y(i) = 0. The remaining points of the ridge between the points y(i) = 0 with the values y(i) ≥ Tr are combined into a vector,
which we will call an event. In Fig. 5 shows a histogram of the number of detected events, depending on the selected threshold
value of PSD (Tr).</p>
      <p>Image Processing, Geoinformation Technology and Information Security / I.A. Kershner, Yu.V. Obukhov, I.G. Komoltsev</p>
      <p>We select a threshold value Tr to include all high-amplitude events present in the signal. Namely, the Tr value at which the
maximum number of events was found (Fig. 5).</p>
      <p>In the future, the beginning and the end of each event were calculated. The threshold value Tr is higher than the maximum
value of the amplitude characteristic of the background activity. Consequently, the values of the beginning and end of found
events do not correspond to the true ones. Therefore, the vector artificially expanded. Let the origin of the vector correspond to
the point k of the ridge y(i). We consider the points of the ridge k and k-1, if y(k-1) &gt; y(k), then the point k is considered the
beginning of the event, otherwise the left shift along the ridge of the wavelet spectrogram continues until a local minimum i s
reached. A similar operation was done to calculate the end of the event, only the advance along the ridge was made to the right.
Fig. 6 shows a 10-minute fragment of a filtered rat EEG signal with isolated high-amplitude events on it, and on
waveletspectrogram ridge of this signal.</p>
      <p>Fragments of a signal with epileptiform discharges are of immense importance in the study of PE. But they may not have
such high amplitude, as, for example, in the time interval from 0 seconds to 200 seconds or from 440 seconds to 600 seconds
(Fig.6.). Consider the minute section of the current 10-minute recording, at which the expert detected a discharge with smaller
amplitude than the other events (Fig. 7). The presence of such events makes the detection process more difficult.</p>
      <p>The epileptiform discharge is in the time interval from 390 seconds to 395 seconds. As can be seen from Fig. 7, this method
allows identifying regions with epileptiform discharges, but also other events are detected.</p>
      <p>Additional conditions for the selection of high-amplitude events were given by expert-neurophysiologist. If there is a time
delay between two events of not more than 1/7 second, then these two events are considered as one. Also, events longer than 0 .5</p>
      <p>Image Processing, Geoinformation Technology and Information Security / I.A. Kershner, Yu.V. Obukhov, I.G. Komoltsev
seconds were considered uninformative and were removed from consideration. In Fig. 8 shows the result of reliable events,
taking into account the conditions set by the expert.</p>
    </sec>
    <sec id="sec-3">
      <title>Acknowledgements References</title>
      <p>This research was done at the expense of the grant of the Russian Science Foundation (project 16-11-10258).</p>
      <p>The calculated areas are different from the background, but need further classification. They can contain both carotid
spindles, epileptiform discharges, and other high-amplitude activity, which neurophysiologists have not detected. Beginning,
end, duration, minimum, maximum and average value of frequencies, maximum PSD value were calculated for each event. After
analyzing these parameters, events will be classified as epileptiform discharges, or as high-amplitude activity that are not ED.</p>
    </sec>
    <sec id="sec-4">
      <title>3. Conclusion</title>
      <p>The paper describes a method for automatic detection of high-amplitude rhythmic activity, based on the analysis of
waveletspectrogram ridges. As a result of algorithm work, areas with high amplitude rhythmic activity on the electroencephalogram
were allocated. Also, the parameters of the allocated parts of signal were calculated. With the help of this method, all
epileptiform activity found by the expert, as well as sleep spindles and other high-amplitude activity. This method allows
collecting a large group of events that will permit the classification of epileptiform discharges not only with background activity,
but also with other events.</p>
      <p>Image Processing, Geoinformation Technology and Information Security / I.A. Kershner, Yu.V. Obukhov, I.G. Komoltsev
[13] Gabova AV, Bosnyakova DY, Bosnyakov MS, Shatskova AB, Kuznetsova GD. The Time–Frequency Structure of the Spike–Wave Discharges in Genetic</p>
      <p>
        Absence Epilepsy. Doklady Biological Sciences. Kluwer Academic Publishers-Plenum Publishers 2004; 396(
        <xref ref-type="bibr" rid="ref1 ref2 ref3 ref4 ref5 ref6">1-6</xref>
        ): 194–197.
[14] Bosnyakova DYu, Obukhov YuV. Extraction of dominant feature in biomedical signals. Pattern Recognition and Image Analysis 2005; 15(
        <xref ref-type="bibr" rid="ref3">3</xref>
        ): 513–515.
[15] Bosnyakova D, Gabova A, Kuznetsova G. Time–frequency analysis of spike-wave discharges using a modified wavelet transform. Journal of neuroscience
methods 2006; 154(
        <xref ref-type="bibr" rid="ref1">1</xref>
        ): 80–88.
[16] Bosnyakova D, Gabova A, Zharikova A. Some peculiarities of time-frequency dynamics of spike-wave discharges in human and rat. Clinical
      </p>
      <p>
        Neurophysiology 2007; 118(
        <xref ref-type="bibr" rid="ref8">8</xref>
        ): 1736–1743.
[17] Malla S. Wavelets in Signal Processing. Moscow: Mir, 2005; 671 p. (in Russian)
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Annegers</surname>
            <given-names>JF</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hauser</surname>
            <given-names>WA</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Coan</surname>
            <given-names>SP</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rocca</surname>
            <given-names>WA</given-names>
          </string-name>
          .
          <article-title>A population-based study of seizures after traumatic brain injuries</article-title>
          .
          <source>NEJM</source>
          <year>1998</year>
          ;
          <volume>338</volume>
          :
          <fpage>20</fpage>
          -
          <lpage>24</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Pitkanen</surname>
            <given-names>A</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Immonen</surname>
            <given-names>RJ</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grohn</surname>
            <given-names>OHJ</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kharatishvili</surname>
            <given-names>I.</given-names>
          </string-name>
          <article-title>From traumatic brain injury to posttraumatic epilepsy: what animal models tell us about the process and treatment options</article-title>
          .
          <source>Epilepsia</source>
          <year>2009</year>
          ;
          <volume>50</volume>
          :
          <fpage>21</fpage>
          -
          <lpage>29</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Kabadi</surname>
            <given-names>SV</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hilton</surname>
            <given-names>GD</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stoica</surname>
            <given-names>BA</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zapple</surname>
            <given-names>DN</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Faden</surname>
            <given-names>AI</given-names>
          </string-name>
          .
          <article-title>Fluid-percussion-induced traumatic brain injury model in rats</article-title>
          .
          <source>Nature Protocols</source>
          <year>2010</year>
          ;
          <volume>5</volume>
          (
          <issue>9</issue>
          ):
          <fpage>1552</fpage>
          -
          <lpage>1563</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>Hopfengartner</surname>
            <given-names>R</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kasper</surname>
            <given-names>BS</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Graf</surname>
            <given-names>W.</given-names>
          </string-name>
          <article-title>Automatic seizure detection in long-term scalp EEG using an adaptive thresholding technique: a validation study for clinical routine</article-title>
          .
          <source>Clinical Neurophysiology</source>
          <year>2014</year>
          ;
          <volume>125</volume>
          (
          <issue>7</issue>
          ):
          <fpage>1346</fpage>
          -
          <lpage>1352</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Divya</surname>
            <given-names>S</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Priyadharsini</surname>
            <given-names>SS</given-names>
          </string-name>
          .
          <article-title>Classification of EEG Signal for Epileptic Seizure Detectionusing EMD and ELM</article-title>
          .
          <source>International journal for trends in engineering &amp; technology</source>
          <year>2015</year>
          ;
          <volume>3</volume>
          (
          <issue>2</issue>
          ):
          <fpage>68</fpage>
          -
          <lpage>74</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Fergus</surname>
            <given-names>P</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hignett</surname>
            <given-names>D</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hussain</surname>
            <given-names>A</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Al-Jumeily</surname>
            <given-names>D</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Abdel-Aziz K. Automatic Epileptic</surname>
          </string-name>
          <article-title>Seizure Detection Using Scalp EEG and Advanced Artificial Intelligence Techniques</article-title>
          . BioMed research international,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>Sitnikova</surname>
            <given-names>EY</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grubov</surname>
            <given-names>VV</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Khramov</surname>
            <given-names>AE</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Koronovskii</surname>
            <given-names>AA</given-names>
          </string-name>
          .
          <article-title>Developmental changes in the frequency-time structure of sleep spindles on the EEG in rats with a genetic predisposition to absence epilepsy (WAG/Rij)</article-title>
          .
          <source>Neuroscience and Behavioral Physiology</source>
          <year>2014</year>
          ;
          <volume>44</volume>
          (
          <issue>3</issue>
          ):
          <fpage>301</fpage>
          -
          <lpage>309</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>Gloor</surname>
            <given-names>P.</given-names>
          </string-name>
          <article-title>Generalized cortico-reticular epilepsies: some considerations on the pathophysiology of generalized bilaterally synchronous spike and wave discharge</article-title>
          .
          <source>Epilepsia</source>
          <year>1968</year>
          ;
          <volume>9</volume>
          (
          <issue>3</issue>
          ):
          <fpage>249</fpage>
          -
          <lpage>263</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <surname>Gloor</surname>
            <given-names>P.</given-names>
          </string-name>
          <article-title>Generalized epilepsy with bilateral synchronous spike and wave discharge. New findings concerning its physiological mechanisms</article-title>
          .
          <source>Electroencephalography and Clinical Neurophysiology. Supplement</source>
          <year>1978</year>
          ;
          <volume>34</volume>
          :
          <fpage>245</fpage>
          -
          <lpage>249</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <surname>Kostopoulos</surname>
            <given-names>GK</given-names>
          </string-name>
          .
          <article-title>Spike-and-wave discharges of absence seizures as a transformation of sleep spindles: the continuing development of a hypothesis</article-title>
          .
          <source>Clinical Neurophysiology</source>
          <year>2000</year>
          ;
          <volume>111</volume>
          :
          <fpage>27</fpage>
          -
          <lpage>38</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <surname>Jankel</surname>
            <given-names>WR</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Niedermeyer</surname>
            <given-names>E.</given-names>
          </string-name>
          <article-title>Sleep spindles</article-title>
          .
          <source>Journal of clinical neurophysiology</source>
          <year>1985</year>
          ;
          <volume>2</volume>
          (
          <issue>1</issue>
          ):
          <fpage>1</fpage>
          -
          <lpage>36</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <surname>Jobert</surname>
            <given-names>M.</given-names>
          </string-name>
          <article-title>Topographical analysis of sleep spindle activity</article-title>
          . Neuropsy-chobiology
          <year>1992</year>
          ;
          <volume>26</volume>
          (
          <issue>4</issue>
          ):
          <fpage>210</fpage>
          -
          <lpage>217</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>