BackgroundComputed tomography (CT) is an effective way to scan for lung cancer. The classification of lung nodules in CT screening is completely doctor dependent, which has drawbacks, including difficulty classifying tiny nodules, subjectivity, and high false-positive rates. In recent years, deep convolutional neural networks, a deep learning technology, have been shown to be effective in medical imaging diagnosis. Herein, we propose a deep convolutional neural network technique (TransUnet) to automatically classify lung nodules accurately.MethodsTransUnet consists of three parts: the transformer, the Unet, and global average pooling (GAP). The transformer encodes discriminative features via global self-attention modeling on CT image patches. The Unet, which collects context by constricting route, enables exact lunge nodule localization. The GAP categorizes CT images, assigning each sample a score. Python was employed to pre-process all CT images in the LIDI-IDRI, and the obtained 8,474 images (3,259 benign and 5,215 lung nodules) were used to evaluate the method's performance.ResultsThe accuracies of TransUnet in the training and testing sets were 87.90 and 84.62%. The sensitivity, specificity, and AUC of the proposed TransUnet on the testing dataset were 70.92, 93.17, and 0.862%, respectively (0.844–0.879). We also compared TransUnet to three well-known methods, which outperformed these methods.ConclusionThe experimental results on LIDI-IDRI demonstrated that the proposed TransUnet has a great performance in classifying lung nodules and has a great potential application in diagnosing lung cancer.