# A Complete Pipeline for Heart Rate Extraction from Infant ECGs
## 2 Materials and Results
### The ECG Pipeline
#### 2.2.1 Existing ECG Approaches
The datasets used were Datasets A and B, which were both clean enough to have a reliable ground truth. A visualisation of the algorithmically labelled peaks by different methods in a sample infant ECG without local peak correction is shown in Figure 6, with the labels shown on both the preprocessed ECGs. Figure 4: Violin plots showing the specificity, sensitivity, and positive predictive values for the pre-existing ECG approaches applied to Dataset A, with a local peak correction applied to allow for cross-method comparison. The thin dark-grey lines represent interquartile values; the thick light-grey line represents the median. Each dot represents a single result in the dataset, with the “violin” helping visualise the distribution. The range of successes that different current methods have for dealing with infant ECGs are shown for Dataset A (Figure 4) and Dataset B (Figure 5). Figure 6's visualisation shows the effect of different preprocessing methods on the raw heart rate, and that some approaches label other complexes in the ECG instead of the QRS. The inbuilt methods for both the Neurokit2 package [44] and HeartPy package [36] outperformed the implementation of all other pre-existing methods, with the Neurokit2 method performing best between the two. This was true when considering their respective full distribution, median, or interquartile ranges (IQRs). Out of the remaining methods, [PERSON] et al. 's wavelet-based method [48] and [PERSON] et al. 's approach [30] were 3 rd  
Figure 5: Violin plots showing the specificity, sensitivity, and positive predictive values for the pre-existing ECG approaches applied to Dataset B, with local peak correction applied to allow for the cross-method comparison. Figure 6: A visualisation of the peak detection for the pre-existing methods on a 12-month-old subject from Dataset A. Detected peaks are shown as black dots. The raw ECG and ground truth are shown on the left. All other approaches show the preprocessed ECG and original detected R-peak locations for that method. and 4 th best respectively. [PERSON]'s method had good specificity and fairly good PPVs but worse sensitivity, indicating the peaks that were detected were accurate, but many peaks were missing. [PERSON]'s method was able to adapt better than most methods to the fast heart rate and noisy signals, but still had some worst-case subjects that it was unable to adapt to, especially in Dataset B. [PERSON] et al. 's method [32] performed 5 th-best overall, narrowly outperforming the sensitivity of [PERSON]'s method for Dataset A, but had more results with poorer for specificity and PPV. [PERSON]'s approach [31] did next best for Dataset A, but fell apart completely for Dataset B. [PERSON] and [PERSON]'s method [46, 47] had a low false-peaks-detection rate, but also did not detect enough of the true peaks for an accurate HR calculation. [PERSON]'s method [29] seemed to work well with some of the signals but needed the altering of its internal threshold factors to properly adapt to the children's ECGs. All other approaches tested [28, 33, 34, 35] did not perform well with the datasets and had lower median specificity/sensitivity/PPV values than the other methods. They likely need some fundamental changes to be suited to the ECG of a young child, as many of these methods have time constraints that work very well for adults but are too rigid for the faster heart rate of a child, falsely rejecting too many R-peaks or identifying other complexes in the ECG over the QRS complex.