Feed 0% source
Medicine AI-generated

ActiTect: a generalizable machine learning pipeline for REM sleep behavior disorder screening through standardized actigraphy.

Generated by a local model (nvidia/Gemma-4-26B-A4B-NVFP4) from a scientific paper, claim-checked against the full text. Provenance is open by design.

ActiTect: An Open-Source ML Pipeline for Automated REM Sleep Behavior Disorder Screening

Until recently, machine learning models designed to detect REM sleep behavior disorder (RBD) via wrist-worn sensors struggled to move beyond the lab. Existing tools, such as RBDAct, often failed when applied to new patient groups. In some cases, their ability to correctly balance sensitivity and specificity dropped to near chance levels when facing different clinical cohorts. This lack of generalizability is a major hurdle for using wearables to identify neurodegenerative diseases in the real world.

RBD is a critical early warning sign. It is a parasomnia (a sleep disorder characterized by abnormal behaviors) that often precedes the onset of Parkinson’s disease or dementia by up to 20 years. Currently, the gold standard for diagnosis is video-polysomnography (vPSG), which requires expensive equipment and expert manual analysis. While wrist-worn actimeters (sensors that track movement over time) offer a cheaper alternative, they have historically lacked a reliable way to handle the messy, inconsistent data they produce.

Bridging the gap between sensors and clinics

The primary obstacle to scalable screening is a lack of standardization. Different manufacturers use varying sampling rates and sensor sensitivities. Consequently, a model trained on one device might view data from another as mere noise. Furthermore, most studies rely on patient-reported sleep diaries to define sleep windows. These diaries are notoriously subjective and prone to human error.

The authors of this study argue that machine learning models will remain trapped in local environments without a way to "harmonize" this data. To achieve widespread adoption, the field needs a pipeline that does not just classify movement. It must first resolve the systematic differences in signal distribution and device-specific artifacts.

A dual-module architecture for signal harmony

The ActiTect pipeline, as illustrated in, uses a modular architecture.

Figure 1
Figure 1 ActiTect pipeline overview. (a) Preprocessing. Raw actigraphy data from different devices is standardized through a dedicated preprocessing module, which mitigates systematic differences in signal distribution and enables generalizable motion feature extraction for downstream tasks. The pipeline further performs automated detection of sleep periods and non-wear episodes, reducing the need of manual annotations and enabling consistent analysis across large-scale datasets. (b) Feature Extraction. From detected sleep bouts, we extract meaningful motion features that characterize nocturnal activity patterns relevant to RBD. Local features are computed for each activity bout, then aggregated to derive global descriptors representing the entire night. (c) Predictive Model. Each night's extracted global motion features are mapped to an RBD probability score using boosted decision trees (XGBoost). These nightly scores are then aggregated into a patient-level risk score via a custom function that combines mean-probability thresholding and majority voting. The final binary RBD prediction is obtained by thresholding each patient's aggregated risk score.

It separates data cleaning from classification to prioritize interpretability and robustness.

  1. The Preprocessing Module: This non-ML component acts as a universal translator. It performs nearest-neighbor resampling to fix timing drifts. It also applies a 4th-order Butterworth bandpass filter (a mathematical tool used to isolate specific frequency ranges) to remove electrical noise and sensor drift. Crucially, it includes an auto-calibration step. This uses the constant pull of gravity during rest to correct device-specific errors.
  2. Automated Sleep Segmentation: Instead of relying on diaries, the pipeline uses the HDCZA algorithm to detect sleep-wake cycles directly from motion data. The authors report that this automated detection aligns closely with both diaries and expert-scored PSG .
Figure 2
Figure 2 Robust preprocessing for generalizable RBD detection. Overview of preprocessing steps and validation; cohort colors match the legend (bottom center). (a) Resampling. Cumulative clock drift over recording time. Raw actigraphy signals sampled at a nominal 100 Hz show substantial timing drift due to internal clock inaccuracies. Resampling corrects this drift to within numerical precision, as evidenced by near-identical post-resampling curves across cohorts. (b) Calibration. Initial calibration error ϵ 0 vs reduction efficiency 1 -ϵ / ϵ 0 , where ϵ is the post-calibration error. Calibration is highly effective across cohorts, with mean ± SD[95%CI] efficiencies of 0 . 93 ± 0 . 04 [0 . 92 , 0 . 94] (CogTrAiL-RBD), 0 . 87 ± 0 . 04 [0 . 85 , 0 . 89] (Local Test), and 0 . 91 ± 0 . 05 [0 . 91 , 0 . 92] (OPDC). Higher initial errors yield greater correction gains. (c) Filtering. Amplitude spectral density (ASD) before (dotted line) and after (solid line) bandpass filtering, highlighting suppression of noise outside while preserving signal power within the 0 . 8-20 Hz passband. Cohort-averaged ASDs (Welch's method) align closely outside the band but show greater variability (SD shown by shaded area) within it, supporting the choice of frequency cutoffs that isolate signal-dominated activity. Retention and suppression scores were 0 . 78 ± 0 . 01 [0 . 77 , 0 . 78] / 0 . 89 ± 0 . 01 [0 . 89 , 0 . 90] for CogTrAiL-RBD data, and 0 . 73 ± 0 . 09[0 . 70 , 0 . 77] / 0 . 90 ± 0 . 01 [0 . 89 , 0 . 90] for Local Test data. (d) Sleep-Detection. Comparison of automatically detected sleep onset and wake-up times with reference values from sleep diaries (CogTrAiL-RBD, n = 756) and PSG (Local Test, n = 32). Subfigure (i) displays predicted and reference times in clock format; the closer the connecting lines are to perfectly radial, the stronger the temporal alignment. Subfigure (ii) shows a scatter plot of automated versus reference times. Strong agreement is evidenced by Pearson correlation coefficients of 0 . 994 ± 0 . 001[0 . 994 , 0 . 995] (CogTrAiL-RBD), 0 . 996 ± 0 . 001[0 . 992 , 0 . 998] (Local Test) and mean-absolute errors (in minutes) of 34 . 4 ± 40 . 9 [31 . 5 , 37 . 3] minutes (CogTrAiL-RBD), 35 . 8 ± 45 . 5 [19 . 4 , 52 . 3] (Local Test). The relatively large SDs compared to the means reflect some high-variance nights, while the narrow confidence intervals suggest that the mean error estimates remain robust at the group level.
  1. Feature Extraction: Once sleep windows are identified, the system distills raw acceleration into "interpretable motion features." These descriptors capture the physics of RBD. They include metrics for movement intensity, rhythmicity, and "spectral complexity" (a measure of how varied the movement frequencies are).
  2. The ML Classifier: These features are fed into an XGBoost model (a gradient-boosted decision tree algorithm). The model produces a probability score for each night. These scores are then aggregated into a single patient-level risk score. This aggregation is vital. As shown in [Figure 3b], combining multiple nights of data helps mitigate the natural variability of human movement.

High accuracy across international borders

The strength of the ActiTect study lies in its validation across independent datasets. The authors utilized "leave-one-dataset-out" (LODO) cross-validation. In this process, the model is trained on several sites and then tested on a completely unseen one.

The single-center model achieved a patient-level AUROC (a metric where 1.0 is perfect and 0.5 is random chance) of 0.96 during internal testing. When moved to external cohorts, the performance remained stable. The model achieved an AUROC of 0.84 in the Oxford (OPDC) cohort. It reached a striking 0.97 in the Danish (PACE) cohort [Table 2]. Even with the difficulty of generalization, the LODO cross-validation showed a consistent AUROC range of 0.84 to 0.89 .

Figure 4
Figure 4 Unified Multi-Center Model: Cross-Cohort Performance and Model Stability. (a) LODO Performance. ROC curves of the leave-one-dataset-out (LODO) cross-validation. Each curve corresponds to one fold, with one dataset held out for testing while the others were used for training. The results show consistently high discrimination across datasets, indicating robust generalization. b) Feature Ranking Stability. Spearman's rank correlation of ActiTect's inherent feature rankings across LODO folds, indicating consistently strong agreement (moderate-to-strong for OPDC holdout) and supporting the robustness of the final model. (c) Feature Selection Stability & Ablation Model performance as a function of features retained from a consensus ranking. Performance peaks around ∼ 20 features (the stable 'core'), while the mean selected count across 20 seeded runs is slightly higher 29 . 74 +1 . 42 -1 . 42 with a narrow band, indicating stable selection. Beyond this range, performance saturates and remains stable. (d) Hyperparameter Stability. Stability scores from repeated LODO runs (n=20) show that nearly all hyperparameters are highly stable, with only minor variability in a subset of hyperparameters. Overall, the training procedure converges to consistent configurations across cohorts, underscoring the robustness of the pipeline.

The model identifies genuine biological signals rather than sensor artifacts. For example, the study finds that individuals with RBD exhibit significantly shorter median movement bouts. They also show higher spectral entropy. This means their movements are more irregular and "jerky" than healthy controls [Figure 3a].

Limitations in the real world

Several hurdles remain before ActiTect can be deployed in general populations. First, the authors note that all labeled RBD data came from a single device type, the Axivity AX6. While the preprocessing logic is designed to be device-agnostic, they have not yet empirically proven that classification accuracy holds across different hardware brands.

Second, the "ground truth" used for training is imperfect. Diagnosis relied on single-night PSG recordings. The authors acknowledge that inter-rater variability (differences in how experts score the same session) could introduce noise. Third, the study focused on an enriched population. Two-thirds of participants had RBD. In a real-world screening scenario, RBD prevalence is only about 2%. This means the model's specificity (its ability to avoid false alarms) must be rigorously tested in larger, more diverse populations.

The verdict: a robust foundation for screening

ActiTect is a significant step toward scalable neurodegenerative disease screening. By focusing on the essential work of signal preprocessing, the authors have built a tool that behaves like medical infrastructure. The decision to release the pipeline as open-source via GitHub allows the community to expand its device diversity.

If you are looking to implement automated sleep analysis or build a screening tool for high-risk groups, this is a viable path. The pipeline provides a modular blueprint for turning wearable data into actionable clinical insights. Code and models are available at https://github.com/bozeklab/actitect.

Figures from the paper

Figure 3
Figure 3 Predictive RBD Modeling Results. (a) Violin plots of two selected features illustrating distributional shifts between individuals with RBD and healthy controls. P-values are computed using two-sided Mann-Whitney U tests, and effect sizes ( δ ) are reported as Cliff's delta. These features are discussed in more detail at the end of the results section. (b) ROC curves of the nested cross-validation results of the night-level prediction (left) and after aggregation to the patient level (right). The blue line indicates the mean over all folds, and the shaded area represents the 95% confidence interval. The improved performance after aggregation reflects the benefit of multi-night actigraphy and helps mitigate night-to-night variability in motor activity. (c) Calibration curve on the night level using predictions from nested cross-validation. Triangles indicate the observed positive rate per probability bin; the shaded region shows the 95% CI across folds. The predicted probabilities are well calibrated and closely reflect the true likelihood of RBD. (d) Radar plot summarizing classifier performance across multiple evaluation metrics for the external test sets. Results are shown separately for the Local Test cohort (cyan), the OPDC cohort (magenta) and the PACE cohort (dark-orange), where (iRBD) and (all-RBD) denote the respective classification tasks (see table 2), indicating robust and balanced generalization with a subtle emphasis on recall.
Figure 5
Figure D1 Spearman's rank correlations of feature importance rankings derived within individual datasets. Correlations ranged from 0.37 to 0.70, indicating moderate-to-strong agreement overall while still reflecting cohort-specific feature preferences. This variability underscores the value of pooling data to optimize the generalizability of feature sets.
Novelty
0.0/10
Impact
0.0/10
Overall
0.0/10
#medicine#clinical#machine learning#actigraphy#RBD#neurodegeneration
How this was made
Generation

Model: nvidia/Gemma-4-26B-A4B-NVFP4
Persona: academic_accessible
Template: engineering_deepdive
Refinement: 0
Pipeline: forge-1.1

Verification

Evaluator: nvidia/Gemma-4-26B-A4B-NVFP4
Score: 94% (passed)
Claims verified: 16 / 16

Translation

Model: nvidia/Gemma-4-26B-A4B-NVFP4

Hardware & cost

NVIDIA GB10 · 128 GB unified · NVFP4 · 100% local · $0 cloud
Tokens: 134,785
Wall-time: 522.6s
Tokens/s: 257.9

Next up

CaliPPer: A Post-Hoc Framework to Quantify and Improve AI Binding Prediction ...

8.7/10· 6 min