With its increasing global prevalence, lung cancer remains a critical health concern. Despite the advancement of screening programs, patient selection and risk stratification pose significant challenges. This study addresses the pressing need for early detection through a novel diagnostic approach that leverages innovative image processing techniques. The urgency of early lung cancer detection is emphasized by its alarming growth worldwide. While computed tomography (CT) surpasses traditional X-ray methods, a comprehensive diagnosis requires a combination of imaging techniques. This research introduces an advanced diagnostic tool implemented through image processing methodologies. The methodology commences with histogram equalization, a crucial step in artifact removal from CT images sourced from a medical database. Accurate lung CT image segmentation, which is vital for cancer diagnosis, follows. The Otsu thresholding method and optimization, employing Colliding Bodies Optimization (CBO), enhance the precision of the segmentation process. A local binary pattern (LBP) is deployed for feature extraction, enabling the identification of nodule sizes and precise locations. The resulting image underwent classification using the densely connected CNN (DenseNet) deep learning algorithm, which effectively distinguished between benign and malignant tumors. The proposed CBO+DenseNet CNN exhibits remarkable performance improvements over traditional methods. Notable enhancements in accuracy (98.17%), specificity (97.32%), precision (97.46%), and recall (97.89%) are observed, as evidenced by the results from the fractional randomized voting model (FRVM). These findings highlight the potential of the proposed model as an advanced diagnostic tool. Its improved metrics promise heightened accuracy in tumor classification and localization. The proposed model uniquely combines Colliding Bodies Optimization (CBO) with DenseNet CNN, enhancing segmentation and classification accuracy for lung cancer detection, setting it apart from traditional methods with superior performance metrics.