Hybrid Transformer-XGBOOST Model Optimized with Ant Colony Algorithm for Early Heart Disease Detection: A Risk Factor-Driven and Interpretable Method - Moch Deny Pratama; Faris Abdi El Hakim; Dimas Novian Aditia Syahputra; Dodik Arwin Dermawan; Asmunin Asmunin; Salamun Rohman Nudin; Andi Iwan Nurhidayat (Journal of Applied Data Sciences, 2026)
Cardiovascular diseases (CVDs) remain the leading cause of death worldwide, with significant socioeconomic consequences due to premature death and chronic disability. Although clinical screening techniques have evolved, early and accurate prediction of heart disease is still partial due to the limited capacity of conventional machine learning algorithms to model the complex nonlinear interactions among various contributing risk factors e.g., hypertension, diabetes, hyperlipidemia, and genetic predisposition. To address these challenges, this research introduces a hybrid framework that combines the Transformer architecture known for its robust self-attention mechanism and high representational capabilities with Ant Colony Optimization (ACO), a nature-inspired metaheuristic algorithm modeled on the foraging behavior of ants, to enable adaptive and efficient hyperparameter optimization. The proposed model processes structured clinical data by encoding categorical variables into embeddings and normalizing numerical features, resulting in a unified tabular representation suitable for transformer-based analysis. ACO improves model efficiency by optimizing key parameters e.g., embedding configuration, learning rate, and depth, reducing manual intervention and computational overhead. The proposed Hybrid Transformer-ACO model focuses on interpretable clinical features to provide actionable risk stratification. Model evaluation was performed using classification metrics e.g., accuracy, precision, recall, F1 score, and time complexity to measure predictive performance and computational efficiency during the training and inference phases. These evaluation criteria provide evidence of the model's diagnostic reliability, generalizability, and practical feasibility for clinical application.. The model achieved 100% accuracy, sensitivity, specificity, and F1-score, outperforming several models. Time complexity analysis demonstrated efficient training and testing, while the model interpretability supports transparency and trust.