How to determine input and target data for classification in neural network
3 次查看(过去 30 天)
显示 更早的评论
Hi,
I'm working on gait recognition problem, the aim of this study is to be used for user authentication (i.e. authenticate the authorised user of a mobile device and reject the imposters)
I have data of 36 users
I've successfully extracted features which are (36 rows and 143 columns) for each user and store it in a matrix called All_Feat.
(by the way, column represents the number of the extracted features and row represents the number of samples for each feature).
Then, for each user, I divided the matrix (All_Feat) into two matrixes ( Training matrix, and Test matrix ).
The training matrix contains ( 25 rows and 143 columns) while the testing matrix has (11 rows and 143 columns).
In order to differentiate between User1 and the remaining 35 users, User 2 and remaining 35 users, and so on ..... , I'd like to use Neural Network.
Based on what I have read, training Neural Network requires two classes, the first class contains all the training data of genuine user (e.g. User1) and labelled with 1 , while the second class has the training data of imposters labelled as 0 (which is binary classification, 1 for the authorised user and 0 for imposters).
now my question is:
1- i dont know how to create these classes!
2- For example, if I want to train Neural Network for User1, I have these variables, input and target. what should I assign to these variables? should input= Training matrix of User1? Target=Training matrix of all the remaining Users (35 Users)?
I really appreciate any help!
0 个评论
采纳的回答
Walter Roberson
2017-2-6
input should be the features for all of the samples.
target should be 0 for the samples with the genuine user, and 1 for the samples for imposters.
However, for some kinds of neural network, instead target should be [1 0] for the samples for the genuine user, and [0 1] for the samples for imposters.
13 个评论
Walter Roberson
2017-2-17
The resulting target matrix is not all 1. The resulting target matrix is sparse, so it only shows the non-zero entries. You can use
full(target)
to see the 0's and 1's in context.
"does that mean what I have done (in my code) to creat the Target Matrix is wrong"
Given that the first 14 entries belong to one class and the next 144 entries belong to another class, all you need for the target matrix is
target = ind2vec( [ones(1,14),2*ones(1,144)] );
No loops, no "if".
If this gives poor results then either you are not correct about which samples belong to which class, or else your classes are not well separated.
It might help to do feature selection such as pca.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!