Skip to content

Latest commit

 

History

History
206 lines (160 loc) · 7.75 KB

README.md

File metadata and controls

206 lines (160 loc) · 7.75 KB

Early-Stage-Cancer-Prediction

cancer_detection_project_image

  1. Cancer is responsible for an estimated 10 million deaths worldwide each year, making it the second leading cause of death.
  2. 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.
  3. More specifically regarding Brain Tumor there were about 265,000 deaths worldwide in 2019, representing approximately 1.6% of all deaths from all causes.
  4. 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.
  5. Breast cancer is the most common cancer in women worldwide, accounting for 25% of all cancers in women.
  6. 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 started searching for methods/cures available for Brain Tumor and Leukemia, what we discovered was that even though we as humans have made great strides and advancements in treating cases of Brain Tumor and Leukemia most treatments rely on the condition that the cancer is detected at an early stage. We took this as the problem we were willing and eager to solve. We recognized that the rate at which cancer cases are increasing is putting stress on the hospital as well as their staff. So we built this model which not only detect cancer but one can predict cancer earlier from the symptomps and classify the types of 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.

Brain Tumor Detection Using Deep Learning

💡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:

  • Python
  • TensorFlow
  • Keras
  • NumPy
  • Matplotlib

  • 🛠️ 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

    Image

    🩺 Breast Cancer Detection using Machine Learning

    🛠️ Technologies Used

  • Python: The primary programming language used for implementation.
  • Libraries:
  • NumPy: For numerical computations.
  • Pandas: For data manipulation and analysis.
  • Matplotlib: For data visualization.
  • Scikit-learn: For dataset handling, preprocessing, and model evaluation.
  • TensorFlow/Keras: For building and training the neural network.

  • **🧠 Model Architecture**


    The neural network model is built using Keras and consists of the following layers:
  • Input Layer: 30 input features.
  • Hidden Layer: 20 neurons with ReLU activation.
  • Output Layer: 2 neurons with sigmoid activation for binary classification.

  • **🛠️ Installation**


    To run this project, please ensure you have the following prerequisites installed:
  • Python
  • TensorFlow/Keras
  • NumPy
  • Pandas
  • Matplotlib
  • scikit-learn

  • 🛠️ Code Snippet

    📊 Results

    | !(WhatsApp Image 2024-10-04 at 09 41 59_6574649b ) | !(WhatsApp Image 2024-10-04 at 09 41 59_6120567b )

    Skin Cancer Detection Using Deep Learning

    🛠️ Technologies Used

  • Python: The primary programming language used for implementation.
  • Libraries:
  • NumPy: For numerical computations.
  • Matplotlib: For data visualization.
  • Scikit-learn: For dataset handling, preprocessing, and model evaluation.
  • TensorFlow/Keras: For building and training the neural network.
  • OpenCV - For image processing

  • **🏗️Model Architecture**

    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

  • To run this project, please ensure you have the following prerequisites installed:
  • Python
  • TensorFlow/Keras
  • NumPy
  • OpenCV
  • Matplotlib
  • scikit-learn

  • 🛠️ 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]
    )


    **📊 Results**

    | !(WhatsApp Image 2024-10-04 at 09 57 26_41b0662f ) | !(WhatsApp Image 2024-10-04 at 09 57 26_280558db )