I developed a CNN for ECG arrhythmia classification and when I train the model I obtain the same validation accuracy for all of the 50 epoch. Can you please tell me what is wrong? I tried to modify the parameters, also the structure, but the validation accuracy is unchanged (80.1%).
The ECG signals fed into the network are ECG heartbeats composed of 1x300 vectors (300 sample points signals).
height = 1;
width = 300;
channels = 1;
Xtrain = reshape(Xtrain,[height, width, channels, length(Xtrain)]);
Xvalidation=reshape(Xvalidation,[height, width, channels, length(Xvalidation)]);
Xtest = reshape(Xtest,[height, width, channels, length(Xtest)]);
Ytrain=categorical(Ytrain);
Yvalidation=categorical(Yvalidation);
Ytest=categorical(Ytest);
Layers=[
imageInputLayer([height,width,channels]); %'DataAugmentation', 'none'); %'Normalization', 'none');
convolution2dLayer([1 3], 256,'stride',[1 1], 'padding','same'); %Filter window size = [1 5], No of filters = 64, stride = [1 1];
convolution2dLayer([1 3], 256,'stride',[1 1], 'padding','same');
reluLayer();
dropoutLayer();
maxPooling2dLayer([1 2],'stride',[1 2]); %PoolSize = [1 2], Stride = [1 1]
convolution2dLayer([1 3], 128,'stride',[1 1], 'padding','same');
reluLayer();
convolution2dLayer([1 3], 128,'stride',[1 1], 'padding','same');
reluLayer();
convolution2dLayer([1 3], 64,'stride',[1 1], 'padding','same');
reluLayer();
dropoutLayer();
maxPooling2dLayer([1 2],'stride',[1 2]);
fullyConnectedLayer(256);
dropoutLayer();
fullyConnectedLayer(128);
fullyConnectedLayer(5); %Reduce to five output classes
softmaxLayer();
classificationLayer();
];
options = trainingOptions('sgdm','InitialLearnRate',0.001,'MaxEpochs',50, ...
'LearnRateSchedule','piecewise', ...
'LearnRateDropFactor',0.1, ...
'LearnRateDropPeriod', 3,...
'L2Regularizatio',1.0000e-04, ...
'MiniBatchSize', 60,...
'ValidationData',{Xvalidation, Yvalidation},...
'Plots','training-progress');
convnet = trainNetwork(Xtrain,Ytrain,Layers,options);