Introduction

Total knee arthroplasty (TKA) is an effective procedure for patients with end-stage osteoarthritis (OA). However, it is associated with significant blood loss, and approximately one-third of patients require a transfusion, although the range is large [2, 13, 16, 22]. Allogeneic transfusion is necessary for haemodynamic stability, but is accompanied by side effects such as an increased risk for deep vein thrombosis (DVT), deep surgical site infection, and mortality rate, which adversely affect patient clinical outcomes [7, 9,10,11].

Allogeneic blood transfusion is accompanied by side effects; thus, many efforts have been made to reduce this type of transfusion. These include preoperative autologous transfusions [18], and preoperative use of erythropoietin (EPO) [6] and tranexamic acid (TXA) [25], but these interventions have shown varied success rates. However, given the risks and costs of the preventive measures themselves, it is impossible to apply them to all patients.

Considering that transfusion after TKA is only required in some patients, it can be assumed that there are risk factors contributing to the need for transfusion. Gender, age at surgery, American Society of Anesthesiologists score, body mass index (BMI), hypertension, autologous transfusion, preoperative haemoglobin (Hb), preoperative creatinine, operation time, total blood loss, infused fluid, and a decrease in Hb are risk factors for transfusion [10, 11, 20]. However, most patients have these risk factors at the same time; thus, they cannot be used to calculate the probability of needing a blood transfusion, making them less useful for clinicians. In addition, considering that most transfusion precautions must be taken prior to surgery, intra- or post-operative risk factors have limited use in clinical practice.

Machine learning is an application of artificial intelligence (AI) that is useful for analysing big data and generating algorithms to predict outcomes [19]. Machine learning has the advantage that it can be applied directly to individuals, resulting in better performance than conventional statistical methods for complex large data such as medical problems [14]. If the risk of transfusion in a patient can be predicted before surgery, safer surgery will be possible by reducing the cost and unnecessary side effects by taking preventive measures selectively for high-risk patients. However, no studies have been conducted to predict transfusion after TKA using a machine learning algorithm. Hence, our hypothesis was that preoperative patient data can be used to predict patients who will experience a postoperative transfusion using machine learning.

To this end, the purpose of this study was to identify informative preoperative variables for a machine learning model, and to provide a web-based program that can be applied immediately in the clinic.

Materials and methods

Study subjects

The subjects were patients who underwent primary TKA by three surgeons from January 2012 to August 2018. The type of TKA surgery was defined as follows: unilateral TKA, when only one knee was operated on; staged bilateral TKA, when both knees were operated on within a 2-week time interval; and simultaneous bilateral TKA, when both knees were operated on at the same time. All patients were followed up from 1 week before the first TKA to 2 weeks after the last TKA. Patients who received transfusions within 1 week before the first TKA were excluded. Ultimately, 1686 patients were included in this study. There were 1481 females (87.8%) and 205 males (12.2%). The average age of the study group was 74.5 years (± 6.8), body weight was 62.2 kg (± 9.6), height was 154.2 cm (± 6.8), and BMI was 26.1 kg/m2 (± 3.4).

Operative technique and rehabilitation after TKA

The primary TKAs were performed using the same technique. After a midline skin incision, a medial parapatellar approach was followed. An intramedullary guide was used to cut the femur, and an extramedullary guide was used for the tibia. The intramedullary femoral canal was sealed with an autologous bone plug, and all implants were fixed with cement. Two intra-articular drain lines were inserted and removed 2 days after surgery. After closing the joint capsule, 1 g TXA (50 mL) was administered through the drain line. TXA has been routinely applied in our institution since January 2016, except in cases of a known contraindication. All patients followed the same postoperative rehabilitation protocol, beginning with full weight bearing gait and continuous passive motion exercises in a supine position the day after surgery.

Data collection

All variables were collected from the electronic medical recording system and clinical data warehouse system of our institution. In this study, the transfusion group was defined as patients whose Hb levels after the first TKA dropped to less than 7 g/dL within 2 weeks. Patients treated with anticoagulants were defined as those who received warfarin, aspirin, heparin, or a factor Xa inhibitor due to underlying diseases prior to TKA. These medications were stopped 1 week before the operation. Underlying diseases such as asthma, chronic obstructive pulmonary disease, diabetes mellitus, heart disease, and vascular disease were assessed based on whether a patient received medical treatment at this institution or received regular treatment or medication from an independent institution. The blood test results obtained 1–2 days before the first TKA were assessed. A total of 43 preoperative variables were collected, and key variables were extracted selected using Recursive Feature Elimination in the scikit-learn library and a heuristic method (Fig. 1). This retrospective study was approved by the Institutional Review Board of our institution (IRB No. H-1810-133-982).

Fig. 1
figure 1

Flow chart showing analyses and model making process for the study

Statistical analyses

Student’s t test was used for continuous variables, Pearson’s Chi-square test was used for categorical variables expressed as 0 and 1, and analysis of variance was used for categorical variables when more than two categories were used to determine whether the difference in the average of a variable between the transfusion and non-transfusion groups was significant. A p value < 0.05 was considered statistically significant. The gradient boosting model (GBM) was used to construct the predictive model. As an evaluation index for comparing the accuracy of prediction according to each model, the tenfold cross-validation area under the receiver operating characteristic curve (AUC) was examined. All codes were written in Python 3.7.1 (Python Software Foundation, http://python.org). Data from an independent institution were used to objectively verify the predictive performance of the model. In total, 400 patients who received TKA were randomly sampled from an independent institution and verified this as a test set using a model that trained the entire dataset (1686 patients) to confirm the AUC. Patient characteristics, including transfusion rate, were different among the two institutions (Table 1). A logistic regression analysis was performed to explore the relative contributions of variables to transfusion, and to determine the odds ratios (ORs).

Table 1 Comparison of study populations between two institutions

Results

Of the 1686 patients, 108 (6.4%) were in the transfusion group. The average Hb, which was 12.7 g/dL before TKA, decreased to 8.6 g/dL. Among the transfusion group patients, the rate of actual blood transfusions was 97.2%. The use of TXA, type of surgery, platelet count, age, body weight, and preoperative Hb were selected as the key variables (Table 2). TXA, type of surgery, and age were higher in the transfusion group, and body weight, platelets, and Hb were higher in the non-transfusion group. The ORs of key variables were calculated by logistic regression analysis (Table 3).

Table 2 Clinical characteristics of the study subjects and key features
Table 3 Odds ratios of logistic regression analysis for transfusion after TKA

Machine learning was used to predict transfusions after TKA using selected variables and the AUC was 0.842 [95% confidence interval (CI) 0.820–0.856] (Fig. 2). The optimal threshold was 0.0687 according to the Youden index, defined as sensitivity + specificity − 1, and the sensitivity and specificity were 89.8% and 74.8%, respectively.

Fig. 2
figure 2

Receiver operating characteristic curve for the machine learning model

In addition, the independent institution’s data were used to verify the predictive performance of the model. The AUC for the independent institution was 0.880 (95% CI 0.844–0.910).

The web-based risk-assessment system of the model designed in this study can be found at http://safetka.net. When a user inputs the six variables included in the model, the web page shows whether a patient is in a high- or low-risk group for blood transfusion after TKA, and the extent to which each variable contributed to the prediction (Fig. 3). The threshold can be adjusted in the advanced mode, which enables optimization for each institution.

Fig. 3
figure 3

Web-based risk-assessment system (http://safetka.net). Entering the input value determines the transfusion risk and displays how each feature contributed to the prediction. a Low-risk group example, b high-risk group example

Discussion

The most important finding of this study was that transfusion after TKA can be accurately predicted preoperatively using a machine learning algorithm. This approach could also be applied to other complications and procedures. The proposed model showed an AUC of 0.842, which was validated by data from an independent institution. Thus, the proposed hypothesis was supported by the results of this study. Furthermore, this study enabled individualized prediction of transfusion risk using a web-based system. Unnecessary costs or risks from transfusion or transfusion preventive measures could be effectively reduced, since this web-based program not only predicts the risk of transfusion, but also allows clinicians to determine the relative importance of the variables involved. Given that millions of TKAs are performed each year and blood transfusions continue, the results of this study will be useful to arthroplasty surgeons. To our knowledge, this is the first study to predict a postoperative blood transfusion after TKA.

Blood transfusions after TKA continue to occur in 20–70% of patients [2, 13, 16, 22]. Because blood transfusion increases complication and infection rates, there have been many efforts to reduce this procedure such as by using TXA, EPO, or an autologous transfusion [5, 6]. Indeed, by applying these methods, the rate of postoperative blood transfusion is steadily decreasing [17]. However, these methods are costly and are often associated with side effects. In addition, these measures cannot be applied to all patients considering the contraindications. Therefore, it is reasonable and safer to predict the transfusion risk and apply preoperative measures accordingly.

Previous studies only reported ORs for each risk factor of a postoperative transfusion [3, 9,10,11]; one study provided a transfusion predictive model using logistic regression [12]. However, it is necessary to know the blood loss and drop in Hb levels after surgery to determine the need for a transfusion. In this sense, it is not a true prediction [20] because even if the model predicts a transfusion, there are no measures that can be taken at the time of the prediction.

In this study, age at surgery, body weight, use of TXA, platelet count, Hb level, and type of surgery were selected as important variables. The higher the age, the lower body weight, the absence of TXA, and the higher the surgical stage, the greater the probability of receiving a transfusion. The lower the platelet and Hb levels the greater the probability of receiving a transfusion. The ORs of preoperative Hb and platelets were 0.61 and 0.99, respectively. For high-risk patients, preoperative correction of Hb or platelet count should be considered. TXA was described by Della Valle [5] as being of key importance for blood conservation during TKA surgery. Our results are in line with their report and the OR for transfusion was 0.03. The results suggest that TXA should be routinely considered in daily practice. Age at surgery, body weight, and Hb level have also been noted as important risk factors for transfusion in previous studies [10, 20]. Body weight is often referred to in the form of BMI. However, in a machine learning algorithm, body weight is considered a more important risk than BMI. The OR of obesity was 0.94, which suggests that patients with low body weight are at a higher risk of requiring a transfusion. Bilateral staged TKA is less common in the United States, but is frequently performed in other countries with high rates of transfusion [4]. The ORs for transfusion in this study were 2.64 and 9.63 in staged bilateral and simultaneous bilateral surgery, respectively, compared to unilateral TKA. Therefore, for high-risk patients, unilateral TKA should be considered. Validation with data from the other institution also supports our argument, with an AUC of 0.880.

In this study, the AUC of the transfusion prediction was 0.842, which exceeds the threshold for good performance of ≥ 0.8 [23]. The model of this study was verified with data from an independent institution, and the results were satisfactory. This finding strongly suggests that the results of this study could be useful for any institution. In addition, safe TKA is possible by placing a longer period of time rather than a weekly bilateral staged TKA in high-risk patients requiring bilateral surgery. Ultimately, this algorithm enables safe and precise medical care. The inputs required in the model presented in this study are only laboratory outcomes, demographic data, and the type of surgery. A major strength of this approach is that the information required is already known before surgery.

In addition to presenting the AUC of the predictive model, this study provides a risk-assessment platform that can be used by doctors in any country worldwide. Through the machine learning code and the prediction platform, physicians can make predictions before the actual surgery with only simple patient information. The methodology of this study can be applied to various problems that arise before and after surgery, which will make surgeries safer. The sensitivity and specificity of each threshold are described in Supplementary Table 1.

Several limitations in this study should be discussed. First, the transfusion group was defined as patients whose Hb level was < 7 g/dL after surgery. The reason for this is that the standards for blood transfusion in each institution are not identical. Frisch [10] pointed out that the reason for the TKA transfusion rate of 3–67% is arbitrary because there are no objective criteria for transfusion. Considering that transfusion mostly occurs in patients whose Hb level is < 7 g/dL, the model presented here could be more commonly used when the Hb level is an objective indicator. Second, the operative protocol used by this institution may be different from others, which may have affected the outcome. For example, in this study, intra-articular drainage was performed for 2 days and was occasionally removed 1 day before or later. There are many institutions that do not actually use drains, which can affect the rate of blood transfusion. However, according to Adalberth, the effects of drainage are not great. The difference in the drop in Hb between drainage and non-drainage groups is less than 1 [1]. It is also possible that the TXA administration route may be different. In our institution, 1 g intra-articular TXA was used. TXA is cheap and has few side effects; thus, it is widely used during TKA surgery. On the other hand, dosage routes (IV, IA, and PO) vary by institution and there is also controversy about the proper dosage [8, 12, 24]. However, the influence of dose or dosing method on the effects of TXA are insignificant, suggesting that the results of this study can be generalized [8, 24]. Third, the predominance of females in the study population should be noted. Although gender was not selected as a key variable, it may affect the outcome of TKA. The proportion of females was 87.8%, which was substantially higher than in other studies [9, 20]. Although there is no clear explanation for the high proportion of females affected by knee OA, it has been reported in several epidemiologic studies in Asia [15, 21]. This could explain the predominance of females in this study, and may indicate negligible selection bias. Further studies including different populations are needed.

Conclusion

A web-based predictive model for transfusion after TKA using a machine learning algorithm was developed, which is simple, validated, and had good performance. This model enables individualized prediction of transfusion risk and can minimize the cost and risks associated with various preventive measures for transfusion. We recommend using this program prior to TKA to predict the risk of transfusion and guide appropriate precautions for high-risk patients.