HiLab-git / SSL4MIS

Semi Supervised Learning for Medical Image Segmentation, a collection of literature reviews and code implementations.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The first supplied array does not contain any binary object

Huiimin5 opened this issue · comments

Hi, thank you so much for your efforts in implementing all these methods.

After training on ACDC with labeled_num=3, the testing code on ACDC gives me this error "The first supplied array does not contain any binary object", which is raised near:
image

The problem is that the trained model does not predict labeled 2 and label 3, which can be seen here:
image

The visualized dice on validation set shows that there is a performance peak at 600th step
image

The test performance on the validation set (at 600th step) looks normal
image

It's confusing that on a test set image the same model does not prediction label 2 and 3 at all. Have you met this issue and could you give me some advice?

Many thanks.

Hi,
Please use this function to measure the performance.

def calculate_metric_percase(pred, gt):
pred[pred > 0] = 1
gt[gt > 0] = 1
if pred.sum() > 0 and gt.sum() > 0:
dice = metric.binary.dc(pred, gt)
hd95 = metric.binary.hd95(pred, gt, voxelspacing=[10, 1, 1])
asd = metric.binary.asd(pred, gt, voxelspacing=[10, 1, 1])
return dice, hd95, asd
else:
return 0, 50, 10.
Best,
Xiangde.

Thanks a lot for your clarification.
By the way, in your work "Semi-Supervised Medical Image Segmentation via Cross Teaching between CNN and Transformer", you report standard deviation, is it calculated over each image? Basically for each foreground class, aside from taking the average over each image's dice, you also calculate the standard deviation, right?
Many thanks

Hi, Huimin,
Yes, your understanding is right.
Best,
Xiangde.

测试时我将代码改成你上面发布的,但还是出现“The first supplied array does not contain any binary object”,请问大佬这个该怎么解决呢?感谢你的贡献。

测试时我将代码改成你上面发布的,但还是出现“The first supplied array does not contain any binary object”,请问大佬这个该怎么解决呢?感谢你的贡献。

have you soloved this problem?