🚀 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 }
}