AI-Diagnostic-Imaging-Agent

๐Ÿฅ Medical Imaging Diagnosis Agent

Python Streamlit Google AI Agno Docker GHCR AWS License

An advanced AI-powered medical imaging analysis tool built with Streamlit and Googleโ€™s Gemini Flash model. This application addresses the critical challenge of providing rapid, accurate, and accessible medical image interpretation to bridge the gap between complex diagnostic imaging and clinical decision-making.

๐ŸŽฏ Problem Statement & Solution

The Challenge

Modern healthcare faces significant challenges in medical imaging interpretation:

Our Solution Approach

This Medical Imaging Diagnosis Agent provides a comprehensive end-to-end solution through:

  1. Advanced AI Integration: Leveraging Googleโ€™s Gemini Flash model for sophisticated image analysis
  2. Multi-Modal Analysis: Supporting various medical imaging modalities (X-ray, MRI, CT, Ultrasound)
  3. Structured Reporting: Generating professional-grade diagnostic reports following medical standards
  4. Patient Communication: Translating complex findings into understandable explanations
  5. Research Integration: Incorporating current medical literature and evidence-based insights
  6. Quality Assurance: Implementing robust validation and error handling mechanisms

๐ŸŽฅ Application Demo

Medical Imaging Diagnosis Agent Demo

Complete workflow demonstration: Upload โ†’ Analysis โ†’ Professional Report โ†’ Download reports

๐Ÿš€ Demo Highlights


๐Ÿš€ Quick Start

Prerequisites

Option 1 โ€” Local (Python)

git clone https://github.com/HadirouTamdamba/AI-Diagnostic-Imaging-Agent.git
cd AI-Diagnostic-Imaging-Agent

python -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate
pip install -r requirements.txt

cp .env.example .env             # then set GOOGLE_API_KEY in .env (optional)
streamlit run src/app.py

Open http://localhost:8501. If GOOGLE_API_KEY is not set in .env, enter it in the sidebar.

Option 2 โ€” Run the published image (fastest, nothing to build)

The container image is published publicly to GitHub Container Registry โ€” no login required. It is multi-architecture (linux/amd64 + linux/arm64), so it runs natively on Intel/AMD machines and on Apple Silicon. Start it, then paste your API key in the sidebar:

docker run -p 8501:8501 ghcr.io/hadiroutamdamba/ai-diagnostic-imaging-agent:latest

Open http://localhost:8501. To pass the key up front instead, keep it on one line and put no space after = (quotes recommended):

docker run -p 8501:8501 -e GOOGLE_API_KEY="your_key" ghcr.io/hadiroutamdamba/ai-diagnostic-imaging-agent:latest

Passing the key on the command line stores it in your shell history. Prefer entering it in the sidebar, or use --env-file .env.

Images are built and published automatically by the release workflow on every version tag.

Option 3 โ€” Build locally with Docker Compose

cp .env.example .env             # set GOOGLE_API_KEY in .env
docker compose up --build -d

The app is available at http://localhost:8501. See DEPLOYMENT.md for Streamlit Community Cloud and production deployment details.

โ˜๏ธ AWS deployment (Infrastructure-as-Code)

Usage

  1. Enter your Google API key (sidebar) if not pre-configured
  2. Upload a medical image (JPG/PNG, max 5 MB)
  3. Click Analyze Image and wait 30โ€“120 s
  4. Review the structured report and download it as Markdown

Configuration (environment variables)

All variables are optional and can be set in .env (see .env.example):

Variable Default Description
GOOGLE_API_KEY โ€” Google AI Studio key (otherwise entered in the sidebar)
MODEL_ID gemini-flash-latest Gemini model used for analysis
FALLBACK_MODEL_ID gemini-3-flash-preview Model used automatically when the primary is overloaded (503) or out of quota (429)
ENABLE_WEB_SEARCH true Live web search for references; set false to use 1 request/analysis (saves quota)
DEFAULT_LANGUAGE en Default UI & report language (en/fr), switchable in the UI
MAX_IMAGE_SIZE 5242880 Max upload size in bytes (5 MB)
MAX_ANALYSIS_TIME 120 Analysis timeout displayed to users (s)
LOG_LEVEL INFO Application log verbosity

Run tests & quality checks

pip install -r requirements-dev.txt
pytest tests/ -v --cov=src          # unit tests + coverage
ruff check src/ tests/              # lint

# Optional: enable git hooks (lint + hygiene on every commit)
pip install pre-commit && pre-commit install

CI (GitHub Actions) runs lint, tests, a dependency security audit (pip-audit) and a Docker build + healthcheck smoke test on every push. Tagging a release (git tag v1.1.0 && git push --tags) automatically publishes the Docker image to GitHub Container Registry.


โ˜๏ธ Cloud & MLOps / LLMOps Engineering

Beyond the model itself, this project applies production engineering practices across the full lifecycle โ€” design, development, testing, deployment, and operation.

Infrastructure as Code (AWS)

CI/CD & DevOps

LLMOps (operating the Gemini agent)

Quality & Security


Supported Medical Imaging Modalities

๐Ÿฆด X-ray Imaging

๐Ÿง  Magnetic Resonance Imaging (MRI)

๐Ÿซ Computed Tomography (CT)

โค๏ธ Ultrasound Imaging


โš™๏ธ Technical Implementation Journey

Phase 1 - Problem Analysis & Architecture Design

Phase 2 - AI Model Integration & Optimization

Phase 3 - User Experience & Interface Development

Phase 4 - Validation & Production Readiness


API Requirements


๐Ÿš€ Features & Capabilities

Core Medical Analysis Features

Advanced Technical Features

Professional Development Standards


๐Ÿ—๏ธ Architecture : Core Components Architecture

1. MedicalImagingAgent (src/models/medical_agent.py)

Primary Responsibilities:

Key Methods:

2. ImageProcessor (src/utils/image_processor.py)

Primary Responsibilities:

Key Methods:

3. SessionValidator (src/utils/validators.py)

Primary Responsibilities:

Key Methods:


๐Ÿ”’ Security, Privacy & Compliance

Data Protection Protocols

Security Best Practices

Medical Compliance Standards


๐Ÿ“Š Performance & Optimization

Performance Metrics & Benchmarks

Optimization Features

Scalability Considerations


๐Ÿ“š Research Foundation & References

This AI Medical Imaging Diagnosis Agent is built upon cutting-edge research in Artificial Intelligence for healthcare, incorporating the latest advancements in medical imaging analysis and diagnostic support systems.

Scientific References

  1. AI Agents for Medical Image Analysis: RapidInnovation - AI Agents for Medical Image Analysis

  2. Diagnostic Imaging Revolution: ScienceDirect - AI in Diagnostic Imaging

  3. Healthcare Analytics Tools: Factspan - Top AI Medical Imaging Tools for Healthcare Analytics 2024

  4. CLAIM 2024 Guidelines: NCBI PMC - Checklist for Artificial Intelligence in Medical Imaging (CLAIM): 2024 Update

  5. Medical Imaging Breakthroughs: Collective Minds Health - Medical Imaging Research: 2024 Breakthroughs

  6. Best Practices Framework: PubMed - Best Practices for AI and ML in Medical Imaging

  7. Healthcare Analytics Transformation: Factspan - AI Medical Imaging Tools Transforming Healthcare 2025

  8. Innovation Survey: NCBI PMC - AI Shaping Medical Imaging Technology

  9. CLAIM Update Standards: RSNA - Checklist for AI in Medical Imaging 2024

  10. Technology Review: NCBI PMC - AI and ML for Medical Imaging Technology Review

Research Integration Philosophy

Our development approach integrates these research findings through:


External Resources


Commercial Use & Monetization

Please Note: While the Apache License 2.0 typically permits commercial use, this project is made available under a dual-licensing model to support its continued development and allow for future monetization.

Commercial use of this software, its components, or any derived works, requires a separate commercial license. This includes, but is not limited to, using the software in:

For inquiries regarding commercial licensing, custom solutions, or enterprise support, please contact Hadirou Tamdamba at hadirou.tamdamba@outlook.fr


This Medical Imaging Diagnosis Agent demonstrates the intersection of advanced AI technology and healthcare innovation. Every line of code, architectural decision, and user interface element reflects a commitment to technical excellence, clinical utility, and responsible AI development

Version: 1.1.0 Last Updated: July 2026 Developed by: Hadirou Tamdamba License: Apache 2.0