Skip to content

Commit 8fc258a

Browse files
authored
Add support for Spider - colorectal, skin, thorax (#3)
1 parent 2928a39 commit 8fc258a

11 files changed

Lines changed: 675 additions & 3 deletions

File tree

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
dataset_name: spider_colorectal
2+
nb_classes: 13
3+
base_data_folder: ${oc.env:THUNDER_BASE_DATA_FOLDER}/datasets/
4+
compatible_tasks:
5+
[
6+
"alignment_scoring",
7+
"image_retrieval",
8+
"knn",
9+
"linear_probing",
10+
"pre_computing_embeddings",
11+
"simple_shot",
12+
"transformation_invariance",
13+
"adversarial_attack",
14+
]
15+
16+
nb_train_samples: 46892
17+
nb_val_samples: 17097
18+
nb_test_samples: 13193
19+
md5sum: "8d0de69eae0dbbe5f601b2bea703d233"
20+
image_sizes: [[224, 224]]
21+
mpp: 0.5
22+
cancer_type: colorectal
23+
classes:
24+
[
25+
"Adenocarcinoma high grade",
26+
"Adenocarcinoma low grade",
27+
"Adenoma high grade",
28+
"Adenoma low grade",
29+
"Fat",
30+
"Hyperplastic polyp",
31+
"Inflammation",
32+
"Mucus",
33+
"Muscle",
34+
"Necrosis",
35+
"Sessile serrated lesion",
36+
"Stroma healthy",
37+
"Vessels",
38+
]
39+
class_to_id:
40+
"Adenocarcinoma high grade": 0
41+
"Adenocarcinoma low grade": 1
42+
"Adenoma high grade": 2
43+
"Adenoma low grade": 3
44+
"Fat": 4
45+
"Hyperplastic polyp": 5
46+
"Inflammation": 6
47+
"Mucus": 7
48+
"Muscle": 8
49+
"Necrosis": 9
50+
"Sessile serrated lesion": 10
51+
"Stroma healthy": 11
52+
"Vessels": 12
53+
54+
id_to_class:
55+
0: "Adenocarcinoma high grade"
56+
1: "Adenocarcinoma low grade"
57+
2: "Adenoma high grade"
58+
3: "Adenoma low grade"
59+
4: "Fat"
60+
5: "Hyperplastic polyp"
61+
6: "Inflammation"
62+
7: "Mucus"
63+
8: "Muscle"
64+
9: "Necrosis"
65+
10: "Sessile serrated lesion"
66+
11: "Stroma healthy"
67+
12: "Vessels"
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
dataset_name: spider_skin
2+
nb_classes: 24
3+
base_data_folder: ${oc.env:THUNDER_BASE_DATA_FOLDER}/datasets/
4+
compatible_tasks:
5+
[
6+
"alignment_scoring",
7+
"image_retrieval",
8+
"knn",
9+
"linear_probing",
10+
"pre_computing_embeddings",
11+
"simple_shot",
12+
"transformation_invariance",
13+
"adversarial_attack",
14+
]
15+
16+
nb_train_samples: 102815
17+
nb_val_samples: 28349
18+
nb_test_samples: 28690
19+
md5sum: "d9bc664972010d28510877f8d02113a3"
20+
image_sizes: [[224, 224]]
21+
mpp: 0.5
22+
cancer_type: skin
23+
classes:
24+
[
25+
"Actinic keratosis",
26+
"Apocrine glands",
27+
"Basal cell carcinoma",
28+
"Carcinoma in situ",
29+
"Collagen",
30+
"Epidermis",
31+
"Fat",
32+
"Follicle",
33+
"Inflammation",
34+
"Invasive melanoma",
35+
"Kaposi’s sarcoma",
36+
"Keratin",
37+
"Melanoma in situ",
38+
"Mercel cell carcinoma",
39+
"Muscle",
40+
"Necrosis",
41+
"Nerves",
42+
"Nevus",
43+
"Sebaceous gland",
44+
"Seborrheic keratosis",
45+
"Solar elastosis",
46+
"Squamous cell carcinoma",
47+
"Vessels",
48+
"Wart"
49+
]
50+
class_to_id:
51+
"Actinic keratosis": 0
52+
"Apocrine glands": 1
53+
"Basal cell carcinoma": 2
54+
"Carcinoma in situ": 3
55+
"Collagen": 4
56+
"Epidermis": 5
57+
"Fat": 6
58+
"Follicle": 7
59+
"Inflammation": 8
60+
"Invasive melanoma": 9
61+
"Kaposi’s sarcoma": 10
62+
"Keratin": 11
63+
"Melanoma in situ": 12
64+
"Mercel cell carcinoma": 13
65+
"Muscle": 14
66+
"Necrosis": 15
67+
"Nerves": 16
68+
"Nevus": 17
69+
"Sebaceous gland": 18
70+
"Seborrheic keratosis": 19
71+
"Solar elastosis": 20
72+
"Squamous cell carcinoma": 21
73+
"Vessels": 22
74+
"Wart": 23
75+
76+
id_to_class:
77+
0: "Actinic keratosis"
78+
1: "Apocrine glands"
79+
2: "Basal cell carcinoma"
80+
3: "Carcinoma in situ"
81+
4: "Collagen"
82+
5: "Epidermis"
83+
6: "Fat"
84+
7: "Follicle"
85+
8: "Inflammation"
86+
9: "Invasive melanoma"
87+
10: "Kaposi’s sarcoma"
88+
11: "Keratin"
89+
12: "Melanoma in situ"
90+
13: "Mercel cell carcinoma"
91+
14: "Muscle"
92+
15: "Necrosis"
93+
16: "Nerves"
94+
17: "Nevus"
95+
18: "Sebaceous gland"
96+
19: "Seborrheic keratosis"
97+
20: "Solar elastosis"
98+
21: "Squamous cell carcinoma"
99+
22: "Vessels"
100+
23: "Wart"
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
dataset_name: spider_thorax
2+
nb_classes: 14
3+
base_data_folder: ${oc.env:THUNDER_BASE_DATA_FOLDER}/datasets/
4+
compatible_tasks:
5+
[
6+
"alignment_scoring",
7+
"image_retrieval",
8+
"knn",
9+
"linear_probing",
10+
"pre_computing_embeddings",
11+
"simple_shot",
12+
"transformation_invariance",
13+
"adversarial_attack",
14+
]
15+
16+
nb_train_samples: 50413
17+
nb_val_samples: 12906
18+
nb_test_samples: 14988
19+
md5sum: "5d91551c7b0a4d82639411fcc2af847e"
20+
image_sizes: [[224, 224]]
21+
mpp: 0.5
22+
cancer_type: skin
23+
classes:
24+
[
25+
"Alveoli",
26+
"Bronchial cartilage",
27+
"Bronchial glands",
28+
"Chronic inflammation + fibrosis",
29+
"Detritus",
30+
"Fibrosis",
31+
"Hemorrhage",
32+
"Lymph node",
33+
"Pigment",
34+
"Pleura",
35+
"Tumor non-small cell",
36+
"Tumor small cell",
37+
"Tumor soft",
38+
"Vessel",
39+
]
40+
class_to_id:
41+
Alveoli: 0
42+
Bronchial cartilage: 1
43+
Bronchial glands: 2
44+
Chronic inflammation + fibrosis: 3
45+
Detritus: 4
46+
Fibrosis: 5
47+
Hemorrhage: 6
48+
Lymph node: 7
49+
Pigment: 8
50+
Pleura: 9
51+
Tumor non-small cell: 10
52+
Tumor small cell: 11
53+
Tumor soft: 12
54+
Vessel: 13
55+
56+
id_to_class:
57+
0: "Aveoli"
58+
1: "Bronchial cartilage"
59+
2: "Bronchial glands"
60+
3: "Chronic inflammation + fibrosis"
61+
4: "Detritus"
62+
5: "Fibrosis"
63+
6: "Hemorrhage"
64+
7: "Lymph node"
65+
8: "Pigment"
66+
9: "Pleura"
67+
10: "Tumor non-small cell"
68+
11: "Tumor small cell"
69+
12: "Tumor soft"
70+
13: "Vessel"

src/thunder/datasets/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
from .dataset import (bach, bracs, break_his, ccrcc, crc, esca, mhist, ocelot,
33
pannuke, patch_camelyon, segpath_epithelial,
44
segpath_lymphocytes, tcga_crc_msi, tcga_tils,
5-
tcga_uniform, wilds,
6-
spider_breast)
5+
tcga_uniform, wilds, spider_breast,
6+
spider_colorectal, spider_skin, spider_thorax)
77
from .download import download_datasets

src/thunder/datasets/data_splits.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ def generate_splits(datasets: Union[List[str], str]) -> None:
4040
"segpath_lymphocytes",
4141
"mhist",
4242
"spider_breast",
43+
"spider_colorectal",
44+
"spider_skin",
45+
"spider_thorax",
4346
]
4447
elif datasets[0] == "classification":
4548
datasets = [
@@ -56,6 +59,9 @@ def generate_splits(datasets: Union[List[str], str]) -> None:
5659
"wilds",
5760
"mhist",
5861
"spider_breast",
62+
"spider_colorectal",
63+
"spider_skin",
64+
"spider_thorax",
5965
]
6066
elif datasets[0] == "segmentation":
6167
datasets = [
@@ -92,7 +98,8 @@ def generate_splits_for_dataset(dataset_name: str) -> None:
9298
create_splits_segpath_lymphocytes,
9399
create_splits_tcga_crc_msi, create_splits_tcga_tils,
94100
create_splits_tcga_uniform, create_splits_wilds,
95-
create_splits_spider_breast)
101+
create_splits_spider_breast, create_splits_spider_colorectal,
102+
create_splits_spider_skin, create_splits_spider_thorax)
96103

97104
DATASET_TO_FUNCTION = {
98105
# Classification
@@ -109,6 +116,9 @@ def generate_splits_for_dataset(dataset_name: str) -> None:
109116
"tcga_uniform": create_splits_tcga_uniform,
110117
"wilds": create_splits_wilds,
111118
"spider_breast": create_splits_spider_breast,
119+
"spider_colorectal": create_splits_spider_colorectal,
120+
"spider_skin": create_splits_spider_skin,
121+
"spider_thorax": create_splits_spider_thorax,
112122
# Segmentation
113123
"ocelot": create_splits_ocelot,
114124
"pannuke": create_splits_pannuke,

src/thunder/datasets/dataset/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@
2020
from .tcga_uniform import create_splits_tcga_uniform, download_tcga_uniform
2121
from .wilds import create_splits_wilds, download_wilds
2222
from .spider_breast import create_splits_spider_breast, download_spider_breast
23+
from .spider_colorectal import create_splits_spider_colorectal, download_spider_colorectal
24+
from .spider_skin import create_splits_spider_skin, download_spider_skin
25+
from .spider_thorax import create_splits_spider_thorax, download_spider_thorax

0 commit comments

Comments
 (0)