- 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.
- 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.
- Augment your data to increase the data size
- go obtain a larger training set without augmentation.
semantic segmantation outputs only one class
3 views (last 30 days)
Show older comments
Marius Bledea
on 25 Apr 2020
Commented: Ryan Comeau
on 19 May 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?![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/287531/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/287531/image.jpeg)
These are original and the ground truth combined with the original(left).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/287532/image.jpeg)
And here is what the algorithm is giving. Basically it labels all the pixels as tissue.
0 Comments
Accepted Answer
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:
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:
Hope this helps,
RC
2 Comments
More Answers (1)
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!
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!