-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.txt
197 lines (158 loc) · 6.1 KB
/
README.txt
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
+========================================================+
| |
| Satellite Road Segmentation |
| Computational Intelligence Lab |
| ETH Zurich, FS2020 |
| |
| N. Kumar, L. Laneve, A. Paccagnella, T. Pegolotti |
| |
+========================================================+
Here we summarize how to reproduce our code. In order to
understand the structure and usage of our classes, we
recommend to follow the Jupyter Notebooks we provided in
this directory.
Please download the directory in the following repository:
https://github.com/NoImaginationGuy/CILroadseg
This repository is kept private until 31.09.2020 23.59,
and no commit will be made after this date.
The following two files are of size larger than 100MB:
saves/final/xception-base.h5
saves/final/xception-additionaldata.h5
and are uploaded using GIT LFS.
Please install git-lfs (https://git-lfs.github.com/)
before cloning the repository or directly download
those two files from:
https://www.polybox.ethz.ch/index.php/s/oqRA2nf89D4vFL2
[ETH VPN required]
or singularly from:
https://github.com/NoImaginationGuy/CILroadseg/blob/master/saves/final/xception-base.h5
https://github.com/NoImaginationGuy/CILroadseg/blob/master/saves/final/xception-additionaldata.h5
and replace the files in saves/final/ directory.
COLAB INTEGRATION:
The first code cell of each notebook contains the code to
import Google Drive folders. If you wish to use Google
Colab, please make sure to change the %cd line with the
actual directory where this folder is placed.
==========================================================
REPRODUCIBLE EXPERIMENTS:
- zero_classifier.ipynb
This notebook shows how we estimated, using a 4-fold
cross validation, the accuracy of the zero classifier,
as described in the report, Section II.
- logistic.ipynb
This notebook shows how to train, use and visualize
the results of the logistic regression baseline
described in the report, Section II(A).
- naive_cnn.ipynb
This notebook shows how to train, use and visualize
the results of the context-free CNN baseline
described in the report, Section II(B).
- cnn.ipynb
This notebook shows how to train, use and visualize
the results of the context-sensitive CNN model
described in the report, Section III(A).
- xception.ipynb
This notebook shows how to train, use and visualize
the results of the Xception based classifier
described in the report, Section III(B).
- unet.ipynb
This notebook shows how to train, use and visualize
the results of the U-Net model described in the
report, Section IV.
- discontinuity.ipynb
This notebook shows the visual differences between
a U-Net prediction made of 4 or 9 pieces. This
problem was mentioned in the report, Section IV.
- bagging.ipynb
This notebook shows how we computed the majority of
9 different (already trained) U-Nets, in order to
obtain our best result, as mentioned in the report,
Section VI.
==========================================================
UTILITY FILES:
- model_base.py
Defines a base class with a common interface we used
for all our models, in order to be able to define
common functions.
- config.py
Contains the definition of the functions for
computing the metrics we need.
- cross_validation.py
Defines a function which computes and prints a K-fold
cross validation, estimating the metrics defined in
config.py.
- helpers.py
Defines function to load and save images.
- notebooks.py
Defines utility functions useful to make notebooks
more straightforward to read, like loading data,
making predictions...
- submit.py
Contains the implementation for CSV generation
provided in the Kaggle competition.
- visualize.py
Defines utility functions to visualize images
on the notebooks.
==========================================================
OTHER DIRECTORIES:
- training/
Contains the provided training set, and the additional
training data extracted from the dataset cited in
the report, Section III(B).
- test/images/
Contains the provided test set.
- test/
All the notebooks will save generated CSV files into
this directory.
- test/pred/
All the notebooks will save the predicted masks as
.png files into this directory. The CSV files are
then generated using these images.
- saves/final/
All the .h5 files containing the weights of our
neural networks are here.
==========================================================
WEIGHT FILES: [in saves/final/]
These weight files produce the results that, on the
Kaggle public test set, achieve the F score mentioned
in report, Section VIII.
Notice that rotate and mean (RM) does not change the
training and thus it does not have a different .h5 file.
- unet-base.h5:
unet without any data augmentation,
only bootstrapping of subimage
- unet-rotation.h5
unet with only rotation/zoom/flip augmentation
- unet-rotation+color.h5
unet with rotation/zoom/flip augmentation, as
well as brightness/contrast augmentation.
- xception-base.h5
xception with rotation/flip augmentation
- xception-additionaldata.h5
xception with rotation/flip augmentation,
trained with the additional data mentioned
in the report, Section III(B).
==========================================================
VOTER PARAMETERS:
In saves/final/bagging/ we have 7 different weight files.
All of them have rotate/flip/zoom augmentation.
- unet-1.h5
no color augmentation
- unet-2.h5
no color augmentation
- unet-3.h5
brightness range [1, 1.1]
contrast range [1, 1.1]
- unet-4.h5
brightness range [1, 1.2]
contrast range [1, 1.1]
- unet-5.h5
brightness range [1, 1.1]
contrast range [1, 1.1]
- unet-6.h5
brightness range [0.9, 1.2]
contrast range [0.9, 1.2]
- unet-7.h5
brightness range [1, 1.1]
no contrast
dropout 0.1 on bottom layer (before first upsample)