diff --git a/main.bib b/main.bib index 2addfd2..5423d88 100644 --- a/main.bib +++ b/main.bib @@ -2214,10 +2214,11 @@ Based on {WST} and {HR} data from the wearable device, the algorithms demonstrat file = {PDF:/home/alex/Zotero/storage/SQCGXH4T/Albertson and Zinaman - 1987 - The prediction of ovulation and monitoring of the fertile period.pdf:application/pdf}, } -@article{owen_physiology_nodate, +@article{owen_physiology_1975, title = {Physiology of the menstrual cycle}, abstract = {Modern techniques of bioassay have permitted correlation of hormonal secretion with genital tissue changes during the normal menstrual cycle. During the follicular phase, estrogen secretion rises while other hormone levels are low. At ovulation luteinizing hormone and follicle-stimulating hormone surges are associated with falling estrogen levels. Secretions of progesterone and estrogen again are characteristic of the lutea! phase ending with menstruation. Gonadotrophin-releasing hormones are detectable just before the luteinizing hormone and follicle-stimulating hormone surges. Basal body temperature rises with ovulation and is still the most reliable clinical indicator, although ferning and spinnbarkeit (when present) are also quite helpful. Vaginal smears are probably less useful except in the hands of experienced observers. Am. J. Clin. Nutr. 28: 333-338, 1975.}, author = {Owen, A}, + date = {1975}, langid = {english}, file = {PDF:/home/alex/Zotero/storage/J9ITWN5R/Owen - Physiology of the menstrual cycle.pdf:application/pdf}, } @@ -2558,3 +2559,78 @@ Conclusions Motivations for fertility app use are varied, overlap and change ove langid = {english}, file = {PDF:/home/alex/Zotero/storage/JCQLD5GG/Lecun - Gradient-Based Learning Applied to Document Recognition.pdf:application/pdf}, } + +@article{smoley_natural_nodate, + title = {Natural Family Planning}, + author = {Smoley, Brian A}, + langid = {english}, + file = {PDF:/home/alex/Zotero/storage/WGENM9D3/Smoley - Natural Family Planning.pdf:application/pdf}, +} + +@article{elman_finding_nodate, + title = {Finding Structure in Time}, + author = {Elman, Jeffrey L}, + langid = {english}, + file = {PDF:/home/alex/Zotero/storage/EDNNYH7G/Elman - Finding Structure in Time.pdf:application/pdf}, +} + +@misc{pascanu_difficulty_2013, + title = {On the difficulty of training Recurrent Neural Networks}, + url = {http://arxiv.org/abs/1211.5063}, + doi = {10.48550/arXiv.1211.5063}, + abstract = {There are two widely known issues with properly training Recurrent Neural Networks, the vanishing and the exploding gradient problems detailed in Bengio et al. (1994). In this paper we attempt to improve the understanding of the underlying issues by exploring these problems from an analytical, a geometric and a dynamical systems perspective. Our analysis is used to justify a simple yet effective solution. We propose a gradient norm clipping strategy to deal with exploding gradients and a soft constraint for the vanishing gradients problem. We validate empirically our hypothesis and proposed solutions in the experimental section.}, + number = {{arXiv}:1211.5063}, + publisher = {{arXiv}}, + author = {Pascanu, Razvan and Mikolov, Tomas and Bengio, Yoshua}, + urldate = {2025-09-08}, + date = {2013-02-16}, + eprinttype = {arxiv}, + eprint = {1211.5063 [cs]}, + keywords = {Computer Science - Machine Learning}, + file = {Full Text PDF:/home/alex/Zotero/storage/DSVXLCYM/Pascanu et al. - 2013 - On the difficulty of training Recurrent Neural Networks.pdf:application/pdf;Snapshot:/home/alex/Zotero/storage/95QFYD7E/1211.html:text/html}, +} + +@article{tsukiyama_lstm-phv_2021, + title = {{LSTM}-{PHV}: prediction of human-virus protein–protein interactions by {LSTM} with word2vec}, + volume = {22}, + rights = {https://creativecommons.org/licenses/by-nc/4.0/}, + issn = {1467-5463, 1477-4054}, + url = {https://academic.oup.com/bib/article/doi/10.1093/bib/bbab228/6308200}, + doi = {10.1093/bib/bbab228}, + shorttitle = {{LSTM}-{PHV}}, + abstract = {Viral infection involves a large number of protein–protein interactions ({PPIs}) between human and virus. The {PPIs} range from the initial binding of viral coat proteins to host membrane receptors to the hijacking of host transcription machinery. However, few interspecies {PPIs} have been identified, because experimental methods including mass spectrometry are time-consuming and expensive, and molecular dynamic simulation is limited only to the proteins whose 3D structures are solved. Sequence-based machine learning methods are expected to overcome these problems. We have first developed the {LSTM} model with word2vec to predict {PPIs} between human and virus, named {LSTM}-{PHV}, by using amino acid sequences alone. The {LSTM}-{PHV} effectively learnt the training data with a highly imbalanced ratio of positive to negative samples and achieved {AUCs} of 0.976 and 0.973 and accuracies of 0.984 and 0.985 on the training and independent datasets, respectively. In predicting {PPIs} between human and unknown or new virus, the {LSTM}-{PHV} learned greatly outperformed the existing state-of-the-art {PPI} predictors. Interestingly, learning of only sequence contexts as words is sufficient for {PPI} prediction. Use of uniform manifold approximation and projection demonstrated that the {LSTM}-{PHV} clearly distinguished the positive {PPI} samples from the negative ones. We presented the {LSTM}-{PHV} online web server and support data that are freely available at http://kurata35.bio.kyutech.ac.jp/{LSTM}-{PHV}.}, + pages = {bbab228}, + number = {6}, + journaltitle = {Briefings in Bioinformatics}, + author = {Tsukiyama, Sho and Hasan, Md Mehedi and Fujii, Satoshi and Kurata, Hiroyuki}, + urldate = {2025-09-08}, + date = {2021-11-05}, + langid = {english}, + file = {PDF:/home/alex/Zotero/storage/JBK85458/Tsukiyama et al. - 2021 - LSTM-PHV prediction of human-virus protein–protein interactions by LSTM with word2vec.pdf:application/pdf}, +} + +@article{min_deep_2016, + title = {Deep learning in bioinformatics}, + issn = {1467-5463, 1477-4054}, + url = {https://academic.oup.com/bib/article-lookup/doi/10.1093/bib/bbw068}, + doi = {10.1093/bib/bbw068}, + abstract = {In the era of big data, transformation of biomedical big data into valuable knowledge has been one of the most important challenges in bioinformatics. Deep learning has advanced rapidly since the early 2000s and now demonstrates state-of-theart performance in various fields. Accordingly, application of deep learning in bioinformatics to gain insight from data has been emphasized in both academia and industry. Here, we review deep learning in bioinformatics, presenting examples of current research. To provide a useful and comprehensive perspective, we categorize research both by the bioinformatics domain (i.e. omics, biomedical imaging, biomedical signal processing) and deep learning architecture (i.e. deep neural networks, convolutional neural networks, recurrent neural networks, emergent architectures) and present brief descriptions of each study. Additionally, we discuss theoretical and practical issues of deep learning in bioinformatics and suggest future research directions. We believe that this review will provide valuable insights and serve as a starting point for researchers to apply deep learning approaches in their bioinformatics studies.}, + pages = {bbw068}, + journaltitle = {Brief Bioinform}, + author = {Min, Seonwoo and Lee, Byunghan and Yoon, Sungroh}, + urldate = {2025-09-08}, + date = {2016-07-29}, + langid = {english}, + file = {PDF:/home/alex/Zotero/storage/CLI454YK/Min et al. - 2016 - Deep learning in bioinformatics.pdf:application/pdf}, +} + +@incollection{lecun_convolutional_1998, + title = {Convolutional networks for images, speech, and time series}, + url = {https://hal.science/hal-05083427}, + booktitle = {The handbook of brain theory and neural networks}, + author = {Lecun, Yann and Bengio, Yoshua}, + urldate = {2025-09-08}, + date = {1998-10}, + doi = {10.5555/303568.303704}, + file = {Full Text PDF:/home/alex/Zotero/storage/7VFH99SR/Lecun and Bengio - 1998 - Convolutional networks for images, speech, and time series.pdf:application/pdf}, +} diff --git a/thesis/main.tex b/thesis/main.tex index 981c164..cce3cbd 100644 --- a/thesis/main.tex +++ b/thesis/main.tex @@ -55,10 +55,10 @@ Prof. Bogdan Franczyk\\ Dr. Christian Alvermann\\[1.5cm] - \textbf{Date:} September 2025\\[2cm] + \textbf{Date:} September 2025\\[1.5cm] \textbf{Master of Science: Data Science}\\ - \textbf{Leipzig University}\\ + \textbf{Leipzig University}\\[1cm] \textit{In collaboration with VivoSensMedical GmbH} \end{titlepage} @@ -69,13 +69,13 @@ More than 40,000 cycles recorded with an intravaginal sensor were used to train and evaluate recurrent, transformer-based, and convolutional model variants. Results show that while LSTM models achieved the lowest error on standard metrics, - transformer-based architectures performed more robustly in use-case evaluations + transformer-based architectures performed more robustly in use case evaluations for contraception and natural family planning (NFP). Predictions were substantially more accurate in regular cycles than in irregular ones, underlining both the promise and the limits of temperature-based approaches. A pre-ovulatory temperature drop was identified as a relevant physiological marker influencing fertility probability. - In simulated use cases, model predictions approached the effectiveness of established contraceptive - methods and enabled more efficient timing for conception efforts. + In simulated use cases, model predictions substantially reduced simulated pregnancy risk compared to + baseline methods and improved timing for conception efforts. Despite the limitations of retrospective labeling, noisy real-world data, and the restriction to temperature as a single modality, the study demonstrates that machine learning can meaningfully advance individualized fertility prediction. @@ -83,7 +83,6 @@ \end{abstract} \pagebreak - \tableofcontents \include{sections/introduction} @@ -100,6 +99,13 @@ \include{sections/conclusion} + \printbibliography + + \include{sections/appendix} + + + \pagebreak + \section*{Declaration of Use of AI-Assisted Writing Tools} @@ -112,23 +118,19 @@ The outputs served solely as editorial support and did not replace my own academic work or authorship. Responsibility for the content, structure, and conclusions of this thesis remains entirely my own. - \pagebreak - I hereby declare that I have written the present thesis independently and only with the use of the sources and aids indicated. - In particular, literal or paraphrased quotations are marked as such. - I am aware that any violation may lead, even retrospectively, - to the revocation of the degree. - I further declare that the electronic copy is identical to the printed copies. + \pagebreak + Ich versichere, dass ich die vorliegende Arbeit selbstständig und nur unter Verwendung der + angegebenen Quellen und Hilfsmittel angefertigt habe, insbesondere sind wörtliche oder + sinngemäße Zitate als solche gekennzeichnet. Mir ist bekannt, dass Zuwiderhandlung auch + nachträglich zur Aberkennung des Abschlusses führen kann. + Ich versichere, dass das elektronische Exemplar mit den gedruckten Exemplaren übereinstimmt. \vspace{2cm} \noindent \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} l c r} - Location: & Date: & Signature: \\ + Ort: & Datum: & Unterschrift: \\ \end{tabular*} - - \include{sections/appendix} - - \printbibliography - + \pagebreak \end{document} \ No newline at end of file diff --git a/thesis/sections/appendix.tex b/thesis/sections/appendix.tex index 33ff94a..08fb30a 100644 --- a/thesis/sections/appendix.tex +++ b/thesis/sections/appendix.tex @@ -2,12 +2,12 @@ \appendixpage % prints "Appendices" -\section{Supplementary Results: Prediction of Ovulation-Over Indicator}\label{sec:appendix_ov_over_results} +\section{Supplementary Results: Prediction of OV-over Indicator}\label{sec:appendix_ov_over_results} \subsection{Comparative Study of Model Architectures and Parameters}\label{subsec:appendix_ov_over_architecture_results} -We evaluate prediction of a binary indicator denoting whether ovulation has already occurred. -We examine the influence of input window length, input resolution, and model capacity. +I will evaluate prediction of a binary indicator denoting whether ovulation has already occurred and +examine the influence of input window length, input resolution, and model capacity. \paragraph{Impact of input window length.} For predicting whether ovulation has occurred (OV-over), @@ -57,7 +57,7 @@ See Table~\ref{tab:ovover_windows_compact_mse} for a summary. \end{table} \paragraph{Impact of input resolution.} -Fixing the input window to 20 days, we compare input resolutions for LSTM and Transformer models. +Fixing the input window to 20 days, I have compared input resolutions for LSTM and Transformer models. For the \textbf{LSTM}, the lowest overall MSE (0.0633) occurs at 24/day, with best before-OV and after-OV MSEs at 12/day (0.0212) and 48/day (0.0550), respectively. @@ -96,7 +96,7 @@ full resolution grids are in Appendix Table~\ref{tab:ov_over_results_by_resoluti \end{table} \paragraph{Impact of model parameters.} -Using fixed input settings (160 days at 12/day for LSTM/Transformer; 40 days for convolutional models), we evaluate model scaling. +Using fixed input settings (160 days at 12/day for LSTM/Transformer; 40 days for convolutional models), I have evaluated model scaling. The \textbf{Transformer} achieves the lowest overall (0.0543) and after-ovulation MSE (0.0410) at a large configuration (512×8×8). Before-OV MSE is lowest at 256×4×4 (0.0293). @@ -177,7 +177,7 @@ full comparisons are included in Appendix Tables~\ref{tab:ov_over_results_by_mod User Mean Baseline & 0.180702 & 0.088884 & 0.217144 \\ \bottomrule \end{tabularx} - \caption{MSEs for ovulation-over target across different model architectures for regular and irregular cycle groups. Bold values denote the best scores per column.} + \caption{MSEs for OV-over target across different model architectures for regular and irregular cycle groups. Bold values denote the best scores per column.} \label{tab:ov_over_mse_regular_irregular} \end{table} @@ -447,7 +447,7 @@ The full table with MSE and MAE for all models can be found in the appendix, Tab \bottomrule \end{tabularx} - \caption{Evaluation Metrics for the Ovulation-Over Target across Different Model Architectures and Input Lengths at a fixed Input Resolution of 12 Values per Day. + \caption{Evaluation Metrics for the OV-over Target across Different Model Architectures and Input Lengths at a fixed Input Resolution of 12 Values per Day. \underline{Underlined} values represent the best value for each metric within a model. \textbf{\underline{Bold + Underlined}} values represent the global best values across all models for a given metric.} \label{tab:ov_over_results_by_window_length} @@ -486,7 +486,7 @@ The full table with MSE and MAE for all models can be found in the appendix, Tab 288 & 0.1319 & 0.1879 & 0.1097 & 0.0617 & 0.0769 & \underline{0.0578}\\ \bottomrule \end{tabularx} - \caption{Evaluation Metrics for the Ovulation-Over Target across Different Model Architectures and Input Resolutions at a fixed Input-Window-Length of 20 Days. + \caption{Evaluation Metrics for the OV-over Target across Different Model Architectures and Input Resolutions at a fixed Input-Window-Length of 20 Days. \underline{Underlined} values represent the best value for each metric within a model. \textbf{\underline{Bold + Underlined}} values represent the global best values across all models for a given metric.} \label{tab:ov_over_results_by_resolution} @@ -517,7 +517,7 @@ The full table with MSE and MAE for all models can be found in the appendix, Tab 512 & 4 & \textbf{0.1120} & 0.1358 & \textbf{0.0983} & \textbf{0.0616} & 0.0603 & \textbf{0.0613} \\ \bottomrule \end{tabularx} - \caption{Evaluation Metrics for the Ovulation-Over Target across Different Model Parameters for the LSTM model with + \caption{Evaluation Metrics for the OV-over Target across Different Model Parameters for the LSTM model with a fixed input window length of 160 days and an input resolution of 12 values per day. \textbf{Bold} values represent the best value for each metric within a model.} \label{tab:ov_over_results_by_model_parameters_lstm} @@ -547,7 +547,7 @@ The full table with MSE and MAE for all models can be found in the appendix, Tab 512 & 8 & 8 & 0.1126 & 0.1965 & \textbf{0.0753} & \textbf{0.0543} & 0.0868 & \textbf{0.0410} \\ \bottomrule \end{tabularx} - \caption{Evaluation Metrics for the Ovulation-Over Target across Different Model Parameters for the Transformer model with + \caption{Evaluation Metrics for the OV-over Target across Different Model Parameters for the Transformer model with a fixed input window length of 160 days and an input resolution of 12 values per day. \textbf{Bold} values represent the best value for each metric within a model.} \label{tab:ov_over_results_by_model_parameters_transformer} @@ -576,7 +576,7 @@ The full table with MSE and MAE for all models can be found in the appendix, Tab 512 & 4 & 0.1436 & \textbf{0.1166} & 0.1523 & 0.0699 & 0.0382 & 0.0820 \\ \bottomrule \end{tabularx} - \caption{Evaluation Metrics for the Ovulation-Over Target across Different Model Parameters for the convolutional LSTM model with + \caption{Evaluation Metrics for the OV-over Target across Different Model Parameters for the convolutional LSTM model with a fixed input window length of 40 days. \textbf{Bold} values represent the best value for each metric within a model.} \label{tab:ov_over_results_by_model_parameters_conv_lstm} @@ -606,7 +606,7 @@ The full table with MSE and MAE for all models can be found in the appendix, Tab 512 & 8 & 8 & 0.1576 & \textbf{0.1025} & 0.1848 & 0.0825 & 0.0339 & 0.1066 \\ \bottomrule \end{tabularx} - \caption{Evaluation Metrics for the Ovulation-Over Target across Different Model Parameters for the convolutional Transformer model with + \caption{Evaluation Metrics for the OV-over Target across Different Model Parameters for the convolutional Transformer model with a fixed input window length of 40 days. \textbf{Bold} values represent the best value for each metric within a model.} \label{tab:ov_over_results_by_model_parameters_conv_transformer} @@ -679,7 +679,7 @@ The full table with MSE and MAE for all models can be found in the appendix, Tab User Mean Baseline & 0.180702 & 0.088884 & 0.217144 & 0.180702 & 0.088884 & 0.217144 \\ \bottomrule \end{tabularx} - \caption{Evaluation Metrics for the Ovulation-Over Target across Different Model Architectures for the Regular and Irregular Cycle Groups. + \caption{Evaluation Metrics for the OV-over Target across Different Model Architectures for the Regular and Irregular Cycle Groups. \textbf{Bold} values represent the best values across all models for a given metric.} \label{tab:regular_vs_irregular_ov_over_results} \end{table} diff --git a/thesis/sections/background.tex b/thesis/sections/background.tex index 9c8d449..c3a6429 100644 --- a/thesis/sections/background.tex +++ b/thesis/sections/background.tex @@ -7,7 +7,7 @@ \subsection{Physiological Background}\label{subsec:physiological_background} \subsubsection{Menstrual Cycle}\label{subsec:menstrual_cycle} -The menstrual cycle consists of physiological changes preparing the female body for potential pregnancy, +The menstrual cycle consists of physiological changes preparing the body for potential pregnancy, typically spanning around 28 days but varying considerably among individuals. It includes two main phases: the follicular phase, beginning with menstruation, and the luteal phase, following ovulation. @@ -19,7 +19,8 @@ induces ovulation—the release of a mature egg into the fallopian tube. After ovulation, the luteal phase begins (Figure~\ref{fig:background_menstrual_cycle_physiology} day 14 to 28). Progesterone increases substantially, maintaining endometrial thickness for potential embryo implantation. In parallel, a subtle rise in body temperature (~0.5°C) occurs due to progesterone elevation. -If fertilization does not happen, progesterone and temperature decline back to baseline levels, resulting in menstruation and initiating a new cycle. +If fertilization does not happen, progesterone and temperature decline back to baseline levels, +resulting in menstruation and initiating a new cycle~\cite{owen_physiology_1975}. \begin{figure}[htbp] \centering @@ -57,7 +58,7 @@ The luteal phase begins at the ovulation and continues until the next menstruati While many cycles exhibit a characteristic biphasic pattern, deviations from this norm are common. Some do not show the typical temperature surge, which might be an indication for an anovulatory cycle. -Anovulatory cycles don't have an ovulation, and thus cannot result in a pregnancy. +Anovulatory cycles do not have an ovulation, and thus cannot result in a pregnancy. Anovulation can have various causes, including hormonal imbalances, stress, or underlying health conditions~\cite{rosenfield_adolescent_2013}. Monophasic cycles with a confirmed ovulation event have also been observed, so there seems to be no clear indication that it is a direct cause of anovulation~\cite{moghissi_accuracy_1976}. Thus, distinguishing between ovulatory and anovulatory cycles is challenging, as the only definitive confirmation of @@ -130,7 +131,8 @@ However, since the goal is to identify the fertile window before ovulation occur For individuals trying to conceive or avoid pregnancy, knowing the window of fertility is more actionable than identifying the ovulation event itself. \subsubsection{Practical Use Cases}\label{subsubsec:practical_use_cases} -In this study, we will focus on \emph{natural family planning} (NFP), which includes preventing and achieving pregnancy. +In this study, I will focus on \emph{natural family planning} (NFP), +which constitutes achieving and preventing pregnancy through non-invasive and natural means~\cite{smoley_natural_nodate}. Individuals aiming to avoid pregnancy identify fertile days to abstain from intercourse, whereas those seeking pregnancy aim to focus intercourse around days with the highest fertility probability. @@ -144,13 +146,14 @@ Although false-positives may lead to unnecessary abstinence, this outcome is gen Consequently, prediction algorithms should be conservative, erring on the side of higher fertility estimates to prioritize safety. For women aiming to conceive, incorrect predictions are less severe, as they might, at worst, result in misdirected -pregnancy effort, causing frustration or delays, but no potential dangers to the health of a woman. -Therefore, algorithms for this group don't need to be as conservative. -It remains to be seen, where the middle ground lies and how different algorithms perform for different use cases. +pregnancy effort, causing frustration or delays, but no severe dangers to the health of a woman. +Therefore, algorithms for this group do not need to be as conservative. +It remains to be seen where the middle ground lies and how different algorithms perform for different use cases. +I acknowledge potential mental health risks associated to it an unfulfilled pregnancy-wish. -In this study, we'll focus on fertility prediction, which incorporates both use cases, and thus we will not train -different models for each use-case. -However, we will test the thresholds used for decision-making to find use-case dependent optimums. +In this study, I will focus on fertility prediction, which incorporates both use cases, and thus I will not train +different models for each use case. +However, I will test the thresholds used for decision-making to find use case dependent optimums. Section~\ref{subsubsec:use_case_evaluation} will introduce the methodology in more detail. \subsubsection{Physiological Signs of Ovulation}\label{subsubsec:physiological_signs} @@ -180,7 +183,7 @@ OvulaRing has been financed by the startup grant `EXIST Gründerstipendium` from The device continuously records intravaginal core body temperature at 5-minute intervals. The sensor itself measures approximately 1\,cm $\times$ 1\,cm $\times$ 2\,cm and is embedded in a silicone ring with a diameter of 5\,cm for ease of use. It pairs with a smartphone via Bluetooth to synchronize and upload recorded data to a secure database. -Figure~\ref{fig:background_ovularing} shows an image of the ring attached to its silicone ring. +Figure~\ref{fig:background_ovularing} shows an image of the sensor attached to its silicone ring. The product has been on the market for over a decade, resulting in an extensive longitudinal dataset of menstrual cycles. Cycle boundaries are defined by self-reported menstruation, which users manually log in the accompanying app to mark the beginning of each cycle. @@ -269,7 +272,7 @@ With a large, high-resolution dataset of longitudinal temperature measurements a the next challenge lies in how to model such sequential data effectively. Accurate ovulation prediction requires algorithms that can handle temporal dependencies, irregularities, and physiological variability across users. -To this end, we turn to machine learning techniques designed for time series analysis, +To this end, I turn to machine learning techniques designed for time series analysis, beginning with foundational concepts and progressing to modern neural architectures. \subsubsection{Time Series Analysis}\label{subsubsec:time_series_analysis} @@ -284,7 +287,8 @@ These recurrent connections allow the network to retain information from previou from a prior time step into the current one, enabling a form of temporal memory. Recurrent Neural Networks (RNNs) process sequences in a strictly sequential manner, where each token's representation depends on the preceding token. -This results in a per-layer time complexity of $\mathcal{O}(n \cdot d^2)$, where $n$ is the sequence length and $d$ is the hidden state size. +This results in a per-layer time complexity of $\mathcal{O}(n \cdot d^2)$, where $n$ is +the sequence length and $d$ is the hidden state size~\cite{elman_finding_nodate}. In practice, this means that input data is processed sequentially, one step at a time. @@ -304,7 +308,7 @@ if they grow exponentially, it results in \emph{exploding gradients}~\cite{hochr In both cases, learning is significantly impaired. Exploding gradients can often be mitigated using techniques such as \emph{gradient clipping}, -where the magnitude of the gradient is capped---typically within a range of \([-1, 1]\)---to stabilize training. +where the magnitude of the gradient is capped---typically within a range of \([-1, 1]\)---to stabilize training~\cite{pascanu_difficulty_2013}. Figure~\ref{fig:rnn_unfolded} illustrates the unfolded structure of an RNN across three time steps. This technique, known as \emph{unfolding}, clarifies how sequential inputs update the hidden state and generate @@ -386,15 +390,7 @@ update, and expose information, solving key limitations of vanilla RNNs in seque LSTMs are widely used in biomedical applications due to their capacity to handle sequences of variable length and complexity. In the context of fertility prediction, where hormonal patterns exhibit periodicity but also irregularity, -LSTMs are well-suited to learn relevant time-dependent signals from sequential physiological measurements. - -While powerful, LSTMs can be computationally intensive and sensitive to hyperparameter tuning. -Therefore, they are often compared with alternative architectures, -including simpler feedforward networks and more recent attention-based models, -to evaluate trade-offs in performance, interpretability, and computational cost. - -Given their ability to learn from sequences with noisy periodic structure, -LSTMs offer a natural choice for modeling hormonal and temperature fluctuations across menstrual cycles. +LSTMs are well-suited to learn relevant time-dependent signals from sequential physiological measurements~\cite{tsukiyama_lstm-phv_2021, min_deep_2016}. The next section introduces the \emph{Transformer} architecture, a more recent alternative that forgoes recurrence in favor of attention mechanisms. @@ -409,7 +405,7 @@ This design mitigates the limitations of recurrent models, such as long-term mem and vanishing gradients. However, the per-layer time complexity is $\mathcal{O}(n^2 \cdot d)$, due to the quadratic cost of computing pairwise attention across the $n$ tokens. Unlike RNNs, Transformers also cannot inherently process sequences of variable length. -Additional preprocessing steps, such as padding or windowing must be applied to support these. +Additional preprocessing steps, such as padding and masking must be applied to support these. Originally introduced for machine translation, Transformers have proven broadly applicable to various sequence modeling tasks due to their flexibility, scalability, and strong performance @@ -447,7 +443,7 @@ to the model regardless of their location, even if they play different syntactic Positional encodings, often based on sinusoidal functions, inject a unique position-dependent signal into each token, enabling the model to distinguish between identical tokens in different positions. -In this work, we use sine and cosine functions of different frequencies: +In this work, I use sine and cosine functions of different frequencies: \begin{align} PE_{\text{pos}, 2i} &= \sin\left(\frac{\text{pos}}{10000^{\frac{2i}{d_{\text{model}}}}}\right), \\ PE_{\text{pos}, 2i+1} &= \cos\left(\frac{\text{pos}}{10000^{\frac{2i}{d_{\text{model}}}}}\right) @@ -582,19 +578,24 @@ This makes Transformers well-suited for learning long-range temporal dependencie such as ovulatory trends spanning multiple days or cycles. \subsubsection{Convolutional Layers as Temporal Feature Extractors} -For high-resolution time-series data, the input dimensionality can become large, -especially in models like Transformers that process the entire sequence in parallel. -This can lead to increased memory consumption and slower training. -To mitigate this and retain as much information as possible, convolutional layers can be used -to reduce the sequence length while preserving important local patterns~\cite{lecun_gradient-based_nodate}. -In this context, one-dimensional convolutions act as learnable filters that slide over the input sequence to extract temporal features. -Each filter is parameterized to respond to specific local structures in the data, such as peaks, slopes, or short-term motifs. -By adjusting the \emph{stride}, the step size of the convolution, the model can control the degree of downsampling, -effectively reducing the number of time steps passed to subsequent layers. +Convolutional neural networks (CNNs) can also be applied to time-series by using 1D convolutions across the temporal dimension. +In this setting, each convolutional filter acts as a learnable temporal pattern detector (e.g. for local peaks, slopes, or motifs). +Convolutions exploit the local correlation structure of time series: adjacent measurements are often highly related. +As~\cite{lecun_convolutional_1998} note, “time-series have a strong 1D structure – variables that are temporally nearby are highly correlated. +Local correlations are the reason for the well-known advantages of extracting and combining local features”~\cite{lecun_convolutional_1998}. +Convolutional layers enforce locality by restricting each neuron’s receptive field to a contiguous segment of time. +By adjusting the convolutional stride and using pooling, +CNNs can downsample the sequence length (reducing resolution) while preserving salient information. +This reduces the input dimensionality for subsequent layers and can speed up training. -Additional dimensionality reduction can be achieved using pooling operations, such as \emph{max pooling}, which retains only the maximum value within a given window. -These techniques reduce the computational load while maintaining salient information for downstream processing. +In practice, convolutional architectures have achieved strong performance on sequential tasks. +For example,~\cite{lecun_convolutional_1998} show that a simple Temporal Convolutional Network often outperforms canonical +recurrent models (like LSTMs) across diverse sequence modeling benchmarks. +Their experiments suggest that CNNs are “a natural starting point for sequence modeling,” +especially when temporal features are local or multi-scale. +In summary, 1D convolutions provide an efficient way to extract local temporal features and compress high-resolution sequences, +complementing recurrent and attention-based models in time-series analysis Figure~\ref{fig:background_convolution_example} illustrates a simple one-dimensional convolution applied to a sequence using a filter of size 3. The stride determines how far the filter moves at each step, affecting both the resolution and length of the resulting feature map. diff --git a/thesis/sections/conclusion.tex b/thesis/sections/conclusion.tex index f490502..c2454a7 100644 --- a/thesis/sections/conclusion.tex +++ b/thesis/sections/conclusion.tex @@ -9,7 +9,7 @@ for fertility prediction based on high-resolution body core temperature data. By comparing LSTM- and Transformer-based models, as well as their convolutional variants, the results show that machine learning can achieve high predictive performance. LSTM models performed best according to standard evaluation metrics, whereas Transformer-based models -proved more robust in simulated use-case evaluations for contraception and Natural Family Planning (NFP). +proved more robust in simulated use case evaluations for contraception and Natural Family Planning (NFP). Predictions were consistently more reliable in regular cycles than in irregular ones, highlighting both the potential and the inherent limits of temperature-based approaches. @@ -17,13 +17,12 @@ A characteristic pre-ovulatory temperature drop was identified as correlating wi Both its timing and its magnitude appear to influence fertility probability, pointing to a concrete physiological marker that could be exploited in practice. -Use-case evaluations indicate that the model outputs could be highly relevant for contraception and NFP\@. -In simulations, pregnancy rates approached those reported for commonly used contraceptives such as condoms -or oral contraceptives, and with simple additional measures could even approximate the effectiveness of -long-term hormonal methods or sterilization. -While pregnancy rates for the NFP use-case were not significantly improved, -the predictions enabled a four-fold increase in the efficiency of timed intercourse, -facilitating more targeted pregnancy efforts for couples. +Use case evaluations indicate that the model outputs could be relevant for contraception and NFP\@. +In simulations, model-guided decisions reduced unintended pregnancies relative to naive and +calendar baselines and improved the efficiency (pregnancies per 1000 intercourse events) of timed intercourse. +These results are simulation-based and depend on assumptions about intercourse +patterns and fecundability; they should not be interpreted as clinical effectiveness estimates or as +direct comparisons to established contraceptive methods. Despite the limitations of real-world tracking data, including missing entries, noise, and user heterogeneity, this work underscores the potential of personalized, data-driven predictions diff --git a/thesis/sections/discussion.tex b/thesis/sections/discussion.tex index 1ecdf87..e40e467 100644 --- a/thesis/sections/discussion.tex +++ b/thesis/sections/discussion.tex @@ -4,13 +4,13 @@ \section{Discussion}\label{sec:discussion} -\subsection{Objective 1: Model Architecture Evuation an Optimization}\label{subsec:discussion_rq1_model_evaluation} +\subsection{Objective 1: Model Architecture Evaluation and Optimization}\label{subsec:discussion_rq1_model_evaluation} The first research objective considered different model architectures and how they perform under various hyperparameter configurations, with respect to the optimization goals of this study. -We found that non-convolutional models performed best with medium resolutions and longer input windows, +I found that non-convolutional models performed best with medium resolutions and longer input windows, where they also outperformed their convolutional counterparts. This suggests that including more historical context improves prediction accuracy. However, there appears to be a trade-off: @@ -20,21 +20,21 @@ The strong performance at medium resolutions indicates a possible sweet spot—b The convolutional variants performed best with medium-length input windows, which was somewhat surprising. One would expect convolutional downsampling to enable more efficient data representation, allowing the model to extract relevant patterns from high-resolution data and to perform better on longer sequences. -However, this was not observed in our experiments. +However, this was not observed in my experiments. Instead, convolutional models performed worse than non-convolutional models on longer input windows, suggesting that the benefits of downsampling may be offset by limitations in capturing long-range dependencies. For medium and short input windows, however, convolutional models did outperform the non-convolutional variants—indicating that the convolution itself provides an advantage when input length is limited. -To our knowledge, no prior studies have compared different deep learning architectures for real-time fertility prediction. -This highlights both the novelty and the exploratory nature of our approach. +To my knowledge, no prior studies have compared different deep learning architectures for real-time fertility prediction. +This highlights both the novelty and the exploratory nature of my approach. All these results must be interpreted with caution, as they are based on single-shot experiments and are not statistically robust. A more rigorous evaluation would involve training all models multiple times to minimize the impact of random initialization and other stochastic processes in training. For most metrics, differences in performance were small, often less than 1\%, and could easily be attributed to such variability. -We are also aware of potential losses in predictive quality due to class imbalance in the labels. +I am also aware of potential losses in predictive quality due to class imbalance in the labels. Especially in long cycles, the targets are mostly zero, except for a narrow window around ovulation (for the fertility-probability target) or the area after ovulation (for the ov-over target). Positive-to-negative target ratios can reach 10–20:1 in long cycles, meaning for each non-zero target day, @@ -42,12 +42,22 @@ there are 10 to 20 days with all-zero targets. This imbalance may introduce instability during training and reduce predictive performance. Future iterations of this study could incorporate class-weighting or loss-balancing mechanisms to address this issue. -Future work should include a more thorough parameter search and statistically more robust evaluation methodology. +A central limitation of this study is that the training labels were generated +retrospectively from temperature curves, rather than being based on direct clinical +confirmation of ovulation (e.g., ultrasound or hormone assays). +Although the retrospective algorithm was validated against expert-labeled reference cycles, +it remains a proxy and can be biased by ambiguous patterns, illness, or sensor dropout. +The models therefore predict consistency with this retrospective labeling rather than +the absolute physiological ground truth. +Prospective validation against clinical reference standards will be essential to establish the reliability of +the approach in real-world use. + +Future work should also include a more thorough parameter search and statistically more robust evaluation methodology. A more sophisticated hyperparameter search may be necessary to identify globally optimal configurations for each model architecture. Time and resource constraints could be alleviated using more efficient search algorithms such as Bayesian Optimization, Genetic Algorithms, or Neural Architecture Search (NAS) to better explore the joint parameter space. -Additionally, we only focused on basic models—LSTMs and Transformers, with convolutional hybrids. +Additionally, I habe only focused on basic models—LSTMs and Transformers, with convolutional hybrids. A closer look into alternative architectures, or tailoring architectures more specifically to the characteristics of menstrual cycle data, could significantly improve predictions. Recent Transformer variants for time series modeling, such as \emph{TimeXer}~\cite{wang_timexer_2024} @@ -68,19 +78,19 @@ Finally, exploring alternative prediction targets may help address some of the c Beyond the fertility-probability and ov-over indicators used in this study, targets such as the number of days to the next ovulation (or since the last), or the ovulation day as a direct regression target, might prove more stable and informative. -As we will see in the next section, the current targets are highly sensitive to anomalies, +As can be seen in the next section, the current targets are highly sensitive to anomalies, which may not be the case for alternative formulations. \subsection{Objective 2: Factors and Patterns that Influence Prediction}\label{susbsec:discussion_rq2_factors_and_patterns} -Our second research objective focused on identifying potential factors and patterns in the data +My second research objective focused on identifying potential factors and patterns in the data that influence fertility prediction. -To our knowledge, no prior work has explicitly analyzed the relationship between temperature patterns +To my knowledge, no prior work has explicitly analyzed the relationship between temperature patterns and ovulation—including the corresponding fertile window—in a way that could directly inform machine learning models. This underscores the exploratory nature of this analysis. -We identified a consistent pre-ovulatory temperature dip that aligned closely with the ground-truth fertility curve. +I have identified a consistent pre-ovulatory temperature dip that aligned closely with the ground-truth fertility curve. This drop was particularly pronounced in short and regular cycles. In contrast, irregular cycles often exhibited too much variability and noise in the follicular phase for the models to reliably detect this temperature drop, or to associate it meaningfully with increased fertility probability. @@ -89,13 +99,13 @@ larger dips tended to produce higher model confidence. This observed correlation may be coincidental, or it may indicate a meaningful biological marker for fertility and successful ovulation. -We hypothesize that there is a real association between the magnitude of the pre-ovulatory temperature dip and the likelihood of ovulation. +I hypothesize that there is a real association between the magnitude of the pre-ovulatory temperature dip and the likelihood of ovulation. -However, our method has a critical limitation: the ground-truth labels used were not based on clinically confirmed ovulation events. +However, my method has a critical limitation: the ground-truth labels used were not based on clinically confirmed ovulation events. This limitation may result not only in fertility-probability curves that are arbitrarily offset from their true value, but also in the inclusion of cycles labeled as ovulatory that in fact were anovulatory. As shown in Section~\ref{subsubsec:physiological_signs}, the only reliable indicator -of ovulation is daily transvaginal ultrasound, which was not feasible given the scale of our dataset. +of ovulation is daily transvaginal ultrasound, which was not feasible given the scale of my dataset. Future studies could apply the current model to a smaller subset of cycles with clinically confirmed ovulation and/or cycles exhibiting a clear temperature rise, to test the hypothesis @@ -121,7 +131,7 @@ Better labels would also allow more reliable medical interpretation of the predi The third research objective of this study was to compare model performance across subsets of users with regular and irregular menstrual cycles. -We found that predictive performance is clearly sensitive to cycle irregularity. +I have found that predictive performance is clearly sensitive to cycle irregularity. Both overall accuracy and the improvement in performance over a growing user history were substantially better for regular cycles compared to irregular ones. This suggests that past cycles contain valuable information that helps the models @@ -131,7 +141,7 @@ Some of this improvement can also be attributed to static features, several of w derived from aggregated past cycles, such as average cycle length or average ovulation day. These features appear to be more informative and stable in the regular cycle group. -Based on the clear difference in performance, we hypothesize, that all models rely more on those static features +Based on the clear difference in performance, I hypothesize, that all models rely more on those static features than on patterns identified in the temperature curves, since if that were the case, the difference would be smaller or non-existent. There might be additional factors that differentiate regular from irregular cycles, that might explain the results, @@ -141,12 +151,12 @@ but this hypothesis needs to be investigated in further research. \citeauthor{yu_tracking_2022} also report a significant drop in performance for irregular cycles in their study~\cite{yu_tracking_2022}, particularly in terms of sensitivity. -While we cannot directly compare results due to methodological differences, especially since -our models do not perform explicit binary classification into fertile vs.\ non-fertile days, a similar trend is observable. -In our case, the models tend to overestimate fertility probability when faced with uncertainty, particularly in irregular cycles +While I cannot directly compare results due to methodological differences, especially since +my models do not perform explicit binary classification into fertile vs.\ non-fertile days, a similar trend is observable. +In my case, the models tend to overestimate fertility probability when faced with uncertainty, particularly in irregular cycles (see Figure~\ref{fig:results_rq2_irregular_cycle_predictions_example}). -As a result, we do not report specificity or sensitivity values. -However, the use-case scenarios in the next section offer a more binary evaluation framework. +As a result, I do not report specificity or sensitivity values. +However, the use case scenarios in the next section offer a more binary evaluation framework. A promising direction for future work would be to further investigate the causes of performance degradation in irregular cycle groups. @@ -159,24 +169,24 @@ Ideally, the model would have access to the entire cycle history of a user for t However, this would likely exceed the memory and capacity constraints of the architectures used in this study. Overcoming this limitation may require more efficient or hierarchical time series architectures, as previously discussed. -\subsection{Objective 4: Use-case Evaluations}\label{subsec:discussion_rq4_use_case_evaluations} +\subsection{Objective 4: Use Case Evaluations}\label{subsec:discussion_rq4_use_case_evaluations} -The fourth research objective was to evaluate two practical use-cases—natural contraception +The fourth research objective was to evaluate two practical use cases—natural contraception and natural family planning (NFP), using predefined evaluation algorithms. These algorithms approximate the effectiveness of different models across varying fertility thresholds. -We found that for both use-cases, all trained models outperformed the baselines. +I have found that for both use cases, all trained models outperformed the baselines. There was notable variability between model types, with the Transformer model performing best, especially for low fertility thresholds, followed closely by the convolutional variants. The LSTM model consistently showed the weakest performance across all metrics. Still, both trained and baseline models yielded significant improvements over the control group, indicating that all model types offer meaningful predictive value. -To our knowledge, no previous work has explicitly evaluated use-cases of natural +To my knowledge, no previous work has explicitly evaluated use cases of natural contraception or NFP with machine learning, or compared them to traditional contraceptive methods. This highlights the exploratory nature of this analysis. -\paragraph{Contraception Use-Case.} +\paragraph{Contraception Use Case.} For the natural contraception scenario, Transformer-based architectures produced competitive results, achieving fewer than 5 pregnancies per 100 user-years for low thresholds. For context, the expected pregnancy rates per 100 user-years are approximately 12 for male condoms @@ -186,7 +196,7 @@ In contrast, the control group, representing no contraception, resulted in 90 pr which closely aligns with literature values (85 pregnancies per 100 women per year)~\cite{trussell_contraceptive_2011}. As expected, the number of denials, i.e., -days on which a potential application would suggest abstinence,increases with the threshold. +days on which a potential application would suggest abstinence, increases with the threshold. Therefore, a trade-off exists between minimizing pregnancies and minimizing denials. This trade-off is user-dependent: while some users prefer certainty and are comfortable with frequent denials, others may accept higher risk or use additional protective measures to mitigate it. @@ -194,7 +204,7 @@ others may accept higher risk or use additional protective measures to mitigate This highlights a critical limitation: all results are based on a naive, rigid denial strategy that did not incorporate any additional measures or contextual information beyond the raw model predictions. -When combined with established behavioral protocols,such as abstinence during the early cycle phase, +When combined with established behavioral protocols, such as abstinence during the early cycle phase, as used in several commercial products~\cite{thigpen_oura_2025, bull_real-world_2019}, significantly lower pregnancy rates are likely achievable. @@ -207,8 +217,8 @@ Future work could explore models that combine predicted fertility probabilities with contextual features—such as current follicular phase length—to generate more nuanced contraceptive guidance. -\paragraph{Pregnancy Use-Case.} -For the NFP use-case (i.e., attempting to conceive), all trained models achieved +\paragraph{Pregnancy Use Case.} +For the NFP use case (i.e., attempting to conceive), all trained models achieved nearly double the pregnancy rate compared to the baselines. However, at low fertility thresholds, the baseline models showed higher efficiency in terms of pregnancies per 1000 intercourse events. @@ -220,18 +230,13 @@ The number of correct deferrals, days correctly identified as non-fertile, rose again suggesting that users may benefit from personalized thresholds depending on the intensity of their conception efforts. -Most related studies report pregnancy outcomes over 12 cycles, which we assume to represent roughly one year. -We use the 100 user-years metric for consistency. -Since fertility status of couples in our dataset is unknown, we assume that all included users are generally fertile. - -Related research usually refers to pregnancies per 100 women over 12 cycles. -We assume that, on average 12 cycles represent one year, and thus use the 100 user-years metric as comparison. -We cannot make any assumptions about the fertility of couples in our study, thus we assume that all users sampled -are generally able to conceive. +Most related studies report pregnancy outcomes over 12 cycles, which I assume to represent roughly one year. +I will use the 100 user-years metric for consistency. +Since fertility status of couples in my dataset is unknown, assume that all included users are generally fertile. Among commercial fertility monitors, pregnancy rates over 12 cycles range from 68\% to 72\% (with additional cervical mucus tracking)~\cite{bouchard_achieving_2018}. -Our method reaches approximately 80\%, without requiring additional measures, +My method reaches approximately 80\%, without requiring additional measures, placing it at the upper end of current non-invasive fertility prediction tools. Interestingly, control group results show that high pregnancy rates are achievable @@ -241,7 +246,7 @@ with literature estimates that ~85\% of couples conceive within a year without timing-based intervention~\cite{pfeifer_optimizing_2017}. The benefit of model-based prediction becomes more evident when examining efficiency. -While most related work ignores intercourse frequency, our results show that +While most related work ignores intercourse frequency, my results show that trained and baseline models significantly outperform the control group in pregnancies per 1000 intercourse events. At mid-range threshold values, trained models demonstrated a four-fold increase in efficiency, indicating that model guidance can substantially optimize the effort-to-outcome ratio for couples trying to conceive. @@ -251,7 +256,7 @@ The same pregnancy rate over one year can represent conception in the first or t which has practical significance for users. Including this temporal dimension would allow for a more detailed comparative analysis. -As in the contraception use-case, all results are based on statistical assumptions +As in the contraception use case, all results are based on statistical assumptions that may not fully hold in real-world scenarios. Therefore, findings should be interpreted accordingly. A more detailed investigation of these assumptions, along with further medical interpretation, diff --git a/thesis/sections/introduction.tex b/thesis/sections/introduction.tex index 08fa6fc..97b5fbd 100644 --- a/thesis/sections/introduction.tex +++ b/thesis/sections/introduction.tex @@ -54,8 +54,9 @@ This allows for more reliable detection of subtle thermal shifts associated with This study aims to advance fertility prediction by leveraging an extensive database of more than 40,000 menstrual cycles, covering cycle lengths 11 to 149 days and ovulation days ranging from 7 to 136, recorded using an intravaginal wearable device that continuously measures core body temperature at a resolution of 288 measurements per day. -The objective is to develop a machine learning model that performs reliably across diverse cycle types, including irregular ones. -To this end, we compare a set of time series-based machine learning architectures and evaluate their performance for +The objective is to develop a machine learning model that predicts the fertility for any given day and +performs reliably across diverse cycle types, including irregular ones. +To this end, I will compare a set of time series-based machine learning architectures and evaluate their performance for NFP and contraception. This thesis addresses this gap by providing the first large-scale, systematic comparison of LSTM and diff --git a/thesis/sections/methodology.tex b/thesis/sections/methodology.tex index 56828f2..6817c66 100644 --- a/thesis/sections/methodology.tex +++ b/thesis/sections/methodology.tex @@ -6,9 +6,9 @@ Despite promising results in earlier studies, ovulation prediction remains constrained by small datasets, assumptions of cycle regularity, and opaque modeling approaches. -To address these limitations, we develop a data-driven framework based on a large, +To address these limitations, I develop a data-driven framework based on a large, heterogeneous dataset of real-world menstrual cycles. -Our approach emphasizes model transparency, adaptability to irregular patterns, and the predictive utility of +My approach emphasizes model transparency, adaptability to irregular patterns, and the predictive utility of high-resolution core body temperature measurements. The overall goal is to train a model to predict the fertility-probability and information about the ovulation for a given day, only relying on past information prior to that day. @@ -53,11 +53,14 @@ The algorithm operates in two stages: This retrospective labeling provides a practical and scalable proxy for ground truth, enabling training and evaluation across a large, real-world dataset, particularly given that temperature is a well-established retrospective marker of ovulation. In internal evaluations, the estimated ovulation day fell within a \(\pm\)2-day window of the expert reference in approximately 86\% of labeled cycles. - These labels serve as the supervisory signal for model training and evaluation. -We acknowledge the limitations of this method: ambiguous or noisy temperature patterns, due to illness, dropout, -or sensor error, may result in noisy labels, which can affect downstream model performance. -However, label quality is continuously reviewed and may be refined iteratively as model performance improves. + +It is important to note that the labeling algorithm infers ovulation retrospectively from the full temperature curve. +While this approach is practical for large-scale annotation, +it means that the labels represent an approximation rather than a clinical gold standard (e.g., ultrasound or daily LH testing). +Consequently, the trained models learn to reproduce these retrospective estimates, which may deviate from the true +physiological ovulation day in some cycles. +This limitation is addressed further in the Discussion. The next section details how these labels are incorporated into feature representations and model training. @@ -169,7 +172,7 @@ They represent real-time physiological signals from which the model must infer o These derived features summarize local trends or extrema in the temperature signal, reducing the burden on the model to learn such patterns from raw data. Special care was taken, so that the sliding window can only look backwards, so that no data leakage can happen. -We extend each windowed feature at the beginning with the starting value, so that the window can be calculated for the first real value already. +I extend each windowed feature at the beginning with the starting value, so that the window can be calculated for the first real value already. The 1-day window length reflects the expected circadian cycle and strikes a balance between temporal sensitivity and signal stability. Figure~\ref{fig:methodology_observable_features} illustrates the behavior of all observable features within a single cycle. @@ -183,7 +186,7 @@ For this study, the following exogenous variables are used: \begin{itemize} \item \textbf{Fertility / Pregnancy Probability} — The estimated probability of conception from unprotected intercourse on the current day. - \item \textbf{Ovulation-Over Indicator} — A binary variable indicating whether ovulation has already occurred in the current cycle. + \item \textbf{OV-over Indicator} — A binary variable indicating whether ovulation has already occurred in the current cycle. \end{itemize} \begin{figure}[htbp] @@ -191,7 +194,7 @@ For this study, the following exogenous variables are used: \includegraphics[width=0.9\textwidth]{resources/figures/methodology/methodology_target_features} \caption{ Target features plotted for a single cycle. - The ovulation-over indicator switches on the day of ovulation; + The OV-over indicator switches on the day of ovulation; the fertility probability follows a curve based on known day-specific fecundability~\cite{dunson_day-specific_1999}. } \label{fig:methodology_target_features} @@ -202,17 +205,17 @@ The combination of these two targets is intended to provide the user with both p A fertility probability near zero could mean that ovulation is either in the past or still ahead—information the model alone cannot disambiguate. Figure~\ref{fig:methodology_target_features} shows an example cycle where the target feature values during the course of a cycle can be seen. -The \textit{ovulation-over indicator}, by contrast, explicitly marks the post-ovulatory phase, but does not describe conception risk. +The \textit{OV-over indicator}, by contrast, explicitly marks the post-ovulatory phase, but does not describe conception risk. Together, the two outputs offer complementary information and improve interpretability for real-time user-facing applications. As discussed in Section~\ref{sec:discussion}, all predictions are subject to further interpretation before presentation in the product interface. The model outputs represent data-driven estimates and do not constitute medical advice or diagnostic statements. -Although the models were trained to predict both targets, and fertility-probability as well as the ovulation-over indicator +Although the models were trained to predict both targets, and fertility-probability as well as the OV-over indicator are relevant for actual application of the models, the primary focus of this thesis lies on the fertility-probability target, which is more central to the research objectives. -The ovulation-over indicator is included due to its practical relevance for potential real-world applications, -but it is not analyzed in depth, as it lies outsize the core scope of scientific investigation. +The OV-over indicator is included due to its practical relevance for potential real-world applications, +but it is not analyzed in depth, as it lies outside the core scope of scientific investigation. \begin{table}[htbp] \centering @@ -257,11 +260,12 @@ but it is not analyzed in depth, as it lies outsize the core scope of scientific All features were normalized based on their empirical distributions. A \textit{standard scaler} was applied to approximately normal features without outliers, a \textit{robust scaler} was used for distributions with outliers, and a \textit{MinMax scaler} was used for all others. -Different Scalers were used for the train, validation and test sets to avoid data leakage. +All scalers were fit on the training set only and applied to the validation and test sets to avoid data leakage. + For the final data matrix, all features are stacked per timestep. The static features are repeated for each timestep. -We are aware of possible inefficiencies here. +I am aware of possible inefficiencies here. A side channel for static features might improve predictive efficiency and potential quality, but this was left out to keep the interfaces the same for compatibility purposes between all tested models @@ -332,11 +336,11 @@ for the prediction as no information is present. Figure~\ref{fig:methodology_padding_example} shows an example of such padding during early-cycle input preparation. -This input strategy supports efficient, temporally-aware learning and allows us to evaluate how predictive accuracy evolves over time within each cycle. +This input strategy supports efficient, temporally-aware learning and allows me to evaluate how predictive accuracy evolves over time within each cycle. \subsection{Model Architecture and Selection}\label{subsec:model_architecture_and_selection} -The primary objective of this study is to find models that accurately predict the features introduced in~\ref{fig:methodology_target_features}, +The primary objective of this study is to find models that accurately predict the features introduced in Figure~\ref{fig:methodology_target_features}, based on the historical data and context variables. This task presents several modelling challenges: capturing temporal dependencies across varying cycle lengths, handling irregular menstrual patterns and adapting to user-specific variability. @@ -348,8 +352,8 @@ Ultimately, the models used in this study were selected based on their ability t \item Generalize across users while incorporating personalized cycle context \end{itemize} -In this section we will introduce the base architectures \textbf{Long-Short-Term-Memory Models} and \textbf{Transformer Models}. -Additionally, we'll show, how the convolutional hybrids extend their functionality. +In this section I will introduce the base architectures \textbf{Long-Short-Term-Memory Models} and \textbf{Transformer Models}. +Additionally, I will show, how the convolutional hybrids extend their functionality. \subsubsection{LSTM-Architecture}\label{subsubsec:lstm_architecture} \begin{figure}[htbp] @@ -365,7 +369,7 @@ Recurrent neural networks, particularly LSTMs, were tested for their ability to Their sequential memory structure allows them to retain information across cycle days, but they may struggle with high-resolution input and longer sequences. LSTMs, in particular, have a long history of strong performance in sequence prediction tasks. For this study, a stack of LSTM layers was followed by a linear projection layer, mapping the hidden state at the final time -step to the two target variables: fertility probability and ovulation-over indicator. +step to the two target variables: fertility probability and OV-over indicator. Figure~\ref{fig:methodology_lstm_architecture} shows the overall architecture pipeline used for the LSTM-based model. The stacked inputs and outputs denote the batch processing of the model. @@ -376,7 +380,7 @@ Model-specific architectural parameters are: \item \textbf{Number of Layers} — Depth of the LSTM stack. \end{itemize} The specific values and tuning ranges for these parameters are discussed in Section~\ref{subsubsec:hyperparameter_tuning}. -A fixed dropout rate of \(p = 0.5\) has been selected for each LSTM-layer expect the last, +A fixed dropout rate of \(p = 0.5\) has been selected for each LSTM-layer except the last, as was shown to be an effective value~\cite{pham_dropout_2014} \subsubsection{Transformer Architecture}\label{subsubsec:transformer_architecture} @@ -405,8 +409,8 @@ A future direction could investigate the impact of omitting it in such naturally Since the task does not require sequence-to-sequence modeling, only the encoder part of the Transformer is used. Its output—one vector per input token—is aggregated via 1D adaptive average pooling, resulting in a single vector representation per sequence. This vector is then passed through a linear projection layer to produce the two target outputs: -fertility probability and ovulation-over indicator. -Note, that in contrast to the original use case of machine-translation, no special tokens are necessary here, as we do not perform sequence-to-sequence prediction. +fertility probability and OV-over indicator. +Note, that in contrast to the original use case of machine-translation, no special tokens are necessary here, as no sequence-to-sequence prediction is performed here. Figure~\ref{fig:methodology_transformer_architecture} shows the overall architecture. The stacked inputs and outputs indicate batch processing. @@ -472,7 +476,7 @@ The training process is organized into distinct \textit{runs}, each representing Within a run, variable parameters, such as input sequence length, hidden layer size, dropout rate, or specific feature subsets, are swept across predefined value ranges. -We define 3 runs for each base architecture and 2 for each convolutional architecture. +I define 3 runs for each base architecture and 2 for each convolutional architecture. \begin{itemize} \item \textbf{Input-Sequence-Length Run:} explores different input sequence lengths \item \textbf{Input Resolution Run:} explores different input resolutions (only for base architectures) @@ -596,8 +600,8 @@ based on the MSE of the fertility-probability target during the fertile days. These model configurations will then be used for further evaluations. \vspace{0.5em} -We acknowledge that interactions between input and model parameters may influence final model performance, -and our two-stage tuning procedure may miss globally optimal combinations. +I acknowledge that interactions between input and model parameters may influence final model performance, +and my two-stage tuning procedure may miss globally optimal combinations. \subsubsection{Training Details}\label{subsubsec:training_details} @@ -616,7 +620,7 @@ Each model was trained for up to 30 epochs, with early stopping based on validat \subsection{Evaluation}\label{subsec:evaluation} -To meaningfully compare model performance, we define a set of metrics according to the research objectives, +To meaningfully compare model performance, I define a set of metrics according to the research objectives, that capture both overall accuracy and behavior at key points in the prediction sequence as well as cover the use cases introduced in~\ref{subsubsec:practical_use_cases}. This includes metrics for different temporal segments, such as before and after the ovulation, enabling a more detailed understanding of model strengths and limitations. @@ -638,7 +642,7 @@ In many cases, it remains unclear whether proposed models genuinely outperform s \subsubsection{Evaluation Metrics}\label{subsubsec:evaluation_metrics} -The base metric used for all categories is the mean squared error (MAE), +The base metric used for all categories is the mean squared error (MSE), which describes the average squared deviation of the prediction from the target value, and is defined as: \begin{align} @@ -653,7 +657,7 @@ This is particularly relevant for model comparison, where disproportionate error Moreover, since the fertility probability target was trained using an MSE-based loss function, this metric directly reflects the optimization objective. -To complement this, we also report the mean squared error (MAE): +To complement this, I also report the mean squared error (MAE): \begin{align} \text{MAE} = \frac{1}{n} \sum_{i=1}^{n} \left| y_i - \hat{y}_i \right| \end{align} @@ -662,18 +666,18 @@ where \(y_i\) is the observed value and \(\hat{y}_i\) the predicted value. MAE was selected for its intuitive interpretability. In particular, the fertility probability target lends itself well to an absolute error interpretation, making MAE a natural choice for evaluating prediction accuracy. -However, we will only be using the MAE as a secondary metric, as we will base our further interpretation of -the model performances on the use-case evaluations, that provide inherent real-world interpretability. +However, I will only be using the MAE as a secondary metric, as I will base my further interpretation of +the model performances on the use case evaluations, that provide inherent real-world interpretability. -We considered including the coefficient of determination (\(R^2\)) as an evaluation metric. -However, we found that the target windows frequently exhibited very low variance, +I considered including the coefficient of determination (\(R^2\)) as an evaluation metric. +However, I found that the target windows frequently exhibited very low variance, a condition under which \(R^2\) becomes unstable and potentially misleading. -As a result, we decided to exclude it from our evaluation. +As a result, I decided to exclude it from my evaluation. To enable a more nuanced comparison of model performance, -we complement the overall error metrics with targeted evaluations at biologically relevant subregions of the prediction sequence. +I complement the overall error metrics with targeted evaluations at biologically relevant subregions of the prediction sequence. -This decomposition allows us to identify localized strengths and weaknesses in different models, +This decomposition allows me to identify localized strengths and weaknesses in different models, for example, a model may accurately capture the onset of fertility but underperform closer to ovulation. It also facilitates a clearer comparison of false-positive tendencies, @@ -681,13 +685,13 @@ i.e., days that are not fertile but are misclassified as such by the model. These insights are important for understanding practical limitations and choosing appropriate models depending on the intended clinical or user-facing application. -In addition, we stratify each metric by the number of past cycles available as context, +In addition, I stratify each metric by the number of past cycles available as context, to assess how model performance varies with different amounts of historical information. This aspect is especially relevant for users with irregular cycles, where models may learn user-specific patterns to different degrees, potentially leading to divergent prediction behavior. -Tables~\ref{tab:fertility_mae_metrics} and~\ref{tab:ov_over_mae_metrics} summarize the metrics used for evaluating the fertility probability and ovulation-over targets, respectively. +Tables~\ref{tab:fertility_mae_metrics} and~\ref{tab:ov_over_mae_metrics} summarize the metrics used for evaluating the fertility probability and OV-over targets, respectively. \begin{table}[htbp] \centering @@ -735,43 +739,46 @@ Tables~\ref{tab:fertility_mae_metrics} and~\ref{tab:ov_over_mae_metrics} summari Post-OV & MAE after the ovulation. \\ \bottomrule \end{tabular} - \caption{Evaluation metrics of the ovulation-over target based on mean squared error (MSE) and mean absolute error (MAE) at various intervals across the predicted fertility window.} + \caption{Evaluation metrics of the OV-over target based on mean squared error (MSE) and mean absolute error (MAE) at various intervals across the predicted fertility window.} \label{tab:ov_over_mae_metrics} \end{table} \subsubsection{Best Model Configuration Selection}\label{subsubsec:methodology_best_model_config_selection} Based on the results from the input window length, input resolution, -and model parameter space exploration, we selected a single best configuration for each model architecture to carry forward. +and model parameter space exploration, I've selected a single best configuration for each model architecture to carry forward. This step was necessary to keep the computational effort manageable, as exhaustively testing all possible configurations for every subsequent metric would have been prohibitively expensive. Selection was based primarily on the \textbf{Fertility-Overall MSE} metric, as it most directly reflects the main objective of this study: predicting fertility, -and we want to penalize larger errors more, as they are much more problematic for our use-case scenarios. +and I want to penalize larger errors more, as they are much more problematic for my use case scenarios. In cases where the difference between configurations was small (less than \(\pm\) 5\% metric value), -we preferred the option that aligned with the general tendency of the model architecture. -For example, if an architecture consistently performed better with more input data or longer sequences, -but the Fertility-Overall MSE was only marginally better for a shorter window, we selected the longer window. +I prefer the option that aligned with the general tendency of the model architecture. +For example, if an architecture consistently performs better with more input data or longer sequences, +but the Fertility-Overall MSE is only marginally better for a shorter window, I'll selected the longer window. This selection process was applied to all tested parameters—input window length, input resolution, and model complexity. The resulting configurations were then used in the irregular cycles study and the use case evaluation. \paragraph{Uncertainty estimation.} -We report point estimates on a held-out test set. -Because per-user (or per-cycle/day) predictions were not retained, we cannot compute confidence intervals or paired significance tests. +I'll report point estimates on a held-out test set. +Because per-user (or per-cycle/day) predictions were not retained, I cannot compute confidence intervals or paired significance tests. All model comparisons are therefore descriptive rather than inferential. +\paragraph{Calibration.} While MSE (Brier score) is reported, model calibration (e.g., reliability +curves) was not assessed and is left for future work alongside prospective validation. + \subsubsection{Regular and Irregular Cycles}\label{subsubsec:methodology_regular_and_irregular_cycles} A perfectly regular menstrual pattern does not require a sophisticated algorithm to predict ovulation— the next ovulation day is likely to be identical or very close to the previous one. To evaluate how different algorithms handle varying degrees of cycle variability, -we compare model performance on two distinct user groups: one with highly regular cycles and another with highly irregular cycles. +I compare model performance on two distinct user groups: one with highly regular cycles and another with highly irregular cycles. These groups are defined by the standard deviation of the ovulation day across cycles. -Specifically, we select the 100 users with the lowest standard deviation (regular group) +Specifically, I have selected select the 100 users with the lowest standard deviation (regular group) and the 100 users with the highest standard deviation (irregular group). -This comparison allows us to assess not only overall performance, +This comparison allows me to assess not only overall performance, but also whether ovulation can be meaningfully predicted in the presence of strong temporal irregularity. For a user to be included in the analysis, they must have at least five completed cycles. @@ -779,12 +786,12 @@ Additionally, ovulation must occur no later than cycle day 150, as later values biologically atypical cases that fall outside the scope of this study. \subsubsection{Use Case Evaluation}\label{subsubsec:use_case_evaluation} -We further evaluate the two distinct use cases introduced in Section~\ref{subsubsec:practical_use_cases}. +I further evaluate the two distinct use cases introduced in Section~\ref{subsubsec:practical_use_cases}. For this purpose, two specialized evaluation algorithms were developed, enabling comparability between models and providing interpretable performance metrics for each scenario. -\paragraph{Contraception Use-Case:} -For evaluating contraceptive effectiveness, we developed an algorithm inspired by the classical \emph{Pearl Index}, +\paragraph{Contraception Use Case:} +For evaluating contraceptive effectiveness, I have developed an algorithm inspired by the classical \emph{Pearl Index}, initially proposed by~\citeauthor{pearl_factors_1933} in~\citeyear{pearl_factors_1933}~\cite{pearl_factors_1933}. \begin{figure}[htbp] @@ -797,14 +804,14 @@ initially proposed by~\citeauthor{pearl_factors_1933} in~\citeyear{pearl_factors \end{figure} Figure~\ref{fig:methodology_use_case_contraception_decision_diagram} illustrates the decision logic of the evaluation algorithm. -The fertility threshold can be adjusted, as will be explored in Section~\ref{subsec:use_case_evaluation_results}. +The fertility threshold can be adjusted, as will be explored in Section~\ref{subsec:rq4_use_case_evaluations}. A day-specific probability of intercourse is computed for each user based on age distributions reported by~\cite{twenge_declines_2017}. -We assume, that the users don't have any health-related or non-health-related issues affecting fertility. +I assume that the users do not have any health-related or non-health-related issues affecting fertility. If a user's age is unknown, it is randomly drawn from the overall dataset distribution. Only users with at least one continuous year of data are included. -To get a representative result, we use 100 randomly selected user years. +To get a representative result, I will use 100 randomly selected user years. -Each day of data for a full year we count the following states by the algorithm: +Each day of data for a full year I've counted the following states by the algorithm: \begin{itemize} \item \emph{Sex}: Intercourse occurred. \item \emph{Pregnancy}: fertility prediction allowed intercourse during a potentially fertile period, and it led to a pregnancy. @@ -817,13 +824,13 @@ This categorization captures both the contraceptive accuracy (avoiding pregnancy An algorithm achieving perfect contraceptive accuracy by always recommending abstinence would score highly but significantly limit user acceptability and utility. -To add a control group, we compute the potential pregnancies and number of sexual intercourse without using the models predictions, +To add a control group, I will compute the potential pregnancies and number of sexual intercourse without using the models predictions, i.e., the group does not use any contraception. In this case, sexual intercourse can happen unrestricted on every day. -\paragraph{Pregnancy Use-Case:} +\paragraph{Pregnancy Use Case:} -For the pregnancy use-case, we developed a complementary algorithm to evaluate model performance for users attempting to conceive. +For the pregnancy use case, I have developed a complementary algorithm to evaluate model performance for users attempting to conceive. \begin{figure}[htbp] \centering @@ -835,16 +842,16 @@ For the pregnancy use-case, we developed a complementary algorithm to evaluate m \end{figure} Figure~\ref{fig:methodology_use_case_pregnancy_decision_diagram} illustrates the decision logic of this algorithm. -The fertility threshold is adjustable and is explored further in Section~\ref{subsec:use_case_evaluation_results}. +The fertility threshold is adjustable and is explored further in Section~\ref{subsec:rq4_use_case_evaluations}. Since sexual intercourse frequency differs slightly for couples trying to conceive~\cite{gaskins_predictors_2018}, -we assume an average frequency of six times per month. +I assume an average frequency of six times per month. -We assume no health-related fertility impairments for comparative simplicity, -though we acknowledge that real-world fertility is influenced by numerous complex factors. +I assume no health-related fertility impairments for comparative simplicity, +though I acknowledge that real-world fertility is influenced by numerous complex factors. Similar to the contraception scenario, only users with at least one continuous year of data are considered. -For representative results, we use 100 randomly selected user years. +For representative results, I will use 100 randomly selected user years. -For each day in a full year we count occurrences of the following states: +For each day in a full year I will count occurrences of the following states: \begin{itemize} \item \emph{Sex}: Intercourse occurred \item \emph{Pregnancy}: Correct fertile prediction, intercourse occurred, resulting in pregnancy. @@ -855,19 +862,39 @@ For each day in a full year we count occurrences of the following states: This classification measures both fertility prediction accuracy and the impact of incorrect deferrals. A model overly predicting fertility would increase potential pregnancy rates but negatively affect usability and trust due to misdirected efforts. -For the pregnancy case, we also compute a control group. +For the pregnancy case, I will also compute a control group. Here, every day is considered potentially fertile and thus allows for intercourse. \subsection{Ethical Considerations}\label{subsec:ethical_considerations} -This study was conducted using pseudonymized data collected in accordance with the terms of service and privacy policy of the data provider, VivoSensMedical GmbH (Leipzig, Germany). -All users whose data were included had consented to the use of their recordings for analytical purposes at the time of data collection. +The use of machine learning for fertility prediction raises important ethical +considerations due to the sensitive nature of reproductive health data and +the potential consequences of incorrect predictions. +While this thesis focuses on technical feasibility, the clinical and societal context must +also be addressed. \\ -The study protocol was reviewed and approved by the provider's internal legal and scientific advisory team, -which is responsible for ensuring ethical and regulatory compliance. +\noindent\textbf{User safety and risk of harm.} Fertility prediction errors have +asymmetric consequences: a false negative in contraception use may lead to +unintended pregnancy, while a false positive in conception support may cause frustration but less direct harm. +Any system derived from this research must therefore prioritize safety, adopt conservative thresholds for contraceptive +contexts, and clearly communicate uncertainty to users. +Importantly, predictions presented here are research results only and do not constitute medical advice. \\ -All data used in this study were pseudonymized prior to access. -No personal identifiers or sensitive metadata were included. -Additional safeguards were implemented to ensure data confidentiality and integrity, -including restricted access and use solely for the purposes of model development and evaluation. -No compensation was provided to participants, as the data were originally collected as part of routine usage under the agreed terms. \ No newline at end of file +\noindent\textbf{Data privacy and autonomy.} The dataset contains highly sensitive, personal health information. +All data were pseudonymized, processed under strict privacy safeguards, and used exclusively for research and product +improvement by the device manufacturer. +Even so, the possibility of re-identification in health datasets cannot be fully excluded. +Future deployments must adhere to the highest standards of data protection and give +users transparent control over how their information is used. \\ + +\noindent\textbf{Equity and generalizability.} The dataset reflects users of a single +device and may not represent the diversity of menstrual patterns across +populations, ages, and health conditions. +Models trained here may therefore perform differently across groups. +Explicit fairness evaluations and diverse validation cohorts are essential before any clinical or consumer application. \\ + +\noindent\textbf{Commercial and clinical responsibility.} The data partner in this +work is a medical device company, which underscores the need to guard against commercial bias. +Results should be independently validated, and any translation into clinical or consumer use must be preceded by prospective, +peer-reviewed trials. +Without such validation, deploying fertility prediction tools risks undermining trust and causing harm. \\ diff --git a/thesis/sections/related_work.tex b/thesis/sections/related_work.tex index 5cf06e0..6e557d1 100644 --- a/thesis/sections/related_work.tex +++ b/thesis/sections/related_work.tex @@ -5,9 +5,9 @@ \section{Related Work}\label{sec:related_work} This section will introduce related work of both ovulation detection and ovulation prediction. -First, we'll introduce early work on the detection of the ovulation based on biomarkers. -Then, we'll show how others have used body temperature to predict ovulation and what their limitations are. -Lastly, we will take a closer look at related work that uses other biomarkers as base, or as an addition to the body +First, I will introduce early work on the detection of the ovulation based on biomarkers. +Then, I will show how others have used body temperature to predict ovulation and what their limitations are. +Lastly, I will take a closer look at related work that uses other biomarkers as base, or as an addition to the body temperature for ovulation and fertility prediction. A variety of approaches have historically been explored for ovulation detection and prediction, @@ -88,7 +88,7 @@ an architectural comparison. Results show an edge for the random forest model with a reported 87\% accuracy and AUC-ROC (area under the receiver operating characteristic curve) of 0.96 for the three class approach. The four class approach significantly reduced accuracy to 68\% and AUC-ROC of 0.77. -There was no separation into cycle groups and all cycles were in a regular group, with a mean lengths of 28 days (SD: 1.65). +There was no separation into cycle groups and all cycles were in a regular group, with a mean length of 28 days (SD: 1.65). There are some additional studies based on commercial products, such as \emph{Oura Ring}\cite{thigpen_oura_2025} or \emph{Natural Cycles}\cite{bull_real-world_2019} that work with temperature data as a base. diff --git a/thesis/sections/results.tex b/thesis/sections/results.tex index 8585aa6..c926c61 100644 --- a/thesis/sections/results.tex +++ b/thesis/sections/results.tex @@ -8,9 +8,9 @@ \subsection{Objective 1: Comparative Study of Model Architectures}\label{subsec:rq1_temp_predictive_value} -We systematically evaluated multiple model architectures to assess their performance in +I have systematically evaluated multiple model architectures to assess their performance in predicting the targets. -We mainly report results for the fertility probability target. +I mainly report results for the fertility probability target. Results for the second target, an indicator that ovulation has already occurred (OV-Over), can be found in Appendix~\ref{sec:appendix_ov_over_results} @@ -19,17 +19,21 @@ The best-performing configurations for each architecture were selected for downs Unless stated otherwise, \textbf{MSE} is the primary metric (equivalent to the Brier score for probabilistic targets), and \textbf{MAE} is secondary. -All metrics reported in this section are point estimates without confidence intervals; therefore, comparisons are descriptive. +While models were compared on the same user-disjoint test set, predictions were not retained at the per-user level, +which prevents the computation of confidence intervals or paired significance tests. +Reported differences between models and thresholds should therefore be interpreted descriptively rather than inferentially. +Future evaluations should retain user-level predictions to enable bootstrap confidence intervals and paired comparisons, +ensuring robust quantification of uncertainty. \subsubsection{Fertility-Probability Prediction}\label{subsec:fertility_probability_prediction} -We analyze model performance in predicting fertility probability, +I have analysed model performance in predicting fertility probability, focusing on the influence of temporal context (window length), measurement resolution, and model capacity. \paragraph{Impact of input window length.} Across all architectures, predictive performance is sensitive to the temporal context length, but the optimal window varies by model. -We consider 10 days short, 20--40 medium and 80--160 long input windows. +I consider 10 days short, 20--40 medium and 80--160 long input windows. The \textbf{LSTM} performs best with long context: at 160 days, it reaches the lowest fertile-day MSE (0.0102) and a competitive overall error(0.0043). The lowest non-fertile-day MSE (0.0013) is tied between LSTM and Convolutional LSTM, both at 20 days. @@ -79,10 +83,10 @@ full results including MAE are provided in Appendix Table~\ref{tab:fertility_res \end{table} \paragraph{Impact of input resolution.} -To assess the impact of temporal resolution, we fix the input window at 20 days and evaluate LSTM and Transformer models across a range of input rates. -We exclude convolutional models from this comparison, as they always receive the full-resolution input (288 values/day) and learn temporal compression internally. +To assess the impact of temporal resolution, I have fixed the input window at 20 days and evaluate LSTM and Transformer models across a range of input rates. +I have excluded convolutional models from this comparison, as they always receive the full-resolution input (288 values/day) and learn temporal compression internally. -We consider 1--8 values per day low resolution, 12--48 medium resolution and 72--288 high resolution. +I consider 1--8 values per day low resolution, 12--48 medium resolution and 72--288 high resolution. For the \textbf{LSTM}, the lowest overall MSE (0.0046) occurs at 4 values/day, while fertile-day MSE is minimized at full resolution (288/day, MSE 0.0110). @@ -125,7 +129,7 @@ Results are summarized in Table~\ref{tab:fertility_resolution_compact_mse}; full \paragraph{Impact of model parameters.} -We next evaluate how architectural complexity, i.e., hidden size, number of layers, +Next, I have evaluated how architectural complexity, i.e., hidden size, number of layers, and number of attention heads, influences performance under fixed input settings (160 days at 12/day for LSTM/Transformer, 40 days for convolutional models). Parameters are reported as (hidden size × number of layers) for LSTM models and (embedding size × number of encoders × attention heads) for Transformers. @@ -183,14 +187,14 @@ with full results in Appendix Tables~\ref{tab:fertility_results_by_model_paramet \subsubsection{Best Model Configuration Selection}\label{subsubsec:results_best_model_config_selection} -To identify the best configuration for each model architecture, we followed the procedure described in Section~\ref{subsubsec:methodology_best_model_config_selection}. +To identify the best configuration for each model architecture, I have followed the procedure described in Section~\ref{subsubsec:methodology_best_model_config_selection}. Configurations were selected based on the overall fertility MSE on the validation set, while also considering the general performance trends of each model. Tables~\ref{tab:best_configs_lstm} and~\ref{tab:best_configs_transformer} summarize the selected hyperparameters for each architecture, including input window length, temporal resolution, and model complexity. For convolutional models, the input resolution was always fixed at the full 288 measurements per day. -For the Transformer architecture, we made the decision to use longer input windows, as the performance on longer +For the Transformer architecture, I have made the decision to use longer input windows, as the performance on longer input windows was competitive to the best measured at 40 days, but includes much more context information. \begin{table}[htbp] @@ -284,7 +288,7 @@ All following prediction were made with the best model for each architecture as \label{fig:results_rq2_regular_cycle_predictions_example} \end{figure} -To visualize potential patterns in the predictions, we will show some representative prediction plots. +To visualize potential patterns in the predictions, I will show some representative prediction plots. All models have a similar predictive behaviour throughout both the regular and irregular cycles. Figure~\ref{fig:results_rq2_regular_cycle_predictions_example} shows, that all models come very close to the ground truth @@ -427,13 +431,13 @@ The Convolutional LSTM shows the lowest overall MSE, while the Transformer perfo The LSTM remains the most effective on non-fertile days. Baselines degrade more sharply in this group. -The full table with MSE and MAE for all models can be found in the appendix, Table~\ref{tab:regular_vs_irregular_fertility_results}. +The full table with MSE and MAE for all models can be found in the appendix Table~\ref{tab:regular_vs_irregular_fertility_results}. \begin{figure}[htbp] \centering \includegraphics[width=0.8\textwidth]{resources/figures/results/model_results_on_regular_cycles} \caption{ - MSE performance trends across increasing historical data availability for fertility and ovulation-over targets on regular cycles. + MSE performance trends across increasing historical data availability for fertility and OV-over targets on regular cycles. } \label{fig:results_performance_on_regular_cycles} \end{figure} @@ -442,7 +446,7 @@ The full table with MSE and MAE for all models can be found in the appendix, Tab \centering \includegraphics[width=0.8\textwidth]{resources/figures/results/model_results_on_irregular_cycles} \caption{ - MSE performance trends across increasing historical data availability for fertility and ovulation-over targets on irregular cycles. + MSE performance trends across increasing historical data availability for fertility and OV-over targets on irregular cycles. } \label{fig:results_performance_on_irregular_cycles} \end{figure} @@ -470,32 +474,36 @@ as indicated by the wider deviations from the trend lines. % ------------------------------------------------------------- -\subsection{Objective 4: Evaluating Use-Case Scenarios}\label{subsec:rq4_use_case_evaluations} +\subsection{Objective 4: Evaluating Use Case Scenarios}\label{subsec:rq4_use_case_evaluations} -We evaluated the use-case scenarios described in Section~\ref{subsubsec:practical_use_cases} using the algorithms +I have evaluated the use case scenarios described in Section~\ref{subsubsec:practical_use_cases} using the algorithms in Section~\ref{subsubsec:use_case_evaluation} across multiple fertility thresholds. Each evaluation used the same test set of 100 users (100 user-years) and was repeated for 200 iterations to get statistically more meaningful results. All results represent the means over all runs. -\subsubsection{Contraception Use-Case Results}\label{subsubsec:use_case_contraception_results} +\subsubsection{Contraception Use Case Results}\label{subsubsec:use_case_contraception_results} \begin{figure}[htbp] \centering \includegraphics[width=0.9\textwidth]{resources/figures/results/contraception_use_case_results_by_fertility_threshold} \caption{ - Contraception use-case evaluation study results by fertility threshold. + Contraception use case evaluation study results by fertility threshold. } \label{fig:results_contraception_use_case_results_by_fertility_threshold} \end{figure} Figure~\ref{fig:results_contraception_use_case_results_by_fertility_threshold} shows the outcomes of -the contraception use-case across fertility thresholds for each model architecture, along with the baselines. +the contraception use case across fertility thresholds for each model architecture, along with the baselines. The four evaluated metrics are: number of pregnancies, number of intercourse events, number of correct denials (i.e., appropriately flagged fertile days), and number of incorrect denials (i.e., fertile days incorrectly flagged as infertile). \paragraph{Potential Pregnancies.} +Potential pregnancies represent days that led to a pregnancy for a user. +This means, that each user could have multiple potential pregnancies. +For a per-user pregnancy metric, see normalized values below (pregnant users per 100-user year). + All trained models start with very low pregnancy rates (Transformer: 0, LSTM: 4) and then increase roughly linearly with the threshold, reaching between 99 (Convolutional Transformer) and 122 (Transformer) at the highest setting. @@ -504,7 +512,7 @@ The Transformer starts with the lowest pregnancy rate but rises steeply, ending with the highest number of pregnancies at threshold 0.1. By comparison, the baselines show much higher pregnancy rates throughout, starting between 103 (user-mean) and 150 (population-mean) and increasing by about 50 pregnancies over the range of thresholds. -The control group, which does not use any predictions shows very high potential pregnancy rates at 274 for 100 user years. +The control group, which does not use any predictions shows very high potential pregnancy rates at 274 for 100 user-years. Note, that the thresholds do not alter the control group, as intercourse can happen on any day by design. \paragraph{Intercourse Events.} @@ -512,7 +520,7 @@ All trained models except the LSTM begin with low values of about 1000 intercour The LSTM starts much higher, around 3000, and increases sharply, converging toward approximately 6100. All trained model variants show curved growth resembling logarithmic convergence, approaching the same upper range. In contrast, the baselines start near 6000 events and converge toward the same levels as the trained models at higher thresholds. -Here, the control group allows for 7610 intercourse events, which is also the maximum for 100 user years by design, +Here, the control group allows for 7610 intercourse events, which is also the maximum for 100 user-years by design, since no denials happen. \paragraph{Correct Denials.} @@ -533,7 +541,7 @@ while the population-mean baseline instead decreases from 1102 to around 879. \centering \includegraphics[width=0.9\textwidth]{resources/figures/results/contraception_use_case_pregnancy_statistics} \caption{ - Contraception use-case results: pregnancies per 100 users per year and per 1000 intercourse events, stratified by fertility threshold. + Contraception use case results: pregnancies per 100 users per year and per 1000 intercourse events, stratified by fertility threshold. } \label{fig:results_contraception_use_case_pregnancy_statistics} \end{figure} @@ -551,39 +559,40 @@ The Transformer, while being the best model for small thresholds, becomes worse the LSTM for the maximum tested value (0.1). \paragraph{Summary.} -In the contraception use-case, the trained models achieve substantially lower pregnancy rates than the baselines, +In the contraception use case, the trained models achieve substantially lower pregnancy rates than the baselines, though at the cost of fewer intercourse opportunities and more denials, both correct and incorrect. -This results in less pregnancies for both 100 users for a year and per 1000 intercourse events for all trained models. +This results in fewer pregnancies for both 100 users for a year and per 1000 intercourse events for all trained models. Within the trained models, Transformers and their convolutional variants perform best overall, while LSTMs lag behind across most metrics. There is an edge for the non-convolutional models for smaller thresholds that switches for higher values. -\subsubsection{Pregnancy Use-Case Results}\label{subsubsec:use_case_pregnancy_results} +\subsubsection{Pregnancy Use Case Results}\label{subsubsec:use_case_pregnancy_results} \begin{figure}[htbp] \centering \includegraphics[width=0.9\textwidth]{resources/figures/results/pregnancy_use_case_results_by_fertility_threshold} \caption{ - Contraception use-case evaluation study results by fertility threshold. + Pregnancy use case evaluation study results by fertility threshold. } \label{fig:results_pregnancy_use_case_results_by_fertility_threshold} \end{figure} -Figure~\ref{fig:results_pregnancy_use_case_results_by_fertility_threshold} presents the results for the pregnancy use-case +Figure~\ref{fig:results_pregnancy_use_case_results_by_fertility_threshold} presents the results for the pregnancy use case across varying fertility thresholds, comparing all model architectures and baselines. The four reported metrics are: number of pregnancies, number of intercourse events, number of correct deferrals (i.e., correctly flagged infertile days), and number of incorrect deferrals (i.e., fertile days incorrectly flagged as infertile). -The overall pattern mirrors the contraception use-case, but the optimization goal is reversed: +The overall pattern mirrors the contraception use case, but the optimization goal is reversed: here, a higher number of pregnancies is desirable. \paragraph{Potential Pregnancies.} -Trained models achieve substantially higher pregnancy rates than the baselines. + +Trained models achieve substantially higher potential pregnancy rates than the baselines. They begin at around 275 pregnancies for low thresholds and decline linearly to between 157 and 176 at higher thresholds. By contrast, the baselines start much lower (user-mean: 159, last-cycle: 139, population-mean: 117) and also decrease linearly, reaching 119, 102, and 71 pregnancies, respectively. This places all trained models well above baseline performance across the full threshold range. -The control group results in 261 potential pregnancies for 100 user years. +The control group results in 261 potential pregnancies for 100 user-years. \paragraph{Intercourse Events.} Trained models start with high numbers of intercourse events, near 7000, except for the LSTM which begins lower at 4252. @@ -610,7 +619,7 @@ but converging to the weakest performance among trained models at higher thresho \centering \includegraphics[width=0.9\textwidth]{resources/figures/results/pregnancy_use_case_pregnancy_statistics} \caption{ - Contraception use-case evaluation study results by fertility threshold. + Pregnancy use case evaluation study results by fertility threshold. } \label{fig:results_pregnancy_use_case_pregnancy_statistics} \end{figure} @@ -626,9 +635,9 @@ The control group attains 90 pregnant users per 100 for a year, which is on par The efficiency is much lower than both trained and baseline models with 36 pregnancies per 1000 intercourse events. \paragraph{Summary.} -In the pregnancy use-case, trained models clearly outperform baselines in terms of pregnancy rates, +In the pregnancy use case, trained models clearly outperform baselines in terms of pregnancy rates, though at the expense of more intercourse events and higher incorrect deferrals. -This results in less pregnancies per 1000 intercourse events for the trained models on smaller thresholds. +This results in fewer pregnancies per 1000 intercourse events for the trained models on smaller thresholds. However, for 100 user-years, the pregnancy rates are noticeably higher than the baselines. The LSTM underperforms relative to the Transformer-based architectures across most metrics, while the Transformer itself exhibits strong performance at low thresholds but deteriorates more rapidly with increasing thresholds. @@ -696,7 +705,7 @@ There is an edge for the non-convolutional models for smaller thresholds that sw \item Variance of predictions grow with longer context lengths. \end{itemize} -\noindent\textbf{Objective 4: Use-case Evaluations.} +\noindent\textbf{Objective 4: Use Case Evaluations.} \begin{itemize} \item \emph{Contraception:} Trained models cut pregnancies sharply vs baselines, at the cost of more denials and fewer intercourse opportunities.