Is it possible to do speech emotion recognition using neural network backpropagation?

Hello everyone, I'm doing emotion speech recognition from human voices. The problem is, there seems some kind of trouble when I try to train them. What I have done so far:
  • Importing the sounds used to MATLAB workspace.
  • Extracting the MFCCs from those sounds.
  • Combining those MFCCs to one matrix and creating trainMatrix.
  • Creating targetMatrix.
targetMatrix = [1 1 1 1 1 0 0 0 0 0; 0 0 0 0 0 1 1 1 1 1]; %Say there is two emotion that I want to train with five samples each.
  • Importing trainMatrix and targetMatrix to neural network toolbox.
inputs = trainMatrix;
targets = targetMatrix;
hiddenLayerSize = [90];
myNetwork = patternnet(hiddenLayerSize);
myNetwork.inputs{1}.processFcns = {'removeconstantrows','mapminmax'};
myNetwork.outputs{2}.processFcns = {'removeconstantrows','mapminmax'};
myNetwork.divideFcn = 'dividerand';
myNetwork.divideMode = 'sample';
myNetwork.divideParam.trainRatio = 70/100;
myNetwork.divideParam.valRatio = 15/100;
myNetwork.divideParam.testRatio = 15/100;
myNetwork.trainFcn = 'trainlm';
myNetwork.performFcn = 'mse';
myNetwork.plotFcns = {'plotperform','plottrainstate','ploterrhist',...
'plotregression','plotfit'};
[myNetwork,tr] = train(myNetwork,inputs,targets);
outputs = myNetwork(inputs);
errors = gsubtract(targets,outputs);
performance = perform(myNetwork,targets,outputs);
trainTargets = targets .* tr.trainMask{1};
valTargets = targets .* tr.valMask{1};
testTargets = targets .* tr.testMask{1};
trainPerformance = perform(myNetwork,trainTargets,outputs);
valPerformance = perform(myNetwork,valTargets,outputs);
testPerformance = perform(myNetwork,testTargets,outputs);
After doing these steps and trying to run the code, the toolbox keep running till finally my MATLAB goes blank screen. Does my computer are not strong enough to run these? Please kindly answer my question. And maybe you can teach me how to classify them. Currently I'm using class for each result matrix and comparing their value.
Thank you,
Randi

2 Comments

Run your code on a MATLAB sample dataset
help nndatasets
doc nndatasets
so that we can compare our codes on data with which we are familiar.
Greg
Hello Greg,
I've tried creating my own datasets since MATLAB r2013a doesn't support nndatasets yet (cmiiw). And the results are in this following excel file.
As you can see there is a lot 0 since I replace them from NaN. Is this the correct treatment? If not what is the correct treatment then?
And here is the code I use to create my datasets in MATLAB.
konfirmasi2=input('Jumlah parameter? (>1) '); %asking input from user for how much emotion used
konfirmasi=cell(size(konfirmasi2)); %reserving data for later use
ukuran=cell(1,konfirmasi2);
for ulang=1:konfirmasi2 %Inputing the voices per emotion
fprintf('Silahkan masukkan parameter ke-%d\n',ulang)
file = uigetfile('*.m4a','MultiSelect','on');
char = ischar(file); %detecting wether the file are char or cell type since single file imported as char file
z=cell(size(file));
if isequal(file,0);
clear file;
return;
end
if char==1; %transforming char data to cell type
file={file};
z=cell(1,1);
end
for k=1:length(file)
y=audioread(file{1,k},[1 2000]); %importing voice file to matrix
hasil=mfcc1(y); %counting the MFCC of imported voice
hasil=hasil'; %transforming to one column
hasil=hasil(:)';
hasil=hasil';
hasil(isnan(hasil))=0;
z{k}=hasil;
ukuran{ulang}=z; %will be used to create trainMatrix
end
konfirmasi{ulang}=input('Simpan sebagai? ','s'); %Labeling the emotion per user input
Data.(konfirmasi{ulang})=z;
fprintf('\n')
end
trainMatrix=cell2mat(cellfun(@(x) cell2mat(x),ukuran,'un',0));
clc

Sign in to comment.

Answers (0)

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Products

Release

R2013a

Asked:

on 10 Aug 2018

Edited:

on 11 Aug 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!