-
Notifications
You must be signed in to change notification settings - Fork 2
/
constants.py
173 lines (130 loc) · 4.21 KB
/
constants.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
"""
Filename: constants.py
Author : Hakima Laribi
Description: This file is used to store helpful constants
Date of last modification : 2023/02/07
"""
# All data modalities
TAB = 'tabular'
TS = 'time_series'
TXT = 'text'
IMG = 'images'
# Store each source type in a class structure, for each class:
# name: the name of the source type in the dataset
# n_embeddings: number of embeddings extracted for this source type in the dataset
# sources: column names of all extracted embeddings of the source type
# modality: the modality to which the source type belongs
class DEMOGRAPHIC:
name = 'de'
n_embeddings = 6
sources = [f"de_{i}" for i in range(n_embeddings)]
modality = TAB
class CHART:
name = 'ce'
n_embeddings = 99
sources = [f"ts_ce_{i}" for i in range(n_embeddings)]
modality = TS
class LAB:
name = 'le'
n_embeddings = 242
sources = [f"ts_le_{i}" for i in range(n_embeddings)]
modality = TS
class PROC:
name = 'pe'
n_embeddings = 110
sources = [f"ts_pe_{i}" for i in range(n_embeddings)]
modality = TS
class RAD:
name = 'rad'
n_embeddings = 768
sources = [f"n_rad_{i}" for i in range(n_embeddings)]
modality = TXT
class ECG:
name = 'ecg'
n_embeddings = 768
sources = [f"n_ecg_{i}" for i in range(n_embeddings)]
modality = TXT
class ECHO:
name = 'echo'
n_embeddings = 768
sources = [f"n_ech_{i}" for i in range(n_embeddings)]
modality = TXT
class VP:
name = 'vp'
n_embeddings = 18
sources = [f"vp_{i}" for i in range(n_embeddings)]
modality = IMG
class VMP:
name = 'vmp'
n_embeddings = 18
sources = [f"vmp_{i}" for i in range(n_embeddings)]
modality = IMG
class VD:
name = 'vd'
n_embeddings = 1024
sources = [f"vd_{i}" for i in range(n_embeddings)]
modality = IMG
class VMD:
name = 'vmd'
n_embeddings = 1024
sources = [f"vmd_{i}" for i in range(n_embeddings)]
modality = IMG
# Group all sources types in a list
SOURCES = [DEMOGRAPHIC, CHART, LAB, PROC, RAD, ECG, ECHO, VP, VMP, VD, VMD]
# Group all predictors of all sources in a list
ALL_PREDICTORS = DEMOGRAPHIC.sources + CHART.sources + LAB.sources + PROC.sources + RAD.sources + ECG.sources + \
ECHO.sources + VP.sources + VMP.sources + VD.sources + VMD.sources
# Group all chest sources types in a list
CHEST_SOURCES = [DEMOGRAPHIC, CHART, LAB, PROC, ECG, ECHO, VP, VMP, VD, VMD]
# Group all predictors of chest sources in a list
CHEST_PREDICTORS = DEMOGRAPHIC.sources + CHART.sources + LAB.sources + PROC.sources + ECG.sources + \
ECHO.sources + VP.sources + VMP.sources + VD.sources + VMD.sources
# Group all modalities in a list
ALL_MODALITIES = [TAB, TS, TXT, IMG]
# ID columns
IMG_ID = 'img_id'
GLOBAL_ID = 'haim_id'
# Number of valid data in the HAIM dataset
N_DATA = 45050
# File where the dataset is stored
FILE_DF = 'csvs/cxr_ic_fusion_1103.csv'
EXPERIMENT_PATH = 'experiments'
# All tasks names
FRACTURE = 'Fracture'
LUNG_LESION = 'Lung Lesion'
ENLARGED_CARDIOMEDIASTINUM = 'Enlarged Cardiomediastinum'
CONSOLIDATION = 'Consolidation'
PNEUMONIA = 'Pneumonia'
LUNG_OPACITY = 'Lung Opacity'
ATELECTASIS = 'Atelectasis'
PNEUMOTHORAX = 'Pneumothorax'
EDEMA = 'Edema'
CARDIOMEGALY = 'Cardiomegaly'
MORTALITY = '48h mortality'
LOS = '48h los'
# AUC values from the paper
AUC = {'HAIM': {FRACTURE: 0.838,
LUNG_LESION: 0.844,
ENLARGED_CARDIOMEDIASTINUM: 0.876,
CONSOLIDATION: 0.929,
PNEUMONIA: 0.883,
ATELECTASIS: 0.779,
LUNG_OPACITY: 0.816,
PNEUMOTHORAX: 0.836,
EDEMA: 0.917,
CARDIOMEGALY: 0.914,
LOS: 0.939,
MORTALITY: 0.912},
'NON_HAIM': {FRACTURE: 0.787,
LUNG_LESION: 0.831,
ENLARGED_CARDIOMEDIASTINUM: 0.868,
CONSOLIDATION: 0.920,
PNEUMONIA: 0.876,
ATELECTASIS: 0.767,
LUNG_OPACITY: 0.813,
PNEUMOTHORAX: 0.804,
EDEMA: 0.912,
CARDIOMEGALY: 0.912,
LOS: 0.919,
MORTALITY: 0.889}
}