This project demonstrates a full-stack ML deployment workflow, focusing on prostate and breast cancer detection from MRI images using 3D U-Net and other deep learning architectures.
- Deep Learning Models
- 3D U-Net for prostate cancer detection
- CNN-based model for breast cancer detection
- Backend
- Flask REST API for model inference
- Frontend
- React.js interface for uploading MRI scans and viewing predictions
- End-to-End Flow
- Upload β Preprocess β Predict β Display results
cancer-detection/ βββ backend/ # Flask API code β βββ app.py # Main API script β βββ models/ # Saved ML models β βββ utils/ # Preprocessing & helper functions β βββ frontend/ # React.js frontend β βββ src/ # React source code β βββ public/ # Static assets β βββ datasets/ # MRI datasets (not included in repo) βββ requirements.txt # Python dependencies βββ README.md # Project documentation
1οΈβ£ Clone the Repository
git clone https://github.com/your-username/cancer-detection.git
cd cancer-detection
2οΈβ£ Backend Setup (Flask + PyTorch)
cd backend
python -m venv .venv
source .venv/bin/activate # (Linux/Mac)
.venv\Scripts\activate # (Windows)
pip install -r requirements.txt
Run the Flask server:
python app.py
3οΈβ£ Frontend Setup (React.js)
cd frontend
npm install
npm start
π₯οΈ Usage
- Start the Flask backend.
- Run the React frontend.
- Upload an MRI scan via the UI.
- Get predictions for cancer presence (positive/negative).
π¦ Requirements
All Python dependencies are listed in requirements.txt. Key libraries:
- PyTorch
- Flask
- scikit-learn
- numpy, pandas
- opencv-python
- matplotlib
- React.js (frontend)