An intelligent web application built with Flask and Google Gemini AI that transforms complex medical reports into structured, easy-to-understand, and actionable health insights. The application extracts text from uploaded medical reports, analyzes the content using AI, identifies abnormal findings, calculates an overall health score, and generates personalized recommendations through a modern interactive dashboard.
- Upload and analyze medical reports in PDF format
- Automatic text extraction using OCR and PDF parsing
- AI-powered medical report interpretation using Google Gemini
- Interactive health dashboard with animated health score
- Automatic health risk assessment (Low, Moderate, High)
- AI-generated summary of the uploaded report
- Detection and explanation of abnormal findings
- Personalized health recommendations
- Interactive charts and medical statistics
- Download analyzed report as a PDF
- Contact form with Flask-Mail integration
- Modern Glassmorphism UI with responsive design
- Python
- Flask
- Flask-Mail
- Google Gemini API
- google-generativeai
- HTML5
- CSS3
- JavaScript
- Chart.js
- PyMuPDF (fitz)
- Tesseract OCR
- html2pdf.js
- html2canvas
- python-dotenv
git clone https://github.com/MobeenFatimaa/Medical-Report-Analyzer.git
cd Medical-Report-Analyzerpython -m venv .venv
.venv\Scripts\activatepython3 -m venv .venv
source .venv/bin/activatepip install -r requirements.txtCreate a file named .env in the project root.
# ==========================
# Google Gemini
# ==========================
GEMINI_API_KEY=your_gemini_api_key_here
# ==========================
# Flask
# ==========================
SECRET_KEY=your_secret_key
# ==========================
# Flask Mail
# ==========================
MAIL_SERVER=smtp.gmail.com
MAIL_PORT=587
MAIL_USE_TLS=True
MAIL_USERNAME=your_email@gmail.com
MAIL_PASSWORD=your_google_app_passwordpython app.pyOpen your browser and visit
http://127.0.0.1:5000
Medical-Report-Analyzer/
│
├── static/
│ ├── css/
│ ├── js/
│ └── images/
│
├── templates/
│ ├── index.html
│ └── result.html
│
├── uploads/
│ └── .gitkeep
│
├── ai_analyzer.py
├── analyzer.py
├── app.py
├── requirements.txt
├── .gitignore
├── README.md
└── LICENSE
- Upload a medical report
- Extract report text
- Send extracted text to Google Gemini
- AI analyzes the report
- Generate health score
- Detect abnormal findings
- Create medical summary
- Generate recommendations
- Display results in an interactive dashboard
- Download the analyzed report as PDF
- API keys are stored using .env
- Sensitive credentials are excluded using .gitignore
- Temporary uploaded files are stored locally
- No API credentials are exposed in the source code
This project is licensed under the Apache License 2.0.
See the LICENSE file for more information.
Mobeen Fatima
GitHub: https://github.com/MobeenFatimaa
If you found this project useful, consider giving it a ⭐ Star on GitHub.
It helps support the project and encourages future development.