Skip to content

KimutaiPeter/Tumor-detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Automated Brain Tumor Diagnostics Model Using Computer Vision

Overview

This repository contains the code and resources for a computer vision model designed to assist in the detection of cancerous cells from medical images. The project utilizes logistic regression to provide accurate and efficient diagnostic support, complete with an intuitive user interface for deployment.

Dataset

The dataset consists of MRI images of brain tumors, categorized into four classes:

  • No Tumor
  • Pituitary Tumor
  • Glioma Tumor
  • Meningioma Tumor

You can access the dataset at the link below: https://www.kaggle.com/datasets/sartajbhuvaji/brain-tumor-classification-mri

Installation

Prerequisites

  • Python 3.7 or later
  • pip package manager
  • Virtual environment (optional but recommended)

Clone the Repository

git clone https://github.com/your-username/automated-cancer-diagnostics.git
cd automated-cancer-diagnostics

Set Up a Virtual Environment (Optional)

python3 -m venv venv
source venv/bin/activate  # On Windows, use `venv\Scripts\activate`

Install Dependencies

pip install -r requirements.txt

Download Model and Weights

  1. Download the pre-trained model and weights from the provided link (e.g., Google Drive or other cloud storage).
  2. Place the downloaded files in the model directory.

Usage

Running the Web Application

  1. Ensure you are in the project's root directory.
  2. Start the web application:
streamlit run app.py
  1. Open your browser and navigate to http://localhost:8501 to access the application.

Uploading Images

  • Use the web interface to upload medical images for diagnosis.
  • The application will display diagnostic results along with visual explanations.

Model Inference (Command Line)

You can also run model inference directly from the command line:

python infer.py --image-path path/to/image

Model Training

Training Script

To train the model, use the train.py script. Customize the script as needed to fit your dataset and requirements:

python train.py --data-dir path/to/dataset --epochs 50 --batch-size 32

Configuration

Edit the config.py file to adjust training parameters such as learning rate, batch size, and model architecture.

Evaluation

Evaluate the Model

To evaluate the trained model on a test dataset, use the evaluate.py script:

python evaluate.py --data-dir path/to/test-dataset

Metrics

The evaluation script provides metrics such as accuracy, precision, recall, and the area under the ROC curve (AUC).

Contributing

We welcome contributions to improve this project! Please follow these steps to contribute:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Commit your changes and push to your branch.
  4. Open a pull request and describe your changes.

License

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


Thank you for using and contributing to this project! If you have any questions or need assistance, please open an issue on GitHub.