Due to the increased awareness of lung cancer, researchers have created many algorithms that can recognise the disease in its early stages using a variety of Machine Learning (ML) techniques. Clinicians can manage incidental or screen-found ambiguous pulmonary nodules with the help of machine learning-based models for lung cancer prediction. Such methods might be able to lower the variability in nodule classification, enhance decision making, and eventually decrease the proportion of benign nodules that do not need to be followed. This study proposes a novel lung cancer detection method based on Magnetic Resonance Imaging (MRI). Using ML to classify features in MRI scans, this technology is useful for the early detection of lung cancer. The performance was further enhanced using featureselection methodologies. The images were divided into segments using the FBSO feature selection method, and deep learning techniques were used to analyze the three standard datasets, S1, S2 and S3. In this investigation, 98.9% classifier optimality and 96.7% accuracy were attained. This new approach demonstrated excellent dependability and was found to be the most effective classifier system compared with previous studies.