A Lightweight Lung Segmentation and Vision Transformer Framework for CT-Based Lung Cancer Classification.
Authors
Affiliations (5)
Affiliations (5)
- Department of Computer Science and Engineering, School of Engineering and Technology, CGC University, Mohali 140307, Punjab, India.
- School of Computer Science and Engineering, Yeungnam University, Gyeongsan 38541, Republic of Korea.
- eHealth and Telemedicine Group, University of Valladolid, 47011 Valladolid, Spain.
- Department of Projects, Universidad Internacional Iberoamericana, Arecibo, PR 00613, USA.
- Department of Projects, Universidad Europea del Atlántico, Isabel Torres 21, 39011 Santander, Spain.
Abstract
Lung cancer remains a major cause of cancer-related mortality, and accurate analysis of pulmonary abnormalities on computed tomography (CT) images is important for supporting timely diagnosis. However, automated lung cancer classification remains challenging because pulmonary lesions exhibit substantial variability in size, morphology, intensity, and anatomical location, while image noise and irrelevant surrounding structures can adversely affect model performance. This study investigates an integrated deep learning framework combining image restoration, anatomical segmentation, and transformer-based classification for computer-aided lung cancer analysis. The proposed framework consists of three sequential stages. First, Fast Non-Local Means (FNLM) denoising is applied to reduce image noise while preserving relevant anatomical structures. Second, lung regions are isolated using intensity-based thresholding followed by morphological operations and contour-based refinement. The resulting lung masks are applied to the denoised CT images to suppress irrelevant surrounding structures. Finally, the segmented lung images are resized and normalized and supplied to a Vision Transformer (ViT), which learns contextual representations for classification. The framework is evaluated using a single open-access CT image dataset under two classification settings: binary classification of cancerous and non-cancerous CT images and multiclass discrimination among normal, benign, and malignant cases. In binary lung cancer classification, the proposed framework correctly classified 982 of 1000 CT images, achieving an accuracy of 98.20%, with sensitivity, specificity, precision, and F1 scores of 98.20%. For multiclass classification of normal, benign, and malignant cases, the framework correctly classified 951 of 1005 CT images, corresponding to an overall accuracy of 94.63%. Class-wise precision, recall, specificity, F1 score, and ROC-AUC were additionally evaluated to provide a more comprehensive assessment of classification performance. These findings reflect performance under the evaluated experimental conditions. The proposed framework demonstrates promising performance for CT-based lung cancer classification by integrating FNLM denoising, conventional lung-region extraction, and transformer-based representation learning. However, because the evaluation relied on a single open-access dataset with image-level partitioning, the generalizability of the findings to independent patient populations and clinical settings remains uncertain. Further patient-disjoint evaluation, external validation using multi-institutional datasets, and prospective clinical assessment are required before its potential clinical utility can be established.