Skip to content

This repository implements a Convolutional Neural Network (CNN) to analyze MRI scans and determine whether a brain tumor is present. The project is designed to function as a backend system, providing the necessary infrastructure to train and deploy the model.

Notifications You must be signed in to change notification settings

Cleveridiot07/BrainTumorClassificationUsingOpenCV

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BrainTumorSegmentationUsingOpenCV

This repository implements a Convolutional Neural Network (CNN) to analyze MRI scans and determine whether a brain tumor is present. The project is designed to function as a backend system, providing the necessary infrastructure to train and deploy the model.


Setup Instructions

Prerequisites

  • Python 3.x installed on your system
  • A stable internet connection to download the dataset and dependencies

Steps to Set Up the Project

  1. Clone the repository:

    git clone https://github.com/Cleveridiot07/BrainTumorClassificationUsingOpenCV
    cd BrainTumorClassificationUsingOpenCV
  2. Initialize a virtual environment:

    python -m venv venv
  3. Activate the virtual environment:

    • On Windows:
      .\venv\Scripts\activate
    • On macOS/Linux:
      source venv/bin/activate
  4. Install dependencies:

    pip install -r requirements.txt

Dataset

  1. Download the dataset:

  2. Unzip the dataset:

    • After downloading, unzip the dataset:
      • On Windows: Right-click the file and select Extract All....
      • On macOS/Linux: Use the command:
        unzip datasets.zip
  3. Place the dataset:

    • After unzipping, place the dataset in the following directory structure:
      backend/
      ├── model/
      │   ├── maintrain.py
      │   └── <dataset-folder>
      

Train the Model

  1. Navigate to the model/ directory:

    cd model
  2. Run the training script:

    python maintrain.py
  3. After training, the .h5 file for the model will be generated automatically in the model/ directory.


Running the Project

  1. Return to the backend directory:

    cd ..
  2. Start the backend:

    uvicorn main:app --reload
    • This will run the backend at http://127.0.0.1:8000.
    • You can proceed to http://127.0.0.1:8000/docs to test the app using the interactive API documentation provided by Swagger UI.
    • Press CTRL+C to stop the server.

Contribution

Feel free to fork the repository, create a branch, and submit a pull request to contribute to the project.

About

This repository implements a Convolutional Neural Network (CNN) to analyze MRI scans and determine whether a brain tumor is present. The project is designed to function as a backend system, providing the necessary infrastructure to train and deploy the model.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages