- Python 3.8 or higher
- pip package manager
- Virtual environment (recommended)
# 1. Create virtual environment
python -m venv venv
# 2. Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
# 3. Install dependencies
pip install -r requirements.txtoral-cancer-detection/
├── data/
│ ├── train/
│ │ ├── cancerous/
│ │ └── non_cancerous/
│ ├── validation/
│ │ ├── cancerous/
│ │ └── non_cancerous/
│ └── test/
│ ├── cancerous/
│ └── non_cancerous/
├── models/
│ ├── best_model.h5
│ └── unet_model.h5
├── uploads/
├── results/
├── logs/
├── templates/
│ └── index.html
├── improved_oral_cancer_detection.py
├── improved_flask_app.py
├── requirements.txt
└── README.md
Organize your dataset in the following structure:
data/
├── train/
│ ├── cancerous/ # Images of oral cancer
│ └── non_cancerous/ # Images of healthy mouths
├── validation/
│ ├── cancerous/
│ └── non_cancerous/
└── test/
├── cancerous/
└── non_cancerous/
Recommended Dataset Size:
- Minimum: 500 images per class
- Good: 1000+ images per class
- Excellent: 2000+ images per class
| Metric | Minimum | Good | Excellent |
|---|---|---|---|
| Accuracy | 85% | 90% | 95% |
| Sensitivity | 90% | 95% | 98% |
| Specificity | 85% | 90% | 95% |
| ROC AUC | 0.90 | 0.95 | 0.98 |
python improved_flask_app.pyThe server will start at http://localhost:5000
curl http://localhost:5000/healthcurl -X POST -F "file=@path/to/image.jpg" http://localhost:5000/predictcurl http://localhost:5000/statsOpen your browser and navigate to:
http://localhost:5000
Upload an image and get instant predictions with:
- Classification result (Cancerous/Non-Cancerous)
- Confidence score
- Medical recommendation
- Grad-CAM visualization (what the AI is looking at)
- Segmentation mask (if cancerous)
- Maximum file size: 16MB
- Allowed formats: PNG, JPG, JPEG
- Secure filename handling
- File integrity checks (SHA256)
- No data is stored permanently without consent
- All predictions are logged with anonymized IDs
- HIPAA compliance considerations built-in
For questions or issues:
- Check this README
- Review code comments
- Check logs in
logs/app.log - Create an issue on GitHub
IMPORTANT DISCLAIMERS:
-
Not Medical Advice: This system provides AI predictions only and is NOT a substitute for professional medical diagnosis.
-
Experimental: This is a research/educational project. Not FDA approved or clinically validated.
-
Liability: Users assume all risks. Consult healthcare professionals for actual diagnosis.
-
Data Privacy: Comply with HIPAA, GDPR, and local regulations when handling medical data.
-
Informed Consent: Users must understand AI limitations before using the system.
This project is for educational and research purposes only.
- Inspired by clinical need for early cancer detection
Remember: The goal is to ASSIST healthcare professionals, not replace them. Always prioritize patient safety and ethical AI use.