0
$\begingroup$

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?

$\endgroup$

2 Answers 2

1
$\begingroup$

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.

$\endgroup$
1
  • $\begingroup$ 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... $\endgroup$ Oct 5, 2023 at 21:43
0
$\begingroup$

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.
$\endgroup$
1
  • $\begingroup$ 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. $\endgroup$ Sep 28, 2023 at 16:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.