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.
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
- Python 3.7 or later
pip
package manager- Virtual environment (optional but recommended)
git clone https://github.com/your-username/automated-cancer-diagnostics.git
cd automated-cancer-diagnostics
python3 -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
pip install -r requirements.txt
- Download the pre-trained model and weights from the provided link (e.g., Google Drive or other cloud storage).
- Place the downloaded files in the
model
directory.
- Ensure you are in the project's root directory.
- Start the web application:
streamlit run app.py
- Open your browser and navigate to
http://localhost:8501
to access the application.
- Use the web interface to upload medical images for diagnosis.
- The application will display diagnostic results along with visual explanations.
You can also run model inference directly from the command line:
python infer.py --image-path path/to/image
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
Edit the config.py
file to adjust training parameters such as learning rate, batch size, and model architecture.
To evaluate the trained model on a test dataset, use the evaluate.py
script:
python evaluate.py --data-dir path/to/test-dataset
The evaluation script provides metrics such as accuracy, precision, recall, and the area under the ROC curve (AUC).
We welcome contributions to improve this project! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Commit your changes and push to your branch.
- Open a pull request and describe your changes.
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.