-
Notifications
You must be signed in to change notification settings - Fork 8
/
chexnet_config_sample.ini
177 lines (130 loc) · 4.68 KB
/
chexnet_config_sample.ini
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
[DEFAULT]
; working directory, one working directory can only have one running job at a time
output_dir = ./experiments/chexnet0
; Verbosity for other stuffs
verbosity = 0
[DATASET]
; Fully Connected model type [multiclass, multibinary]
class_mode = multiclass
; if class_mode == multiclass, you may selec softmax or sigmoid as activation of final probability estimate
final_activation = sigmoid
; number of train/dev unique patient count,
; test patient count will be (total count - train_patient_count - dev_patient_count), which is 389 by default
train_patient_ratio = 94
dev_patient_ratio = 3
;
dataset_dilation = 1
; download this file directly from NIH dropbox
data_entry_file = ./datasets/chexnet_ds/image_data_entry.csv
; class names, you should not modify this
class_names = Atelectasis,Cardiomegaly,Effusion,Infiltration,Mass,Nodule,Pneumonia,Pneumothorax,Consolidation,Edema,Emphysema,Fibrosis,Pleural_Thickening,Hernia
; this variable controlls the class_weight ratio between 0 and 1
; higher value means higher weighting of positive samples
positive_weights_multiply = 1
; if true, mean binary cross-entroy will be weighted by positive counts
; if false, just average the cross-entropy loss of each class
; in both cases, positive/negative sample ratio of each class is considered in the cross-entropy loss
use_class_balancing = true
; if true, use default split, otherwise create a new train/dev/test split
use_default_split = false
; random state used for splitting dataset into train/dev/test sets
split_dataset_random_state = 1
[IMAGE]
; all images should be placed under this dir
image_source_dir = ./datasets/chexnet_ds/images
; 512 means 512x512 pixels, always use square shaped input
image_dimension = 224
; valid options are 'grayscale', 'rgb' and 'hsv'
color_mode = rgb
[IMAGE-PREPROCESSING]
; normalize
normalize_by_mean_var = true
; color_mode=grayscale
normalize_mean = 0.449
; color_mode=rgb, hsv
normalize_mean_chan1 = 0.485
normalize_mean_chan2 = 0.456
normalize_mean_chan3 = 0.406
; color_mode=grayscale
normalize_stdev = 0.226
; color_mode=rgb, hsv
normalize_stdev_chan1 = 0.229
normalize_stdev_chan2 = 0.224
normalize_stdev_chan3 = 0.225
; samplewise zero-mean, variance normalization. DO NOT set true in conjection with normalize_by_mean_var=true
normalize_samplewise = false
[IMAGE-AUGMENATION]
; Image augmentation
; augmented images will be saved into
aug_verification_path = ./augmentation/verification
; enable augmentation in training set
train_augmentation = true
; enable augmentation in dev set
dev_augmentation = false
; enable augmentation in testing set
test_augmentation = false
random_horz_flip = true
random_vert_flip = false
;flip probability
flip_prob = 0.5
[MODEL]
; use the following model (currently support densenet121)
model_name = densenet121
; Load imagenet defaults automatically if use_ext_base_model_weights = false
use_base_model_weights = true
; file path of imagenet pretrained weights, loaded at base_model initialization step
use_ext_base_model_weights = false
base_model_weights_file = ./densenet121_grayscale.h5
; if true, load trained model weights saved in output_dir
; this is typically used for resuming your previous training tasks
; so the use_split_dataset will be automatically set to false
; also, make sure you use the reasonable initial_learning_rate
use_trained_model_weights = true
; if true, use best weights, else use last weights
use_best_weights = false
; note that the best weighting will be saved as best_weights.h5
output_weights_name = weights.h5
; print model summary
show_model_summary = false
;
loss_function = chexnet_binary_cross_entropy
[TRAIN]
; number of gpus, 0 means all
gpu = 0
; Resplit dataset (implies starting over)
force_resplit = false
; Print training progress
progress_verbosity = 1
; basic training parameters
epochs = 30
batch_size = 32
initial_learning_rate = 0.001
; steps per epoch for training
; auto or int
; if auto is set, (total samples / batch_size) is used by default.
train_steps = auto
; steps per epoch for validation
; auto or int
; if auto is set, (total samples / batch_size) is used by default.
validation_steps = auto
; patience parameter used for ReduceLROnPlateau callback
; If val_loss doesn't decrease for x epochs, learning rate will be reduced by factor of 10.
patience_reduce_lr = 2
; Tensorboard
histogram_freq = 0
write_graph = false
write_grads = false
write_images = false
embeddings_freq = 0
[TEST]
; Print testing progress
progress_verbosity = 1
; Save grad-cam outputs
enable_grad_cam = true
; Output directory of gradcam images
grad_cam_outputdir = ./imgdir_cxr14
batch_size = 32
test_generator_random_state = 1
steps = auto
; if true, use best_weights.h5, else use weights.h5
use_best_weights = true