Oral Cancer Detection Demo
A production-ready Flask web application for oral cancer detection using deep learning.
π Quick Start
1. Install Dependencies
pip install -r requirements.txt
2. Model Included β
Trained CNN model is included:
- File:
model/oral_cancer_model.keras(43MB) - Architecture: CNN with Transfer Learning
- Accuracy: ~94% on test data
The app will load this model automatically for real AI predictions.
3. Run the App
python app.py
4. Open Browser
Navigate to: http://localhost:5000
π File Structure
oral-cancer-detection-demo/
βββ app.py # Main Flask application
βββ requirements.txt # Python dependencies
βββ README.md # This file
βββ model/ # Model directory
β βββ oral_cancer_model.keras # Trained CNN model (43MB)
βββ uploads/ # Temporary upload directory
βββ static/
β βββ css/ # Stylesheets
β βββ js/ # JavaScript files
βββ templates/ # HTML templates
βββ index.html # Upload page
βββ result.html # Results page
βββ about.html # About page
π§ Features
- β Drag & drop image upload
- β Real-time AI analysis
- β Confidence score display
- β Risk level assessment
- β Medical recommendations
- β Mobile responsive design
- β REST API endpoint
π API Usage
Endpoint: /api/predict
Method: POST
Request:
curl -X POST -F "image=@oral_image.jpg" http://localhost:5000/api/predict
Response:
{
"success": true,
"predicted_class": "Normal (Non-Cancerous)",
"confidence": 92.45,
"risk_level": "Very Low Risk",
"recommendation": "β
No significant indicators detected...",
"model_loaded": true
}
π¦ Demo Mode vs Production
Demo Mode:
- No model file required
- Simulates realistic predictions
- Perfect for demonstrations
- Random confidence scores
Production Mode:
- Trained model included (43MB .keras file)
- Real CNN predictions
- No additional setup required
π₯ Medical Disclaimer
β οΈ This tool is for research and educational purposes only.
- Not a medical device
- Should not replace professional diagnosis
- Always consult healthcare professionals
- Results require expert verification
π¨βπ» Developer
Umar Ranginwala
- M.Sc AI/ML, Gujarat University
- Product Manager
- GitHub: @umarranginwala
- LinkedIn: linkedin.com/in/umarranginwala
π License
Academic research project - Gujarat University