模型:

nathansutton/generate-cxr

英文

生成CXR

这个BlipForConditionalGeneration模型根据胸部X射线和临床指征(例如“RLL crackles, eval for pneumonia”)生成逼真的放射学报告。

  • 开发者:Nathan Sutton
  • 模型类型:BLIP
  • 语言:英语
  • 许可证:Apache 2.0
  • 模型基于:Salesforce/blip-image-captioning-large

模型来源

超出范围的用途

任何医疗应用。

如何开始使用模型

from PIL import Image
from transformers import BlipForConditionalGeneration, BlipProcessor

# read in the model
processor = BlipProcessor.from_pretrained("nathansutton/generate-cxr")
model = BlipForConditionalGeneration.from_pretrained("nathansutton/generate-cxr")

# your data
my_image = 'my-chest-x-ray.jpg'
my_indication = 'RLL crackles, eval for pneumonia'

# process the inputs
inputs = processor(
    images=Image.open(my_image), 
    text='indication:' + my_indication,
    return_tensors="pt"
)

# generate an entire radiology report
output = model.generate(**inputs,max_length=512)
report = processor.decode(output[0], skip_special_tokens=True)

培训细节

通过将MIMIC-CXR中的放射学报告与MIMIC-CXR-JPG中的图像进行交叉参考来训练此模型。这些数据不在此处提供,需要与physionet签署数据使用协议。