(C) PLOS One
This story was originally published by PLOS One and is unaltered.
. . . . . . . . . .



Vision-based detection and quantification of maternal sleeping position in the third trimester of pregnancy in the home setting–Building the dataset and model [1]

['Allan J. Kember', 'Department Of Obstetrics', 'Gynaecology', 'University Of Toronto', 'Toronto', 'Institute Of Health Policy', 'Management', 'Evaluation', 'Shiphrah Biomedical Inc.', 'Rahavi Selvarajan']

Date: 2023-11

Abstract In 2021, the National Guideline Alliance for the Royal College of Obstetricians and Gynaecologists reviewed the body of evidence, including two meta-analyses, implicating supine sleeping position as a risk factor for growth restriction and stillbirth. While they concluded that pregnant people should be advised to avoid going to sleep on their back after 28 weeks’ gestation, their main critique of the evidence was that, to date, all studies were retrospective and sleeping position was not objectively measured. As such, the Alliance noted that it would not be possible to prospectively study the associations between sleeping position and adverse pregnancy outcomes. Our aim was to demonstrate the feasibility of building a vision-based model for automated and accurate detection and quantification of sleeping position throughout the third trimester–a model with the eventual goal to be developed further and used by researchers as a tool to enable them to either confirm or disprove the aforementioned associations. We completed a Canada-wide, cross-sectional study in 24 participants in the third trimester. Infrared videos of eleven simulated sleeping positions unique to pregnancy and a sitting position both with and without bed sheets covering the body were prospectively collected. We extracted 152,618 images from 48 videos, semi-randomly down-sampled and annotated 5,970 of them, and fed them into a deep learning algorithm, which trained and validated six models via six-fold cross-validation. The performance of the models was evaluated using an unseen testing set. The models detected the twelve positions, with and without bed sheets covering the body, achieving an average precision of 0.72 and 0.83, respectively, and an average recall (“sensitivity”) of 0.67 and 0.76, respectively. For the supine class with and without bed sheets covering the body, the models achieved an average precision of 0.61 and 0.75, respectively, and an average recall of 0.74 and 0.81, respectively.

Author summary Over the last decade, mounting evidence has pointed to sleeping on the back in late pregnancy as a possible risk factor for fetal growth restriction and stillbirth. One such analysis indicated that avoiding sleeping on the back in late pregnancy may be as important as stopping smoking and more important than achieving a healthy pre-pregnancy weight. However, a major problem with previous research has been that a pregnant person’s sleeping position was not actually measured but was, rather, recollected by the person themselves, which is known to be inaccurate. Currently available sleep position measurement devices, including computer vision based algorithms, are not appropriate for use in pregnancy. As such, there is a need for tools to help researchers measure sleeping position in pregnancy. Using an ordinary home-surveillance camera, we collected night-vision video of pregnant participants simulating sleeping positions unique to pregnancy in the home setting and in the presence and absence of bed sheets. We built a model from this data to automatically and accurately detect sleeping position and measure the amount of time spent in each position. Our model may eventually contribute to a tool that could help bridge a major gap in previous research, which would strengthen the case for a definitive and universal change in clinical practice.

Citation: Kember AJ, Selvarajan R, Park E, Huang H, Zia H, Rahman F, et al. (2023) Vision-based detection and quantification of maternal sleeping position in the third trimester of pregnancy in the home setting–Building the dataset and model. PLOS Digit Health 2(10): e0000353. https://doi.org/10.1371/journal.pdig.0000353 Editor: Chrystinne Oliveira Fernandes, Massachusetts Institute of Technology, UNITED STATES Received: December 1, 2022; Accepted: August 17, 2023; Published: October 3, 2023 Copyright: © 2023 Kember et al. This is an open access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited. Data Availability: The authors, nor the owner of the data (Shiphrah Biomedical Inc.), do not have the REB's nor the participants' permission to share the study data given that the study data are videos of study participants that cannot be de-identified. Should other researchers have questions about the data, they should contact the Research Ethics Manager, Health Sciences at the University of Toronto Research Ethics Board, whose contact information is available online (https://research.utoronto.ca/ethics-human-research/research-ethics-boards). Funding: This study was funded by a Mitacs Accelerate Program grant (No. IT 26263). Mitacs Accelerate (Ottawa, Canada), which connects companies with over 50 research-based universities through graduate students and postdoctoral fellows, who apply their specialized expertise to business challenges. Interns transfer their skills from theory to real-world application, while the companies gain a competitive advantage by accessing high-quality research expertise. In this study, the intern was HH. The university was the University of Toronto. The professor was ED. The company was Shiphrah Biomedical Inc. (Toronto, Canada). The total study funding was $15,000 CAD and was provided through Mitacs to the University of Toronto for ED to administer for the intern (HH) and the study expenses. For the grant (No. IT 26263), Mitacs provided 50% of the study funding and had no other role in the study. Mitacs contribution to the grant (No. IT 26263) was matched by SBI, which provided the remaining 50%. SBI also provided an internship experience for HH. HH was co-supervised by ED (University of Toronto) and AJK (SBI). Mitacs had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript, whereas SBI had a role in all these aspects via AJK. Mitacs Accelerate website: https://www.mitacs.ca/en/programs/accelerate Shiphrah Biomedical Inc. website: https://shiphrahbiomedical.com. Competing interests: I have read the journal’s policy and the authors of this manuscript have the following competing interests: AJK is the volunteer (unpaid) Chief Executive Officer and President of one of the study funders, Shiphrah Biomedical Inc. (SBI). AJK did not receive financial or material payment for his involvement in this study. EP is a volunteer at SBI and a shareholder in SBI. EP received a financial payment for her involvement in this study from the study funds. HH was involved in this work via an internship as part of his graduate studies at the University of Toronto. HH received a financial payment for his internship from the study funds. HH has no role in ownership, management, or control of SBI. RS, HZ, FR, SA, BT, SRH, and ED have no competing interests that could be perceived to bias this work.

Introduction Sleep during pregnancy plays a crucial role in maternal and fetal complications as evidenced by prior studies [1–11]. A supine going-to-sleep position after 28 weeks’ gestation was shown to be associated with more than double the odds of late stillbirth [12–17], and more than triple odds of birthing a small-for-gestational age (SGA) infant [12–15,18]. The going-to-sleep position is the dominant sleep position for the entire night in more than 50% of pregnancies with most pregnant people spending an average of 44% of the night in their sleep onset position [19]. Analyses demonstrate that avoiding the supine going-to-sleep position is important for all pregnancies after 28 weeks’ gestation regardless of risk factors for stillbirth in the pregnant person (e.g., age, body size, smoking, recreational drug use, pre-existing hypertension or diabetes) or in the fetus (e.g., movements, growth, gestation) [17]. In high-income countries, late stillbirth, defined as stillbirth occurring at or greater than 28 weeks’ gestation, remains an important yet understudied public health issue, affecting 1.3–8.8 per 1000 births [20]. Sleeping position in pregnancy, if a truly causative risk factor for stillbirth, must be contextualized among other modifiable risk factors. The leading three potentially modifiable risk factors for stillbirth are maternal obesity, advanced maternal age, and smoking–all of which have been shown to be deleterious to placental health and fetal growth [21]. Of these, only smoking is a realistically modifiable factor during the course of pregnancy, which amplifies the potential importance of sleeping position as a potentially modifiable risk factor [22–24]. For comparison, consider that if all pregnant people avoided sleeping on the back in the third trimester of pregnancy, the overall late stillbirth rate could be reduced by 5.8% (population attributable risk), [17] whereas if all pregnant people quit smoking, the overall late stillbirth rate would be reduced by 5.5% [25]. Furthermore, for a given pregnant person who usually goes to sleep on their back, by going to sleep on their left side instead, they can reduce their risk of late stillbirth by 62% (aOR 0.38) [17], whereas one Canadian study demonstrated that a 10% reduction in pre-pregnancy body weight would reduce the risk of stillbirth by only 10% [26]. The potential contribution of supine sleeping position in late pregnancy to stillbirth and growth restriction is biologically plausible. When in the supine position after 28 weeks’ gestation, the inferior vena cava (IVC) is compressed by the gravid uterus and pregnancy, resulting in reduction in blood flow and oxygen delivery to the fetus [27–33]. Furthermore, the prevalence of supine sleeping position in the third trimester is common with a wide range of variability–published research of objective sleeping positions demonstrate that pregnant people spend between 9.5–47% of the night sleeping supine [19,22,23,34–39]. The National Institute for Health and Care Excellence (NICE) organization’s recently reviewed the evidence for safe sleeping positions in pregnancy and concluded that, on a balance, the evidence is strong enough to recommend that pregnant people should be advised to avoid going to sleep on their back after 28 weeks’ due to the likely link with stillbirth [40]. Indeed, the aforementioned studies demonstrating an association between supine sleep, stillbirth, and delivering an SGA infant were all retrospective and body position was subjectively measured through self-reporting. As such, these studies are limited by recall bias, established inaccuracies inherent in self-reported sleep behavior when compared to objective measurements [35,41–45], and by the fact that sleeping position is usually not static in healthy sleep nor pregnancy [22,46,47]. Furthermore, members of our group have previously demonstrated that pregnant people underestimate the percentage of time they spend sleeping supine by an average of 7% in absolute terms (44% underestimate in relative terms) [22]. Among the NICE’s main critiques of the evidence was that it would not be possible to study the association between sleeping position in pregnancy and adverse outcomes because of these limitations [40]. As such, herein lays the rationale for the present study. Over the past decade, advances in computer vision have revolutionized daily life, and deep neural networks in particular, have attained remarkable performance in object detection tasks [48,49]. There have been numerous studies utilizing computer vision technologies (CVT) to track and analyze body movement and posture [50–55]; however, none of these were developed for pregnancy, which has unique sleep behaviors and physiology. Non-CVT devices for body position detection such as BodyCompass [56] and SleepPos [57–60] were also not developed with pregnancy in mind. These devices focus on the position of the thorax. While the position of the thorax may be important for maternal obstructive sleep apnea (OSA) diagnosis and treatment in pregnancy and the postpartum [19,61–64], the position of the pelvis, owing to its impact on maternal and uteroplacental hemodynamics [27,29,65–68], is more important to fetal wellbeing. The literature concerning investigations of the impact of OSA on fetal heart rate (FHR) patterns is of questionable quality in that it rarely accounts for maternal posture, a major confounder, using the gold standard (video determination). While OSA and accompanying maternal oxygen desaturations may play a role in spontaneous nocturnal FHR decelerations [69–71], this likely only holds true for moderate or severe OSA with deep desaturations and concomitant placental disease (e.g., fetal growth restriction) [70,71]. The fetus has a remarkable adaptive capacity to withstand in utero hypoxia, and the fetal hemoglobin has a higher affinity for oxygen than the maternal adult hemoglobin. Evidence from the largest studies to date investigating the role of OSA indicates no relationship between mild maternal oxygen desaturations and FHR decelerations, even in pregnancies with known fetal growth restriction [71,72]. Conversely, objectively-verified supine maternal posture seems to play a role in overnight FHR patterns, and this is corroborated by several studies [19,23,29], and likely extends to adverse pregnancy outcomes [17,18]. Only one study showed no effect of supine maternal sleeping position on FHR patterns; however, this study did not confirm maternal position with video, and the median percentage of time spent in the supine position overnight was only 1.09%, which makes it challenging to draw definitive conclusions [73]. Further, determination of only the thorax position is of insufficient resolution for sleep-in-pregnancy research because discordance between the position of the pelvis and the position of the thorax naturally occurs when the body is in a hybrid (i.e., twisted) position–in one of our studies (ClinicalTrials.gov Identifier: NCT04437407), we have observed up to 144 minutes of discordance between the pelvis and thorax position and up to 26.5 minutes of discordance between the pelvis and head position in a single night, which exposes a major limitation of use of “thoracic-centric” and/or “head-centric” position detection devices in sleep-in-pregnancy research. In the present study, we built a model for effortless, accurate, unobtrusive, and non-contact detection and measurement of sleeping position, at a high resolution, occurring throughout the third trimester of pregnancy in the home setting.

Discussion There exists a significant need to study sleeping positions in the third trimester of pregnancy using objective methods. These methods enable quantifying the time (“dose”) spent in various sleeping positions across this trimester and linking these “doses” to pregnancy outcomes (“responses”). Data on this dose-response is valuable and may lend support to or detract support from previous associations found between supine sleep, stillbirth, and small-for-gestation infants. The data underlying these previous associations are of suboptimal quality because they are based on subjective self-reported recollection of sleeping position and do not account for intra- and inter-night variability in sleeping position [17,18,40]. Currently, there are few clinically-approved products to monitor people’s sleep positions; however, given the unique physiology and sleep behaviors characterizing pregnancy, these products are not appropriate for use in sleep-in-pregnancy research. To advance the field of sleep-in-pregnancy efficiently, there is a need for simple, readily accessible research tools that can be easily and widely employed in the home setting by the participant without the need for a research assistant to visit the participant’s home. Herein, we have demonstrated that models can be developed to automatically process any infrared video (e.g., from any available home-surveillance camera) as long as the camera is positioned above the head of the bed. These tools should be accurate. The American Academy of Sleep Medicine’s Manual for the Scoring of Sleep and Associated Events states that body position reporting is “required” for polysomnographic studies and “optional” for home-based studies; however, there is currently no consensus on how accurate body position reporting should be. Despite training our models on less than 10% of our collected dataset, our models achieved an overall [email protected] of 0.76 (0.81 without bed sheets, 0.71 with bed sheets; see Fig 4) in the testing phase on unseen images across 24 classes. The tools must account for factors unique to pregnancy anatomy and physiology including, but not limited to, the impact of the pelvis position on uteroplacental hemodynamics and fetal physiology, the location of the low-pressure, thin-walled, and collapsible IVC on the right side of the spine, and the challenge that pregnancy places on the respiratory system, especially during sleep [19,38], and especially when supine [19,38,88,89]. The models we developed may meet this requirement–we were able to train them to detect sleeping position at a high resolution in that it accounts for the position of the pelvis and the thorax and the direction (right vs. left) at varying degrees (recovery, lateral, tilt) for a total of eleven sleeping postures. The tools, if CVT-based, must be able to compensate for the natural sleeping environment including the presence or absence of a bed partner, bed sheets, pillows, and dark or low-light conditions, which our model partially accounts for but is discussed later as a major limitation of our study. With few exceptions, all performance parameters for detected classes in the absence of bed sheets were equal to or greater than the respective value in the presence of bed sheets (see Fig 4), which was not unanticipated given the expected negative effect on performance of bed sheets obscuring the participant’s body. Sleep in the third trimester is punctuated by frequent position changes due to discomfort and frequent rising to void due to decreased bladder capacity from compression by the gravid uterus–our models can account for this and is trained to detect sitting at the edge of the bed, which signifies entry/exit events. Over the last few years, several vision-based sleeping posture classification studies have been published including Grimm et al. (2016) [90], Liu et al. (2017) [91], Mohammadi et al. (2018) [92], Wang et al. (2019) [93], Li et al. (2022) [94], and Akbarian et al. (2019) [54]. Like Mohammadi et al. [92] and Li et al. [94], we used video from a readily available home-security camera, simulated sleeping position data, and incorporated the presence and absence of bed sheets. Mohammadi et al. [92] used a CNN algorithm (as we did), trained and validated their model using approximately 10,000 images, and completed resampling via leave-one-out (LOO) cross-validation (one participant was “held out”, and a model was trained on the remaining participants, and this was repeated for each participant). Note that LOO cross-validation is a form of k-fold where k (the number of folds) is set equal to the number of samples, n. Similarly, we used a cross-validation approach to resampling but with k-fold cross-validation (with k = 6). We were able to calculate the average recall (“average sensitivity”) from Mohammadi et al.’s testing data as 0.64 (SD 0.10) and 0.79 (SD 0.09) with and without bed sheets, respectively, which is comparable to the average recall across our six models at 0.67 (0.08) and 0.76 (SD 0.09) with and without bed sheets, respectively (see Fig 4). Comparison of Li et al.’s [94] testing performance to ours is not possible because they only present classification accuracy (not recall, precision, nor mAP) but a direct comparison of accuracy is not possible because we cannot compute it for our results–accuracy computation requires the number of true negatives [95], which is not computed by YOLO, which is a detector and does not generate negative predictions. Furthermore, standard research and clinical scoring of body position is limited to left, right, supine, prone, or upright [96]; however, for physiologic reasons unique to pregnancy, our models score body position at a higher resolution by accounting for body twist and hybrid positions (e.g., supine thorax with left pelvic tilt). As such, even if there was consensus on how accurate body position reporting should be, this would need to be extrapolated as eight of our models’ eleven detected sleeping positions are non-standard positions. Our study has two main limitations that prevent our model from being ready for deployment in the real-world. The first limitation is related to our models’ generalization performance due to the biases in the video data. The range of our participants’ BMI’s was relatively narrow and clustered in the normal and overweight category, which limits generalizability to pregnancies with higher BMI categories (e.g., class II obesity), which are common and a specific concern vis-à-vis sleeping position. Our models were built on video data that included only one subject in the bed, which limits our models’ generalizability for multi-subject posture detection. Simultaneous multi-subject posture detection is important given the high prevalence (78–85%) of co-sleeping in pregnancy [22,24]. Moreover, our participants were asked to use thin, pattern-free bed sheets and to clear their beds of any pillows and objects except for head pillows, which is not realistic of the natural sleeping environment in pregnancy where it is common to use multiple pillows (in addition to head pillows) to support one’s body against while sleeping; therefore, it is anticipated that the performance of our model would deteriorate with patterned and/or thick bed sheets (e.g., duvet) and in the presence of a bed partner and multiple pillows. In addition, we did not account for the prone posture; however, note that the occurrence of prone posture during natural sleep in the third trimester is exceedingly rare due to increasing abdominal size [22,23,34–38]. Lastly, our study was relatively small with only 24 participants. As such, our model could benefit from increased heterogeneity in participants and their environments. Currently, we are collecting a real-world video dataset of sleep in pregnancy, which will address each of these issues. The second limitation of this study is related to data protection and privacy considerations with long-term recording of continuous nocturnal video data in the home setting. This issue limits the translation of our models into research (and possibly clinical) practice. A viable and more likely alternative to continuous long-term use is periodic sampling (e.g., recording one night per week throughout the third trimester), which should yield a good surrogate of sleeping position across the third trimester.

Supporting information S1 Appendix. Additional methodological details. https://doi.org/10.1371/journal.pdig.0000353.s001 (PDF) S2 Appendix. Collapsed-resolution model. https://doi.org/10.1371/journal.pdig.0000353.s002 (PDF) S1 Fig. Heatmap of precision, recall, [email protected], and [email protected] (columns) from the testing phase averaged across the six models for each of the predicted collapsed-resolution (CR) classes (rows) under the “without bed sheets” (upper blue row header) and “with bed sheets” condition (lower yellow row header). The value of the respective performance parameter is mapped to a colour spectrum from red to yellow to green where values of 0.50 or less are represented by red at the lower end of the spectrum, values around 0.75 are shades around yellow (oranger if lower than 0.75; greener if higher than 0.75), and values of 0.90 or more are represented by green at the higher end of the spectrum. The “all class average” is provided as the averaged value of the respective performance parameter across the six models’ test sets and the five collapsed-resolution classes under each bed sheets condition, and the combined “24 class average” is given (red column) as the average of the former two values combined. For these “all class average” rows, the value in the [email protected] column is a [email protected], and the value in the [email protected] column is a [email protected] since these values represent averages across multiple classes. https://doi.org/10.1371/journal.pdig.0000353.s003 (TIF)

Acknowledgments The authors would like to acknowledge and thank Ms. Alexandra Gratton for her assistance in design and promotion of recruitment advertisements for this study on social media.

[END]
---
[1] Url: https://journals.plos.org/digitalhealth/article?id=10.1371/journal.pdig.0000353

Published and (C) by PLOS One
Content appears here under this condition or license: Creative Commons - Attribution BY 4.0.

via Magical.Fish Gopher News Feeds:
gopher://magical.fish/1/feeds/news/plosone/