Journal of Artificial Intelligence and Metaheuristics

Lung Cancer Prediction from Smoking Cause by Machine Learning Classification Models

Nada M. Sallam, P. K. Dutta
Volume 9, Issue 1, pp. 30–36 (2025)
DOI: https://doi.org/10.54216/JAIM.090105
Online: https://americaspg.com/journal/28/article/3522

Abstract

The incidence of lung cancer varies in males and females, which occurs due to the abnormal and uncontrolled growth of cells in the lungs. It has a greater predilection in males as compared to females. Smoking is the most important risk factor for lung cancer. It causes serious breathing issues and also affects other organs. It increases the mortality rate both in young adults as well as in the older age group. Therefore, there is improvement in medical technologies to facilitate specialized diagnosis and treatment, but the mortality has not been controlled to a satisfactory extent. It is important to take preventive measures and precautions at the initial stages. Machine learning brings various advancements to the medical sector due to which various diseases can be detected at an early stage. In this paper, we presented different machine learning classifier techniques used for the classification of the present lung cancer data in the UCI machine learning repository as benign and malignant. The dataset is divided into cancerous and non-cancerous by converting the input data into binary form and using the classifier technique in the Weka tool. This specifically includes classifiers used: Logistic Regression, Random Forest, Support Vector Machine (SVM), k-Nearest Neighbors (k-NN), Decision Trees, and Naïve Bayes. In addition, we study the effect of data preprocessing methods on our prediction accuracy, such as data normalization and feature selection. The study seeks to help develop various reliable resources for lung cancer identification, which are critical for diagnosing and treating patients in a timely manner and improving their outcomes.

Keywords: Lung cancer prediction; Machine learning classifiers; Smoking risk factors; Medical data preprocessing; Early cancer diagnosis

1. INTRODUCTION

X-rays to aid radiologists in accurate and early diagnosis [2]. This capability allows patient treatment to be determined with high accuracy and in a shorter time compared to traditional tools [2]. Moreover, ML contributes to the development of molecular markers for lung cancer patients. By integrating genotype and phenotype data, personalized algorithms effectively search for the most optimal treatment plans while excluding futile therapies [3]. This approach not only increases the efficacy of the treatment but also decreases dangerous side effects

Artificial Intelligence, or specifically termed as Machine Learning (ML), has taken a frontline position in availing medical practice with efficient and effective tools for improved diagnosis and treatment of diseases such as lung cancer [1]. A key feature of ML algorithms is their capability to solve complex data analyses within relatively short periods and highlight descriptive features important for making timely diagnoses [1]. For instance, algorithms identify cancer kernels and tumors in visual anatomy such as CAT scans and and costs, which traditional healthcare services cannot overcome [4]. Beyond diagnosis and therapy, ML plays an important role in risk assessment and prognosis prediction [5]. EHR-based models can estimate an individual’s lung cancer risk from clinical records and smoking-related information, helping identify high-risk groups for preventive screening [5]. This can concentrate resources on early detection and treatment to prevent malignant tumors [6, 7]. ML also assists in drug identification and development. By analyzing big data, it is possible to predict the nature, efficiency, and dosage of particular drugs using ML models [8]. This reduces the time required for drug development, lowers costs for pharmaceutical companies, and provides exclusive treatments for specific cancer types [9]. However, challenges remain in the implementation of ML in lung cancer care. The quality of training data shapes ML model accuracy and reliability [10]. Bias in datasets leads to biased predictions and amplifies healthcare disparities [11]. Hence, addressing the problem of racially and ethnically imbalanced data is crucial for ensuring fair ML healthcare applications [11]. Furthermore, the explainability of ML model results, especially from deep learning algorithms, is a significant barrier to implementation. Clinicians and patients often struggle to understand the reasoning behind predictions, leading to mistrust [12]. Explainable AI (XAI) techniques are being developed to address this, enhancing confidence among healthcare professionals and patients by providing clear insights into predictions [13]. Emerging wearable health devices powered by ML are providing new options for patient monitoring [14]. These devices track physiological factors, respiratory patterns, and other features, offering relevant alerts for the treatment process [15]. These systems improve patient outcomes and reduce healthcare costs by facilitating early identification of risk factors and disease progression [16]. ML also integrates data from imaging, genetics, proteomics, and clinical records, enhancing the understanding of diseases and the development of treatments. Natural Language Processing (NLP) complements ML by extracting structured information from unstructured clinical notes, enriching clinical practice and research [17]. However, risks like patient data privacy and minority data accuracy must be managed appropriately. Collaboration among researchers, clinicians, and policymakers is necessary to determine best practices for ML implementation in real-world scenarios. Due to advancements in ML technologies, diagnosing and treating lung cancer has become more efficient. The analysis demonstrates the potential to diagnose lung cancer in its earliest stages and provide personalized treatment approaches, improving patients’ quality of life.

2. LITERATURE REVIEW

In this paper, we provide a summary of the most recent and relevant research works focused on predicting lung cancer occurrence using machine learning techniques and models. The primary goal of the study [1] is to establish early detection of lung cancer by evaluating the performance of various classification algorithms. The authors used Support Vector Machine (SVM), Naive Bayes, Decision Tree, and Logistic

Regression. Logistic Regression achieved an accuracy of 96.9% for the UCI lung cancer dataset, while SVM achieved a higher accuracy of 99.2%. The study [2] aimed to enhance performance, measured by RMSE, and predict lung cancer survival time in terms of months (≤6, 7–24, or > 24). The Random Forest classification model was integrated with three regression models (Gradient-Boosted Machines and General Linear Regression). Random Forest was most effective for survival times ≤6 months (RMSE 10.52) and > 24 months (RMSE 20.51), while Gradient-Boosted Machines were significant for survival times between 7–24 months (RMSE 15.65). The research in [3] evaluates the efficacy of machine learning methods for lung cancer diagnosis using a dataset of 56 features and 32 samples. Preprocessing techniques such as normalization, dimensionality reduction, and feature selection were applied before running six classification algorithms: Decision Tree (DT), Random Forest (RF), k-Nearest Neighbors (k-NN), Logistic Regression (LR), Support Vector Machines (SVM), and Naive Bayes (NB). k-NN achieved the highest accuracy with 83%, outperforming Naive Bayes (87%) and Decision Tree (71%). The study [5] developed a three-year lung cancer risk model using electronic health records from more than 4.7 million individuals. The model was externally validated, achieved an area under the curve of 0.76, and identified age, smoking, race, ethnicity, and chronic obstructive pulmonary disease among its leading predictors. In [18], machine learning methods were applied to blood transcriptome data to distinguish current from former smokers. Feature selection and ranking identified smoking-associated transcript isoforms, and decision-tree rules were used to describe the resulting classifications. The study [19] proposed an interpretable lung cancer detection system using Decision Tree, Logistic Regression, Random Forest, and Naive Bayes classifiers. Logistic Regression and Random Forest each achieved 97% accuracy, and SHAP and LIME were used to explain model predictions. The study [6] analyzed symptom e-questionnaire data separately for never, former, and current smokers using stochastic gradient boosting. Its results demonstrate that prediction performance and influential variables can differ across smokingstatus groups. The research in [6] focused on predicting smoking cessation using models such as Logistic Regression (LoR), CART, ANN, NB, RF, k-NN, and SVM. ANN achieved the highest sensitivity (70.4%), specificity (56.7%), and accuracy (64%), providing general practitioners with reliable estimates for individualized therapies. The work in [7] proposed a deep learning model for lung cancer prognosis using data from the Taipei Medical University Clinical Research Database and the Taiwan Cancer Registry. Using nine machine learning algorithms, ANN showed the highest accuracy with an AUC of 0.89. Significant biomarkers included cancer stage, age, smoking habits, and EGFR gene status. Authors in [8] utilized a public dataset for lung cancer prognosis using 10-fold cross-validation. The Rotation Forest model achieved the highest accuracy of 97.1% and AUC of 99.3%. Research in [9] proposed an ensemble classifier based on patient symptoms and risk factors. The ensemble model outperformed individual classifiers, demonstrating improved accuracy in lung cancer pre-diagnosis. The study [10] explored interpretability methods for three models (BACH, PLCOm2012, and LCART) and used Explainable AI (xAI) techniques to highlight significant features. This enhanced model transparency and confidence in predictions. In [11], researchers analyzed data from 1,000 patients with 23 features. Classifiers such as Naive Bayes, k-NN, Decision Tree, and Random Forest achieved 100% accuracy on the full dataset and 98.7% on a reduced feature set. The work in [12] tested classifiers (k-NN, Naive Bayes, RBF, and J48) on the UCI repository dataset. RBF was the most accurate, achieving 81.25% accuracy. Finally, [13] compared Gradient Boosted Trees (GBT), Random Forest, Majority Voting, and Neural Network models.

GBT achieved the highest accuracy of 90%, highlighting its potential for lung cancer diagnosis. Table 1 summarizes the recent research related to lung cancer prediction.

3. MATERIAL AND METHODS

3.1 Data Acquisition

The data employed in this work is sourced from a public dataset on lung cancer, available through the UCI Machine Learning Repository. The dataset contains information about patient characteristics such as age, gender, smoking status, and other relevant variables. A link to the dataset is available on Kaggle [15]. Figure 1 shows the histogram of the variables within the tested dataset. Figure 2 presents the histogram of the age variable in more detail. Figure 3 provides a correlation analysis of the variables with respect to one another.

Table 1. Summary of recent research on lung cancer prediction.
Table 1. Summary of recent research on lung cancer prediction.

3.2 Data Preprocessing

Due to the presence of missing values in the dataset, data imputation techniques were applied. Alternatively, instances with significant missing values were filtered out. To ensure uniformity, all features were normalized or standardized to a comparable range. This step prevents large or small absolute values of specific features from influencing the model disproportionately. In cases where the number of features is significantly larger than the number of instances, feature selection techniques were employed. These methods identify a subset of features containing the maximum entropy, likely increasing model accuracy while mitigating interpretability issues.

3.3 Model Selection

This section discusses the machine learning classification models selected for their known performance in medical diagnosis and prediction: • Support Vector Machines (SVMs): SVMs are highly effective at identifying the best separation boundary (hyperplane) by focusing on the data points closest to the boundary (support vectors). This method maximizes the margin, making SVMs particularly strong for high-dimensional datasets. However, they can be computationally expensive for large datasets, especially those with numerous dimensions [16].

4. EXPERIMENTAL RESULTS

4.1 Dataset Preparation

The dataset was divided into training and testing sets. Selected models were trained on the training set and evaluated on the test data using performance metrics such as recall, accuracy, F1-score, and precision [7]. Two key parameters

Figure 1. Histogram of the variables within the tested dataset.
Figure 1. Histogram of the variables within the tested dataset.

considered were the number of iterations and the use of crossvalidation techniques, such as k-fold cross-validation, to improve performance estimates. The results were evaluated by comparing models based on chosen metrics, and the best-performing models were identified. Models were ranked by performance, interpretability, and computational efficiency. The impact of different preprocessing techniques on model accuracy was also explored. If imaging data, such as computed tomography (CT), were present in the dataset, deep learning models like Convolutional Neural Networks (CNNs) were employed for analysis. Model explainability was explored using techniques like LIME and SHAP to understand feature importance and build trust in the models’ predictions.

4.2 Performance Metrics

The performance metrics used in this work are defined as follows: accuracy measures overall correctness but may be misleading with imbalanced data; F1-score balances precision and recall, especially for imbalanced datasets; precision focuses on avoiding false positives; recall (sensitivity) focuses on capturing all true positives; and ROC-AUC (Receiver Operating Characteristic–Area Under Curve) evaluates the model’s ability to discriminate between classes, providing a comprehensive measure of performance.

Their standard mathematical forms are:

Accuracy = TP+TN TP+TN +FP+FN , (1)

Precision = TP TP+FP, (2)

Recall = TP TP+FN , (3)

F1-Score = 2PrecisionRecall

Precision+Recall, (4)

ROC-AUC =

0 TPR(u)du, u = FPR. (5)

Here, TP, TN, FP, and FN denote true positives, true negatives, false positives, and false negatives, respectively; TPR and FPR denote the true-positive and false-positive rates.

4.3 Results and Discussion

The performance results of different models for the tested dataset are shown in Table 2. Based on multiple metrics, the SGD Classifier demonstrated the best overall performance, offering high accuracy, F1-Score, and ROC-AUC, while maintaining strong recall. Logistic Regression was a close second.

Figure 2. Histogram of the age variable within the tested dataset.
Figure 2. Histogram of the age variable within the tested dataset.
Figure 3. Correlation analysis of the variables within the tested dataset.
Figure 3. Correlation analysis of the variables within the tested dataset.
Table 2. The output results of different models for the tested dataset.
Table 2. The output results of different models for the tested dataset.

Figure 4 shows the accuracy summary of different models for the tested dataset.

Figure 4. The output accuracy summary of different models for the tested dataset.
Figure 4. The output accuracy summary of different models for the tested dataset.

5. CONCLUSION AND DISCUSSION

Machine Learning (ML) has revolutionized the diagnosis, treatment, and management of lung cancer, demonstrating its potential as a transformative technology in the healthcare sector. The future of lung cancer research and treatment lies in the promising capabilities of ML, including its ability to analyze big data and derive meaningful insights. The two most common applications of ML in lung cancer are early diagnosis and detection. By applying advanced ML algorithms to medical imagery, such as CT scans and X-rays, radiologists can accurately identify potentially cancerous nodules and tumors, enabling timely intervention and significantly improving patient outcomes. Additionally, ML plays a pivotal role in personalized medicine by leveraging patientspecific data, including genetic predispositions, lifestyle, and treatment history, to define optimal treatment plans and maximize therapeutic efficacy. This personalized approach not only improves treatment outcomes but also minimizes unnecessary side effects and healthcare costs. Beyond diagnosis and treatment, ML extends to risk assessment and prognosis prediction. Algorithms can identify individuals at higher risk of developing lung cancer, enabling targeted screening and reducing risk factors. ML can also predict disease progression, providing valuable insights for treatment regimens and patient counseling. Despite these advancements, challenges remain. The quality and nature of training datasets are critical for developing effective ML models. Biased data can lead to inaccurate predictions and exacerbate health inequalities. Therefore, diverse and unbiased datasets are essential for the equitable deployment of ML in healthcare. Another challenge is the “black box” nature of many ML models, particularly deep learning algorithms. Their lack of transparency complicates adoption by clinicians and patients. Explainable AI (XAI) techniques are being developed to address this issue, offering insights into model operations and enhancing trust in their predictions. Ethical concerns, including data privacy, algorithm fairness, and the impact of automation on healthcare jobs, also need to be addressed. Strong regulatory frameworks are required to ensure the ethical and accountable use of ML technologies. Overall, ML offers immense potential for lung cancer research and patient care. By leveraging its ability to process and analyze big data, ML provides opportunities for early diagnosis, personalized treatment, risk assessment, and prognosis prediction, ultimately improving patient outcomes and quality of life.

References

[1] Radhanath Patra. Prediction of lung cancer using ma-chine learning classifier. In Computing Science, Commu-nication and Security: First International Conference, COMS2 2020, Revised Selected Papers, pages 132–142, 2020.

[2] M. I. Faisal, S. Bashir, S. Khan, Z. S. Khan, and F. H. Khan. An evaluation of machine learning classifiers and ensembles for early stage prediction of lung cancer. In Proceedings of the 2018 3rd International Conference on Emerging Trends in Engineering, Sciences and Tech-nology (ICEEST), pages 1–4, Thrissur, Kerala, India, 2018.

[3] James A. Bartholomai and Hermann B. Frieboes. Lung cancer survival prediction via machine learning regres-sion, classification, and statistical techniques. In Pro-ceedings of the 2018 IEEE International Symposium on Signal Processing and Information Technology, pages 632–637, 2018.

[4] Yasemin G"ultepe. Performance of lung cancer predic-tion methods using different classification algorithms. Computers, Materials & Continua, 67(2):2015–2028, 2021.

[5] Urmila Chandran, Jenna Reps, Robert Yang, Anil Vachani, Fabien Maldonado, and Iftekhar Kalsekar. Ma-chine learning and real-world data to predict lung cancer risk in routine care. Cancer Epidemiology, Biomarkers & Prevention, 32(3):337–343, 2023.

[6] E. Nemlander, A. Rosenblad, E. Abedi, S. Ekman, J. Hasselstrom, and L. E. Eriksson. Lung cancer predic-tion using machine learning on data from a symptom e-questionnaire for never smokers, former smokers and current smokers. PLOS ONE, 17(10):e0276703, 2022.

[7] J. C. Hsu, P.-A. Nguyen, P. T. Phuc, T.-C. Lo, M.-H. Hsu, M.-S. Hsieh, N. Q. K. Le, C.-T. Cheng, T. H.Chang, and C.-Y. Chen. Development and validation of novel deep-learning models using multiple data types for lung cancer survival. Cancers, 14(22):5562, 2022.

[8] E. Dritsas and M. Trigka. Lung cancer risk prediction with machine learning models. Big Data and Cognitive Computing, 6:139, 2022.

[9] K. Balachandran and R. Anitha. Ensemble based opti-mal classification model for pre-diagnosis of lung can-cer. In Proceedings of the 2013 Fourth International Conference on Computing, Communications and Net-working Technologies, pages 1–7, 2013.

[10] K. Kobyli´nska, T. Orłowski, M. Adamek, and P. Biecek. Explainable machine learning for lung cancer screening models. Applied Sciences, 12(4):1926, 2022.

[11] Huu-Huy Ngo and Hung Linh Le. A prediction model for lung cancer levels based on machine learning. In-ternational Journal of Open Information Technologies, 10(5):202, 2022.

[12] Saif Al Rumhi, Raza Hasan, Saqib Hussain, and Ji-tendra Pandey. Lung cancer prediction using machine learning techniques. In 6th Middle East College Student Research Conference Proceedings, 2023.

[13] Radhanath Patra. Prediction of lung cancer using ma-chine learning classifier. In Computing Science, Commu-nication and Security: First International Conference, COMS2 2020, Revised Selected Papers, pages 132–142, 2020.

[14] Shaghayegh Shajari, Kirankumar Kuruvinashetti, Amin Komeili, and Uttandaraman Sundararaj. The emergence of ai-based wearable sensors for digital health technol-ogy: A review. Sensors, 23(23):9498, 2023.

[15] Masoud Aliramezani, Charles Robert Koch, and Mahdi Shahbakhti. Modeling, diagnostics, optimization, and control of internal combustion engines via modern ma-chine learning techniques: A review and future direc-tions. Progress in Energy and Combustion Science, 88:100967, January 2022.

[16] Heng Chi, Yuyu Zhang, Tsz Ling Elaine Tang, Lu-cia Mirabella, Livio Dalloro, Le Song, and Glaucio H. Paulino. Universal machine learning for topology op-timization. Computer Methods in Applied Mechanics and Engineering, 375:112739, March 2021.

[17] Maryam Gholipour, Reza Khajouei, Parastoo Amiri, Sadrieh Hajesmaeel Gohari, et al. Extracting cancer concepts from clinical notes using natural language pro-cessing: A systematic review. BMC Bioinformatics, 24:405, 2023.

[18] FeiMing Huang, QingLan Ma, JingXin Ren, JiaRui Li, Fen Wang, Tao Huang, and Yu-Dong Cai. Identification of smoking-associated transcriptome aberration in blood with machine learning methods. BioMed Research In-ternational, 2023:5333361, 2023.

[19] Md. Sabbir Ahmed, Khondoker Nazia Iqbal, and Md. Golam Rabiul Alam. Interpretable lung cancer detection using explainable ai methods. In 2023 International Conference for Advancement in Technology (ICONAT), pages 538–543, Goa, India, 2023.

[20] Qi An, Saifur Rahman, Jingwen Zhou, and James Jin Kang. A comprehensive review on machine learning in healthcare industry: Classification, restrictions, oppor-tunities and challenges. Sensors, 23(9):4178, 2023.

[21] Shiqi Wang, Peng Xia, Keyu Chen, Fuyuan Gong, Hai-long Wang, Qinghe Wang, Yuxi Zhao, and Weiliang Jin. Prediction and optimization model of sustainable con-crete properties using machine learning, deep learning and swarm intelligence: A review. Journal of Building Engineering, 80:108065, December 2023.

[22] Morteza Esfandyari, Amin Amiri Delouei, and Ali Jalai. Optimization of ultrasonic-excited double-pipe heat exchanger with machine learning and pso. Inter-national Communications in Heat and Mass Transfer, 147:106985, October 2023.

[23] Binayak Kar, Widhi Yahya, Ying-Dar Lin, and Asad Ali. Offloading using traditional optimization and machine learning in federated cloud–edge–fog systems: A survey. IEEE Communications Surveys & Tutorials, 25(2):1199–1226, 2023.