Not entirely sure what you’re trying to do, but if you’re trying to break the image up like this:

I would use a k-means clustering algorithm to segment the data by color. Then, inside of each color, you could break non-neighboring pixels into different groups. I don’t necessarily know if deep learning would be the best approach here.