Open Darienzhangyy opened 8 years ago
Hi Darienzhangyy, did you figure out the reason behind this? I was wondering how to compute the weight of different class? Could you enlighten me?
I would like to know how have you assigned class weighting values?
@Darienzhangyy hello,how do you annotate your own dataset?
@Darienzhangyy can you please explain class weighting?
Hi, A matlab script can be used to create annotations, such that each class in your image reperesents a particular label. So using a matlab script, try to label every pixel in your image. Eg: if road is one class, then all the pixels belonging to the road class will br labeled as 1. If tree is another class label it as 2. So every class should have a label, so that it can be classified by the system. You will have to write a matlab script for it.
On Aug 2, 2017 4:04 PM, "Shivam Sardana" notifications@github.com wrote:
@Darienzhangyy https://github.com/darienzhangyy can you please explain class weighting?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/alexgkendall/caffe-segnet/issues/66#issuecomment-319634947, or mute the thread https://github.com/notifications/unsubscribe-auth/AUXv5IU8PL5CoZjQAy_qZVG4p-prEcoiks5sUFC3gaJpZM4JbHqe .
I really dont know why similar topics of this nature are not being answered
I have tried to train on my own data, which only has 4 classes. To be more specific, some images have 3 classes, some have 4 classes.
The training process works fine. I am also able to make predictions and the prediction looks VERY close to the ground truth! However, two of the classes are always missing in prediction. May I ask what may probably cause this? Do I need to modify compute_bn_statistics.py? Thanks~
Here is some modifications in my segnet_ train.prototxt(last few layers): layer { bottom: "conv1_2_D" top: "conv1_1_D" name: "conv1_1_D" type: "Convolution" param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0 } convolution_param { weight_filler { type: "msra" } bias_filler { type: "constant" } num_output: 4#11 pad: 1 kernel_size: 3 } } layer { name: "loss" type: "SoftmaxWithLoss" bottom: "conv1_1_D" bottom: "label" top: "loss" softmax_param {engine: CAFFE} loss_param: { weight_by_label_freqs: true
ignore_label: 11
class_weighting: 0.25
class_weighting: 0.25
class_weighting: 0.25
class_weighting: 0.25
class_weighting: 0.2595
class_weighting: 0.1826
class_weighting: 4.5640
class_weighting: 0.1417
class_weighting: 0.9051
class_weighting: 0.3826
class_weighting: 9.6446
class_weighting: 7.3614 } }
segnet_inference(last few layers): layer { bottom: "conv1_2_D" top: "conv1_1_D" name: "conv1_1_D" type: "Convolution" param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0 } convolution_param { weight_filler { type: "msra" } bias_filler { type: "constant" } num_output: 4#11 pad: 1 kernel_size: 3 } }
I have also modified test_segmentation_camvid.py:
CLASS1 = [128,0,0] CLASS2 = [0,128,0] CLASS3 = [0,0,128] background = [0,0,0]