semantic segmantation outputs only one class

4 vues (au cours des 30 derniers jours)
Marius Bledea
Marius Bledea le 25 Avr 2020
Commenté : Ryan Comeau le 19 Mai 2020
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.

Réponse acceptée

Ryan Comeau
Ryan Comeau le 10 Mai 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 commentaires
Marius Bledea
Marius Bledea le 19 Mai 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.
Ryan Comeau
Ryan Comeau le 19 Mai 2020
Excellent, nice work.

Connectez-vous pour commenter.

Plus de réponses (1)

Sai Bhargav Avula
Sai Bhargav Avula le 14 Mai 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!

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by