Skip to content

Repository files navigation

🏥 Cancer Detection Agentic System

Implementing Agentic AI for Medical Image Analysis in Multi-Cancer Diagnosis

MSc Dissertation Project — Computing and Digital Technologies

Python TensorFlow Claude API Flask License


📋 Overview

An end-to-end Agentic AI system that analyses medical images for multi-cancer diagnosis using a Vision Transformer routing model and a four-agent LLM pipeline. The system autonomously identifies cancer type, provides clinical interpretation, generates evidence-based recommendations, and produces a structured clinical decision-support report.

This project is part of an MSc dissertation investigating the implementation of agentic AI in medical image analysis — an emerging field where 91.9% of published research appeared only in 2024–2025 (Abbasian et al., 2025).


🏗️ System Architecture

System Architecture

🔬 Cancer Domains Supported

Domain Architecture Classes
Skin DenseNet201 Melanoma, Benign, Nevus
Oral EfficientNetB0 OSCC, Normal
Lung EfficientNetB0 ACA, Benign, SCC
Leukemia EfficientNetB0 ALL, Normal
Kidney EfficientNetB0 Tumour, Cyst, Normal, Stone
Brain EfficientNetB2 Glioma, Meningioma, Pituitary, Normal

🚀 Getting Started

Prerequisites

Python 3.12
TensorFlow 2.13

Installation

# Clone the repository
git clone https://github.com/yourusername/cancer-detection-agentic.git
cd cancer-detection-agentic

# Create virtual environment
python -m venv venv
venv\Scripts\activate  # Windows
source venv/bin/activate  # Mac/Linux

# Install dependencies
pip install -r requirements.txt

Configuration

Create a .env file in the root directory:

ANTHROPIC_API_KEY=your_claude_api_key_here

Download the ViT router model from Hugging Face:

from huggingface_hub import snapshot_download
snapshot_download(
    repo_id='ErnestBeckham/MulticancerViT',
    local_dir='models/weights/router/MulticancerViT'
)

Run

# Web interface
python app.py
# Open http://localhost:5000

# Command line
python main.py --image path/to/image.jpg --name "Patient Name" --age 45

🤖 Agentic AI Pipeline

The system implements sequential multi-agent orchestration where each agent receives the full context of all previous agents:

Agent Role Input Output
Router Agent Validates ViT prediction Model output Confidence assessment + routing decision
Analysis Agent Clinical interpretation Model + Agent 1 Cancer description + uncertainty flags
Recommendation Agent Next steps Model + Agents 1–2 Investigations + referrals
Report Agent Synthesises all outputs All prior outputs Structured clinical report

🖼️ Screenshots

Dashboard Analysis Agent Recommendations Clinical Report


⚠️ Disclaimer

This system is an AI-powered decision-support tool developed for academic research purposes. It does not constitute a clinical diagnosis. All outputs must be reviewed and validated by a qualified clinician before any clinical action is taken.


📚 Key References

  • Abbasian et al. (2025). Agentic AI is the future of cancer detection. ScienceDirect
  • Qiu et al. (2024). LLM-based agentic systems in medicine. Nature Machine Intelligence
  • Shamshad et al. (2023). Transformers in medical imaging. Medical Image Analysis
  • Dosovitskiy et al. (2021). An Image is Worth 16x16 Words. arXiv

👨‍💻 Author

Muhammad Haris MSc Computing and Digital Technologies (Northumbria University London)


📄 License

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

About

Agentic AI system for multi-cancer medical image analysis using ViT routing and 4-agent LLM pipeline

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages