Dataset Preview
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed because of a cast error
Error code:   DatasetGenerationCastError
Exception:    DatasetGenerationCastError
Message:      An error occurred while generating the dataset

All the data files must have the same columns, but at some point there are 6 new columns ({'trachea_point_right', 'aortic_knob_xmax', 'trachea_width', 'trachea_point_left', 'aortic_knob_xmin', 'aortic_knob_width'}) and 5 missing columns ({'y_heart_max', 'y_start', 'distance_upper', 'y_end', 'distance_lower'}).

This happened while the csv dataset builder was generating data using

hf://datasets/ttumyche/CheXStruct/nih_cxr14/aortic_knob_enlargement.csv (at revision 39074801745758a2b0a646c344ac401137427575)

Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1831, in _prepare_split_single
                  writer.write_table(table)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py", line 644, in write_table
                  pa_table = table_cast(pa_table, self._schema)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2272, in table_cast
                  return cast_table_to_schema(table, schema)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2218, in cast_table_to_schema
                  raise CastError(
              datasets.table.CastError: Couldn't cast
              image_file: string
              viewposition: string
              aortic_knob_width: double
              aortic_knob_xmin: double
              aortic_knob_xmax: int64
              trachea_width: int64
              trachea_point_right: string
              trachea_point_left: string
              ratio: double
              label: bool
              -- schema metadata --
              pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 1517
              to
              {'image_file': Value('string'), 'viewposition': Value('string'), 'ratio': Value('float64'), 'distance_upper': Value('float64'), 'distance_lower': Value('float64'), 'y_start': Value('float64'), 'y_heart_max': Value('float64'), 'y_end': Value('float64'), 'label': Value('float64')}
              because column names don't match
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1456, in compute_config_parquet_and_info_response
                  parquet_operations = convert_to_parquet(builder)
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1055, in convert_to_parquet
                  builder.download_and_prepare(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 894, in download_and_prepare
                  self._download_and_prepare(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 970, in _download_and_prepare
                  self._prepare_split(split_generator, **prepare_split_kwargs)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1702, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1833, in _prepare_split_single
                  raise DatasetGenerationCastError.from_cast_error(
              datasets.exceptions.DatasetGenerationCastError: An error occurred while generating the dataset
              
              All the data files must have the same columns, but at some point there are 6 new columns ({'trachea_point_right', 'aortic_knob_xmax', 'trachea_width', 'trachea_point_left', 'aortic_knob_xmin', 'aortic_knob_width'}) and 5 missing columns ({'y_heart_max', 'y_start', 'distance_upper', 'y_end', 'distance_lower'}).
              
              This happened while the csv dataset builder was generating data using
              
              hf://datasets/ttumyche/CheXStruct/nih_cxr14/aortic_knob_enlargement.csv (at revision 39074801745758a2b0a646c344ac401137427575)
              
              Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

image_file
string
viewposition
string
ratio
float64
distance_upper
float64
distance_lower
float64
y_start
float64
y_heart_max
float64
y_end
float64
label
float64
00007624_037
AP
0.125413
909
114
0
909
1,023
1
00006302_000
PA
0.228091
833
190
0
833
1,023
1
00019056_007
AP
0.147026
891
131
0
891
1,022
1
00029559_000
PA
0.434783
713
310
0
713
1,023
1
00009125_001
PA
0.395634
733
290
0
733
1,023
1
00018972_030
AP
0.616114
633
390
0
633
1,023
1
00026986_006
PA
0.267658
807
216
0
807
1,023
1
00000583_023
AP
0.694859
603
419
0
603
1,022
1
00002524_007
AP
0.017946
1,003
18
2
1,005
1,023
1
00015198_004
PA
0.337255
765
258
0
765
1,023
1
00026798_000
PA
0.234644
814
191
1
815
1,006
1
00002016_000
PA
0.38806
737
286
0
737
1,023
1
00009403_011
AP
0.652666
619
404
0
619
1,023
1
00009336_015
AP
0.133011
827
110
0
827
937
1
00014706_010
PA
0.642055
623
400
0
623
1,023
1
00010486_001
PA
0.384303
739
284
0
739
1,023
1
00008925_001
PA
0.290038
793
230
0
793
1,023
1
00010094_000
PA
0.174512
871
152
0
871
1,023
1
00021743_000
AP
0.15411
876
135
11
887
1,022
1
00003432_001
PA
0.600939
639
384
0
639
1,023
1
00019399_010
AP
0.565084
653
369
0
653
1,022
1
00023264_001
AP
0.413555
723
299
0
723
1,022
1
00023500_000
PA
0.335948
765
257
0
765
1,022
1
00012856_000
PA
0.174512
871
152
0
871
1,023
1
00000406_001
PA
0.334204
766
256
1
767
1,023
1
00015653_000
AP
0.32
775
248
0
775
1,023
1
00019143_009
PA
0.316602
777
246
0
777
1,023
1
00024997_000
PA
0.111869
733
82
0
733
815
1
00020940_000
PA
0.207792
847
176
0
847
1,023
1
00010909_002
AP
0.317269
747
237
0
747
984
1
00005676_002
PA
0.497804
683
340
0
683
1,023
1
00002678_004
PA
0.376851
743
280
0
743
1,023
1
00019766_004
PA
0.471942
695
328
0
695
1,023
1
00001999_000
PA
0.409655
725
297
0
725
1,022
1
00020772_013
PA
0.438819
711
312
0
711
1,023
1
00027389_002
PA
0.376851
743
280
0
743
1,023
1
00004542_001
PA
0.2933
791
232
0
791
1,023
1
00017601_001
PA
0.547655
661
362
0
661
1,023
1
00005532_037
PA
0.556068
651
362
0
651
1,013
1
00017297_001
AP
0.313222
779
244
0
779
1,023
1
00003034_002
PA
0.422809
719
304
0
719
1,023
1
00016429_033
PA
0.337255
765
258
0
765
1,023
1
00010384_020
AP
0.333768
767
256
0
767
1,023
1
00026802_002
PA
0.1854
863
160
0
863
1,023
1
00009137_000
AP
0.365821
749
274
0
749
1,023
1
00009885_000
PA
0.416667
720
300
3
723
1,023
1
00013849_005
PA
0.369478
747
276
0
747
1,023
1
00014950_009
PA
0.533733
667
356
0
667
1,023
1
00026343_000
PA
0.231047
831
192
0
831
1,023
1
00022604_013
AP
0.232811
829
193
0
829
1,022
1
00026232_037
AP
0.222222
792
176
55
847
1,023
1
00018625_000
PA
0.395634
733
290
0
733
1,023
1
00018362_015
PA
0.621236
631
392
0
631
1,023
1
00008541_002
AP
0.391837
735
288
0
735
1,023
1
00026925_016
AP
0.272727
803
219
0
803
1,022
1
00027905_001
AP
0.202591
849
172
0
849
1,021
1
00007943_012
PA
0.306513
783
240
0
783
1,023
1
00007794_000
PA
0.422809
719
304
0
719
1,023
1
00020124_001
AP
0.257073
813
209
0
813
1,022
1
00022461_000
PA
0.090513
917
83
0
917
1,000
1
00011950_002
AP
0.365821
749
274
0
749
1,023
1
00006102_008
AP
0.135405
901
122
0
901
1,023
1
00010092_023
AP
0.459344
701
322
0
701
1,023
1
00026117_002
PA
0.631579
627
396
0
627
1,023
1
00002505_002
AP
0.174512
871
152
0
871
1,023
1
00000370_010
PA
0.261406
811
212
0
811
1,023
1
00005457_007
AP
0.264524
809
214
0
809
1,023
1
00026925_020
AP
0.285326
736
210
77
813
1,023
1
00016719_002
PA
0.358566
753
270
0
753
1,023
1
00000296_001
PA
0.207792
847
176
0
847
1,023
1
00024698_000
PA
0.309859
781
242
0
781
1,023
1
00007321_004
AP
0
1,022
0
1
1,023
1,023
1
00002974_000
PA
0.373154
745
278
0
745
1,023
1
00010365_010
AP
0.399453
731
292
0
731
1,023
1
00010007_043
AP
0.354967
755
268
0
755
1,023
1
00005970_004
AP
0
1,023
0
0
1,023
1,023
1
00014870_004
PA
0.414938
723
300
0
723
1,023
1
00016995_000
PA
0.309859
781
242
0
781
1,023
1
00007109_020
PA
0.690909
605
418
0
605
1,023
1
00023162_015
PA
0.652666
619
404
0
619
1,023
1
00018334_004
PA
0.707846
599
424
0
599
1,023
1
00016887_001
PA
0.571429
651
372
0
651
1,023
1
00007558_012
AP
0.626391
629
394
0
629
1,023
1
00009437_009
PA
0.261406
811
212
0
811
1,023
1
00008122_008
AP
0.177215
869
154
0
869
1,023
1
00014721_014
AP
0.261406
811
212
0
811
1,023
1
00009889_008
PA
0.296578
789
234
0
789
1,023
1
00011896_005
AP
0.080253
947
76
0
947
1,023
1
00014146_001
PA
0.299873
787
236
0
787
1,023
1
00017425_001
PA
0.326848
771
252
0
771
1,023
1
00008008_037
PA
0.205036
834
171
1
835
1,006
1
00012834_130
AP
0.286792
795
228
0
795
1,023
1
00007420_000
PA
0.14574
892
130
1
893
1,023
1
00018815_000
PA
0.506627
679
344
0
679
1,023
1
00013330_000
PA
0.425384
717
305
0
717
1,022
1
00022132_010
AP
0.221027
837
185
0
837
1,022
1
00003894_003
PA
0.395634
733
290
0
733
1,023
1
00028509_015
AP
0.449645
705
317
0
705
1,022
1
00027866_002
AP
0.003128
959
3
60
1,019
1,022
1
00003446_010
AP
0.237001
827
196
0
827
1,023
1
End of preview.

Overview

The CheXStruct dataset, introduced in the paper CXReasonBench: A Benchmark for Evaluating Structured Diagnostic Reasoning in Chest X-rays, provides structured clinical information extracted from high-quality chest X-ray images using the CheXStruct pipeline, a fully automated framework for deriving diagnostic reasoning from chest X-rays.

The pipeline generates structured outputs for 12 diagnostic tasks, categorized as Radiological Findings and Image Quality Assessment, as well as 3 global filtering tasks to exclude non-frontal or corrupted images:

  • Global Filtering

    • Excludes non-frontal or corrupted images by assessing the number of segmented anatomical structures, anatomical positioning (e.g., presence of substantial abdominal or pelvic anatomy), and post-processing artifacts (e.g., low contrast).
  • Radiological Findings

    • Cardiomegaly, Mediastinal Widening, Carina Angle, Trachea Deviation, Aortic Knob Enlargement, Ascending Aorta Enlargement, Descending Aorta Enlargement, and Descending Aorta Tortuous
  • Image Quality Assessment

    • Inclusion, Inspiration Level, Rotation, and Projection

Dataset Structure

The CheXStruct dataset is derived from three publicly available chest X-ray datasets and is organized into three main folders, each corresponding to one of the source datasets:

The MIMIC-CXR-JPG dataset is not included in this repository due to requiring PhysioNet credential access but will be uploaded to PhysioNet soon!

Within each folder, there are 15 .csv files: 12 corresponding to the diagnostic tasks listed in the Overview, and 3 additional files (abdominal_xray.csv, mask_number.csv, window.csv) generated during a global filtering process to exclude non-frontal or corrupted chest X-ray images.

These files contain the structured outputs extracted by the CheXStruct pipeline for the respective task.

CSV File Structure

Each .csv file contains the following common columns across all diagnostic tasks:

  • image_file: Unique identifier for the chest X-ray image in the respective dataset.
  • viewposition: The chest X-ray view position, either PA (posteroanterior) or AP (anteroposterior). For datasets that do not support view position (e.g., OpenI), this is marked as N/A.
  • label: Binary label (1/0) indicating the presence or absence of the specific radiological finding or the state of the image quality assessment, derived by the CheXStruct pipeline. The specific meaning of the label varies by task, as detailed below.

In addition to these common columns, each .csv file includes task-specific columns representing:

  • Anatomical landmarks: Extracted landmarks derived from segmentation masks (e.g., cardiac end points, thoracic end points).
  • Diagnostic measurements: Measurements calculated based on the anatomical landmarks (e.g., cardiac width, thoracic width).
  • Diagnostic indices: Computed indices based on the diagnostic measurements (e.g., cardiothoracic ratio - CTR).

The specific column names vary by task, as follows:

Global Filtering
  • mask_number.csv

    • label: 0 indicates an invalid image (e.g., too few structures detected, suggesting the image is not a chest X-ray, is corrupted or blank, or has anatomical structures obscured due to poor patient positioning or motion artifacts), 1 indicates a valid image.
    • mask_count: The count of valid segmentation masks, determined as the number of masks where the sum of pixel values is non-zero.
  • abdomial_xray.csv

    • label: 0 indicates the presence of substantial abdominal or pelvic anatomy, 1 indicates a standard chest X-ray.
    • y_start: Y-coordinate of the top of the image
    • y_heart_max: Y-coordinate of the lowest point of the heart mask
    • y_end: Y-coordinate of the bottom of the image
    • distance_upper: Vertical distance from y_start to y_heart_max, representing the portion of the image above the heart
    • distance_lower: Vertical distance from y_heart_max to y_end, representing the portion of the image below the heart
    • ratio: Ratio of the vertical distances below and above the heart, calculated as distance_lower / distance_upper.
  • window.csv:

    • label: 0 indicates the presence of post-processing artifacts, 1 indicates acceptable image quality.
    • gradient_mean: The mean gradient magnitude across the image, calculated as a metric of edge strength to detect post-processing artifacts.
Radiological Findings
  • cardiomegaly.csv

    • label: 1 indicates the presence of cardiomegaly, 0 indicates its absence.
    • heart_xmin, heart_xmax: X-coordinates of the heart's left and right end points.
    • lung_xmin, lung_xmax: X-coordinates of the lung's left and right end points.
    • heart_width, lung_width: Widths of the heart and lungs, calculated from the coordinates heart_xmin, heart_xmax, lung_xmin, and lung_xmax, respectively.
    • ctr: cardiothoracic ratio, computed as the ratio of heart width to lung width.
  • mediastinal_widening.csv

    • label: 1 indicates the presence of mediastinal widening, 0 indicates its absence.
    • mediastinum_xmin, mediastinum_xmax: X-coordinates of the mediastinum's left and right end points.
    • lung_xmin, lung_xmax: X-coordinates of the lung's left and right end points at the .
    • mediastinum_width, lung_width: Widths of the mediastinum and lungs, calculated from the coordinates mediastinum_xmin, mediastinum_xmax, lung_xmin, and lung_xmax, respectively.
    • mcr: mediastinal to chest width ratio, computed as the ratio of mediastinum width to lung width.
  • carina_angle.csv

    • label: 1 indicates an abnormal carina angle, 0 indicates a normal angle.
    • point_1, point_2, point_3: Coordinates of three points defining the tracheal bifurcation, where point_2 is the bifurcation point and point_1 and point_3 are points along the right and left main bronchi, respectively.
    • angle: The angle formed at the bifurcation point, measured directly in degrees.
  • trachea_deviation.csv

    • label: 1 indicates trachea deviation, 0 indicates no deviation.
    • point_1 to point_9: Coordinates of nine points along the midline of the trachea.
    • direction_per_pnt: Direction of the trachea mask relative to each point at the same horizontal level (same y-coordinate), labeled as left, right, or flat for each of the nine points.
    • direction: Overall trachea deviation direction, determined by aggregating the per-point direction assessments.
  • aortic_knob_enlargement.csv

    • label: 1 indicates enlargement of the aortic knob, 0 indicates no enlargement.
    • aortic_knob_xmin, aortic_knob_xmax: X-coordinates of the aortic knob's left and right end points.
    • trachea_point_left, trachea_point_right: Coordinates of the trachea's left and right end points.
    • aortic_knob_width, trachea_width: Widths of the aortic knob and trachea, calculated from the coordinates aortic_knob_xmin, aortic_knob_xmax, trachea_point_left, and trachea_point_right, respectively.
    • ratio: the ratio of aortic knob width to trachea width.
  • ascending_aorta_enlargement.csv

    • label: 1 indicates enlargement of the ascending aorta, 0 indicates no enlargement.
    • heart_point: Coordinates of the most right-lung side point on the right heart border.
    • trachea_point: Coordinates of the most right-lung side point of the trachea.
    • ratio: Ratio of the area of the ascending aorta that extends beyond a straight line connecting the heart point and trachea point to the total area of the ascending aorta mask.
  • descending_aorta_enlargement.csv

    • label: 1 indicates enlargement of the descending aorta, 0 indicates no enlargement.
    • desc_aorta_point_left,desc_aorta_point_right: Coordinates of the descending aorta's left and right end points.
    • trachea_point_left, trachea_point_right: Coordinates of the trachea's left and right end points.
    • desc_aorta_width, trachea_width, : Widths of the descending aorta and trachea, calculated from the coordinates desc_aorta_point_left, desc_aorta_point_right, trachea_point_left, and trachea_point_right, respectively.
    • ratio: the ratio of descending aorta width to trachea width.
  • descending_aorta_tortuous.csv

    • label: 1 indicates tortuosity of the descending aorta, 0 indicates no tortuosity.
    • point_1 to point_6: Coordinates of the rightmost points at the boundaries of five equal vertical segments of the thoracic descending aorta region.
    • curvature: Mean curvature across the six points, computed using finite difference methods to evaluate the tortuosity.
Image Quality Assessment
  • inclusion.csv

    • label: 1 indicates sufficient inclusion of lung regions (e.g., apex, side, and bottom are adequately captured), 0 indicates exclusion.
    • label_side_right_lung, label_side_left_lung, label_apex_right_lung, label_apex_left_lung, label_bottom_right_lung, label_bottom_left_lung: Binary labels (1 for inclusion, 0 for exclusion) indicating whether the side, apex, and bottom of the thoracic cage are included in the image.
    • point_apex_right_lung, point_apex_left_lung, point_side_right_lung, point_side_left_lung, point_bottom_right_lung, point_bottom_left_lung: Coordinates of the apex, side, and bottom of the right and left lungs.
    • ratio_apex_right_lung, ratio_apex_left_lung, ratio_side_right_lung, ratio_side_left_lung, ratio_bottom_right_lung, ratio_bottom_left_lung: Ratios of the distance from each corresponding coordinate (apex, side, bottom) to the image edge, relative to a reference distance, for the right and left lungs.
  • inspiration.csv

    • label: 1 indicates inadequate inspiration, 0 indicates adequate inspiration
    • mid-clavicular_line(x): X-coordinate of the mid-clavicular line
    • rib_position: The number of the first right posterior rib that intersects with the right hemidiaphragm at the mid-clavicular line
  • rotation.csv

    • label: 1 indicates rotation, 0 indicates proper alignment.
    • medial_end_right_clavicle, medial_end_left_clavicle: Coordinates of the medial end points of the right and left clavicles.
    • midline_points: Coordinates of the spinous process points nearest to each clavicle's medial end point, defined within a ±1 vertebrae margin around the nearest spinous process for both clavicles.
    • midline_point_right_clavicle, midline_point_left_clavicle: Coordinates of the points on the spinous process line at the same vertical level (y-coordinate) as the medial end points of the right and left clavicles, respectively
    • distance_right, distance_left: Horizontal distances between the medial end point of the right and left clavicles and their corresponding points on the spinous process line.
    • ratio: Ratio of the minimum to the maximum of the right and left distances, calculated as min(distance_right, distance_left) / max(distance_right, distance_left).
  • projection.csv

    • label: 1 indicates large scapular overlap with lung fields, 0 indicates indicates minimal overlap.
    • scapular_region_right, scapular_region_left: Areas of the right and left scapular regions, derived from segmented masks.
    • overlap_region_righn, overlap_region_left: Areas of overlap between the right and left scapulae and the lung fields.
    • ratio_right, ratio_left: Ratios of the overlap area to the total scapular region area for the right and left scapulae, respectively.

For detailed extraction methods of these columns, refer to Appendix A Details of CheXStruct in the paper CXReasonBench: A Benchmark for Evaluating Structured Diagnostic Reasoning in Chest X-rays.


Citation

If you use this dataset in your research, please cite the following paper:

@article{lee2025cxreasonbench,
  title={CXReasonBench: A Benchmark for Evaluating Structured Diagnostic Reasoning in Chest X-rays},
  author={Lee, Hyungyung and Choi, Geon and Lee, Jung-Oh and Yoon, Hangyul and Hong, Hyuk Gi and Choi, Edward},
  journal={arXiv preprint arXiv:2505.18087},
  year={2025}
}

License

The dataset is released under CC BY 4.0. Please ensure compliance with the licenses of the source datasets when using this dataset.


Contact

For questions or issues related to the dataset, please open an issue on the Hugging Face dataset repository or contact: ttumyche@kaist.ac.kr

Downloads last month
41