Skip to content

Repository for the paper "Slicing Through Bias: Explaining Performance Gaps in Medical Image Analysis using Slice Discovery Methods"

License

Notifications You must be signed in to change notification settings

volesen/slicing-through-bias

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

slicing-through-bias

Repository for the MICCAI 2024 FAIMI workshop paper Slicing Through Bias: Explaining Performance Gaps in Medical Image Analysis using Slice Discovery Methods

A fork of the code for the 2023 FAIMI paper Are Sex-based Physiological Differences the Cause of Gender Bias for Chest X-ray Diagnosis? is used to export the embeddings used in the paper.

This repository contains the code for

  1. Dimensionality reductions of the exported embeddings
  2. Generating figures for the paper

Generating embeddings

Follow the instructions given in the forked repository to download the data and generate the embeddings.

The labels for the datasets, see datafiles/, have been augmented by adding a Drain column, kindly provided by the authors of Augmenting Chest X-ray Datasets with Non-Expert Annotations and Detecting Shortcuts in Medical Images -- A Case Study in Chest X-rays.

With the forked repository as the current working directory, the embeddings can be generated by running the following commands:

python prediction/disease_prediction.py -s <dataset> -d <disease> -f 0 50 100 -n 1 -r 0-10 -p <img-dir> --run_dir <run-directory>

For the paper, embeddings where generated for the following diseases: Atelectasis and Pneumothorax on NIH and chexpert. The artifacts generated by the command will be saved in the <run-directory> and is used in the following steps.

Dimensionality reduction

The remaining steps are caried in the cxr enviroment created using the following command:

conda env create -f environment.yml

To apply dimensionality reduction to the embeddings, run the following command:

python embeddings.py --path <run-directory> --dataset=<dataset> --dimension <embedding-dimension>

This will save the embeddings with the specified dimension in the <run-directory>. In the final paper, we used the embeddings with 128 dimensions.

Generating figures

The figures in the paper can be generated by running the following commands:

python comorbidity_plot.py --path <run-directory> --dataset=<dataset> --disease=<disease> --case=<case> --output=<output-directory>

The plots were generated with case set to positive and negative. Further, a --drain flag is included for analyses including the Drain column.

About

Repository for the paper "Slicing Through Bias: Explaining Performance Gaps in Medical Image Analysis using Slice Discovery Methods"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages