1
$\begingroup$

Total Dataset :- 100 (on case level)

Training :- 76 cases (18000 slices) Validation :- 19 cases (4000 slices) Test :- 5 cases (2000 slices)

I have a dataset that consists of approx. Eighteen thousand images, out of which approx. Fifteen thousand images are of the normal patient and around 3000 images of patients having some diseases. Now, for these 18000 images, I also have their segmentation mask. So, 15000 segmentations masks are empty, and 3000 have patches.

Should I also feed my model (deep learning, i.e., unet with resnet34 backbone) empty masks along with patches (non empty mask)?

$\endgroup$

2 Answers 2

0
$\begingroup$

You should, absolutely.

Even more, if you have prior knowledge regarding the distribution of the disease (like 1 case every 1000) I would strive to get a training dataset close to that distribution, even if it means collecting and adding more control cases with empty masks.

At the end you'll probably end up with a really imbalanced dataset, the way to tackle this issue is using the focal loss.

$\endgroup$
2
  • $\begingroup$ Thank you for your response. $\endgroup$
    – kal1619
    Oct 12, 2022 at 10:36
  • $\begingroup$ Thank you for your response. But I tried this approach earlier and used the focal loss, but the result was unsatisfactory. I have used model unet-resnet34. The tumor patch is tiny, and you can say it is a small dot on 512X512 images, which is hard to segment. Therefore, I'm using only mask pictures. And at this time stamp, I'm getting an IOU of 74%. Once the training is complete, I'll freeze all the layers except the last one and feed mixed images which are empty masks and non-empty masks. What do you say abo this approach? $\endgroup$
    – kal1619
    Oct 12, 2022 at 10:44
0
$\begingroup$

I share with you my experience with TensorFlow 2.0 (TF2.0). I don't know for other deep learning packages. In TF2.0, you must pass x_train and y_train together during training, where x_train is the image and y_train is the mask. (Similar holds for x_test and y_test, which must be passed together during evaluation.) This means that you must have a mask for both images with tumor and images without tumor. In your case, y_train would be a binary mask, since you have two pixel classes (tumor and no tumor). For images with no tumor, the mask would be all 0's (what you call an "empty mask"). For images with tumor, the mask would be 0's everywhere but 1's where there is tumor (what you call the "patch"). Note that the masks are essentially images (or numpy arrays, if you prefer) of the same size as your medical images, except that the mask has binary pixel values according to tumor present (1's) or absent (0's).

Thus, the answer to your question, "Should I also feed my model empty masks along with patches (non empty mask)?", is Yes. In fact, in TF2.0, you absolutely must. (A separate post can be started if you have questions about model performance.)

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .