SALAD: Score-based Adaptive Learning via Auxiliary Disease Classifier for Radiology Report Generation
1. Prepare the code and the environment
- Git clone our repository and create a new conda environment.
conda create -n SALAD python=3.9 -y
conda activate SALAD- Install the requirements.
pip install -r requirements.txt- Modify the code of the Transformers library for score-based adaptive learning.
In transformers/models/llama/modeling_llama.py,
replace loss_fct = CrossEntropyLoss() with loss_fct = nn.CrossEntropyLoss(reduction='none')
2. Prepare the training dataset
IU-Xray
MIMIC-CXR
CheXpert Plus
bash scripts/run_iu.shbash scripts/run_mimic.shbash scripts/run_chexpert.shbash scripts/test_iu.shbash scripts/test_mimic.shbash scripts/test_chexpert.shThis repository is under BSD 3-Clause License.