<!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>Research on the use of artificial neural networks for the myocardial infarction diagnosis</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>P I Katkov</string-name>
          <email>katkov.p.i@gmail.com</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>N S Davydov</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>A G Khramov</string-name>
          <email>alexander.khramov@gmail.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>A N Nikonorov</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Image Processing Systems Institute of RAS - Branch of the FSRC "Crystallography and Photonics" RAS</institution>
          ,
          <addr-line>Molodogvardejskaya street 151, Samara, Russia, 443001</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Samara National Research University</institution>
          ,
          <addr-line>Moskovskoe Shosse 34А, Samara, Russia, 443086</addr-line>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2019</year>
      </pub-date>
      <fpage>158</fpage>
      <lpage>164</lpage>
      <abstract>
        <p>In this paper, the use of artificial neural networks for the myocardial infarction diagnosis is investigated. For the analysis, 169 ECG records were taken from the database of the Massachusetts University of Technology, of which 80 correspond to healthy patients and 89 correspond to patients who have a myocardial infarction. Each signal has been preprocessed. The result of preprocessing each signal is a common segment consisting of 1000 samples. To detect myocardial infarction, a convolutional neural network consisting of two convolutional layers was used. For accuracy of the neural network leave-one-out crossvalidation was used. The best results of the experiments are obtained with the neural network for leads V1, V2, AVF.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>Artificial neural networks are now widely used in different clinical research and its clinical use shows
high quality results especially in signal analysis such as electrocardiogram (ECG) signals.
Cardiovascular diseases are the main cause of health loss in most developed countries, therefore the
premature detection of cardiovascular diseases is a very important issue. One of the most dangerous
among cardiovascular diseases is myocardial infarction. In order to detect myocardial infarction, the
doctor analyzes the results of electrocardiography.</p>
      <p>
        There are many different methods for analyzing ECG signals. For example, methods based on blind
signal separation [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], the multilayer method of support vectors [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], and others.
      </p>
      <p>The main objective of this study is to study the applicability of artificial neural networks for the
diagnosis of myocardial infarction by electrocardiogram. The main problems of every myocardial
infarction detection method are complexity and a poor theoretical basis and these problems need to be
solved for future developments and studies.</p>
      <p>
        We compare our method of myocardial infarction detection with several others such as Blind
Signal Separation (BSS) method [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. BSS was used for the extraction of the raw signal and Naive
Bayes classifier was used for myocardial infarction detection. In that study the algorithm gave 96.77%
of accuracy, but it is hard to recreate this result using the information which is given in the paper. The
second study is based on the conversion of ECG signal to 3D image and the using of multilayer
support vector machine for classification [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. However, it is also possible to reconstruct the structure
of ECG signal in order to filter the signal with a risk of data loss [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. The ECG signal represents
anatomical structure of the heart, its parts and the process of working. One of the last developed
method of myocardial infarction detection is based on wavelet transformation[
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. This new approach
allows to do fast and accurate classifications using information from energy level of wavelet
transformation.
      </p>
      <p>
        In this paper, we proposed the new approach based on discrete wavelet transformation during
preprocessing stage and convolutional neural network in the classification stage. At the first stage, there is
a selection of the cardiac cycle in order to reduce the total amount of data and bring all the data to one
template form. This is done with use of an algorithm that is based on a discrete wavelet transform of
the original signal [
        <xref ref-type="bibr" rid="ref5 ref6 ref7">5, 6, 7</xref>
        ].
      </p>
      <p>
        At the second stage, the binary classification problem is solved using a convolutional neural
network. This is where the architecture for the neural network is composed and its learning takes
place. The patient data set was taken from the database of the Massachusetts Institute of Technology
[
        <xref ref-type="bibr" rid="ref8">8</xref>
        ].
      </p>
      <p>Also in this paper, to get the result of the classification close to what can be obtained by the
practical application of the algorithm, a leave-one-out cross validation technique was used.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Signal preprocassing</title>
      <sec id="sec-2-1">
        <title>2.1 Segmantation</title>
        <p>The first step in bringing the signal to the required form is its segmentation into cardiac cycles, which
will allow you to continue working not with the whole signal, but only with its part containing the
most important information about the patient. Segmentation is performed using discrete wavelet
transform.</p>
      </sec>
      <sec id="sec-2-2">
        <title>2.1.1 Trend removal and signal filtering using discrete wavelet transform</title>
        <p>The raw signals used in this study have different lengths and amplitudes. Each of them also has a
wandering trend line, which affects the position of each cardiac cycle and can cause unwanted
distortions during further processing. An example of a raw ECG signal with a wandering trend line
present is shown in Figure 1.</p>
        <p>The wandering of the trend line of the ECG signal is associated with physical movements of the
chest in the process of breathing the patient. This noise is low-frequency physical noise and its
elimination is necessary for obtaining a stable signal and its subsequent processing.</p>
        <p>The frequency range of the trend line is between 0 and 0.5 Hz. The method used to remove a
wandering trend line is based on decomposition using discrete wavelet transform into 8 levels and the
subsequent restoration of the signal to 8 levels without using additional level coefficients. Due to the
fact that the signal was restored from those coefficients that contain all the main details of the source
signal, except for the trend line, the signal shown in Figure 2 will be received at the output of the
inverse transform.</p>
        <p>Also, to prepare the signal for further processing, it is necessary to remove high-frequency noise.
This can be done by decomposing the signal into 3 levels of discrete wavelet transform and restoring
the signal according to the coefficients of the third and additional levels, thereby removing
highfrequency noise from the signal.</p>
      </sec>
      <sec id="sec-2-3">
        <title>2.1.2 R-peak detection and signal segmentation</title>
        <p>To proceed the signal segmentation, it is required to select the most important point of each cardiac
cycle – the R-peak. The frequency range corresponding to the QRS complex and R-peak is between 3
and 40 Hz, which means that the signal will require decomposition into 5 levels of discrete wavelet
transform and the subsequent restoration of the signal using coefficients 4 and 5 levels.</p>
        <p>After the signal is restored, it will contain only peak values at those positions which correspond to
the R-peaks in the original signal. Peaks are detected by successively searching for a maximum with a
window width of half the sampling frequency and a maximum of at least 10% of the amplitude of the
maximum point in the reconstructed signal. The result of projecting the found points on the original
signal is shown in Figure 3.</p>
        <p>The final step of segmentation of the ECG signal will be the cutting of the signal into cardiac
cycles relative to the R-peak. The length of the cardiac cycle of each patient is different and depends
on his pulse and how long the electrocardiogram was taken. Therefore, the following formula was
developed to calculate the length of the patient's cardiac cycle:</p>
        <p>ℎ
 =

.</p>
        <p>After calculating the length of the cardiac cycle, it is necessary to distinguish it relative to each
Rpeak. To do this, take an interval equal to half of the length of the entire cycle to the left of the R-peak
and an the same interval to the right of the R-peak.</p>
        <p>Thus, the signal will be evenly divided into cardiac cycles of the same length, but for each patient
this length will be different. The entire set of segments obtained as a result of dividing the ECG signal
is shown in Figure 4.</p>
      </sec>
      <sec id="sec-2-4">
        <title>2.2 Calculation of a common standard ECG signal segment</title>
        <p>The final step in converting the ECG signal to the common standard segment will be averaging the set
of selected segments. This procedure is necessary in order to obtain the general shape of the entire set
of segments and drown out low-frequency noises. It is worth mentioning that this step may drown out
erroneously identified cardiac cycles that are not. For example, if in the process of ECG removal any
physical noise was recorded with a frequency equal to the frequency of the QRS complex, then it can
be defined as part of the heartbeat. In this regard, averaging will significantly reduce the contribution
of the defective clock to the overall information segment of the signal. Also in the case of pathological
signals, various heart sounds and heart damage can affect the waveform. However, the detection of
damage data can be based on the selection of the shape - the average standard segment, and the
subsequent finding of the greatest deviation from this segment.</p>
        <p>The result of the final stage of processing is shown in Figure 5.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Architecture of the convolutional neural network</title>
      <p>After preprocessing signals for all 169 input records, we obtain an array of dimension (169, 600, N),
where N is the number of leads taken. This array will be fed to the input of our neural network along
with the array, which contains the answers to each entry (1, if the patient is healthy, 0, if he has a
posterodiaphragmatic myocardial infarction). We implement the neural network using the Keras
library in the Python language.</p>
      <p>The following figure 6 shows the architecture of the convolutional neural network.</p>
      <p>A convolutional layer is a set of feature maps. The number of attribute cards is determined
experimentally. If you take a large number of cards, the recognition quality will increase, but the
computational complexity will increase too. Two convolutional layers were chosen because, with a
smaller choice of layers, the accuracy of the network becomes noticeably worse, and with a larger
choice of layers, it is not noticeably better. Each convolutional layer is 15 and 10 feature maps,
respectively. To reduce the dimensions of the maps of the previous layer, we use the subsample
operation MaxPooling. In order to prevent retraining of the neural network on each convolutional
layer, the Dropout method is used. The fully connected part of the network includes two levels. All
weights were chosen experimentally.
Data Science</p>
      <p>The network is trained using the error back-propagation algorithm and is optimized in accordance
with the Adam optimization algorithm.</p>
      <p>The Adam method converts a gradient as follows:</p>
      <p>St = α · St−1 + (1 − α) · ∇Et2; S0 = 0;
Dt = β · Dt−1 + (1 − β) · ∇Et; D0 = 0;
  =</p>
      <p>1 − 
· (
1 − 
 
1
error function, which looks like this:
where η – learning rate, ∇Et - loss function gradient, µ - moment ratio, ∆Wt−1
the previous iteration, ρ - regularization coefficient, Wt−1
– weights on the previous iteration, α
–weights changing in
Since we are solving a binary classification problem, the logistic error function was chosen as the

 =1
 ( ) = −
(     + (1 −   )ln (1 −   )) → 
,
where  – target vector,  – output vector.</p>
    </sec>
    <sec id="sec-4">
      <title>4. Results</title>
      <p>taken.</p>
      <p>
        For an experimental study, a program was launched for a data set consisting of 169 records with
different numbers of leads. Pre-processing was performed for each input signal. In order to test how
successfully our model is able to work in practice, element-by-element cross-validation
was
performed. In this case, a separate observation is used as a test set of data, and the remaining
observations from the initial set are used as a training one. The cycle repeats until each observation is
used once as a test. Table 1 shows the learning results of the neural network depending on the leads
solution is non-trivial and the material of the article does not explain how this problem was solved and
whether the data was cross-validated. Algorithms based on the support vector method have different
directions. In one of the considered articles, the ECG signal is converted to a three-dimensional view
and the calculation of three-dimensional signs of the disease and the subsequent application of the
multi-layer support vector machine (MSVM) [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>The results of the comparison of various approaches to the detection of myocardial infarction are
shown in Table 2.</p>
    </sec>
    <sec id="sec-5">
      <title>5. Conclusion</title>
      <p>In this paper, the possibility of using convolutional neural networks to determine myocardial infarction
was demonstrated. A preliminary selection of data and its preparation for training was done. A
convolutional neural network consisting of two convolutional layers was constructed and trained. An
experimental study was conducted, which showed that the neural network shows the best results when
the input data are leads V1, V2, AVF. On these leads, the neural network showed results: accuracy
0.8876, sensitivity - 0.9213, specificity - 0.8500. The classification was carried out using the
elementwise cross-validation method to obtain a result that most adequately shows the operation of the
algorithm in practical application.</p>
    </sec>
    <sec id="sec-6">
      <title>Acknowledgments</title>
      <p>With support of RFBR grants (projects 19-29-01235-mk, № 18-07-01390-А), and the state assignment
of the IPSI RAS - a branch of the Federal Scientific-Research Center "Crystallography and Photonics"
of the RAS (agreement № 007-ГЗ/Ч3363/26).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Devika</surname>
            <given-names>M G</given-names>
          </string-name>
          and
          <string-name>
            <surname>Aneesh R P 2016</surname>
          </string-name>
          <article-title>Myocardial infarction fetection using hybrid BSS method</article-title>
          <source>International Conference on Communication Systems and Networks 1 167</source>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Dhawan</surname>
            <given-names>A</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wenzel</surname>
            <given-names>B</given-names>
          </string-name>
          ,
          <string-name>
            <surname>George</surname>
            <given-names>S</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gussak</surname>
            <given-names>I</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bojovic</surname>
            <given-names>B</given-names>
          </string-name>
          and
          <string-name>
            <surname>Panescu D 2012</surname>
          </string-name>
          <article-title>Detection of acute myocardial infarction from serial ecg using multilayer support vector machine 34th</article-title>
          <source>Annual International Conference of the IEEE EMBS 1 2704</source>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Smelkina</surname>
            <given-names>N A</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kosarev</surname>
            <given-names>R N</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nikonorov</surname>
            <given-names>A V</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bairikov</surname>
            <given-names>I M</given-names>
          </string-name>
          ,
          <article-title>Ryabov</article-title>
          K
          <string-name>
            <given-names>N</given-names>
            ,
            <surname>Avdeev</surname>
          </string-name>
          <string-name>
            <given-names>A V</given-names>
            and
            <surname>Kazanskiy N L 2017</surname>
          </string-name>
          <article-title>Reconstruction of anatomical structures using statistical shape modeling</article-title>
          <source>Computer Optics</source>
          <volume>41</volume>
          (
          <issue>6</issue>
          )
          <fpage>897</fpage>
          -
          <lpage>904</lpage>
          DOI 10.18287/
          <fpage>2412</fpage>
          -6179-2017-41-6-
          <fpage>897</fpage>
          -904
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>Swain</surname>
            <given-names>S</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Patra</surname>
            <given-names>D 2018</given-names>
          </string-name>
          <article-title>Multiscale energy based suitable wavelet selection for detection of myocardial infarction in ECG 1 Healthcare Technology Letters 6 1</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Davydov</surname>
            <given-names>N S</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Khramov</surname>
            <given-names>A G</given-names>
          </string-name>
          <year>2018</year>
          <article-title>Myocardial infarction detection using wavelet analysis of</article-title>
          <source>ECG signal CEUR Workshop Proceedings</source>
          <volume>2212</volume>
          <fpage>31</fpage>
          -
          <lpage>37</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Haddadi</surname>
            <given-names>R</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Abdelmounim</surname>
            <given-names>E</given-names>
          </string-name>
          and
          <string-name>
            <surname>Hanine</surname>
            <given-names>M 2014</given-names>
          </string-name>
          <article-title>Discrete wavelet transform based algorithm for recognition of qrs complexes</article-title>
          <source>World of Computer Science and Information Technology Journal 4 127</source>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>Chandel</surname>
            <given-names>S</given-names>
          </string-name>
          and
          <string-name>
            <surname>Singh</surname>
            <given-names>K 2016</given-names>
          </string-name>
          <article-title>ECG denoising using wavelet transform and soft thresholding</article-title>
          <source>International Journal of Advanced Research in Computer Science and Software Engineering 6 370</source>
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>The</given-names>
            <surname>PTB Diagnostic ECG Database 2016</surname>
          </string-name>
          <string-name>
            <surname>URL</surname>
          </string-name>
          : https://physionet.org/physiobank/ database/ptbdb/ (
          <volume>09</volume>
          .
          <fpage>03</fpage>
          .
          <year>2019</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <surname>Loginov</surname>
            <given-names>D S</given-names>
          </string-name>
          <year>2011</year>
          <article-title>Methods and tools for computer processing of electrocardiogram for the diagnosis of myocardial infarction: Dis. Cand. tech</article-title>
          .
          <source>Sciences: 05.11</source>
          .17 (
          <issue>Penza</issue>
          ) p
          <fpage>134</fpage>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>