hcpcvlr

CausalVLR: A Toolbox and Benchmark for Visual-Linguistic Causal Reasoning (视觉-语言因果推理开源框架)


Keywords
causal, causal-inference, visual-linguistic
License
MIT
Install
pip install hcpcvlr==0.0.1

Documentation

CausalVLR is a python open-source framework for causal relation discovery, causal inference that implements state-of-the-art causal learning algorithms for various visual-linguistic reasoning tasks, such as VQA, Image/Video Captioning, Model Generalization and Robustness, Medical Report Generation, etc.

PyPI docs badge license open issues issue resolution

📘Documentation | 🛠️Installation | 👀Model Zoo | 🆕Update News | 🚀Ongoing Projects | 🤔Reporting Issues


📄 Table of Contents

📚 Introduction 🔝

Causal-VLR is a python open-source framework based on PyTorch for causal relation discovery, causal inference that implements state-of-the-art causal learning algorithms for various visual-linguistic reasoning tasks, detail see on Documentation.

Framework Overview

Image

Major features
  • Modular Design

    We decompose the causal framework of visual-linguistic tasks into different components and one can easily construct a customized causal-reasoning framework by combining different modules.

  • Support of multiple tasks

    The toolbox directly supports multiple visual-linguistic reasoning tasks such as VQA, Image/Video Caption, Medical Report Generation, Model Generalization and Robustness and so on.

  • State of the art

    The toolbox stems from the codebase developed by the HCPLab team, who dedicated to solving a variety of complex logic tasks through causal reasoning, and we keep pushing it forward.

Note: The framework is actively being developed. Feedbacks (issues, suggestions, etc.) are highly encouraged.

🚀 What's New 🔝

🔥 2023.6.29.

  • v0.0.1 was released in 6/30/2023
  • Support VLCI for Medical Report Generation task
  • Support CMCIR (T-PAMI 2023) for Event-Level Visual Question Answering task
  • Support VCSR for Visual Causal Scene Discovery task
  • Support Robust Fine-tuning (CVPR 2023) for Model Generalization and Robustness


VLCI-Visual Causal Intervention for Radiology Report Generation

Image

Dataset B@1 B@2 B@3 B@4 Meteor Rough-L CIDEr
IU-Xray 50.5 33.4 24.5 18.9 20.4 39.7 45.6
MIMIC-CXR 39.6 24.3 16.3 11.7 14.9 28.1 15.7

CMCIR-Cross-modal Causal Intervention for Event-level Video Question Answering

Image

Method Basic Attribution Introspection Counterfactual Forecasting Reverse All
VQAC 34.02 49.43 34.44 39.74 38.55 49.73 36.00
MASN 33.83 50.86 34.23 41.06 41.57 50.80 36.03
DualVGR 33.91 50.57 33.40 41.39 41.57 50.62 36.07
HCRN 34.17 50.29 33.40 40.73 44.58 50.09 36.26
CMCIR 36.10 (+1.93) 52.59 (+1.73) 38.38 (+3.94) 46.03 (+4.64) 48.80 (+4.22) 52.21 (+1.41) 38.58 (+1.53)

👨‍🏫 Getting Started 🔝

Please see Overview for the general introduction of Causal-VLR.

For detailed user guides and advanced guides, please refer to our documentation, and here is the code structure of toolbox.

Image

Installation

Please refer to Installation for installation instructions in documentation.

Briefly, to use Causal-VLR, we could install it using pip:

pip install Causal-VLR

Running examples

For causal discovery, there are various running examples in the ‘tests’ directory.

For the implemented modules, we provide unit tests for the convenience of developing your own methods.

👀 Model Zoo 🔝

Please feel free to let us know if you have any recommendation regarding datasets with high-quality. We are grateful for any effort that benefits the development of causality community.

Task Model Benchmark
Medical Report Generation VLCI IU-Xray, MIMIC-CXR
VQA CMCIR SUTD-TrafficQA, TGIF-QA, MSVD-QA, MSRVTT-QA
Visual Causal Scene Discovery VCSR NExT-QA, Causal-VidQA, and MSRVTT-QA
Model Generalization and Robustness Robust Fine-tuning ImageNet-V2, ImageNet-R, ImageNet-Sketch, ObjectNet, ImageNet-A

🎫 License 🔝

This project is released under the Apache 2.0 license.

🖊️ Citation🔝

If you find this project useful in your research, please consider cite:

@misc{liu2023causalvlr,
      title={CausalVLR: A Toolbox and Benchmark for Visual-Linguistic Causal Reasoning}, 
      author={Yang Liu and Weixing Chen and Guanbin Li and Liang Lin},
      year={2023},
      eprint={2306.17462},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

🙌 Contribution 🔝

Please feel free to open an issue if you find anything unexpected. We are always targeting to make our community better!

🤝 Acknowledgement 🔝

Causal-VLR is an open-source project and We appreciate all the contributors who implement their methods or add new features and users who give valuable feedback. We wish that the toolbox and benchmark could serve the growing research community by providing a flexible toolkit to reimplement existing methods and develop their new models.

🪐 The review paper here can provide some help

Causal Reasoning Meets Visual Representation Learning: A Prospective Study
Machine Intelligence Research (MIR) 2022
A Review paper for causal reasoning and visual representation learning
Image

@article{liu2022causal,
  title={Causal Reasoning Meets Visual Representation Learning: A Prospective Study},
  author={Liu, Yang and Wei, Yu-Shen and Yan, Hong and Li, Guan-Bin and Lin, Liang},
  journal={Machine Intelligence Research},
  pages={1--27},
  year={2022},
  publisher={Springer}