4

I am new to deep learning. I am working on a CT-scan medical images. I want to use UNet architecture to predict the image segmentation. I have successfully implemented the UNet, however, my prediction is completely black. I think it is because there are images, for which the corresponding ground truth is black (quite a lot of images). So, I suppose it might cause a problem.

If the entire mask is black that implies there are no desired object in the image. An example image is below;

enter image description here

The below is the corresponding ground truth.

enter image description here

I am not sure how to deal with this situation. Should I remove all the (image, ground truth) pairs? CT images are volumetric images. So when my model predict the segmentation in a new test set, it should also detect images with no desired object in it. I would appreciate if someone guide me in this.

dataset: https://www.doc.ic.ac.uk/~rkarim/la_lv_framework/wall/index.html

Shai
  • 111,146
  • 38
  • 238
  • 371
Mass17
  • 1,555
  • 2
  • 14
  • 29
  • 2
    My advice would be to remove those samples and see if the model gets better. What's the ratio of such images to the total samples? – thushv89 Apr 12 '21 at 05:01
  • @thushv89, I checked it now. I have object to no_object ratio is 4409:8386. That is, there are 8386 black images out of 12795. This is too bad. – Mass17 Apr 12 '21 at 11:31
  • 3
    Wow! that's pretty high. No wonder your model went haywire... Again, try removing them and see if that helps. I assume you're solving a binary classification problem here? Though I can't guarantee, I think you'd be able to reach a decent state with the ~4400 you got. – thushv89 Apr 12 '21 at 11:36
  • @thushv89. I am solving image segmentation problem. I will try as you have suggested. Please share if you have any other ideas. Thank you very much. – Mass17 Apr 12 '21 at 11:51

1 Answers1

4

Image segmentation is more like pixel classification than image classification.
Therefore, you should not look at the ratio of "blank images"/"object images", but rather the ratio of "blank pixels"/"object pixels". My guess the ratio is much more skewed towards the "blank" pixels.

This means you are dealing with severe class imbalance.

This answer lists focal loss and on-line hard negative mining as good methods for handling class imbalance.

Shai
  • 111,146
  • 38
  • 238
  • 371