Explainable artificial intelligence (XAI) for efficient lung cancer diagnosis using transformer–CNN hybrid with metadata fusion
摘要
An explainable and computationally efficient deep learning framework has been proposed for accurate classification of lung cancer subtypes from histopathological images using a hybrid Swin Transformer–CNN architecture fused with patient metadata. Despite the growing success of vision-based models in medical diagnostics, challenges remain in subtype discrimination, clinical interpretability, and deployment readiness. To address these limitations, the proposed model has integrated spatial representations learned via Swin Transformer with structured metadata features through a self-gating fusion module. This design has enabled the network to emphasize clinically discriminative patterns while preserving contextual consistency. Extensive experiments on the LC25000 dataset have been conducted, achieving 99.3% classification accuracy while maintaining low inference latency (18.3 ms per sample) and model compactness (~28.32M parameters). Furthermore, explainability has been ensured through Grad-CAM and SHAP visualizations, providing transparent insights into model decisions. External validation via stratified split testing has confirmed the generalizability of the proposed approach. These results have demonstrated that combining vision transformers with clinical metadata in an interpretable architecture can significantly enhance lung cancer diagnosis and support real-time decision-making in biomedical applications.