Introduction

Artificial intelligence (AI) is the study of algorithms that give machines those abilities considered typical of human thinking, such as problem-solving, object and word recognition, inference of world states, and decision-making [1]. The capability of AI algorithms in the quick and accurate examination of large datasets, and in detection of correlations and patterns imperceptible for human mind, makes them particularly useful in healthcare setting. The relentless growth of AI implementation involves that it is of paramount importance to understand how these technologies can be used to deliver safer, more efficient, and more cost-effective care.

In the context of perioperative medicine, machine learning (ML) is having great success. Among the different classifications of ML available in literature, one of the most popular identifies three main categories: supervised, unsupervised, and reinforcement learning [2]. A supervised algorithm is a task-driven process where an algorithm is trained to predict a prespecified output; it requires a training dataset, to analyze and learn associations between an input and desired output, and a test dataset, used for the assessment of the algorithm performance on new data [2]. An unsupervised algorithm refers to algorithms that identify patterns or structure in an untagged dataset [3]. A reinforcement algorithm has to perform a certain task, learning from its mistakes and successes. Finally, a special note goes to deep learning, considered the most advanced class of ML algorithms, that uses multiple layers to progressively extract higher-level features from the raw input [4].

AI has different potential uses in modern medicine; in fact, it can implement and complement human intelligence by augmenting and democratizing it. AI-algorithms are increasingly used for genomics, imaging and diagnosis, risk stratification, and drug discovery [5]. It finds various applications in surgery [6, 7] and anesthesia [2, 8]. Furthermore, it can be applied for the evaluation and optimization of health conditions to better control and prevent chronic diseases in the idea of precision medicine [9].

The management of the patient candidate to bariatric surgery (BS) is an intricate topic. It requires evaluation by a multidisciplinary team consisting of internists, psychiatrists, general surgeons, and anesthesiologists. All physicians are involved in pre, intra, and postoperative evaluation which is challenging due to the complexity of the patients suffering from obesity [10, 11]. Compared to the non-obese patient, the process is elaborate, and risks-increased [12,13,14]. Management of comorbidities related to obesity, such as obstructive sleep apnea (OSA), diabetes, heart disease, hypertension, and gastroesophageal reflux disease, requires careful preoperative evaluation [15, 16]. BS can be more demanding than common general surgery, due to the intraoperative anesthesiologic control, which requires caution for the management of airways, ventilation, and hemodynamics [17,18,19]. Furthermore, the pharmacokinetic of drugs commonly used in anesthesia is different during bariatric surgical procedures and keeps being a thorny issue [20]. Pharmacological dosing must be carefully planned; weight-based drug dosing in patients with obesity can be defined on actual total body weight (TBW), ideal body weight (IBW), lean body weight (LBW), or adjusted body weight (AdjBW), depending on the specific drug [21, 22].

For these difficulties, we believe that the management of patients with obesity candidate for a bariatric procedure could obtain many advantages from the use of new data mining technologies. In this review, we analyzed the available literature on the current applications of AI to BS, evaluating its impact on each phase of the perioperative management, from presurgical assessment to postoperative period.

Materials and Methods

We performed a narrative review of the literature on the Scopus, Pubmed, and Cochrane databases. All relevant studies published up to September 2021 were included. The search string included various combinations of “artificial intelligence,” “machine learning,” “obese patient,” “pathology,” “risk assessment,” and “bariatric surgery.” Papers concerning children, animals, and studies written in languages other than English were excluded. Articles of interest that were cited from the articles identified in the initial search were also included.

Results

The literature search was conducted on 3 scientific databases (Pubmed, Scopus, and Cochrane) and produced 761 results. After the screening and removal of duplicates, 36 articles met the inclusion criteria and were finally included in the analysis (Fig. 1).

Fig. 1
figure 1

Article selection flow diagram

In detail, considering the design of the report, 28 studies were retrospective and 8 were prospective; 23 articles were about single-center research, while 13 were multicenter.

Regarding the temporal distribution, the totality of the studies has been produced between 2001 and 2021, with a rising trend in last 3 years (Fig. 2).

Fig. 2
figure 2

Temporal distribution of the articles included in our analysis according to the year of publication

All the included articles investigated the different steps of the management of patients with obesity; in particular, 9 studies considered the preoperative phase, 3 the intraoperative one, 8 the postoperative management and complications, while 16 studies examined the clinical outcomes (Fig. 3).

Fig. 3
figure 3

Pie chart describing the proportion of the studied involved in the review related to the specific phase of the perioperative pathway

Various types of AI/ML algorithms were tested, from 1 to 19 for a single study. The most frequent.

algorithms were NN (24 articles), followed by logistic regression (LR) (16 articles), support vector machine (12 articles), random forest (5 articles), and decision tree (6 articles).

To assess the efficacy of the algorithms, multiple outcome measurements were used, specifically area under the curve (AUC) in 17 cases, accuracy in 7 cases, and sensitivity/specificity in 4 cases.

Discussion

The management of patients suffering from obesity and candidates for a bariatric surgical procedure is highly demanding. It assumes the involvement of different specialists, in a tailored multidisciplinary approach. Many efforts have been made to facilitate physicians in accurate risk prediction, selection of the most suitable procedure, and optimization of the surgical planning, thus granting high-quality care.

In recent years, new data mining technologies are promising to be the turning point.

Along with the growing diffusion of AI-based technologies in several subspecialities of healthcare, their application in the field of BS is showing encouraging insights.

Our results are consistent with the recent findings of the scoping review by Pantelis et al. [23], as ML explored models proved effective and outperformed conventional statistical techniques.

AI algorithms have been used in each step of the clinical pathway of the patient candidates for BS, from the presurgical evaluation and intraoperative management to complications and outcome prediction (Fig. 4).

Fig. 4
figure 4

Role of artificial intelligence (AI) in bariatric surgery. AI can be used in every aspect of the perioperative path, from the presurgical assessment to the intraoperative phase, up to the postoperative management

Preoperative Evaluation and Risk-Assessment

Careful and thorough preoperative evaluation is essential in patient candidates for BS to assess their individual risk and prognosis. The aim is to find obesity-related comorbidities to identify high-risk patients and to minimize the risk of postoperative complications. AI can represent a useful tool to achieve this goal, as clearly shown from the number of studies reported (Table 1).

Table 1 Overview of papers about preoperative assessment included in our analysis

For its capability to integrate a great amount of information, AI could be applicable to all preoperative patients, especially those suffering from different obesity-related comorbidities.

Airway assessment must be performed in attempt to identify possible difficult airway management. Zhou et al. explored six ML models for predicting difficult intubation in patients suffering from obesity and found three approaches that can successfully predict it. One of these, the Xgbc algorithm, has an accuracy over 80% and precision up to 100% [24].

Risk assessment of OSA is one of the aspects mostly considered for an accurate presurgical evaluation. Polysomnography (PSG) is traditionally considered an established and effective diagnostic tool providing information on the severity of OSA and the degree of sleep fragmentation. Several publications demonstrate how AI can be used to predict OSA risk. Mencar et al. tested the efficacy and clinical applicability of different ML methods based on demographic information and questionnaire data to predict OSA severity and found out that these can be useful to identify a priority level for assigning patients to the PSG test [25]. Pèpin et al. evaluated if mandibular movement monitoring during sleep coupled with an automated analysis by ML was appropriate for OSA diagnosis and found that it provided reliable performance in respiratory disturbance index [26]. Keshavarz et al. used a dataset containing self-reported variables obtained by utilizing the cross-industry standard process for data mining instruction, a methodology for medical data mining project. They found out it has a good efficacy to predict OSA and it might be a fast and cost-effective auxiliary tool [27]. Furthermore, Gao et al. studied an OSA detection algorithm based on electrocardiogram where sleep apnea-related features are obtained by extracting the time-domain and frequency-domain components of ballistocardiogram and respiratory signals over fixed time intervals. Then ML classification algorithm is used to detect OSA. This model has moderate complexity, high spatial complexity, and high sensitivity and can be used for OSA screening at home [28]. Finally, Tiron et al. presented a hybrid acoustic smartphone App that uses a signal processing technology and AI algorithms to identify sleep stages, respiration rate, snoring, and OSA patterns. It performed both reliably and accurately in the detection of clinically significant OSA, and in the estimation of apnea hypopnea index when compared to a PSG gold standard [29].

Patients with obesity often suffer from lung disfunction, in particular chronic obstructive pulmonary disease (COPD), chronic lung disease, and asthma, that can be usually detected by spirometry. It is of utmost importance to investigate these potential conditions during the preoperative evaluation, and AI proved to be equally effective in this area. Cheng et al. showed that improved classification models can accurately predict pulmonary function, with inputs being motion sensors from carried phones. The trained model perfectly computed the Global Initiative for Chronic Obstructive Lung Disease level 1, 2, and 3 [30]. Viswanath et al. analyzed and estimated the quality of smartphone spirometry efforts. They found that NN can extract more information from potentially muddled signals than traditional methods using domain-specific, expert-designed features. Indeed, it is possible to provide the necessary expert level validity feedback for smartphone-based spirometry efforts [31].

Furthermore, ML prediction models were utilized to predict preoperative hiatal hernia diagnosis. Assaf and colleagues utilized three optional ML models to improve preoperative contrast swallow study (SS) prediction, thus finding that the implementation of ML algorithms to include patient data increases the sensitivity of preoperative SS and may lower the need for hiatal exploration in a large number of patients undergoing BS [32].

ML algorithms are effective in the risk definition and are promising for the future, representing a valuable help for the clinician, increasing the efficacy of the preoperative evaluation.

However, we were not able to find any randomized trial comparing AI to standard perioperative evaluation; recently, the Wuerzburg University Hospital proposed Artificial Intelligence-augmented Perioperative Clinical Decision Support (KIPeriOP) (NCT05284227), a trial investigating a novel anesthesiologic clinical decision support (CDS) application, that integrates risk evaluation tools and updated clinical guidelines guided by artificial intelligence in the setting of preoperative anesthesiologic assessment. It will be compared to the current standard preoperative assessment workflow with participants being actual patients, and the recruitment will be starting in April 2022.

Intraoperative Phase

There are several possible applications of AI in the intraoperative period. It could be used in the management of pharmacotheraphy, in hemodynamic optimization, in monitoring of neuromuscolar block, and of anesthesia depth [33, 34]. Despite this, its use in BS has not yet been fully explored. To our knowledge, the available literature on the use of ML in this phase is limited (Table 2).

Table 2 Overview of papers about intraoperative phase included in our analysis

One the most significant report concerns predicting the early distribution kinetics of propofol. In fact, the volume of distribution of drugs in patients with obesity is modified; the blood volume is increased, as well as the cardiac output, and there are alterations in the plasma transport proteins. In the study by Ingrande et al., AI has been used to manage induction-phase kinetics by means of a high-resolution pharmacokinetic dataset. A classic 4-compartment model was compared to a recirculatory model and to a gated recurrent unit NN. They found out that a recirculatory model and a gated recurrent unit artificial NN had similar performance and were both superior to a compartmental model in describing high-resolution pharmacokinetic data of propofol [35].

AI algorithms were successfully used also for accurate surgery duration estimation and quality-improvement. Twinanda et al. proposed a deep learning pipeline, referred to as RSDNet, which automatically estimates the remaining surgery duration (RSD), by using only visual information from laparoscopic videos of 120 cholecystectomies and 170 gastric bypasses. The proposed deep learning network significantly outperformed a traditional method of estimating RSD [36].

Furthermore, deep learning was utilized to automatically identify steps in laparoscopic sleeve gastrectomy from operative video with a high degree of accuracy, suggesting that advances in AI may translate to healthcare applications, future analyses of surgical cases, quality improvement, and education [37].

Postoperative Management

Complications

Postoperative possible complications after BS could be divided in surgical (fistula, bleeding, herniation, anastomotic stenosis, gastric erosion, intestinal small bowel obstructions), pulmonary (deep vein thrombosis, pulmonary embolism, post-operative pneumonia), nutritional, hepato-biliary, gastrointestinal (gastric ulcers, dumping syndrome, mesenteric vein, or portal system thrombosis), and neurological (neuropathy, myopathy, encephalopathy). A tailored risk assessment could modify the perioperative management and reduce them significantly. AI can be considered a valuable help to achieve this goal (Table 3). Sheikhtaheri et al. developed a clinical decision support system to predict the early complications of one-anastomosis gastric bypass surgery. They developed different artificial neural networks (multilayer perceptron network) for prediction of 10-day, 1-month, and 3-month complications using age, body mass index (BMI), smoking status, intra-operative complications, comorbidities, laboratory tests, sonography results, and endoscopy results as factors for predicting early complications. They found out that the prediction system has a good accuracy, specificity, and sensitivity [38]. Similarly, Cao et al. aimed to find a useful ML algorithm to predict the risk for severe complication after BS. They trained and compared 29 supervised ML algorithms and observed that most of the ML algorithms showed high accuracy (> 90%) and specificity (> 90%) in both the training and test data but none of them achieved an acceptable sensitivity in the test data. Overfitting was the overwhelming problem even though some algorithms showed both high accuracy and an acceptable AUC for the training data. However, they recognized that deep learning neural networks (DLNNs) have the potential to improve the accuracy [39]. Cao et al. also published another study regarding the use of DLNNs to predict serious complications after BS. The aim was to examine whether serious postoperative complications of BS could be predicted preoperatively using DLNNs based on the information available from a national quality registry. Three supervised DLNNs were applied and compared: multilayer perceptron (MLP), convolutional neural network (CNN), and recurrent neural network (RNN). They concluded that MLP and CNN showed improved, but limited, ability for predicting the postoperative serious complications after BS, while the RNN manifested the worst performance [40]. Nudel et al. compared the ability of two ML strategies, artificial neural networks (ANNs), and gradient boosting machines (XGBs) to conventional models using LR in predicting leak and venous thromboembolism after BS. They proved that ANN and XGB outperformed traditional LR in predicting leak and could prove useful in preoperative screening [41].

Table 3 Overview of papers about postoperative management and complications included in our analysis

Comparable results about the effectiveness of AI algorithms to predict morbidity and mortality after BS were obtained by other groups. Recently, Wise et al. used an ANN model to optimize the prediction of 30-day readmission, reoperation, reintervention, or mortality after laparoscopic sleeve gastrectomy, compared to standard LR modeling [42]. Similarly, the results by Razzaghi and colleagues demonstrated the potential of ML tools as clinical decision support in identifying risks/outcomes associated with BS and their effectiveness in reducing the surgery complications and in improving patient care [43].

Furthermore, AI models can help and facilitate physicians in the prevention and management of metabolic complications after BS. In fact, a computerized intelligent decision-making support system for nutritional diagnoses was specifically developed and validated, thus assisting health professionals in the nutritional monitoring of patients submitted to BS [44].

ANN might be as well a useful tool to predict the risk factors and prevalence of gallbladder disease and gallstone development in patients suffering from obesity on the basis of multiple variables related to laboratory and pathological features [45].

In conclusion, ML methods can offer clinically meaningful improvements in risk stratification, even for uncommon events that are difficult to predict using traditional statistical method.

Outcomes

AI based models found wide space in clinical outcome prediction after BS, especially regarding weight loss, obesity related diseases remission, and postoperative quality of life (Table 4).

Table 4 Overview of papers about clinical outcomes included in our analysis

Effectiveness of BS, by means of the forecast of weight loss, is one the fields in which AI was mainly implemented, thus assisting in personalized diagnosis for treatment of obesity, and in the selection of the best candidates for surgery [45,46,47,48].

ANN modeling was used to provide an optimized estimate of expected postoperative weight loss at 6 and 12 months after laparoscopic Roux-en-Y gastric bypass (LRYGB) using only known preoperative patient variables [49]. Similarly, ANN models were successfully applied for prediction of weight loss in women with obesity treated by laparoscopic adjustable gastric banding (LAGB) [50], and laparoscopic one anastomosis gastric bypass (LOAGB) [51].

In the recent paper by Dimeglio et al., a hierarchical cluster analysis was used to identify four profiles of weight trajectories associated with clinical expertise. Interestingly, the authors reported that patients who were the most successful were those who lost weight regularly, and patients who lost the least had difficulties in the initial phase or had a secondary weight regain [52].

Moving to prediction of obesity related comorbidities improvement, ML was applied to develop an ordinal LR model, using 4 clinical and 32 laboratory input variables, and the output was then mathematically transformed into a continuous score for intuitive interpretation, ranging from 1 to 6. In analogy with BMI as index for weight, the Metabolic Health Index (MHI) is developed as objective quantification of metabolic health status, to objectively express improvement of comorbidity [53].

We found several papers investigating the application of AI in the prediction of diabetes remission, proving that it could be helpful for personalized management of individuals with obesity and diabetes candidates for BS, contributing ultimately to precision medicine.

The application of ML techniques to real-world healthcare data can yield useful predictive models to assist the selection of patients more responsive to surgery-induced diabetes remission [54, 55].

Aminian et al. aimed to construct and validate prediction models to estimate the risk of long-term end-organ complications and mortality in patients affected by type 2 diabetes and obesity. The prediction models were programmed to construct user-friendly web-based and smartphone applications of individualized diabetes complications (IDC) risk scores for clinical use. They analyzed all-cause mortality, coronary artery events, heart failure, and nephropathy, showing that these major adverse cardiovascular events are predictable outcomes in patients with diabetes and obesity who undergo metabolic surgery or received diabetes care. They concluded that the IDC Risk Scores can provide personalized evidence-based risk information for patients with type 2 diabetes and obesity about future cardiovascular outcomes and mortality with and without metabolic surgery based on their status of obesity, diabetes, and related cardiometabolic conditions [56].

Aron-Wisnewsky et al. described the development of the Ad-DiaRem scoring system for predicting diabetes remission following RYGB in individuals with obesity and type 2 diabetes. They demonstrated the ability of the score to better separate between individuals predicted to achieve remission and those who will not, and the score improved predictive performance over the traditional scoring system [57]. The same group validated the score even with a long-term follow-up of 5 years [58]. Furthermore, similar findings on the discrimination of patients with and without surgery-induced diabetes remission were reported in the study by Pedersen et al. [59].

Bayesian networks provide useful tools for predicting long-term health-related quality of life in patients after BS, based on their preoperative health and disease status, and outperformed CNN and multivariable LR, in the recent paper by Cao et al. [60, 61].

We were not able to find any paper exploiting the use of AI in the determination of the most proper surgical procedure for each patient. Nevertheless, we do believe that, in the near future, the use of data mining technologies will be extremely useful to select out the best operation for a given patient. In fact, in past years, the number of surgical cases of each bariatric center did not allow the analysis to adequately answer this key topic of BS. Currently, with the introduction of electronic medical records and the availability of large datasets from different centers, we will enter a new era of clinical research, possibly giving a solution to open questions.

Future Perspectives and Limitations

As reported for other medical subspecialties, along with the application of data mining technologies, the use of telemedicine in the field of BS could be one the explorable area in the future. To date, available literature is limited [62].

Despite the promising results of the use of AI-models in each phase of the perioperative management of the patients with obesity, some concern remains about legal and ethical aspects.

In fact, these technologies assume the availability of high-quality datasets, and the collection and utilization of medical data should fulfill regulation criteria, as the ones of the General Data Protection and Regulation (GDPR), that has been issued by the European Union [63, 64]. Unfortunately, most of the time, these existing regulations do not specifically deepen the issue of new technologies and even less they do not give precise and transparent legal instruction for the processing of health data by AI techniques.

Furthermore, separate consensus guidelines are needed to report inherent studies, thus increasing transparency and accuracy of results [65].

Moreover, as clearly inferable from the geographical distribution of the studied included in our analysis, the accessibility to AI and ML methods is not equally available worldwide, contributing to the exacerbation of social inequities. This is a phenomenon opposite to that for which they were born, that is, the smoothing out of differences. In the near future, it will therefore be important to create international networks capable of bypassing national limits and favoring technological access. Similarly, the non-equal access to these technologies, due to substantial costs and economic discrepancy, is still a concern. Indeed, to date, the use of AI could be considered more expensive and not cost-effective, when compared to standard evaluation. Actually, with the continuous application, over time and on large scale, the use of AI-based technologies could lead to a maximization of resources, especially in the accurate and proper plan of surgical procedures, and thus in the optimization of operating rooms efficiency.

Finally, all healthcare professionals should be properly educated and trained on these techniques, granting the full development of AI-instruments potential [66]. In fact, the equipment and instrumentation that are commonly available make AI-tools widely accessible, but the education and culture of the involved physicians can guarantee the specific competence, necessary to extrapolate the maximum use for patients’ care.

Conclusions

AI algorithms have been used in each step of the perioperative path of the patient candidates for BS, from the presurgical evaluation and risk-assessment to postoperative complications and outcomes prediction.

ML models are promising encouraging results helping physicians in the decision-making process in the management of the patients with obesity candidates for BS, thus improving the quality of care and contributing to the goal of precision medicine.

Nevertheless, a number of legal and ethical hurdles remain to be overcome before these methods can be really integrated in common practice.