Abstract
We constructed an early prediction model for postoperative pulmonary complications after thoracoscopic surgery using machine learning and deep learning algorithms. The artificial intelligence prediction models were built in Python, primarily using artificial intelligencealgorithms including both machine learning and deep learning algorithms. Correlation analysis showed that postoperative pulmonary complications were positively correlated with age and surgery duration, and negatively correlated with serum albumin. Using the light gradient boosting machine(LGBM) algorithm, weighted feature engineering revealed that single lung ventilation duration, history of smoking, surgery duration, ASA score, and blood glucose were the main factors associated with postoperative pulmonary complications. Results of artificial intelligence algorithms for predicting pulmonary complications after thoracoscopy in the test group: In terms of accuracy, the two best algorithms were Logistic Regression (0.831) and light gradient boosting machine(0.827); in terms of precision, the two best algorithms were Gradient Boosting (0.75) and light gradient boosting machine (0.742); in terms of recall, the three best algorithms were gaussian naive bayes (0.581), Logistic Regression (0.532), and pruning Bayesian neural network (0.516); in terms of F1 score, the two best algorithms were LogisticRegression (0.589) and pruning Bayesian neural network (0.566); and in terms of Area Under Curve(AUC), the two best algorithms were light gradient boosting machine(0.873) and pruning Bayesian neural network (0.869). The results of this study suggest that pruning Bayesian neural network (PBNN) can be used to assess the possibility of pulmonary complications after thoracoscopy, and to identify high-risk groups prior to surgery.
Similar content being viewed by others
Introduction
At present, thoracoscopic technique is widely used in thoracic surgery1. Thoracoscopic surgery has a much lower incidence of complications than earlier forms of open surgery2. Although there has been great progress in surgical techniques such as thoracoscopic approach and perioperative treatment, the incidence of complications after lobectomy remains high3,4. Despite this, pneumonectomy invariably results in impaired lung function as well as further pulmonary complications which have an incidence ranging from 15 to 37%5. The incidence of PPCs after thoracoscopic pneumonectomy also remains high, due to one-lung ventilation, nerve injury, lung disease and high concentrations of inhaled oxygen during surgery and stress reaction6,7.
Pulmonary complications are the leading cause of perioperative mortality during pneumonectomy8. They contribute to prolonged hospital stays, as well as increased ICU admissions and hospital costs9,10. Postoperative pulmonary complications (PPCs) may also be a driver of tumor-related deaths11. However, targeted measures can alleviate and prevent postoperative pulmonary complications12. At present, there are many studies on the prediction of pulmonary complications, but there remains no effective and feasible intelligence prediction research model11,13,14. Furthermore, there have been few studies on developing models to predict PPCs after thoracoscopic surgery.
At present, artificial intelligence (AI) such as machine learning plays a significant role in clinical diagnosis and treatment. In recent years, machine learning methods have attracted considerable attention, due to their superiority over traditional methods in predicting patient prognosis in a variety of settings and disease conditions15. A significant advantage of machine learning techniques lies in their ability to produce more stable predictions by handling complex nonlinear relationships between predictive variables. For example, a recent study has suggested that a variety of AI algorithms can be used to construct prediction models for difficult intubations16. Additionally, it has been demonstrated that intelligent algorithms can be used to predict the likelihood of pulmonary complications after emergency gastrointestinal procedures17. Machine learning and deep learning techniques can also predict intraoperative bleeding in patients undergoing hepatectomy18.
The aim of this study was to construct an early prediction model for PPCs after thoracoscopic surgery using machine learning and deep learning algorithms.
Methods
Study population
In this study, patients who had undergone thoracoscopic surgery according to the public BioStudies medical database were analyzed. A total of 905 patients who had undergone thoracoscopic surgery were included. Exclusion criteria: emergency and trauma patients; age < 18 years; patients with preoperative pulmonary infection and/or pleural effusion; patients who had undergone open thoracotomy or whose surgery had been canceled; patients who had undergone a second operation; and patients whose relevant data were incomplete or missing. This study was approved by the Ethics Committee at the First Affiliated Hospital of Zhengzhou University (2020-KY-130). It was exempted from informed consent because it was a retrospective study.
Data collection
Demographic and clinical variables were collected from multiple patients who had undergone thoracoscopic surgery. General information included age, sex, American Society of Anesthesiologists (ASA) classification, body mass index (BMI), and history of hypertension, diabetes, stroke, heart disease, chronic obstructive pulmonary disease (COPD), smoking, and alcohol use. Preoperative laboratory tests included white blood cell, red blood cell, and platelet counts. Information on surgery and anesthetic management included surgery duration and single lung ventilation duration. The study focused on PPCs, which, according to the definition of European perioperative clinical outcomes, comprise respiratory infection, respiratory failure, pleural effusion, pulmonary atelectasis, pneumothorax, bronchospasm, and aspiration pneumonia19,20. In the event that one of these complications was detected within the first seven days after surgery, it was considered a PPC.
AI algorithms
The AI prediction models were built in Python, primarily using AI algorithms. These included both machine learning and deep learning algorithms, such as Logistic Regression, Decision Tree, Random Forest, Gradient Boosting Decision Tree-Gradient Boosting, Extreme gradient boosting-XGB, light gradient boosting machine-LGBM, Linear Support Vector-LinearSVC, Multilayer Perceptron Classifier-MLPC, Gaussian naive Bayes-gnb, K-nearest neighbors-knn, AdaBoost-adab, Convolutional Neural Network-CNN, Long Short Term Memory-LSTM, Convolutional Neural Network + Recurrent Neural Networks-CNNRNN, Convolutional Neural Network + Long Short Term Memory-CNNLSTM and Pruning Bayesian neural network-PBNN. The dataset was first divided into training and test groups at a ratio of 7:3. Then the AI algorithms were used to build prediction models for data in the training group with fivefold cross-validation. Next, the model’s performance was verified in the test group. The LGBM algorithm was used to analyze and rank the weights of each variable accounting for the PPC. Person correlation was used to analyze the relationship between the individual variables. The data were then normalized. Any missing data were processed using the SimpleImputer package. The model was evaluated based on its ROC curve, accuracy, precision, F1 score, recall, Matthews correlation coefficient(MCC), Specificity and MSE score.
General statistical analysis
R was used to conduct general analysis. The count data were expressed as percentages, with a χ2 test for group comparisons. Any measurement data conforming to a normal distribution were expressed as \({\overline{\text{x}}} \pm {\text{s}}\), with a t-test for group comparisons. A P value less than 0.05 was considered significant.
Ethics approval and consent to participate
This study was approved by the Ethics Committee of the First Affiliated Hospital of Zhengzhou University (2020-KY-130), which exempted the informed consent form because it was a retrospective study.
Results
General information
A total of 905 post-thoracoscopic patients were included in this study. In neither the training nor the test groups was there any statistical difference in BMI between the PPC and non-PPC groups (Table 1).
Correlation analysis between clinical PPC variables
Correlation analysis showed that PPCs were positively correlated with age and surgery duration, and negatively correlated with serum albumin (Fig. 1). Using the LGBM algorithm, weighted feature engineering revealed that single lung ventilation duration, history of smoking, surgery duration, ASA score, and blood glucose were the main factors associated with PPCs (Fig. 2).
Results of AI algorithms for predicting pulmonary complications after thoracoscopy in the training group
In terms of accuracy, the two best algorithms were adab (0.915) and CNNRNN (0.912); in terms of precision, the best algorithm was RandomForest (0.944); in terms of recall, the two best algorithms were CNNRNN (0.752) and adab (0.745); in terms of F1 score, the best algorithm was CNNRNN (0.796); and in terms of AUC, the two best algorithms were CNNRNN (0.959) and RandomForest (0.918); MCC value greater than 0.6 includes the following algorithms: CNNRNN, adab, logistic regression, linear SVC, and PBNN; and except for the gnb algorithm, the specificity values of other algorithms are all greater than 0.900 (Table 2 and Fig. 3).
Results of AI algorithms for predicting pulmonary complications after thoracoscopy in the test group
In terms of accuracy, the two best algorithms were LogisticRegression (0.831) and LGBM (0.827); in terms of precision, the two best algorithms were GradientBoosting (0.75) and LGBM (0.742); in terms of recall, the three best algorithms were gnb (0.581), LogisticRegression (0.532), and PBNN (0.516); in terms of F1 score, the two best algorithms were LogisticRegression (0.589) and PBNN (0.566); and in terms of AUC, the two best algorithms were LGBM (0.873) and PBNN (0.869); the algorithms with the highest MCC value were logistic regression and PBNN; and except for the CNNLSTM, CNNRNN, and gnb algorithms, the specificity values of other algorithms are all greater than 0.900 (Table 3 and Fig. 4).
Taken together, PBNN performed best among these AI algorithms in predicting post-thoracoscopic pulmonary complications.
Discussion
With its high incidence, PPCs associated with pneumonectomy are a major contributor to prolonged hospitalization, increased postoperative mortality, and medical costs21,22. In spite of the use of perioperative pulmonary protective ventilation strategies and minimally invasive thoracoscopic techniques, the incidence of PPCs remains between 12 and 50%23. As a result, preventing PPCs is crucial to the prognosis of post-thoracoscopic patients. In this study, PBNN were found to outperform other AI algorithms in predicting PPCs.
The weighted feature engineering constructed by the LGBM algorithm indicated that the main factors for developing pulmonary complications after thoracoscopy were single-lung ventilation duration, smoking history, surgery duration, ASA score, and blood glucose. The occurrence of PPCs has been shown to be closely related to preoperative interstitial pneumonia and smoking history24. A predictive risk model for PPCs can be constructed using age, smoking status, and postoperative 1-s forced expiratory volume25. PPCs are also associated with prolonged surgery times26. In multivariate analysis, the risk factors associated with increased prevalence of PPCs were ASA physical status ≥ III and surgery duration > 5 h27. Surgery duration, one-lung ventilation duration, and ASA score are significant predictors of PPCs after thoracic surgery28. The incidence of PPCs was 10.9% among the 6,063 patients who were analyzed, and factors such as advanced age, ASA score, and surgery duration ≥ 1 h were the main determinants of pulmonary complications29. PPCs have been reported to be significantly influenced by smoking, postoperative blood glucose, and ventilation duration in patients undergoing noncardiac surgery30. Additionally, diabetic patients have a higher risk of pulmonary complications during the perioperative period of coronary artery bypass surgery than do non-diabetics31. These conclusions are also supported by our findings.
This study does have its limitations. Firstly, it was a retrospective study conducted at a single center, and therefore it is subject to single-center bias. For internal validation, cross-validation were used; however, further multicenter and prospective studies are needed. Furthermore, this retrospective study did not include detailed information on intraoperative hemodynamic fluctuations, postoperative pain, or its treatment.
This study’s results suggest that AI algorithms such as PBNN can be used to assess the possibility of pulmonary complications after thoracoscopy, and to identify high-risk groups prior to surgery. Moreover, PBNN’s accuracy rate is 82%, the AUC value is 0.869, and its recall rate and F1 value are both greater than 0.5. Therefore, AI algorithms should be able to facilitate early intervention which will reduce the likelihood of pulmonary complications, and facilitate the management of patients in the perioperative period.
Data availability
The data is available from the BioStudies public database (https://www.ebi.ac.uk/biostudies/europepmc/studies/S-EPMC8572520).
References
Kim, S. J. et al. Changes in pulmonary function in lung cancer patients after video-assisted thoracic surgery. Ann. Thorac. Surg. 99(1), 210–217 (2015).
Bendixen, M. et al. Postoperative pain and quality of life after lobectomy via video-assisted thoracoscopic surgery or anterolateral thoracotomy for early stage lung cancer: A randomised controlled trial. Lancet Oncol. 17(6), 836–844 (2016).
Villamizar, N. R. et al. Thoracoscopic lobectomy is associated with lower morbidity compared with thoracotomy. J. Thorac. Cardiovasc. Surg. 138(2), 419–425 (2009).
Suzuki, K. et al. Comparison of pulmonary segmentectomy and lobectomy: Safety results of a randomized trial. J. Thorac. Cardiovasc. Surg. 158(3), 895–907 (2019).
Agostini, P. et al. Postoperative pulmonary complications following thoracic surgery: Are there any modifiable risk factors?. Thorax 65(9), 815–818. https://doi.org/10.1136/thx.2009.123083 (2010).
Yan, T. et al. Prophylactic penehyclidine inhalation for prevention of postoperative pulmonary complications in high-risk patients: A double-blind randomized trial. Anesthesiology 136(4), 551–566 (2022).
Wang, B., Chen, Z., Zhao, R., Zhang, L. & Zhang, Y. Development and validation of a nomogram to predict postoperative pulmonary complications following thoracoscopic surgery. PeerJ 9, e12366 (2021).
Miskovic, A. & Lumb, A. B. Postoperative pulmonary complications. Br. J. Anaesth. 118(3), 317–334 (2017).
Canet, J. et al. Prediction of postoperative pulmonary complications in a population-based surgical cohort. Anesthesiology 113(6), 1338–1350. https://doi.org/10.1097/ALN.0b013e3181fc6e0a (2010).
Canet, J. & Gallart, L. Predicting postoperative pulmonary complications in the general population. Curr. Opin. Anaesthesiol. 26, 107–115 (2013).
Lugg, S. T. et al. Long-term impact of developing a postoperative pulmonary complication after lung surgery. Thorax 71(2), 171–176. https://doi.org/10.1136/thoraxjnl-2015-207697 (2016).
Güldner, A. et al. Intraoperative protective mechanical ventilation for prevention of postoperative pulmonary complications: A comprehensive review of the role of tidal volume, positive end-expiratory pressure, and lung recruitment maneuvers. Anesthesiology 123(3), 692–713 (2015).
Mazo, V., Sabaté, S. & Canet, J. How to optimize and use predictive models for postoperative pulmonary complications. Minerva Anestesiol. 82(3), 332–342 (2016).
Im, Y. et al. Impact of interstitial lung abnormalities on postoperative pulmonary complications and survival of lung cancer. Thorax 78(2), 183–190 (2023).
Ren, H. et al. Predicting acute onset of heart failure complicating acute coronary syndrome: An explainable machine learning approach. Curr. Probl. Cardiol. 48(2), 101480 (2023).
Zhou, C. M., Wang, Y., Xue, Q., Yang, J. J. & Zhu, Y. Predicting difficult airway intubation in thyroid surgery using multiple machine learning and deep learning algorithms. Front. Public Health 10, 937471. https://doi.org/10.3389/fpubh.2022.937471 (2022).
Xue, Q. et al. Developing machine learning algorithms to predict pulmonary complications after emergency gastrointestinal surgery. Front. Med. (Lausanne) 8, 655686. https://doi.org/10.3389/fmed.2021.655686 (2021).
Xue, Q. et al. Predicting intraoperative bleeding in patients undergoing a hepatectomy using multiple machine learning and deep learning techniques. J. Clin. Anesth. 74, 110444. https://doi.org/10.1016/j.jclinane.2021.110444 (2021).
Jammer, I. et al. Standards for definitions and use of outcome measures for clinical effectiveness research in perioperative medicine: European Perioperative Clinical Outcome (EPCO) definitions: A statement from the ESA-ESICM joint taskforce on perioperative outcome measures. Eur. J. Anaesthesiol. 32(2), 88–105 (2015).
Nijbroek, S. G., Schultz, M. J. & Hemmes, S. N. T. Prediction of postoperative pulmonary complications. Curr. Opin. Anaesthesiol. 32(3), 443–451 (2019).
Arslantas, M. K. et al. Effect of the amount of intraoperative fluid administration on postoperative pulmonary complications following anatomic lung resections. J. Thorac. Cardiovasc. Surg. 149(1), 314-321.e1. https://doi.org/10.1016/j.jtcvs.2014.08.071 (2015).
Simonsen, D. F., Søgaard, M., Bozi, I., Horsburgh, C. R. & Thomsen, R. W. Risk factors for postoperative pneumonia after lung cancer surgery and impact of pneumonia on survival. Respir. Med. 109(10), 1340–1346. https://doi.org/10.1016/j.rmed.2015.07.008 (2015).
Kim, E. S. et al. Prevalence of and risk factors for postoperative pulmonary complications after lung cancer surgery in patients with early-stage COPD. Int. J. Chron. Obstruct. Pulmon. Dis. 11, 1317–1326. https://doi.org/10.2147/COPD.S105206 (2016).
Sekine, Y., Suzuki, H., Nakajima, T., Yasufuku, K. & Yoshida, S. Risk quantification for pulmonary complications after lung cancer surgery. Surg. Today 40(11), 1027–1033. https://doi.org/10.1007/s00595-009-4182-7 (2010).
Yepes-Temiño, M. J., Monedero, P. & Pérez-Valdivieso, J. R. Risk prediction model for respiratory complications after lung resection: An observational multicentre study. Eur. J. Anaesthesiol. 33(5), 326–333. https://doi.org/10.1097/EJA.0000000000000354 (2016).
Foster, C. A. et al. Development and validation of procedure-specific risk score for predicting postoperative pulmonary complication: A NSQIP analysis. J. Am. Coll. Surg. 229(4), 355-365.e3. https://doi.org/10.1016/j.jamcollsurg.2019.05.028 (2019).
BevilacquaFilho, C. T. et al. Risk factors for postoperative pulmonary complications and prolonged hospital stay in pulmonary resection patients: A retrospective study. Braz. J. Anesthesiol. 71(4), 333–338. https://doi.org/10.1016/j.bjane.2021.02.003 (2021).
Ülger, G. et al. The effectiveness of ARISCAT Risk Index, other scoring systems, and parameters in predicting pulmonary complications after thoracic surgery. Medicine (Baltimore) 101(30), e29723. https://doi.org/10.1097/MD.0000000000029723 (2022).
Neto, A. S. et al. The LAS VEGAS risk score for prediction of postoperative pulmonary complications: An observational study. Eur. J. Anaesthesiol. 35(9), 691–701. https://doi.org/10.1097/EJA.0000000000000845 (2018).
Jin, Y. et al. Incidence and risk factors of postoperative pulmonary complications in noncardiac Chinese patients: A multicenter observational study in university hospitals. Biomed Res Int. 2015, 265165. https://doi.org/10.1155/2015/265165 (2015).
Lauruschkat, A. H. et al. Diabetes mellitus as a risk factor for pulmonary complications after coronary bypass surgery. J. Thorac. Cardiovasc. Surg. 135(5), 1047–1053. https://doi.org/10.1016/j.jtcvs.2007.07.066 (2008).
Wang, B., Chen, Z., Zhao, R., Zhang, L. & Zhang, Y. Development and validation of a nomogram to predict postoperative pulmonary complications following thoracoscopic surgery. PeerJ 9, e12366. https://doi.org/10.7717/peerj.12366 (2021).
Acknowledgements
We are also grateful to the BioStudies public database for including the original data32.
Ethics declarations
Competing interests
The authors declare no competing interests.
Additional information
Publisher's note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Zhou, CM., Xue, Q., Li, H. et al. A predictive model for post-thoracoscopic surgery pulmonary complications based on the PBNN algorithm. Sci Rep 14, 7035 (2024). https://doi.org/10.1038/s41598-024-57700-z
Received:
Accepted:
Published:
DOI: https://doi.org/10.1038/s41598-024-57700-z
Keywords
Comments
By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.