with deep learning
Advanced Medical Recommendation System with Flask on Azure is an end‑to‑end solution designed to provide medical diagnostics and recommendations using machine learning and deep learning models.
The system comprises multiple modules including X-ray analysis, symptom analysis, AI nutritionist, and medical chat. It leverages deep learning (using PyTorch) for medical image classification (e.g., pneumonia, brain tumors, skin cancer), and rule‑based or ML‑based predictions for symptom analysis.
Large model files are then hosted on Azure Blob Storage and dynamically downloaded at runtime. Deployment is fully automated via GitHub Actions to Azure App Service.
-
Python, Flask (with blueprints), GitHub Actions, Langchain, Huggingface
-
PyTorch, TorchScript, Scikit-Learn, Pickle/Joblib (SVC), Git LFS for managing large model files
-
Azure Blob Storage for models, Faiss Vector Storage for Document RAG based Query (custom context based)
-
HTML with Bootstrap, jQuery UI, CSS
-
Azure App Service, Azure Blob Storage, GitHub Actions CI/CD
-
- X-ray Analysis: Upload and analyze medical images (MRI, X-ray, or skin lesion) for conditions such as pneumonia, brain tumor, and skin cancer.
- Symptom Analyzer: Input symptoms in free text to receive diagnostic predictions along with details like description, precautions, medications, diet, and workouts.
- AI Nutritionist: Analyze meal images and obtain detailed nutritional analysis in a structured table format.
- MediChat: Engage with an interactive chatbot for medical consultations and answering FAQs.
-
- Leverages Azure Blob Storage to host and deliver large deep learning models at runtime without bloating the repository.
- Uses Git LFS to manage large files during development.
-
- Fully automated deployment using GitHub Actions that build and deploy your application to Azure App Service.
- Supports continuous deployment and easy scaling under the Azure ecosystem.
-
- Dynamic and responsive web pages built with Bootstrap, HTML, and jQuery.
- Interactive forms for uploading images, entering symptoms, and receiving real‑time diagnostic feedback.
-
git clone https://github.com/realshubhamraut/Advanced-Medical-Recommendation-System-with-Flask-on-Azure.git cd Advanced-Medical-Recommendation-System-with-Flask-on-Azure
-
Create a virtual environment and install required packages:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
-
Create a .env file in the root directory with any required keys, e.g.:
GOOGLE_API_KEY=your_google_api_key_here HF_TOKEN=your_hugging_face_token
- Upload your local models folder to your Azure Blob Storage container (container name: models).
- Ensure the container is public or appropriately configured.
- The helper module model_downloader.py is configured to download model files at runtime if not present locally.
Run the Flask app
python main.py
Visit http://127.0.0.1:5000
in your browser to test the application.
Deploying to Azure App Service via GitHub Actions
- Create a new Web App in the Azure Portal using the Web App option.
- Choose Publish: Code and select a Python runtime matching your project (e.g., Python 3.12).
-
Configure GitHub Actions:
Your repository includes a workflow file under workflows (e.g., azure-webapps-deploy.yml) which:
- Sets up the Python environment.
- Installs dependencies.
- Zips and deploys the artifact to Azure App Service.
Note: Update GitHub Secrets with the following:
- clientidsecretname
- tenantidsecretname
- subscriptionidsecretname
Commit the workflow file, and every push to the main branch will trigger an automatic deployment.
and finally issues and improvements / pull requests are always welcomed.
Important: This project is provided for experimental purposes only. and I have only designed it in a way to explore the possibilities of integrating healthcare with AI. Always seek the advice of qualified medical professionals regarding any medical diagnosis or treatment. Do not solely rely on the outputs of this repository for clinical decisions.