How do I weight input data when training a neural network?

84 views (last 30 days)
Hi, I have trained an LSTM neural network to classify ECG signals using data from several patients. I would now like to use this to classify a new patient's ECG signal as being normal or abnormal on a cycle-by-cycle basis. I would then like to add this labelled data to the input data for training the network. I then want to use this retrained network to classify that same patient's future ECG signal traces. Is there any way of weighting the new input data from this patient specifically so the classification network is more tuned for that patient specifically? Thanks in advance
Cai Chin
Cai Chin on 22 Jan 2021
Hi, I would like to weight the patient's data to change the trained network itself. This altered network would then be used for all subsequent classifications of that patient's ECG signals.
I have trained the network on the instantaneous frequency and spectral entropy which have been extracted from different patients' ECG signals as shown in this example.
The data used for prediction is of the same type.

Sign in to comment.

Answers (1)

Athul Prakash
Athul Prakash on 27 Jan 2021
Hi Cai,
I can think of a few ideas, you may need to experiment with these to find what works..
Once the network is trained on general data, you may try fine-tuning the network using the specific patient's data alone. This involves retraining the existing network on the patient's data, but using options that minimize how much the weights change. You may try to reduce the number of training iterations or the gradient step-size used or both.
The aim is to produce a network whose weights derive mostly from non-specific data, but has been customized particularly to be good at the select patient's data.
Alternatively, you could try the sample weighting technique. This involves giving additional weightage to some examples over others for calculating the loss function during training. There are many things you could try for this, such as modifying the architecture or writing a custom training script. The easiest way I can think of is to duplicate the patient's example multiple times in the training data itself and then train the network as normal. I would be cautious though, to avoid overfitting in the network.
Hope it helps!

Community Treasure Hunt

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

Start Hunting!

Translated by