How can I build a Neural Network model for pattern recognition using two (2) sensor datasets?
Afficher commentaires plus anciens
Hi all,
I have two (2) sensor datasets (FRF datasets from two (2) accelerometers positioned at different locations), each dataset is of 6540 observations and 4000 features. I want to use a Neural Network for pattern recognition to classify eleven (11) conditions (1 fault-free case + 10 faulty cases).
I managed to get excellent results using one (1) dataset from one (1) sensor using this code:
% Creating the target matrices
% ti refers to the target matrix for the ith case. bi refers to the number of observations for the ith case.
t1 = zeros(11,b1); t1(1,:) = ones(1,b1); t2 = zeros(11,b2); t2(2,:) = ones(1,b2); t3 = zeros(11,b3); t3(3,:) = ones(1,b3);
t4 = zeros(11,b4); t4(4,:) = ones(1,b4); t5 = zeros(11,b5); t5(5,:) = ones(1,b5); t6 = zeros(11,b6); t6(6,:) = ones(1,b6);
t7 = zeros(11,b7); t7(7,:) = ones(1,b7); t8 = zeros(11,b8); t8(8,:) = ones(1,b8); t9 = zeros(11,b9); t9(9,:) = ones(1,b9);
t10 = zeros(11,b10); t10(10,:) = ones(1,b10); t11 = zeros(11,b11); t11(11,:) = ones(1,b11);
TARGETS = [t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11]; % The overall target 11*6540 matrix
INPUTS = Dataset; % The overall 4000*6540 dataset matrix. 4000 features and 6540 observations.
net = patternnet(20); [net,tr] = train(net,INPUTS,TARGETS); plotperform(tr)
testX = INPUTS(:,tr.testInd); testT = TARGETS(:,tr.testInd); testY = net(testX); testIndices = vec2ind(testY);
plotconfusion(testT,testY)
[c,cm] = confusion(testT,testY)
fprintf('Percentage Correct Classification : %f%%\n', 100*(1-c)); fprintf('Percentage Incorrect Classification : %f%%\n', 100*c);
plotroc(testT,testY)
Now, to use both datasets (from 2 sensors), I'm considering following the same method mentioned above for both datasets and then concatenate the relavent matrices creating one (4000*13080) INPUTS matrix and one (11*13080) TARGET matrix before applying the NN model.
Is there a better way? Please help, and thanks in advance!
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Pattern Recognition dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!