Selection of neural network architecture and data augmentation procedures for predicting the course of cardiovascular diseases

The article solves the problem of creating models for predicting the course and complications of cardiovascular diseases. Artificial neural networks based on the Keras library are used. The original dataset includes 1700 case histories. In addition, the dataset augmentation procedure was used. As a result, the overall accuracy exceeded 84%. Furthermore, optimizing the network architecture and dataset has increased the overall accuracy by 17% and precision by 7%.


Introduction
Diseases of the heart and blood vessels are the leading cause of death in most economically developed countries. Every year about 17 million people die of this pathology [1]. In Russia, for several decades, cardiovascular diseases, as well as in other countries, have been the leading cause of death among the population (50.1%) [2,3,4]. Therefore, early diagnosis of heart disease could significantly reduce unwanted statistics.

Related work
In 1990, William Bakst [5] of the University of California, San Diego used a neural networka multilayer perceptron -to recognize myocardial infarction. In addition, Bakst used only 20 parameters, among which were age, gender, localization of pain, reaction to nitroglycerin, nausea, and vomiting, sweating, fainting, respiratory rate, heart palpitations, previous heart attacks, diabetes, hypertension, distention of the cervical vein, some ECG features and the presence of significant ischemic changes. The network demonstrated 92% accuracy in detecting myocardial infarction and gave only 4% of false alarms, falsely confirming the referral of non-infarcted patients to the cardiology department.
An ideal diagnostic method should have one hundred percent sensitivity and specificity -firstly, do not miss a single sick person and, secondly, do not frighten healthy people. To be insured, you can and should try, first of all, to ensure one hundred percent sensitivity of the method -you must not miss the disease. But this usually results in a low specificity of the technique.  [6,7]. Their use is advantageous in the following cases: 1. Due to specific features, the problem under consideration does not lend itself to adequate formalization since it contains elements of uncertainty that are not formalized by traditional mathematical methods. 2. When the problem under consideration is formalized, but there is currently no apparatus for its solution. 3. When for the considered, well-formalized problem, there is a corresponding mathematical apparatus, but the implementation of computations with its help based on existing computing systems does not satisfy the requirements for obtaining solutions in time, size, weight, energy consumption, etc., in such a situation it is necessary to either produce simplification of algorithms, which reduces the quality of solutions, or apply an appropriate neural network approach, provided that it provides the required rate of the task.

Research methods
As the conclusion to work [7] mentioned, the authors attempted to reproduce its results using the Python language and the Keras library. Keras functions can work in TensorFlow, CNTK, or Teano environments. Keras was developed with an emphasis on the ability to experiment quickly. Going from idea to result with the lowest possible latency is key to effectively conducting neural network research.
The intensive development of neurocomputer science has led to the emergence of many network architectures that have minimal differences in their structure but at the same time have different spectra of applicability and computational capabilities. The impossibility of a neural network solution to this problem or obtaining less accurate results than when using the conventional mathematical apparatus often indicates an incorrect choice of a neural network model. The neural network approach in solving some mathematical problems of medical diagnostics can significantly simplify the solution process. It allows you to avoid cumbersome mathematical transformations associated with the search for patterns between input and output data, often complicated by the need to recover laws and probabilities distribution functions.
The initial dataset was formed based on the database [8]. Then, a neural network was used to predict diagnoses, consisting of layers Dense, BatchNormalization and DropOut (see figure 1, 2). The study used the following accuracy metrics based on the Confusion Matrix: overall prediction accuracy, precision, recall.

Database augmentation and balancing
A data augmentation procedure [9] was applied to overcome the lack of data in some experiments. The data augmentation procedure was applied to solve the small number of each diagnosis in the database, figure 4. At the same time, it was evident that you should not use the extended sample directly because it will contain a significant number of examples that coincide with the test sample. The procedure for solving this problem is shown in figure 5. The Python code that implements this process is shown in figure 6.     Table 2 shows the diagnostic quality metrics for the respective experiments. In addition, the plan of experiments for selecting the optimal architecture is included in the comparative assessment of the combinations of the studied architectures and the sets of training and test samples shown in table 2.

Discussion and conclusions
As can be seen in table 1, the accuracy of solving the problem riches 84%. The data augmentation procedure provided a significant (almost one and a half times). The use of the auxiliary layers increased both accuracy and precision by nearly 6-7%. The overall improvement in the forecast as a result of the entire set of activities is 19%. Improving the sensitivity metrics can be realized by enhancing the dataset and using more flexible augmentation methods.