This project focuses on building a deep learning-based system to detect lung cancer from CT scan images. The goal is to leverage Convolutional Neural Networks (CNN) and transfer learning models such as ResNet50, VGG16, and MobileNetV2 to assist in early cancer detection and classification.
- Handles large-scale CT scan image datasets
- Supports multiple CNN architectures (ResNet50, VGG16, MobileNetV2)
- Detects and classifies cancerous vs non-cancerous lung tissues
- Visualizes model performance (accuracy, confusion matrix, loss curves)
- Includes trained models for quick inference
- Modular code β easy to extend or retrain with custom datasets
LungCancerDetection/
β
βββ data/ # Dataset (not included in repo)
β βββ train/
β βββ test/
β
βββ models/ # Saved trained models (.pkl / .h5)
β βββ model_resnet50.pkl
β βββ model_vgg16.pkl
β
βββ notebooks/ # Jupyter notebooks for training & analysis
β βββ lung_cancer_training.ipynb
β
βββ src/ # Python source code
β βββ data_preprocessing.py
β βββ train_model.py
β βββ predict.py
β
βββ requirements.txt # Python dependencies
βββ README.md # Project documentation
| Model | Description | Framework |
|---|---|---|
| CNN (Custom) | Basic convolutional architecture built from scratch | TensorFlow/Keras |
| ResNet50 | Deep residual network (50 layers) for high accuracy | TensorFlow/Keras |
| VGG16 | Simpler deep CNN architecture | TensorFlow/Keras |
| MobileNetV2 | Lightweight CNN for mobile deployment | TensorFlow/Keras |
- Language: Python
- Libraries: TensorFlow, Keras, NumPy, OpenCV, Matplotlib, Scikit-learn
- IDE: Jupyter Notebook / VS Code
- Frameworks: Deep Learning (CNN, Transfer Learning)
-
Clone the repository
git clone https://github.com/gschandrasekhar/LungCancerDetection.git cd LungCancerDetection -
Create a virtual environment (optional)
python -m venv venv venv\Scripts\activate # On Windows
-
Install dependencies
pip install -r requirements.txt
-
Run the notebook or script
jupyter notebook notebooks/lung_cancer_training.ipynb
or
python src/train_model.py
| Model | Accuracy | Notes |
|---|---|---|
| CNN (Custom) | 85% | Baseline model |
| VGG16 | 91% | Moderate accuracy, higher training time |
| ResNet50 | 94% | Best performing model |
| MobileNetV2 | 92% | Lightweight, good trade-off |
(Results may vary depending on dataset and training parameters.)
- Deploy model as a web app using Streamlit or Flask
- Integrate Grad-CAM visualization for explainability
- Add real-time prediction from uploaded CT images
- Optimize for mobile and edge devices
- Kaggle: Lung Cancer CT Scan Dataset
- Research Paper: βDeep Learning for Lung Cancer Detection Using CT Scansβ
- TensorFlow / Keras Documentation
Chandra Sekhar G π§ Email Me π LinkedIn π» GitHub
This project is licensed under the MIT License β feel free to use and modify for research or learning purposes.