Ensemble Transfer Learning for Gastric Cancer Prediction Using Electronic Health Records in a Data-Scarce Single-Hospital Setting
Hyon Kim, Ji Yeon Han, Yae Bin Lim, Y. Young Lim, Seung In Seo, Kyung Joo Lee, Woon Geon Shin · Applied Sciences · 2025
Gastric cancer is a significant health concern in East Asia, where early risk prediction is critical for prevention. However, the scarcity of single-hospital electronic health records (EHRs) data limits the applicability and generalizability of machine learning models. To address this challenge, we propose an ensemble transfer learning framework for gastric cancer prediction using structured EHRs in a data-scarce single-hospital setting. Three base models, Support Vector Machine (SVM), Random Forest, and Deep Neural Network (DNN), were pretrained on a large-scale national dataset from the Republic of Korean National Health Insurance Service (NHIS) and fine-tuned on a smaller institutional dataset from Kangdong Sacred Heart Hospital (KSHH). These fine-tuned models were combined via stacking ensemble learning with logistic regression as a meta-learner. The proposed model achieved strong performance with precision 0.78, recall 0.92, F1-score 0.83, accuracy 0.91, and AUC 0.93. For interpretability, permutation feature importance and Shapley Additive Explanations (SHAP) were applied. Smoking status, gender, and hypertensive disorder were identified as key predictors consistent with previous studies. This study demonstrates the successful application of transfer learning to overcome data scarcity in single-hospital structured EHRs. Furthermore, our stacking ensemble strategy outperformed the individual fine-tuned models, offering a generalizable framework for gastric cancer prediction in data-scarce clinical settings.