An evolutionary approach to continuously estimate CPR quality parameters from a wrist-worn inertial sensor

Cardiopulmonary resuscitation (CPR) is one of the most critical emergency interventions for sudden cardiac arrest. In this paper, a robust sinusoidal model-fitting method based on a Evolution Strategy inspired algorithm for CPR quality parameters – naming chest compression frequency and depth – as measured by an inertial measurement unit (IMU) attached to the wrist is presented. The proposed approach will allow bystanders to improve CPR as part of a continuous closed-loop support system once integrated into a smartphone or smartwatch application. By evaluating the model’s precision with data recorded by a training mannequin as reference standard, a variance for the compression frequency of ±2.22\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\pm 2.22$$\end{document} compressions per minute (cpm) has been found for the IMU attached to the wrist. It was found that this previously unconsidered position and thus, the use of smartwatches is a suitable alternative to the typical placement of phones in hand for CPR training.


Introduction
Sudden cardiac arrest (SCA) is one of the most prominent diseases (350,000-700,000 individuals a year in Europe are affected [1][2][3]). SCA can significantly affect the independent living of the victims if medical treatment is not available within a few minutes [4,5]. In the case of cardiac arrest, the transport of oxygen and glucose to the human body's cells stops immediately due to the disrupted heart function. This leads to irreparable cell damage if blood circulation is not quickly reestablished, e.g. supported by cardiopulmonary resuscitation (CPR). If the blood circulation is interrupted, the cells of the nervous system, including the brain, reduce their functionality after 10 seconds, which leads, for example, to unconsciousness [6]. The death of the cells begins after about 3 minutes without blood circulation [6].
Medical personnel such as paramedics are trained in Advanced Life Support (ALS) [7] methodology that includes CPR. Unfortunately, paramedics are usually not immediately available if a cardiac arrest occurs in the field. The typical median reaction time of paramedics is about 5-8 minutes [5] and with every minute the chances of survival of the victims without CPR decrease. Thus, victims rely on the initial CPR support of bystanders within the first so-called golden minutes after cardiac arrest to prevent long-term adverse effects or death. Since these bystanders can offer essential initial resuscitation support, corresponding technical solutions to support them with online feedback regarding the quality of CPR are beneficial.
For the following discussion, the optimal Basic Life Support (BLS) [5] procedure (the methodology aiming for nonspecialists) is worthwhile to be briefly recapitulated (see Fig. 1): In case of a cardiac arrest, it is essential to ensure sufficient oxygenation of the nerve cells via correctly conducted cardiac massages (chest compressions) as the most critical countermeasure. During this cardiac massage, the heart is compressed by orthogonal pressure onto the breastbone. In order to sustain a minimal blood circulation, a chest compression frequency (CCF) of the cardiac massage should range within 100-120 compressions per minute (cpm), and a chest compression depth (CCD) of 5-6 cm is required. With a CCF below 100 cpm, blood circulation is insufficient to fullfill the essential tissue oxigenation, while with a CCF over 120 cpm the heart complete refillment with blood is not assured, thus resulting in to little amount of blood being circulated in the next compression. Ideally, but not necessarily, the procedure is combined with rescue breathing, to improve the chance of survival and reduce neurological deficits [5].
While typical bystanders can develop a sufficient feeling of semi-ideal compression depth, the consistent application of the correct compression frequency and depth is challenging, especially for extended periods of cardiac massage with the associated muscle-fatigue and mental pressure. Thus, instant feedback regarding the correct execution (regarding CCD and CCF) during a cardiac arrest will be beneficial for untrained bystanders. Such feedback could be derived from online monitoring of the quality of the cardiac massage from the vertical acceleration measured by inertial measurement units (IMUs) and giving continuous feedback and adjustment hints. Corresponding smartphone applications are well suited for this purpose due to their high availability [8,9]. Renshaw et al. have confirmed the general benefit regarding CCF/CCD for the BHF PocketCPR application and recognized an improved performance (from 66 to 91 cpm) and increased confidence of bystanders [10]. However, for such CPR training apps, accurate CPR information (regarding CCF and CCD) is an essential requirement [8], which is achieved partially by the existing implementations (as summarized in Table 1).
Most of these approaches use Fast Fourier Transformation (FFT) to determine the regular frequencies from the inertial data and identify the frequency spectrum's central frequencies via peak detection. While being straightforward, this approach is susceptible to erroneous peak selection and a resulting frequency shift of the CCFs by orders of magnitudes. Also, the double-integration of the acceleration signal -a standard processing step to determine the displacementvector as a preprocessing step for the CCD -is challenging due to the signal drift if the accelerometer is not perfectly aligned with the gravity axis [17]. Consequently, the typical integration process is inherently unstable and leads to relevant errors unless boundary conditions are applied for each compression cycle (e.g. in very short windows) [14].
The motion in cardiopulmonary resuscitation is primarily a rhythmic movement that approximates the natural rhythm of the human heartbeat. Thus, the use of a robust sinusoidal model, i.e., sine curve, might not suffer from disadvantages of the FFT and its subsequent effects on the derived CPR parameters (see Fig. 2), due to its implicit periodic accordance with the CPR. A concept that was shown for depthimage based motion capture of CPR movements [21] but still needs to be confirmed for use with acceleration data recorded directly via IMUs at rescuers. Furthermore, the discussed algorithms have been mainly evaluated for the use of IMUs in a grasp-in-hand use (i.e., the sensor or smartphone is held between the back of the lower hand and the palm of the upper hand during the procedure). A position that has been reported to be a slightly uncomfortable and disturbing positioning for bystanders [18], which as well might mislead them into learning incorrect postures [19]. To overcome this drawback, Park et al. [18] proposed the fixation of smartphones via an armband on the dorsum manus or at the arm and had shown an increased convenience compared to the common grasp-in-hand approach. However, they reported a reduced sensitivity, which they   [16] explained with the amplified inertial forces resulting from the additional device's swing. Similarly, Ruiz de Gauna et al. [20] compared sensor placement at the dorsum manus with one fixed to the forearm 7 cm above the wrist. They confirmed a significantly increased error for the forearm placement.
Consequently, while IMUs have generally proven to be a precise and practical approach to measuring chest compression depth and frequency during CPR, user-friendliness via smartphones is a challenging task as it affects the quality of CPR for bystanders. Smartwatches hold benefits over the use of smartphones regarding usability. They could be expected to achieve higher reliability towards arm-movements because they are potentially less affected by hand movements and rigidly attached to the wrist. Furthermore, they overcome challenging aspects of reduced tactile pressure sensation at the hands. However, the use of IMUs on alternative placements was repetitively found challenging for sufficient accuracy. The suitability of smartwatches for CPR training and onlinesupport regarding the sensitivity of CCD and CCF detection has yet to be investigated.
Our approach is the combination of a wrist-worn IMU with a sinusoidal model. To fit the accelerometer data to the sine curve of the model, an appropriate optimization algorithm is required. Evolutionary methods have already been found to be principally suitable for a similar approach: Lins et al. [21] use a Differential Evolution (DE) algorithm to fit optical motion capture data to a sinusoidal model. In this context DE is used for continuous window-based curve fitting of the model by optimizing the parameters of a sine function. The article at hand proposes a Evolution Strategy (ES) inspired algorithm for the continuous model-fitting (i.e., without complete reinitialization of the population) with IMU data.
Nature-inspired algorithms such as a Genetic Algorithm (GA) have also already proven useful in signal processing [22][23][24]. In addition, there is already some work that has used GAs for curve fitting, e.g. Zhao et al. use a GA to fit the parameters of a Bezier curve [25]. GAs have also been used to fit polynomials [26]. In the recent work of Jiang et al. a modified GA is used to optimize the parameters of sine signals [27,28]. Consequently, in this study, we aim to investigate the following two research questions: 1. How suitable are wrist-worn inertial sensors (e.g. smartwatches) for the online detection of the chest compression during CPR regarding the accuracy of resulting CCF and CCD parameters compared to both the Resusci Anne training mannequin and the typical hand-holding as the gold standard? 2. How suitable is the algorithmic approach for fitting a sinusoidal model of the chest compression during CPR regarding the accuracy of resulting CCF and CCD parameters for the considered sensor placements compared to the Resusci Anne training mannequin as reference system?
In Section 2, our system approach, details of the used algorithm, study design, and applied evaluation methodology is introduced. In Section 3, the results of the study are presented and discussed in Section 4. The article is concluded in Section 5.

System Approach
In the proposed system ( Fig. 3), the curve of chest compressions during CPR is analyzed from data of a wrist-worn (and handheld as reference) three-dimensional inertial sensor containing accelerometer, gyroscope, and magnetometer (9DOF). The accelerometer signal contains earth gravity as a constant component distributed among all three accelerometer axes, depending on the sensor orientation. For fitting the model function, only the acceleration caused by the orthogonal pressure on the patient's chest is relevant. Unfortunately, when placed on the wrist, the orientation of the sensor is never entirely orthogonal to the chest. So the earth's gravity is distributed over all three axes with different magnitudes. The approach to handle this is to consider only the total acceleration a, i.e. the Euclidean distance over all axes and subtract the Fig. 2 Basic approach of a sinusoidal model for CPR quality parameter estimation (see Section 2.1 and Fig. 3 for more details). The accelerometer data is measured by an IMU sensor and then window-based fitted to a sine function, which in turn provides the CCF/CCD parameters sought constant gravity ( 9.81 m s 2 ) from the total acceleration, which is one-dimensional (see Equation 1).
This one-dimensional time-series data are window-based (window length S len ) fitted to a sinusoidal function model. The fitting generates adapted models per f U −1 seconds, from which the CPR parameters frequency (CCF) and compression depth (CCD) can be derived (recap Fig. 3).

Model function
The approach is to fit the time series of the accelerometer readings to a sinusoidal function. This is possible because of the periodic nature of CPR (see Fig. 4). The sought CPR quality parameters can then be derived directly from the parameters of the sinusoidal function. The generic parameterized sine function can be written as follows: (2) f (t) = A ⋅ sin( t + ) + D Parameter A and are of primary interest: A is the amplitude, the angular frequency (D is the vertical displacement, the phase shift). A, , are adapted so that the sine curve fits the accelerometer data. Assuming that the arms of a person performing CPR are orthogonal (and rigid) on the patient's chest, the relative movements of the bystanders' arms are equal to the chest compression depth. It is also assumed that the chest is wholly relieved after each compression (full chest recoil as recommended by ALS/BLS guidelines). Additionally, the frequency of low to high to low compression depth represents one compression cycle. Since it is not applicable to fit the accelerometer data (total acceleration) directly to the sine curve (see Equation 2) and derive the displacement of the arm from it, the accelerometer data must be integrated twice to determine the vertical displacement ( ∫ ∫ acceleration → ∫ velocity → displacement). However, the double integration of the acceleration values induces errors since the accelerometer can not be assumed to be perfectly calibrated, so this is rarely a practical way. To avoid this integration errors, we use the second derivative of the sine function as a model function. Thus, the analytical solution of the double integration is already known ( f , see Equation 2): On a fitted function, parameter is the CPR frequency (CCF), and 2 ⋅ A is the compression depth (CCD). To fit the function f (t) , we minimize the root mean squared error (RMSE). Thus, we formulate the minimization problem (loss function L) as follows: In Equation 5, a is the T-dimensional tuple of accelerometer measurements (total acceleration or vertical acceleration), |a| is the dimension of the tuple a, i.e., its number of elements. T is derived from the window length S len (e.g., S len = 3s with 100 Hz → T = 300 ), which has been optimized in [blinded citation].

Evolutionary fitting of the model function
Lins et al. [21] use the Differential Evolution (DE) algorithm with a comparatively large population of candidate solutions that are evaluated in each generation. Population-based algorithms such as DE can use the diversity of their population to optimize several local minima (in case of a minimization problem) in parallel over generations. In the case of the sine model, there are not several different local minima (only periodic ones), so only individuals of the population are mutated and recombined per generation G. This reduces the computational effort per generation. The approach of working with only a few candidate solutions is thus better suited for use on an embedded device that operates under more difficult constraints in terms of performance and energy consumption.
In order to estimate the three variables , A, of the sine function f (Equation 4), herein a Evolution Strategy inspired algorithm is applied (see Algorithm 1). The algorithm uses also elements from GA, e.g. it is population-based and optimizes the population throughout several generations ( + ) -Evolution-Strategy based on [29] but with a GA-like population). The population-element of the algorithm is used as archive for possible good solutions.
The optimization is done between a transition from one generation G to the next generation G + 1 . Within each transition from one generation to the next, the algorithm comprise the steps mutation, crossover, and selection, which are discussed in the next sections. Algorithm 1 is continuously applied on S len long data windows while retaining fractions of the population until G = G max or the convergence of G is smaller than c min .

Initialization of the parameter space
Be x i,G a 3-dimensional vector (containing sought parameter A, , ) of individual i for generation G: In every generation G = 1 + 1 + 3 = 5 individuals are newly generated ( x +1 to x + ). Every of the individuals represents a possible solution to the minimization problem (see Equation 5).
At the first start, the population is initialized by drawing parameters from an uniform random distribution (exploration). In the optimization process, individual solutions will move closer and closer to the optimum, and the variance within the population will decrease (exploitation). Every new individual of the population is also initialized taking random variables from a uniform random distribution to foster the exploitation of the parameter space. For the specific task of fitting a sinusoidal function, the interval of the random distribution can be restricted to the problem's bounds. Table 2 summarizes the parameter space over all dimensions for the given task of fitting the CPR sinusoidal model.

Mutation
In the applied approach, mutation occurs in two ways. The first child x +1 is simply a newly generated random individual. This ensures that the algorithm can still exploit the parameter space. Then, in each generation G, the currently best individual x 0 is mutated minimally and forms the second child x +2 of the current generation. This mutation is a fine-tuning element to optimize the current solution. The following − 2 offspring are created as follows (with constant M = 0.999 ), where U generates a random value from a uniform random distribution within the interval: k is the index of the 3-dimensional solution vector (see Table 2).

Crossover
The crossover step is used to transfer information, i.e., possible solutions, from the current generation to the next generation and to recombine it. In the approach chosen here, three ( − 2 ) offspring per generation are generated from two randomly selected parent individuals.

Selection
The selection step determines which individuals are passed to the next generation by evaluating them against the cost function. Herein, the RMSEs are summed up for every solution candidate x i,G as cost function: with a being a T-dimensional tuple S of samples (accelerometer data) and f x i,G the parameterized sinusoidal function of individual x i,G . After the steps mutation and crossover + individuals exist. The population is therefore reduced to the fittest individuals after the evaluation of the population. Once the optimization has finished, i.e. when G max or c min has been reached, the individual with the lowest RMSE represent the parameter of the sinusoidal model ( x 0 ). From these parameters, the CCF and CCD can be obtained with CCF = 2 ⋅ 60 cpm and CCD = 2A cm.

Reconsideration of the population
Herein, the algorithm is initially only executed for a small window of 3 seconds ( S len = 3 ) of IMU data. Once a subsequent data-window is available (next 3s with 2s overlap → f U = 1s −1 ), the algorithm is executed for a new fitting run. In a previous approach [21], the evolutionary optimization was performed with a completely new population. Possible solutions that are very similar to the current solutions must always be found and optimized anew. In contrast, herein a part of the population is retained and only one fraction is completely reinitialized. On the one hand, a large diversity of the initial population can be ensured. On the other hand, good solutions from the past are retained in the expectation that they will also fit the current data window with a few (9) x a with a = U(1, ) Table 2 Parameter limits for every dimension used for initialization. The individuals are initialized by drawing random numbers from the given intervals using a uniform random distribution Individual x Function Parameter Interval CCF/CCD only used for model fitting adjustments. Fraction is being optimized in the hyperparameter optimization step (see Section 1). Initially, the favorable hyperparameters of the algorithm ( , G max , , c min ) are determined based on simulated data of sinusoidal curves (see Section 1). With these specific hyperparameters, the algorithm is then evaluated within a study with human participants.
Based on the results of Monte Carlo simulations, we select = 400 , G max = 10 , = 0.5 , c min = 0.05 as suitable hyperparameters for further evaluation with human participants.

Experimental setup
The Laerdal Resusci Anne Simulator mannequin 1 was used as a reference system and was placed on the floor (see Fig. 5). Within the Resusci Anne simulator, sensors measure the depth of thorax compression and decompression, the frequency of the compressions, and the volume of ventilation.
While conducting CPR trainings on the Recusci Anne, the participants have been equipped with two IMU sensors (see Fig. 6) to evaluate the relevance of their placement. One IMU sensor was placed at the left wrist of the participant with a bracelet, and the other one was placed between the hands of the participant (between the back of the hand of the first hand and the palm of the second hand). Otherwise, no specific arm or upper body posture was explicitly required. The sensors and the training mannequin were collecting data that was synchronized manually after the recording via visual inspection of the accelerometer signal. The Resusci Anne recording starts and stops automatically with the first and last chest compressions. The rising and falling edges of the accelerometer signal are clearly visible on a plot and were synchronized with the start of the chest compressions.
A sensor system (humotion 2 sensor belt) was chosen and modified for the intended use, which allows the raw sensor data to be recorded unfiltered and in a wide variety of formats. This 9DOF IMU sensor system consists of a triaxial accelerometer with sensitivity ranges from 1G up to 16G (Bosch BMA180, Bosch Sensortec GmbH, Reutlingen, Germany), gyroscope (STMicroelectronics L3GD20H, STMicroelectronics, Geneva, Switzerland), and a magnetometer. A sampling rate of 100 Hz was selected, which is considered a typical sampling rate on smartwatches and also represents a reasonable compromise between computing effort and precision.
The participants were asked to place themselves on any side of the training mannequin and perform the CPR within 80-140 cpm. The study director monitored the correct implementation of the CPR and, where necessary, corrected with verbal advice. The recording lasted for two minutes.

Statistical analysis
For every compression cycle recognized by the reference system, a 3-second window S ( S Len = 3s ) of the sensor data is used to fit the sinus model every second ( f U = 1s −1 ) as recommended by [21]. Here, it is S len > f −1 U , so the used datasets S are interleaved (see Fig. 7).
Also, one Resusci Anne event E (a complete compression/decompression cycle) may be smaller, equal, or larger than f −1 U so that we must combine one or more model predictions before comparing it with E (Equation 13). Thereby, the weighted mean of n subsequent model predictions within each interval (E Start , E End ) is calculated with the overlap ratio representing the weight: For each compression event E, a corresponding prediction p is determined according to Equation 13. The measurement-error is calculated as the absolute difference between predicted CCF/CCD and the CCF/CCD of the reference system for every CCF/CCD prediction over every participant.
For comparison with the predictions of the sine models, one-dimensional 1000-point Discrete Fourier Transformations (DFT) were calculated for the identical windows using the FFT algorithm.

Results
The study cohort consisted of 18 participants, aged 19-48, 12 male, 6 female. The participants were recruited amongst students and staff of the University of Oldenburg, Germany. The study received ethics approval number "Drs. EK/2018/31" of the IRB of the University of Oldenburg. Table 3 contains the overall results of the comparison between model predictions and reference data. The results show the least error ( ±2.22 cpm) for CCF prediction for the sinusoidal model based on the sensor data from the wrist-worn sensor. The alternative method FFT shows a much higher error with ±7.42 cpm. When predicting the compression depth CCD, the wrist sensor's data with ±0.69 cm show an slightly higher error as the hand-held sensor, which median error is ±0.64 cm.
The statistical significance of the differences between the sensor positioning at hand versus at wrist was tested with the Wilcoxon Rank Sum Test (one-sided). The differences in absolute errors between wrist and hand ( H 1 : wrist position produces lower error) are not significant for CCD prediction ( p = 0.999 ), whereas the differences for CCF prediction are significant ( p = 0.001). Figure 8 shows the error distribution of the CCF prediction of the sine model versus FFT considering the two sensor positions. The sine models' errors are predominantly in the area of [0, 5] cpm showing little outliers. The error distribution for the FFT variants is mainly in the area of about [0,15] showing more outlier sets between [25,50] cpm. Figure 9 shows the error distribution of the CCD prediction of the sine models for the two considered sensor positions. The distribution of the model based on the hand-held sensor is centered around 0.5 cm with no notable outlier groups (some outliers up to 4 cm). The wrist-worn sensor's distribution is also centered around 0.5 cm, also with no notable outlier groups but some outliers up to 5 cm.
In Figs. 10 and 11 -unique forms of point diagrams (Bland-Altman plots) -the differences between the predictions of the sinusoidal models and the measurement of the reference system are plotted against the mean value of the two methods. For the compression frequency (Fig. 10) the error is within one standard  deviation in most cases. A closer look reveals a linear relationship between increasing error and measured frequency (diagonal arrangement of data points). In case of the compression depth (Fig. 11) most measurements and predictions are between 4-6.5 cm and within two standard deviations and few outliers.

Discussion
In this study, two research questions have been investigated. To clarify the suitability of smartwatch-like inertial sensors for the detection of the chest compression frequency (CCF) and depth (CCD) during CPR in comparison to the typical hand-held smartphone sensor, both sensor positions were evaluated with the Resusci Anne training mannequin as reference system. With an error of ±2.22 cpm, the CCF accuracy of the wrist sensor was slightly more accurate compared to an error of ±2.38 cpm for the common grasp-in-hand use. Both errors remain in the same order of magnitude, confirming the algorithm's robustness and the general suitability of the sinusoidal model-based approach. Consequently, we could confirm the suitability of the smartwatch-related wrist positioning for CCF calculation.
Considering the CCD, we found a slightly higher error (0.69 cm) for the wrist sensor when compared to the With an error of ±2.22 cpm in predicting the CCF, it is higher than the range given in the literature. Even though Ruiz de Gauna et al. [14] reported a lower median error of 0.9 cpm for their approach, differences among both studies could as well be affected by variations among reference system (photoelectric sensor) and IMU sensor (ADXL330, Analog Devices, USA). It thereby might not only be related to the algorithmic specifics. In any case, the error of 2.22 cpm is far below the critical target range of 100-120 cpm and thereby does not affect the practical applicability of the algorithm.
In comparison to the related approaches, the proposed system achieves a comparable CCF accuracy within the ERC guideline requirements of ±10 cpm [5]. However, we found a high inter-subject variability of the sensitivity to measure the CCD. In contrast to the CCD prediction results here, Lu et al. [32] used the accelerometer data to fit a polynomial model to predict the CCD with high accuracy (about 0.03 ± 0.5 cm within 95%-CI). González-Otero et al. [33] report an CCD prediction error below 0.35 cm in 95% of 2-s-windows of accelerometer data using the peak-to-peak value of the reconstructed compression signal.
Consequently, wrist-worn devices can accurately predict the CCF, while CCD measure can be expected to hold an error of up to 0.69 cm. Although CCD prediction still shows potential for improvement (e.g. with modified model function), the results are sufficient for practical applications in smartwatches to make qualitative statements about the quality of the CPR. Smartwatches are therefor a well suited, unobtrusive, and high available alternative platform for giving CPR feedback for bystanders in emergencies.
While the proposed CPR modeling via a sinusoidal model is intended for an online system, it was tested as an offline system for evaluation purposes. Due to its iterative nature, the sine model fitting can probably be used well on (mobile) embedded devices. In contrast, the population-based optimization of the evolutionary algorithm is well suited for parallelization on multi-core systems, which become defactostandard in current mobile devices. As the algorithm can be dynamically adapted to varying processing power conditions, e.g. by adjusting hyperparameters such as number of generations and individuals the given approach is well suited for use in smartwatch application where even with cheaper hardware good results can be achieved, albeit not with the highest precision. The convergence ensures that each offspring generation is at least as good as the previous one, and even in limited generations, models can be expected to be fine-tuned to the physiological characteristics of the users and the sensor environment. Fig. 10 Bland-Altman plot of differences against mean CCF measurements using wrist-worn sensor with the corresponding 95% confidence interval (shaded line) Fig. 11 Bland-Altman plot of differences against mean CCD measurements using wrist-worn sensor with the corresponding 95% confidence interval (shaded line) A more complex sine function, such as a linear combination of several sine terms, may be also an appropriate model function. For the usage scenario here, namely to determine the frequency and compression depth of the CPR in a straightforward way, a more complex function would be a hindrance, even though it might fit better to the data. Therefore a comparatively simple sine function was chosen here.

Conclusion
The article introduces and evaluates an approach to predict frequency and depth parameters of CPR training via accelerometer data of a wrist-worn IMU in comparison to a hand-held IMU. The sinusoidal models for estimating the compression frequency and depth were dynamically adapted using a Evolution Strategy inspired evolutionary algorithm. The approach was evaluated with 18 human participants for both hand-held and wrist-worn sensor positions. The chest compression frequency (CCF) was predicted with a median error of ±2.22 cpm and the compression depth (CCD) with a median error of ±0.69 cm for the wrist sensor position. The CCF prediction is considered suitable for practical applications whereas the CCD requires refinement of the approach. Thus, our work represents an essential step towards complete and precise modeling of the CPR using mobile sensors as can be found in smartwatches. While focusing on the algorithmic aspects of the detection of the CPR parameters, the general feasibility of smartwatches for CPR feedback (e.g. via a full-featured smartwatch application) has to be investigated further. The next steps are the development of a corresponding smartwatch application with a refined CCD prediction model, its evaluation, and subsequent usability studies to show that the application is of value in CPR training and emergency scenarios.

Evaluation with simulated data
For the simulation-based optimization, periodic acceleration data for ten random frequencies were generated within the interval [1,3] Hz (60-180 cpm). For each frequency, a three-second sample was generated using the model function (see Equation 4) and normal-distributed Gaussian noise was applied. The amplitude of the function was randomly selected from [0.01, 0.05] m. This one test round with ten random frequencies was considered as one individual for a meta evolution using the Differential Evolution (DE) algorithm (Python/scipy implementation).
A cost function was chosen that considers the number of individuals and the maximum number of generations (less is better): with M being the number of model predictions and F and D the random frequency and depth values. The DE algorithm was optimizing with a population size of 100 and 100 iterations.

Simulation Data Results
The meta-optimization of the hyper parameters using the DE algorithm produced the near optimal values shown in Table 4. Since the results of heuristic algorithms are subject to random fluctuations, the meta-optimization was performed 100 times in total and the deviations were noted. Table 4 gives mean and median deviations of the optimizations.
Funding Open Access funding enabled and organized by Projekt DEAL.

Ethics statement
The study received ethics approval number "Drs. EK/2018/31" of the IRB of the University of Oldenburg.

Conflict of interest
The authors declare that they have no conflict of interest.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http:// creat iveco mmons. org/ licen ses/ by/4. 0/.