Skip to main content
Advertisement
  • Loading metrics

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

  • Allan J. Kember ,

    Roles Conceptualization, Data curation, Formal analysis, Funding acquisition, Investigation, Methodology, Project administration, Resources, Software, Supervision, Validation, Visualization, Writing – original draft, Writing – review & editing

    allan.kember@mail.utoronto.ca

    Affiliations Department of Obstetrics and Gynaecology, University of Toronto, Toronto, Canada, Institute of Health Policy, Management, and Evaluation, University of Toronto, Toronto, Canada, Shiphrah Biomedical Inc., Toronto, Canada

  • Rahavi Selvarajan,

    Roles Formal analysis, Methodology, Software, Validation, Writing – review & editing

    Affiliation Department of Electrical and Computer Engineering, University of Toronto, Toronto, Canada

  • Emma Park,

    Roles Data curation, Formal analysis, Writing – review & editing

    Affiliation Shiphrah Biomedical Inc., Toronto, Canada

  • Henry Huang,

    Roles Conceptualization, Data curation, Formal analysis, Funding acquisition, Investigation, Methodology, Writing – review & editing

    Affiliation Institute of Biomedical Engineering, University of Toronto, Toronto, Canada

  • Hafsa Zia,

    Roles Data curation, Formal analysis, Writing – review & editing

    Affiliation Temerty Faculty of Medicine, University of Toronto, Toronto, Canada

  • Farhan Rahman,

    Roles Methodology, Software, Writing – review & editing

    Affiliation Department of Electrical and Computer Engineering, University of Toronto, Toronto, Canada

  • Sina Akbarian,

    Roles Conceptualization, Formal analysis, Methodology, Supervision, Writing – review & editing

    Affiliation Vector Institute, Toronto, Canada

  • Babak Taati,

    Roles Conceptualization, Methodology, Supervision, Writing – review & editing

    Affiliations Institute of Biomedical Engineering, University of Toronto, Toronto, Canada, Vector Institute, Toronto, Canada, Department of Computer Science, University of Toronto, Toronto, Canada

  • Sebastian R. Hobson,

    Roles Conceptualization, Methodology, Supervision, Writing – review & editing

    Affiliations Department of Obstetrics and Gynaecology, University of Toronto, Toronto, Canada, Department of Obstetrics and Gynaecology, Maternal-Fetal Medicine Division, Mount Sinai Hospital, Toronto, Canada

  • Elham Dolatabadi

    Roles Conceptualization, Formal analysis, Funding acquisition, Investigation, Methodology, Project administration, Resources, Software, Supervision, Validation, Visualization, Writing – review & editing

    Affiliations Institute of Health Policy, Management, and Evaluation, University of Toronto, Toronto, Canada, Vector Institute, Toronto, Canada

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.

Introduction

Sleep during pregnancy plays a crucial role in maternal and fetal complications as evidenced by prior studies [111]. A supine going-to-sleep position after 28 weeks’ gestation was shown to be associated with more than double the odds of late stillbirth [1217], and more than triple odds of birthing a small-for-gestational age (SGA) infant [1215,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 [2224]. 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 [2733]. 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,3439].

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,4145], 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 [5055]; 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 [5760] 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,6164], the position of the pelvis, owing to its impact on maternal and uteroplacental hemodynamics [27,29,6568], 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 [6971], 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.

Materials & methods

Design

This study can be conceptualized as a cross-sectional design in which video data of simulated sleeping positions was prospectively collected over a period of five to ten minutes. No methodological changes were made after the study’s commencement.

Patient and public involvement

Development of the research question and outcome measures, design of the study, recruitment process, and conduct of the study were completed by the researchers without the involvement of the public or patients. Participants in this study indicated whether they wished to receive a summary of the overall study results during the informed consent process.

Participants

Participants were recruited Canada-wide by the researchers via various social media platforms (Instagram, Facebook, LinkedIn, and Twitter) and an app for research study participation (Honeybee). Snowball sampling was also used in which participants who completed their participation in the study invited their friends and family members who also may have been eligible to participate in contacting the researchers. All contact between the researchers and participants was virtual (i.e., no in-person or face-to-face contact given the ongoing COVID-19 pandemic). All data collection was completed within the participants’ own homes.

Participants were eligible to participate in the study if they were healthy (self-reported), had a low-risk singleton pregnancy, were in the third trimester of pregnancy (between 28 weeks’ and 0 days through 40 weeks and 6 days gestation, inclusive, by first-trimester ultrasound), were aged 18 to 50 years, had access to an Android or iPhone device, and had a secure 2.4 GHz network (WiFi or cellular data plan) in their home. Exclusion criteria included non-English speaking, reading, or writing and a musculoskeletal condition preventing simulation of sleeping positions.

Interventions

The consent process was completed via a virtual meeting (telephone or Zoom), and eligible participants gave voluntary, written, informed consent to participate in the study. Basic demographic data was collected from each participant including, name, mailing address, age, gestational age, height, and weight. No additional personal health information was accessed or shared because linkage to clinical outcomes was beyond the scope of this study. Each participant was then mailed a study kit containing sanitized study equipment.

A virtual meeting was held with each participant to describe the specific study protocol and instructions including assisting in equipment setup and data collection. Each participant installed an infrared home-surveillance camera (Wyze Cam V2 by Wyze Labs, Inc., Seattle, USA) by attaching it to the wall, centered at the head of their bed and 1.6 to 1.7 meters above the sleeping surface, to clearly capture all pertinent data. The participant then shared the video feed of the Wyze Cam with the researcher via the Wyze smartphone app, and the researcher provided instructions in real-time to the participant. The participant was assisted in taking two short video clips of themself in twelve different simulated body positions. We used a simulated position approach to data collection to create a highly heterogeneous dataset for CVT model building. See the supplementary file S1 Appendix for a justification of why recordings of natural sleep were not used.

Each participant simulated the body positions while lying in their bed in the dark and fully clothed. The participant was asked to use a bed sheet with no patterns and remove all pillows and objects from the bed except for head pillows. The participant simulated each of the twelve positions for ten seconds per position (recorded at 10 frames per second, fps), first without bed sheets covering her body, and subsequently with bed sheets covering her body. While simulating each position, the participant was asked to move her head, arms, and legs constantly while maintaining the position with her body. The individual who appears in the images in this manuscript has given written informed consent (as outlined in PLOS consent form) to publish their photos. The twelve simulated positions, eleven of which are sleeping positions and one of which is a transitional position, were (see Fig 1): left recovery (P1), left lateral (P2), left tilt (P3), supine (P4), supine thorax with left pelvic tilt (P5), supine thorax with right pelvic tilt (P6), supine pelvis with left thorax tilt (P7), supine pelvis with right thorax tilt (P8), right tilt (P9), right lateral (P10), right recovery (P11), and sitting up at the edge of the bed (P12). All “tilt” positions were tilted in the lateral direction (i.e., rotated about a string connecting the head to the feet) and were simulated at approximately 45° above the horizontal plane–to achieve this angle, participants were instructed to tilt their body “45°, that is, half-way between completely on your side and flat on your back”. When the simulation was complete, each participant uploaded her video clips to the research team’s secure cloud server for analysis and storage.

thumbnail
Fig 1. Twelve simulated positions. Example of each of the twelve simulated positions, P1 through P12, without a bed covering the participant’s body.

https://doi.org/10.1371/journal.pdig.0000353.g001

Outcomes

Not applicable.

Sample size

A formal sample size calculation was not performed. We determined a target sample size of N = 20, which was informed by the study budget and timeline.

Statistical methods

We assessed normality of continuous variables via the Shapiro-Wilk test at a 0.05 significance level. Normally distributed continuous variables are presented as “mean ± standard deviation”, and non-normally distributed continuous variables are presented as “median (interquartile range)”. Statistical analyses were conducted using the R Statistical Software package (R version 4.1.1 (2021-08-10) — "Kick Things") [74].

Computer vision model development

Dataset development and annotation.

First, all video recordings were converted to a sequence of frames at a rate of 10 fps using an open-source video and audio processing software, FFmpeg [75], (refer to Fig 2). All extracted frames were then manually reviewed and sorted into the twelve unique postures, shown in Fig 1, with and without bed sheets (24 classes in total).

thumbnail
Fig 2. Schematic representation of dataset development and annotation and model development and evaluation.

Frames were extracted from video recordings via FFMPEG and manually reviewed to classify them into the twelve positions without bed sheets and with bed sheets covering the body. Low-quality frames and frames without a participant (negatives) were set aside. The manually sorted frames were then semi-randomly down-sampled and localization and annotations were then completed with LabelImg. The negative frames were augmented using the ImageDataGenerator class in the Keras library and were then combined with the annotated frames in the training and validation phase, which was by six-fold cross-validation on a virtual GPU (NVIDIA Tesla P100 on Google Colab) using YOLOv5s by Ultralytics and pre-trained weights from the COCO dataset. The weights of the model in each loop of the cross-validation that achieved the best mAP on the validation set were saved as the best weights. Performance evaluation for each loop was completed on the testing set using the best weights, and the performance was evaluated by computing the mAP, precision, and recall. Various classes with similar anatomic and hemodynamic implications on uteroplacental perfusion were subsequently combined, which resulted in a simpler, collapsed-resolution (CR) condition (see the supplementary file S2 Appendix).

https://doi.org/10.1371/journal.pdig.0000353.g002

Next, all low-quality frames were excluded from the dataset. Low-quality frames included frames in which there was static posing (no movement between subsequent frames), minimal movement between subsequent frames, unidentifiable postures, transitions between postures, low image resolution, and glitches in the video recording.

Moreover, frames in which there was no participant in the field of view (i.e., the object being detected was not in the frame), which we refer to as “negative frames”, were set aside to be used as negative frames (background) in the training dataset [76].

The remaining frames were semi-randomly down-sampled such that there were approximately 10 frames per class per participant for annotation. Annotation included localization of the participant’s body within the frame and labeling of the body posture occurring in the frame. An open-source annotation tool, LabelImg [77], was used to localize the participant’s body in each frame via a rectangular bounding box that touched the edges of their body. As such, the development dataset to be used for model training and evaluation included the annotated (labeled) dataset and the negative frames (non-labeled).

Model development and evaluation.

We framed the detection of sleeping position in bed as a multi-class classification (24 classes) where state-of-the-art deep learning Convolutional Neural Networks were used. In this regard, we used YOLOv5s with 7.5M parameters [78,79] including pre-trained weights from the COCO dataset and fine-tuned it on our annotated dataset to make predictions of classes. We trained our deep learning models on an NVIDIA Tesla P100 GPU virtual machine running on Google Colab Pro Plus using the PyTorch framework with a batch size of 16 and early stopping criteria [80,81].

During training, we disabled “flip augmentation” in the YOLO configuration file because we wanted our model to distinguish left and right sleeping positions as separate classes. The clinical rationale for distinguishing between left and right as separate classes is that while the human body looks symmetrical on the outside, it is not anatomically symmetrical on the inside, which has physiologic implications. On the inside, the relatively thick-walled and high-pressure aorta runs down the left side of the spinal column whereas the relatively thin-walled and low-pressure IVC runs up the right side of the spinal column. As such, the left lateral and tilt positions are not likely hemodynamically equivalent to the right lateral and tilt positions, and tilting from the supine position to the right tilt position may actually worsen the compression of the IVC (rather than relieving it like tilting to the left does) and reduces cardiac output, and this effect is supported by several studies [8287].

Using k-fold cross-validation, the participants and pertaining frames were randomly split into six non-overlapping folds (k = 6) of equal size (equal number of participants). In each loop of the cross-validation, four folds were used for training (“training set”), one fold was used for validation (“validation set”), and one fold was held out for testing (“testing set”). For each training loop, the weights that achieved the highest mean average precision (mAP) estimate across all classes on the validation set were saved. Six loops of the cross-validation procedure were completed such that each fold was given a turn to be the validation set and testing set. Finally, performance evaluation was completed using the best weights on the testing set for each loop, and precision, recall, and average precision (AP) at different intersections over union (IoU, described below) were calculated and compared across each class.

The precision for a class is the precision average across all recall (sensitivities) values between 0 and 1 at various IoU thresholds. The IoU is the area of overlap between the predicted object location and the ground truth location divided by the area of union (the total area of both the prediction and ground truth combined). During object detection, the IoU is calculated to determine whether the object is correctly detected or not. By interpolating across all points, the AP can be interpreted as the area under the curve of the precision-recall curve. For each class, we also report the AP@0.50 and the AP@.50-.95. The 0.50 in “AP@0.50” is the IoU threshold value. If the predicted IoU is greater than or equal to the threshold, it is considered a true positive. As such, the AP@0.5 means that the AP is calculated for the objects predicted with an IoU value of 0.50 or greater. The AP@.50-.95, similar to the previous definition, means the AP is calculated by considering multiple threshold values between 0.50 and 0.95 and averaging them across all those thresholds. For a given class, a very high value for AP@.50-.95 indicates that the model is more confident about its predictions. The mean average precision (mAP) across all classes was calculated by taking the mean of the AP’s across all classes being predicted by the model.

See the supplementary file S1 Appendix for more details regarding the rationale for a simulated posture study design, bias-variance trade-off in k-fold cross-validation, selection of YOLOv5s, early stopping criteria, and definitions of precision and recall.

In addition, we presented the performance evaluation of the models from each loop under a collapsed resolution (CR) condition where we reduced the total number of classes by combining classes with similar anatomic and hemodynamic implications from the perspective of uteroplacental perfusion (see the supplementary files S2 Appendix and S1 Fig).

Ethics

This study was approved by the University of Toronto Health Sciences Research Ethics Board in June 2021 (Protocol No. 27465). Written informed consent was given by all study participants.

Results

From July 5th, 2021 through September 22nd, 2021, 39 participants were assessed for eligibility. Of these, 12 (31%) were not recruited (2 gave birth prior to giving written informed consent, 1 was excluded due to twin pregnancy, and the remaining 9 declined participation)–we did not collect any data from these. Of the 27 (69%) participants that met the eligibility criteria and gave written informed consent to participate in the study, 24 (89%) successfully completed the study. Two (7%) gave birth prior to completing data collection, and one (3%) was excluded by the researchers due to irremediable technical difficulties.

Demographic characteristics

Demographic characteristics of the 24 participants included in our model are shown in Table 1. Age and height were not normally distributed and had medians of 29 years and 1.64 meters, respectively.

thumbnail
Table 1. Demographic characteristics of participants (n = 24) included in the computer vision model.

https://doi.org/10.1371/journal.pdig.0000353.t001

Dataset

We collected 257.12 minutes of infrared 1080P video at 10 frames-per-second from which we extracted a total of 152,618 frames. Of these, 82,251 frames (53.9%, 137.33 minutes) were recorded with no bed sheets covering the body, and 70,367 (46.1%, 119.78 minutes) were recorded with bed sheets covering the body. Of the total 152,618 frames, 88,793 (58.2%) were low-quality frames and 206 (0.1%) were negative frames, which left 63,619 (41.7%) frames for annotation with the 24 classes. Of these 63,619 frames, 33,190 (52.2%) frames were with no bed sheets and 30,429 (47.8%) were with bed sheets. See Table 2 for the number of frames extracted and manually sorted for each class without bed sheets and with bed sheets.

thumbnail
Table 2. Total number of frames extracted for each class.

https://doi.org/10.1371/journal.pdig.0000353.t002

Models

Our development set included 5970 annotated frames and 206 negative frames. We used six-fold cross validation for model training and evaluation. See Table 3 for a summary of the training and validation, which is given for reference purposes. The summary includes, for each loop of the cross-validation, the number of validation frames, the number of training epochs completed prior to activation of the early stopping criteria, the epoch with the best results (highest validation mAP@0.50), and the performance parameters (validation precision, validation recall, validation mAP@0.50, and validation mAP@.50-.95) corresponding to the best results and across the 24 classes (12 classes with bed sheets covering the body, 12 classes without bed sheets covering the body).

thumbnail
Table 3. Summary of validation and performance parameters (validation precision, validation recall, validation mAP@0.50, and validation mAP@.50-.95) during training and validation of six models via six-fold cross-validation, across 24 classes (12 classes with bed sheets covering the body, 12 class without bed sheets covering the body).

https://doi.org/10.1371/journal.pdig.0000353.t003

Table 4 provides a summary of the testing of each of the six models produced from the six-fold cross-validation. These six models are defined by the weights achieving the highest validation mAP@0.50 during the training and validation phase. For each model, the number of testing frames in the testing set, number of testing instances, and performance parameters (testing precision, testing recall, testing mAP@0.50, and testing mAP@.50-.95) across 24 classes (12 classes with bed sheets covering the body, 12 class without bed sheets covering the body) are presented.

thumbnail
Table 4. Summary of testing and performance parameters (testing precision, testing recall, testing mAP@0.50, and testing mAP@.50-.95) during testing of the six models produced by six-fold cross-validation, across 24 classes (12 classes with bed sheets covering the body, 12 class without bed sheets covering the body).

https://doi.org/10.1371/journal.pdig.0000353.t004

Fig 3 shows an elaboration of the results in Table 4 by presenting a grouped bar chart, and Fig 4 shows these results via a heat map. In Fig 3, the grouped bar chart shows the four performance parameters–precision, recall, mAP@0.50, and mAP@.50-.95 –from the testing phase across the six models’ testing sets and across all classes under three different conditions: (1) Red bar: a combination of the “with bed sheets” and “without bed sheets” conditions (24 classes). (2) Blue bar: the “without bed sheets” condition (12 classes). (3) Yellow bar: the “with bed sheets” condition (12 classes). The error bars represent one standard deviation of the respective value across all measures, which reflects the variability both across models (n = 6) and classes (n = 24 for combined condition; n = 12 for the without and with bed sheets conditions). In Fig 4, the heatmap shows the four performance parameters (columns)–precision, recall, AP@0.50, and AP@.50-.95 –from the testing phase averaged across the six models’ test sets for each of the predicted classes (rows) under the “without bed sheets” and “with bed sheets” condition. The “all class average” is provided as the averaged value of the respective performance parameter across the six models’ test sets and the 12 classes under each bed sheets condition, and the “combined 24 class average” is given as the average of the former two values combined.

thumbnail
Fig 3. Grouped bar charts of performance parameters from the testing phase (precision, recall, mAP@0.50, and mAP@.50-.95) averaged across the six models’ testing sets and across all classes, where the parameters are presented under three conditions.

(1) Red bar: averaged across all classes as a combination of the “with bed sheets” and “without bed sheets” conditions (24 classes). (2) Blue bar: averaged across all classes under the “without bed sheets” condition (12 classes). (3) Yellow bar: averaged across all classes under the “with bed sheets” condition (12 classes). The error bars represent one standard deviation of the respective value across all measures, which reflects the variability both across models and classes.

https://doi.org/10.1371/journal.pdig.0000353.g003

thumbnail
Fig 4. Heatmap of precision, recall, AP@0.50, and AP@.50-.95 (columns) from the testing phase averaged across the six models’ test sets for each of the predicted 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 color 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 12 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 the “all class average” rows, the value in the AP@0.50 column is the mAP@0.50, and the value in the AP@.50-.95 column is the mAP@.50-.95 since these values represent averages across multiple classes.

https://doi.org/10.1371/journal.pdig.0000353.g004

On a per-condition basis, higher and more consistent values of performance were generally achieved under the “without bed sheets” condition, whereas the values for “with bed sheets” conditions were lower and had higher variability. On a per-class basis under the “without bed sheets” condition, the recovery classes had higher values (≥0.90) of AP@0.50, and the lateral, supine, and supine hybrid classes had values between 0.80 to 0.90, whereas non-hybrid tilted (left tilt, right tilt), sitting, and supine thorax with left pelvic tilt generally had lower (<0.80) AP@0.50 as averaged across the six models. When the “with bed sheets” condition is considered, the recovery classes maintained higher values (≥0.80) of AP@0.50, whereas the left lateral, supine hybrid, and sitting classes had values between 0.70 to 0.80, and the right lateral, non-hybrid tilted (left tilt, right tilt), supine, and supine pelvis with right thorax tilt classes generally had lower (<0.70) AP@0.50 as averaged across the six models. An enduring pattern with regard to the AP@0.50 across models for the “without bed sheets” and “with bed sheets” conditions is that the recovery classes scored high and non-hybrid tilted (left tilt, right tilt) classes scored low.

Fig 5 displays a running example using one of our trained models to localize and classify the sleeping position of a study participant. As shown in the figure, the participant’s body on the bed is localized by the colored bounding box. Moreover, the prediction of the sleeping position along with its confidence score (between 0 and 1) are shown at the top of each bounding box.

thumbnail
Fig 5. Example output of one of our trained models to localize and classify the sleeping position of a study participant.

Ground truth localizations and labels are on the left. Model predictions of localizations and labels are on the right.

https://doi.org/10.1371/journal.pdig.0000353.g005

Harms

There were no known harms related to this study. The time spent supine and in positions with a supine pelvis, while simulated in both video clips for each participant, was minimal. No participants reported symptoms of supine hypotensive syndrome.

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 mAP@0.50 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,3438]. 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 Fig. Heatmap of precision, recall, AP@0.50, and AP@.50-.95 (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 AP@0.50 column is a mAP@0.50, and the value in the AP@.50-.95 column is a mAP@.50-.95 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.

References

  1. 1. Romero R, Badr MS. A Role for Sleep Disorders in Pregnancy Complications: Challenges and Opportunities. Am J Obstet Gynecol. 2014;210: 3–11. pmid:24359866
  2. 2. Ding X-X, Wu Y-L, Xu S-J, Zhang S-F, Jia X-M, Zhu R-P, et al. A systematic review and quantitative assessment of sleep-disordered breathing during pregnancy and perinatal outcomes. Sleep Breath Schlaf Atm. 2014;18: 703–713. pmid:24519711
  3. 3. Li L, Zhao K, Hua J, Li S. Association between Sleep-Disordered Breathing during Pregnancy and Maternal and Fetal Outcomes: An Updated Systematic Review and Meta-Analysis. Front Neurol. 2018;9: 91. pmid:29892255
  4. 4. Warland J, Dorrian J, Morrison JL, O’Brien LM. Maternal sleep during pregnancy and poor fetal outcomes: A scoping review of the literature with meta-analysis. Sleep Med Rev. 2018;41: 197–219. pmid:29910107
  5. 5. Pamidi S, Pinto LM, Marc I, Benedetti A, Schwartzman K, Kimoff RJ. Maternal sleep-disordered breathing and adverse pregnancy outcomes: a systematic review and metaanalysis. Am J Obstet Gynecol. 2014;210: 52.e1-52.e14. pmid:23911687
  6. 6. Xu T, Feng Y, Peng H, Guo D, Li T. Obstructive sleep apnea and the risk of perinatal outcomes: a meta-analysis of cohort studies. Sci Rep. 2014;4: 6982. pmid:25382105
  7. 7. Pien GW, Schwab RJ. Sleep disorders during pregnancy. Sleep. 2004;27: 1405–1417. pmid:15586794
  8. 8. Lu Q, Zhang X, Wang Y, Li J, Xu Y, Song X, et al. Sleep disturbances during pregnancy and adverse maternal and fetal outcomes: A systematic review and meta-analysis. Sleep Med Rev. 2021;58: 101436. pmid:33571887
  9. 9. Luque-Fernandez MA, Bain PA, Gelaye B, Redline S, Williams MA. Sleep-disordered breathing and gestational diabetes mellitus: a meta-analysis of 9,795 participants enrolled in epidemiological observational studies. Diabetes Care. 2013;36: 3353–3360. pmid:24065843
  10. 10. Brown NT, Turner JM, Kumar S. The intrapartum and perinatal risks of sleep-disordered breathing in pregnancy: a systematic review and metaanalysis. Am J Obstet Gynecol. 2018;219: 147–161.e1. pmid:29454869
  11. 11. Liu L, Su G, Wang S, Zhu B. The prevalence of obstructive sleep apnea and its association with pregnancy-related health outcomes: a systematic review and meta-analysis. Sleep Breath Schlaf Atm. 2019;23: 399–412. pmid:30255484
  12. 12. Stacey T, Thompson JMD, Mitchell EA, Ekeroma AJ, Zuccollo JM, McCowan LME. Association between maternal sleep practices and risk of late stillbirth: a case-control study. BMJ. 2011;342: d3403. pmid:21673002
  13. 13. Gordon A, Raynes-Greenow C, Bond D, Morris J, Rawlinson W, Jeffery H. Sleep position, fetal growth restriction, and late-pregnancy stillbirth: the Sydney stillbirth study. Obstet Gynecol. 2015;125: 347–355. pmid:25568999
  14. 14. McCowan LME, Thompson JMD, Cronin RS, Li M, Stacey T, Stone PR, et al. Going to sleep in the supine position is a modifiable risk factor for late pregnancy stillbirth; Findings from the New Zealand multicentre stillbirth case-control study. PLoS ONE. 2017;12: e0179396. pmid:28609468
  15. 15. Heazell A, Li M, Budd J, Thompson J, Stacey T, Cronin RS, et al. Association between maternal sleep practices and late stillbirth—findings from a stillbirth case-control study. BJOG Int J Obstet Gynaecol. 2018;125: 254–262. pmid:29152887
  16. 16. O’Brien LM, Warland J, Stacey T, Heazell AEP, Mitchell EA, STARS Consortium. Maternal sleep practices and stillbirth: Findings from an international case-control study. Birth Berkeley Calif. 2019;46: 344–354. pmid:30656734
  17. 17. Cronin RS, Li M, Thompson JMD, Gordon A, Raynes-Greenow CH, Heazell AEP, et al. An Individual Participant Data Meta-analysis of Maternal Going-to-Sleep Position, Interactions with Fetal Vulnerability, and the Risk of Late Stillbirth. EClinicalMedicine. 2019;10: 49–57. pmid:31193832
  18. 18. Anderson NH, Gordon A, Li M, Cronin RS, Thompson JMD, Raynes-Greenow CH, et al. Association of Supine Going-to-Sleep Position in Late Pregnancy With Reduced Birth Weight. JAMA Netw Open. 2019;2: e1912614. pmid:31577362
  19. 19. Wilson DL, Fung AM, Pell G, Skrzypek H, Barnes M, Bourjeily G, et al. Polysomnographic analysis of maternal sleep position and its relationship to pregnancy complications and sleep-disordered breathing. Sleep. 2022;45: zsac032. pmid:35150285
  20. 20. Flenady V, Wojcieszek AM, Middleton P, Ellwood D, Erwich JJ, Coory M, et al. Stillbirths: recall to action in high-income countries. Lancet Lond Engl. 2016;387: 691–702. pmid:26794070
  21. 21. Lawn JE, Blencowe H, Waiswa P, Amouzou A, Mathers C, Hogan D, et al. Stillbirths: rates, risk factors, and acceleration towards 2030. Lancet Lond Engl. 2016;387: 587–603. pmid:26794078
  22. 22. Kember AJ, Scott HM, O’Brien LM, Borazjani A, Butler MB, Wells JH, et al. Modifying maternal sleep position in the third trimester of pregnancy with positional therapy: a randomised pilot trial. BMJ Open. 2018;8: e020256. pmid:30158217
  23. 23. Warland J, Dorrian J, Kember AJ, Phillips C, Borazjani A, Morrison JL, et al. Modifying Maternal Sleep Position in Late Pregnancy Through Positional Therapy: A Feasibility Study. J Clin Sleep Med JCSM Off Publ Am Acad Sleep Med. 2018;14: 1387–1397. pmid:30092890
  24. 24. Coleman J, Okere M, Seffah J, Kember A, O’Brien LM, Borazjani A, et al. The Ghana PrenaBelt trial: a double-blind, sham-controlled, randomised clinical trial to evaluate the effect of maternal positional therapy during third-trimester sleep on birth weight. BMJ Open. 2019;9: e022981. pmid:31048420
  25. 25. Flenady V, Koopmans L, Middleton P, Frøen JF, Smith GC, Gibbons K, et al. Major risk factors for stillbirth in high-income countries: a systematic review and meta-analysis. The Lancet. 2011;377: 1331–1340. pmid:21496916
  26. 26. Schummers L, Hutcheon JA, Bodnar LM, Lieberman E, Himes KP. Risk of adverse pregnancy outcomes by prepregnancy body mass index: a population-based study to inform prepregnancy weight loss counseling. Obstet Gynecol. 2015;125: 133–143. pmid:25560115
  27. 27. Couper S, Clark A, Thompson JMD, Flouri D, Aughwane R, David AL, et al. The effects of maternal position, in late gestation pregnancy, on placental blood flow and oxygenation: an MRI study. J Physiol. 2021;599: 1901–1915. pmid:33369732
  28. 28. Humphries A, Mirjalili SA, Tarr GP, Thompson JMD, Stone P. The effect of supine positioning on maternal hemodynamics during late pregnancy. J Matern-Fetal Neonatal Med Off J Eur Assoc Perinat Med Fed Asia Ocean Perinat Soc Int Soc Perinat Obstet. 2019;32: 3923–3930. pmid:29772936
  29. 29. Stone PR, Burgess W, McIntyre JPR, Gunn AJ, Lear CA, Bennet L, et al. Effect of maternal position on fetal behavioural state and heart rate variability in healthy late gestation pregnancy. J Physiol. 2017;595: 1213–1221. pmid:27871127
  30. 30. Kienzl D, Berger-Kulemann V, Kasprian G, Brugger PC, Weber M, Bettelheim D, et al. Risk of inferior vena cava compression syndrome during fetal MRI in the supine position–a retrospective analysis. J Perinat Med. 2014;42: 301–306. pmid:24246284
  31. 31. De-Giorgio F, Grassi VM, Vetrugno G, d’Aloja E, Pascali VL, Arena V. Supine Hypotensive Syndrome as the Probable Cause of Both Maternal and Fetal Death. J Forensic Sci. 2012;57: 1646–1649. pmid:22537582
  32. 32. Rossi A, Cornette J, Johnson MR, Karamermer Y, Springeling T, Opic P, et al. Quantitative cardiovascular magnetic resonance in pregnant women: cross-sectional analysis of physiological parameters throughout pregnancy and the impact of the supine position. J Cardiovasc Magn Reson Off J Soc Cardiovasc Magn Reson. 2011;13: 31. pmid:21708015
  33. 33. Higuchi H, Takagi S, Zhang K, Furui I, Ozaki M. Effect of lateral tilt angle on the volume of the abdominal aorta and inferior vena cava in pregnant and nonpregnant women determined by magnetic resonance imaging. Anesthesiology. 2015;122: 286–293. pmid:25603203
  34. 34. McIntyre JPR, Ingham CM, Hutchinson BL, Thompson JMD, McCowan LM, Stone PR, et al. A description of sleep behaviour in healthy late pregnancy, and the accuracy of self-reports. BMC Pregnancy Childbirth. 2016;16: 115. pmid:27194093
  35. 35. Warland J, Dorrian J. Accuracy of Self-Reported Sleep Position in Late Pregnancy. PLOS ONE. 2014;9: e115760. pmid:25535960
  36. 36. O’Brien LM, Warland J. Typical sleep positions in pregnant women. Early Hum Dev. 2014;90: 315–317. pmid:24661447
  37. 37. Wilson DL, Barnes M, Ellett L, Permezel M, Jackson M, Crowe SF. Decreased sleep efficiency, increased wake after sleep onset and increased cortical arousals in late pregnancy. Aust N Z J Obstet Gynaecol. 2011;51: 38–46. pmid:21299507
  38. 38. Dunietz GL, Sever O, DeRowe A, Tauman R. Sleep position and breathing in late pregnancy and perinatal outcomes. J Clin Sleep Med. 2020;16: 955–959. pmid:32118576
  39. 39. Maasilta P, Bachour A, Teramo K, Polo O, Laitinen LA. Sleep-related disordered breathing during pregnancy in obese women. Chest. 2001;120: 1448–1454. pmid:11713118
  40. 40. National Institute for Health and Care Excellence, National Guideline Alliance, Royal College of Obstetricians and Gynaecologists. Antenatal Care: [W] Maternal sleep position during pregnancy—NICE guideline NG201—Evidence reviews underpinning recommendations 1.3.24 to 1.3.25. 2021. Available: https://www.ncbi.nlm.nih.gov/books/NBK573947/pdf/Bookshelf_NBK573947.pdf
  41. 41. Herring SJ, Foster GD, Pien GW, Massa K, Nelson DB, Gehrman PR, et al. Do pregnant women accurately report sleep time? Sleep Breath Schlaf Atm. 2013;17: 10.1007/s11325-013-0835–2. pmid:23563909
  42. 42. Wilson DL, Fung A, Walker SP, Barnes M. Subjective reports versus objective measurement of sleep latency and sleep duration in pregnancy. Behav Sleep Med. 2013;11: 207–221. pmid:23205562
  43. 43. Russo K, Bianchi MT. How Reliable Is Self-Reported Body Position during Sleep? J Clin Sleep Med JCSM Off Publ Am Acad Sleep Med. 2016;12: 127–128. pmid:26518704
  44. 44. Berndt C, Diekelmann S, Alexander N, Pustal A, Kirschbaum C. Sleep fragmentation and false memories during pregnancy and motherhood. Behav Brain Res. 2014;266: 52–57. pmid:24589545
  45. 45. Zinke K, Lehnert V, Fritsche A, Preissl H, Hallschmid M. Pregnant women do not display impaired memory formation across one night of sleep. J Sleep Res. 2021;30: e13204. pmid:32985760
  46. 46. Skarpsno ES, Mork PJ, Nilsen TIL, Holtermann A. Sleep positions and nocturnal body movements based on free-living accelerometer recordings: association with demographics, lifestyle, and insomnia symptoms. Nat Sci Sleep. 2017;9: 267–275. pmid:29138608
  47. 47. Kai-Ching Yu C. Why is Self-Report of Sleep Position Sometimes Unreliable? Sleep Hypn—Int J. 2017 [cited 19 Aug 2021].
  48. 48. How Artificial Intelligence Revolutionized Computer Vision: A Brief History. In: Motion Metrics [Internet]. 16 May 2019 [cited 26 Jul 2021]. Available: https://www.motionmetrics.com/how-artificial-intelligence-revolutionized-computer-vision-a-brief-history/
  49. 49. Szeliski R. Computer Vision: Algorithms and Applications. 2nd ed. London: Springer London; 2021. https://doi.org/10.1007/978-1-84882-935-0
  50. 50. Aroeira RMC, de Las Casas EB, Pertence AEM, Greco M, Tavares JMRS. Non-invasive methods of computer vision in the posture evaluation of adolescent idiopathic scoliosis. J Bodyw Mov Ther. 2016;20: 832–843. pmid:27814864
  51. 51. Li MH, Yadollahi A, Taati B. Noncontact Vision-Based Cardiopulmonary Monitoring in Different Sleeping Positions. IEEE J Biomed Health Inform. 2017;21: 1367–1375. pmid:28113736
  52. 52. Akbarian S, Ghahjaverestan NM, Yadollahi A, Taati B. Noncontact Sleep Monitoring With Infrared Video Data to Estimate Sleep Apnea Severity and Distinguish Between Positional and Nonpositional Sleep Apnea: Model Development and Experimental Validation. J Med Internet Res. 2021;23: e26524. pmid:34723817
  53. 53. Akbarian S, Montazeri Ghahjaverestan N, Yadollahi A, Taati B. Distinguishing Obstructive Versus Central Apneas in Infrared Video of Sleep Using Deep Learning: Validation Study. J Med Internet Res. 2020;22: e17252. pmid:32441656
  54. 54. Akbarian S, Delfi G, Zhu K, Yadollahi A, Taati B. Automated Non-Contact Detection of Head and Body Positions During Sleep. IEEE Access. 2019;7: 72826–72834.
  55. 55. Zhu K, Li M, Akbarian S, Hafezi M, Yadollahi A, Taati B. Vision-Based Heart and Respiratory Rate Monitoring During Sleep–A Validation Study for the Population at Risk of Sleep Apnea. IEEE J Transl Eng Health Med. 2019;7: 1–8. pmid:32166048
  56. 56. Yue S, Yang Y, Wang H, Rahul H, Katabi D. BodyCompass: Monitoring Sleep Posture with Wireless Signals. Proc ACM Interact Mob Wearable Ubiquitous Technol. 2020;4: 66:1–66:25.
  57. 57. Ferrer-Lluis I, Castillo-Escario Y, Montserrat JM, Jané R. SleepPos App: An Automated Smartphone Application for Angle Based High Resolution Sleep Position Monitoring and Treatment. Sensors. 2021;21: 4531. pmid:34282793
  58. 58. Ferrer-Lluis I, Castillo-Escario Y, Montserrat JM, Jané R. Enhanced Monitoring of Sleep Position in Sleep Apnea Patients: Smartphone Triaxial Accelerometry Compared with Video-Validated Position from Polysomnography. Sensors. 2021;21: 3689. pmid:34073215
  59. 59. Ferrer-Lluis I, Castillo-Escario Y, Montserrat JM, Jané R. Analysis of Smartphone Triaxial Accelerometry for Monitoring Sleep-Disordered Breathing and Sleep Position at Home. IEEE Access. 2020;8: 71231–71244.
  60. 60. Castillo-Escario Y, Ferrer-Lluis I, Montserrat JM, Jané R. Entropy Analysis of Acoustic Signals Recorded With a Smartphone for Detecting Apneas and Hypopneas: A Comparison With a Commercial System for Home Sleep Apnea Diagnosis. IEEE Access. 2019;7: 128224–128241.
  61. 61. Loube DI, Poceta JS, Morales MC, Peacock MD, Mitler MM. Self-reported snoring in pregnancy. Association with fetal outcome. Chest. 1996;109: 885–889. pmid:8635365
  62. 62. Oksenberg A, Dynia A, Nasser K, Gadoth N. Obstructive sleep apnoea in adults: body postures and weight changes interactions. J Sleep Res. 2012;21: 402–409. pmid:22211627
  63. 63. Jung S, Zaremba S, Heisig A, Eikermann M. Elevated body position early after delivery increased airway size during wakefulness, and decreased apnea hypopnea index in a woman with pregnancy related sleep apnea. J Clin Sleep Med JCSM Off Publ Am Acad Sleep Med. 2014;10: 815–817. pmid:25024663
  64. 64. Zaremba S, Mueller N, Heisig AM, Shin CH, Jung S, Leffert LR, et al. Elevated upper body position improves pregnancy-related OSA without impairing sleep quality or sleep architecture early after delivery. Chest. 2015;148: 936–944. pmid:25905714
  65. 65. Khatib N, Weiner Z, Beloosesky R, Vitner D, Thaler I. The effect of maternal supine position on umbilical and cerebral blood flow indices. Eur J Obstet Gynecol Reprod Biol. 2014;175: 112–114. pmid:24491277
  66. 66. Nakai Y, Mine M, Nishio J, Maeda T, Imanaka M, Ogita S. Effects of maternal prone position on the umbilical arterial flow. Acta Obstet Gynecol Scand. 1998;77: 967–969. pmid:9849838
  67. 67. Ryo E, Okai T, Kozuma S, Kobayashi K, Kikuchi A, Taketani Y. Influence of compression of the inferior vena cava in the late second trimester on uterine and umbilical artery blood flow. Int J Gynaecol Obstet Off Organ Int Fed Gynaecol Obstet. 1996;55: 213–218. pmid:9003945
  68. 68. Abaci Turk E, Abulnaga SM, Luo J, Stout JN, Feldman HA, Turk A, et al. Placental MRI: Effect of maternal position and uterine contractions on placental BOLD MRI measurements. Placenta. 2020;95: 69–77. pmid:32452404
  69. 69. Sahin FK, Koken G, Cosar E, Saylan F, Fidan F, Yilmazer M, et al. Obstructive sleep apnea in pregnancy and fetal outcome. Int J Gynaecol Obstet Off Organ Int Fed Gynaecol Obstet. 2008;100: 141–146. pmid:17976624
  70. 70. Fung AM, Wilson DL, Lappas M, Howard M, Barnes M, O’Donoghue F, et al. Effects of maternal obstructive sleep apnoea on fetal growth: a prospective cohort study. PloS One. 2013;8: e68057. pmid:23894293
  71. 71. Wilson DL, Howard ME, Fung AM, O’Donoghue FJ, Barnes M, Lappas M, et al. The presence of coexisting sleep-disordered breathing among women with hypertensive disorders of pregnancy does not worsen perinatal outcome. PloS One. 2020;15: e0229568. pmid:32101584
  72. 72. Olivarez SA, Maheshwari B, McCarthy M, Zacharias N, van den Veyver I, Casturi L, et al. Prospective trial on obstructive sleep apnea in pregnancy and fetal heart rate monitoring. Am J Obstet Gynecol. 2010;202: 552.e1–7. pmid:20171603
  73. 73. Lucchini M, Wapner RJ, Chia-Ling N-C, Torres C, Yang J, Williams IA, et al. Effects of maternal sleep position on fetal and maternal heart rate patterns using overnight home fetal ECG recordings. Int J Gynaecol Obstet Off Organ Int Fed Gynaecol Obstet. 2020;149: 82–87. pmid:31912893
  74. 74. The R Foundation for Statistical Computing. R Statistical Software. 2021.
  75. 75. FFmpeg Developers. FFmpeg. 2021. Available: https://ffmpeg.org/
  76. 76. Bochkovskiy A. Projects · AlexeyAB/darknet. In: GitHub [Internet]. [cited 1 Jun 2022]. Available: https://github.com/AlexeyAB/darknet
  77. 77. Tzutalin. LabelImg Free Software. 2015. Available: https://github.com/heartexlabs/labelImg
  78. 78. Home · ultralytics/yolov5 Wiki. In: GitHub [Internet]. [cited 7 Jun 2022]. Available: https://github.com/ultralytics/yolov5
  79. 79. YOLOv5 Documentation. [cited 7 Jun 2022]. Available: https://docs.ultralytics.com/
  80. 80. NVIDIA Tesla P100: The Most Advanced Data Center Accelerator. In: NVIDIA [Internet]. [cited 7 Jun 2022]. Available: https://www.nvidia.com/en-us/data-center/tesla-p100/
  81. 81. Google Colaboratory. [cited 7 Jun 2022]. Available: https://research.google.com/colaboratory/faq.html
  82. 82. Fujita N, Higuchi H, Sakuma S, Takagi S, Latif MAHM, Ozaki M. Effect of Right-Lateral Versus Left-Lateral Tilt Position on Compression of the Inferior Vena Cava in Pregnant Women Determined by Magnetic Resonance Imaging. Anesth Analg. 2019;128: 1217–1222. pmid:31094791
  83. 83. Bamber JH, Dresner M. Aortocaval Compression in Pregnancy: The Effect of Changing the Degree and Direction of Lateral Tilt on Maternal Cardiac Output. Anesth Analg. 2003;97: 256–258. pmid:12818977
  84. 84. Saravanakumar K, Hendrie M, Smith F, Danielian P. Influence of reverse Trendelenburg position on aortocaval compression in obese pregnant women. Int J Obstet Anesth. 2016;26: 15–18. pmid:26597402
  85. 85. Humphries A, Thompson JMD, Stone P, Mirjalili SA. The effect of positioning on maternal anatomy and hemodynamics during late pregnancy. Clin Anat. 2020;33: 943–949. pmid:32329156
  86. 86. Cluver C, Novikova N, Hofmeyr GJ, Hall DR. Maternal position during caesarean section for preventing maternal and neonatal complications. Cochrane Database Syst Rev. 2013; CD007623. pmid:23543552
  87. 87. Fields JM, Catallo K, Au AK, Rotte M, Leventhal D, Weiner S, et al. Resuscitation of the pregnant patient: What is the effect of patient positioning on inferior vena cava diameter? Resuscitation. 2013;84: 304–308. pmid:23178869
  88. 88. Prodromakis E, Trakada G, Tsapanos V, Spiropoulos K. Arterial oxygen tension during sleep in the third trimester of pregnancy. Acta Obstet Gynecol Scand. 2004;83: 159–164. pmid:14756733
  89. 89. Hignett R, Fernando R, McGlennan A, McDonald S, Stewart A, Columb M, et al. A randomized crossover study to determine the effect of a 30° head-up versus a supine position on the functional residual capacity of term parturients. Anesth Analg. 2011;113: 1098–1102. pmid:21918160
  90. 90. Grimm T, Martinez M, Benz A, Stiefelhagen R. Sleep position classification from a depth camera using Bed Aligned Maps. 2016 23rd International Conference on Pattern Recognition (ICPR). 2016. pp. 319–324.
  91. 91. Liu S, Yin Y, Ostadabbas S. In-Bed Pose Estimation: Deep Learning with Shallow Dataset. IEEE J Transl Eng Health Med. 2019;7: 1–12. pmid:30792942
  92. 92. Mohammadi SM, Alnowami M, Khan S, Dijk D-J, Hilton A, Wells K. Sleep Posture Classification using a Convolutional Neural Network. Annu Int Conf IEEE Eng Med Biol Soc IEEE Eng Med Biol Soc Annu Int Conf. 2018;2018: 1–4. pmid:30440284
  93. 93. Wang Y-K, Chen H-Y, Chen J-R. Unobtrusive Sleep Monitoring Using Movement Activity by Video Analysis. Electronics. 2019;8: 812.
  94. 94. Li Y-Y, Wang S-J, Hung Y-P. A Vision-Based System for In-Sleep Upper-Body and Head Pose Classification. Sensors. 2022;22: 2014. pmid:35271162
  95. 95. Baratloo A, Hosseini M, Negida A, El Ashal G. Part 1: Simple Definition and Calculation of Accuracy, Sensitivity and Specificity. Emergency. 2015;3: 48–49. pmid:26495380
  96. 96. The AASM Manual for the Scoring of Sleep and Associated Events. Version 2.6. American Academy of Sleep Medicine; 2020