Neuron Network Training - lstm network - record sounds by microphone

조회 수: 4(최근 30일)
Raz Elimelech
Raz Elimelech 2021년 3월 22일
답변: Shashank Gupta 2021년 3월 25일
Hi I'm new in training neural networks in matlab,
I have recorded recordings on my microphone, and I want to classify them by their features by useing lstm network.
I have 86 words for every word there is a recording i was record, that is 86 recordings i load to my program in matlab.
To check that the network of neurons I created works, I try to put the same word that was
in training for testing- word number one. to classify it after the network is trained,
when I expect to get overfitting because the same word was in the traing and in the test, but every word from the set of words I put I get the classification only to word 64.
and not overfitting as I expected to Get. why is it happening?
the code:
clear all;
currentFolder = pwd;
files_wav=dir([currentFolder '/*.wav']);
num_files=length(files_wav(not([files_wav.isdir])));
for i=1:num_files
[audio(i).audioIn,fs] = audioread(files_wav(i).name);
afe = audioFeatureExtractor("SampleRate",fs, ...
"SpectralDescriptorInput","melSpectrum", ...
"spectralCentroid",true, ...
"spectralSlope",true);
[audio(i).featuresTrain] = extract(afe,(audio(i).audioIn));
audio(i).featuresTrain=audio(i).featuresTrain';
end
featuresTraintoNet = {audio(:).featuresTrain}';
featuresTraintoNet=featuresTraintoNet;
labelsTrain = 1:num_files;
labelsTrain=categorical(labelsTrain');
net=makelayer(featuresTraintoNet,labelsTrain,num_files);
featuretest=audio(1).featuresTrain;
classify(net,featuretest); % why always back 64 label? (the same label for every word in the train that i put in the test)

채택된 답변

Shashank Gupta
Shashank Gupta 2021년 3월 25일
Hi Raz,
It looks like an underfitting problem. By the first look of your results, it seems the model is not able to train the data at all. It can happened because of several reason, either the data is repetitive, not balanced or the network you defined is not good enough for the data. I suggest you to first start with a pretrained model and fine tune with your data, then see how things are moving. If that doesn't work, then take a small sample of data may be like 10 recording of 2 classes and then try to overfit the situation, make sure you are able to overfit and then go other ways to optimise your networks. Since I don't have access to your recording or the network , these are the only things that comes in my mind right now. Although Check out this resource to get an idea how many different functions and networks are available and most of them you can try in your case.
I hope this helps.
Cheers.

추가 답변(0개)

Community Treasure Hunt

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

Start Hunting!

Translated by