Apply non-image data to CNN
Show older comments
I am trying to train a CNN with a numerical data set. Once the input data is not an image format. Assuming my data has a size of 1850*11 matrix. With a 1850*1 label (for output). In libsvm I can use it directly and in the Neural Network Toolbox (nnstart) as well.
However, in case I want to use a CNN network. The only training function is "trainNetwork" it could only support image as an input. So how could I train the CNN with my data on Matlab?
Any simple example will be appreciated.
Thanks to all of in advance.
Gad
Accepted Answer
More Answers (3)
Zia Uddin Ahmed Zihan
on 21 Jun 2019
0 votes
Hi Shivam,
I am also struggling with the same. My problem is I want to run the numerical data alongside each image to improve image classification accuracy. I ran my code according to your suggestion. However, how am I supposed to know if MATLAB is taking the image and numerical data correctly simultaneously?
Thanks,
Zia
Abdullah Bittar
on 25 May 2020
0 votes
Hi Guys,
I am also trying to train CNN using non image data. I followed the steps that were published by Shivam Gupta but was not seccussful. I am having the following problem.
Error using trainNetwork (line 150)
The training images are of size 1x1x1 but the input layer expects images of size 137x14x1.
Error in save_mat_try (line 22)
trainedNet = trainNetwork(imds,layers,options);
I sparated my input datafrom my output (target data) into two separate mat files. My input data has 14 colunms and 137 rows. Therefore it is the size of [137 14 1].
I have my imageInputLayer as imageInputLayer([137 14 1]
I tried searching for a solution for my probelm but i didnt find any solution. I would truley appreciate the help.
Thank you
Omar Almasarani
on 20 Apr 2021
0 votes
Hi,
I followed the answer of Shivam and it run but this in only input data without target. how do you define the target data?
1 Comment
HayderMU
on 2 Nov 2022
Exactly
I followed the code. The code NEVER LOADS THE CLASSES.
So it's training just on the fly. The last column which contains the target classes is comlpetely excluded. THe network is training on itself just to do nothing bcause no target classes are loaded.
Categories
Find more on Object Detection in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!