A comprehensive AI-powered medical diagnostic platform that leverages state-of-the-art machine learning models to assist in the early detection and analysis of various medical conditions through image and data analysis.
MediScan AI is an innovative web-based application that integrates multiple deep learning and machine learning models to provide diagnostic assistance for seven major medical conditions:
- 🦠 COVID-19 Detection - Chest X-ray analysis for pneumonia patterns
- 🧠 Brain Tumor Detection - MRI scan analysis for tumor identification
- 👩 Breast Cancer Detection - Predictive analysis using clinical parameters
- 🧠 Alzheimer's Disease Detection - MRI-based dementia classification
- 💉 Diabetes Prediction - Risk assessment using physiological parameters
- 🫁 Pneumonia Detection - Chest X-ray analysis for lung infections
- ❤️ Heart Disease Prediction - Cardiovascular risk assessment
Video Demo (Watch this) - https://drive.google.com/file/d/1v5stMRkBzpqc0mnqDkDXjfaOMKHAF4El/view?usp=sharing

- Multi-Modal Analysis: Supports both image-based (X-rays, MRIs) and parameter-based diagnostics
- Real-Time Predictions: Instant results with confidence scores
- User-Friendly Interface: Intuitive web interface accessible to healthcare professionals and researchers
- Detection History: Complete log of all diagnostic sessions
- Data Persistence: CSV-based storage for analysis and auditing
- Export Capabilities: Easy data export for further research
- Modular Design: Clean separation of models and web interface
- Error Handling: Graceful degradation when models are unavailable
- Scalable Framework: Easy to extend with new diagnostic models
- Responsive Design: Works seamlessly across devices
- Bootstrap Framework: Modern, professional UI
- Interactive Forms: Guided input collection for accurate diagnostics
- Flask 3.0.0: Lightweight Python web framework
- Python 3.9.13: Stable runtime environment
- TensorFlow 2.12.0: Deep learning framework for CNN models
- Keras: High-level neural network API
- Scikit-learn 0.24.2: Traditional ML algorithms
- XGBoost 2.0.3: Gradient boosting for tabular data
- OpenCV 4.5.1.48: Image processing and computer vision
- Imutils 0.5.4: Image processing utilities
- NumPy: Numerical computing
- Pandas: Data manipulation (implied through sklearn)
- Joblib: Model serialization
- Architecture: Convolutional Neural Network with 3 Conv2D layers
- Input: Chest X-ray images (224x224x3)
- Output: Binary classification (COVID/Normal)
- Training Data: ~5,000 chest X-ray images
- Accuracy: ~95% on validation set
- Technique: Transfer learning with custom CNN layers
- Architecture: VGG16-based CNN with custom preprocessing
- Input: Brain MRI scans (224x224x3)
- Output: Binary classification (Tumor/No Tumor)
- Preprocessing: Advanced cropping and skull removal
- Technique: Image segmentation and classification
- Architecture: Custom CNN with 4 convolutional blocks
- Input: Brain MRI slices (176x176x3)
- Output: Multi-class classification (4 dementia stages)
- Classes: NonDemented, VeryMildDemented, MildDemented, ModerateDemented
- Technique: Multi-stage classification with batch normalization
- Architecture: Sequential CNN with dropout regularization
- Input: Chest X-ray images (150x150x3)
- Output: Binary classification (Pneumonia/Normal)
- Training Data: Large chest X-ray dataset
- Technique: Data augmentation and regularization
- Algorithm: XGBoost Classifier
- Features: 5 clinical parameters (concave points, area, radius, perimeter, concavity)
- Output: Binary classification (Malignant/Benign)
- Technique: Ensemble learning with gradient boosting
- Algorithm: Random Forest Classifier (saved as pickle)
- Features: 8 physiological parameters
- Output: Binary classification (Diabetic/Non-Diabetic)
- Technique: Ensemble of decision trees
- Algorithm: Custom ML model (pickle format)
- Features: Clinical parameters (age, blood pressure, cholesterol, etc.)
- Output: Binary classification (Disease/No Disease)
- Technique: Traditional supervised learning
MediScan AI/
├── app.py # Flask web application
├── models/ # Pre-trained ML models
│ ├── covid.h5 # COVID detection model
│ ├── braintumor.h5 # Brain tumor model
│ ├── alzheimer_model.h5 # Alzheimer's model
│ ├── pneumonia_model.h5 # Pneumonia model
│ ├── cancer_model.pkl # Breast cancer model
│ ├── diabetes.sav # Diabetes model
│ └── heart_disease.pickle.dat # Heart disease model
├── templates/ # HTML templates
│ ├── homepage.html
│ ├── covid.html
│ ├── resultc.html
│ └── ...
├── static/ # Static assets
│ ├── uploads/ # User uploaded images
│ └── images/ # UI images
├── detection_history.csv # Diagnostic history log
└── tools/ # Utility scripts
- Python 3.9.13
- Conda package manager
- Git
- Clone the repository
git clone <repository-url>
cd MediScan-AI- Create Conda Environment
conda create -n mediscan python=3.9.13
conda activate mediscan- Install Dependencies
pip install opencv-python==4.5.1.48 numpy tensorflow==2.12.0 scikit-learn==0.24.2 imutils==0.5.4 flask==3.0.0 xgboost==2.0.3- Start Flask Server
flask run- Access the Application
Open your browser and navigate to:
http://127.0.0.1:5000
- Navigate to the desired diagnostic page (COVID, Brain Tumor, etc.)
- Fill in patient information (name, age, gender, etc.)
- Upload the medical image (X-ray, MRI, etc.)
- Click "Submit" for instant AI-powered analysis
- View results with confidence scores
- Select the appropriate diagnostic module
- Enter clinical parameters in the form
- Submit for risk assessment
- Review prediction results
- Access the History page to view all previous diagnostics
- Export data for further analysis
- Clear history when needed
| Model | Type | Accuracy | Input Type | Output Classes |
|---|---|---|---|---|
| COVID-19 | CNN | ~95% | Chest X-ray | 2 (COVID/Normal) |
| Brain Tumor | CNN | ~92% | Brain MRI | 2 (Tumor/No Tumor) |
| Alzheimer's | CNN | ~88% | Brain MRI | 4 (Dementia Stages) |
| Pneumonia | CNN | ~94% | Chest X-ray | 2 (Pneumonia/Normal) |
| Breast Cancer | XGBoost | ~96% | Clinical Data | 2 (Malignant/Benign) |
| Diabetes | Random Forest | ~85% | Physiological Data | 2 (Diabetic/Normal) |
| Heart Disease | ML Model | ~83% | Clinical Data | 2 (Disease/No Disease) |
The application automatically loads all models on startup. If a model fails to load, the corresponding diagnostic feature becomes unavailable with appropriate user messaging.
- Standardization: All images normalized to [0,1] range
- Resizing: Consistent input dimensions for each model
- Augmentation: Training data enhanced with rotations, flips, and zooms
- Model Unavailable: Graceful fallback with user notification
- Invalid Input: Form validation and error messages
- File Upload: Secure file handling with type validation
- Model Explainability: Integration of SHAP/LIME for prediction explanations
- Multi-Modal Fusion: Combining multiple imaging modalities
- Real-Time Training: Online learning capabilities
- API Endpoints: RESTful API for integration
- Batch Processing: Multiple image analysis
- Performance Metrics: Detailed accuracy and ROC curves
- Federated Learning: Privacy-preserving model training
- Transfer Learning: Cross-domain model adaptation
- Uncertainty Quantification: Confidence intervals for predictions
- Clinical Validation: Real-world performance studies
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow PEP 8 style guidelines
- Add docstrings to new functions
- Update tests for new features
- Ensure models are version-controlled appropriately
This project is licensed under the MIT License - see the LICENSE file for details.
MediScan AI is a research and educational tool, not a clinical diagnostic device.
- Models are trained on publicly available datasets
- Results should not be used for actual medical decisions
- Always consult qualified healthcare professionals
- Performance may vary with real-world data
- Regular model updates and validation recommended
For questions, issues, or contributions:
- Open an issue on GitHub
- Contact the development team
- Check the documentation for common solutions
- Medical imaging datasets from various public repositories
- Open-source ML frameworks and libraries
- Research community for published methodologies
- Healthcare professionals for domain expertise
MediScan AI - Advancing healthcare through artificial intelligence 🚀