A Streamlit application that utilizes Google's Gemini AI to analyze and provide diagnostic insights for medical images, supported by web search capabilities.
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.
- 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
- Python 3.7+
- Google Gemini API key
# Create a virtual environment
python -m venv venv
# Activate the virtual environment
# For Windows:
venv\Scripts\activate
# For macOS/Linux:
source venv/bin/activate# Install required packages from requirements.txt
pip install -r requirements.txtEnsure 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)
- Start the Streamlit application:
streamlit run app.py-
Open your web browser and navigate to the local URL provided (typically http://localhost:8501)
-
In the sidebar, enter your Google API key from Google AI Studio
-
Upload a medical image (supported formats: JPG, JPEG, PNG)
-
Click "Analyze Image" to receive a comprehensive analysis
The application provides a structured analysis with five key sections:
- Image Type & Region: Identifies the imaging modality and anatomical region
- Key Findings: Lists observations and abnormalities with precise descriptions
- Diagnostic Assessment: Provides primary and differential diagnoses with confidence levels
- Patient-Friendly Explanation: Explains findings in clear, accessible language
- Research Context: Includes recent medical literature and relevant references
- 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
- 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
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Gemini AI for providing the AI model
- Streamlit for the web application framework
- Phi Framework for agent development utilities