alexgkendall / SegNet-Tutorial

Files for a tutorial to train SegNet for road scenes using the CamVid dataset
http://mi.eng.cam.ac.uk/projects/segnet/tutorial.html
847 stars 517 forks source link

class_weighting and ignore_label in loss param layer #133

Open xuxucmkox opened 6 years ago

xuxucmkox commented 6 years ago

Now I have value 0 to represent unlabeled pixels, values 1 to 6 to represent label class 1 to 6. From what I understand, if we want to predict a pixel map with predicted labels 0 and 1 to 6, what I need is:

  1. In the last conv lalyer, num_output: 7

` loss_param: { weight_by_label_freqs: true class_weighting: 0.0352 # weighting for class 0 class_weighting: 0.6242 # weighting for class 1 class_weighting: 1.0 # weighting for class 2 class_weighting: 2.2355 # weighting for class 3 class_weighting: 1.4315 # weighting for class 4 class_weighting: 4.2291 # weighting for class 5 class_weighting: 0.3236 # weighting for class 6 }

`

And if we want to predict a pixel map with predicted labels 1 to 6, without 0, what I need is:

  1. In the last conv lalyer, num_output: 6

` loss_param: { weight_by_label_freqs: true ignore_label: 0 class_weighting: 0.0352 # weighting for class 0, should I delete this line? class_weighting: 0.6242 # weighting for class 1 class_weighting: 1.0 # weighting for class 2 class_weighting: 2.2355 # weighting for class 3 class_weighting: 1.4315 # weighting for class 4 class_weighting: 4.2291 # weighting for class 5 class_weighting: 0.3236 # weighting for class 6 }

` My question is:

  1. Are the two correct for their purposes?
  2. Should I delete the line " class_weighting: 0.0352 # weighting for class 0 " in code 2?

Thanks a lot!

vsuryamurthy commented 6 years ago

Please refer to the issue #20