--- title: Next Signal emoji: 📈 colorFrom: green colorTo: gray sdk: static app_file: index.html pinned: false license: cc-by-4.0 short_description: Self-supervised sensor representations with a frozen probe --- # Next Signal Next Signal learns a representation of smartphone inertial-sensor windows **without labels** (SimCLR-style contrastive learning) and checks its quality with a **frozen linear probe** on activity recognition. It is compared with a randomly initialised encoder and with 54 simple signal statistics under the **same label budget**. **Model:** https://huggingface.co/thelamapi/Next-Signal — pick or upload a window, add noise, scale or shift it; all three probes classify it in the browser. ## Results on 9 unseen test subjects (2947 windows) Accuracy (mean ± std over 5 label draws): | Representation | 2 labels/class | 10 labels/class | 50 labels/class | all 5967 labels | |---|---:|---:|---:|---:| | Self-supervised encoder (Next Signal) | 0.684 ± 0.039 | 0.850 ± 0.029 | 0.901 ± 0.010 | 0.912 | | Random encoder | 0.650 ± 0.036 | 0.779 ± 0.013 | 0.856 ± 0.013 | 0.892 | | Signal statistics (54 features) | 0.652 ± 0.034 | 0.806 ± 0.027 | 0.862 ± 0.007 | 0.893 | Macro-F1: | Representation | 2/class | 10/class | 50/class | |---|---:|---:|---:| | Self-supervised encoder (Next Signal) | 0.688 | 0.852 | 0.903 | | Random encoder | 0.646 | 0.776 | 0.855 | | Signal statistics (54 features) | 0.632 | 0.802 | 0.859 | ![Probe accuracy and confusion](preview.png) ## Method * Split by person: pre-training and label pool from 17 subjects, probe regularisation chosen on 4 validation subjects, scores on the official 9 test subjects. * Encoder: 3 Conv1d blocks (32/64/64 channels, kernel 7, BatchNorm, ReLU) + global average pool → 64-d. Projection head 64→64→32 used only during pre-training. * Pre-training: NT-Xent (τ = 0.2), batch 256, Adam 1e-3, 80 epochs on 5967 unlabeled windows; augmentations: per-channel scaling, crop-and-resize (80–128 samples), circular shift, jitter. * Probe: standardised multinomial logistic regression; C per representation chosen on the validation subjects ({'ssl': 10.0, 'random': 1.0, 'stats': 10.0}). * Browser: encoder runs through `nlrt.js`; Node parity max abs difference 6.106226635438361e-16. ## Usage ```python from inference import load, classify spec = load() # NumPy only probs = classify(spec, windows, 50) # windows: (N, 9, 128) raw UCI HAR inertial signals ``` `encoder.safetensors` contains the PyTorch encoder weights (architecture in the notebook). ## Limitations * One dataset and device type (waist-mounted Samsung Galaxy S II); other placements and sensors need re-validation. * One pre-training run; probe seeds vary only the labeled samples. * Sitting vs standing remains the main confusion (see figure). Failure examples are in `evaluation.json`. * Trained on NVIDIA L4; profile full. Not a medical device. Data: Anguita et al., UCI HAR Dataset, CC BY 4.0. sha256 of the downloaded archive: `c00b803081a5c797cd5e4b83700a9810b38d53d9d84e01917e090e1fdbc81031`.