Skip to content

Add CheXlocalize dataset support (CheXpert official val/test + segmentation masks) #192

Description

@AmlanMishra2004

Proposal

Add a CheXlocalize_Dataset loader for CheXlocalize (Saporta et al., Nature Machine Intelligence 2022, https://doi.org/10.1038/s42256-022-00536-x): the official CheXpert validation/test images and labels, plus radiologist ground-truth segmentation masks for 10 pathologies — one of the contribution areas explicitly called out in CONTRIBUTING.md ("segmentation masks").

Why not CheX_Dataset

CheX_Dataset can't load this data as-is:

  • It assumes Sex/Age/Frontal-Lateral/AP-PA columns exist. CheXlocalize's blinded official test_labels.csv omits them to prevent re-identification of the test set — loading it with CheX_Dataset raises KeyError: 'Frontal/Lateral' (confirmed against the real download).
  • Even with those columns present, it infers the train/valid split by string-matching 'train'/'valid' in the CSV path, and raises a bare NotImplementedError otherwise — which also fails on CheXlocalize's test_labels.csv.

Planned implementation

A new CheXlocalize_Dataset(Dataset) class, mirroring CheX_Dataset's constructor/label conventions but:

  • synthesizing safe defaults for the missing demographic/view columns instead of assuming they exist,
  • extracting patient IDs/views without depending on the split name,
  • normalizing CheXlocalize's path quirks (CheXpert-v1.0/ prefix, valid/ CSV prefix vs. val/ directory on disk),
  • adding pathology_masks=True + segmentation_jsonpath=... support for CheXlocalize's ground-truth segmentation JSON (COCO RLE via pycocotools), following the same pattern as SIIM_Pneumothorax_Dataset.get_pathology_mask_dict.

I already have this implemented and verified (including against a real CheXlocalize download — test/val sample counts match the documented patient counts, and decoded masks match the CSV labels for spot-checked patients). Opening this issue per CONTRIBUTING.md before the PR; PR is up at #191.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions