DOI: 10.11648/j.ajris.20260103.12 ISSN: 3142-8673

TabTransformer-XGBoost Hybrid Framework for Gastric Cancer Classification Using Tabular Clinical Data with SHAP-Based Explainability

Adetokunbo John-Otumu, Oyewole Dokun, Ferguson Ogene, Chukwukere Okpani, Victor Nwachukwu, Rebecca Ekemonye
Gastric cancer remains an important health challenge, and accurate classification using routinely available clinical information could support timely clinical decision-making. However, conventional machine learning approaches may have difficulty capturing complex relationships among heterogeneous clinical variables, while highly predictive models may provide limited insight into how individual features influence their decisions. This study proposes an explainable TabTransformer-XGBoost hybrid framework for gastric cancer classification using structured clinical data. A publicly available gastric cancer dataset containing 212,354 patient records and 29 attributes was used. The proposed framework incorporates data cleaning, feature selection using mutual information, stratified data partitioning, SMOTE-based class balancing, contextual feature learning with TabTransformer, XGBoost classification, and SHAP-based explainability. The framework was evaluated using accuracy, precision, recall, F1-score, and ROC-AUC and compared with conventional machine learning models, including Decision Tree, Random Forest, XGBoost, Naïve Bayes, Logistic Regression, and Multilayer Perceptron. The proposed framework achieved 90.13% accuracy, 86.17% precision, 90.13% recall, and an F1-score of 85.46%, outperforming the evaluated baseline models in the principal classification measures. Ablation analysis showed that XGBoost provided strong predictive performance, while the TabTransformer contributed contextual feature representations within the hybrid architecture. SHAP analysis further identified influential learned representations and demonstrated nonlinear relationships involving clinical variables such as age and alcohol consumption, thereby providing greater transparency into model predictions. The findings indicate that the proposed framework provides a promising basis for explainable gastric cancer classification from tabular clinical data, although independent multi-centre and real-world clinical validation are required before clinical deployment.

More from our Archive