Surgery is the most effective treatment for early-stage non-small cell lung cancer. The 8th TNM staging system guides treatment selection, and surgical resection with systematic lymph node dissection remains the primary curative approach when there are no medical or social contraindications. Locally advanced stages may also involve chemotherapy, immunotherapy, and radiotherapy, with surgery added for select patients.
Length of hospital stay after lung cancer surgery is highly variable and unpredictable. Published data show that the duration of postoperative hospitalization varies significantly across institutions, surgeons, and patient populations. The mean length of stay at the study institution was 7.3 days with a standard deviation of 5.4 days, reflecting substantial case-by-case variation that makes individual prediction challenging.
Prolonged hospitalization carries meaningful medical, financial, and social costs. Extended stays are associated with higher rates of hospital-acquired infections, increased healthcare expenditure, and greater burden on patients and families. Known risk factors for prolonged stay include older age, comorbidities, reduced pulmonary function, prior neoadjuvant therapy, and open surgical approaches.
Minimally invasive surgery and prehabilitation can reduce hospital stay. Video-assisted thoracic surgery and robotic-assisted thoracic surgery are associated with shorter hospital stays compared to open thoracotomy. Preoperative pulmonary rehabilitation also improves postoperative recovery. Identifying which patients will nonetheless experience prolonged stays despite these advantages could guide more intensive perioperative management.
953 consecutive NSCLC surgical patients over 22 years formed the dataset. All patients underwent lung resection and systematic lymph node dissection between 2001 and 2023 at a single academic thoracic surgery center. The long study period captured both the evolution of surgical practice and the natural variation in patient populations, enhancing the model's exposure to real-world clinical diversity.
Input data spanned six major categories covering the full clinical picture. The neural network received clinical data including comorbidities, smoking history, and risk scores; laboratory values including hemoglobin, albumin, C-reactive protein, and leukocyte counts; respiratory parameters including FVC, FEV1, DLCO, and blood gas values; PET-CT metabolic data including tumor and lymph node SUVmax; surgical approach and technique; and pathological data including tumor type, size, lymph node involvement, and TNM stage.
A fully connected neural network with backpropagation was selected as the model architecture. The FCNN connects every neuron in each layer to every neuron in adjacent layers, establishing pathways capable of capturing both direct and indirect effects of input variables on hospital stay duration. Forward propagation computes predictions and backpropagation iteratively adjusts connection weights to minimize prediction error.
The 9-day threshold was derived from institutional data, not arbitrary cutpoints. The 75th percentile of hospital stay in the institution was 9 days. The mean of 7.3 days was not used as a cutoff because the wide standard deviation of 5.4 days made mean-based classification unstable. Using the 75th percentile as the boundary between short and prolonged stay reflects a clinically meaningful threshold where resource implications and complication risk become elevated.
The model achieved 82.6% accuracy and 90.3% sensitivity on training data. At the optimal iteration step of 9,900, the FCNN demonstrated a positive predictive value of 87.8%, F1-1 score of 89.0%, F1-0 score of 58.3%, and F1 average of 73.6% for the training dataset. The high sensitivity indicates the model effectively identifies most patients who will have short hospital stays.
Test data performance showed good generalization with 78.7% accuracy. On the held-out test set, the model achieved sensitivity of 83.8%, positive predictive value of 88.6%, specificity of 60.0%, F1-1 score of 86.1%, F1-0 score of 54.5%, and F1 average of 70.3%. The AUC on the ROC curve was 0.82, indicating strong overall discriminative ability between short and prolonged hospital stays.
The model performed markedly better for predicting short stays than prolonged stays. The F1-1 score (predicting stays of 9 days or less) was 86.1% on test data, while the F1-0 score (predicting stays longer than 9 days) was only 54.5%. This asymmetry reflects the class imbalance in the dataset, where the majority of patients fell below the 9-day threshold, giving the model more examples to learn from for the short-stay prediction task.
Parallel training and test curves confirm the model avoids overfitting. The training and test accuracy curves progressed in parallel without divergence and stabilized rather than continuing to increase toward infinity. This behavior demonstrates that the model learned genuine generalizable patterns from the data rather than memorizing training examples, supporting confidence in its applicability to new patients.
Preoperative risk stratification enables earlier and more targeted preventive action. Patients predicted to face prolonged hospitalization can receive intensified attention during preoperative preparation, perioperative management, and early postoperative care. Clinical teams can implement specific precautionary measures to address the identifiable risk factors contributing to each patient's extended stay prediction.
AI predictions complement physician judgment rather than replace it. The model is designed to function as a decision support system that supplements clinical experience. Physicians retain final decision-making authority, but can use the model's prediction to calibrate their level of vigilance. Future integration of physician predictions alongside AI outputs could further improve accuracy through combined human-machine assessment.
Better length-of-stay prediction improves hospital resource management. Accurate preoperative forecasting of postoperative hospital duration enables operating room scheduling, ward capacity planning, and intensive care unit allocation to be managed more scientifically. This helps hospitals use surgical and nursing resources more sustainably, particularly in high-volume thoracic surgery units where bed availability directly affects case throughput.
Patients and families benefit from more accurate preoperative counseling. Patients undergoing thoracic surgery consistently seek information about expected hospital duration, procedure risks, and recovery timeline. AI-generated length-of-stay predictions allow surgeons to offer more personalized and evidence-based guidance about the postoperative period, improving patient and family preparedness for the recovery process.
Single-center data is both a strength and a limitation of the model. Training on 22 years of data from a single center with consistent surgical teams enhances internal consistency and reduces confounding from institutional variation. However, single-center algorithms capture institution-specific clinical practices and patient populations, which may limit direct generalizability to centers with different surgical approaches, patient demographics, or postoperative care protocols.
The 953-patient dataset was adequate for initial model development but not for optimal performance. The sample size enabled meaningful learning and hypothesis testing, with the F1 average scores supporting the validity of both the H1 (short stay) and H0 (prolonged stay) predictions. However, the authors note that increasing the training dataset size would improve model accuracy, reduce class imbalance effects, and enhance the model's ability to correctly predict prolonged stays specifically.
The asymmetric F1 performance between short and prolonged stays reflects a real clinical challenge. Prolonged stays are inherently less common and more heterogeneous in their causes, making them harder for any classification model to predict reliably. Future work could address this through oversampling strategies for the minority prolonged-stay class or by building separate sub-models specifically optimized for identifying high-risk patients.
AI applications in thoracic surgery are expanding rapidly across multiple domains. Beyond length-of-stay prediction, deep learning is being applied to diagnostic radiology for nodule detection and characterization, pathology image analysis, robotic-assisted surgical guidance, and drug development. This study contributes a complementary application focused on perioperative outcome prediction, adding to a growing toolkit of AI tools for thoracic oncology care.
Machine and deep learning algorithms offer a practical route to evidence-based perioperative planning. By integrating the full breadth of preoperative clinical, laboratory, respiratory, metabolic, surgical, and pathological data, the FCNN model demonstrated that it is possible to classify postoperative hospital stay risk with clinically meaningful accuracy before the patient enters the operating room.
The AUC of 0.82 confirms the model's meaningful discriminative power. An AUC in this range indicates that the algorithm correctly rank-orders patients by prolonged stay risk substantially better than chance, making it a viable screening tool even in its current form. With further refinement and multicenter validation, performance could be expected to improve toward levels that would support routine clinical deployment.
Early identification of high-risk patients motivates proactive perioperative care. When patients predicted to require extended hospitalization are identified preoperatively, the clinical team can systematically address modifiable risk factors including pulmonary rehabilitation, nutritional optimization, cardiac risk mitigation, and enhanced recovery protocols before surgery, potentially reducing the actual duration of stay for the flagged high-risk group.
Hospital management systems stand to benefit from accurate surgical outcome forecasting. Beyond individual patient care, reliable length-of-stay predictions enable better scheduling of operating rooms, wards, and intensive care units. Sustainable utilization of surgical facilities is a growing priority in healthcare systems facing capacity constraints, and AI-based outcome prediction tools directly support this operational goal.