<!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>ConvNet based QRS Multilead Delineator in Electrocardiogram signals</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Juli`a Camps</string-name>
          <email>julia.camps@cs.ox.ac.uk</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Adam McCarthy</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Blanca Rodr´ıguez</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ana Minchol´e</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Computer Science, University of Oxford</institution>
          ,
          <addr-line>Oxford</addr-line>
          ,
          <country country="UK">UK</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>The surface electrocardiogram (ECG) is the most widely adopted test to diagnose cardiac diseases. Extracting critical biomarkers from these signals, such as the QRS width, requires delineating the fundamental waves in them. However, even though ECG signals significantly change depending on the recording methodology and cardiac condition, the available QRS delineators are hard to adapt to non-considered cases. We present a machine learning-based multilead ECG delineation method which can successfully delineate QRS complexes. Our approach reached root-mean-square errors (RMSE) of 12.1±0.5 and 18.5±1.1 ms for QRS onset and offset, respectively, when evaluated on the QT database; thus, demonstrating to be comparable to the state-of-the-art. Moreover, these results are similar to the RMSE calculated from differences between the two cardiologists that annotated this database, namely, 14.7 ms for the QRS onset and 17.2 ms for the offset.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>The surface electrocardiogram (ECG) is the most popular non-invasive test employed in
clinical practice to diagnose and monitor cardiac diseases. The ECG provides signal-data
of the heart’s electrical activity. Analysing these signals requires segmenting the beats
and delineating the P, QRS and T waves to calculate representative biomarkers. More
precisely, segmenting the signal involves identifying and isolating the beats in it, while
the delineation process retrieves the exact location of critical points, such as the onsets
and offsets of the QRS complexes.</p>
      <p>
        Manually delineating ECG waves is repetitive and time-consuming. Therefore, some
automatic delineation methods have been proposed in the literature [
        <xref ref-type="bibr" rid="ref1 ref2 ref5">5, 1, 2</xref>
        ]. However,
these systems lack of adaptability to significant differences in the target scenario since the
rules composing them have been carefully designed by human experts to match a specific
domain, for example, a database comprising ECG signals recorded from athletes while
exercising. Indeed, adapting these solutions to non-planned scenarios requires expert
knowledge about the task and the system’s design, which has limited the acceptance of
the existing QRS delineation approaches. On the other hand, machine learning models
have the potential to adapt to any domain automatically.
      </p>
      <p>
        We present a novel two-stepped machine learning-based multilead QRS delineation
system. This system first segments the QRS waves from the ECG recording and then
delineates them. More precisely, our approach is formed by successive segmentation and
delineation modules, each of which is composed of a one-dimensional (1D) convolutional
neural network (ConvNet) and a fully-connected neural network (NN). Previous studies
have addressed ECG segmentation and detection [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. Nevertheless, to our knowledge,
this is the first work to propose a ConvNet-based QRS delineator.
      </p>
    </sec>
    <sec id="sec-2">
      <title>Methods</title>
      <p>We propose a delineator system formed by two modules, each of which is composed
of two machine learning models (see Figure 1). Figure 1 illustrates these two modules
and how the system works. Firstly, the segmentation module, formed by the segmenter
and segmentation merger, locates the QRS waves in the ECG signal. Then, the data
are windowed again using only areas containing a QRS complex. Finally, the delineation
module, which is formed by the delineator and delineation merger, defines the QRS onset
and offset marks.
The segmenter is a 19-layered 1D ConvNet composed of 16 convolutional and three
fullyconnected layers. Each convolutional layer is formed by 16 kernels of length 3. These
layers implement batch normalisation and use rectified linear unit (ReLU) activation
functions. Next, the two hidden fully-connected layers have 128 and 256 neurons,
respectively. Furthermore, both layers implement batch normalisation, dropout at a rate
of 0.5 and ReLU as the activation functions. Finally, the output layer was another
fullyconnected layer with as many sigmoid units as the size of the input window to enable
the model to perform classification from one-hot encoded labels.</p>
      <p>The second model of the segmentation module is the segmentation merger. This
model is a 2-layered NN composed of two fully-connected layers, with 512 and one
neurons in the first and second layer, respectively. The first layer implements batch
normalisation, dropout at rate 0.5 and ReLU as the activation functions. There is a
sigmoid output layer.</p>
      <p>Analogously to the segmentation module, the delineator and the segmentation merger
are also a 1D ConvNet and an NN, respectively. Except for having 8 convolutional
layers with kernels of size 5, the delineator is composed of the same elements than the
segmenter. On the other hand, the delineation merger is identical to the segmentation
one.</p>
      <p>The number of layers and kernel sizes were chosen to enable our models to learn
patterns with length up to 33 instances (i.e. 132 ms), which accounts for most QRS
morphologies.
2.2</p>
      <sec id="sec-2-1">
        <title>Data</title>
        <p>
          The proposed method was validated using the QT database (QTDB) [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ], which includes
105 two-lead ECG recordings at 250 Hz sampling rate from 7 databases. Moreover, these
recordings are manually annotated by two different experts.These signals were windowed
at 2.048 s (i.e. 512 instances); thus, according to RR-interval known ranges, there should
be at least one QRS complex in each sample. Then each window was normalised by
subtracting the mean of its values and dividing by their standard deviation.
        </p>
        <p>The augmentation strategies implemented to train our models implied using
99%overlapping when windowing the samples, and adding constants and scaling the values
of the ECG signals.
2.3</p>
      </sec>
      <sec id="sec-2-2">
        <title>Methodology</title>
        <p>Firstly, the segmenter trains using the augmented and windowed data. Secondly, it
predicts segmentation labels on each recording using a sliding window with jumps of 1%
instances. Due to the sliding strategy, this process generates a matrix of predictions.
Next, the segmentation merger takes this matrix and trains on how to combine these
predictions. Once trained, this merger computes a single segmentation prediction for
every instance in the recording. Then, the system windows the segments of the signal with
a QRS to 256 ms to give some margin to the identified zones. Later, the delineator trains
on the task of finding the onset and offset marks using these shorter windows generated
by the segmentation module, each of which contains only one QRS complex. Moreover,
these samples are augmented again to train the delineator. Once trained, analogous to
the segmentation module, the delineator will produce a matrix of predictions using a
sliding window strategy. Then, the delineator merger uses this matrix to compute the
QRS onset and offset positions.
2.4</p>
      </sec>
      <sec id="sec-2-3">
        <title>Training and evaluation</title>
        <p>
          Some hyperparameters, namely the number of convolutional layers, the kernel sizes and
the window lengths, were chosen according to domain knowledge about the of ECG
signals and its waves. Furthermore, we used Adam [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ] and binary cross-entropy since
this task is a one-hot-encoding binary classification problem due to its resemblance to
segmentation.
        </p>
        <p>We chose the remaining hyperparameters and validated the system using nested
cross-validation with leave-one-database-out and grid search. More precisely, each fold
included the recordings from one of the databases included in the QTDB. Then
testing performances were computed each time for one fold using leave-one-database-out
cross-validation with the others to choose the hyperparameters and learn the models’
weights. Consequently, the performances reported are an approximation of how our
approach would generalise to other databases. Moreover, the training and assessment were
repeated 10 times to assess the reproducibility.</p>
        <p>The performance measurements employed in this study were the root-mean-square
error (RMSE), the mean error (ME) and the error’s sample standard deviation (ESTD)
from the differences between the manual annotations and our predictions.
3</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Results</title>
      <p>
        This study
[
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]
[
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]
Difference between
annotators
      </p>
      <p>
        STD
Offset
error according to the true labels. On the other hand, our approach uses both leads
to give a single prediction per time instance; thus, avoiding to use the true labels.
Moreover, the magnitude of the errors from the differences between the marks given by
the two annotators in the QTDB suggests that choosing the better of two predictions
each time can significantly boost the performance of the algorithm. Consequently, since
our performances are similar to the difference between the annotators and close to the
ones reported by [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] and [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], our approach is at least comparable to the state-of-the-art.
4
      </p>
    </sec>
    <sec id="sec-4">
      <title>Conclusions</title>
      <p>We propose a ConvNet-based multilead delineation system for QRS complexes in ECG
signals. The implemented data augmentation strategies enabled our system to
successfully learn from a scarce and highly diverse set of multilead ECG recordings how to
delineate QRS complexes. Moreover, the method achieved comparable performances
than the state-of-the-art.</p>
      <p>Exciting extensions of our work are assessing the proposed delineation system on
12lead ECG datasets and exploring time-series specific machine learning strategies, such
as recurrent neural networks and long-short-term-memory units.
5</p>
    </sec>
    <sec id="sec-5">
      <title>Acknowledgements</title>
      <p>The UK EPSRC supports JC and AMc, and a Wellcome Trust Senior Research
Fellowship in Basic Biomedical Sciences supports AMi and BR.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Almeida</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          , Mart´ınez,
          <string-name>
            <surname>J.P.</surname>
          </string-name>
          , Rocha,
          <string-name>
            <given-names>a.P.</given-names>
            ,
            <surname>Laguna</surname>
          </string-name>
          ,
          <string-name>
            <surname>P.:</surname>
          </string-name>
          <article-title>P wave delineation using spatially projected leads from wavelet transform loops</article-title>
          .
          <source>Computers in Cardiology 2010 XX</source>
          ,
          <fpage>1003</fpage>
          -
          <lpage>1006</lpage>
          (
          <year>2010</year>
          ), http://www.cinc.org/archives/2010/pdf/1003.pdf
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Bote</surname>
            ,
            <given-names>J.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Recas</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rincon</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Atienza</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hermida</surname>
            , R.:
            <given-names>A Modular</given-names>
          </string-name>
          <string-name>
            <surname>Low-Complexity ECG Delineation</surname>
          </string-name>
          <article-title>Algorithm for Real-Time Embedded Systems</article-title>
          .
          <source>IEEE Journal of Biomedical and Health Informatics</source>
          <volume>22</volume>
          (
          <issue>2</issue>
          ),
          <fpage>429</fpage>
          -
          <lpage>441</lpage>
          (mar
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Kingma</surname>
            ,
            <given-names>D.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ba</surname>
          </string-name>
          , J.:
          <article-title>Adam: A method for stochastic optimization</article-title>
          .
          <source>CoRR 1412</source>
          .6980 (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Laguna</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mark</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Goldberg</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          , Moody, G.:
          <article-title>A database for evaluation of algorithms for measurement of QT and other waveform intervals in the ECG</article-title>
          .
          <source>Computers in Cardiology 1997</source>
          <volume>24</volume>
          ,
          <fpage>673</fpage>
          -
          <lpage>676</lpage>
          (
          <year>1997</year>
          ), http://ieeexplore.ieee.org/document/648140/
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5. Mart´ınez,
          <string-name>
            <given-names>J.P.</given-names>
            ,
            <surname>Almeida</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            ,
            <surname>Olmos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            ,
            <surname>Rocha</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.P.</given-names>
            ,
            <surname>Laguna</surname>
          </string-name>
          ,
          <string-name>
            <surname>P.</surname>
          </string-name>
          :
          <article-title>A Wavelet-Based ECG Delineator Evaluation on Standard Databases</article-title>
          .
          <source>IEEE Transactions on Biomedical Engineering</source>
          <volume>51</volume>
          (
          <issue>4</issue>
          ),
          <fpage>570</fpage>
          -
          <lpage>581</lpage>
          (
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Xiang</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lin</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Meng</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          :
          <article-title>Automatic qrs complex detection using two-level convolutional neural network</article-title>
          .
          <source>Biomedical engineering online 17(1)</source>
          ,
          <volume>13</volume>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>