milesial / Pytorch-UNet

PyTorch implementation of the U-Net for image semantic segmentation with high quality images
GNU General Public License v3.0
9.13k stars 2.49k forks source link

How relevant are negative examples for a Unet segmentation model? #126

Closed luistelmocosta closed 4 years ago

luistelmocosta commented 4 years ago

Hello, I am working with a Unet segmentation model for medical image analysis, and I would like to know how important are negative examples (with empty masks) for my model to learn that some images are 100% negatives. I am asking this because I took a bunch of negative and added to my dataset, some kind of hard negative mining, and still, I am getting a lot of false positives. Does Unet learn anything with negative examples? Is there any other way to force my model to learn these 'negative' features?

If you could also provide relevant information about this (articles, papers, questions) I would highly appreciate it.

Kind regards

milesial commented 4 years ago

Hi, in my Carvana dataset there was only images of cars, and no images without any cars, so I can't really help you.

Adding negative example as you did should help. You could also modify your loss so that false positive are heavily penalised. Finally, you could simply try increasing the threshold for creating the final binary mask.