Skip to content
/ ai-med Public

An AI-powered Streamlit application for analyzing medical images, providing detailed diagnostic assessments using Google's Gemini model and integrating research context via DuckDuckGo search."

License

Notifications You must be signed in to change notification settings

apix7/ai-med

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏥 Medical Imaging Diagnosis Agent

Medical Imaging Application Screenshot

A powerful AI-powered application for analyzing and diagnosing medical images. This tool leverages Google's Gemini model to provide detailed analysis of various medical imaging formats including X-rays, MRIs, CT scans, and DICOM files.

⚠️ DISCLAIMER: This tool is for educational and informational purposes only. It is not a substitute for professional medical advice, diagnosis, or treatment. Always seek the advice of qualified healthcare providers for any medical concerns.

🌟 Features

  • Modern, Intuitive UI: Clean and professional interface built with Streamlit
  • Multi-format Support: Handles standard image formats (JPG, PNG, JPEG) and medical DICOM files
  • AI-Powered Analysis: Utilizes Google's Gemini 2.0 model for state-of-the-art image interpretation
  • Comprehensive Reports: Generates structured analysis including:
    • Image Type & Region Identification
    • Detailed Key Findings
    • Diagnostic Assessment with Confidence Levels
    • Patient-Friendly Explanations
    • Research Context with Recent Medical Literature

📋 Sample Analysis Output

The analysis provides a structured report with the following sections:

### 1. Image Type & Region
- X-ray imaging of the chest, PA (posteroanterior) view
- Good image quality with proper exposure and positioning

### 2. Key Findings
- Clear lung fields without infiltrates or masses
- Normal cardiac silhouette
- No pleural effusions
- Normal bony structures

### 3. Diagnostic Assessment
- Primary: Normal chest radiograph (95% confidence)
- No acute cardiopulmonary process identified

### 4. Patient-Friendly Explanation
Your chest X-ray looks normal. The lungs appear clear without any signs of infection or fluid...

### 5. Research Context
Recent studies on normal chest radiographs:
- [Link to relevant medical literature]
- [Standard protocols for chest X-ray interpretation]

🛠️ Installation & Setup

Prerequisites

Step-by-Step Installation

  1. Clone the repository

    git clone https://github.com/apix7/ai-med.git
    cd ai-med
  2. Create and activate a virtual environment

    python -m venv venv
    
    # On Windows
    venv\Scripts\activate
    
    # On macOS/Linux
    source venv/bin/activate
  3. Install dependencies

    pip install -r requirements.txt

🚀 Usage

  1. Start the application

    streamlit run med.py
  2. Enter your Google API Key

    • On first launch, you'll be prompted to enter your Google API Key in the sidebar
    • This key is securely stored in your session state and not shared externally
    • You can get your API key from Google AI Studio
  3. Upload a medical image

    • Use the file uploader to select an image file
    • Supported formats: JPG, JPEG, PNG, DICOM
    • Maximum file size: 200MB
  4. Get AI Analysis

    • Click the "Analyze Image" button
    • Wait for the AI to process the image (typically 10-30 seconds)
    • Review the comprehensive analysis report

🔒 Privacy & Security

  • All image processing happens on your local machine
  • API keys are stored only in your session state and not persisted
  • No patient data is stored or transmitted beyond what's needed for analysis

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgements

About

An AI-powered Streamlit application for analyzing medical images, providing detailed diagnostic assessments using Google's Gemini model and integrating research context via DuckDuckGo search."

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages