Dataset Viewer
Auto-converted to Parquet Duplicate
image
imagewidth (px)
1.02k
1.02k
labels
listlengths
0
6
label_names
listlengths
0
6
image_id
stringlengths
12
12
fold
int8
0
9
patient_id
int32
1
9.35k
follow_up
int32
0
80
patient_age
int32
1
94
patient_sex
stringclasses
2 values
view_position
stringclasses
2 values
original_width
int32
1.52k
3.06k
original_height
int32
1.31k
3.06k
pixel_spacing_x
float64
0.12
0.19
pixel_spacing_y
float64
0.12
0.19
bboxes
listlengths
0
0
[ 1 ]
[ "Cardiomegaly" ]
00000001_000
0
1
0
57
M
PA
2,682
2,749
0.143
0.143
[]
[ 1, 5 ]
[ "Cardiomegaly", "Emphysema" ]
00000001_001
0
1
1
58
M
PA
2,894
2,729
0.143
0.143
[]
[ 1, 4 ]
[ "Cardiomegaly", "Effusion" ]
00000001_002
0
1
2
58
M
PA
2,500
2,048
0.168
0.168
[]
[]
[]
00000002_000
4
2
0
80
M
PA
2,500
2,048
0.171
0.171
[]
[ 9, 10 ]
[ "Mass", "Nodule" ]
00000004_000
1
4
0
82
M
AP
2,500
2,048
0.168
0.168
[]
[]
[]
00000005_000
3
5
0
69
F
PA
2,048
2,500
0.168
0.168
[]
[]
[]
00000005_001
3
5
1
69
F
AP
2,500
2,048
0.168
0.168
[]
[]
[]
00000005_002
3
5
2
69
F
AP
2,500
2,048
0.168
0.168
[]
[]
[]
00000005_003
3
5
3
69
F
PA
2,992
2,991
0.143
0.143
[]
[]
[]
00000005_004
3
5
4
70
F
PA
2,986
2,991
0.143
0.143
[]
[]
[]
00000005_005
3
5
5
70
F
PA
2,514
2,991
0.143
0.143
[]
[ 8 ]
[ "Infiltration" ]
00000005_006
3
5
6
70
F
PA
2,992
2,991
0.143
0.143
[]
[ 4, 8 ]
[ "Effusion", "Infiltration" ]
00000005_007
3
5
7
70
F
PA
2,566
2,681
0.143
0.143
[]
[]
[]
00000006_000
0
6
0
81
M
PA
2,500
2,048
0.168
0.168
[]
[]
[]
00000007_000
1
7
0
82
M
PA
2,500
2,048
0.168
0.168
[]
[ 1 ]
[ "Cardiomegaly" ]
00000008_000
0
8
0
68
F
PA
2,048
2,500
0.171
0.171
[]
[]
[]
00000008_001
0
8
1
70
F
PA
2,048
2,500
0.171
0.171
[]
[ 10 ]
[ "Nodule" ]
00000008_002
0
8
2
72
F
PA
2,048
2,500
0.168
0.168
[]
[ 5 ]
[ "Emphysema" ]
00000009_000
0
9
0
72
M
PA
2,992
2,991
0.143
0.143
[]
[ 8 ]
[ "Infiltration" ]
00000010_000
2
10
0
84
F
PA
2,992
2,991
0.143
0.143
[]
[ 4 ]
[ "Effusion" ]
00000011_000
2
11
0
74
M
PA
2,638
2,449
0.143
0.143
[]
[]
[]
00000011_001
2
11
1
74
M
PA
2,500
2,048
0.168
0.168
[]
[]
[]
00000011_002
2
11
2
75
M
PA
2,714
2,781
0.143
0.143
[]
[]
[]
00000011_003
2
11
3
75
M
PA
2,500
2,048
0.168
0.168
[]
[]
[]
00000011_004
2
11
4
75
M
PA
2,500
2,048
0.168
0.168
[]
[ 8 ]
[ "Infiltration" ]
00000011_005
2
11
5
75
M
AP
2,500
2,048
0.168
0.168
[]
[ 0 ]
[ "Atelectasis" ]
00000011_006
2
11
6
75
M
PA
2,992
2,991
0.143
0.143
[]
[ 8 ]
[ "Infiltration" ]
00000011_007
2
11
7
75
M
PA
2,782
2,753
0.143
0.143
[]
[]
[]
00000011_008
2
11
8
75
M
PA
2,826
2,685
0.143
0.143
[]
[ 4, 9 ]
[ "Effusion", "Mass" ]
00000012_000
0
12
0
76
M
PA
2,992
2,991
0.143
0.143
[]
[]
[]
00000014_000
4
14
0
60
F
PA
2,048
2,500
0.171
0.171
[]
[]
[]
00000015_000
1
15
0
70
M
AP
2,500
2,048
0.168
0.168
[]
[]
[]
00000016_000
7
16
0
71
M
PA
2,992
2,991
0.143
0.143
[]
[ 4, 8, 10 ]
[ "Effusion", "Infiltration", "Nodule" ]
00000017_000
5
17
0
77
M
PA
2,500
2,048
0.168
0.168
[]
[]
[]
00000017_001
5
17
1
77
M
AP
2,500
2,048
0.168
0.168
[]
[]
[]
00000017_002
5
17
2
77
M
AP
2,500
2,048
0.168
0.168
[]
[]
[]
00000018_000
8
18
0
75
M
PA
2,500
2,048
0.168
0.168
[]
[ 0, 4, 11 ]
[ "Atelectasis", "Effusion", "Pleural_Thickening" ]
00000019_000
6
19
0
66
M
PA
2,992
2,991
0.143
0.143
[]
[ 11 ]
[ "Pleural_Thickening" ]
00000020_000
2
20
2
53
M
PA
2,978
2,991
0.143
0.143
[]
[ 6, 8 ]
[ "Fibrosis", "Infiltration" ]
00000020_001
2
20
0
47
M
PA
2,992
2,991
0.143
0.143
[]
[ 6, 8, 11 ]
[ "Fibrosis", "Infiltration", "Pleural_Thickening" ]
00000020_002
2
20
1
48
M
PA
2,414
2,991
0.143
0.143
[]
[ 10 ]
[ "Nodule" ]
00000021_000
5
21
0
77
M
PA
2,500
2,048
0.168
0.168
[]
[ 8 ]
[ "Infiltration" ]
00000021_001
5
21
1
80
M
PA
3,056
2,496
0.139
0.139
[]
[]
[]
00000022_000
8
22
0
47
M
PA
2,048
2,500
0.171
0.171
[]
[ 6 ]
[ "Fibrosis" ]
00000022_001
8
22
1
48
M
PA
2,500
2,048
0.168
0.168
[]
[]
[]
00000023_000
1
23
0
63
F
PA
2,048
2,500
0.168
0.168
[]
[]
[]
00000023_001
1
23
1
63
F
AP
2,500
2,048
0.168
0.168
[]
[ 4, 8 ]
[ "Effusion", "Infiltration" ]
00000023_002
1
23
2
63
F
PA
2,048
2,500
0.168
0.168
[]
[]
[]
00000023_003
1
23
3
63
F
PA
2,048
2,500
0.168
0.168
[]
[ 8, 9, 10 ]
[ "Infiltration", "Mass", "Nodule" ]
00000023_004
1
23
4
63
F
PA
2,500
2,048
0.168
0.168
[]
[ 6 ]
[ "Fibrosis" ]
00000024_000
9
24
0
52
M
PA
2,048
2,500
0.168
0.168
[]
[ 4 ]
[ "Effusion" ]
00000025_000
1
25
0
71
M
PA
2,048
2,500
0.171
0.171
[]
[ 8 ]
[ "Infiltration" ]
00000026_000
1
26
0
68
M
PA
2,870
2,812
0.143
0.143
[]
[ 5 ]
[ "Emphysema" ]
00000027_000
1
27
0
73
M
PA
2,990
2,991
0.143
0.143
[]
[ 11 ]
[ "Pleural_Thickening" ]
00000028_000
7
28
0
63
M
PA
2,048
2,500
0.168
0.168
[]
[]
[]
00000029_000
4
29
0
59
F
PA
2,500
2,048
0.171
0.171
[]
[ 0 ]
[ "Atelectasis" ]
00000030_000
9
30
0
74
M
PA
2,992
2,991
0.143
0.143
[]
[ 0 ]
[ "Atelectasis" ]
00000030_001
9
30
1
79
M
PA
2,992
2,991
0.143
0.143
[]
[]
[]
00000031_000
5
31
0
71
F
PA
2,992
2,991
0.143
0.143
[]
[ 0, 1, 6 ]
[ "Atelectasis", "Cardiomegaly", "Fibrosis" ]
00000033_000
4
33
0
72
F
PA
2,992
2,745
0.143
0.143
[]
[ 5 ]
[ "Emphysema" ]
00000034_000
4
34
0
73
M
PA
2,048
2,500
0.171
0.171
[]
[]
[]
00000034_001
4
34
1
75
M
PA
2,500
2,048
0.168
0.168
[]
[]
[]
00000035_000
2
35
0
79
M
PA
2,754
2,873
0.143
0.143
[]
[]
[]
00000035_001
2
35
1
80
M
PA
2,718
2,973
0.143
0.143
[]
[ 4, 8 ]
[ "Effusion", "Infiltration" ]
00000036_000
6
36
0
81
M
PA
2,992
2,991
0.143
0.143
[]
[]
[]
00000037_000
6
37
0
72
M
PA
2,708
2,638
0.143
0.143
[]
[ 1, 4 ]
[ "Cardiomegaly", "Effusion" ]
00000038_000
5
38
0
75
M
PA
2,992
2,991
0.143
0.143
[]
[ 0, 8 ]
[ "Atelectasis", "Infiltration" ]
00000038_001
5
38
1
75
M
PA
2,992
2,991
0.143
0.143
[]
[]
[]
00000038_002
5
38
2
76
M
PA
2,021
2,020
0.194311
0.194311
[]
[ 1 ]
[ "Cardiomegaly" ]
00000038_003
5
38
3
76
M
AP
3,056
2,544
0.139
0.139
[]
[]
[]
00000038_004
5
38
4
76
M
AP
3,056
2,544
0.139
0.139
[]
[]
[]
00000038_005
5
38
5
76
M
PA
2,021
2,021
0.194311
0.194311
[]
[ 0, 8 ]
[ "Atelectasis", "Infiltration" ]
00000038_006
5
38
6
76
M
PA
2,021
2,021
0.194311
0.194311
[]
[]
[]
00000038_007
5
38
7
77
M
PA
2,021
2,021
0.194311
0.194311
[]
[]
[]
00000039_000
5
39
0
75
M
PA
2,500
2,048
0.168
0.168
[]
[]
[]
00000039_001
5
39
1
75
M
PA
2,992
2,991
0.143
0.143
[]
[]
[]
00000039_002
5
39
2
75
M
AP
2,500
2,048
0.168
0.168
[]
[]
[]
00000039_003
5
39
3
75
M
PA
2,464
2,715
0.143
0.143
[]
[ 4 ]
[ "Effusion" ]
00000039_004
5
39
4
75
M
PA
2,718
2,991
0.143
0.143
[]
[]
[]
00000040_000
5
40
0
66
M
PA
2,500
2,048
0.168
0.168
[]
[ 5 ]
[ "Emphysema" ]
00000040_001
5
40
1
66
M
AP
2,500
2,048
0.168
0.168
[]
[]
[]
00000040_002
5
40
2
66
M
AP
2,500
2,048
0.168
0.168
[]
[ 2, 9 ]
[ "Consolidation", "Mass" ]
00000040_003
5
40
3
67
M
PA
2,500
2,048
0.168
0.168
[]
[]
[]
00000042_000
0
42
0
71
M
AP
3,056
2,544
0.139
0.139
[]
[]
[]
00000042_001
0
42
1
71
M
AP
3,056
2,544
0.139
0.139
[]
[]
[]
00000042_002
0
42
2
71
M
AP
3,056
2,544
0.139
0.139
[]
[]
[]
00000042_003
0
42
3
71
M
AP
3,056
2,544
0.139
0.139
[]
[]
[]
00000042_004
0
42
4
71
M
AP
2,808
2,544
0.139
0.139
[]
[]
[]
00000042_005
0
42
5
71
M
PA
2,992
2,991
0.143
0.143
[]
[ 8 ]
[ "Infiltration" ]
00000042_006
0
42
6
71
M
AP
3,056
2,544
0.139
0.139
[]
[]
[]
00000042_007
0
42
7
71
M
PA
2,992
2,991
0.143
0.143
[]
[]
[]
00000042_008
0
42
8
71
M
AP
3,056
2,544
0.139
0.139
[]
[ 8 ]
[ "Infiltration" ]
00000043_000
0
43
0
66
M
PA
2,794
2,991
0.143
0.143
[]
[ 2, 4, 8 ]
[ "Consolidation", "Effusion", "Infiltration" ]
00000044_000
0
44
0
78
M
PA
2,010
2,021
0.194311
0.194311
[]
[ 8, 11 ]
[ "Infiltration", "Pleural_Thickening" ]
00000044_001
0
44
1
78
M
PA
2,544
3,056
0.139
0.139
[]
[ 1 ]
[ "Cardiomegaly" ]
00000044_002
0
44
2
78
M
PA
3,056
2,544
0.139
0.139
[]
[ 1 ]
[ "Cardiomegaly" ]
00000045_000
4
45
0
70
F
PA
2,500
2,048
0.168
0.168
[]
[]
[]
00000046_000
0
46
0
56
M
PA
2,500
2,048
0.171
0.171
[]
[]
[]
00000047_000
8
47
0
73
F
PA
2,048
2,500
0.168
0.168
[]
[]
[]
00000047_001
8
47
1
73
F
PA
2,766
2,991
0.143
0.143
[]
End of preview. Expand in Data Studio

Description

The NIH ChestX-ray14 dataset (NIH Clinical Center), an extension of ChestX-ray8 from the CVPR 2017 paper. It has 112,120 frontal-view chest X-rays of 30,805 unique patients. Each image is labelled with any of 14 thoracic findings, text-mined from the associated radiology reports with NLP.

' ChestX-ray dataset comprises 112,120 frontal-view X-ray images of 30,805 unique patients with the text-mined fourteen disease image labels (where each image can have multi-labels), mined from the associated radiological reports using natural language processing. Fourteen common thoracic pathologies include Atelectasis, Consolidation, Infiltration, Pneumothorax, Edema, Emphysema, Fibrosis, Effusion, Pneumonia, Pleural_thickening, Cardiomegaly, Nodule, Mass and Hernia, which is an extension of the 8 common disease patterns listed in our CVPR 2017 paper. '

Labels (14): Atelectasis, Cardiomegaly, Consolidation, Edema, Effusion, Emphysema, Fibrosis, Hernia, Infiltration, Mass, Nodule, Pleural_Thickening, Pneumonia, Pneumothorax.

Images labelled No Finding in the source (about 54% of images) have an empty labels list. Per the NIH FAQ, 'No Finding' is not the same as 'normal': those images may show patterns outside the 14 categories, or uncertain findings.

The labels are NLP-extracted and noisy (NIH estimates >90% accuracy). The test labels come from the same NLP process and are not radiologist-verified. Improved label sets are linked from the original download site (e.g. MAPLEZ, NIH-CXR-LT).

The splits are the official patient-level train_val_list.txt (86,524 images, 28,008 patients) and test_list.txt (25,596 images, 2,797 patients). No patient appears in both. There is no official validation split. The train split has a fold column (0-9) that I assigned with multi-label iterative stratification (Sechidis et al., 2011, seed 42), grouped by patient: every image of a patient is in the same fold. Use a fold as validation (e.g. fold == 0, ~10%) without leaking patients between train and validation. Findings and 'No Finding' are balanced to within 1% across folds; Hernia, the rarest, has 14-15 per fold.

Images are the original 1024x1024 8-bit PNGs re-encoded as 8-bit grayscale (L mode) JPEG at quality 95. This halves the size relative to PNG (mean PSNR ~48.4 dB, SSIM ~0.988 vs. the PNGs), and all 256 gray levels are preserved. About 1% of the source PNGs are stored as RGBA with identical R/G/B channels and opaque alpha; these were converted to L losslessly before encoding.

Dataset Structure

  • image - JPEG image, 1024x1024, 8-bit grayscale.
  • labels - sequence of ClassLabel indices of the positive findings (empty for 'No Finding').
  • label_names - names of the positive findings.
  • image_id - original image filename stem (e.g. 00000001_000).
  • fold - patient-grouped stratified fold (0-9) for train, null for test.
  • patient_id, follow_up, patient_age, patient_sex, view_position (PA / AP) - from Data_Entry_2017_v2020.csv (Patient ID, Follow-up #, Patient Age, Patient Sex, View Position). Per NIH, the image name suffix does not necessarily match the follow-up number.
  • original_width, original_height, pixel_spacing_x, pixel_spacing_y - original image size and pixel spacing before the 1024x1024 resize, from the same file.
  • bboxes - list of {bbox: [x, y, w, h], label} from BBox_List_2017.csv, in pixels on the 1024x1024 image, (x, y) = top-left corner. Present for 880 test images (984 boxes, 8 findings), empty otherwise. The source's Infiltrate is mapped to Infiltration.

Usage

This dataset follows the same multi-label format as timm/plant-pathology-2021 and timm/amazon-from-space for use with timm 1.0.31 or greater. The images are grayscale; timm converts them to 3-channel RGB by default.

python train.py --dataset hfds/timm/nih-chest-xray-14 --train-split train --val-split test \
  --task multilabel --target-key labels --num-classes 14 \
  --model resnet50.ram_in1k --pretrained --img-size 512 --batch-size 32 --epochs 30 \
  --opt adamw --lr 1e-4 --weight-decay 0.01 --amp

To hold out a patient-level validation fold instead of validating on test:

from datasets import load_dataset
ds = load_dataset('timm/nih-chest-xray-14', split='train')
train_ds = ds.filter(lambda f: f != 0, input_columns='fold')
val_ds = ds.filter(lambda f: f == 0, input_columns='fold')

The standard metric is per-finding ROC AUC, averaged over the 14 findings.

License / Terms

From the NIH FAQ: "The usage of the data set is unrestricted. But you should provide the link to our original download site, acknowledge the NIH Clinical Center and provide a citation to our CVPR 2017 paper."

Original download site: https://nihcc.app.box.com/v/ChestXray-NIHCC. Data provided by the NIH Clinical Center.

Citation

@InProceedings{wang2017chestxray,
  author = {Wang, Xiaosong and Peng, Yifan and Lu, Le and Lu, Zhiyong and Bagheri, Mohammadhadi and Summers, Ronald},
  title = {ChestX-ray8: Hospital-scale Chest X-ray Database and Benchmarks on Weakly-Supervised Classification and Localization of Common Thorax Diseases},
  booktitle = {2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
  pages = {3462--3471},
  year = {2017}
}
Downloads last month
118

Collection including timm/nih-chest-xray-14

Paper for timm/nih-chest-xray-14