Advanced automatic detection of fetal body movements from multichannel magnetocardiographic signals

Objective: Both heart rate (HR) monitoring and detection and description of fetal movements provide essential information of the integrity of in utero development and fetal wellbeing. Our previously described method to identify movements from multichannel magnetocardiographic (MCG) recordings lacks of reliability in some cases. This work is aimed at the improvement of fetal movement detection by means of an advanced signal processing and validation strategy. Approach: The previously proposed methodology of fetal body movement detection from MCG recordings using single space angle (SSA), min–max amplitude (MMA) and a measure of the overall signal strength across (RSS) was extended by moving correlation coefficient (MCC). The methodology was developed with respect to the discrimination between active and quiet sleep, validated by testing its coupling with HR accelerations in a total of 137 recordings lasting 30 min from 98 fetuses aged 34–38 weeks of gestation (WGA) of normal pregnancy. Main results: The developed algorithm improves the reliable automatic detection of fetal body movements independent of the fetal sleep states and their changes in the individual MCG recordings. In the fetuses aged 34–38 WGA 94% of 15  ×  15 HR accelerations were coupled with detected movements. The visual inspection of the movement graphs of 30 fetuses aged 20–32 WGA supports the transferability of the movement detector to this age. In four subjects MCG-based movement detection and maternal report on percepted fetal movements were consistent. Significance: The presented methodology allows the parallel automatic acquisition of precise fetal heart rate variability (HRV) indices based on subsequent beat intervals and of fetal body movements from MCG recordings during late 2nd and 3rd trimester. Potential advantages of parallel monitoring of fetal HRV and movements using MCG compared to established ultrasound technology should be investigated in subsequent studies with respect to the identification of fetuses at risk.

Observer-dependent ultrasound observation of fetal movements is a time-consuming procedure that is somewhat impractical under standard conditions. The current gold standard of movement detection in association with HR patterns is based on the automatized analysis of Doppler signal deviations during the recording of CTG. CTG for its methodological basics is limited to resolve the fetal HR for exact beat-to-beat analysis. Therefore, standard HRV markers, based on individual heart beat intervals, can only be obtained with respective trade-offs on temporal acuity.
Fetal magnetocardiography (MCG) is an alternative approach which allows a heartbeat-precise HR measurement as well as an indirect identification of fetal body movements. Fetal movement in utero leads to a shift of the heart and, hence, of the spatial distribution of the cardiac magnetic field. This shift results in amplitude variations and morphological changes in the multi-channel MCG presentation of the heartbeats, induced by the change in position and orientation of the fetus.
Nijhuis et al introduced four fetal behavioral states which are based on fetal HR patterns, eye movements and body movements measured by ultrasound (Nijhuis et al 1982). It can be seen as a concept based on movement patterns and fetal HR patterns, mainly accelerations. These patterns define the fetal behavioral states and the corre sponding fetal movement activities. Originally, the behavioural states are defined only after 32 weeks of gestation (WGA). Before 32 WGA it is only possible to distinguish between quiet and active states.
It was shown that the HR accelerations of different magnitude and duration, which develop with increasing gestational age , show a high coupling to fetal movement (Schmidt et al 2014). This is especially true for the 15 × 15 accelerations. 15 × 15 accelerations are defined as an increase in the HR for more than 15 s with a deviation of at least 15 beats per minute (bpm) above the baseline. The synchronous onset of fetal HR accelerations and fetal movements becomes closely linked in the third trimester, at which they show more than 90% coincidence (Timor-Tritsch et al 1978, Rabinowitz et al 1983, Johnson et al 1992, Schmidt et al 2014. As the accelerations develop during the course of pregnancy it is not possible to make a reliable statement about the movement activity of the fetus based on the information of the accelerations alone, especially during the early weeks of pregnancy. Therefore, methods for the independent automatic detection of movements are required. Recently, we developed and presented a method for the automatic detection of fetal body movements using multichannel MCG signals. In our previous MCG approach, we were able to clearly distinguish between segments with fetal body movement and segments without movement when both conditions occurred during the recording. As a major restriction the method did not allow to define a suitable detection threshold in those recordings devoid of any fetal movements (Schmidt et al 2014).
The present work is aimed at the improvement of the fetal movement detection by means of an advanced signal processing that overcomes previous limitations and a profound validation strategy. We propose a more reliable method for identification of fetal body movements based on modified versions of three previously used movement graphs, namely minimum maximum amplitude (MMA), L2 norm (RSS), signal space angle (SSA) and the newly developed graph of moving correlation coefficient (MCC). We introduce the calculation of a discriminatory parameter using the information of these graphs, which is able to divide the signal into sections with and without body movements in order to give a more precise and quantitative statement about the movement activity of the individual fetuses.
The methodology was developed with respect to the discrimination between active and quiet sleep and validated by testing its coupling with HR accelerations in a total of 137 recordings lasting 30 min from 98 fetuses aged 34-38 WGA of normal pregnancy. The developed methodology was shown valid in 30 recordings of fetuses aged 20-32 WGA by visual inspection of the movement graphs. In four subjects the fetal movements identifed by the proposed MCG analysis method were shown consistent with the maternal report on percepted fetal movements.

Subjects and data acquisition
Data was used from the study database at the Biomagnetic Center, Department of Neurology and the Department of Obstetrics, both at the Jena University Hospital. The data were collected using the 195 channel SQUID array system ARGOS200 (ATB, Chieti, Italy) over 30 min with a sampling rate of 1025 Hz. We investigated 137 recordings from 98 mothers with singleton normal maturating pregnancies during non-stress situations aged between 34 and 38 WGA. All women gave their written consent. Thirteen recordings were excluded due to bad signal quality and artefacts. Additionally, 30 recordings of fetuses aged 20-32 WGA (n = 5 of 20-21, n = 5 of 23-24, n = 5 of 25-26, n = 5 of 27-28, n = 5 of 29-30, n = 5 of 31-32 WGA) were randomly chosen from our study data base. All fMCG recordings were accompanied by a maternal electrocardiogram.

MCG derived movement signal
The methods to reconstruct fetal movements include independent component analyses (ICA) with an automatic recognition of fetal components in order to reconstruct the fetal MCG (fMCG) and a Rate of change of Hilbert Amplitude algorithm for the identification of the fetal heart beat positions (Schmidt et al 2014).
Based on the fMCG and the heart beat positions the movement graphs are calculated. Three graphs inspired by Zhao and Wakai (2002), Van Leeuwen et al (2009), Govindan et al (2011), Lutter and Wakai (2011), Brändle et al (2015, Avci et al (2018) have been adopted or slightly modified. MCC is a newly introduced movement graph. MMA and RSS primarily quantify amplitude changes, whereas SSA and MCC tend to identify changes of the ORS complex pattern. These four graphs as a whole describe most of the fetal body movement types. In the following, a step by step guide for the calculation of the single graphs is displayed.

SSA
(a) Determine the polarity of each channel; (b) determine the initial heart vector X 0 . Depending on the polarity of the channel it is searched for the maximum or minimum in a region around every fetal heart beat position; (c) calculate the graph with the following calculation rule: -Determining the individual X i takes place as at the initial heart vector X 0

RSS
(a) Determine the polarity of the channel; (b) construct X i vector by maximum or minimum values in a window around the heartbeat position in all channels depending on their polarity; (c) calculate the graph with the following calculation rule: In both calculation rules l denotes the number of fetal heart beats. X i is a n-component heart vector, which is the output of the n many channels for one heart beat time point. One restriction has to be noted when calculating SSA. It cannot be calculated in the exceptional case when only one ICA component was found (in our data 8 out of 137 recordings).

MMA
(a) Find the minimum and maximum values for each channel in a given area around the R-peak at each fetal heart beat position; (b) calculate the average of the minimum and maximum curves; (c) sum up the absolute values of the averaged minimum and maximum curves of all channels.

MCC
(a) Set a heartbeat template as reference, by a given window around the initial heartbeat position; (b) calculate the maximum cross correlation coefficient between every heartbeat and the heartbeat template for each channel; (c) average the maximum cross correlation coefficients of all channels.
Each of these graphs was finally smoothed using a sliding average filter with a window size of two heart beats in order to reduce the effect of noise in individual heartbeat pattern changes on the quantification parameter.

Discrimination parameter RMSSD
Within each movement graph, the root mean square of successive differences (RMSSD) was calculated stepwise over sliding windows. Note that RMSSD in this circumstance was not applied as a measure of HRV but of variability within the secondary time series acquired by the above described algorithms to detect movementrelated signal changes in the fMCG trace. RMSSD is well-suited to identify rapidly changing signal parts. We investigate the hypothesis that low RMSSD values of these movement-related MCG graphs indicate movements of the fetus.
The sliding window size was 64 heart beats with shift and overlap of 50% resulting in a temporal resolution of movement detection around 14-16 s. Before calculating RMSSD, within each window the graphs were linear trend corrected to remove slow baseline drifts from the signal and z-score normalized, since the amplitudes of the individual graphs differ greatly, depending on the location and position of the fetus.
Subsequently, the calculated RMSSD graph values were weighted averaged. We used heuristically determined weights (0.5, 0.2, 0.15, 0.15) for the graphs (MMA, RSS, SSA, MCC), respectively, and (0.5, 0.2, 0.3) for (MMA, RSS, MCC), when SSA could not be calculated. In spite of their mainly similar appearance, MMA and RSS provide complementary information in some cases. MMA graphs showed the more robust values comparing approaches because it quantifies both the minimum and maximum values around the heartbeat positions, whereas RSS only the maximum or minimum value. SSA and MCC, on the other hand, are more susceptible to different aspects of movements which change the QRS pattern. In the final step, a global threshold has been searched for, which is used to determine whether there was a movement at a specific time window or not. Figure 1 shows examples of movement graphs and identified movements. The corresponding RMSSD sequences of the recording with movements (left part) are shown in figure 2.
Technical requirements to combine MCG and ultrasound concurrently are complicated. Therefore, simultaneous comparison of ultrasound and MCG is hardly achievable (Mensah-Brown et al 2010).
For this reason, we use a three-step approach to ensure the correctness of the detected movements and to find an optimal global threshold.

Threshold optimization: 1F/2F separation
Using the discriminatory parameter RMSSD, a threshold for the optimal discrimination between 1F and 2F was searched for. For this purpose, 155 10 min segments of women between the 34th and 38th WGA were considered. These segments are excerpts from 30 min measurements as can be seen in figure 1. In total 49 1F segments and 106 2F segments are available. Generally, one state of 1F and 2F per measurement were considered when available. The fetal behavioral states were previously classified according to visual assessment of the HR patterns based on standard criteria after a consensus decision by three independent obstetricians (quiet sleep (1F, HRP A), active sleep (2F, HRP B). The 1F state is generally characterized by absence of or sporadic movements, whereas state 2F is characterized by a frequent movement activity (Nijhuis et al 1982). The here developed approach should be able to differentiate between these two states on the basis of the percentage of detected movements in the total measurement. In order to determine an optimal detection threshold we have varied the global threshold from 0.65 to 0.85. The groups were separated by univariate logistic regression models based on the percentage of movement in the 10 min segments. The separation ability was quantified by sensitivity (Sens), specificity (Spec) and area under curve (AUC) of the receiver operating characteristic curve. The goodness of fit values was estimated by means of a 5-fold cross validation with 10 repeats (table 1).

Validation coupling 15 × 15 HR accelerations-fetal movement
The accuracy of the movement detection was then tested by the coupling with HR accelerations. Since no movement-labelled data were available for the development of the present method, the 15 × 15 accelerations were considered as a label. For this purpose 124 30 min measurements of women between the 34th and 38th WGA were considered. During this period, the coupling between the accelerations and fetal movements is pronounced. Therefore, a strong coupling between the accelerations and detected movements can be interpreted as a confirmation of the parameter as a measure of movement. An acceleration and fetal movement were considered as coupled if they had an overlap of at least 30%.
For each measurement, we calculated the ratio between coupled accelerations and all accelerations as a measure of accuracy. The same calculation was done using the detected movements to obtain information over the other coupling direction. Three records were excluded from the evaluation, since no 15 × 15 accelerations occurred.
In order to detect accelerations, a HR baseline needs to be calculated. For fitting a baseline no gold standard is available and it is assigned by means of visual assessment. Sometimes it is very difficult to guess where the baseline should be, especially in recordings of very active behavior with frequent and long-lasting HR accelerations. The used baseline estimation follows mainly the original Dawes Redman baseline fitting procedure (Pardey et al 2002. Figures 1 and 4 show exemplary results of the estimated baseline and the accompanying detected accelerations.

Confirmation: maternal perception
Maternal perception of fetal movements is subjective and there is not any approach for a common practice of movement counting (Freda et al 1993, Kamalifard et al 2013. Therefore, we visually evaluated four measurements which lasted 30 min, where the mothers marked sensed fetal movements during the measurement. One fetus was measured at the 29 WGA, one at 34 WGA and two at 35 WGA. Table 1 shows a snapshot of the performance of the logistic regression models based on the percentage of movement in 10 min segments for the used thresholds. The best separation between the states 1F and 2F could be achieved using a threshold of 0.72. We reached a mean AUC value of 93.45%, a Sens of 81.18% and a Spec of 90.45%. The thresholds from 0.67 to 0.72 provided similarly good results with AUC values of more than 93%.

1F/2F Separation
The AUC values for the thresholds down to 0.65 and up to 0.77 are only slightly worse (AUC decrease of about 0.7% and 2.1%, resp.). Figure 3 shows the boxplot of the percentage of movement in 10 min segments for the used threshold of 0.72. In most of the 1F states the fetuses move less than 25% of the time. On the other hand, if you look at the 2F states, most of the measurements show values between 40%-60%. These values are in good agreement with the expected movement activity within these two states, except for a few measurements.

Coupling 15 × 15 accelerations-fetal movement
Using the previously defined threshold of 0.72, an average of 94% (quartiles: 92, 100, 100) of the 15 × 15 HR accelerations was coupled with detected fetal movements. In contrast, only 60% (quartiles: 44, 60, 80) of the detected movements was coupled with the HR 15 × 15 accelerations. This can be seen as a proof of the suitability for the used method. Within the considered range of pregnancy, such a high coupling value could be expected due to the strong coupling between the accelerations and the corresponding movements in the investigated WGA period (Timor-Tritsch et al 1978, Rabinowitz et al 1983, Johnson et al 1992, Schmidt et al 2014.

Maternal perception
In figure 4 a reasonable coincidence between movements detected from fMCG and those sensed by the mother can be seen. For example around minute 5 both signals coincidently indicate fetal movement. In contrast, between minute 11 and 15 no movement was detected and the mother gave only two single movement perception signals. All three recordings from 34-35 WGA showed similar consistent relationships between movements detected from fMCG and those sensed by the mother. Only in a few cases maternal perceptions were not accompanied by movements detected from MCG. This figure also demonstrated the limitation of maternal sensing of fetal movements as reported above.

Application of movement detector to 20-32 WGA
Due to the weaker couplings and smaller HR accelerations the methods development cannot be performed based on these couplings before 32 WGA. Instead, we identified fetal movements from the movement graphs by visual inspection and compared these results with the MCG-based movements detections as designed above. This was systematically done for 30 recording of 20-32 WGA. We found almost similar characteristics of the movement graphs and mainly coincidence with the automatically identified movements as shown in figure 5.

Discussion
The developed methodology allows the synchronous automatic assessment of fetal body movements and HRV indices at a beat-to-beat precision from the MCG. Since a direct fetal body movement related signal is hardly recordable under MCG conditions, we followed a strategy that used segments of active and quiet fetal sleep  during the 3rd trimester in order to develop an appropriate detection setting. The detected movements could be confirmed with regard to the coincidence with HR accelerations and exemplarily by the coincidence with maternal markers of movement perception. The four movement graphs used in this work are simple and could be calculated with minimal effort from multichannel fetal MCG recordings.
The results show that the used approach is well suited for a 1F/2F separation with an AUC value of over 90% for different thresholds (see table 1). The used movement detection parameter RMSSD is mainly independent of the used threshold and therefore robust to discriminate the fetal behavioral state from MCG-based on the detected movements.
Different studies confirmed that fetal movements and fetal HR accelerations become more integrated with advancing WGA, which is an expression of the ongoing maturation and coordination of the fetal central nervous system (DiPietro et al 1996, DiPietro et al 2001, Schmidt et al 2014, Brändle et al 2015. Therefore, the detected movements showed a strong coupling to 15 × 15 accelerations. This property can thus be regarded as a further confirmation of the procedure. We reasoned that, if the algorithm correctly identifies changes in fetal heart position, the timing of these changes in the movement graphs should correspond with fetal HR accelerations. The results show that the majority (94%) of the 15 × 15 accelerations are coupled with the detected movements. This is a clear sign that the changes in heartbeat morphology and amplitude measured by the fetal MCG are associated with fetal body movement. In some cases, no indication in the graphs for fetal movement was present, which indicates other reasons for the occurred accelerations, as can be seen in figure 4. These accelerations may result from movements involving punches and kicks from the fetus. Generally, gross body movements detected with ultrasound are characterized as being a combined trunk and extremity movements or stand-alone extremity movements. As only gross trunk movement will result in a shift of the fetal heart vector, the MCG technique is blind to stand-alone extremity movements.
Concerning the opposite direction, only 60% of the automatically detected movement episodes were associated with 15 × 15 accelerations. In many cases, we observed that HR accelerations of lower amplitude like 10 bpm above the baseline were also associated with detected movements (figure 1), a result consistent with (Timor-Tritsch et al 1978, Natale et al 1984, Schmidt et al 2014. Another reason may be that some detected movements are caused from artifacts resulting from maternal movement. Under some circumstances, however, movements occur in the absence of fetal HR accelerations. In the second trimester, the fetus is often active but the fetal HR accelerations are of low amplitude (Sorokin et al 1982, Natale et al 1984.
The agreement between identified movements and maternal movement perception also demonstrated the suitability of the procedure. However, the ability of the women to perceive movement varies widely among individuals and increasingly with advancing WGA (Hertogs et al 1979, Hantoushzadeh et al 2015, Brown et al 2016. This circumstance and also the maternal perception of stand-alone extremity-movements may be explanations for the changing coincidences. In six of the 13 excluded measurements a very regular and slow sinus rhythm could be observed. The slowly changing amplitudes lead to many false positive detected movements, mainly during episodes of 1F. By the analysis of the maternal respiratory rate reconstructed from the maternal electrocardiogram, we could show that the maternal breathing movement has affected the fetal movement signals. Figure 6 illustrates this aspect. It is worth mentioning, that this effect does not imply a serious limitation to the method since this rhythm could be observed only in a small fraction of the measurements. A subsequent manual evaluation of the data has shown that these signal components can be circumvented by a more appropriate choice of the fetal ICA components.
The present work was aimed at the development of a method to identify fetal movements from the MCGbased movement graphs based on the associations with fetal activity states and established 15 s lasting HR accelerations. The resulting method was intended and found to be able to detect fetal movements from the movement graphs alone during the 3rd and the late 2nd trimester. So far, the threshold for movement detection was set according to these relationships. Changes towards smaller movements are basically possible but need to be explored preferably using the movement graphs alone independent from the fetal HR pattern. The identification of smaller movements in connection with smaller AC would require the consideration of possibly weaker couplings even in mature gestation. The lack of knowledge in this regard is a fundamental problem for a methods development such as proposed here supposing mature developed activity states and cardio-motor autonomic integration. Another point of interest could be the transferability of the movement detector details to other MCG devices.
The fetal movement quantification is an important technique because assessment of fetal movement is an important supplement when it comes to antepartum fetal surveillance. Some studies suggested that a high amount of maternal stress, deleterious conditions in utero and other pregnancy high-risk conditions lead to a decoupling between fetal HR accelerations and movements (DiPietro et al 1996(DiPietro et al , 2001. Furthermore, there are hints that fetuses in distress compensate this situation by reducing their activity, which leads to fewer movements and fewer fetal HR accelerations (Pearson and Weaver 1976, Ehrstrom 1979, Mor-Yosef et al 1983, Heazell and Froen 2008. Therefore, an objective co-registration of fetal movements and HR using the methodology like outlined in this work could help to predict to neonatal outcomes in the future. Finally, this could facilitate the management of high-risk pregnancies like in intrauterine growth restriction (Grimm et al 2003. The ability to correlate fetal movement with fetal HR accelerations of reduced amplitude could be useful for monitoring fetuses especially in early WGA. One major advantage of the proposed methodology is its capability of an objective and automatic monitoring of fetal body movements. It may, therefore, contribute to a multivariate monitoring that considers fetal body movements, HR, HRV, heart beat morphology, and maternal autonomic tone (Zöllkau et al 2018). The latter factor is based on the maternal heart beats that can be obtained from corresponding ICA components of the identical MCG. HRV categories may help to find comparable HRV key parameters (Hoyer et al 2019). This multivariate setting may have implications for improved prenatal risk assessment that has to be evaluated in subsequent studies.

Conclusion
The advanced algorithm proposed here allows a stable automatic detection of fetal body movements from MCG recordings independent of fetal behavioral state or state changes. Consequently, the MCG-based methodology allows the parallel acquisition of fetal body movements, of fetal NN interval based HRV, as well as of the time intervals of fetal heart beat morphology and maternal autonomic tone. Further studies are required to compare this overarching functional description of high temporal resolution with clinically established approaches like CTG to explore possible diagnostic advantages in identifying and monitoring fetuses at risk.