Downloads · 30 days
92
4% of all-time downloads
Luffy503/UniBiomed
UniBiomed is a machine learning model from Luffy503. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
<div align="center" <h1UniBiomed: A Universal Foundation Model for Grounded Biomedical Image Interpretation</h1
Downloads · 30 days
92
4% of all-time downloads
All-time downloads
2.1K
Public
Parameters
1.2B
8.1 GB on disk
Likes
9
Public
Click a slice to open those files.
.safetensors4 GB · 100%
How the weights are stored.
F32860M · 74%
From the Hugging Face model README
<a href="https://arxiv.org/abs/2504.21336"><img src='https://img.shields.io/badge/arXiv-Preprint-red' alt='Paper PDF'></a> <a href='https://huggingface.co/Luffy503/UniBiomed'><img src='https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Models-blue'></a> <a href='https://huggingface.co/datasets/Luffy503/UniBiomed'><img src='https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Dataset-green' alt='Dataset'></a>
</div>We introduce UniBiomed, the first universal foundation model for grounded biomedical image interpretation, which is capable of generating accurate diagnostic findings and simultaneously segmenting the corresponding biomedical targets. UniBiomed is based on a novel integration of Multi-modal Large Language Model (MLLM) and Segment Anything Model (SAM), which can effectively unify diverse biomedical tasks in universal training for advancing grounded interpretation.
Github link: https://github.com/Luffy03/UniBiomed
We will consistently update more powerful versions of models in this repo.
import argparse
import torch
from transformers import (AutoModel, AutoTokenizer,
BitsAndBytesConfig, CLIPImageProcessor,
GenerationConfig)
def parse_args():
parser = argparse.ArgumentParser(description='UniBiomed')
parser.add_argument('--model_path', default='Luffy503/UniBiomed')
return args
args = parse_args()
# load model
model = AutoModel.from_pretrained(
args.model_path,
torch_dtype=torch.bfloat16,
low_cpu_mem_usage=True,
use_flash_attn=True,
trust_remote_code=True,
).eval().cuda()
tokenizer = AutoTokenizer.from_pretrained(
args.model_path,
trust_remote_code=True,
)
# define data input, image and text instruction
data_dict = {}
image, text = None, None
data_dict['image'] = image
data_dict['text'] = text
# output
pred_dict = model.predict_forward(**data_dict, tokenizer=tokenizer)
# text description
prediction = pred_dict['prediction']
# segmentation mask
mask = pred_dict['prediction_masks'][0][0]
If you find this repo useful for your research, please consider citing the paper as follows:
@article{wu2025unibiomed,
title={UniBiomed: A Universal Foundation Model for Grounded Biomedical Image Interpretation},
author={Wu, Linshan and Nie, Yuxiang and He, Sunan and Zhuang, Jiaxin and Chen, Hao},
journal={arXiv preprint arXiv:2504.21336},
year={2025}
}