Skip to content

A web application that utilizes artificial intelligence to detect brain tumors .

License

Notifications You must be signed in to change notification settings

MahtabRanjbar/TumorDetectAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TumorDetectAI

Brain Tumor Detection App

App Screenshot

TumorDetectAI is a web application that utilizes artificial intelligence to detect brain tumors in MRI images. With the help of advanced deep learning algorithms, the application offers accurate and efficient predictions regarding the presence of brain tumors. Users can conveniently upload their brain MRI images and receive instant results.

link to project notebook in kaggle


Table of Contents

Installation

  1. Clone this repository to your local machine:

    git clone https://github.com/MahtabRanjbar/TumorDetectAI.git
  2. Navigate to the project directory:

    cd Brain-tumor-detection-app
    
  3. Install the required packages:

    pip install -r requirements.txt

Usage

  1. download pretrained model from here and put in saved_models folder

  2. Start the app by running the following command in your terminal:

    streamlit run src/app.py
  3. Open your web browser and navigate to http://localhost:8501. This should open the app in your browser.

  4. Upload a Brain MRI image to the app and click the "Predict" button to see the model's prediction. you can use my sample_images

  5. If you want to retrain the model, you can execute the following command:

    python src/main.py

    consider to first download the data and put in data folder as it is said here

  6. for ease of use and not installing all neccessary packages and having no conflict, you can run the notebook of project

Dataset

The Brain Tumor Detection dataset from Kaggle consists of brain MRI images collected for the purpose of brain tumor detection. The dataset has been split into three subsets: train set, validation set, and test set. The sizes of each subset are as follows:

  • Train set size: 161
  • Validation set size: 41
  • Test set size: 51

You can download the dataset from the Kaggle website and extract it to the data directory in this project. For more information on the dataset and its structure, see here

Model

The model architecture is based on the Resnet50 model, which is a powerful convolutional neural network architecture known for its efficiency and accuracy. In addition to the Resnet base model, additional convolutional layers and fully connected layers have been added to enhance the model's ability to detect brain tumors.

The model is pretrained and saved for ease of use. You can find the pretrained model in the here. Instead of retraining the model, you can directly use this pretrained model for your brain tumor detection tasks.

The model is trained using the Adam optimizer, which is a popular choice for deep learning tasks. Adam adjusts the model's weights during training to minimize the loss function and improve the model's performance.

The loss function used in training is binary cross-entropy. This loss function is suitable for binary classification tasks and helps the model learn to distinguish between brain MRI images with tumors and those without.

Evaluation Metrics

After training and testing the brain tumor detection model, several evaluation metrics have been computed to assess its performance. These evaluation metrics provide insights into the model's effectiveness in detecting brain tumors. The metrics include accuracy, F1 score, recall, and precision.

Metric Value
Accuracy 0.9019
F1 Score 0.9002
Recall 0.9019
Precision 0.9054

For further evaluation metrics and details, please check the reports folder.

Contributing

Contributions are always welcome! If you have any ideas or suggestions, please feel free to open an issue or a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for more information

Contact

If you have any questions or comments about this project, please feel free to contact me at [email protected]

About

A web application that utilizes artificial intelligence to detect brain tumors .

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published