Model Card: MedGemma DSA LoRA Adapter (ds-lora)

Model Details

Model Description

This repository contains a LoRA adapter fine-tuned for Digital Subtraction Angiography (DSA) vessel patency triage.

The adapter is intended to improve sensitivity for blocked/occluded vessel patterns compared with naive base-model prompting on heavily imbalanced data.

  • Developed by: DataRabbit hackathon team
  • Base model: google/medgemma-1.5-4b-it
  • Model type: Vision-language LoRA adapter (PEFT)
  • Primary task: Binary DSA support classification (patent vs blocked)
  • Language: English (prompts/output)
  • License: Follows base model terms and license restrictions
  • Finetuned from model: google/medgemma-1.5-4b-it

Model Sources

Intended Uses

Direct Use

  • Rapid DSA image triage support in a controlled evaluation pipeline.
  • Experimental decision-support where output is always reviewed by a clinician.

Downstream Use

  • Can be routed only for DSA/XA series in a multi-stage pipeline (e.g., PACS worker).
  • Can be merged into a standalone model for simpler deployment.

Out-of-Scope Use

  • Not for autonomous diagnosis.
  • Not for emergency triage without human oversight.
  • Not validated for non-DSA modalities (CT, MR, US, X-ray).
  • Not intended for pediatric/special populations without dedicated validation.

Bias, Risks, and Limitations

  • Performance can degrade under domain shift (scanner/protocol/institution changes).
  • Small and previously imbalanced blocked-vessel class is a key risk.
  • Model outputs can be verbose or overconfident; structured post-processing is recommended.
  • False negatives remain clinically high-risk.

Clinical Safety Recommendations

  • Use as decision support only, never as final diagnosis.
  • Always combine with human radiology review.
  • Route uncertain/low-confidence outputs to manual review.
  • Monitor sensitivity/specificity continuously on newly ingested data.

How to Use

Load base model + LoRA adapter

import torch
from transformers import AutoModelForImageTextToText, AutoProcessor
from peft import PeftModel

base_model_id = "google/medgemma-1.5-4b-it"
adapter_id = "s0close/medgemma-dsa-lora"

processor = AutoProcessor.from_pretrained(base_model_id)
base_model = AutoModelForImageTextToText.from_pretrained(
    base_model_id,
    torch_dtype=torch.bfloat16,
    device_map="auto",
)
model = PeftModel.from_pretrained(base_model, adapter_id)
model.eval()

Optional: merge adapter for standalone inference

Use: tools/publish_dsa_merged_model.py

Training Details

Training Data

  • Internal DSA dataset prepared for vessel patency classification.
  • Conversational VLM format (messages with image + text supervision).
  • De-identified data expected; no PHI should be stored in the model artifacts.

Training Procedure

  • QLoRA fine-tuning on Hugging Face Jobs.
  • Quantization: 4-bit NF4 with double quantization.
  • Compute dtype: bfloat16.

Hyperparameters (default project config)

  • LoRA rank (r): 8
  • LoRA alpha: 16
  • LoRA dropout: 0.1
  • Target modules: all-linear
  • Learning rate: 2e-5 (script default)
  • Batch size: 1
  • Gradient accumulation: 8
  • Epochs: 2 (script default)

Evaluation

Evaluation Setup

  • Primary metrics: accuracy, sensitivity (blocked recall), specificity.
  • Internal prior baseline showed a strong class-imbalance failure mode:
    • very high accuracy with near-zero blocked sensitivity when predicting majority class.

Current Results

  • Run-specific results should be reported from the latest training_run.json and evaluation outputs in your HF run artifacts.
  • Do not claim clinical-grade performance without external multi-site validation.

Technical Specifications

Architecture

  • Base: MedGemma 1.5 4B instruction-tuned vision-language model.
  • Adaptation: PEFT LoRA heads trained for DSA classification prompts.

Infrastructure

  • Typical training flavor: Hugging Face Jobs on L4.
  • Inference: CUDA/CPU depending on deployment constraints.

Ethical and Regulatory Notice

This model is a research artifact for hackathon/prototyping workflows. It is not a medical device and has not undergone regulatory approval. Any clinical use requires formal validation, governance, and compliance review.

Contact

For project-level questions, use your team repository issue tracker or designated team contact.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support