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.
- 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
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]- Python 3.8+
- Google API Key from Google AI Studio
-
Clone the repository
git clone https://github.com/apix7/ai-med.git cd ai-med -
Create and activate a virtual environment
python -m venv venv # On Windows venv\Scripts\activate # On macOS/Linux source venv/bin/activate
-
Install dependencies
pip install -r requirements.txt
-
Start the application
streamlit run med.py
-
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
-
Upload a medical image
- Use the file uploader to select an image file
- Supported formats: JPG, JPEG, PNG, DICOM
- Maximum file size: 200MB
-
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
- 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
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Streamlit for the amazing web app framework
- Google Gemini for the AI model
- Agno AI for the agent framework
