semantic segmantation outputs only one class

3 views (last 30 days)
Using the algorithm from here I try to detect polyps from pictures. Every things goes well until I try to predict an image, it doesen't matter if it's from the training set or test set, it only outputs one class (there are 2 possible cases: tissue and polyp). Any ideas what I'm missing?
These are original and the ground truth combined with the original(left).
And here is what the algorithm is giving. Basically it labels all the pixels as tissue.

Accepted Answer

Ryan Comeau
Ryan Comeau on 10 May 2020
Hello,
Based on what I can see here, the semantic segmentation algorithm may not be your best choice. Maybe try using a computer vision technique which will place a bounding box around the object in your image. One of the following 2:
  1. https://www.mathworks.com/help/vision/ug/getting-started-with-yolo-v2.html
These will allow you to place bounding boxes around your regions of interest to identify what you're looking for. It will avoid having to class the various pixels in an image.
I have maybe a few ideas about how to improve your results:
  1. Lower your learning rate. The learning rate can cause your algorithm to converge too quickly on results that are not the best or in your case, since the regions of tissue are all very similar, it was unable to segment from the polyps and it determined it was getting perfect accuracy on the image from the tissue.
  2. Increase the mini batch size to 16-24 images if you have enough RAM to handle it. Coupled with the lower learning rate, this can help not falling into the trap of finding "blank" space and thinking it perfectly located what you're searching for. What i mean by this is, if your polyps look similar to tissue, the algo might class tissue as a polyp and tell you it's obtained a 100% accuracy.
  3. Augment your data to increase the data size
  4. go obtain a larger training set without augmentation.
Hope this helps,
RC
  2 Comments
Marius Bledea
Marius Bledea on 19 May 2020
Hi,
Thank you for all this explanations. I managed to make it work finnaly. My problem was labeling the classes and after that I had to deal with mini batch size as you were suggesting.

Sign in to comment.

More Answers (1)

Sai Bhargav Avula
Sai Bhargav Avula on 14 May 2020
Hi,
Adding to Ryan Comeau answers, I want to add the things like
By looking at the result I think the issue might be vanishing gradients. Check for that and the loss values.
To use segmentation the data needs a bit of preprocessing for better training.
Refer the following example which is closer to your case.
Hope this help!

Products


Release

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!