Spaces:
Sleeping
Sleeping
title: Lung Cancer Detection | |
emoji: 👀 | |
colorFrom: purple | |
colorTo: purple | |
sdk: gradio | |
sdk_version: 4.37.2 | |
app_file: app.py | |
pinned: false | |
license: mit | |
# LUNGAI: Lung Cancer Detection Model | |
## Project Overview | |
LungAI is a deep learning project aimed at detecting and classifying lung cancer from CT scan images. The model can differentiate between cancerous and non-cancerous lung tissue, as well as classify specific types of lung cancer. | |
4x hackathon award winner - out of 1,500 total competitors. | |
[](https://github.com/DorsaRoh/LungAI) | |
[](https://huggingface.co/spaces/dorsar/lung-cancer-detection) | |
## Model Performance | |
- 98% accuracy in distinguishing between cancerous and non-cancerous cases | |
- 83% accuracy in differentiating between four specific types of lung conditions: | |
- Adenocarcinoma: 82% F1-score | |
- Large Cell Carcinoma: 85% F1-score | |
- Normal (non-cancerous): 98% F1-score | |
- Squamous Cell Carcinoma: 76% F1-score | |
<i>This project represents the newest version, now using PyTorch.</i> | |
## Repository Structure | |
- `Architecture/`: Contains the core model scripts | |
- `architecture.py`: Defines the model architecture | |
- `preprocess.py`: Data preprocessing utilities | |
- `test.py`: Script for testing the model | |
- `Model/`: Stores trained model files | |
- `lung_cancer_detection_model.onnx`: ONNX format of the trained model | |
- `lung_cancer_detection_model.pth`: PyTorch weights of the trained model | |
- `Data/`: (Not included in repository) Directory for storing the dataset | |
- `Processed_Data/`: (Not included in repository) Directory for preprocessed data | |
- `assets/`: Additional project assets | |
- `requirements.txt`: List of Python dependencies | |
## Setup and Usage | |
### Step 1: Install Dependencies | |
First, ensure you have Python installed. Then, install the required Python libraries using the following command: | |
```bash | |
pip install -r requirements.txt | |
``` | |
### Step 2: Train the Model (Optional) | |
Run the training script to train the model. | |
**It will be saved as `.pth` and `.onnx` files** | |
```bash | |
python Architecture/architecture.py | |
``` | |
### Step 3: Run the Model | |
Run the model by running the following file: | |
```bash | |
python Architecture/run.py | |
``` | |
### Notes | |
- Make sure your dataset is structured correctly under the Processed_Data directory with subdirectories for training, validation, and testing sets. | |
- The model training script expects the dataset to be in the Processed_Data directory. Ensure that the data transformations and directory paths are correctly set up in architecture.py. | |
### Contributing | |
If you would like to contribute to this project, please fork the repository and submit a pull request. We welcome improvements, bug fixes, and new features. | |
## Connect with Me | |
[](https://github.com/DorsaRoh) | |
[](https://twitter.com/Dorsa_Rohani) | |
[](https://www.linkedin.com/in/dorsarohani/) |