Methods: Between January 2020 and December 2023, a total of 50 patients with postoperative atrial fibrillation (POAF group; 39 males, 11 females; mean age: 65.9±8.3 years; range, 38 to 77 years) and 50 without postoperative atrial fibrillation (non-POAF group; 41 males, 9 females; mean age: 61.8±10.0 years; range, 41 to 81 years) were randomly selected from a group of patients undergoing two or three-vessel coronary artery bypass grafting. We analyzed preoperative laboratory, demographic and intraoperative data using machine learning models.
Results: The overall incidence of postoperative atrial fibrillation was 21.69%. The three most effective biomarkers were magnesium, total iron binding capacity, and albumin, respectively. A total of 2.0 mg/dL value of magnesium was identified as a threshold value. Magnesium values below 2.0 mg/dL were considered atrial fibrillation-positive, accounting for 25% of the dataset. Total iron binding capacity values higher than 442 ?g/dL were considered atrial fibrillation-positive, accounting for 12% of the dataset. The threshold value for albumin was 29 g/dL, and patients with values under this value were considered atrial fibrillation-positive, accounting for 4% of the dataset.
Conclusion: Machine learning models demonstrate encouraging results in identifying risk factors for many entities. It is of utmost importance to establish a ranking among risk factors and determine threshold values to support clinicians in decision making. This is our first experience with machine learning in this patient group after cardiac surgery. Further studies are warranted to confirm these data.
To date, several studies have been performed to predict POAF. Heat shock proteins were shown as markers for AF development.[3,4] Electrolyte disturbances,[5] vitamin deficiencies,[6] metabolic states,[7] demographic features,[8] genetic factors[9] and many others have also been evaluated to predict POAF. However, some markers and predictors are not cost-effective and sometimes commercially unavailable. Another question is the importanceranking of these markers and predictors.
In the present study, we aimed to identify predictors of new-onset POAF using a pool of routinely performed preoperative tests at our institution using machine learning (ML) methods.
CABG procedure
Routine cardiac medications were continued until
day of surgery, except for clopidogrel, which was
stopped at least five days before surgery. Betablocking
agents were routinely prescribed until the
day of surgery. Before anesthetic induction complete
hemodynamic monitoring was performed in the
operating room. On-pump surgery was performed
with mild hypothermia with the use of aortic crossclamping
and antegrade cold blood cardioplegia.
Patients were heparinized at 300 IU/kg to achieve
an activated clotting time of >400 sec. Heparin was
neutralized with 1 mg protamine sulfate per 100 IU
given.
Diagnosis of new-onset atrial fibrillation
Diagnosis of AF was made according to the 2010
guidelines of the European Society of Cardiology
(ESC), based on abnormalities on electrocardiogram
(ECG), which lasted at least 30 sec and was
characterized by sustained arrhythmia, irregular
RR intervals, absent P waves and different intervals
between atrial contractions (cycle <200 ms). All
patients were routinely monitored in the ICU for two
days after cardiac surgery and, then, transferred to
the ward where an ECG was done once daily and
heart rate and blood pressure were measured every
4 h. In case of any disturbance of heart rate, an
actual ECG was done. A new-onset of POAF was
defined as an AF from time after cardiac surgery
until discharge on postoperative Day 5.
Sixteen patients were excluded from the study. Finally, a total of 54 (21.69%) of the patients developed POAF.
Data collection
All routine laboratory results obtained at least
48 h before surgery were collected. Demographic,
echocardiographic, and perioperative data were also
recorded.
Analysis using machine learning
Several classification models were used for data
comparison. Description of the models are provided
below.
Decision Tree (DT) is a classification algorithm good at handling erroneous data. The main aim of this algorithm is to minimize the error and determine the appropriate tree model.
Naive Bayes (NB) formula represents the likelihood of a class given a set of independent features. In simple terms, it calculates the probability of a patient developing POAF based on the observed features:
In Eq.1, Y is the Boolean value, X is the Boolean vector, and i indicates the class. By estimating the kth value in X, the ratio between the target class value and the total target value should be found.
Probabilistic Data Association (PDA) is a classification algorithm that can estimate values in real-time. This algorithm approach is similar to Bayesian. Firstly, an area is chosen in the problem and the value is searched in this area. The area is updated until the value is detected. The value detections are independent. The formulation is as follows:
In Eq. 2, ? is the value that depends on the originated targets, Z(k) is the very last data, and Zk-1 a nd Z k are the broken data parts. The Bayesian approach can also be used in this formulation.
Random Ferns (RFerns) is a classification algorithm that applies the identical series to all inputs. This algorithm uses multiplication rather than addition to compute. The RFerns algorithm uses an improved NB algorithm by partitioning the trees into ferns to consider the correlation between features. The formulation is as follows:
In Eq. 3, while M represents the groups of features, c represents class, and C is a random class. In addition, f is the binary features set, and P is the uniform prior.
K Nearest Neighbour (KNN) is an effective classification algorithm that places the value into the appropriate class. For this, the algorithm calculates the distance between variables. The target value is, then, placed into the nearest class.
In Eq. 4, w is the space vector, W is the class known tuple, d is distance, i and j are the class indicators. The smallest result of the formula gives the class of the unknown classed value.
Statistical analysis
Statistical analysis was performed using the
IBM SPSS version 20.0 software (IBM Corp.,
Armonk, NY, USA). Continuous variables were
presented in mean ± standard deviation (SD) or
median (min-max), while categorical variables
were presented in number and frequency. The
Mann-Whitney U test was performed to analyze
continuous variables, while the chi-square test
was applied for categorical variables. Significant
predictors of POAF were identified using the
receiver operating characteristic (ROC) curve.
A p value of <0.05 was considered statistically
significant.
Table 1. Demographic and baseline data
Using the ML systems, there were 91 independent and one dependent variables for a total of 100 patients. The dataset consisted of a matrix consisting of 100 rows and 92 columns.
The Boruta Feature Selection Algorithm (BFSA) was used to determine the importance of independent features. Figure 1 illustrates the distribution of important features selected through the BFSA. The red colored features of the BFSA appear as features without effect on the classification problem and could be discarded. The green colored features were identified to be important for the classification problem. The importance ranking among these features increases toward the right on the horizontal axis. These features were continued in the creation of ML models. The data distribution and numerical values of highly ranked variables in the dataset are shown in the histogram chart in Figure 2 and Table 2, respectively.
Table 2. Results of high ranked parameters
The graph obtained using the DT model is seen in Figure 3. This chart shows how classification is performed by representing two classes according to certain threshold values of three separate features. The three most important features in predicting POAF are magnesium, TIBC and albumin, respectively. The mean magnesium level was 1.83±0.391 mg/dL in POAF group and 2.04±0.122 mg/dL in non-POAF group. Normal ranges for magnesium at our institution"s laboratory are 1.8 to 2.6 mg/dL. The 2.0 mg/dL value of magnesium was determined by the DT algorithm as the threshold value. Patients with magnesium values below the threshold value were AF-positive and constituted 25% of the dataset. The second most ranked parameter was TIBC, and the mean values in POAF and non-POAF groups were 385.26±9.046 µg/dL and 341.18±61.585 µg/dL, respectively. Regarding to our laboratory references both levels were within the normal ranges, but the difference was significant. A TIBC value of 442 µg/dL is the threshold value. Patients with TIBC values greater than this value were AF-positive and constituted approximately 12% of the dataset. Although in normal ranges albumin level was significantly lower in the POAF group (35.61±6.555 g/dL vs. 42.47±6.138 g/dL). The albumin threshold value was determined as 29 g/dL. Patients with values below this threshold value were AF-positive and constituted 4% of the entire dataset.
Eighty percent of the total observation amount was allocated for training each ML model. The remaining 20% was reserved for testing the trained models. By applying 10-fold cross validation to the dataset allocated for training, an attempt was made to prevent possible memorization in the training of the models. The resulting five separate ML models were examined by considering the accuracy and kappa evaluation metrics. In addition, the results were obtained by resampling 50 times for a 95% confidence interval (CI).
The test results of the DT model were obtained from 20 observations. Nine out of 10 patients who had no AF were correctly classified as non- POAF. However, the model made an error by classifying one patient who was non-POAF as POAF. On the other hand, all patients who had POAF were predicted to have POAF and were classified correctly. Accordingly, accuracy: 0.95, kappa: 0.9, sensitivity: 0.9, specificity: 1, precision: 1, prevalence: 0.5 and F1 score value was obtained as 0.947 (Figure 4). Comparison of ML models is demonstrated in Table 3. The ROC analysis of ML models is depicted in Figure 5.
Figure 4. Accuracy of DT model.
POAF: Postoperative atrial fibrillation; DT: Decision tree.
In the present study, we focused on defining features and establishing classification models in AF. As a result of the analyses, 14 features that were likely to affect the classification process of patients according to whether they develop AF or not were identified. Magnesium, TIBC, and albumin were determined to be the three most effective properties, respectively.
Magnesium, which is an essential cofactor for the sodium-potassium adenosine triphosphate pump, has effects on the cardiac conduction system. Disruption or alteration of this pump in the setting of hypomagnesemia may impact myocardial excitability. Magnesium infusion prolongs atrioventricular conduction, while low magnesium levels increase sinus node automaticity.[12] Hypomagnesemia is a common finding in pre- and postoperative situations, and this contributes to AF onset.[13] A study conducted by Burrage et al.[14] showed that low serum magnesium levels were associated with AF after cardiac surgery. Most of the studies in the literature demonstrate beneficial effects of magnesium therapy except for one conducted by Lancaster et al.[15] postulating that supplementation of magnesium did not protect against AF. On the other hand, a meta-analysis published by Gu et al.[16] found that intravenous magnesium prevented AF after CABG. The supplementation of magnesium to cardioplegia is also effective in preventing AF.[17] Additionally, in off-pump CABG, administration of magnesium pre- and postoperatively was beneficial in preventing AF.[14] In their systematic review, Turagam et al.[18] compared the effects of preoperative regimens of magnesium to intra- and postoperative administrations. Preoperative magnesium was more effective in preventing AF than intra- and postoperative administration. A debating factor is the dose and duration of treatment to reach adequate levels of intracellular magnesium;[19] therefore, studies for determining the optimal dosing and timing for magnesium therapy seem to be essential.
In our study, TIBC as an effective property was an interesting finding. To the best of our knowledge, there are no studies in the literature demonstrating a direct correlation between TIBC and AF. Rather, TIBC may be an indirect indicator for serum iron. Only a few studies have investigated the correlation between iron and AF. In a review by Hanna-Rivero et al.,[20] the relationship between iron status and AF was clearly documented and Keskin et al.[21] showed that iron deficiency was common among AF patients. Although not widely discussed in the literature, levels of causality are also critical. In our study, the mean ferritin level was 123.03±78.625 in POAF group and 124.39±79.560 in non-POAF group. The fact that the TIBC value increased in the POAF group, but the ferritin value was normal may raise the question of whether there may be a relationship between inflammation and POAF rather than iron deficiency or anemia. However, regarding to this study, TIBC still seems to be a novel marker. Further studies are needed to fully elucidate the biochemical causality relationship with AF. Hanna-Rivero et al.[20] also suggested that inflammation had a significant role in the pathogenesis of AF, which may explain normal ranges of ferritin despite high -TIBC levels.
Albumin is another effective biomarker. Although the causality could not be established, low levels of albumin are directly associated with AF development.[22] The importance of albumin was also demonstrated in a study by Schamroth Pravda et al.[23] w here l ow a lbumin l evels p redicted A F recurrence after ablative therapies.
Currently, ML models are effective tools for predicting operative outcomes after CABG. This may benefit quality assessment and clinical decision making. The interpretation of ECG parameters using ML models has been shown to be effective in predicting AF.[24] Furthermore, ML models appear to be superior to clinical scoring tools in predicting AF, as well as mortality.[25] El-Sherbini et al.[26] published a review postulating that ML models may offer an advantage over conventional risk scores due to their ability to analyze different correlations and their potential for incorporating several demographic and clinical variables in predicting AF after cardiac surgery.
Of note, this study is our first attempt using ML models to predict AF after CABG. We believe that it was important to determine a ranking in probably effective biomarkers. Another important finding was the threshold values of the three most important biomarkers; i.e., magnesium, TIBC, and albumin. Although favorable results can be obtained with ML in small sample sizes, it would be more accurate to work with larger case series for an ambitious result. Indeed, including features such as preoperative renal failure and prolonged ICU stay in large case series would be beneficial in terms of diversity.[27] On the other hand, a remarkable feature of our study was that we analyzed all routine preoperative laboratory parameters, demographic data and intraoperative data. It would be more possible to make a generalization with studies conducted with increased number of cases. The ML studies should be conducted with larger case series. However, the accuracy of the threshold values also needs to be tested. The impact of preoperative magnesium, TIBC, and albumin optimization on long-term outcomes should be investigated in further studies.
In conclusion, many parameters in the literature demonstrate a correlation with atrial fibrillation and even with postoperative atrial fibrillation. Taken together, the ranking of the parameters or properties are still missing. Machine learning is useful for establishing the ranking among these parameters or properties. Our study findings suggest that preoperative levels of magnesium, albumin, and total iron binding capacity may help to predict postoperative atrial fibrillation risk. However, it should be kept in mind that this study was conducted on a limited scale due to the low rate of atrial fibrillation in a selected population. Therefore, the findings of the study need to be strengthened by external validation for their applicability. Future studies should involve larger patient populations to validate these predictors and refine machine learning models.
Data Sharing Statement: The data that support the findings of this study are available from the corresponding author upon reasonable request.
Author Contributions: Idea: B.A.; Design: B.A., O.O., M.Ç.; Supervision: M.Y., G.A.; Data collection. M.G.S.; Literature revirew: B.A., M.G.S., G.A.; Crtical review: M.Y., O.O.
Conflict of Interest: The authors declared no conflicts of interest with respect to the authorship and/or publication of this article.
Funding: The authors received no financial support for the research and/or authorship of this article.
1) Gillinov AM, Bagiella E, Moskowitz AJ, Raiten JM, Groh
MA, Bowdish ME, et al. Rate control versus rhythm control
for atrial fibrillation after cardiac surgery. N Engl J Med
2016;374:1911-21. doi: 10.1056/NEJMoa1602002.
2) Mostafa A, El-Haddad MA, Shenoy M, Tuliani T. Atrial
fibrillation post cardiac bypass surgery. Avicenna J Med
2012;2:65-70. doi: 10.4103/2231-0770.102280.
3) Oc M, Ucar HI, Pinar A, Akbulut B, Oc B, Akinci SB, et al.
Heat shock protein 60 antibody. A new marker for subsequent
atrial fibrillation development. Saudi Med J 2007;28:844-7.
4) Oc M, Ucar HI, Pinar A, Akbulut B, Oc B, Akyon Y, et al.
Heat shock protein70: A new marker for subsequent atrial
fibrillation development? Artif Organs 2008;32:846-50. doi:10.1111/j.1525-1594.2008.00640.x.
5) Pati G, Mukherjee S, Kumar P, Khan D, Sengupta S. A study
of the effects of intravenous magnesium sulphate on postoperative
atrial fibrillation in patients undergoing off pump
Coronary Artery Bypass Grafting (CABG). Indian J Clin
Anaesth 2023;10:26-31.
6) Ohlrogge AH, Brederecke J, Ojeda FM, Pecha S, Börschel
CS, Conradi L, et al. The relationship between vitamin D and
postoperative atrial fibrillation: A prospective cohort study.
Front Nutr 2022;9:851005. doi: 10.3389/fnut.2022.851005.
7) Ao H, Xu F, Wang X, Tang X, Zheng Z, Hu S. Effects of
metabolic syndrome with or without obesity on outcomes
after coronary artery bypass graft. A cohort and 5-year
study. PLoS One 2015;10:e0117671. doi: 10.1371/journal.
pone.0117671.
8) Filardo G, Ailawadi G, Pollock BD, da Graca B, Sass DM,
Phan TK, et al. Sex differences in the epidemiology of
new-onset in-hospital post-coronary artery bypass graft
surgery atrial fibrillation: A large multicenter study. Circ
Cardiovasc Qual Outcomes 2016;9:723-30. doi: 10.1161/
CIRCOUTCOMES.116.003023.
9) Kertai MD, Li YJ, Ji Y, Qi W, Lombard FW, Shah SH,
et al. Genome-wide association study of new-onset atrial
fibrillation after coronary artery bypass grafting surgery. Am
Heart J 2015;170:580-90.e28. doi: 10.1016/j.ahj.2015.06.009..
10) Sihombing RS, Muhadi M, Mansjoer A, Rinaldi I. The
influence of new-onset atrial fibrillation after coronary
artery bypass grafting on three-year survival. Acta Med
Indones 2020;52:125-130.
11) Malhotra P, Pande S, Mahindru S, Thukral A, Kotwal AS,
Gupta RP, et al. Postoperative atrial fibrillation in coronary
artery bypass grafting herald poor outcome. Ann Card
Anaesth 2021;24:464-469. doi: 10.4103/aca.ACA_30_20.
12) Khan AM, Lubitz SA, Sullivan LM, Sun JX, Levy D, Vasan
RS, et al. Low serum magnesium and the development
of atrial fibrillation in the community: The Framingham
Heart Study. Circulation 2013;127:33-8. doi: 10.1161/
CIRCULATIONAHA.111.082511.
13) Leventopoulos G, Koros R, Travlos C, Perperis A,
Chronopoulos P, Tsoni E, et al. Mechanisms of atrial
fibrillation: How our knowledge affects clinical practice.
Life (Basel) 2023;13:1260. doi: 10.3390/life13061260.
14) Burrage PS, Low YH, Campbell NG, O'Brien B. New-onset
atrial fibrillation in adult patients after cardiac surgery. Curr
Anesthesiol Rep 2019;9:174-93. doi: 10.1007/s40140-019-
00321-4.
15) Lancaster TS, Schill MR, Greenberg JW, Moon
MR, Schuessler RB, Damiano RJ Jr, et al. Potassium
and magnesium supplementation do not protect against
atrial fibrillation after cardiac operation: A time-matched
analysis. Ann Thorac Surg 2016;102:1181-8. doi: 10.1016/j.
athoracsur.2016.06.066.
16) Gu WJ, Wu ZJ, Wang PF, Aung LH, Yin RX. Intravenous
magnesium prevents atrial fibrillation after coronary artery
bypass grafting: A meta-analysis of 7 double-blind, placebocontrolled,
randomized clinical trials. Trials 2012;13:41. doi:10.1186/1745-6215-13-41.
17) Reşatoğlu AG, Uymaz OK, Akbulut B, Yener A.
Supplementation of magnesium to warm blood hyperkalemic
cardioplegia for the prevention of atrial fibrillation after
coronary artery bypass grafting. Anadolu Kardiyol Derg
2007;7:230.
18) Turagam MK, Downey FX, Kress DC, Sra J, Tajik AJ,
Jahangir A. Pharmacological strategies for prevention of
postoperative atrial fibrillation. Expert Rev Clin Pharmacol
2015;8:233-50. doi: 10.1586/17512433.2015.1018182.
19) Klinger RY, Thunberg CA, White WD, Fontes M, Waldron
NH, Piccini JP, et al. Intraoperative magnesium administration
does n ot r educe p ostoperative a trial f ibrillation a fter
cardiac surgery. Anesth Analg 2015;121:861-7. doi: 10.1213/
ANE.0000000000000873.
20) Hanna-Rivero N, Tu SJ, Elliott AD, Pitman BM, Gallagher
C, Lau DH, et al. Anemia and iron deficiency in patients with
atrial fibrillation. BMC Cardiovasc Disord 2022;22:204. doi:10.1186/s12872-022-02633-6.
21) Keskin M, Ural D, Altay S, Argan O, Börklü EB,
Kozan Ö. Iron deficiency and hematinic deficiencies
in atrial fibrillation: A new insight into comorbidities.
Turk Kardiyol Dern Ars 2018;46:103-10. doi: 10.5543/
tkda.2018.51001.
22) Zhao D, Jiao H, Zhong X, Wang W, Li L. The association
between serum albumin levels and related metabolic
factors and atrial fibrillation: A retrospective study.
Medicine (Baltimore) 2022;101:e31581. doi: 10.1097/
MD.0000000000031581.
23) Schamroth Pravda N, Golovchiner G, Goldenberg G, Plakht
Y, Wiessman M, Tal S, et al. Albumin as a prognostic marker
for atrial fibrillation recurrence following cryoballoon
ablation of pulmonary venous. J Clin Med 2022;12:264. doi:10.3390/jcm12010264.
24) He K, Liang W, Liu S, Bian L, Xu Y, Luo C, et al. Long-term
single-lead electrocardiogram monitoring to detect newonset
postoperative atrial fibrillation in patients after cardiac
surgery. Front Cardiovasc Med 2022;9:1001883. doi: 10.3389/
fcvm.2022.1001883.
25) Fan Y, Dong J, Wu Y, Shen M, Zhu S, He X, et al.
Development of machine learning models for mortality risk
prediction after cardiac surgery. Cardiovasc Diagn Ther
2022;12:12-23. doi: 10.21037/cdt-21-648.