My thesis advisor suggested me to open these images on any image editor and zoom in to see if there was something strange on them, and nailed it. Apparently the dataset has some images that went through some kind of image processing/resize and did distort some of the pixels, as shown on images below (these images were extracted from raw dataset, before any image processing done by me).
Sharp edges:
image1420×808 840 Bytes
Smoothened edges:
image1151×789 15.4 KB
So I guess I’ll have to modify the code snippet applying some kind of threshold when designating class indices to pixels.
Thanks for the support, the last reply shed some light on were to investigate the problem and finally guide to the necessary adjustments.