Home

Awesome

VLCI

This is the implementation of Cross-Modal Causal Intervention for Medical Report Generation. It contains the codes of the Visual-Linguistic Pre-training (VLP), and fine-tuning via Visual-Linguistic Causal Intervention (VLCI) on IU-Xray/MIMIC-CXR dataset.

<div align=center> <img src="vlci.png" alt="图片替换文本" width="1024" /> </div>

Requirements

All the requirements are listed in the requirements.yaml file. Please use this command to create a new environment and activate it.

conda env create -f requirements.yaml
conda activate mrg

Preparation

  1. Datasets: You can download the dataset via data/datadownloader.py, or download from the repo of R2Gen. Then, unzip the files into data/iu_xray and data/mimic_cxr, respectively.
  2. Models: We provide the well-trained models of VLCI for inference, and you can download from here.
  3. Please remember to change the path of data and models in the config file (config/*.json).

Evaluation

python main.py -c config/iu_xray/vlci.json
<div align=center>
ModelB@1B@2B@3B@4CRM
R2Gen0.4700.3040.2190.165/0.3710.187
CMCL0.4730.3050.2170.162/0.3780.186
PPKED0.4830.3150.2240.1680.3510.3760.190
CA0.4920.3140.2220.169/0.3810.193
AlignTransformer0.4840.3130.2250.173/0.3790.204
M2TR0.4860.3170.2320.173/0.3900.192
MGSK0.4960.3270.2380.1780.3820.381/
RAMT0.4820.3100.2210.165/0.3770.195
MMTN0.4860.3210.2320.1750.3610.375/
DCL///0.1630.5860.3830.193
VLCI0.5050.3340.2450.1890.4560.3970.204
</div>
python main.py -c config/mimic_cxr/vlci.json
<div align=center>
ModelB@1B@2B@3B@4CRMCE-PCE-RCE-F1
R2Gen0.3530.2180.1450.103/0.2770.1420.3330.2730.276
CMCL0.3340.2170.1400.097/0.2810.133///
PPKED0.3600.2240.1490.1060.2370.2840.149///
CA0.3500.2190.1520.109/0.2830.1510.3520.2980.303
AlignTransformer0.3780.2350.1560.112/0.2830.158///
M2TR0.3780.2320.1540.107/0.2720.1450.2400.4280.308
MGSK0.3630.2280.1560.1150.2030.284/0.4580.3480.371
RAMT0.3620.2290.1570.113/0.2840.1530.3800.3420.335
MMTN0.3790.2380.1590.116/0.2830.161///
DCL///0.1090.2810.2840.1500.4710.3520.373
VLCI0.4000.2450.1650.1190.1900.2800.1500.4890.3400.401
</div>

Citation

If you use this code for your research, please cite our paper.

@misc{chen2023crossmodal,
      title={Cross-Modal Causal Intervention for Medical Report Generation}, 
      author={Weixing Chen and Yang Liu and Ce Wang and Jiarui Zhu and Guanbin Li and Liang Lin},
      year={2023},
      eprint={2303.09117},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

Contact

If you have any question about this code, feel free to reach me (chen867820261@gmail.com)

Acknowledges

We thank R2Gen for their open source works.