Vedant Misra
Predicting Lung Cancer and NSCLC Types with Data Mining Classifiers

Research

Predicting Lung Cancer and NSCLC Types with Data Mining Classifiers

10 min read

Machine LearningResearchHealthcare AISVMXGBoostIEEE

I'm pleased to share our research published at the 2022 IEEE Bombay Section Signature Conference (IBSSC), co-authored with Riya Adsul and Saumya Pailwan at NMIMS University.

Download the full paper (PDF)

DOI: 10.1109/IBSSC56953.2022.10037478

Abstract

Lung cancer is one of the most common types of cancer and the leading cause of cancer-related death in humans. Early diagnosis is critical — survival rates improve dramatically when the disease is caught before symptoms manifest. This research examines lung cancer symptoms and risk factors using Machine Learning algorithms to identify lung cancer patients from healthy individuals, and further distinguishes the three pathological subtypes of Non-Small Cell Lung Cancer (NSCLC). The optimal data mining strategy is determined by comparing classifier performance across two independent datasets. For the binary detection task, SVM achieves the best results; for NSCLC subtype classification, XGBoost performs best.

Introduction

Lung carcinoma causes uncontrolled cell growth in lung tissue and accounts for disproportionate cancer mortality worldwide — particularly in North America, Europe, and East Asia. Long-term tobacco use accounts for approximately 85% of cases, with radon gas, asbestos, and air pollution also contributing.

Lung cancer is classified into two primary types:

  • NSCLC (Non-Small Cell Lung Cancer): The more common and slower-growing type, with three subtypes — Adenocarcinoma, Squamous Cell Carcinoma, and Large Cell Carcinoma.
  • SCLC (Small Cell Lung Cancer): Rarer but more aggressive, typically originating near the bronchi.

The goal of this paper is two-fold: (1) detect the presence of lung cancer from symptom and risk factor data, and (2) classify the type of NSCLC if cancer is detected. This sequential pipeline addresses a gap in the literature — most prior work handles only one of these tasks.

Datasets

Dataset 1 — Binary Detection (data.world / UCI)

Used to distinguish lung cancer patients from healthy individuals.

AttributeValues
GenderM / F
AgeNumeric
SmokingYES=2, NO=1
Yellow FingersYES=2, NO=1
AnxietyYES=2, NO=1
WheezingYES=2, NO=1
Alcohol ConsumptionYES=2, NO=1
CoughingYES=2, NO=1
Shortness of BreathYES=2, NO=1
Swallowing DifficultyYES=2, NO=1
Chest PainYES=2, NO=1
Lung Cancer (target)YES / NO
  • Instances: 284 | Attributes: 16 (15 predictive + 1 class)
  • Preprocessing: Class imbalance corrected via minority upsampling (random_state=4, n_samples=269)
  • Top correlating features: Allergy, Alcohol Consumption, Swallowing Difficulty

Dataset 2 — NSCLC Subtype Classification (UCI)

Used to classify the three pathological subtypes: Lung Adenocarcinoma, Squamous Cell Carcinoma, and Large Cell Lung Cancer.

  • Instances: 170 | Attributes: 57 (56 predictive + 1 class)
  • Data type: Nominal integer values (0–3), including tumor marker levels and TNM staging
  • Preprocessing: Dataset is balanced — no resampling required

Methodology

Classifiers Evaluated

Twelve classifiers were trained and compared on both datasets:

#AlgorithmKey Hyperparameters
0Linear Discriminant Analysis (LDA)Default
1Logistic Regressionsolver=lbfgs, max_iter=200
2AdaBoostDefault
3SVCC=1, gamma=1, kernel=rbf
4Random Forestmax_depth=5
5Decision Treecriterion=entropy
6Gaussian Naïve BayesDefault
7K-Nearest Neighborsn_neighbors=7
8Gradient Boostinglearning_rate=0.01, random_state=1
9XGBoostlearning_rate=0.01, random_state=1
10Voting ClassifierDecision Tree + SVC
11MLP Classifierhidden_layer_sizes=800, random_state=50

Evaluation Protocol

  • Train/test split: 80/20, with StandardScaler for scale-free features
  • Metrics: Test accuracy, training accuracy, precision, recall, F1 score
  • Cross-validation: 4-fold cross-validation on the best classifier (SVC) with decision_function_shape='ovr'

Results

Dataset 1 — Binary Lung Cancer Detection

AlgorithmTest AccuracyTrain Accuracy
LDA87.96%91.6%
Logistic Regression87.04%91.4%
AdaBoost92.59%96.5%
SVC79.81% (raw) → 98.14% (CV)99.7%
Random Forest91.67%94.4%
Decision Tree95.37%99.7%
Gaussian NB88.89%86.1%
KNN85.19%88.3%
Gradient Boosting86.11%90.7%
XGBoost86.11%89.7%
Voting Classifier95.37%99.7%
MLP Classifier91.67%90.9%

Winner: SVC — 98.14% test accuracy after 4-fold cross-validation (precision 96.3%, recall 100%, F1 98.1%). Cross-validation score: 0.986.

Dataset 2 — NSCLC Subtype Classification

AlgorithmTest AccuracyTrain Accuracy
LDA71.43%87.5%
Logistic Regression57.14%100%
AdaBoost42.86%70.8%
SVC57.14%95.83%
Random Forest57.14%100%
Decision Tree57.14%100%
Gaussian NB28.57%91.66%
KNN71.43%66.6%
Gradient Boosting71.43%100%
XGBoost85.71%95.8%
Voting Classifier71.43%100%
MLP Classifier71.43%100%

Winner: XGBoost — 85.71% test accuracy, outperforming all other classifiers on NSCLC subtype classification.

Discussion

The results validate the sequential detection-then-classification pipeline:

Why SVM wins on Dataset 1: SVM's decision boundary complexity is determined by support vectors rather than data dimensionality. For symptom-based binary classification where samples are linearly separable in higher-dimensional space (via the RBF kernel), SVM consistently outperforms ensemble methods on this dataset size.

Why XGBoost wins on Dataset 2: The NSCLC subtype dataset has 57 attributes and only 170 instances — a high-dimensional, sparse regime. XGBoost handles missing values natively, is robust to unscaled data and outliers, and its gradient-boosted decision trees capture complex feature interactions between tumor marker levels and TNM staging that simpler linear models miss.

Key tradeoffs across classifiers:

  • Naïve Bayes is fast but assumes feature independence — a poor fit for correlated clinical symptoms
  • Multilayer networks handle complex numerical patterns but are the most computationally expensive and require careful tuning
  • Random Forest addresses decision tree overfitting via bagging but plateaued at ~57% on Dataset 2
  • Gradient Boosting and Voting Classifier achieve competitive accuracy but are outperformed by XGBoost on both datasets when hyperparameters are tuned

Conclusion

This study demonstrates that cancer can be detected and subtyped from tabular symptom and risk factor data alone — without CT scans. The SVM-then-XGBoost pipeline achieves clinically meaningful accuracy (98.14% for detection, 85.71% for subtyping) that could support pre-diagnosis screening, reducing unnecessary and costly imaging procedures.

Future directions include integrating CT scan imagery with symptom data via multimodal deep learning, applying text mining to unstructured clinical notes, and evaluating the pipeline prospectively on held-out clinical cohorts.


Published at the 2022 IEEE Bombay Section Signature Conference (IBSSC). Co-authored with Riya Adsul and Saumya Pailwan, NMIMS University, Mumbai.