Background: Lung cancer is a deadly disease. An early diagnosis can significantly improve the patient survival and quality of life. One potential solution is using deep learning (DL) algorithms to automate the diagnosis using patient computed tomography (CT) scans. However, the limited availability of training data and the computational complexity of existing algorithms, as well as their reliance on high-performance systems, limit the potential of DL algorithms. To improve early lung cancer diagnoses, this study proposes a low-cost convolutional neural network (CNN) that uses a Mavage pooling technique to diagnose lung cancers. Methods: The DL-based model uses five convolution layers with two residual connections and Mavage pooling layers. We trained the CNN using two publicly available datasets comprised of the IQ_OTH/NCCD dataset and the chest CT scan dataset. Additionally, we integrated the Mavage pooling in the AlexNet, ResNet-50, and GoogLeNet architectures to analyze the datasets. We evaluated the performance of the models based on accuracy and the area under the receiver operating characteristic curve (AUROC). Results: The CNN model achieved a 99.70% accuracy and a 99.66% AUROC when the scans were classified as either cancerous or non-cancerous. It achieved a 90.24% accuracy and a 94.63% AUROC when the scans were classified as containing either normal, benign, or malignant nodules. It achieved a 95.56% accuracy and a 99.37% AUROC when lung cancers were classified. Additionally, the results indicated that the diagnostic abilities of AlexNet, ResNet-50, and GoogLeNet were improved with the introduction of the Mavage pooling technique. Conclusions: This study shows that a low-cost CNN can effectively diagnose lung cancers from patient CT scans. Utilizing Mavage pooling technique significantly improves the CNN diagnostic capabilities.