The use of Vision Transformers in this study allows lung cancer to be classified from CT images, achieving an accuracy of 98.18%, at 1,190 scans. The model preserved a satisfactory level of robustness, with accuracy levels between (80–88%) with noisy and blurred images, against standard convolutional neural network (CNN) models, in consumer health diagnostic applications.