# Looking for suggestions on the model/algorithm for 2D row labeling

As an experiment, I'd like to train a model to label a few rows of data on a 2D tensor. F.e. on a black and white image, label the "darkest" and "lightest" row. Is this a task for CNN or some simpler methods would do?

Does this task fall into one of existing categories?

Is the number of rows fixed or variable? Can the row predictions be made independently or do they require information from other rows?

If predictions are independent, you could take your input image of size (rows, cols, channels), reshape it to (rows, cols*channels) and run it through a MLP that predicts a value for each row separately. This would work for fixed or variable number of rows

If number of rows is fixed and predictions are dependent, you could use a pretrained CNN to map the input image to a fixed length embedding vector. Then send the embedding vector to a MLP that outputs a fixed number of predictions (fixed at number of rows).

If rows are variable and predictions are dependent, you could do the same pretrained CNN -> embedding, but decode with an autoregressive model that can predict variable length outputs for each input.

• It is the latest - number of rows is variable, and rows are dependent, and the output is a multi class classification of each row. Thanks for the suggestion, this is along with what I had in mind but could not formulate due to the lack of experience... Oct 5 at 21:43

This sounds like a simple matrix operation:

1. Get the sum of each row (or mean, median)
2. Minimum is darkest row, Maximum is brightest row.
• I'm not trying to solve this in a simplest possible way ;) My interest is this type of problem - how to approach from the ML. Like, if instead of sum it was another criteria that is harder to formalize, but not random and also depending on the other rows in the tensor. Sep 28 at 16:57