Skip to content

Commit 9fb9ed8

Browse files
committed
update configuration files
add supervise_type
1 parent 55bfa53 commit 9fb9ed8

30 files changed

+441
-141
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ python setup.py install
1515
```
1616

1717
## Data
18-
The datasets for the examples can be downloaded from [Google Drive][google_link] or [Baidu Disk][baidu_link] (extraction code: n07g). Extract the files to `PyMIC_data` after the download.
18+
The datasets for the examples can be downloaded from [Google Drive][google_link] or [Baidu Disk][baidu_link] (extraction code: xlwg). Extract the files to `PyMIC_data` after downloading.
1919

2020

2121
## List of Examples
@@ -35,8 +35,8 @@ Currently we provide the following examples in this repository:
3535
|Noisy label learning|[seg_nll/JSRT][nll_jsrt_link]|Comparing different NLL methods for learning from noisy labels|
3636

3737
[PyMIC_link]: https://github.com/HiLab-git/PyMIC
38-
[google_link]:https://drive.google.com/file/d/1-LrMHsX7ZdBto2iC1WnbFFZ0tDeJQFHy/view?usp=sharing
39-
[baidu_link]:https://pan.baidu.com/s/15mjc0QqH75xztmc23PPWQQ
38+
[google_link]:https://drive.google.com/file/d/1eZakSEBr_zfIHFTAc96OFJix8cUBf-KR/view?usp=sharing
39+
[baidu_link]:https://pan.baidu.com/s/1tN0inIrVYtSxTVRfErD9Bw
4040
[AntBee_link]:classification/AntBee
4141
[CHNCXR_link]:classification/CHNCXR
4242
[JSRT_link]:segmentation/JSRT

seg_nll/JSRT/README.md

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ The dataset setting is similar to that in the `segmentation/JSRT` demo. See `con
3939

4040
```bash
4141
...
42-
task_type = seg
42+
tensor_type = float
43+
task_type = seg
44+
supervise_type = fully_sup
45+
4346
root_dir = ../../PyMIC_data/JSRT
4447
train_csv = config/data/jsrt_train_mix.csv
4548
valid_csv = config/data/jsrt_valid.csv
@@ -51,8 +54,8 @@ loss_type = CrossEntropyLoss
5154
The following commands are used for training and inference with this method, respectively:
5255

5356
```bash
54-
pymic_run train config/unet_ce.cfg
55-
pymic_run test config/unet_ce.cfg
57+
pymic_train config/unet_ce.cfg
58+
pymic_test config/unet_ce.cfg
5659
```
5760

5861
### GCE Loss
@@ -67,8 +70,8 @@ loss_type = GeneralizedCELoss
6770
The following commands are used for training and inference with this method, respectively:
6871

6972
```bash
70-
pymic_run train config/unet_gce.cfg
71-
pymic_run test config/unet_gce.cfg
73+
pymic_train config/unet_gce.cfg
74+
pymic_test config/unet_gce.cfg
7275
```
7376

7477
### CLSLSR
@@ -81,33 +84,45 @@ python clslsr_get_condience config/unet_ce.cfg
8184
The weight maps will be saved in `$root_dir/slsr_conf`. Then train the new model and do inference by:
8285

8386
```bash
84-
pymic_run train config/unet_clslsr.cfg
85-
pymic_run test config/unet_clslsr.cfg
87+
pymic_train config/unet_clslsr.cfg
88+
pymic_test config/unet_clslsr.cfg
8689
```
8790

8891
Note that the weight maps for training images are specified in the configuration file `train_csv = config/data/jsrt_train_mix_clslsr.csv`.
8992

9093
### Co-Teaching
91-
The configuration file for Co-Teaching is `config/unet2d_cot.cfg`. The corresponding setting is:
94+
The configuration file for Co-Teaching is `config/unet2d_cot.cfg`. Note that for the following methods, `supervise_type` should be set to `noisy_label`.
9295

9396
```bash
94-
nll_method = CoTeaching
97+
[dataset]
98+
...
99+
supervise_type = noisy_label
100+
...
101+
102+
[noisy_label_learning]
103+
method_name = CoTeaching
95104
co_teaching_select_ratio = 0.8
96105
rampup_start = 1000
97106
rampup_end = 8000
98107
```
99108

100109
The following commands are used for training and inference with this method, respectively:
101110
```bash
102-
pymic_nll train config/unet_cot.cfg
103-
pymic_nll test config/unet_cot.cfg
111+
pymic_train config/unet_cot.cfg
112+
pymic_test config/unet_cot.cfg
104113
```
105114

106115
### TriNet
107116
The configuration file for TriNet is `config/unet_trinet.cfg`. The corresponding setting is:
108117

109118
```bash
110-
nll_method = TriNet
119+
[dataset]
120+
...
121+
supervise_type = noisy_label
122+
...
123+
124+
[noisy_label_learning]
125+
method_name = TriNet
111126
trinet_select_ratio = 0.9
112127
rampup_start = 1000
113128
rampup_end = 8000
@@ -116,15 +131,21 @@ rampup_end = 8000
116131
The following commands are used for training and inference with this method, respectively:
117132

118133
```bash
119-
pymic_nll train config/unet_trinet.cfg
120-
pymic_nll test config/unet_trinet.cfg
134+
pymic_train config/unet_trinet.cfg
135+
pymic_test config/unet_trinet.cfg
121136
```
122137

123138
### DAST
124139
The configuration file for DAST is `config/unet_dast.cfg`. The corresponding setting is:
125140

126141
```bash
127-
nll_method = DAST
142+
[dataset]
143+
...
144+
supervise_type = noisy_label
145+
...
146+
147+
[noisy_label_learning]
148+
method_name = DAST
128149
dast_dbc_w = 0.1
129150
dast_st_w = 0.1
130151
dast_rank_length = 20
@@ -136,8 +157,8 @@ rampup_end = 8000
136157
The commands for training and inference are:
137158

138159
```bash
139-
pymic_nll train config/unet_dast.cfg
140-
pymic_run test config/unet_dast.cfg
160+
pymic_train config/unet_dast.cfg
161+
pymic_test config/unet_dast.cfg
141162
```
142163

143164
## Evaluation

seg_nll/JSRT/config/unet_ce.cfg

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
[dataset]
22
# tensor type (float or double)
3-
tensor_type = float
3+
tensor_type = float
4+
task_type = seg
5+
supervise_type = fully_sup
46

5-
task_type = seg
67
root_dir = ../../PyMIC_data/JSRT
78
train_csv = config/data/jsrt_train_mix.csv
89
valid_csv = config/data/jsrt_valid.csv
@@ -64,8 +65,6 @@ ReduceLROnPlateau_patience = 2000
6465
ckpt_save_dir = model/unet_ce
6566
ckpt_prefix = unet_ce
6667

67-
# start iter
68-
iter_start = 0
6968
iter_max = 10000
7069
iter_valid = 100
7170
iter_save = [10000]

seg_nll/JSRT/config/unet_clslsr.cfg

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
[dataset]
22
# tensor type (float or double)
3-
tensor_type = float
3+
tensor_type = float
4+
task_type = seg
5+
supervise_type = fully_sup
46

5-
task_type = seg
67
root_dir = ../../PyMIC_data/JSRT
78
train_csv = config/data/jsrt_train_mix_clslsr.csv
89
valid_csv = config/data/jsrt_valid.csv
@@ -65,8 +66,6 @@ early_stop_patience = 4000
6566
ckpt_save_dir = model/unet_clslsr
6667
ckpt_prefix = unet_clslsr
6768

68-
# start iter
69-
iter_start = 0
7069
iter_max = 10000
7170
iter_valid = 100
7271
iter_save = [10000]

seg_nll/JSRT/config/unet_cot.cfg

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
[dataset]
22
# tensor type (float or double)
3-
tensor_type = float
3+
tensor_type = float
4+
task_type = seg
5+
supervise_type = noisy_label
46

5-
task_type = seg
67
root_dir = ../../PyMIC_data/JSRT
78
train_csv = config/data/jsrt_train_mix.csv
89
valid_csv = config/data/jsrt_valid.csv
@@ -68,7 +69,7 @@ iter_valid = 100
6869
iter_save = [10000]
6970

7071
[noisy_label_learning]
71-
nll_method = CoTeaching
72+
method_name = CoTeaching
7273
co_teaching_select_ratio = 0.8
7374
rampup_start = 1000
7475
rampup_end = 8000

seg_nll/JSRT/config/unet_dast.cfg

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
[dataset]
22
# tensor type (float or double)
3-
tensor_type = float
3+
tensor_type = float
4+
task_type = seg
5+
supervise_type = noisy_label
46

5-
task_type = seg
67
root_dir = ../../PyMIC_data/JSRT
78
train_csv = config/data/jsrt_train_clean.csv
89
train_csv_noise = config/data/jsrt_train_noise.csv
@@ -70,7 +71,7 @@ iter_valid = 100
7071
iter_save = [10000]
7172

7273
[noisy_label_learning]
73-
nll_method = DAST
74+
method_name = DAST
7475
dast_dbc_w = 0.1
7576
dast_st_w = 0.1
7677
dast_rank_length = 20

seg_nll/JSRT/config/unet_gce.cfg

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
[dataset]
22
# tensor type (float or double)
3-
tensor_type = float
3+
tensor_type = float
4+
task_type = seg
5+
supervise_type = fully_sup
46

5-
task_type = seg
67
root_dir = ../../PyMIC_data/JSRT
78
train_csv = config/data/jsrt_train_mix.csv
89
valid_csv = config/data/jsrt_valid.csv
@@ -64,8 +65,6 @@ ReduceLROnPlateau_patience = 2000
6465
ckpt_save_dir = model/unet_gce
6566
ckpt_prefix = unet_gce
6667

67-
# start iter
68-
iter_start = 0
6968
iter_max = 10000
7069
iter_valid = 100
7170
iter_save = [10000]

seg_nll/JSRT/config/unet_trinet.cfg

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
[dataset]
22
# tensor type (float or double)
3-
tensor_type = float
3+
tensor_type = float
4+
task_type = seg
5+
supervise_type = noisy_label
46

5-
task_type = seg
67
root_dir = ../../PyMIC_data/JSRT
78
train_csv = config/data/jsrt_train_mix.csv
89
valid_csv = config/data/jsrt_valid.csv
@@ -64,14 +65,12 @@ ReduceLROnPlateau_patience = 2000
6465
ckpt_save_dir = model/unet_trinet
6566
ckpt_prefix = trinet
6667

67-
# start iter
68-
iter_start = 0
6968
iter_max = 10000
7069
iter_valid = 100
7170
iter_save = [10000]
7271

7372
[noisy_label_learning]
74-
nll_method = TriNet
73+
method_name = TriNet
7574
trinet_select_ratio = 0.9
7675
rampup_start = 1000
7776
rampup_end = 8000

0 commit comments

Comments
 (0)