- Cancer is responsible for an estimated 10 million deaths worldwide each year, making it the second leading cause of death.
- In 2020, there were an estimated 19.3 million new cases of cancer worldwide, with the number expected to rise to 28.4 million by 2040.
- More specifically regarding Brain Tumor there were about 265,000 deaths worldwide in 2019, representing approximately 1.6% of all deaths from all causes.
- Additionally with regards to Leukemia it was estimated (in 2020) that there were approximately 417,000 deaths due to this worldwide, representing approximately 3% of all cancer deaths.
- Breast cancer is the most common cancer in women worldwide, accounting for 25% of all cancers in women.
- More than two-thirds of cancer deaths occur in Low and Middle Income Countries, despite these countries accounting for about one-third of the global population. This meant, that even though these countries suffer from a high number of cancer patients, their economic backgrounds hinder them from being detected early on.
This model classify differnt types of cancer, majorly we focused on classifying:-
Brain Tumor
Breast Cancer
We provide the users with a web interface (integrated with deep learning models) wherein they can upload the MRI or CT scans and in a matter of few seconds, they get to know whether they have Cancer (Brain Tumor/ Breast Cancer/ Leukemia). With this we aim to make it sustainable for doctors to detect a patient's cancer as well as for low income individuals to atleast get the fundamental right to basic healthcare, i.e. knowing if they have cancer and thus getting the required diagnosis.
💡Motivation
Brain tumors are a significant health concern worldwide, often leading to severe complications if not diagnosed early. The complexity and variability of MRI images make manual analysis time-consuming and prone to human error. Our solution leverages the power of deep learning to enhance diagnostic accuracy and speed, potentially improving patient outcomes.
🏗️Model Architecture
We employ the MobileNet architecture due to its efficiency and effectiveness in image classification tasks. The model is fine-tuned for our specific use case with the following layers:
Input Shape: (224, 224, 3) (standard size for MobileNet) Flatten Layer: Converts 2D matrices into a 1D vector Output Layer: A Dense layer with a sigmoid activation function for binary classification.
🛠️ Installation
To run this project, please ensure you have the following prerequisites installed:
🛠️ Code Snippet
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from keras.layers import Flatten,Dense
from keras.models import Model,load_model
from keras.applications.mobilenet import MobileNet,preprocess_input
import keras
base_model=MobileNet(input_shape=(224,224,3),include_top=False)
for layer in base_model.layers:
layer.trainable=False
X=Flatten()(base_model.output)
X=Dense(units=1,activation='sigmoid')(X)
model=Model(base_model.input,X)
model.summary()
📊 Results
🛠️ Technologies Used
🛠️ Code Snippet
📊 Results
🛠️ Technologies Used
We utilized the MobileNet architecture as our base model. Here’s a brief overview of the architecture used:
from keras.applications.mobilenet import MobileNet
from keras.layers import Flatten, Dense
from keras.models import Model
base_model = MobileNet(input_shape=(224, 224, 3), include_top=False)
X = Flatten()(base_model.output)
X = Dense(units=9, activation='softmax')(X) # 9 classes for multi-class classification
model = Model(inputs=base_model.input, outputs=X)
model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])
🛠️ Installation
🛠️ Code Snippet
from keras.callbacks import ModelCheckpoint
# Define ModelCheckpoint to save the best model
checkpoint = ModelCheckpoint('best.keras', monitor='val_accuracy', mode='max', save_best_only=True, verbose=1)
# Train the model
history = model.fit(
train_data,
steps_per_epoch=len(train_data),
epochs=30,
callbacks=[checkpoint]
)