4
$\begingroup$

Is there any difference between the convolution operation applied to images and applied to other numerical 2D data?

For example, we have a pretty good CNN model trained on a number of $64 \times 64$ images to detect two classes. On the other hand, we have a number of $64 \times 64$ numerical 2D matrices (which are not considered images), which also have two classes. Can we use the same CNN model to classify the numerical dataset?

$\endgroup$
3
  • $\begingroup$ Images and numerical 2D data are the same thing. Having that, a CNNs viability depends on if the input data has a reasonable number and density of 2D features. If row 1 of your input data has no relation to row 2, a CNN is not a good choice. $\endgroup$
    – Recessive
    Mar 5, 2020 at 2:41
  • $\begingroup$ Of course, you can do it, but here's a new problem - how to interpret the results of the predictions? $\endgroup$
    – Leox
    Mar 5, 2020 at 16:46
  • $\begingroup$ There should be spatial correlation between neighboring elements. If in your matrix neighboring elements are (almost) independent 2D convolution is useless. $\endgroup$ Mar 12, 2020 at 6:18

2 Answers 2

1
$\begingroup$

To offer a bit of theory, CNNs work well for many image tasks because they process spacially local information, without much care for absolute position. Essentially, every layer chops every image up into tiny crop images, and do an analysis step on the crops. The simple questions of "is this a line... corner... eye... face?" can be asked equally of every crop.

This means that the network only needs to learn once to detect a feature, rather than separately learn to detect that feature in each possible location it might appear. Therefore we can use smaller networks that train faster and need less data than if we had a fully connected architecture.

To return to the question, you could expect a CNN to work if your data is similarly spacially correlated. Put another way, if finding a pattern around cell x, y means the same sort of thing as the same pattern in cell a, b, then you are probably in luck. On the other hand if each column represents a meaningfully different concept, then a CNN will be a poor choice of architecture.

$\endgroup$
2
$\begingroup$

Short answer is no. You can't use a model trained for one task to predict on a totally different task. Even if the second task was another image classification task, the CNN would have to be fine tuned for the new data to work.

A couple of things to note...

1) CNNs are good for images due to their nature. It isn't necessary that they'd be good for any 2-dimensional input.

2) By 2D numerical data I'm assuming you don't mean tabular data.

$\endgroup$
1
  • $\begingroup$ Thanks for your answer. By 2D numerical data, I meant geospatial data in tabular form. I was wondering if can take advantage of CNN models for those geospatial data. but you are right, same model working good for images wont work on matrices because of the variation $\endgroup$ Mar 5, 2020 at 18:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .