SlowGuess/NeurIPS_2023_OCR huggingface dataset:
The winning entry of the 2015 PhysioNet challenge using a Rule-based approach achieved a Challenge Score of 65.54 in the retrospective event. The CNN and FCN models and their contrastive learning variants remained consistently strong performers in the retrospective event. In comparing the performance of the real-time and retrospective events, FCN with contrastive learning had noticeable improvement in the challenge scores. Other models did not benefit significantly from the additional five seconds of post-alarm data as input to the model.
Appendix D Machine Learning Model Setting
D.1 Supervised Models
Table 9 displays the range of hyperparameter settings employed during the grid search as part of the hyperparameter tuning process. To overcome the problem of imbalanced classes, a positive class weight was added to the positive samples in the BCE loss function.
The Multilayer Perceptron (MLP) consists of three hidden layers with node sizes of 1024, 256, and 64, respectively. The Supervised Autoencoder (SAE) architecture utilizes an encoder and decoder, both composed of four convolutional layers. A four layer MLP operates on the  $32\mathrm{dim}$  vector to produce model predictions. Learning rate, dropout probability and positive class weight were chosen from hyperparam tuning via grid search based on best validation set performance.
The Convolutional Neural Network (CNN) architecture employed in this study consists of four 1-dimensional convolutional feature extractors. Each extractor is composed of two convolutional layers with window sizes of 50, 100, 200, and 400, respectively. Dropout regularization is applied to mitigate overfitting. The resulting feature maps are then flattened and passed through a hidden layer with 128 nodes before being used to make the model's final prediction. The FCN used 3 convolution layers followed by an adaptive pooling layer. Between each convolution, batch normalization was used. Lastly, we used adaptive max pooling followed by a dense layer which is used to make the model's final prediction.
The Transformer model consists of 1 single-layer Transformer encoders. The dimensionality of the representations is set to 128, and number of attention head is set to 8. The input time steps are first mapped to a 128-dimensional feature space using a linear layer. The processed features are then passed through the Transformer layers and activated using the GELU activation function. The Transformer model use dropout with 0.1. The models are trained using BCE loss as the loss function and please refer to Table.9 for specific hyperparameter settings.
Code is available at https://github.com/ML-Health/VTaC/. Code for the rule-based approach [Plesinger et al., 2015] is from the Challenge 2015 PhysioNet website<sup>2</sup>.
D.2 Conditional Generative Models
In addition to conventional classification models, we also employed conditional generative models [Wu et al., 2023, Zhou et al., 2019, Bashar and Nayak, 2020] to classify the VT alarms as true or false. The generative models generate waveform trajectories conditioned on a patient's observed waveform data. Specifically, conditioned on an observed waveform segment from a patient, our generative approach predicts what the subsequent trajectory of the patient's waveform would look like if it were a true alarm. Thus, in the case of a false alarm, the predicted waveform (simulating a true alarm) will differ significantly from the observed ground truth. The distance between the generated trajectory and the original waveform is thus calculated to determine the type of alarm. Since false alarms can be caused by various factors, while true alarms have specific pathological features, we choose to generate trajectories for true alarms to calculate the anomaly scores. If the candidate observed sample is from a genuine arrhythmia alarm, the distance between the generated waveforms and the observed samples will be small; on the other hand, if the alarm is false, the discrepancy between the two will be large. Unlike the classification models, we need to generate physiological waveforms using time intervals that correspond to the true event as much as possible. For BeatGAN [Zhou et al., 2019] and TanoGAN [Bashar and Nayak, 2020], We used their Github repository's settings<sup>3</sup> and modified the input channels to fit the number of channels in our dataset, and we changed the threshold setting from a fixed threshold to a threshold search approach using validation data. In the BeatGAN and TanoGAN models, the learning rate is set to 0.0001, the weight decay is set to 0.0005, and the batch size is 128.
The diffusion-based generative model consists of a network of 36 residual layers with 256 residual and skip channels. The diffusion embedding layer have three levels of diffusion embedding of 128, 256, and 256 dimensions. Each layer are connected by a swish activation function. Then, we leverage
$^{2}$ https://www.physionet.org/static/published-projects/challenge-2015/1.0.0/sources/
<sup>3</sup>https://github.com/hi-bingo/BeatGAN
$^{4}$ https://github.com/mdabashar/TAnoGAN
two Transformer encoders for extracting the noise input and conditional input. Each encoder contains one encoder layer and the "dmodel" of each encoder layer is 512 and "nhead" is 4, and feed forward layer between each encoder layer have 512 dimensions. The number of negative samples is 32 and the temperature parameter of total loss  $\text{lamda}$  is 0.5. In the inference stage, we used 200-time steps on a linear schedule for diffusion configuration from a beta of 0.0001 to 0.02. We utilize an Adam as the optimizer with the learning rate of 1e-4. We randomly mask the half part of data for train and mask the first half of data for test. Because of the  $x_{noise} \sim \mathcal{N}(0, I)$  where  $I = 1$ , we scaled down the ABP channel by a factor of 10 to solve the problem of sample value out of range. We use the MSE Loss to calculate the distance between the generated results and the original waveforms. The threshold used for the test set is the one corresponding to the optimal score obtained on the validation.
Table 9: Model Hyperparameters and their Search Range. Parameter settings with the best validation Score underlined.
Hyperparameters	Search Range
MLP
Batch Size	32, 64, 128
Learning Rate	0.0001, 0.001
Dropout Probability	0.0, 0.1, 0.3
Positive Class Weight	3.54, 4
SAE
Batch Size	32, 64, 128
Learning Rate	0.0001, 0.001
Reconstruction Loss Weight	0.5, 1.0, 1.5
Dropout Probability	0.0, 0.1, 0.3
Positive Class Weight	3.54, 4
CNN
Batch Size	32, 64, 128
Learning Rate	0.0001, 0.001
Dropout Probability	0.0, 0.1, 0.3
Positive Class Weight	3.54, 4
CNN + CL
Batch Size	32, 64, 128
Learning Rate	0.0001, 0.001
Dropout Probability	0.1, 0.3, 0.5
Contrastive Loss Weight	0.5, 1.0, 1.5
Positive Class Weight	3.54, 4
FCN
Batch Size	32, 64, 128
Learning Rate	0.0001, 0.001
Dropout Probability	0.0, 0.1, 0.3
Positive Class Weight	3.54, 4
FCN + CL
Batch Size	32, 64, 128
Learning Rate	0.0001, 0.001
Dropout Probability	0.1, 0.3, 0.5
Contrastive Loss Weight	0.5, 1.0, 1.5
Positive Class Weight	3.54, 4
Transformer
Batch Size	32, 64, 128
Learning Rate	0.0001, 0.001
Dropout Probability	0.0, 0.1, 0.3
Positive Class Weight	3.54, 4
D.3 Hardware and Software
In our experiments, we used NVIDIA Tesla V100 GPUs with 32 GB of VRAM and IBM Power9 CPUs, running on Red Hat Enterprise Linux 8.3.1. We used Python version 3.8.18, Pytorch version 1.9.0 using a CUDA version 12.2 backend and WFDB version 4.1.1.