Counting Daily Loops: A Gap-Protected Winding Index for Circadian Integrity in ICU Vital Signs

Healthy physiology repeats itself every day. Heart rate, temperature and blood pressure rise and fall on a roughly 24-hour clock, so one day of data, plotted against itself with a quarter-day delay, traces a loop. In very sick patients that loop tends to shrink, wobble, or disappear. Clinical prediction models mostly ignore this. They treat vitals as a stream of values to smooth or decay, and the rhythm itself is never turned into a quantity the model can use. We propose to turn it into one. For each day, count how many times the delayed trajectory winds around the patient's own set point. That count is an integer, and it is 1 for an intact rhythm. Next to it, record how far the loop stayed from the set point compared with the noise level. That distance is a "gap" in the physicist's sense: the count is only trusted when the gap is wide enough.

The idea comes from topological charge pumping. In a Thouless pump, a quantum system cycled slowly around a closed loop of control settings moves exactly an integer number of particles per cycle. That integer does not change under smooth distortions, but only as long as the loop keeps clear of a critical point and disorder stays smaller than the energy gap (Quantized Pumping and Topology of the Phase Diagram for a System of Interacting Bosons; Interplay between disorder and topology in Thouless pumping on a superconducting quantum processor). We borrow no quantum mechanics. We borrow a design rule: summarize each cycle with a discrete invariant, and attach an explicit condition, gap larger than noise, that says when the invariant can be believed. The clinical question is whether a day on which a patient's rhythm "loses a winding" signals decompensation earlier or more reliably than existing time-series models do, and whether this signal survives the irregular, suspicion-driven sampling of real ICU charts.

Core Claim

A per-day winding number around a robustly estimated set point, gated by a normalized gap margin, is a rhythm-integrity feature with two properties that current tools lack. First, it is invariant to how the day was sampled. A winding number depends only on the order in which the loop is traversed, not on timing. It can therefore be computed from sparse, irregular observations whenever the angle between consecutive observations changes by less than half a turn, and that condition can be checked. This partly resolves the tension the research file notes between informative missingness and loop integrals (Gap 4). The gating rule also says exactly which days are too sparse or too noisy to score, and the fact that a day could not be scored becomes an informative-missingness signal in its own right. Second, a transition of the index from 1 to 0 (rhythm lost) or to an unstable value (a "phase slip") should add prognostic information for 24-hour mortality beyond strong recurrent baselines. It should matter most in the subgroup where scalar inflammatory markers saturate, such as sepsis, where the neutrophil-to-lymphocyte ratio loses discrimination (The association between the neutrophil-to-lymphocyte ratio and mortality in critical illness: an observational cohort study).

Concretely, let $x(t)$ be a detrended vital sign, let $z(t) = (x(t), x(t-\tau))$ with $\tau$ equal to a quarter period (6 hours), and let $c$ be the day's robust center, the median of $z$. The day's winding number is

$$ W = \frac{1}{2\pi}\sum_{k} \operatorname{wrap}\big(\theta_{k+1}-\theta_k\big), \qquad \theta_k = \arg\big(z(t_k)-c\big), $$

where $\operatorname{wrap}$ maps angles into $(-\pi,\pi]$. The gap margin is $g = \min_k \lVert z(t_k)-c\rVert / \hat\sigma$, where $\hat\sigma$ is a residual noise scale estimated from high-frequency fluctuations. $W$ is reported as trusted only when $g$ exceeds a threshold and no angular step comes close to $\pi$. This mirrors the pumping condition that quantization holds while disorder stays below the gap. The same approach extends to pairs of vitals, such as heart rate against temperature, instead of a single delayed signal.

Relation to Prior Work

The closest existing methods also build loops from time series with delay embeddings. TOTOPO, Topological Attention for Time Series Forecasting and ScatterAD embed the series in a delayed phase space and extract persistent-homology summaries: how large and how long-lived the loops in the point cloud are. These summaries are unordered and unsigned. They do not tell a single clean daily loop apart from a tangle of noisy small loops of similar total persistence, and they do not come with a per-cycle count or a sampling-validity condition. Our index is signed and tied to cycles, and it is gated. It asks whether this day went around once, in the right direction, clear of the center. Static persistent-homology biomarkers such as TopoTxR and WGTDA work on cross-sectional omics or images and do not address temporal rhythm. The same holds for the topological tau-PET analysis in Tau-PET abnormality change along with Alzheimer’s disease. Learning Multi-Modal Biomarker Representations via Globally Aligned Longitudinal Enrichments compresses irregular trajectories into fixed vectors through linear alignment. That makes it a representation-learning competitor for sparse longitudinal data, but its visits are months apart, so it cannot see daily cycles.

On the modeling side, GRU-D supplies the treatment of missingness we build on: time gaps and masks are signals, not noise. It works through local exponential decay and has no notion of a completed cycle. The channel-wise multitask LSTM from Multitask Learning and Benchmarking with Clinical Time Series Data supplies the benchmark tasks and the strongest published decompensation model. Circadian-entrainment modeling (Rapid Circadian Entrainment in Models of Circadian Genes Regulation; Time optimal entrainment control for circadian rhythm) motivates the premise that the rhythm is a driven limit cycle whose collapse means something. Those works study mechanistic oscillators, not noisy bedside measurements.

The pumping literature plays a constraining role as well as a motivating one. Its disorder results warn that noise does not only destroy a quantized invariant. Structured disorder can also create non-trivial transport along paths that are trivial in the clean system (Interplay between disorder and topology in Thouless pumping on a superconducting quantum processor). The clinical analogue is spurious windings: noise can wrap a trajectory around a center it never truly encircles. This is the reason the gap gate exists, and it is why we measure false-winding rates explicitly rather than assuming robustness. We deliberately do not use Floquet quasi-energy or Chern-number machinery (Topological characterization of periodically driven quantum systems; The anomalous Floquet-Anderson insulator as a non-adiabatic quantized charge pump). Vital signs have no band structure, and claiming one would be decoration.

Research Program

The work has three stages. The first is a controlled synthetic study. We simulate noisy two-variable oscillators whose amplitude slowly collapses toward the center, which is the gap closing. Measurement noise and slow drift are added, and observations are thinned by an ordering policy in which measurements become more frequent as the simulated state worsens. This mimics clinical ordering behavior. Ground truth for "rhythm present" is known. On this data we map, as a function of gap-to-noise ratio and sampling density, how often $W$ is correct, how often it produces spurious windings, and where the validity check correctly refuses to score. This yields a phase diagram with gap-to-noise ratio on one axis and sampling sparsity on the other, which sets the threshold for the gate before any clinical data is touched.

The second stage builds the clinical index on MIMIC-III and MIMIC-IV. We use charted heart rate, temperature, and systolic and mean arterial pressure. Each is detrended with a slow rolling median, embedded with a 6-hour delay, and scored per calendar-aligned 24-hour window. Each window produces a winding number, a gap margin, a validity flag, and the angular phase of the loop's peak. The day-over-day change in that phase is the analogue of a phase slip. Before any outcome modeling, we check that the index captures rhythm at all. We examine whether patients discharged alive show $W=1$ on a majority of valid days, and whether invalid days cluster in expected periods such as the first ICU day and heavily sedated stays.

The third stage tests prognostic value by adding the index as extra input channels to strong sequence models on the standard benchmark tasks. It also tests the index as a standalone risk marker within subgroups where scalar markers saturate.

Baselines

The naive reference is the logistic regression over the standard hourly features from the MIMIC-III benchmark suite. It reports an in-hospital mortality AUC-ROC of 0.848 in Multitask Learning and Benchmarking with Clinical Time Series Data. We will rerun it on our exact cohort split, because our decompensation analysis is restricted to stays long enough to contain at least two full days.

The strongest existing method for the task that matters here, decompensation or death within 24 hours, is the best neural model from the same benchmark paper, which reports an AUC-ROC of 0.911. It is the strongest competitor because it already sees the full hourly vital stream and could in principle learn rhythm features implicitly. We will retrain it with the published architecture and tune it under a fixed budget of the same number of hyperparameter trials we give our augmented variant, on identical splits. Beating it means a statistically reliable gain in AUPRC under a paired bootstrap over patients, not only in AUROC, given the imbalance that MIMIC-Extract documents, where AUPRC often falls below 0.50 while AUROC looks high.

We also run GRU-D (Recurrent Neural Networks for Multivariate Time Series with Missing Values), which reports an in-hospital mortality AUC of 0.8527. It is the natural competitor on the claim about irregular sampling, and it is retrained under the same budget. We note the much higher AUROC of 0.9410 reported for multimodal deep learning over 135 raw features in Benchmark of Deep Learning Models on Large Healthcare MIMIC Datasets. That number comes from a different feature set and cohort, so it is not directly comparable, and we will not treat it as the bar. No reported result was found on Lacuna for any circadian or winding-based feature on MIMIC decompensation.

Four feature baselines are added to the same backbone to isolate our ingredient. The first is per-day cosinor features: the amplitude, phase and fit quality of a fitted 24-hour sinusoid. The second is persistent-homology features of the same delay embedding, in the style of TOTOPO. The third is simple day-over-day delta and spline features, as used for albumin trajectories in Association between albumin changes and prognosis in older patients with acute myocardial infarction. The fourth is plain time-of-day encoding fed to GRU-D.

Two ablations target the key ingredient directly. The first removes the gate, using raw $W$ on every day. The second removes the integer, using the continuous gap margin $g$ alone. If $g$ alone matches the full index, the topological count adds nothing, and we will say so.

Why not just…?

Why not just fit a cosinor curve each day? This is the most serious threat. A collapsing loop is roughly a shrinking cosinor amplitude. Our argument is that least-squares sinusoid fits degrade under exactly the sampling ICU charts produce: sparse nights, dense bursts during deterioration, and non-sinusoidal waveforms. The winding count depends only on the order of traversal and has an explicit validity test. This is an empirical claim, not a theorem. The synthetic phase diagram and the subsampling-stability experiment below compare the two directly. If cosinor amplitude is equally stable and equally predictive, the honest conclusion is that the gate is the only contribution, and it can be applied to cosinor fits just as well.

Why not just use persistent homology on the delay embedding? Persistence already detects loops. But it scores the day's point cloud without order or orientation, and it does not separate one clean cycle from several noisy ones. Existing time-series persistence methods (Topological Attention for Time Series Forecasting; ScatterAD) report no ICU rhythm results we can point to. The head-to-head comparison as added channels settles this. We also test specifically on synthetic days with spurious small loops, where persistence should overcount.

Why not just let the recurrent network learn the rhythm itself? A channel-wise LSTM or GRU-D sees every hourly value, and 24-hour structure is learnable in principle. In practice, the 48-hour window of in-hospital mortality holds only two cycles, and decompensation models are trained on local horizons, so a daily loop-level summary may be hard to learn implicitly from limited positives. The augmented-versus-plain comparison under matched tuning answers this. If the gain vanishes once time-of-day encoding is added to GRU-D, rhythm information was already recoverable and the index is unnecessary.

Proposed Experiments and Decisive Checks

The first decisive check is stability under thinning. On real MIMIC-IV days with dense vitals, we randomly and informatively subsample observations down to clinically realistic sparsity. We then measure agreement between the index computed on full and thinned data, and compare it against the agreement of cosinor amplitude and of persistence features. The index must remain markedly more stable on the days its gate accepts, or the core robustness claim fails.

The second decisive check is incremental prognostic value on MIMIC-III decompensation for stays of at least 48 hours. We report AUROC and AUPRC for the retrained benchmark model with and without the index, under a patient-level paired bootstrap, and repeat the comparison for GRU-D. Success means an AUPRC gain that survives both ablations, raw $W$ and continuous $g$ alone. A lead-time analysis then asks how many hours before the event the first "lost winding" day appears, relative to the first alert from the baseline model at a matched false-alarm rate.

The third check is the saturation subgroup. Within patients with sepsis codes, we compare the discrimination of NLR, the index, and their combination for 28-day mortality. We follow the adjusted-model setup of the NLR study, which reports AUC rising only from 0.746 to 0.757 when NLR is added to SAPS I on MIMIC II (The association between the neutrophil-to-lymphocyte ratio and mortality in critical illness). A clear gain here would support the claim that rhythm integrity carries information that multi-lineage inflammatory markers lose.

Finally, because the gate refuses to score sparse days and sparseness correlates with care patterns, we audit acceptance rates and alert rates across racial groups. This follows the positive-rate disparity reported in An Extensive Data Processing Pipeline for MIMIC-IV, and it checks that the validity condition does not quietly import institutional testing bias.

References

  1. Quantized Pumping and Topology of the Phase Diagram for a System of Interacting Bosons
  2. Interplay between disorder and topology in Thouless pumping on a superconducting quantum processor
  3. The association between the neutrophil-to-lymphocyte ratio and mortality in critical illness: an observational cohort study
  4. TOTOPO: Classifying univariate and multivariate time series with Topological Data Analysis
  5. Topological Attention for Time Series Forecasting
  6. ScatterAD: Temporal-Topological Scattering Mechanism for Time Series Anomaly Detection
  7. TopoTxR: A Topological Biomarker for Predicting Treatment Response in Breast Cancer
  8. WGTDA: A Topological Perspective to Biomarker Discovery in Gene Expression Data
  9. Tau-PET abnormality change along with Alzheimer’s disease: a topological perspective
  10. Learning Multi-Modal Biomarker Representations via Globally Aligned Longitudinal Enrichments
  11. Recurrent Neural Networks for Multivariate Time Series with Missing Values
  12. Multitask Learning and Benchmarking with Clinical Time Series Data
  13. Rapid Circadian Entrainment in Models of Circadian Genes Regulation
  14. Time optimal entrainment control for circadian rhythm
  15. Topological characterization of periodically driven quantum systems
  16. The anomalous Floquet-Anderson insulator as a non-adiabatic quantized charge pump
  17. MIMIC-Extract: a data extraction, preprocessing, and representation pipeline for MIMIC-III
  18. Benchmark of Deep Learning Models on Large Healthcare MIMIC Datasets
  19. Association between albumin changes and prognosis in older patients with acute myocardial infarction
  20. An Extensive Data Processing Pipeline for MIMIC-IV