Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TensorFlow: Convolution Neural Network with non-image input

I am interested in using Tensorflow for training my data for binary classification based on CNN.

Now I wonder about how to set the filter value, number of output nodes in the convolution process.

I have read many tutorials and example. However, most of them use image data and I cannot compare it with my data that is customer data, not pixel.

So could you suggest me about this issue?

like image 903
Yaoi Dirty Avatar asked Nov 07 '16 11:11

Yaoi Dirty


People also ask

Can CNN be used for non-image data?

Moreover, CNN can't be used because it requires an image as an input. However, if we can transform non-image data to a well-organized image form, then CNN can be used for higher classification performance.

Is CNN only for images?

The Convolutional Neural Network (CNN or ConvNet) is a subtype of the Neural Networks that is mainly used for applications in image and speech recognition.

Can deep learning be used for non-image data?

Yes you can use deep learning techniques to process non-image data. However, other model classes are still very competitive with neural networks outside of signal-processing and related tasks.

Why do we use convolutions for images rather than just fully connected layers?

Convolutional Layers (Conv Layers) Convolutions are not densely connected, not all input nodes affect all output nodes. This gives convolutional layers more flexibility in learning. Moreover, the number of weights per layer is a lot smaller, which helps a lot with high-dimensional inputs such as image data.


2 Answers

If you data varies in time or space then you can use CNN,I am currently working with EEG data set which varies in time.Also you can refer to this paper http://www.nlpr.ia.ac.cn/english/irds/People/lwang/M-MCG_EN/Publications/2015/YD2015ACPR.pdf were the input data(Which is not an image) is presented as an image to the CNN.

like image 96
dm5 Avatar answered Oct 07 '22 01:10

dm5


You have to reshape the data to be 4d. In this example, I have only 4 column.

x_train = np.reshape(x_train, (x_train.shape[0],2, 2,1))
x_test = np.reshape(x_test, (x_test.shape[0],2,2, 1))

This is a good example to use none image data https://github.com/fengjiqiang/LSTM-Wind-Speed-Forecasting You just need to change the following :

prediction_cols

feature_cols

features

and dataload

like image 28
I_Al-thamary Avatar answered Oct 07 '22 00:10

I_Al-thamary