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.
It separates data cleaning from classification to prioritize interpretability and robustness.
- 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.
- 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 .
- 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).
- 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 .
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
How this was made
Model: nvidia/Gemma-4-26B-A4B-NVFP4
Persona: academic_accessible
Template: engineering_deepdive
Refinement: 0
Pipeline: forge-1.1
Evaluator: nvidia/Gemma-4-26B-A4B-NVFP4
Score: 94% (passed)
Claims verified: 16 / 16
Model: nvidia/Gemma-4-26B-A4B-NVFP4
NVIDIA GB10 · 128 GB unified · NVFP4 · 100% local · $0 cloud
Tokens: 134,785
Wall-time: 522.6s
Tokens/s: 257.9