Skip to content

Mr-PU/x-ray-assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Medical Imaging Diagnosis Agent

A Streamlit application that utilizes Google's Gemini AI to analyze and provide diagnostic insights for medical images, supported by web search capabilities.

Overview

This application allows healthcare professionals and users to upload medical images (X-ray, MRI, CT, Ultrasound, etc.) and receive a comprehensive AI-powered analysis. The agent provides structured insights including image type identification, key findings, diagnostic assessment, and patient-friendly explanations, all supported by recent medical literature through integrated web search.

Features

  • AI-Powered Image Analysis: Leverages Google's Gemini 2.0 Flash model for medical image interpretation
  • Structured Analysis Reports: Provides organized insights with clear sections for findings and diagnoses
  • Research Integration: Incorporates relevant medical literature through DuckDuckGo search
  • Patient-Friendly Explanations: Translates complex medical findings into accessible language
  • Secure API Management: Safely stores Google API keys in the session state

Requirements

  • Python 3.7+
  • Google Gemini API key

Installation

Setting up a Virtual Environment

# Create a virtual environment
python -m venv venv

# Activate the virtual environment
# For Windows:
venv\Scripts\activate
# For macOS/Linux:
source venv/bin/activate

Installing Dependencies

# Install required packages from requirements.txt
pip install -r requirements.txt

Project Structure

Ensure you have the following files in your project directory:

  • app.py (the main application file)
  • static/iffort blue logo.png (logo image file)
  • requirements.txt (containing all necessary dependencies)

Usage

  1. Start the Streamlit application:
streamlit run app.py
  1. Open your web browser and navigate to the local URL provided (typically http://localhost:8501)

  2. In the sidebar, enter your Google API key from Google AI Studio

  3. Upload a medical image (supported formats: JPG, JPEG, PNG)

  4. Click "Analyze Image" to receive a comprehensive analysis

Analysis Output

The application provides a structured analysis with five key sections:

  1. Image Type & Region: Identifies the imaging modality and anatomical region
  2. Key Findings: Lists observations and abnormalities with precise descriptions
  3. Diagnostic Assessment: Provides primary and differential diagnoses with confidence levels
  4. Patient-Friendly Explanation: Explains findings in clear, accessible language
  5. Research Context: Includes recent medical literature and relevant references

Important Notes

  • This tool is for educational and informational purposes only
  • All analyses should be reviewed by qualified healthcare professionals
  • Do not make medical decisions based solely on this analysis

Security Considerations

  • API keys are stored in the Streamlit session state and not persisted
  • User-uploaded images are temporarily stored and then deleted after analysis
  • No patient data is permanently stored by the application

License

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

Acknowledgments

About

A Streamlit-based Medical Imaging Diagnosis App that leverages Google Gemini AI and DuckDuckGo to analyze uploaded medical images. Users can upload an image, and the AI provides detailed radiological analysis, patient-friendly explanations, and research-backed insights. The app requires a Google API key for AI-powered diagnostics.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages