1
$\begingroup$

My dataset is a simple table of 20 columns and 100,000 rows.It is not a image data as commonly used in CNN. What input shape should I provide in this case?

Right now I did-

input_shape = (21,109713,1)

model.add(Conv2D(32, kernel_size=(5, 5), strides=(1, 1),
                 activation='relu',
                 input_shape=input_shape))

which gives the error-

ValueError: Error when checking input: expected conv2d_1_input to have 4 dimensions, but got array with shape (109713, 19)
$\endgroup$

2 Answers 2

2
$\begingroup$

The question in the title is inconsistent with the question body. If you are intent on using a CNN albeit it not being the best idea for this type of data, then for the dataset you are describing a 1D CNN architecture would be most suitable.

To answer the question in the title, yes a 3D CNN is definitely possible and is actually commonly used on 3D data, for example: video (3rd dimension is time), 3D medical images, etc.

The instances in the dataset you described is a vector with 20 instances. This data is a single dimensional structure. You can thus use a 1D CNN as described here.

However, it would be best to use a DNN for such a data structure. As a CNN is essentially cross-correlation of neighboring features. In this case, your data cannot be assumed to have such similarities between adjacent features. A DNN will allow for cross-correlation between distant features to be captured more effectively.

$\endgroup$
1
$\begingroup$

Adding to JahKnows's answer, if your data represents progression in time, using a 1D-CNN might be a good idea (but perhaps you might also consider an RNN), otherwise you should probably stick with a DNN.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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