Next Article in Journal
Exploring Bio-Impedance Sensing for Intelligent Wearable Devices
Next Article in Special Issue
Graph Representation Learning for the Prediction of Medication Usage in the UK Biobank Based on Pharmacogenetic Variants
Previous Article in Journal
Cardiac Tissue Engineering for Translational Cardiology: From In Vitro Models to Regenerative Therapies
Previous Article in Special Issue
Utility of Clustering in Mortality Risk Stratification in Pulmonary Hypertension
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Multitask Deep Learning Model for Predicting Myocardial Infarction Complications

1
Department of Computer Engineering, Gachon University, Sujeong-gu, Seongnam-si 13120, Republic of Korea
2
Digital Technologies and Artificial Intelligence Development Research Institute, 17A, Buz-2, Tashkent 100125, Uzbekistan
*
Author to whom correspondence should be addressed.
Bioengineering 2025, 12(5), 520; https://doi.org/10.3390/bioengineering12050520
Submission received: 1 April 2025 / Revised: 24 April 2025 / Accepted: 1 May 2025 / Published: 14 May 2025

Abstract

Myocardial infarction is one of the most severe forms of ischemic heart disease, associated with high mortality and disability worldwide. The accurate and reliable prediction of adverse cardiovascular events is critical for developing effective treatment strategies and improving outcomes in cardiac rehabilitation. Traditional prognostic models, such as the GRACE and TIMI scores, often lack the flexibility to incorporate a wide range of contemporary clinical predictors. Therefore, machine learning methods, particularly deep neural networks, have recently emerged as promising alternatives capable of enhancing predictive accuracy and enabling more personalized care. This study presents a multitask deep learning model designed to simultaneously address two related tasks: multidimensional binary classification of myocardial infarction complications and multiclass classification of mortality causes. The model was trained on a dataset of 1700 patients, encompassing 111 clinical and demographic features. Experimental results demonstrate high predictive accuracy and the model’s capacity to capture complex interactions among risk factors, suggesting its potential as a valuable tool for clinical decision support in cardiology. Comparative analysis confirms that the proposed multitask approach performs comparably to, or better than, conventional machine learning models. Future research will focus on refining the model and validating its generalizability in real-world clinical environments.

1. Introduction

Myocardial infarction (MI) is one of the most severe forms of ischemic heart disease, characterized by high patient mortality and a significant incidence of disability [1,2]. Although recent advances in diagnostics and treatment have reduced the overall fatality rate, predicting complications and mortality in individuals who have experienced MI remains a critical task in clinical practice. To address this need, the medical community—particularly cardiologists—develops and routinely uses specialized calculators or risk scales such as GRACE, ACTION, TIMI, HEART, CRUSADE, and EuroSCORE. These tools estimate the likelihood of various complications, adverse cardiac events, and patient mortality.
Researchers typically design cardiac scales by analyzing extensive clinical data. Key risk factors are identified through statistical methods, and weights are assigned to reflect their influence on the probability of specific outcomes. Traditional scales are often praised for their simplicity, interpretability, and wide acceptance in the medical community. An example is the GRACE scale, which is frequently used to assess in-hospital mortality risk in patients with acute coronary syndrome [3,4,5]. Despite these benefits, linear or simple logistic models underpinning such scales can limit flexibility and accuracy. Each scale captures a fixed set of attributes and may fail to adapt to new data.
Growing interest in machine learning (ML), especially deep neural networks, has emerged in part because these techniques can capture interactions among clinical features. ML refers to a broad class of data-driven algorithms, such as decision trees, support vector machines, and ensemble methods, which typically rely on manually selected features. In contrast, deep learning (DL) is a subfield of ML that uses multilayer neural networks capable of automatically learning complex hierarchical patterns from raw input data. This enables DL models to capture complex, non-linear interactions among clinical factors more effectively, making them particularly suitable for high-dimensional and heterogeneous medical datasets.
Modern DL approaches already play an active role in clinical research [6,7] and cardiology practice [8,9,10,11,12], and the number of related scientific publications continues to increase. One notable study [13] introduced the CSDNN model to predict mortality in patients with MI and hypertension [14]. This deep neural network addressed data imbalance in situations where mortality cases were comparatively rare. It showed improved predictive accuracy using data from the South Korean MI registry, particularly in identifying high-risk patients by shifting the decision threshold. Also, the same CSDNN network was able to predict various complications from MI, such as cardiogenic shock, pulmonary edema, and congestive heart failure, which allowed for quicker medical responses. Scientists from Taiwan [15] introduced a new deep learning model called ECG-MACE that can predict major heart problems within a year using regular ECGs, based on data from the Chang Gung Memorial Hospital.
Another investigation [16] compared an FT-Transformer architecture with a multilayer perceptron using the same South Korean MI registry. The FT-Transformer achieved higher sensitivity in mortality prediction. This study also emphasized interpretability through the SHAP method, increasing trust in neural networks for clinical applications. By modeling different scenarios based on medical records, physicians could better understand critical survival factors such as age and medication use [17].
Several publications focus on multitasking approaches that simultaneously predict complications and causes of death, thereby improving overall prognostic accuracy. An example is the use of neural networks to identify potential complications in patients after MI [18]. Other researchers [19] suggested a deep learning algorithm that can predict cardiac arrest in patients who have had a myocardial infarction while they are in the hospital, showing it is very accurate for early detection. Another study [20,21,22] used deep learning to predict long-term death rates in patients with suspected coronary artery disease, revealing that ML methods can outperform traditional statistical models.
A team [23] further developed a predictive system for myocardial infarction risk using a large clinical dataset. Their result indicated that advanced models, including boosting classifiers and convolutional neural networks (CNNs), surpassed classical decision trees (DT) and random forests (RF) by achieving high accuracy in identifying patients at risk of heart attack across different scenarios and metrics. Another group [24] aimed to develop and test a clinical risk model for in-hospital mortality in acute myocardial infarction (AMI), using the Registry-GWTG database (243,440 patients, 655 hospitals). With an in-hospital mortality rate of 4.6%, predictors such as age, heart rate, systolic blood pressure, cardiogenic shock, and troponin were especially important. Mortality varied significantly, from 0.4% in the lowest-risk group to 49.5% in the highest. Based on these experiments, the authors concluded that their model offers a valid tool for risk adjustment and stratification in AMI care. In [25], scientists suggest using a deep learning (DL) method to effectively detect myocardial infarction (MI) in two situations: one with balanced data and one without. We used an MI dataset containing 1700 medical records of MI patients.
South Korean researchers then introduced a new DAMI mortality risk stratification model [26,27] using deep learning. The DAMI model predicted both in-hospital and 12-month mortality in MI patients more accurately than existing risk assessments and other ML methods, assisting in refining rehabilitation strategies and guiding treatment decisions. Its training data included 22,875 MI patients from the KorMI registry, incorporating a broad array of demographic and laboratory variables. Validation results showed its effectiveness compared to GRACE, ACTION, and TIMI scales.
These scientific publications, along with many other studies, highlight the promise of neural networks in cardiology. Highly accurate and interpretable models for MI-related predictions enable the incorporation of multiple clinical factors, improving risk stratification and leading to more informed clinical decisions and a higher quality of care [28,29,30,31,32,33]. Nonetheless, most neural networks developed to date focus on solving individual classification or regression problems. Neural networks are typically designed with a single output layer, as they are intended to address a single specific task. In classification problems, the output layer maps the input to one of the predefined classes, whereas in regression tasks, it generates a continuous numerical prediction.
Multitask learning (MTL) architectures require more elaborate design choices, including carefully balanced loss functions and access to large, well-structured datasets. In medical applications—where class imbalance and data sparsity are common—implementing and validating MTL models is particularly challenging. As a result, the majority of published studies rely on single-task neural networks.
In more complex scenarios involving multiple outcomes or the need for insight into disease progression, researchers sometimes apply cascades or ensembles of separate neural networks. While this approach can be effective, decomposing the original problem into independent subtasks may lead to redundancy and loss of shared information. This is because breaking the original problem into separate sub-tasks usually means creating and managing several different models, which makes the process more complicated and requires more resources [15]. Moreover, this strategy can lead to redundant feature processing and prevents the models from capturing potentially important shared patterns or dependencies across tasks. Multitask learning mitigates these issues by enabling joint modeling of related outcomes within a unified architecture. Multitask deep learning offers a compelling alternative, allowing multiple related tasks to be solved jointly, potentially leveraging shared dependencies within the data. Despite its advantages, this approach remains relatively underexplored in the current literature.
Given these considerations, the present study aims to develop a multitask deep learning model designed to handle two closely related tasks: multidimensional binary classification of MI complications and multiclass classification of MI mortality causes.
We organize the rest of the paper as follows: Section 2 describes the dataset, model architecture, and methods used for training and evaluation. Section 3 presents the experimental results and model performance metrics. Section 4 discusses the implications of the findings, including comparisons with existing approaches and clinical relevance. Finally, Section 5 summarizes the conclusions and outlines direction for future research.

2. Materials and Methods

2.1. Data Description

The database of MI patients used in this study was compiled at the Krasnoyarsk Interdistrict Clinical Hospital No. 20, named after I.S. Berzon (Russia), between 1992 and 1995 [34]. Its creators originally designed it to evaluate various recognition and prediction systems.
This dataset contains comprehensive medical information on 1700 MI patients, including clinical data at admission, demographic characteristics, medical histories, laboratory and instrumental diagnostic results, therapeutic details, and more. In total, there are 111 independent variables (predictors) plus two sets of target variables. The first set covers potential MI complications—such as atrial fibrillation, supraventricular tachycardia, pulmonary edema, myocardial rupture, and other issues—which amount to 11 binary target variables. The second set looks at the reasons for deadly outcomes, like cardiogenic shock, pulmonary edema, myocardial rupture, asystole, and others, combined into one category.
Of the 1700 patients, 232 died in the intensive care unit due to various complications. Like many real-world datasets, this one can contain inconsistencies and exhibits significant class imbalance, necessitating preprocessing before building predictive models. According to the dataset’s creators [35], all 111 predictors (columns 2–112) are generally applicable for prediction. Moreover, four different time points can be used for making predictions, based on the available information:
  • At hospital admission (all columns except 93–95, 100–105);
  • At 24 h after admission (all columns except 94, 95, 101, 102, 104, 105);
  • At 48 h after admission (all columns except 95, 102, 105);
  • At 72 h after admission (all columns 2–112).
For this study, all available predictors were incorporated to train the neural network for both multivariate binary classification of complications and multiclass classification of mortality causes.

2.2. Multitask Neural Network Model Architecture

Let us describe the model architecture (Figure 1).
Let X n × m be the feature matrix, where n is the number of patients, m is the number of features. Each patient is represented by a vector of features x i m , i = 1 , 2 , , n .
The neural network consists of L hidden layers with the parameters W l , b l ,   l = 1 , 2 , , L . The number of hidden layers and the dimensionality of each layer d l , are hyperparameters of the model, i.e., can be selected during the tuning process.
In our case, key hyperparameters and training settings of the multitask neural network are presented in Table 1.
The proposed multitask neural network was implemented using Python (version 3.12) and TensorFlow/Keras frameworks.

2.3. Forward Pass and Activation Functions

For each hidden layer l , an output value is computed:
h l = g l W l h l 1 + b l ,
where W l d l × d l 1 is the weight matrix of layer l ; b l d l is the bias vector of layer l ; g l is the activation function for layer l .
The first input h 0 = x i is initialized with random values, according to the He initialization method
W i j l N 0 , 2 d l 1 ,
and the bias vector is initialized with zeros b j l = 0 .
First, the affine transformation
z l = W l h l 1 + b l
is applied, and then the batch normalization for each j -th neuron as well:
μ j l = 1 B i = 1 B z i j l ,   σ j l 2 = 1 B i = 1 B z i j l μ j l 2 ,
In our case, the batch size is B = 64 .
Next, the activations are normalized
z ^ i j l = z i j l μ j l σ j l 2 + ε ,
where ε is a small number to ensure stability, usually ε = 10 5 .
Then, the scaling and shifting parameters are applied:
z ˜ i j l = γ j l z ^ i j l + β j l ,
which are initialized as γ j l = 1 and β j l = 0 .
The choice of activation function depends on the specific layer and is part of the model tuning. It is known that when using only conventional activation functions like ReLU, the problem of “vanishing gradient” may arise during the training of multilayer networks, where error derivatives with respect to weights become very small as they propagate backwards through the layers. This leads to weights in the initial layers of the network being updated extremely slowly or not changing at all, which slows down or even stops the training of the entire network.
To improve learning and avoid the above problem, but without excessively increasing the computational cost, different activation functions are used here.
Parametric ReLU or PreLU for the first hidden layer ( l = 1 )
h i j 1 = z ˜ i j 1 , z ˜ i j 1 0 ; α j 1 z ˜ i j 1 , z ˜ i j 1 < 0 ,
where α j 1 is trainable parameter for each neuron in the layer, initialized by small positive value, for example α j 1 = 0.25 .
The ReLU for the second layer ( l = 2 )
h i j 2 = z ˜ i j 2 , z ˜ i j 2 > 0 ; 0 , z ˜ i j 2 0 .
And the Leaky ReLU for the third layer ( l = 3 ),
h i j 3 = z ˜ i j 3 , z ˜ i j 3 0 ; α z ˜ i j 3 , z ˜ i j 3 < 0 ,
where α 1 is an immutable parameter with a specified value, e.g., α = 0.01 .
In order to prevent overfitting, the dropout method is applied to the first two hidden layers l = 1 and l = 2 with a neuron dropout probability p 0 l . For each of these two layers, a binary masking vector r l d l is created, where each element r j l is an independent random variable for each neuron, taking values as follows:
r j l = 1 , with   probability   p 1 l ; 0 , with   probability   p 0 l ,
where the probabilities p 1 l = 0.6 and p 0 l = 0.4 were selected experimentally.
Then, the obtained mask is applied to the activations
h i j l = r j l p 1 l h i j l .
Here, division by p 1 l is necessary to preserve the mathematical expectation of activations.
According to the problem statement, the proposed model contains two output layers. The first output layer is for multivariate binary classification of k = 11 MI complications. Here, the sigmoid activation function was used:
y ^ i j o 1 = σ s = 1 d L W j s o 1 h i s L + b j o 1 , j = 1 , 2 , , k .
The second output layer for the multiclass classification of C = 8 causes of lethal outcomes. At this layer, the softmax activation is used:
y ^ i j o 2 = exp s = 1 d L W j s o 2 h i s L + b j o 2 c = 1 C exp s = 1 d L W c s o 2 h i s L + b c o 2 , j = 1 , 2 , , C .

2.4. Backpropagation, Class Imbalance and Loss Functions

Before describing backpropagation step, it is important to highlight a key point. Class imbalance is often present in medical data. The dataset of patients with MI which was used for training is no exception. To eliminate the class imbalance, we perform oversampling of minority classes up to 50% of the number in the majority class. Also, in order to avoid overfitting, the L2-regularization is applied here along with the dropout to ensure that the model adequately handle new data.
The loss function of the first classifier is evaluated using the binary cross-entropy
L 1 = 1 n × k i = 1 n j = 1 k y i j o 1 ln y ^ i j o 1 + 1 y i j o 1 ln 1 y ^ i j o 1 ,
where y i j o 1 0 , 1 is the true value of the presence or absence of j -th complication for the i -th patient; y ^ i j o 1 is the predicted probability of j -th complication for the i -th patient.
The categorical cross-entropy is used as the loss function for the second classifier, which predicts the causes of fatal outcomes:
L 2 = 1 n i = 1 n j = 1 C y i j o 2 ln y ^ i j o 2 ,
where y i j o 2 0 , 1 is the true class label, y i j o 2 = 1 if the i -th patient belongs to j -th class, otherwise y i j o 2 = 0 ; y ^ i j o 2 is the predicted probability of that i -th patient belongs to j -th class.
The overall loss function is the sum these two loss functions, taking into account the regularization:
L = α L 1 + β L 2 + R ,
where α = 3.0 и β = 1.0 are the hyperparameters determining the contribution of each task, whose values were selected experimentally; R is the regularization term
R = λ 2 l = 1 L W l F 2 + W o 1 F 2 + W o 2 F 2 ,
where λ = 0.001 is the regularization factor; F is the Frobenius norm.
The gradients of the loss function L over all model parameters are calculated during backpropagation.
For MI complications, first the output error is calculated
δ i j o 1 = y ^ i j o 1 y i j o 1 .
Then, the gradients with respect to the parameters are calculated
L W j s o 1 = α B i = 1 B δ i j o 1 h i s L + λ W j s o 1 ; L b j o 1 = α B i = 1 B δ i j o 1 .
Similar calculations are performed for mortality
δ i j o 2 = y ^ i j o 2 y i j o 2 ; L W j s o 2 = β B i = 1 B δ i j o 2 h i s L + λ W j s o 2 ; L b j o 2 = β B i = 1 B δ i j o 2 .
Next, the gradients of the hidden layers are computed. For the hidden layers l = L , L 1 , , 1 starting from L = 3 , the total error is calculated as:
δ i j L = s = 1 k δ i s o 1 W s j o 1 + c = 1 C δ i c o 2 W c j o 2 g z ˜ i j L ,
where s is the summation index over the complication classes from 1 to k ; c is the summation index over the mortality classes from 1 to C ; g z ˜ i j L is the derivative of Leaky ReLU for the third hidden layer
g z ˜ i j L = 1 , if   z ˜ i j L 0 ; α , if   z ˜ i j L < 0 .
Next, the gradients with respect to the parameters are calculated
L W j s L = i = 1 B δ i j L h i s L 1 + λ W j s L ; L b j L = i = 1 B δ i j L .
The process is repeated for the second l = 2 and first l = 1 hidden layers, taking into account the neurons dropout δ i j l = δ i j l r j l / p 1 l and batch normalization, where gradients have the following form:
L γ j l = i = 1 B δ i j l z ˜ i j l ; L β j l = i = 1 B δ i j l .
It should be noted that the complete formulation of backpropagation through Batch Normalization is not given here, as it is quite complex and involves multiple steps. It was omitted because the implementation utilized built-in algorithms from Keras and TensorFlow libraries.
Also, the parameters of the PReLU are taken into account:
L α j l = i = 1 B δ i j l z ^ i j l I z ^ i j l < 0 ,
where I is the indicator function.

2.5. Parameter Updates with Adam Optimizer

For adaptive parameter updating, Adam optimizer [36] is used. According to the algorithm, the moment update expressions are
m θ = β 1 m θ + ( 1 β 1 ) L θ ; v θ = β 2 v θ + ( 1 β 2 ) L θ 2 ,
where θ is any model parameter (weights, biases, normalization parameters, activation function parameters, etc.); β 1 and β 2 are the exponential decay coefficients of the moments with predefined values β 1 = 0.9 и β 2 = 0.999 . The initialization of moments m 0 = 0 and v 0 = 0 .
Bias correction is performed as follows:
m ^ θ = m θ 1 β 1 t ; v ^ θ = v θ 1 β 2 t ,
and parameter updating as:
θ t + 1 = θ t η m ^ θ v ^ θ + ϵ ,
where t is the current iteration number; η = 0.0005 is the learning rate; ϵ is a small number to prevent division by zero, usually set to 1 × 10 8 .
The stopping criteria for the iterative process are the conditions for reaching the maximum number of epochs; the absence of improvements on the validation set over a specified number of epochs (early stopping); and achieving the required value of the loss function or quality metric.

3. Results

Model Performance Evaluation
Figure 2, Figure 3, Figure 4 and Figure 5 present the results of the model performance evaluation. The provided metric graphs help us see how well the model does in identifying MI complications and the different causes of mortality.
The curves in Figure 2 illustrate the changes in loss for complication and mortality classes over epochs for the training (train) and validation (val) datasets. As observed, there is a sharp decrease in loss during the first few epochs, followed by stabilization at a low level. This indicates that the model learns efficiently in the early stages and gradually approaches convergence by epoch 25.
Additionally, the loss curve for mortality causes decreases more rapidly and stabilizes at a lower level compared to complications, suggesting better convergence of the model for mortality prediction.
Figure 3 illustrates the changes in accuracy over epochs for complication and mortality classes, similar to Figure 2, for both the training (train) and validation (val) datasets. As seen in Figure 3, accuracy increases rapidly during the initial epochs and then remains consistently high, reaching approximately 0.9. This trend indicates effective model learning and its ability to maintain high accuracy throughout training.
However, as observed in Figure 2 and Figure 3, as well as in Table 1, which presents the metric values, the curves plateau around epoch 34. At this point, validation performance starts to deteriorate significantly, indicating the onset of overfitting.
Overall, the results in Figure 2 and Figure 3, as well as Table 2, indicate successful model training with satisfactory convergence for both prediction tasks and most classes—77% for complications and 86% for mortality.
Figure 4 shows that the area under the curve (AUC) values vary across different classes, ranging from 0.68 to 0.92. This indicates that the model performs well or satisfactorily in distinguishing most complication classes. However, its accuracy is noticeably lower for certain cases, such as “REC_IM” (myocardial infarction recurrence) with an AUC of 0.68.
The ROC curves presented in Figure 5 illustrate the AUC values for different mortality classes. Unlike Figure 4, these values are significantly higher, reaching a maximum of 0.97, which indicates better model performance in predicting mortality compared to complications. However, variations in accuracy between different mortality causes are still observed, similar to the case of MI complications.
Based on the analysis of the results (Figure 2, Figure 3, Figure 4 and Figure 5), it is evident that adding more training data and implementing additional class-balancing techniques could further improve model performance. Additionally, fine-tuning hyperparameters such as learning rate and regularization settings could enhance prediction quality.

4. Discussion

4.1. Comparison with Other ML Models

Since this dataset has been used in multiple studies by researchers from various countries, it is possible to compare the quality of the proposed model with machine learning algorithms developed in those studies.
For example, in study [37], the authors focused on predicting the risk of MI complications within the first few hours after patient hospitalization. Their interest stemmed from the fact that the initial hours of hospitalization are typically the most critical for patient survival. Notably, the authors of [29] did not utilize deep learning models but instead applied commonly used machine learning algorithms.
Table 3 presents the accuracy results of classifiers tested on this dataset. It is important to emphasize that the authors addressed only a single task—predicting complications.
The same study also provides separate results evaluating the performance of the XGBoost classifier combined with various synthetic data generation methods aimed at addressing class imbalance in the dataset. This includes a method developed by the authors themselves (Table 4).
Similar studies have been conducted by other researchers. For example, in study [38], a method for predicting patient mortality in MI cases was proposed based on the same dataset [35]. The authors used the Cox regression model to estimate mortality risk and identify key factors influencing patient survival. Reddy L. and Thangam S. [39] implemented several machine learning algorithms with different sampling methods to predict a specific complication—MI recurrence. Their findings indicated that the SVM classifier demonstrated the highest accuracy. A team of Indian researchers led by Joshi A. applied the mutual information technique to select the most informative features, identifying 20 key predictors [40]. Using the SVM classifier, they achieved an F1 score of 90.29%, focusing specifically on predicting adverse MI outcomes.
Table 5 presents the performance evaluation results of machine learning models developed by these authors, tested on the Krasnoyarsk Interdistrict Clinical Hospital dataset [35].
As seen in Table 2, the performance of the developed multitask neural network model is only slightly lower than that of commonly used machine learning algorithms. It is important to note that in the study by Newaz A. and other authors [37], the classifiers were applied to solve only a single prediction task.
The higher accuracy of the XGBoost algorithm (Table 3) was achieved primarily through aggressive data resampling techniques to mitigate class imbalance in complications. However, such approaches can reduce the model’s true predictive capability by artificially balancing the dataset rather than improving its generalization ability.
In our case, because of pronounced class imbalance (for certain complications and mortality causes), we used oversampling of minority classes up to 50% of the majority class size. Additionally, we experimented with SMOTE, ADASYN, and other sampling strategies, but the simpler oversampling approach performed well in combination with the multitask scheme. Weighted loss functions were also tested, but oversampling yielded satisfactory improvements in practice.
Based on a comparative analysis of the performance of complication and mortality prediction models (Table 4) developed by various authors, the proposed multitask neural network model demonstrates comparable effectiveness. In certain cases (Figure 2, Figure 3, Figure 4 and Figure 5), it even surpasses traditional methods in accuracy. Additionally, unlike other models, it can solve two tasks simultaneously without excessive data resampling, preserving the dataset’s natural distribution.

4.2. Clinical Interpretation and Feature Importance

Permutation importance analysis was conducted to quantify the impact of each clinical predictor on model performance. Shuffling key features such as age, systolic blood pressure, and left ventricular ejection fraction resulted in a 7–10% decrease in overall model accuracy, highlighting their substantial importance for prediction outcomes. Additional influential variables included blood glucose level and heart rate, each associated with a 3–5% reduction in accuracy when permuted. These findings are consistent with previous studies [28,29,37], where age and cardiac function indices were identified as major risk factors for adverse MI outcomes and mortality.
Moreover, our multitask model identified a broader set of clinically relevant variables compared to single-task models reported in earlier works. For example, Newaz et al. [37] and Kim et al. [16] also emphasized the predictive value of age and blood pressure but did not analyze the simultaneous effect of these features on both complications and mortality. By jointly modeling both tasks, our approach enables more comprehensive risk stratification and highlights the shared and unique contributions of clinical predictors across outcomes.
From a clinical standpoint, it is also important to investigate whether certain complications share correlated predictors. For instance, in some patients, a risk factor for pulmonary edema may also be relevant for cardiogenic shock. A multitask model can leverage such shared information, potentially explaining why it outperforms single-task classifiers that handle each outcome independently.
Although permutation importance provides useful insights, further analysis using more advanced interpretability methods, such as SHAP, may help clarify complex interactions among predictors. This is planned for future work.

5. Conclusions

This study yields the following key conclusions.
From a theoretical perspective, the contribution of this research lies in the development and implementation of a multitask neural network architecture tailored for the simultaneous prediction of multiple clinical outcomes, as well as the integration of permutation-based feature importance analysis to enhance model interpretability. The approach leverages a combination of advanced activation functions (PReLU, ReLU, LeakyReLU) to optimize learning and incorporates oversampling strategies to address class imbalance, ensuring robust model performance. Our analysis demonstrates that the proposed model achieves performance comparable to, and in some cases surpasses, traditional machine learning methods commonly used for similar tasks. Notably, the model effectively handles class imbalance—a common challenge in medical datasets collected in real-world clinical practice.
From a practical perspective, the model provides a robust and versatile tool for individualized risk stratification in MI patients, supporting more informed clinical decision-making. The model is already integrated into a telemedicine system for remote monitoring and management of cardiac rehabilitation https://recardio.uz (accessed on 17 February 2025). It serves as a supplementary tool for predicting adverse cardiovascular events and assessing patient severity, thereby assisting clinicians in selecting individualized rehabilitation programs, including recommendations for physical activity and pharmacological management for MI patients. Its ability to process heterogeneous clinical and demographic data, as well as to simultaneously predict multiple outcomes, highlights its potential for integration into real-world decision support systems in cardiology.
Overall, the results of this study confirm the promising potential of deep learning models in cardiology, particularly for predicting complication risks and mortality in MI patients, thereby supporting more accurate and personalized clinical decision-making.
Future work will focus on employing deeper interpretability methods, such as SHAP or LIME, and on evaluating the model’s generalizability and stability across different populations [41,42]. The promising results indicate that multitask neural networks can serve as an effective alternative to single-task or multi-model approaches for predicting MI complications and mortality.

Author Contributions

Conceptualization, F.M.; Methodology, N.R.; Software, D.T.; Validation, N.R.; Formal analysis, F.M.; Investigation, O.P.; Resources, O.P.; Data curation, D.A.; Writing—original draft, D.A.; Visualization, D.T.; Supervision, Y.-I.C.; Funding acquisition, Y.-I.C. All authors have read and agreed to the published version of the manuscript.

Funding

This paper is supported by the Korean Agency for Technology and Standard under the Ministry of Trade, Industry and Energy in 2024, project number is 20022362 (2410003714, Establishment of standardization basis for BCI and AI Interoperability).

Institutional Review Board Statement

Ethical review and approval were waived for this study due to the use of retrospective, anonymized clinical data from archived medical records. The study did not involve any direct patient interaction, intervention, or collection of identifiable personal information.

Informed Consent Statement

Patient consent was waived due to the use of fully anonymized medical records. No personally identifiable information was collected or published.

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. World Health Statistics 2024: Monitoring health for the SDGs, Sustainable Development Goals; World Health Organization: Geneva, Switzerland, 2024; pp. 12–14.
  2. Bokenberger, K.; Rahman, S.; Wang, M.; Vaez, M.; Dorner, T.E.; Helgesson, M.; Ivert, T.; Mittendorfer-Rutz, E. Work disability patterns before and after incident acute myocardial infarction and subsequent risk of common mental disorders: A Swedish cohort study. Sci. Rep. 2019, 9, 16086. [Google Scholar] [CrossRef] [PubMed]
  3. Bauer, D.; Toušek, P. Risk Stratification of Patients with Acute Coronary Syndrome. J. Clin. Med. 2021, 10, 4574. [Google Scholar] [CrossRef] [PubMed]
  4. Gupta, A.K.; Mustafiz, C.; Mutahar, D.; Zaka, A.; Parvez, R.; Mridha, N.; Stretton, B.; Kovoor, J.G.; Bacchi, S.; Ramponi, F.; et al. Machine Learning vs Traditional Approaches to Predict All-Cause Mortality for Acute Coronary Syndrome: A Systematic Review and Meta-analysis. Can. J. Cardiol. 2025. [Google Scholar] [CrossRef] [PubMed]
  5. Schlesinger, D.E.; Stultz, C.M. Deep Learning for Cardiovascular Risk Stratification. Curr. Treat. Options Cardiovasc. Med. 2020, 22, 15. [Google Scholar] [CrossRef]
  6. Salas-Nuñez, L.F.; Barrera-Ocampo, A.; Caicedo, P.A.; Cortes, N.; Osorio, E.H.; Villegas-Torres, M.F.; González Barrios, A.F. Machine Learning to Predict Enzyme–Substrate Interactions in Elucidation of Synthesis Pathways: A Review. Metabolites 2024, 14, 154. [Google Scholar] [CrossRef]
  7. Huang, J.; Huth, C.; Covic, M.; Troll, M.; Adam, J.; Zukunft, S.; Prehn, C.; Wang, L.; Nano, J.; Scheerer, M.F.; et al. Machine Learning Approaches Reveal Metabolic Signatures of Incident Chronic Kidney Disease in Individuals with Prediabetes and Type 2 Diabetes. Diabetes 2020, 69, 2756–2765. [Google Scholar] [CrossRef]
  8. Muntasir Nishat, M.; Faisal, F.; Jahan Ratul, I.; Al-Monsur, A.; Ar-Rafi, A.M.; Nasrullah, S.M.; Reza, M.T.; Khan, M.R.H. A comprehensive investigation of the performances of different machine learning classifiers with SMOTE-ENN oversampling technique and hyperparameter optimization for imbalanced heart failure dataset. Sci. Program. 2022, 2022, 3649406. [Google Scholar] [CrossRef]
  9. Fedai, H.; Sariisik, G.; Toprak, K.; Taşcanov, M.B.; Efe, M.M.; Arğa, Y.; Doğanoğulları, S.; Gez, S.; Demirbağ, R. A Machine Learning Model for the Prediction of No-Reflow Phenomenon in Acute Myocardial Infarction Using the CALLY Index. Diagnostics 2024, 14, 2813. [Google Scholar] [CrossRef]
  10. Ibrahim, L.; Mesinovic, M.; Yang, K.W.; Eid, M.A. Explainable prediction of acute myocardial infarction using machine learning and Shapley Values. IEEE Access 2020, 8, 210410–210417. [Google Scholar] [CrossRef]
  11. Choi, A.; Kim, M.J.; Sung, J.M.; Kim, S.; Lee, J.; Hyun, H.; Kim, H.C.; Kim, J.H.; Chang, H.-J., on behalf of the Connected Network for EMS Comprehensive Technical Support Using Artificial Intelligence Investigators. Development of Prediction Models for Acute Myocardial Infarction at Prehospital Stage with Machine Learning Based on a Nationwide Database. J. Cardiovasc. Dev. Dis. 2022, 9, 430. [Google Scholar] [CrossRef]
  12. Hasbullah, S.; Mohd Zahid, M.S.; Mandala, S. Detection of Myocardial Infarction Using Hybrid Models of Convolutional Neural Network and Recurrent Neural Network. BioMedInformatics 2023, 3, 478–492. [Google Scholar] [CrossRef]
  13. Zheng, H.; Sherazi, S.W.A.; Lee, J.Y. A cost-sensitive deep neural network-based prediction model for the mortality in acute myocardial infarction patients with hypertension on imbalanced data. Front. Cardiovasc. Med. 2024, 11, 1276608. [Google Scholar] [CrossRef] [PubMed]
  14. Lee, S.-J.; Lee, S.-H.; Choi, H.-I.; Lee, J.-Y.; Jeong, Y.-W.; Kang, D.-R.; Sung, K.-C. Deep learning improves prediction of cardiovascular disease-related mortality and admission in patients with hypertension: Analysis of the Korean national health information database. J. Clin. Med. 2022, 11, 6677. [Google Scholar] [CrossRef] [PubMed]
  15. Lin, C.H.; Liu, Z.Y.; Chu, P.H.; Chen, J.S.; Wu, H.H.; Wen, M.S.; Kuo, C.F.; Chang, T.Y. A multitask deep learning model utilizing electrocardiograms for major cardiovascular adverse events prediction. NPJ Digit. Med. 2025, 8, 1. [Google Scholar] [CrossRef]
  16. Kim, M.; Kang, D.; Kim, M.S.; Choe, J.C.; Lee, S.-H.; Ahn, J.H.; Oh, J.-H.; Choi, J.H.; Lee, H.C.; Cha, K.S.; et al. Acute myocardial infarction prognosis prediction with reliable and interpretable artificial intelligence system. J. Am. Med. Inform. Assoc. 2024, 31, 1540–1550. [Google Scholar] [CrossRef]
  17. Wang, Q.; Zhao, C.; Qiang, Y.; Zhao, Z.; Song, K.; Luo, S. Multitask Interactive Attention Learning Model Based on Hand Images for Assisting Chinese Medicine in Predicting Myocardial Infarction. Comput. Math. Methods Med. 2021, 2021, 6046184. [Google Scholar] [CrossRef]
  18. Zheng, H.; Sherazi, S.W.A.; Lee, J.Y. A stacking ensemble prediction model for the occurrences of major adverse cardiovascular events in patients with acute coronary syndrome on imbalanced data. IEEE Access 2021, 9, 113692–113704. [Google Scholar] [CrossRef]
  19. Kwon, J.M. An algorithm based on deep learning for predicting in-hospital cardiac arrest. J. Am. Heart Assoc. 2018, 7, e008678. [Google Scholar] [CrossRef]
  20. Motwani, M.; Dey, D.; Berman, D.S.; Germano, G.; Achenbach, S.; Al-Mallah, M.H.; Andreini, D.; Budoff, M.J.; Cademartiri, F.; Callister, T.Q.; et al. Machine learning for prediction of all-cause mortality in patients with suspected coronary artery disease: A 5-year multicentre prospective registry analysis. Eur. Heart J. 2017, 38, 500–507. [Google Scholar] [CrossRef]
  21. Li, W.; Zuo, M.; Zhao, H.; Xu, Q.; Chen, D. Prediction of coronary heart disease based on combined reinforcement multitask progressive time-series networks. Methods 2022, 198, 96–106. [Google Scholar] [CrossRef]
  22. Yavru, İ.B.; Yılmaz Gündüz, S. Predicting Myocardial Infarction Complications and Outcomes with Deep Learning. Eskişehir Tech. Univ. J. Sci. Technol. A-Appl. Sci. Eng. 2022, 23, 184–194. [Google Scholar] [CrossRef]
  23. Boudali, I.; Chebaane, S.; Zitouni, Y. A predictive approach for myocardial infarction risk assessment using machine learning and big clinical data. Healthc. Anal. 2024, 5, 100319. [Google Scholar] [CrossRef]
  24. McNamara, R.L.; Kennedy, K.F.; Cohen, D.J.; Diercks, D.B.; Moscucci, M.; Ramee, S.; Wang, T.Y.; Connolly, T.; Spertus, J.A. Predicting in-hospital mortality in patients with acute myocardial infarction. J. Am. Coll. Cardiol. 2018, 68, 626–635. [Google Scholar] [CrossRef] [PubMed]
  25. Abbas, S.; Ojo, S.; Krichen, M.; Alamro, M.A.; Mihoub, A.; Vilcekova, L. A Novel Deep Learning Approach for Myocardial Infarction Detection and Multi-Label Classification. IEEE Access 2024, 12, 76003–76021. [Google Scholar] [CrossRef]
  26. Kwon, J.; Jeon, K.-H.; Kim, H.M.; Kim, M.J.; Lim, S.; Kim, K.-H.; Song, P.S.; Park, J.; Choi, R.K.; Oh, B.-H. Deep-learning-based risk stratification for mortality of patients with acute myocardial infarction. PLoS ONE 2019, 14, e0224502. [Google Scholar] [CrossRef]
  27. Kim, Y.J.; Saqlian, M.; Lee, J.Y. Deep learning–based prediction model of occurrences of major adverse cardiac events during 1-year follow-up after hospital discharge in patients with AMI using knowledge mining. Pers. Ubiquit Comput. 2022, 26, 259–267. [Google Scholar] [CrossRef]
  28. Lu, J.; Bennamoun, M.; Stewart, J.; Eshraghian, J.; Liu, Y.; Chow, B.; Sanfilippo, F.M.; Dwivedi, G. Multitask Deep Learning for Accurate Risk Stratification and Prediction of Next Steps for Coronary CT Angiography Patients. arXiv 2023, arXiv:2309.00330. [Google Scholar]
  29. Ghafari, R.; Azar, A.S.; Ghafari, A.; Aghdam, F.M.; Valizadeh, M.; Khalili, N.; Hatamkhani, S. Prediction of the Fatal Acute Complications of Myocardial Infarction via Machine Learning Algorithms. J. Tehran Heart Cent. 2023, 18, 278–287. [Google Scholar] [CrossRef]
  30. Shickel, B.; Loftus, T.J.; Ruppert, M.; Upchurch, G.R.; Ozrazgat-Baslanti, T.; Rashidi, P.; Bihorac, A. Dynamic predictions of postoperative complications from explainable, uncertainty-aware, and multi-task deep neural networks. Sci. Rep. 2023, 13, 1224. [Google Scholar] [CrossRef]
  31. Mandair, D.; Tiwari, P.; Simon, S.; Colborn, K.L.; Rosenberg, M.A. Prediction of incident myocardial infarction using machine learning applied to harmonized electronic health record data. BMC Med. Inform. Decis. Mak. 2020, 20, 252. [Google Scholar] [CrossRef]
  32. de Carvalho, L.S.F.; Alexim, G.; Nogueira, A.C.C.; Fernandez, M.D.; Rezende, T.B.; Avila, S.; Reis, R.T.B.; Soares, A.A.M.; Sposito, A.C. The framing of time-dependent machine learning models improves risk estimation among young individuals with acute coronary syndromes. Sci. Rep. 2023, 13, 1021. [Google Scholar] [CrossRef] [PubMed]
  33. Boonstra, M.J.; Weissenbacher, D.; Moore, J.H.; Gonzalez-Hernandez, G.; Asselbergs, F.W. Artificial intelligence: Revolutionizing cardiology with large language models. Eur. Heart J. 2024, 45, 332–345. [Google Scholar] [CrossRef] [PubMed]
  34. Golovenkin, S.E.; Gorban, A.; Mirkes, E.; Shulman, V.A.; Rossiev, D.A.; Shesternya, P.A.; Nikulina, S.Y.; Orlova, Y.V.; Dorrer, M.G. Myocardial Infarction Complications Database: Dataset; University of Leicester: Leicester, UK, 2020. [Google Scholar] [CrossRef]
  35. Golovenkin, S.E.; Gorban, A.N.; Mirkes, E.M.; Shulman, V.A.; Rossiev, D.A.; Shesternya, P.A.; Nikulina, S.Y.; Orlova, Y.V.; Dorrer, M.G. Complications of Myocardial Infarction: A Database for Testing Recognition and Prediction Systems. 2020. Available online: https://figshare.le.ac.uk/ndownloader/files/22803572 (accessed on 18 February 2024).
  36. Kingma, D.P.; Ba, J. Adam: A method for stochastic optimization. arXiv 2017. [Google Scholar] [CrossRef]
  37. Newaz, A.; Mohosheu, S.; Noman, A. Predicting complications of myocardial infarction within several hours of hospitalization using data mining techniques. Inform. Med. Unlocked 2023, 42, 101361. [Google Scholar] [CrossRef]
  38. Farah, C.; Adla, Y.A.; Awad, M. Can machine learning predict mortality in myocardial infarction patients within several hours of hospitalization? A comparative analysis. In Proceedings of the IEEE 21st Mediterranean Electrotechnical Conference, Palermo, Italy, 14–16 June 2022; pp. 1135–1140. [Google Scholar] [CrossRef]
  39. Reddy, L.; Thangam, S. Predicting relapse of the myocardial infarction in hospitalized patients. In Proceedings of the 3rd International Conference for Emerging Technology, Belgaum, India, 27–29 May 2022; pp. 1–7. [Google Scholar] [CrossRef]
  40. Joshi, A.; Gunwant, H.; Sharma, M.; Chaudhary, V. Early prognosis of acute myocardial infarction using machine learning techniques. In Lecture Notes on Data Engineering and Communications Technologies; Springer: Singapore, 2022; Volume 91, pp. 815–829. [Google Scholar] [CrossRef]
  41. Tukhtaev, A.; Turimov, D.; Kim, J.; Kim, W. Feature Selection and Machine Learning Approaches for Detecting Sarcopenia Through Predictive Modeling. Mathematics 2025, 13, 98. [Google Scholar] [CrossRef]
  42. Turimov, D.; Kim, W. Enhancing Sarcopenia Prediction Through an Ensemble Learning Approach: Addressing Class Imbalance for Improved Clinical Diagnosis. Mathematics 2025, 13, 26. [Google Scholar] [CrossRef]
Figure 1. Architecture of the multitask neural network.
Figure 1. Architecture of the multitask neural network.
Bioengineering 12 00520 g001
Figure 2. Changes in loss for complication and mortality classes over epochs.
Figure 2. Changes in loss for complication and mortality classes over epochs.
Bioengineering 12 00520 g002
Figure 3. Changes in model accuracy for complication and mortality classes over epochs.
Figure 3. Changes in model accuracy for complication and mortality classes over epochs.
Bioengineering 12 00520 g003
Figure 4. ROC curves for complication classes.
Figure 4. ROC curves for complication classes.
Bioengineering 12 00520 g004
Figure 5. ROC curves for mortality classes.
Figure 5. ROC curves for mortality classes.
Bioengineering 12 00520 g005
Table 1. Key hyperparameters and training settings of the multitask neural network.
Table 1. Key hyperparameters and training settings of the multitask neural network.
ParameterValue/Description
Input features d 0 = m  = 111 clinical and demographic variables
Hidden layers3
Layer 1 d 1 = 512 , PReLU, L2 regularization ( λ = 0.001 ),
BatchNormalization, Dropout (rate = 0.4)
Layer 2 d 2 = 256 , ReLU, L2 regularization ( λ = 0.001 ),
BatchNormalization, Dropout (rate = 0.4)
Layer 3 d 3 = 128 , LeakyReLU ( α = 0.01 ),
L2 regularization ( λ = 0.001 )
Output layers2
Complications d 4 = 11 , binary classification, Sigmoid activation
Mortality causes d 5 = 8 , multiclass classification, Softmax activation
OptimizerAdam (learning rate = 0.0005)
Batch size64
Epochs E  = 50 (with early stopping, patience = 10)
Loss function (complications)Binary cross-entropy
Loss function (mortality)Sparse categorical cross-entropy
Loss weightsComplications: 3.0;
Mortality: 1.0
Class imbalance handlingRandom oversampling of minority classes up to 50% of the majority class (for complications)
Feature scalingStandardScaler (zero mean, unit variance)
Validation strategyTrain/test split: 80/20; 20% of training set used for validation during training
RegularizationL2 regularization ( λ = 0.001 );
Dropout (rate = 0.4 on first two hidden layers)
CallbacksEarlyStopping (patience = 10, restore best weights),
ReduceLROnPlateau (factor = 0.1, patience = 5)
Evaluation metricsBinary accuracy, AUC (for complications);
Categorical accuracy (for mortality causes)
Table 2. Metric values at epoch 34 for training and validation datasets.
Table 2. Metric values at epoch 34 for training and validation datasets.
MetricsTraining
Set
Validation
Set
Weighted and Averaged
Values over Epochs
LossComplications0.50800.70020.6626
Mortality0.08740.70330.4289
Overall loss1.15931.88731.7132
AccuracyComplications0.93470.92780.7799
Mortality0.97320.85290.8617
AUCComplications0.90870.78470.9286
Table 3. Accuracy of machine learning algorithms (%) for predicting MI complications at the time of hospital admission [37].
Table 3. Accuracy of machine learning algorithms (%) for predicting MI complications at the time of hospital admission [37].
KNNSVMLRNBRFXGBoostAdaBoost
85.972486.231786.490220.7591.143391.337090.1098
Table 4. Accuracy of the XGBoost classifier (%) combined with different class-balancing methods for MI complications [37].
Table 4. Accuracy of the XGBoost classifier (%) combined with different class-balancing methods for MI complications [37].
SMOTEADASYNRUSTomek-LinkENNWeighted XGBoostThis Model
91.143191.400981.901490.885090.431791.531191.9843
Table 5. Performance metrics of models developed by various authors [37].
Table 5. Performance metrics of models developed by various authors [37].
StudiesMetrics
Accuracy (%)Sensitivity (%)ROC-AUC (%)
Newaz A. [37]91.9865.0380.88
Farah C. [38]87.3325.0061.67
Reddy L. [39]84.8743.9868.04
Joshi A. [40]86.6215.0857.16
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Makhmudov, F.; Ravshanov, N.; Akhmedov, D.; Pekos, O.; Turimov, D.; Cho, Y.-I. A Multitask Deep Learning Model for Predicting Myocardial Infarction Complications. Bioengineering 2025, 12, 520. https://doi.org/10.3390/bioengineering12050520

AMA Style

Makhmudov F, Ravshanov N, Akhmedov D, Pekos O, Turimov D, Cho Y-I. A Multitask Deep Learning Model for Predicting Myocardial Infarction Complications. Bioengineering. 2025; 12(5):520. https://doi.org/10.3390/bioengineering12050520

Chicago/Turabian Style

Makhmudov, Fazliddin, Normakhmad Ravshanov, Dilshot Akhmedov, Oleg Pekos, Dilmurod Turimov, and Young-Im Cho. 2025. "A Multitask Deep Learning Model for Predicting Myocardial Infarction Complications" Bioengineering 12, no. 5: 520. https://doi.org/10.3390/bioengineering12050520

APA Style

Makhmudov, F., Ravshanov, N., Akhmedov, D., Pekos, O., Turimov, D., & Cho, Y.-I. (2025). A Multitask Deep Learning Model for Predicting Myocardial Infarction Complications. Bioengineering, 12(5), 520. https://doi.org/10.3390/bioengineering12050520

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop