3.3 Heartbeat Synthesis using Generative Models
3.3.5 Results and Discussion
DCCGAN performance is evaluated both quantitatively and qualitatively. The real beats of N, SVEB, and VEB classes are randomly sampled from the training data, where equal beats of each class are extracted so that model has enough information about each class of beats. The fake beats are generated from the generator using the Gaussian noise as latent input and class labels. An equal number of fake beats of each class are generated so that discriminator does not get biased during the training. The DCCGAN is trained for 800 batches, and the generator loss, discriminator loss, and evaluation metrics for all classes are recorded. The models are saved after every second epoch during training as the training is unstable, and any intermediate model could generate the best quality of beats. Figure 3.20 depicts the generator and discriminator loss during DCCGAN training. It can be observed that multiple local minima are obtained by generator loss at batches 255, 525, 649, 663, and 757. The beats generated by the generator model at these batches depict a perfect resemblance with the real beats present in the training dataset. So, a detailed analysis of the generator models saved at these particular batches is performed.
Quantitative Evaluation: Five evaluation metrics are monitored during the training of the DCCGAN model, as mentioned above. The TWED metric is com- putationally expensive, and therefore, only 200 real and generated samples of each class are compared against each other after every two batches. The average of each evaluation metric is provided in Figure 3.21. The individual evaluation metric for Normal, SVEB, and VEB class is provided in Figure 3.22, 3.23, and 3.24. Overall and class respective metrics display similar pattern to training loss curves.
74 TH-2764_156201001
3. PREPROCESSING ELECTROCARDIOGRAM SIGNAL
Batch 0.0
0.5 1.0 1.5 2.0 2.5
200 400 600 800
Generator Loss Discriminator Loss
Figure 3.20: Generator and Discriminator Loss during training.
Batch
DTW, FD, TWED
0 25 50 75 100
200 400 600 800
DTW FD TWED
Batch
RMSE, MMD
0.0 0.2 0.4 0.6
200 400 600 800
RMSE MMD
Figure 3.21: Overall Evaluation Metrics during DCCGAN training.
The normal class evaluation metrics in Figure 3.22 depicted a larger variation than the irregular beat evaluation metrics. The reason behind this might be the random undersampling performed for the normal class during data preparation. The Normal class beats were reduced as they were around 80% of the total beats, whereas SVEB and VEB contributed nearly 20% of total beats. The reduction in Normal beats might have reduced the variation present in the patient beats, thereby increasing the error in evaluation metrics.
SVEB and VEB class evaluation metrics in Figure 3.23 and Figure 3.24 depicted comparatively less error than Normal beats. The reason might not be because the model produced a good variation in irregular beats but because SVEB and VEB might have less variation in irregularities in the actual training dataset. Therefore, the generated beats could easily adapt to the variation present in SVEB and VEB class beats.
TH-2764_156201001
3.3. HEARTBEAT SYNTHESIS USING GENERATIVE MODELS
Batch
DTW, FD, TWED
0 25 50 75 100 125
200 400 600 800
DTW FD TWED
Batch
RMSE, MMD
0.0 0.2 0.4 0.6
200 400 600 800
RMSE MMD
Figure 3.22: Evaluation Metrics for Normal Class during DCCGAN training.
Batch
DTW, FD, TWED
0 20 40 60 80
200 400 600 800
DTW FD TWED
Batch
RMSE, MMD
0.0 0.1 0.2 0.3 0.4 0.5
200 400 600 800
RMSE MMD
Figure 3.23: Evaluation Metrics for SVEB class during DCCGAN training.
Batch
DTW, FD, TWED
0 20 40 60 80
200 400 600 800
DTW FD TWED
Batch
RMSE, MMD
0.0 0.1 0.2 0.3 0.4 0.5
200 400 600 800
RMSE MMD
Figure 3.24: Evaluation Metrics for VEB class during DCCGAN training.
Similarly, less error in evaluation metric and less generator loss are observed in Figure 3.20, 3.21, 3.22, 3.23, and 3.24 for batches 255, 525, 649, 663, and 757, respectively. Therefore, the models saved at these batches are used to generate data for heartbeat classification. The model with lowest error in evaluation metrics is used to depict the generated beat quality.
Qualitative Evaluation: Out of the selected batches, the least error in eval- uation metrics is obtained for batch 649. The model saved at batch 649 is used to generate beats of Normal, SVEB, and VEB class. Figure 3.25 illustrates original beats from DS1 and GAN Augmented beats from generator model saved at batch 649. Figure 3.25 (a), (b), (c) describe normal, SVEB, and VEB class beats from
76 TH-2764_156201001
3. PREPROCESSING ELECTROCARDIOGRAM SIGNAL
training set of DS1. Figure 3.25 (d)-(f) describe the generated Normal Beat, Figure 3.25 (g)-(i) describe the generated SVEB, and Figure 3.25 (j)-(l) describe the gen- erated VEB. The high error in evaluation metrics of normal beats might be due to irregularity or slight problem in generation of R-wave of QRS complex, i.e., the ven- tricular depolarisation of the heart. The other characteristic waves, such as P-wave and T-wave, resemble the real normal beats. The generated SVEB depicts a clear absence of P-wave and narrow QRS complex resembling real SVEB. This might be the reason for less error in evaluation metrics of SVEB. The generated VEB depicts an abnormal QRS complex with prolonged duration and elevated ST segment with a dominant S wave. It also shows an inverted or retrograde P-wave. This might be the reason for less error in the evaluation metrics of VEB.
(a)
(e) (d)
(f)
(b)
(h) (g)
(i)
(c)
(k) (j)
(l)
Normalised Amplitude
Signal Timestamps
Figure 3.25: Illustration of Original beats from DS1 and GAN Augmented beats from generator model saved at batch 649. (a) Normal Beat, (b)SVEB, (c) VEB;
(d)-(f ) Generated Normal Beat, (g)-(i)Generated SVEB, (j)-(l) Generated VEB.
Figure 3.26 illustrates the incorrect beat generation by the generator model from TH-2764_156201001
3.3. HEARTBEAT SYNTHESIS USING GENERATIVE MODELS
the models saved at different batches. Figure 3.26 (a-b) describe incorrectly generated normal beat , Figure 3.26 (c-d) describe incorrectly generated SVEB , Figure 3.26 (e-f) describe incorrectly generated VEB. The beats of all three classes do not resemble the actual beats of the respective class. Moreover, the generated beats are contaminated with high frequency noises.
(a)
(b)
(c)
(d)
(e)
(f)
Signal Timestamps
Normalised Amplitude
Figure 3.26: Illustration of Incorrect Beat Generation by the Generator Model.
(a-b) Normal Beat, (c-d)SVEB, and (e-f ) VEB.
The DCCGAN model generated different classes of ECG beats, including N, SVEB, and VEB recommended by AAMI. In DCCGAN, binary cross-entropy loss is preferred for discriminator and Gaussian noise as input for generator. Soft labels are preferred for faster convergence of the discriminator model. The results are pre- sented both quantitatively and qualitatively. Quantitatively, the generated beats are evaluated using five quantitative metrics, and qualitatively, the beats generated by the generator model are plotted against the real/original beats to illustrate the sim-
78 TH-2764_156201001
3. PREPROCESSING ELECTROCARDIOGRAM SIGNAL
ilarity in real and synthetically generated beats. The training curves of DCCGAN depicted stable training, and the change in evaluation metrics followed a similar pat- tern. Generated synthetic heartbeats resemble real beats as they encompass essential characteristics present in beats and follow the intricate structure present in the dif- ferent classes of beats.