Diff of /GenerateSolution.txt [000000] .. [70b6b3]

Switch to unified view

a b/GenerateSolution.txt
1
1) Generating necessary pkl-files
2
    $ python elias/make_final_split.py
3
2) $ cd ira
4
3) In SETTINGS.json set STAGE to 1:
5
            "STAGE": 1
6
4) Train segmentation networks on LUNA dataset: 
7
    $ python train_seg_patch.py luna_p8a1
8
    //md5sum 75b63363507b44632c778f3165812000  luna_p8a1-20170226-173608.pkl
9
    //trained model can be found at metadata/models/luna_p8a1-20170226-173608.pkl
10
5) Generate segmentation maps for DSB: 
11
    $ python test_seg_scan_dsb.py  dsb_s5_p8a1
12
        Alternatively, to make it in parallel on 4 GPUs do:
13
        $ python test_seg_scan_dsb_prl.py  dsb_s5_p8a1  0
14
        $ python test_seg_scan_dsb_prl.py  dsb_s5_p8a1  1
15
        $ python test_seg_scan_dsb_prl.py  dsb_s5_p8a1  2
16
        $ python test_seg_scan_dsb_prl.py  dsb_s5_p8a1  3
17
18
19
20
21
6) Generate AAPM Segmentation Maps 
22
    $ cd ../matthias
23
    $ python test_seg_scan_aapm.py  aapm_s2_p8a1
24
25
26
7) Train False Positive Reduction Network on LUNA dataset
27
    $ cd ../ira
28
    $ python train_fpred_patch.py luna_c3
29
    //md5sum c3bedca59e6fa93221ba9c88ece7953d  luna_c3-20170226-174919.pkl
30
    //trained model can be found at metadata/models/luna_c3-20170226-174919.pkl
31
32
33
8) Generate false positive predictions for DSB candidates
34
    $ python test_fpred_scan.py dsb_c3_s5_p8a1
35
36
37
9) Generate False Positive predictions AAPM
38
    $ cd ../matthias
39
    $ python matthias/test_fpred_scan_aapm.py aapm_c3_s2_p8a1
40
41
42
10) Train Malignancy Detection Networks on LUNA data for transfer learning
43
    $ cd ../fred
44
    $ python train_props_patch.py r_fred_malignancy_2
45
    //md5sum 676adf509ed8193ecd114b5dcbf0c7f6  r_fred_malignancy_2-20170328-230443.pkl
46
    //trained model can be found at metadata/models/r_fred_malignancy_2-20170328-230443.pkl
47
    $ python train_props_patch.py r_fred_malignancy_7
48
    //md5sum 5689072d7bd49f079654e21ce6d1f423  r_fred_malignancy_7-20170404-163552.pkl
49
    //trained model can be found at metadata/models/r_fred_malignancy_7-20170404-163552.pkl
50
    $ python train_props_patch.py r_fred_malignancy_8
51
    //md5sum ca5cab14549e601628bd7612adba3b23  r_fred_malignancy_8-20170404-171012.pkl
52
    //trained model can be found at metadata/models/r_fred_malignancy_8-20170404-171012.pkl
53
    $ python train_props_patch.py r_fred_centroid_1
54
55
56
11) Train cancer prediction networks on DSB stage 1 data
57
    $ cd ../elias
58
    $ python train_class_dsb.py  dsb_a_eliasq1_mal2_s5_p8a1_all
59
    $ python train_class_dsb.py  dsb_a_eliasq1_mal2_s5_p8a1_spl
60
    $ python train_class_dsb.py  dsb_a_eliasq3_mal2_s5_p8a1_all
61
    $ python train_class_dsb.py  dsb_a_eliasq3_mal2_s5_p8a1_spl
62
    $ python train_class_dsb.py  dsb_a_eliasq4_mal2_s5_p8a1_all
63
    $ python train_class_dsb.py  dsb_a_eliasq4_mal2_s5_p8a1_spl
64
    $ python train_class_dsb.py  dsb_a_eliasq5_mal2_s5_p8a1_all
65
    $ python train_class_dsb.py  dsb_a_eliasq5_mal2_s5_p8a1_spl
66
    $ python train_class_dsb.py  dsb_a_eliasq6_mal2_s5_p8a1_all
67
    $ python train_class_dsb.py  dsb_a_eliasq6_mal2_s5_p8a1_spl
68
    $ python train_class_dsb.py  dsb_a_eliasq10_mal2_s5_p8a1_all
69
    $ python train_class_dsb.py  dsb_a_eliasq10_mal2_s5_p8a1_spl
70
    $ python train_class_dsb.py  dsb_a_eliasq11_mal2_s5_p8a1_all
71
    $ python train_class_dsb.py  dsb_a_eliasq11_mal2_s5_p8a1_spl
72
    $ python train_class_dsb.py  dsb_a_eliasq14_mal2_s5_p8a1_all
73
    $ python train_class_dsb.py  dsb_a_eliasq14_mal2_s5_p8a1_spl
74
    $ python train_class_dsb.py  dsb_a_eliasq15_mal7_s5_p8a1_all
75
    $ python train_class_dsb.py  dsb_a_eliasq15_mal7_s5_p8a1_spl
76
77
78
    $ cd ../lio
79
    $ python train_class_dsb.py  dsb_a_lionoclip_c3_s5_p8a1_spl
80
    $ python train_class_dsb.py  dsb_a_liolme32_c3_s5_p8a1_spl
81
    $ python train_class_dsb.py  dsb_a_liox8_c3_s2_p8a1_spl
82
    $ python train_class_dsb.py  dsb_a_liox11_c3_s5_p8a1_spl
83
    $ python train_class_dsb.py  dsb_a_liox13_c3_s2_p8a1_spl
84
    $ python train_class_dsb.py  dsb_a_lionoclip_c3_s5_p8a1_all
85
    $ python train_class_dsb.py  dsb_a_liolme32_c3_s5_p8a1_all
86
    $ python train_class_dsb.py  dsb_a_liox8_c3_s2_p8a1_all
87
    $ python train_class_dsb.py  dsb_a_liox11_c3_s5_p8a1_all
88
    $ python train_class_dsb.py  dsb_a_liox13_c3_s2_p8a1_all
89
90
91
    $ cd ../matthias
92
    $ python train_class_dsb.py dsb_af25lmelr10-1_mal2_s5_p8a1_spl
93
    $ python train_class_dsb.py dsb_af25lmeaapm_mal2_s5_pa81_spl
94
    $ python train_class_dsb.py dsb_af25lmelr10-3_mal2_s5_p8a1_spl
95
    $ python train_class_dsb.py dsb_af25lmelr10-1_mal2_s5_p8a1_all
96
    $ python train_class_dsb.py dsb_af25lmeaapm_mal2_s5_pa81_all
97
    $ python train_class_dsb.py dsb_af25lmelr10-3_mal2_s5_p8a1_all
98
99
100
    $ cd ../frederic
101
    $ python train_class_dsb.py dsb_af27lme_mal2_s5_p8a1_all
102
    $ python train_class_dsb.py dsb_af27lme_mal2_s5_p8a1_spl
103
    $ python train_class_dsb_coords.py dsb_af30lme_mal2_s5_p8a1_all
104
    $ python train_class_dsb_coords.py dsb_af30lme_mal2_s5_p8a1_spl
105
    $ python train_class_dsb.py dsb_af31lme_mal8_s5_p8a1_all
106
    $ python train_class_dsb.py dsb_af31lme_mal8_s5_p8a1_spl
107
    $ python train_class_dsb.py dsb_af34lme_mal7_s5_p8a1_all
108
    $ python train_class_dsb.py dsb_af34lme_mal7_s5_p8a1_spl
109
    $ python train_class_dsb.py dsb_af35lme_mal7_s5_p8a1_all
110
    $ python train_class_dsb.py dsb_af35lme_mal7_s5_p8a1_spl
111
    $ python train_class_dsb.py dsb_af36_eq10_mal7_s5_p8a1_all
112
    $ python train_class_dsb.py dsb_af36_eq10_mal7_s5_p8a1_spl
113
114
115
12) Generate predictions for DSB stage 1 data from the split for ensemble weighing
116
    $ cd ../elias
117
    $ python test_class_dsb.py  dsb_a_eliasq1_mal2_s5_p8a1_spl valid
118
    $ python test_class_dsb.py  dsb_a_eliasq3_mal2_s5_p8a1_spl valid
119
    $ python test_class_dsb.py  dsb_a_eliasq4_mal2_s5_p8a1_spl valid
120
    $ python test_class_dsb.py  dsb_a_eliasq5_mal2_s5_p8a1_spl valid
121
    $ python test_class_dsb.py  dsb_a_eliasq6_mal2_s5_p8a1_spl valid
122
    $ python test_class_dsb.py  dsb_a_eliasq10_mal2_s5_p8a1_spl valid
123
    $ python test_class_dsb.py  dsb_a_eliasq11_mal2_s5_p8a1_spl valid
124
    $ python test_class_dsb.py  dsb_a_eliasq14_mal2_s5_p8a1_spl valid
125
    $ python test_class_dsb.py  dsb_a_eliasq15_mal7_s5_p8a1_spl valid
126
127
128
    $ cd ../lio
129
    $ python test_class_dsb.py  dsb_a_lionoclip_c3_s5_p8a1_spl valid
130
    $ python test_class_dsb.py  dsb_a_liolme32_c3_s5_p8a1_spll valid
131
    $ python test_class_dsb.py  dsb_a_liox8_c3_s2_p8a1_spl valid
132
    $ python test_class_dsb.py  dsb_a_liox11_c3_s5_p8a1_spl valid
133
    $ python test_class_dsb.py  dsb_a_liox13_c3_s2_p8a1_spl valid
134
135
136
    $ cd ../matthias
137
    $ python test_class_dsb.py dsb_af25lmelr10-1_mal2_s5_p8a1_spl valid
138
    $ python test_class_dsb.py dsb_af25lmeaapm_mal2_s5_pa81_spl valid
139
    $ python test_class_dsb.py dsb_af25lmelr10-3_mal2_s5_p8a1_spl valid
140
141
142
    $ cd ../frederic
143
    $ python test_class_dsb.py dsb_af27lme_mal2_s5_p8a1_spl valid
144
    $ python test_class_dsb_coords.py dsb_af30lme_mal2_s5_p8a1_spl valid
145
    $ python test_class_dsb.py dsb_af31lme_mal8_s5_p8a1_spl valid
146
    $ python test_class_dsb.py dsb_af34lme_mal7_s5_p8a1_spl valid
147
    $ python test_class_dsb.py dsb_af35lme_mal7_s5_p8a1_spl valid
148
    $ python test_class_dsb.py dsb_af36_eq10_mal7_s5_p8a1_spl valid
149
150
151
13) Generate predictions for the DSB final stage data
152
    // change stage field in SETTINGS.json files in all branch folders
153
    In SETTINGS.json set STAGE to 2:
154
                "STAGE": 2
155
156
157
    $ cd ../elias
158
    $ python test_class_dsb.py  dsb_a_eliasq1_mal2_s5_p8a1_spl test
159
    $ python test_class_dsb.py  dsb_a_eliasq3_mal2_s5_p8a1_spl test
160
    $ python test_class_dsb.py  dsb_a_eliasq4_mal2_s5_p8a1_spl test
161
    $ python test_class_dsb.py  dsb_a_eliasq5_mal2_s5_p8a1_spl test
162
    $ python test_class_dsb.py  dsb_a_eliasq6_mal2_s5_p8a1_spl test
163
    $ python test_class_dsb.py  dsb_a_eliasq10_mal2_s5_p8a1_spl test
164
    $ python test_class_dsb.py  dsb_a_eliasq11_mal2_s5_p8a1_spl test
165
    $ python test_class_dsb.py  dsb_a_eliasq14_mal2_s5_p8a1_spl test
166
    $ python test_class_dsb.py  dsb_a_eliasq15_mal7_s5_p8a1_spl test
167
    $ python test_class_dsb.py  dsb_a_eliasq1_mal2_s5_p8a1_all test
168
    $ python test_class_dsb.py  dsb_a_eliasq3_mal2_s5_p8a1_all test
169
    $ python test_class_dsb.py  dsb_a_eliasq4_mal2_s5_p8a1_all test
170
    $ python test_class_dsb.py  dsb_a_eliasq5_mal2_s5_p8a1_all test
171
    $ python test_class_dsb.py  dsb_a_eliasq6_mal2_s5_p8a1_all test
172
    $ python test_class_dsb.py  dsb_a_eliasq10_mal2_s5_p8a1_all test
173
    $ python test_class_dsb.py  dsb_a_eliasq11_mal2_s5_p8a1_all test
174
    $ python test_class_dsb.py  dsb_a_eliasq14_mal2_s5_p8a1_all test
175
    $ python test_class_dsb.py  dsb_a_eliasq15_mal7_s5_p8a1_all test
176
177
178
    $ cd ../lio
179
    $ python test_class_dsb.py  dsb_a_lionoclip_c3_s5_p8a1_spl test
180
    $ python test_class_dsb.py  dsb_a_liolme32_c3_s5_p8a1_spl test
181
    $ python test_class_dsb.py  dsb_a_liox8_c3_s2_p8a1_spl test
182
    $ python test_class_dsb.py  dsb_a_liox11_c3_s5_p8a1_spl test
183
    $ python test_class_dsb.py  dsb_a_liox13_c3_s2_p8a1_spl test
184
    $ python test_class_dsb.py  dsb_a_lionoclip_c3_s5_p8a1_all test
185
    $ python test_class_dsb.py  dsb_a_liolme32_c3_s5_p8a1_all test
186
    $ python test_class_dsb.py  dsb_a_liox8_c3_s2_p8a1_all test
187
    $ python test_class_dsb.py  dsb_a_liox11_c3_s5_p8a1_all test
188
    $ python test_class_dsb.py  dsb_a_liox13_c3_s2_p8a1_all test
189
190
191
    $ cd ../frederic
192
    // replace dummy array with pids of stage2 data in configs
193
    $ python test_class_dsb.py dsb_af27lme_mal2_s5_p8a1_all test
194
    $ python test_class_dsb.py dsb_af27lme_mal2_s5_p8a1_spl test
195
    $ python test_class_dsb_coords.py dsb_af30lme_mal2_s5_p8a1_all test
196
    $ python test_class_dsb_coords.py dsb_af30lme_mal2_s5_p8a1_spl test
197
    $ python test_class_dsb.py dsb_af31lme_mal8_s5_p8a1_all test
198
    $ python test_class_dsb.py dsb_af31lme_mal8_s5_p8a1_spl test
199
    $ python test_class_dsb.py dsb_af34lme_mal7_s5_p8a1_all test
200
    $ python test_class_dsb.py dsb_af34lme_mal7_s5_p8a1_spl test
201
    $ python test_class_dsb.py dsb_af35lme_mal7_s5_p8a1_all test
202
    $ python test_class_dsb.py dsb_af35lme_mal7_s5_p8a1_spl test
203
    $ python test_class_dsb.py dsb_af36_eq10_mal7_s5_p8a1_all test
204
    $ python test_class_dsb.py dsb_af36_eq10_mal7_s5_p8a1_spl test
205
206
207
    $ cd ../matthias
208
    $ python test_class_dsb.py dsb_af25lmelr10-1_mal2_s5_p8a1_spl stage2
209
    $ python test_class_dsb.py dsb_af25lmeaapm_mal2_s5_pa81_spl stage2
210
    $ python test_class_dsb.py dsb_af25lmelr10-3_mal2_s5_p8a1_spl stage2
211
    $ python test_class_dsb.py dsb_af25lmelr10-1_mal2_s5_p8a1_all stage2
212
    $ python test_class_dsb.py dsb_af25lmeaapm_mal2_s5_pa81_all stage2
213
    $ python test_class_dsb.py dsb_af25lmelr10-3_mal2_s5_p8a1_all stage2
214
215
216
217
218
14) Making ensembles
219
    $ cd ../andreas/ensemble
220
    // make sure settings.json has stage = 2
221
    $ python ensemble_main.py 
222
    // This script will generate the two submissions
223
224
225
226
227
228
229
230
231
232
233
Extra information to make it easier to check our approach:
234
Results of the ensembling approaches:
235
236
237
    DEFENSIVE ENSEMBLE
238
    10-skf-cv: dsb_af36_eq10_mal7_s5_p8a1_spl is always the best.
239
    Other configs that are used during CV are: ['dsb_a_eliasq5_mal2_s5_p8a1_spl', 'dsb_a_eliasq14_mal2_s5_p8a1_spl', 'dsb_a_eliasq15_mal7_s5_p8a1_spl', 'dsb_a_liolme32_c3_s5_p8a1_spl', 'dsb_af30lme_mal2_s5_p8a1_spl', 'dsb_af34lme_mal7_s5_p8a1_spl', 'dsb_af36_eq10_mal7_s5_p8a1_spl']
240
    reoptimizing on full valid set will give dsb_af36_eq10_mal7_s5_p8a1_spl 100% weight
241
    TLDR: defensive ensemble = dsb_af36_eq10_mal7_s5_p8a1_spl
242
    
243
    OFFENSIVE ENSEMBLE
244
    will take the configs used by the defensive ensemble, assign equal weights, take those models trained on the full data set and average their predictions for stage2 LB. 
245
    Here: average test set predictions of configs ['dsb_a_eliasq5_mal2_s5_p8a1_spl', 'dsb_a_eliasq14_mal2_s5_p8a1_spl', 'dsb_a_eliasq15_mal7_s5_p8a1_spl', 'dsb_a_liolme32_c3_s5_p8a1_spl', 'dsb_af30lme_mal2_s5_p8a1_spl', 'dsb_af34lme_mal7_s5_p8a1_spl', 'dsb_af36_eq10_mal7_s5_p8a1_spl']
246
    So the following models are selected to make the offensive ensemble:
247
    ['dsb_a_eliasq5_mal2_s5_p8a1_all', 'dsb_a_eliasq14_mal2_s5_p8a1_all', 'dsb_a_eliasq15_mal7_s5_p8a1_all', 'dsb_a_liolme32_c3_s5_p8a1_all', 'dsb_af30lme_mal2_s5_p8a1_all', 'dsb_af34lme_mal7_s5_p8a1_all', 'dsb_af36_eq10_mal7_s5_p8a1_all']
248
249
250
All trained models can be found in metadata/models