A Lightweight Self-Supervised Representation Learning Framework for Depression Risk Profiling from Synthetic Daily Behavioural Trajectories ()
1. Introduction
Depression manifests through persistent disturbances in motivation, circadian rhythms, motor activity, and social engagement domains that naturally imprint themselves onto the patterns of daily life [1]-[5]. Modern smartphones and wearable devices continuously record many of these behaviours, including sleep duration, step count, communication frequency, and screen-use dynamics. As a result, digital phenotyping has emerged as a powerful paradigm for passive, real-time mental health monitoring, offering insights far beyond what traditional clinic-based assessments can capture [6]-[10]. Yet translating these rich behavioural streams into reliable indicators of depression risk remains a formidable challenge.
Several limitations hinder progress in this field. First, real-world digital phenotyping datasets are often small, noisy, and sparsely annotated, as clinical labels may be collected retrospectively or inconsistently across participants. Second, depression prevalence in naturalistic samples is typically low, leading to severe class imbalance and making it difficult for models to learn discriminative patterns [11]-[14]. Third, behavioural signals themselves are heterogeneous: device types, usage habits, and lifestyle differences introduce variability unrelated to mental health [15]-[19]. Finally, although deep learning has shown promise for modelling complex temporal patterns, deploying large models on smartphones or wearables is constrained by computational load, energy consumption, and privacy considerations [20]-[24]. Synthetic behavioural environments provide an attractive complementary pathway for overcoming these obstacles. By explicitly controlling noise sources, label distributions, and behavioural characteristics, synthetic datasets allow researchers to isolate the core methodological challenges and evaluate representation-learning techniques under reproducible conditions [25]-[27]. Such environments help clarify what behavioural signatures are theoretically discoverable and how algorithms behave when confronted with overlapping or weakly separable classes.
In this work, we pursue four objectives: 1) to construct a transparent, clinically inspired synthetic generator of daily behavioural trajectories resembling depression-related patterns; 2) to define subject-level labels derived from PHQ-9 distributions; 3) to train a lightweight self-supervised learning (SSL) encoder using contrastive learning and reconstruction on 30-day sequences; and 4) to compare the effectiveness of SSL-derived embeddings against simple raw behavioural features for distinguishing depressed from healthy individuals [28]-[30]. Our goal is to determine whether SSL can uncover distributed behavioural signatures of depression reflected across Figures 1-6 even in the presence of strong noise and overlapping behavioural distributions.
2. Methods
2.1. Synthetic Behavioural Dynamics
We consider
virtual subjects (
) monitored over
days (
). For each subject
and day
, we generate a behavioural feature vector
where
denotes the number of behavioural variables (sleep duration, step count, social interactions, screen time, and diurnal phone usage components). In total, F = 7 features per day, comprising: sleep duration (1), step count (1), social interaction count (1), total screen time (1), and three diurnal phone-usage components (morning, afternoon, evening).
Each subject has a binary depression label
with
denoting a healthy subject and
a depressed subject. Labels are drawn from a Bernoulli distribution
producing approximately 70% healthy and 30% depressed subjects, consistent with the class distribution visualized in Figure 1(A). Although real-world depression prevalence in population-level samples is often lower (5% - 15%), we selected pdep = 0.3 to ensure sufficient minority representation for stable self-supervised pre-training and downstream classifier evaluation in this proof-of-concept study. Future work should evaluate robustness under more severe imbalance conditions.
2.1.1. PHQ-9 Score Model
For each subject we simulate a PHQ-9 score
conditional on the label:
with
and moderate variances to produce overlapping yet separated distributions (Figure 1(B)). The clinical threshold at score 10 is used to verify label consistency:
This ensures that behavioural labels correspond to standard PHQ-9 definitions of non-depressed versus clinically relevant depressive symptoms [30]-[34].
2.1.2. Behavioural Feature Generation
For each feature
and subject
, the baseline daily behaviour is modelled as a Gaussian distribution conditioned on the subject label:
where:
is the label-dependent global mean (e.g., lower step count for depressed subjects).
controls inter-day variability.
denotes the weekday of day
, with
representing Monday.
encodes weekly structure (e.g., increased weekend sleep and screen time in depression).
The label-dependent means and variances were selected to approximate behavioural effect sizes reported in digital phenotyping literature. Prior studies have documented reduced step counts (15% - 30% decrease), increased sleep variability, and elevated late-evening screen engagement in individuals with depressive symptoms. Accordingly, group mean differences in the synthetic generator were calibrated to correspond to moderate standardized effect sizes (Cohen’s d ≈ 0.5 - 0.8), ensuring overlapping but non-trivially separable behavioural distributions.
For diurnal phone usage, we introduce three components morning, afternoon, evening whose daily values are drawn with time-of-day specific means:
Evening phone usage has larger means for depressed subjects, consistent with the bar plots in Figure 2(D) and Figure 4(D).
To enforce non-negativity for count-like variables (steps, interactions), we apply an element-wise rectification:
2.1.3. Behavioural Variability
Subject-level day-to-day variability for feature
is defined as the sample standard deviation:
Healthy subjects are given lower variability for some features (e.g., sleep, steps) relative to depressed subjects; their distributions are compared in Figure 2(E).
2.2. Descriptive Analyses
To contextualize the synthetic environment, we compute:
This descriptive layer verifies that depressed subjects exhibit longer sleep, reduced activity, diminished social interactions, increased evening screen time, and altered cross-feature relationships.
2.3. Self-Supervised Sequence Modelling
2.3.1. Sequence Construction
For each subject we consider the full 30-day behavioural trajectory:
The SSL encoder is trained on the set
without using labels
.
2.3.2. Data Augmentation
We employ a family
of stochastic augmentations acting on sequences:
1) Time masking: randomly zeroing out contiguous day segments.
2) Additive Gaussian noise:
.
3) Time warping/interpolation: non-linear rescaling of the time axis followed by interpolation back to length
.
For each subject
we sample two independent transformations
and create two augmented views
2.3.3. Encoder, Projection Head, and Decoder
The SSL model consists of:
A temporal encoder
implemented as a 1-D convolutional network with global average pooling and a fully connected layer.
A projection head
used only during contrastive training.
A decoder
used for reconstruction.
Given an input sequence
, the encoder outputs a latent vector
The projection head produces a contrastive representation
which is subsequently
-normalized:
The decoder reconstructs the original sequence from
:
2.4. Contrastive Objective with Reconstruction
We adopt the NT-Xent (normalized temperature-scaled cross-entropy) loss applied to pairs of augmented views. Assume a mini batch of
subjects, resulting in
augmented sequences and corresponding projection vectors
. Let
denote the two views of the same subject. Cosine similarity between two vectors is
The contrastive loss for anchor
and its positive pair
is
where
is a temperature hyperparameter. The full NT-Xent loss over the batch is
To encourage the latent representation to retain information useful for reconstructing the original sequences, we add a mean-squared reconstruction loss:
where
denotes the Frobenius norm.
The combined SSL training objective is
with
controlling the contribution of reconstruction.
In all experiments,
was set to 0.2, placing stronger emphasis on contrastive discrimination while maintaining reconstruction regularization. Preliminary sensitivity analysis across
showed stable downstream AUC, with
yielding optimal validation performance.
2.5. Latent Embeddings and Downstream Classifiers
After SSL pre-training, we discard the projection head and decoder and apply the encoder
to the original (non-augmented) sequences to obtain a single latent vector for each subject:
These vectors constitute the SSL feature matrix
For comparison, we construct simple raw features by averaging across days:
The full raw feature matrix is
We then train multiple supervised classifiers
to predict depression label
from either SSL features (
) or raw features (
):
Models considered include Random Forest, XGBoost, SVM, and Logistic Regression [35]-[39].
Given an estimated probability
, the predicted label is obtained via thresholding:
with default
.
2.6. Evaluation Metrics
We compute standard binary classification metrics on held-out data. Let
,
,
, and
denote the number of true positives, true negatives, false positives, and false negatives.
The F1-score is defined as the harmonic mean of precision and recall:
To quantify ranking performance across thresholds, we compute the area under the ROC curve (AUC):
where
denotes the discrimination threshold and
,
are the true-positive and false-positive rates.
3. Results
3.1. Behavioural Landscape and PHQ-9 Distributions
Figure 1. Class distribution and PHQ-9 score profiles of the synthetic population.
Panel 1A (left): Class distribution of healthy vs. depressed subjects.
Panel 1B (right): PHQ-9 score distributions with clinical threshold marked.
Figure 1(A) (left panel) shows that the dataset contains approximately 70% healthy and 30% depressed subjects, closely mirroring typical prevalence patterns in population-level studies.
Figure 1(B) (right panel) presents the PHQ-9 distributions for both groups. Healthy subjects cluster sharply below the clinical threshold of 10, while depressed subjects span a wide distribution across moderate to severe ranges. The overlap near the threshold reflects real-world diagnostic uncertainty, where behavioural signatures and clinical scores do not always perfectly align. Together, the two panels confirm that label assignment and score distributions are clinically coherent.
Row 1:
Panel 2A (top-left): Sleep duration trajectories
Panel 2B (top-middle): Physical activity (step count)
Panel 2C (top-right): Social interaction patterns
Row 2:
Panel 2D (bottom-left): Diurnal phone usage
Panel 2E (bottom-middle): Behavioural variability (standard deviations)
Panel 2F (bottom-right): Correlation matrix of behavioural features and PHQ-9
Figure 2. Temporal, diurnal, variability, and correlation patterns in synthetic behavioural data.
Panels 2A-2C (top row) highlight the primary temporal patterns across modalities.
In Panel 2A (top-left), healthy subjects maintain stable sleep durations (8-10 hours), whereas depressed subjects experience longer and more fluctuating sleep, often exceeding 10 hours.
Panel 2B (top-middle) reveals consistently reduced physical activity in the depressed group.
Panel 2C (top-right) shows lower social interaction levels throughout the 30-day period, reflecting reduced social engagement typical of depressive behaviour. Panels 2D-2F (bottom row) provide deeper behavioural insight. Panel 2D (bottom-left) displays diurnal phone usage averaged across subjects. Depressed individuals show a distinctive surge in evening phone use, suggesting late-night wakefulness and circadian disruption [40]-[42]. Panel 2E (bottom-middle) demonstrates that depressed subjects exhibit greater variability across all modalities-sleep, steps, social interactions, and screen time indicating behavioural instability rather than simple mean differences. Finally, Panel 2F (bottom-right) shows the correlation structure of the dataset, including a clear negative relationship between PHQ-9 scores and activity/social features, and strong positive coupling among activity-related behaviours. This confirms that the synthetic generator encodes realistic multivariate behavioural dependencies.
3.2. Performance of SSL Embeddings Versus Raw Features
Row 1:
Figure 3. Classifier performance using SSL embeddings versus raw behavioural features.
Row 2:
Panel 3A (top-left) compares ROC-AUC scores across multiple classifiers trained on either raw aggregated behavioural features or SSL-derived latent embeddings [43]-[46]. Across all models including Random Forest, XGBoost, Logistic Regression, and SVM the SSL embeddings provide substantial performance gains, often improving AUC by 0.20 - 0.35. This indicates that the self-supervised encoder captures temporal and cross-feature structure that simple daily averages fail to represent. Panels 3B-3D (top-middle to top-right) show confusion matrices for the held-out subjects. Random Forest and SVM demonstrate strong balanced discrimination between healthy and depressed subjects, while Logistic Regression performs more modestly, reflecting the inherently non-linear class separation present in the latent space [47]-[51]. Most misclassifications occur among subjects with intermediate PHQ-9 scores or behaviour patterns that do not clearly signal depression or health, highlighting the subtlety of behavioural indicators in borderline cases. Panel 3E (bottom) presents multi-model ROC curves for SSL-trained classifiers. All curves rise well above the diagonal, confirming meaningful discriminative power [52]-[54]. The SVM curve exhibits the steepest early rise, suggesting high sensitivity at lower false-positive rates. This behaviour allows clinicians or system designers to adjust thresholds to prioritize either sensitivity (recall) for safety-focused screening or specificity for resource-limited settings.
3.3. Weekly Rhythms and Diurnal Structure
Figure 4. Weekly and diurnal behavioural patterns across healthy and depressed subjects.
Row 1:
Row 2:
Figure 4 provides a structured analysis of weekly and diurnal rhythms.
In Panel 4A (top-left), healthy individuals maintain consistent sleep duration across the week, while depressed individuals show markedly increased weekend sleep, suggesting circadian irregularity and potential “catch-up” behaviour following weekday dysregulation. Panel 4B (top-right) shows that step counts for depressed subjects remain consistently lower than those of healthy individuals, with only minor weekday variation. This reflects a stable behavioural signature of reduced physical activity in depressive states. Panel 4C (bottom-left) demonstrates higher social engagement throughout the week for healthy subjects, whereas depressed individuals experience more pronounced mid-week declines, aligning with motivational and social withdrawal patterns commonly reported in clinical literature. Finally, Panel 4D (bottom-right) shows that depressed subjects exhibit significantly elevated evening phone usage, a behaviour absent in the healthy group. This diurnal asymmetry reflects disrupted sleep hygiene and increased evening rumination, reinforcing the importance of time-of-day analysis in behavioural mental-health modelling [55]-[59]. These weekly and diurnal patterns together highlight the value of modelling rhythmic structure when interpreting digital phenotyping data for mental-health assessment [60]-[62].
3.4. Latent-Space Archetypes and Clustering
Figure 5. Cluster-level behavioural archetypes derived from SSL latent embeddings.
Row 1:
Row 2:
To investigate how the self-supervised encoder organizes subjects in latent space, we apply k-means clustering to the latent embeddings
. Figures 5(A)-(D) show cluster-level averages across key behavioural dimensions.
Cluster 0 displays high activity, moderate sleep, and frequent social interactions, forming a profile predominantly aligned with healthy subjects.
Cluster 1 demonstrates low activity and low social engagement, but with relatively normal sleep patterns indicative of milder depressive expressions or subthreshold symptoms.
Cluster 2 exhibits moderate activity but disproportionately high evening screen time, consistent with digitally engaged yet behaviourally withdrawn individuals.
Panels 5A-5D (top-left to bottom-right) visually highlight these archetypes across sleep, steps, social interactions, and screen time. The emergence of such structured clusters without using depression labels during SSL training demonstrates that the encoder effectively identifies meaningful inter-subject behavioural variability beyond the binary classification boundary.
3.5. Global Geometry of SSL Representations
Figure 6. UMAP projection of SSL latent embeddings for healthy and depressed subjects.
Figure 6 presents a two-dimensional UMAP projection of the SSL-derived embeddings, with healthy subjects shown in blue and depressed subjects in red. Although the distributions overlap consistent with the subtle behavioural differences between groups the embeddings form partially distinct regions. Depressed subjects gravitate toward areas associated with longer sleep, lower activity, and increased screen time, reflecting the behavioural patterns seen in Figure 2 and Figure 4.
This geometric structure explains why downstream classifiers trained on SSL features achieve above-chance performance: the SSL encoder reshapes the high-dimensional behavioural trajectories into a more linearly separable manifold, enabling traditional classifiers to detect depression-related structure that is not clearly visible in raw feature space.
4. Discussion
This study demonstrates that a lightweight self-supervised encoder can uncover depression-related behavioural signatures from noisy, overlapping, and weakly discriminative synthetic daily trajectories. Despite being trained without access to depression labels, the SSL model learns latent representations that consistently outperform raw feature aggregates across all downstream classifiers. This finding underscores a central insight: depression is expressed not through static behavioural shifts but through temporal micro-dynamics distributed patterns of variability, rhythm disturbance, and cross-modal imbalance spanning sleep, activity, social engagement, and phone-based interaction. The mathematical formulation of the synthetic generator provides clarity on how label-dependent means, variances, weekly rhythms, and diurnal patterns give rise to the observed behavioural landscape. Importantly, the correlation analysis and PHQ-9 overlap confirm that depression cannot be inferred from isolated features or simple thresholds. Instead, meaningful detection arises from integrating multiple weak signals across time. This is precisely what SSL achieves: through augmentations and contrastive learning, behaviourally similar sequences are mapped closer together while dissimilar ones are separated, enabling the encoder to denoise, compress, and structurally reorganize the trajectories into a clinically informative latent space. From an applied perspective, the compact architecture and low computational footprint of the encoder make it feasible for deployment on smartphones and wearables, where memory and energy constraints typically preclude the use of large deep models. Once pre-trained, the encoder could operate directly on-device, generating risk-relevant embeddings from short behavioural windows. These embeddings could support real-time mental-health monitoring, adaptive intervention systems, and clinical decision-support dashboards. Nonetheless, several limitations warrant consideration. An additional limitation concerns the Gaussian assumptions embedded in the synthetic generator. Real-world digital phenotyping data often exhibit heavy-tailed distributions, burst-like behavioural events, missingness patterns, and device-specific artefacts that deviate from normality. Because the reconstruction objective implicitly assumes smooth and noise-perturbed structure, model performance in this synthetic Gaussian setting may overestimate generalization to empirical behavioural streams. Future work should incorporate non-Gaussian noise models and realistic sensor irregularities to more rigorously stress-test representation robustness. The dataset is fully synthetic; although clinically inspired, it cannot capture the full heterogeneity, contextual factors, or sensor artefacts of real-world populations. The temporal resolution is limited to daily data, whereas finer-grained (e.g., hourly) signals may reveal richer early-warning structure. Moreover, the current formulation models depression as a binary outcome, omitting symptom trajectories, remission patterns, comorbidities, and individual differences in behavioural expression. Future work should therefore focus on: (i) calibrating the generator using empirical statistics from real digital phenotyping cohorts, (ii) extending the framework to multi-label or continuous severity prediction, (iii) integrating additional data streams such as GPS-derived mobility, speech acoustics, keyboard dynamics, or physiological sensing, and (iv) testing generalization under strict subject-wise cross-validation on real-world datasets. Incorporating uncertainty-aware or Bayesian prediction layers may further enhance the system’s utility in risk-sensitive clinical settings.
Overall, this work provides an interpretable, mathematically grounded, and computationally efficient foundation for advancing behavioural representation learning in digital mental health, setting the stage for future real-world applications in early detection and continuous monitoring of depression.
5. Conclusion
This work presents a mathematically transparent synthetic framework for modelling depression-related daily behavioural trajectories and demonstrates that a lightweight self-supervised encoder can meaningfully disentangle healthy and depressed behavioural patterns [63]-[67]. Across multiple downstream classifiers, the SSL-derived embeddings consistently outperform raw feature aggregations in AUC and overall discriminability, indicating that the model successfully captures temporal micro-dynamics that static features overlook. In addition to improved predictive accuracy, the latent space reveals interpretable behavioural archetypes and structured separability, offering insight into how depression-related signatures manifest across different modalities. Together, these findings provide a clear proof of concept: compact, self-supervised models can serve as efficient and effective components of digital mental-health analytics, even in settings characterized by noise, imbalance, and overlapping behavioural profiles. By uniting synthetic behavioural modelling with temporal representation learning, this study establishes a reproducible testbed for evaluating early-detection algorithms and lays methodological groundwork for future real-world applications. Looking ahead, the proposed framework offers a foundation upon which more advanced systems can be built, including personalized behavioural models, multi-modal sensing pipelines, and real-time mobile deployment strategies. As digital phenotyping continues to evolve, the integration of lightweight SSL encoders with real-world data streams holds promise for enabling proactive mental-health monitoring, earlier detection of depressive risk, and more timely clinical intervention.