Let's assume I have dataset of image-like 2D samples where values can be divided into few discrete levels (for example 1, 2, 3 and 4) like in the image below, where each color maps different value, from 1 to 4. Number of how many times given color occurs on the picture varies from sample to sample though.
I would like to classify these images into different classes but based on the spatial relations of these values between each other (not the values themselves). By spatial relations I mean basically (left, right, up, down), for example:
- If blue is above and to the right of the red
- Another blue is above and to the left of the same red
- Yellow is to the right of one blue (same height)
- One green is below red
My question is, what machine learning or deep learning algorithm I should use for that task? I would appreciate even just some keywords or clues of what might help here.
[EDIT] These data are not proper real images. Just more-less 50x50 arrays with one integer value per cell (range of these values is limited to just few, like 1, 2, 3, 4).