Skip to content

Dielldev/MedAI

Repository files navigation

MedAI - Local Medical Report Analysis Tool

A local AI tool for analyzing medical reports using OCR and machine learning. Processes scanned medical reports (images or PDFs) and provides automated analysis including value extraction, diagnosis prediction, and case similarity matching.

MedAI Overview

📱 Application Screenshots

Desktop Application Interface

Desktop App Interface

Analysis Results View

Analysis Results

🚀 Key Features

  • 📄 Multi-format Support: Analyze image files (JPG, PNG) and PDF documents
  • 🔍 OCR Text Extraction: Uses Tesseract OCR for text extraction from medical documents
  • 🩺 Medical Value Parsing: Extracts vital signs, lab values, and symptoms automatically
  • � AI-Powered Analysis: Uses SentenceTransformer embeddings for semantic understanding
  • 📊 Case-Based Learning: Finds similar past cases using machine learning
  • 🌍 Multi-Language Support: Works with English and Albanian medical documents
  • 🔒 Privacy-First: 100% local processing - no cloud services or data sharing

🛠️ Installation & Setup

Step 1: Prerequisites

  • Python 3.8 or higher (Check with python --version)
  • Git (to clone the repository)
  • Tesseract OCR (for text extraction)

Step 2: Install Tesseract OCR

Windows:

  1. Download from: https://github.com/UB-Mannheim/tesseract/wiki
  2. Install the executable
  3. Add Tesseract to your system PATH
  4. Verify installation: tesseract --version

macOS:

brew install tesseract
tesseract --version  # Verify installation

Linux (Ubuntu/Debian):

sudo apt-get update
sudo apt-get install tesseract-ocr
tesseract --version  # Verify installation

Step 3: Download MedAI

Option A: Clone with Git

git clone https://github.com/Dielldev/MedAI.git
cd MedAI

Option B: Download ZIP

  1. Download the ZIP file from GitHub
  2. Extract to your desired folder
  3. Open terminal/command prompt in that folder

Step 4: Install Python Dependencies

# Make sure you're in the MedAI directory
cd MedAI

# Install required packages
pip install -r requirements.txt

Step 5: Verify Installation

# Test if everything is working
python test_installation.py

🎯 How to Use MedAI

Method 1: Graphical User Interface (Recommended for Beginners)

# Run the GUI application
python gui.py

Method 2: Web Application

# Run the web app
python web_app.py

Then open your browser and go to: http://localhost:5000

Web Interface

Features:

  • Upload medical documents through web interface
  • View analysis results in your browser
  • Download reports as JSON or text files

Web Analysis Results

Method 4: Test with Demo Data

# Run enhanced demo with sample data
python tests/enhanced_demo.py

📁 Project Structure

MedAI/
├── main.py              # Main application logic
├── gui.py               # Graphical user interface
├── web_app.py          # Web application
├── medical_analyzer.py  # Core medical analysis engine
├── requirements.txt     # Python dependencies
├── config.yaml         # Configuration settings
├── README.md           # This file
├── setup.py            # Installation script
├── data/               # Database and embeddings
│   ├── cases_db.json   # Case database
│   └── case_embeddings.npy  # ML embeddings
├── exports/            # Analysis results
├── uploads/            # Input documents
├── templates/          # Web app templates
│   └── index.html
├── tests/              # Test scripts
│   ├── test_installation.py
│   └── enhanced_demo.py
└── poppler-23.08.0/    # PDF processing tools

🚨 Important Notes

⚠️ Medical Disclaimer: This tool is for educational and research purposes only. It should not be used as a substitute for professional medical diagnosis or treatment. Always consult qualified healthcare professionals for medical decisions.

Privacy & Security

  • All processing is done locally (no cloud services)
  • No data is sent to external servers
  • Medical data remains on your local machine

Getting Help

  1. Check the test files:

    python tests/test_installation.py
    python tests/enhanced_demo.py
  2. Enable debug mode in your Python scripts:

    medai = MedAI(debug=True)
  3. Check log files in the project directory

🔗 Tech Stack

  • sentence-transformers: Text embeddings
  • pytesseract: OCR text extraction
  • opencv-python: Image preprocessing
  • scikit-learn: Similarity calculations
  • pdf2image: PDF processing

🏥 Medical Disclaimer: This tool is designed for educational and research purposes only. Always consult qualified healthcare professionals for medical decisions.

About

Local Medical Report Analysis Tool

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors