Giter Club home page Giter Club logo

dcl's Introduction

DCL

Official code for "Dynamic Graph Enhanced Contrastive Learning for Chest X-ray Report Generation" (CVPR 2023)

In this paper, we present a practical approach to leverage dynamic graph to enhance contrastive learning for radiology report generation. In which the dynamic graph is constructed in a bottom-up manner to integrate retrieved specific knowledge with general knowledge. Then contrastive learning is employed to improve visual and textual representations, which also promises the accuracy of our dynamic graph. Experiments on two popular benchmarks verify the effectiveness of our method in generating accurate and meaningful reports

Requirements

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

conda create --name DCL --file requirements.txt
conda activate DCL

Data

Please download the IU and MIMIC datasets, and place them in the ./dataset/ folder.

  • IU dataset from here
  • MIMIC dataset from here
  • We prvoide the annotation files and knowledge files for both datasets. Please download from here, and place them in the ./annotations/ folder

Training and Testing

The source code for training and testing is main.py. To run this code, please use the following command:

CUDA_VISIBLE_DEVICES=0,1,2,3 TORCH_DISTRIBUTED_DEBUG=DETAIL python -m torch.distributed.run --nproc_per_node=2 --master_port=21073 main.py --config ./configs/BLIP.yaml --output_dir output/Generation --dataset_name iu_xray --distributed True --batch_size 8 --epochs 50 --save_dir results/test --bert sci

Citation

If you find the code useful, please cite our paper:

@article{li2023dynamic,
  title={Dynamic Graph Enhanced Contrastive Learning for Chest X-ray Report Generation},
  author={Li, Mingjie and Lin, Bingqian and Chen, Zicong and Lin, Haokun and Liang, Xiaodan and Chang, Xiaojun},
  journal={arXiv preprint arXiv:2303.10323},
  year={2023}
}

Contact

If you are interested in work or have any questions, please connect us: [email protected]

Acknowledges

We thank BLIP and R2Gen for their open source works.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.