Expanding Deep Network Architecture for Signal Classification
조회 수: 4 (최근 30일)
이전 댓글 표시
I have implemented a code for classifying P, QRS, T, and NA segments from ECG signals. The current network architecture consists of a sequence input layer, an LSTM layer, and fully connected layers for classification. However, I would like to enhance the performance of the network by incorporating convolutional neural network (CNN) layers to capture more informative features from the ECG signals.
Here is the existing code that I have:
input_data = fsstTrainData(:, 1);
target_data = fsstTrainData(:, 2);
size_input = size(input_data); %cell 315*1
size_input_signals = size(input_data{1, 1}); %double 40*5000
size_target = size(target_data); %cell 315*1
size_target_signals = size(target_data{1, 1}); %categorical 1*5000
layers = [
sequenceInputLayer(size_input_signals(1))
lstmLayer(200, 'OutputMode', 'sequence')
fullyConnectedLayer(class_num)
softmaxLayer
classificationLayer];
trainNetwork(input_data, target_data, layers, options);
I would appreciate any assistance in modifying the network architecture to incorporate CNN layers that can extract more informative features from the signals. Your suggestions and guidance would be highly valuable in improving the classification accuracy.
Thank you for your help!
댓글 수: 0
답변 (2개)
Aniketh
2023년 7월 9일
편집: Aniketh
2023년 7월 9일
In order to answer your question how you can incorporate CNN layers to your architecture it is quite straight forward, here is one short example to give you an idea:
cnn_layers = [
imageInputLayer([size_input_signals(1), size_input_signals(2), 1])
convolution2dLayer([3, 3], 16, 'Padding', 'same')
reluLayer
maxPooling2dLayer(2, 'Stride', 2)
convolution2dLayer([3, 3], 32, 'Padding', 'same')
reluLayer
maxPooling2dLayer(2, 'Stride', 2)
];
lstm_layers = [
sequenceInputLayer(size_input_signals(1))
lstmLayer(200, 'OutputMode', 'sequence')
fullyConnectedLayer(class_num)
softmaxLayer
classificationLayer
];
layers = [
cnn_layers
sequenceFoldingLayer('Name', 'fold')
lstm_layers
];
As for increasing the accuracy/enhancing the performance, you should know these are really empirical methods, just adding more layers or introducing more complex architectures such as this would not necessarily produce better results and might even produce worse results.
Try and experiment on your own, changing the parameters and different architectural changes see what works best for your case, I would suggest reading up on how DL architectures are popularly used for processing ECG Signals, I believe MathWorks has a lot of resources on this as well.
Hope this helped!
댓글 수: 0
Abolfazl Nejatian
2023년 7월 10일
댓글 수: 2
Aniketh
2023년 7월 10일
Apologies for the confusion, as I mentioned it was just an example to get you started, the dimensions would not match in the template I gave, having a look at it, the dimensions should be 1/4th the original dimension passed to the CNN, but further in the code you would have to be mindful and check carefully for dimensions.
참고 항목
카테고리
Help Center 및 File Exchange에서 AI for Signals에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!