MedMKG / README.md
xcwangpsu's picture
Update README.md
8148c26 verified
metadata
license: mit
task_categories:
  - feature-extraction
language:
  - en
tags:
  - medical
size_categories:
  - 10K<n<100K
pretty_name: MedMKG

RADM: Radiological Multimodal Knowledge Graph

We introduce RADM, a a Radiological Multimodal Knowledge Graph that seamlessly fuses clinical concepts with medical images.
MedMKG is constructed via a multi-stage pipeline that accurately identifies and disambiguates medical concepts while extracting their interrelations.
To ensure the conciseness of the resulting graph, we further employ a pruning strategy based on our novel Neighbor-aware Filtering (NaF) algorithm.


πŸ“‚ Provided Files

This repository contains:

  • RADM.csv β€” biomedical triplets: Head, Relation, Tail, Head_Name, Tail_Name
  • image_mapping.csv β€” image ID to relative path mappings

Note: The images themselves are not included. Users must download MIMIC-CXR-JPG separately and specify their local path.

πŸ“¦ About MIMIC-CXR-JPG

MIMIC-CXR-JPG is a large publicly available dataset of chest radiographs in JPEG format, sourced from the Beth Israel Deaconess Medical Center in Boston.

Access Instructions

To use the image data, you must request access and agree to the data use agreement, which includes:

  1. You will not share the data.
  2. You will not attempt to reidentify individuals.
  3. Any publication using the data will make the relevant code available.

Download options:

  • ZIP download

  • Google BigQuery access

  • Google Cloud Storage Browser access

  • Command-line download:

    wget -r -N -c -np --user your_username --ask-password https://physionet.org/files/mimic-cxr-jpg/2.1.0/
    

πŸ”§ Usage Example

Below is a demo script to load and link the knowledge graph with your local image data:

import pandas as pd

kg_path = "RADM.csv"
mapping_path = "image_mapping.csv"

# Load CSVs
kg_df = pd.read_csv(kg_path)
mapping_df = pd.read_csv(mapping_path)

# Local path to downloaded MIMIC-CXR images
local_root = "/path/to/your/mimic-cxr-jpg"

# Map image IDs to full paths
iid_to_path = {
    row["IID"]: f"{local_root}/{row['Image_Path']}"
    for _, row in mapping_df.iterrows()
}

# Merge image path info into KG
kg_df["Head_Path"] = kg_df["Head"].map(iid_to_path)
kg_df["Tail_Path"] = kg_df["Tail"].map(iid_to_path)

print(kg_df.head())

Benchmark Instruction

We cover codes for three downstream tasks detailed in our paper, including link prediction, knowledge-augmented visual question answering, and knowledge-augmented text-image retrieval. You may check the three folders and execute the following:

python main.py

after specifying your local paths of data files.