Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Colon and Lung Cancer Prediction folder #377

Merged
merged 3 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Colon-And-Lung-Cancer-Type-Prediction/Dataset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Lung and Colon Cancer Histopathological Images Dataset
This dataset is sourced from Kaggle and is provided by the user andrewmvd on Kaggle. The original dataset can be found at the following Kaggle link:

https://www.kaggle.com/datasets/andrewmvd/lung-and-colon-cancer-histopathological-images

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class_index,class,height,width
0,Colon Adenocarcinoma,224,224
1,Colon Benign Tissue,224,224
2,Lung Adenocarcinoma,224,224
3,Lung Benign Tissue,224,224
4,Lung Squamous Cell Carcinoma,224,224

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions Colon-And-Lung-Cancer-Type-Prediction/Model/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
os==<your_os_version>
time==<your_time_version>
shutil==<your_shutil_version>
pathlib==<your_pathlib_version>
itertools==<your_itertools_version>
opencv-python==4.5.1
numpy==1.19.5
pandas==1.1.5
seaborn==0.11.1
matplotlib==3.4.3
scikit-learn==0.24.2
tensorflow==2.4.1
48 changes: 48 additions & 0 deletions Colon-And-Lung-Cancer-Type-Prediction/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Lung and Colon Cancer Detection
This project aims to detect lung and colon cancer from histopathological images using deep learning techniques. It includes a deep neural network model, data preprocessing, training, evaluation, and model saving. The code is structured to provide a comprehensive solution for cancer detection.

# Table of Contents
Introduction
Project Structure
Getting Started
Data Preparation
Model Architecture
Training
Evaluation
Saving the Model

# Introduction
Lung and colon cancer detection is a critical task in the field of medical image analysis. Early and accurate diagnosis can significantly improve patient outcomes. This project uses deep learning to classify histopathological images as either cancerous or benign, contributing to the early detection of these cancers.

# Project Structure
data: This directory contains the dataset of histopathological images. src: This directory contains the Python code for data preprocessing, model creation, training, and evaluation. saved_models: This directory is where trained models and their weights are saved. requirements.txt: A list of Python dependencies for reproducing the environment.

# Getting Started
To get started with this project, follow these steps: Clone this repository to your local machine. Install the required dependencies by running pip install -r requirements.txt. Organize your dataset into the data directory, following the structure provided in the project. Run the code for data preprocessing and model training, following the instructions in the source code. Evaluate the model's performance on the test dataset. Save the trained model for future use.

# Data Preparation
Before training the model, ensure that your dataset is organized correctly in the data directory. The dataset should be split into train, validation, and test sets if available. The code for data preprocessing will load and augment the images for training.

# Model Architecture
The deep neural network model used for cancer detection consists of several convolutional and pooling layers. The model architecture is defined in the source code within the create_model function.

# Training
To train the model, execute the training script provided in the src directory. You can adjust hyperparameters such as batch size, learning rate, and the number of epochs to fine-tune the model's performance.

# Evaluation
After training, the model's performance can be evaluated using the validation and test datasets. The code generates accuracy, loss, and a confusion matrix to assess the model's effectiveness in cancer detection.

# Visualization
![dataset](https://github.com/adi271001/DL-Simplified/assets/67856422/ddeec067-df03-49aa-bd24-5071a69332b3)
![training](https://github.com/adi271001/DL-Simplified/assets/67856422/d8d4ff4b-40f0-4a9a-99f4-25086ab5990e)
![plot_training_testing](https://github.com/adi271001/DL-Simplified/assets/67856422/c1f7d305-ad94-45c4-8fc0-4d4e66ca441b)
![accuracy](https://github.com/adi271001/DL-Simplified/assets/67856422/9298bfe0-890b-4321-9b7d-2f2d156c0637)
![classification_report](https://github.com/adi271001/DL-Simplified/assets/67856422/f6df8216-eb6b-4422-947f-3dc0ce8fd09a)
![confusion_matrix](https://github.com/adi271001/DL-Simplified/assets/67856422/649c373d-64ff-417a-9bd0-04739cc962e2)


# Results
The model achieved an accuracy of 99.6399, Graphs are attached which shows that the model is neither overfitted nor underfitted

# Saving the Model
The trained model and its weights can be saved for future use. You can easily save both the model architecture and the learned weights using the provided code. The saved model can then be loaded and used for making predictions on new data.
12 changes: 12 additions & 0 deletions Colon-And-Lung-Cancer-Type-Prediction/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
os==<your_os_version>
time==<your_time_version>
shutil==<your_shutil_version>
pathlib==<your_pathlib_version>
itertools==<your_itertools_version>
opencv-python==4.5.1
numpy==1.19.5
pandas==1.1.5
seaborn==0.11.1
matplotlib==3.4.3
scikit-learn==0.24.2
tensorflow==2.4.1