Papers
Topics
Authors
Recent
Search
2000 character limit reached

RFF-GP-HSMM: Scalable Time-Series Segmentation

Updated 6 July 2026
  • The paper introduces RFF-GP-HSMM, which replaces computationally heavy kernel inversion in GP-HSMM with a Random Fourier Feature approximation for scalable segmentation.
  • It transforms GP regression into linear regression on M-dimensional features, significantly reducing training cost while preserving segmentation quality.
  • Empirical results on human motion data demonstrate up to 278× speedup with nearly identical segmentation accuracy compared to traditional GP-HSMM.

RFF-GP-HSMM is a scalable, unsupervised time-series segmentation method that replaces the Gaussian-process emissions in a Gaussian Process Hidden Semi-Markov Model with a Random Fourier Feature approximation. Its purpose is the same as GP-HSMM: to segment a continuous sequence into interpretable, recurring patterns with explicit durations and without labels. The method addresses the central computational limitation of GP-HSMM, namely the need to invert an N×NN \times N kernel matrix during training for each state’s Gaussian process, which yields an O(N3)O(N^3) bottleneck and O(N2)O(N^2) memory use as the number of data points grows. By approximating a stationary kernel with a finite-dimensional feature map, RFF-GP-HSMM reduces GP regression to linear regression or Bayesian linear regression on MM-dimensional features with MNM \ll N, thereby preserving expressive power while eliminating the need for kernel-matrix inversion (Saito et al., 14 Jul 2025).

1. Definition and objective

RFF-GP-HSMM was introduced in "Scalable Unsupervised Segmentation via Random Fourier Feature-based Gaussian Process" (Saito et al., 14 Jul 2025). It is formulated as a fast unsupervised time-series segmentation method designed for settings in which standard GP-HSMM becomes computationally prohibitive. The target problem is segmentation of sequential observations into latent states that recur over time, with each segment having an explicit duration distribution rather than the geometric-duration assumption of a standard HMM.

The motivating contrast is between expressiveness and scalability. GP-HSMM models state-conditioned emissions with Gaussian processes, which are flexible enough to capture structured temporal patterns, but this flexibility requires inversion of a kernel matrix whose size grows with the number of data points assigned to a state. RFF-GP-HSMM retains GP-like emission structure through a stationary-kernel approximation while moving inference into a finite-dimensional linear model. This suggests a design goal of maintaining segmentation quality while substantially reducing both training and inference cost.

The paper’s empirical setting is human motion segmentation. In that application, the input variable is time tt, the observations are 8-D vectors corresponding to hands and feet coordinates, and conditional independence across output dimensions is assumed given the state and input (Saito et al., 14 Jul 2025).

2. Probabilistic structure

The underlying sequence model is an HSMM with explicit segment durations. Let s1,s2,s_1, s_2, \ldots denote the sequence of states, let d1,d2,d_1, d_2, \ldots denote segment durations, and let y1:Ty_{1:T} denote the observations. The generative structure is

p(s1)jp(djsj)p(sj+1sj)jp(yτj:τj+dj1sj),p(s_1) \prod_j p(d_j \mid s_j) p(s_{j+1} \mid s_j) \prod_j p(y_{\tau_j} : \tau_j + d_j - 1 \mid s_j),

where O(N3)O(N^3)0 is the start time of segment O(N3)O(N^3)1.

State transitions follow a categorical distribution with a Dirichlet prior over rows. The transition probability used is

O(N3)O(N^3)2

where O(N3)O(N^3)3 is the number of states, O(N3)O(N^3)4 counts transitions from O(N3)O(N^3)5 to O(N3)O(N^3)6, and O(N3)O(N^3)7 is the symmetric Dirichlet hyperparameter. Segment durations are explicitly modeled by a Poisson distribution,

O(N3)O(N^3)8

with inference restricted to O(N3)O(N^3)9.

In the original GP-HSMM emission model, each state O(N2)O(N^2)0 has a Gaussian-process regression function

O(N2)O(N^2)1

and observations are generated as

O(N2)O(N^2)2

Given state-specific training inputs O(N2)O(N^2)3 and outputs O(N2)O(N^2)4, the GP predictive distribution for a new input O(N2)O(N^2)5 is

O(N2)O(N^2)6

where O(N2)O(N^2)7 has entries O(N2)O(N^2)8, O(N2)O(N^2)9, and MM0. The dominant cost is computation of MM1, which is MM2 per state (Saito et al., 14 Jul 2025).

3. Random Fourier Feature approximation

The distinctive step in RFF-GP-HSMM is replacement of the GP emission by a Random Fourier Feature approximation of a stationary kernel. For any shift-invariant kernel MM3 with Fourier transform MM4, the method samples frequencies and phases as

MM5

and defines the feature map

MM6

so that

MM7

For the RBF kernel used in the paper’s exposition,

MM8

the corresponding spectral density is Gaussian,

MM9

that is, MNM \ll N0. The paper derives the cosine-with-random-phase construction by writing the inverse Fourier integral, introducing a random phase MNM \ll N1, and using the identity MNM \ll N2, followed by Monte Carlo estimation of the integral (Saito et al., 14 Jul 2025).

Once MNM \ll N3 is introduced, the GP emission becomes a linear-Gaussian model. For each output dimension,

MNM \ll N4

with Gaussian prior

MNM \ll N5

typically with MNM \ll N6 and MNM \ll N7. For state MNM \ll N8, the posterior covariance and mean are

MNM \ll N9

tt0

and the predictive distribution is

tt1

with

tt2

An equivalent ridge-regression view is

tt3

where tt4. The computational consequence is that the model no longer requires inversion of an tt5 kernel matrix, replacing it with an tt6 system where tt7 (Saito et al., 14 Jul 2025).

4. Inference procedure and computational profile

The learning procedure uses blocked Gibbs sampling together with forward filtering-backward sampling over segments and state labels, and Bayesian linear regression updates for the emissions. Initialization consists of random segmentation and random segment-class assignment, followed by initialization of transition counts and class-specific linear-Gaussian emission parameters.

For each sequence tt8, the forward recursion computes messages over segment ending time tt9, duration s1,s2,s_1, s_2, \ldots0, and class s1,s2,s_1, s_2, \ldots1:

s1,s2,s_1, s_2, \ldots2

For s1,s2,s_1, s_2, \ldots3-dimensional observations, the emission likelihood is factorized as

s1,s2,s_1, s_2, \ldots4

Backward sampling then draws segment durations and state labels from the end of the sequence using the paper’s form

s1,s2,s_1, s_2, \ldots5

assigns the segment s1,s2,s_1, s_2, \ldots6, and repeats with s1,s2,s_1, s_2, \ldots7 until the start of the sequence is reached. After segments are reassigned, the method updates state-specific sufficient statistics s1,s2,s_1, s_2, \ldots8 and s1,s2,s_1, s_2, \ldots9, recomputes d1,d2,d_1, d_2, \ldots0 and d1,d2,d_1, d_2, \ldots1 or the corresponding ridge estimate, and updates transition probabilities from the Dirichlet-multinomial counts. In the reported experiments, the Poisson mean d1,d2,d_1, d_2, \ldots2 and the truncation bounds d1,d2,d_1, d_2, \ldots3 are fixed rather than learned. The blocked Gibbs outer loop repeats sequence removal, parameter update from the remaining data, and FFBS resampling for all sequences; the paper uses 5 iterations (Saito et al., 14 Jul 2025).

The complexity reduction is explicit. For GP-HSMM, training per state is d1,d2,d_1, d_2, \ldots4 with d1,d2,d_1, d_2, \ldots5 memory, and prediction is d1,d2,d_1, d_2, \ldots6 per test point. For RFF-GP-HSMM, sufficient-statistics accumulation is d1,d2,d_1, d_2, \ldots7 if d1,d2,d_1, d_2, \ldots8 is formed directly, or d1,d2,d_1, d_2, \ldots9 with streaming updates and small y1:Ty_{1:T}0; posterior or MAP computation is y1:Ty_{1:T}1; emission evaluation is y1:Ty_{1:T}2 per time point, multiplied by the observation dimensionality y1:Ty_{1:T}3. The HSMM forward-backward dynamic program costs y1:Ty_{1:T}4 for transitions, and with RFF emissions the additional emission cost is y1:Ty_{1:T}5. The summarized complexity is therefore

  • GP-HSMM: dominated by y1:Ty_{1:T}6 with y1:Ty_{1:T}7 memory.
  • RFF-GP-HSMM: y1:Ty_{1:T}8 training, y1:Ty_{1:T}9 inference, and p(s1)jp(djsj)p(sj+1sj)jp(yτj:τj+dj1sj),p(s_1) \prod_j p(d_j \mid s_j) p(s_{j+1} \mid s_j) \prod_j p(y_{\tau_j} : \tau_j + d_j - 1 \mid s_j),0 memory.

A plausible implication is that the principal scalability gain comes not only from replacing cubic-statewise GP training but also from removing statewise predictive costs that would otherwise recur inside FFBS.

5. Hyperparameters and empirical evaluation

The reported experiments use an RBF kernel with p(s1)jp(djsj)p(sj+1sj)jp(yτj:τj+dj1sj),p(s_1) \prod_j p(d_j \mid s_j) p(s_{j+1} \mid s_j) \prod_j p(y_{\tau_j} : \tau_j + d_j - 1 \mid s_j),1 and p(s1)jp(djsj)p(sj+1sj)jp(yτj:τj+dj1sj),p(s_1) \prod_j p(d_j \mid s_j) p(s_{j+1} \mid s_j) \prod_j p(y_{\tau_j} : \tau_j + d_j - 1 \mid s_j),2, together with p(s1)jp(djsj)p(sj+1sj)jp(yτj:τj+dj1sj),p(s_1) \prod_j p(d_j \mid s_j) p(s_{j+1} \mid s_j) \prod_j p(y_{\tau_j} : \tau_j + d_j - 1 \mid s_j),3 random features. Bayesian linear regression uses the prior p(s1)jp(djsj)p(sj+1sj)jp(yτj:τj+dj1sj),p(s_1) \prod_j p(d_j \mid s_j) p(s_{j+1} \mid s_j) \prod_j p(y_{\tau_j} : \tau_j + d_j - 1 \mid s_j),4 and observation noise parameter p(s1)jp(djsj)p(sj+1sj)jp(yτj:τj+dj1sj),p(s_1) \prod_j p(d_j \mid s_j) p(s_{j+1} \mid s_j) \prod_j p(y_{\tau_j} : \tau_j + d_j - 1 \mid s_j),5, although the numerical constants are not specified. The duration model is p(s1)jp(djsj)p(sj+1sj)jp(yτj:τj+dj1sj),p(s_1) \prod_j p(d_j \mid s_j) p(s_{j+1} \mid s_j) \prod_j p(y_{\tau_j} : \tau_j + d_j - 1 \mid s_j),6 with p(s1)jp(djsj)p(sj+1sj)jp(yτj:τj+dj1sj),p(s_1) \prod_j p(d_j \mid s_j) p(s_{j+1} \mid s_j) \prod_j p(y_{\tau_j} : \tau_j + d_j - 1 \mid s_j),7, truncated in FFBS with p(s1)jp(djsj)p(sj+1sj)jp(yτj:τj+dj1sj),p(s_1) \prod_j p(d_j \mid s_j) p(s_{j+1} \mid s_j) \prod_j p(y_{\tau_j} : \tau_j + d_j - 1 \mid s_j),8 and p(s1)jp(djsj)p(sj+1sj)jp(yτj:τj+dj1sj),p(s_1) \prod_j p(d_j \mid s_j) p(s_{j+1} \mid s_j) \prod_j p(y_{\tau_j} : \tau_j + d_j - 1 \mid s_j),9. The number of states O(N3)O(N^3)00 is fixed but not explicitly reported. Initialization is random, and each experiment uses 5 blocked-Gibbs iterations. The implementation extends a GP-HSMM implementation with fast FFBS attributed to Sasaki et al., 2023; a code release is listed at https://github.com/naka-lab/RFF-GP-HSMM (Saito et al., 14 Jul 2025).

The dataset is CMU motion capture, Subject 14, using three sequences containing multiple exercises: jumping jack, jogging, squatting, knee raise, arm circle, twist, side reach, boxing, arm wave, side bend, and toe touch. The data are downsampled to 4 fps, represented as 8-D inputs consisting of 2D positions of left and right hands and feet, and min-max normalized to O(N3)O(N^3)01.

For segmentation accuracy, the three sequences are duplicated 10 times to produce 30 sequences. Each method is run 10 times with different initializations, and the best-likelihood run is reported. The metric is normalized Hamming distance, where 0 is best. The reported values are O(N3)O(N^3)02 for GP-HSMM and O(N3)O(N^3)03 for RFF-GP-HSMM, which the paper characterizes as essentially unchanged segmentation accuracy under the RFF approximation (Saito et al., 14 Jul 2025).

For speed evaluation, the same three sequences totaling 490 frames are duplicated to create datasets with 3, 30, 60, and up to 240 sequences, corresponding to 490, 4,900, 9,800, 14,700, 19,600, 24,500, 29,400, 34,300, and 39,200 frames. Each method is run 5 times and average wall-clock time is reported on an Apple M1 Ultra with 64 GB RAM.

Frames Time comparison Speedup
9,800 GP-HSMM 708 s; RFF-GP-HSMM 21 s 34×
19,600 3,227 s vs 48 s 67×
34,300 21,294 s vs 97 s 220×
39,200 32,583 s vs 117 s 278×

At 39,200 frames, which the paper describes as approximately 2 h 43 min of data at 4 fps, the runtime drops from about 9 h to about 2 min. Across all evaluated sizes, RFF-GP-HSMM consistently outperforms GP-HSMM, and the speedup increases with dataset size. The paper also compares this result to prior GP-side optimizations, noting that approximately O(N3)O(N^3)04 acceleration at approximately 8.5k frames had been reported in Sasaki et al., 2023, whereas RFF-GP-HSMM achieves approximately O(N3)O(N^3)05 at 9.8k frames (Saito et al., 14 Jul 2025).

6. Relation to adjacent methods, limits, and usage considerations

The paper positions RFF-GP-HSMM among several families of alternatives. Inducing-point or sparse GP methods and Nyström methods reduce the effective rank of the kernel matrix and replace O(N3)O(N^3)06 with O(N3)O(N^3)07 for O(N3)O(N^3)08, but they still retain GP-specific machinery, require per-state inducing sets, and often involve nontrivial optimization of inducing locations. By contrast, RFF uses explicit features and reduces GP regression to linear regression, yielding constant-time-in-O(N3)O(N^3)09 matrix inversion at the level of an O(N3)O(N^3)10 system and straightforward integration with linear-Gaussian updates and HSMM dynamic programs. The stated trade-off is approximation error controlled by O(N3)O(N^3)11 and random sampling variance (Saito et al., 14 Jul 2025).

Relative to segmentation baselines, HMMs or HSMMs with Gaussian emissions are described as fast but limited in emission expressiveness for complex motion. GP-HSMM addresses this limitation with nonparametric emissions but incurs cubic cost in the number of state-assigned data points. RFF-GP-HSMM is therefore presented as restoring GP-like emission flexibility to the HSMM framework at near-HMM runtimes. Transformer-based and deep sequence models are described as capable of capturing long-range structure but as typically requiring labels, large data, and heavy compute, while offering less interpretability than HSMMs.

The paper does not report explicit ablations varying the number of random features, kernel families, or duration models. Instead, it fixes O(N3)O(N^3)12, the RBF kernel, and Poisson durations with O(N3)O(N^3)13, O(N3)O(N^3)14, and O(N3)O(N^3)15. It nevertheless provides guidance on expected behavior rather than reported results. Increasing O(N3)O(N^3)16 is said to improve the kernel approximation and typically improve accuracy up to diminishing returns while increasing per-state O(N3)O(N^3)17 to O(N3)O(N^3)18 cost. Very small O(N3)O(N^3)19 can underfit, while very large O(N3)O(N^3)20 erodes the speed advantage. For periodic or quasi-periodic motion, the text suggests that periodic or mixed stationary kernels could help, provided their spectral densities are used to sample O(N3)O(N^3)21. It also notes that more flexible duration families such as log-normal or negative binomial could better match real segment lengths but would complicate inference. Truncation bounds O(N3)O(N^3)22 and O(N3)O(N^3)23 strongly affect runtime because the dynamic program scales linearly in O(N3)O(N^3)24.

The practical guidance given in the paper recommends starting with O(N3)O(N^3)25 in O(N3)O(N^3)26, increasing it if accuracy lags GP-HSMM or a nonparametric baseline, and considering O(N3)O(N^3)27 to O(N3)O(N^3)28 for high-dimensional inputs or very long sequences. With one-dimensional time inputs, smaller values around O(N3)O(N^3)29 to O(N3)O(N^3)30 are said often to suffice. For the number of states O(N3)O(N^3)31, the recommendation is to set a plausible upper bound based on domain knowledge; overestimation is described as often safer because the Dirichlet prior regularizes unused transitions, although per-time-step computation grows linearly or quadratically in O(N3)O(N^3)32 depending on whether emissions or transitions dominate. Tight duration bounds are recommended when approximate segment lengths are known. A plausible implication is that RFF-GP-HSMM is most suitable when a stationary kernel is appropriate, segment durations are semantically meaningful, and the application benefits from interpretable unsupervised segmentation together with strong computational scaling (Saito et al., 14 Jul 2025).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to RFF-GP-HSMM.