Downloads · 30 days
144
15% of all-time downloads
pamessina/medgemma-4b-it-cure
medgemma-4b-it-cure is a image-text-to-text model from pamessina. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as other.
[](https://pablomessina.github.io/cure-project-page/) [](https://colab.research.google.com/drive/1E4OyQZ58tvqCrMB-zWQ6rb-yJtZ9wAQL?usp=sharing) [](https://github.com/PabloMessina/CURE)
Downloads · 30 days
144
15% of all-time downloads
All-time downloads
933
Public
Repo size
2.9 GB
Likes
0
Public
Click a slice to open those files.
.safetensors2.8 GB · 99%
From the Hugging Face model README
Accepted as an Oral Presentation at CVPR 2026.
CURE (Curriculum-guided Multi-task Training) is an error-aware curriculum learning framework that improves grounding and report quality for medical vision-language models without any additional data.
Grounded medical Vision-Language Models often learn to associate the task of visual grounding exclusively with predicting abnormalities due to abnormality-biased datasets. This causes strong prior models to hallucinate abnormalities when asked to ground normal anatomy. CURE directly addresses this through a novel task structure and an adaptive training strategy.
Main Takeaways: Ground and describe normal anatomy too, and use adaptive sampling to overcome medical data imbalance.
For the easiest way to run inference, including our custom image transformation pipeline (which is crucial for replicating optimal performance) and bounding box visualizations, please use our official Colab notebook:
You can load the base model and the CURE PEFT adapter using 4-bit quantization for efficient inference.
import torch
from transformers import AutoModelForImageTextToText, AutoProcessor, BitsAndBytesConfig
from peft import PeftModel
# Configuration
BASE_MODEL_ID = "google/medgemma-4b-it"
ADAPTER_ID = "pamessina/medgemma-4b-it-cure"
# 4-bit Quantization Config (Must match training settings)
quantization_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_use_double_quant=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16,
bnb_4bit_quant_storage=torch.bfloat16,
)
# Load Model
base_model = AutoModelForImageTextToText.from_pretrained(
BASE_MODEL_ID,
quantization_config=quantization_config,
torch_dtype=torch.bfloat16,
device_map="auto",
)
# Load the LoRA adapter onto the base model
model = PeftModel.from_pretrained(base_model, ADAPTER_ID)
# Load the processor
processor = AutoProcessor.from_pretrained(BASE_MODEL_ID)
processor.tokenizer.padding_side = "left"
model.eval()
print("CURE model and processor are ready for inference.")
Note: For the full inference script, including the required get_pil_with_augmentations_transforms Albumentations setup, please refer to the GitHub Repository or the Colab link above.
If you find this work useful, please cite our CVPR 2026 paper:
@InProceedings{Messina_2026_CVPR,
author = {Messina, Pablo and Villa, Andr\'es and Alcazar, Juan Leon and Sanchez, Karen and Hinojosa, Carlos and Parra, Denis and Soto, Alvaro and Ghanem, Bernard},
title = {CURE: Curriculum-guided Multi-task Training for Reliable Anatomy Grounded Report Generation},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2026},
pages = {36279-36289}
}