lstm network not giving accurate results
1 view (last 30 days)
Show older comments
I have trained an LSTM network for fault classification of transmission lines. I have collected the current samples of three phases using Simulink and processed using wavelet transform. The total number of fault cases are 161 for each fault and number of features in each simulation are 104. After training the LSTM network I have plotted the confusion matrix with the data I trained the network and the data is not classified exactly.I have converted the data into cell format. I used the following code to implement LSTM.
inputSize = 104;
numHiddenUnits1 = 100;
numHiddenUnits2 = 100;
numClasses = 10;
% layers = [ ...
% sequenceInputLayer(inputSize)
% lstmLayer(numHiddenUnits1,'OutputMode','sequence')
% dropoutLayer(0.2)
% lstmLayer(numHiddenUnits2,'OutputMode','last')
% dropoutLayer(0.2)
% fullyConnectedLayer(numClasses)
% softmaxLayer
% classificationLayer];
% options = trainingOptions('sgdm', ...
% 'MaxEpochs',100, ...
% 'Verbose',false, ...
% 'Plots','training-progress');
net = trainNetwork(XTrain1,YTrain1,layers,options);`
0 Comments
Answers (1)
Krishna
on 7 Feb 2024
Hello Suresh,
Upon reviewing the confusion matrix, it appears that your network may be overfitting, particularly with respect to class 1. I recommend verifying that the data you have compiled is mostly evenly distributed among all classes. To mitigate overfitting in neural networks, you might find the following article useful:
Another potential issue could be an insufficient quantity of data. Recurrent networks typically require a substantial amount of data for effective learning. I also noticed that you are employing a dropout layer. Consider increasing the dropout rate to see if it enhances the performance metrics for your test dataset. Furthermore, I notice you are not using validaion dataset. Make sure to utilize both a validation dataset and a test dataset to accurately assess the efficacy of your training. Apart from that try hyperparameter tuning of variables to check if that could help your problem. Please go through this documentation to learn more,
https://towardsdatascience.com/simple-guide-to-hyperparameter-tuning-in-neural-networks-3fe03dad8594
Hope this helps.
0 Comments
See Also
Categories
Find more on AI for Signals and Images in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!