Data Science Asked by Noon Kamonchat on June 24, 2021
I train U-Net model for audiometric CT image segmentation. I have one class in train data set and test data set (such as bladder). At the first time I set tf.keras.metrics.MeanIoU in model.fit, I set (num_classes=1) because I have only one class but it is error. Then I searched in many source it tell that I must set (num_classes=2) but I wonder why?
And I set def IoU like code as show below to see that will they be same? but not it very different or nearly at the end of epoch but not same.
def IoU(y_true, y_pred):
y_true_f = k.flatten(y_true)
y_pred_f = k.flatten(y_pred)
intersection = k.sum(y_true_f * y_pred_f)
union = k.sum(y_true_f) + k.sum(y_pred_f) - intersection
return intersection/union
sample of result
Epoch 1/50
Epoch 2/50
Epoch 3/50
Epoch 4/50
Epoch 5/50
Epoch 6/50
Epoch 7/50
Epoch 8/50
Epoch 9/50
Epoch 10/50
Epoch 11/50
Epoch 12/50
Epoch 13/50
Epoch 14/50
Epoch 15/50
Epoch 16/50
Can anyone explain to me? Thankyou.
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP