🚀 RadioCare
RadioCare致力于开发一款先进的图像转文本模型,能够为胸部X光图像生成准确的放射学报告和诊断结果。该模型借助BLIP和视觉Transformer架构,简化诊断流程,实现更快速、准确地识别健康问题,尤其能满足农村等医疗资源有限地区对及时、精准放射学评估的迫切需求,最终改善患者治疗效果,缩小加拿大各地医疗可及性差距。
🚀 快速开始
若要使用此模型,请使用您的MIMIC - CXR访问权限申请访问以获得批准。
✨ 主要特性
- 基于BLIP(“Salesforce/blip - image - captioning - large”)模型在MIMIC - CXR数据集上进行微调,能根据胸部X光和临床指征(如“评估肺炎”)生成准确的放射学报告。
- 利用BLIP和视觉Transformer架构,简化诊断流程,提高诊断速度和准确性。
- 模型评估胸部X光大约仅需3秒,使医生的诊断过程提速99%。
📦 安装指南
文档未提供具体安装步骤,可参考GitHub仓库获取训练和推理代码。
💻 使用示例
基础用法
from PIL import Image
from transformers import BlipForConditionalGeneration, BlipProcessor
processor = BlipProcessor.from_pretrained("adibvafa/BLIP-MIMIC-CXR")
model = BlipForConditionalGeneration.from_pretrained("adibvafa/BLIP-MIMIC-CXR")
image = 'chest-x-ray.jpg'
prompt = 'final report\nexamination: chest (pa and lat)\nindication: ___f with chest pressure, uri sx, voice change.'
inputs = processor(
images=Image.open(image),
text=prompt,
return_tensors="pt"
)
output = model.generate(**inputs, max_length=512)
report = processor.decode(output[0], skip_special_tokens=True)
输出示例
### report will be like follows:
final report
examination : chest ( pa and lat )
indication : ___f with chest pressure, uri sx, voice change.
comparison : none
findings : pa and lateral views of the chest provided. there is no focal consolidation, effusion, or pneumothorax. the cardiomediastinal silhouette is normal. imaged osseous structures are intact. no free air below the right hemidiaphragm is seen.
impression : no acute intrathoracic process.
📚 详细文档
数据
Radiocare使用了PhysioNet上MIMIC - CXR数据库的数据,该数据库包含大量胸部X光图像及相关的放射学报告,为模型的训练和评估提供了全面的医学图像资源。
模型架构
Radiocare采用了BLIP(Bootstrapped Language - Image Pre - training)模型,该模型将视觉Transformer(ViT)架构与文本解码器相结合。ViT通过将图像分割成固定大小的图像块,将这些图像块转换为高维向量,然后嵌入到标记中。ViT中的自注意力机制能够捕捉图像块之间的全局依赖关系,增强模型对整个图像的理解。文本解码器将这些视觉特征转换为连贯的放射学报告,实现详细而准确的诊断。
结果
Radiocare的模型评估胸部X光大约仅需3秒,使医生的诊断过程提速99%。关键性能指标如下:
- Bert分数:47.2
- RadGraph:26.1
讨论
Radiocare通过利用先进的AI技术,从胸部X光图像生成准确、及时的放射学报告,是医学诊断领域的一项重大进展。BLIP模型和视觉Transformer架构的结合优化了诊断流程,确保了更快、更可靠的诊断结果。该项目满足了关键的医疗需求,特别是在医疗资源匮乏的农村地区,有望改善患者治疗效果,缩小加拿大各地医疗可及性差距。
团队信息
Radiocare是Borealis AI的“Let's SOLVE It”项目2024年春季批次的一部分。项目团队成员包括:
仓库结构
仓库结构如下:
- data_modules/:包含数据加载和预处理脚本。
- evals/:包含评估脚本和指标计算。
- models/:包含不同的模型架构。
- blip/:使用BLIP和ViT实现的最终模型。
- cnn/:卷积神经网络模型。
- vit/:视觉Transformer模型。
- utils/:项目的实用函数。
- slurm/:用于在计算集群上运行作业的SLURM批处理脚本。
📄 许可证
本项目采用Apache 2.0许可证。
📖 引用
如果您在研究中使用了此成果,请按以下格式引用:
@misc {adibvafa_fallahpour_2024,
author = { Fallahpour, Adibvafa and Srivastava, Archita and Dhillon, Mantaj and Liu, Grace },
title = { BLIP-MIMIC-CXR },
year = 2024,
url = { https://huggingface.co/adibvafa/BLIP-MIMIC-CXR },
doi = { 10.57967/hf/3207 },
publisher = { Hugging Face }
}