Papers
Topics
Authors
Recent
Search
2000 character limit reached

Pairwise Trajectory Sampling

Updated 8 July 2026
  • Pairwise Trajectory Sampling is a design principle that treats pairs of trajectories as the primary computational unit for capturing shared dynamic patterns and relative motion.
  • It enables applications like windowed co-movement detection, noise-guided Monte Carlo sampling, and efficient empirical risk estimation in pairwise learning.
  • These methods underpin diverse domains from spatiotemporal motion analysis to video representation, offering practical benefits in interpretability and computational scalability.

Pairwise trajectory sampling denotes a family of methods that operate on pairs of trajectories, trajectory segments, or trajectory-index pairs rather than on isolated paths or pointwise observations. The literature uses the term in several technically distinct ways: as windowed sampling of geolocated trajectories for partial co-movement detection, as correlation-preserving proposal construction in trajectory-space Monte Carlo, as adaptive or survey-based sampling of trajectory pairs for pairwise learning objectives, and as pairwise representations or alignments for motion analysis and similarity computation (Cardei et al., 2024, Gingrich et al., 2015, Zhou et al., 3 Apr 2025, Davy et al., 1 Jun 2026, Pero et al., 2014, Sankararaman et al., 2013). A common theme is that the relevant signal is encoded at the level of pairs—shared subpaths, correlated dynamical histories, informative loss terms, or relative motion between components—so the sampling or matching mechanism is designed directly in pair space rather than reconstructed indirectly from single-trajectory operations.

1. Conceptual scope and core formulations

Across the cited work, a “trajectory” may mean a geolocated time series, a Markovian path x0:Tx_{0:T}, a dense point track in video, or an input-output path pair in a stochastic reaction network. Pairwise trajectory sampling therefore does not refer to a single algorithm. It refers to a design principle: the primitive object of computation is a pair, and the target quantity is defined by pairwise structure.

Research line Pairwise object Primary objective
Spatiotemporal co-movement Windowed trajectory segments Detect and localize partial co-movement
Path-space Monte Carlo Reference and trial trajectories Preserve acceptance for long trajectories
Pairwise learning Sampled trajectory-index pairs Optimize pairwise risk efficiently
Motion representation Ordered trajectory pairs Encode relative articulated motion
Trajectory similarity Two sampled trajectories Identify similar and dissimilar portions

In spatiotemporal behavior analysis, the pair is typically a synchronized pair of windowed segments Si(k)S_i^{(k)} and Sj(k)S_j^{(k)}. In rare-event sampling, the pair is a reference trajectory and a trial trajectory linked by shared noise or another correlation-preserving mechanism. In pairwise learning, the pair is an index pair (i,j)(i,j) drawn from the population of all pairs so that a pairwise loss can be estimated or minimized without enumerating all O(n2)O(n^2) combinations. In motion analysis and similarity search, the pair may be either two trajectories belonging to different moving parts or two observed trajectories to be aligned under monotonicity and gap constraints.

This multiplicity of meanings suggests that the unifying object is not the trajectory itself but the relation between trajectories. The technical differences therefore lie in how that relation is parameterized: by temporal windows, coupling noises, inclusion probabilities, descriptor geometry, or alignment states.

2. Windowed pairwise sampling for partial co-movement

In pairwise spatiotemporal partial trajectory matching, the problem is to decide whether two entities exhibit shared movement within limited time windows and to localize the specific segments where co-movement occurs. The formalization uses a time-stamped trajectory

Ti={(xti,yti,t)t[t0,tN]},T_i = \{ (x_t^i, y_t^i, t) \mid t \in [t_0, t_N] \},

partitions a day into KK fixed windows of size Δt\Delta t and stride Δt\Delta t, and defines the kk-th windowed segment

Si(k)S_i^{(k)}0

Day-level co-movement is declared when there exists a window for which the pair matches under spatial and temporal consistency, and the aggregate decision is

Si(k)S_i^{(k)}1

The implemented pipeline converts tabular spatiotemporal data into interpretable trajectory images, one image per person per time window, rendered on a shared canvas scaled to the joint latitude-longitude bounds of the pair. Within each window, the trajectory is drawn as connected lines between sequential GPS points, and color is a normalized monotonic gradient from the window’s start to its end. Low-quality windows are filtered by counting colored pixels, using the 25th percentile threshold for the 1-layer case and the 50th percentile for the 5-, 24-, and 48-layer sets. Trajectories are localized with OpenCV Selective Search, and a bounding-box overlap pre-filter is applied:

Si(k)S_i^{(k)}2

Only overlapping windows are forwarded to a Siamese network. The network is SigNet, with two identical CNN branches embedding the input images into a space Si(k)S_i^{(k)}3, and the decision rule is based on

Si(k)S_i^{(k)}4

with a margin threshold Si(k)S_i^{(k)}5 used to declare a match. Training was reported for pretrained SigNet and fine-tuned SigNet under 5-fold cross-validation with 50 epochs per fold (Cardei et al., 2024).

The reported evaluation used a private 5-week university study with 126 participants tracked via Fitbit and the AWARE app; after cleaning and exclusions, the dataset contained 94 unique individuals, 38 days, 1,472 person-days, 507 positives, and 965 negatives. Baselines were LSTM and GRU models trained on raw latitude-longitude sequences. The strongest reported configuration was the fine-tuned Siamese model with overlap checking only, no filtering and no cropping, using 48 layers; it achieved Accuracy Si(k)S_i^{(k)}6, F1 Si(k)S_i^{(k)}7, and MCC Si(k)S_i^{(k)}8. The LSTM baseline achieved Precision Si(k)S_i^{(k)}9, Recall Sj(k)S_j^{(k)}0, Accuracy Sj(k)S_j^{(k)}1, F1 Sj(k)S_j^{(k)}2, and MCC Sj(k)S_j^{(k)}3, while the GRU baseline achieved Precision Sj(k)S_j^{(k)}4, Recall Sj(k)S_j^{(k)}5, Accuracy Sj(k)S_j^{(k)}6, F1 Sj(k)S_j^{(k)}7, and MCC Sj(k)S_j^{(k)}8. A central empirical result was that overlap checking yielded large improvements, especially at Sj(k)S_j^{(k)}9 and (i,j)(i,j)0, whereas cropping and filtering did not consistently improve performance and often increased complexity without improving the metrics.

These results position windowed pairwise sampling as a partial-match mechanism rather than a full-sequence classifier. Its interpretability derives from the shared canvas, the within-window temporal colormap, and the transparent overlap pre-filter. Its main computational trade-off is that increasing (i,j)(i,j)1 improves temporal localization but increases the number of rendered images and candidate windows.

3. Pairwise coupling in trajectory-space Monte Carlo

In rare-event path sampling, Pairwise Trajectory Sampling is a path-sampling strategy that explicitly couples a trial trajectory to a reference trajectory so that the two remain highly correlated across many time steps. The motivation is to avoid the exponential collapse of acceptance rates with trajectory length (i,j)(i,j)2 that arises in conventional shooting or shifting moves. For discrete-time Markovian dynamics,

(i,j)(i,j)3

and Metropolis–Hastings acceptance on trajectory space is

(i,j)(i,j)4

Noise-guided proposals write the dynamics as (i,j)(i,j)5 and correlate the trial noise with the reference noise through

(i,j)(i,j)6

with (i,j)(i,j)7. For Gaussian noise, the ratio

(i,j)(i,j)8

holds, so the natural-dynamics factors cancel. In the unbiased ensemble, (i,j)(i,j)9 independent of O(n2)O(n^2)0; in a tilted ensemble, acceptance depends only on the explicit bias term; and in a reactive ensemble, acceptance is determined by the endpoint constraints. The paper contrasts this with artificial-force guidance, for which the entropy production is time-extensive, and with segment-selection strategies such as STePS, for which the accumulated bias is again extensive in O(n2)O(n^2)1. The crucial caveat is dynamical: in systems such as the 2D Ising model with Glauber dynamics and directional push-up/push-down updates, shared noise can synchronize trajectories and sustain nonzero steady-state overlap for arbitrarily long times, whereas in continuous chaotic systems such as a WCA fluid under Langevin dynamics, state-space separation grows approximately as O(n2)O(n^2)2 and the method loses efficiency for large O(n2)O(n^2)3 (Gingrich et al., 2015).

A related trajectory-pair Monte Carlo construction appears in Path Weight Sampling, which computes the mutual information between stochastic input and output trajectories governed by a master equation. The target quantity is

O(n2)O(n^2)4

The method evaluates exact conditional path probabilities from the master equation and averages them via Monte Carlo sampling in trajectory space. Three variants are described: Direct PWS, Rosenbluth–Rosenbluth PWS, and Thermodynamic Integration PWS. Direct PWS estimates O(n2)O(n^2)5 by Monte Carlo marginalization over inputs; RR-PWS uses a polymer-sampling analogy with sequential reweighting and resampling; TI-PWS treats O(n2)O(n^2)6 as a free-energy difference in trajectory space. The same framework is extended to systems with hidden internal states and to systems with feedback from output to input (Reinhardt et al., 2022).

Taken together, these path-space methods use pairwise trajectory structure in a fundamentally dynamical sense. The pair is not a supervised training example but a coupled object in trajectory space: reference-trial in one case, input-output in the other. The central issue is whether pairwise correlation can be maintained under the underlying dynamics strongly enough to make the Monte Carlo estimator scalable.

4. Pairwise sampling for learning and empirical risk estimation

In pairwise learning, the basic object is a pairwise loss O(n2)O(n^2)7 applied to pairs of trajectories O(n2)O(n^2)8. The population risk is

O(n2)O(n^2)9

and the empirical risk is the order-2 U-statistic

Ti={(xti,yti,t)t[t0,tN]},T_i = \{ (x_t^i, y_t^i, t) \mid t \in [t_0, t_N] \},0

Because the terms share observations, they are statistically dependent, so pointwise analyses do not apply directly. The PAC-Bayes and stability framework in randomized pairwise learning addresses arbitrary data-adaptive posterior sampling distributions Ti={(xti,yti,t)t[t0,tN]},T_i = \{ (x_t^i, y_t^i, t) \mid t \in [t_0, t_N] \},1 over sequences of sampled index pairs Ti={(xti,yti,t)t[t0,tN]},T_i = \{ (x_t^i, y_t^i, t) \mid t \in [t_0, t_N] \},2. The analyzed algorithms include pairwise stochastic gradient descent, with updates

Ti={(xti,yti,t)t[t0,tN]},T_i = \{ (x_t^i, y_t^i, t) \mid t \in [t_0, t_N] \},3

and pairwise stochastic gradient descent ascent for convex-concave min-max objectives. The paper gives explicit generalization bounds for smooth and non-smooth convex settings, recommends Ti={(xti,yti,t)t[t0,tN]},T_i = \{ (x_t^i, y_t^i, t) \mid t \in [t_0, t_N] \},4 and Ti={(xti,yti,t)t[t0,tN]},T_i = \{ (x_t^i, y_t^i, t) \mid t \in [t_0, t_N] \},5 for non-smooth convex losses, and Ti={(xti,yti,t)t[t0,tN]},T_i = \{ (x_t^i, y_t^i, t) \mid t \in [t_0, t_N] \},6 and Ti={(xti,yti,t)t[t0,tN]},T_i = \{ (x_t^i, y_t^i, t) \mid t \in [t_0, t_N] \},7 for smooth convex losses to obtain Ti={(xti,yti,t)t[t0,tN]},T_i = \{ (x_t^i, y_t^i, t) \mid t \in [t_0, t_N] \},8 generalization. A notable statement is that the PAC-Bayes plus stability analysis “removes the need for a correction factor” for generalization guarantees under adaptive sampling, although importance weighting remains an optimization choice (Zhou et al., 3 Apr 2025).

A second line of work addresses scalability by sampling pairs directly from the population of pairs and debiasing their contribution with Horvitz–Thompson weighting. For a sampled pair set Ti={(xti,yti,t)t[t0,tN]},T_i = \{ (x_t^i, y_t^i, t) \mid t \in [t_0, t_N] \},9 and first-order inclusion probabilities KK0, the estimator is

KK1

with an analogous unbiased gradient estimator. The central theoretical claim is that sampling must target pairs directly rather than individual observations. Under pairwise Poisson sampling, conditional variance is

KK2

whereas observation-level Poisson sampling induces additional cross terms and strictly larger expected conditional variance under the stated assumptions. Theorem 1 identifies the optimal pairwise Poisson design at fixed expected size: inclusion probabilities proportional to

KK3

minimize the HT variance. Practical proxies proposed for trajectories include LB_Keogh, downsampled or piecewise aggregate approximation DTW, bounding-box overlap, velocity-profile similarity, and embedding distances. If the pair budget is linear in KK4, the reported sample-complexity result is that survey-induced error and U-statistic error are both KK5, so full-pair learning rates can be matched while using only KK6 pairs per epoch (Davy et al., 1 Jun 2026).

These two frameworks address different aspects of the same computational bottleneck. Adaptive pair sampling studies how an optimizer may choose informative pairs during learning while retaining algorithm-dependent generalization guarantees. Pair-targeted survey sampling studies how one can estimate or optimize a quadratic pairwise objective with unbiasedness and explicit variance control. Both place the pair, not the individual trajectory, at the center of the computational design.

5. Pairwise representations, descriptors, and similarity measures

One strand of research constructs pairwise trajectory descriptors directly from video motion. “Pairs of trajectories” (PoTs) are ordered pairs of dense point tracks extracted from optical flow, with one trajectory designated as anchor and the other as swing. Candidate ordered pairs are scored over an KK7 frame window by

KK8

where KK9 is the median foreground velocity. The scoring favors anchors close to the object’s median motion and swings that deviate from it, so the pair tends to span different moving parts. For a retained pair, the descriptor uses the anchor-to-swing vector Δt\Delta t0, the relative displacement Δt\Delta t1, the initial angle

Δt\Delta t2

and the normalization

Δt\Delta t3

The resulting descriptor is

Δt\Delta t4

with dimension Δt\Delta t5 when Δt\Delta t6. The implementation retains the top Δt\Delta t7 fraction of ordered pairs, uses a PoT codebook of size Δt\Delta t8, and clusters interval histograms by hierarchical complete linkage. On the tiger and dog video datasets, PoTs outperformed single-trajectory or appearance-based baselines in the reported clustering evaluations, and on KTH they achieved 59% purity versus 38% for the motion-primitive baseline (Pero et al., 2014).

A different pairwise construction addresses similarity between two sampled trajectories Δt\Delta t9 and Δt\Delta t0. The assignment model is directed and monotone, allows many-to-one matches, and marks deviations by gap segments. The edge reward is

Δt\Delta t1

and the global score is the sum of edge rewards plus gap contributions Δt\Delta t2 over maximal gap runs. Local similarity is obtained by subtracting a threshold Δt\Delta t3 from matched pairs and adding Smith–Waterman-style zero resets. The dynamic program runs in Δt\Delta t4 time, and the optimal assignment can be recovered in Δt\Delta t5 space by Hirschberg’s trick. The paper also describes a semi-continuous extension in which a point can be assigned to the closest point on a segment of the other trajectory, rather than only to sampled vertices, in order to handle large differences in sampling density. Experiments on Microsoft GeoLife, Athens school buses, and cycling trajectories used, for the global model, Δt\Delta t6 m, minimum gap length Δt\Delta t7, Δt\Delta t8, Δt\Delta t9, and kk0, and reported that the assignment model combined the advantages of DTW and sequence alignment while being more robust to deviations and non-uniform sampling (Sankararaman et al., 2013).

These representation-oriented methods use pairwise trajectory sampling in a structural sense. The sampled pair is either an ordered pair of point tracks encoding articulated relative motion or a pair of observed trajectories linked by a monotone assignment. In both cases, pairwise structure is the descriptor itself rather than an intermediate stage for downstream classification.

6. Applications, limitations, and research directions

The applications reported in the literature are heterogeneous but technically consistent with the pairwise viewpoint. Windowed co-movement matching is used for co-walking classification and for pair routine pattern analysis in social behavior research, urban planning, and healthcare. PoTs are used for unsupervised discovery of behaviors such as walking, running, turning head, and sitting in unconstrained animal videos. Pairwise learning frameworks cover ranking, metric learning, AUC maximization, similarity learning, and clustering. Path-space pair methods address rare-event sampling and the computation of mutual information rates between stochastic trajectories (Cardei et al., 2024, Pero et al., 2014, Zhou et al., 3 Apr 2025, Davy et al., 1 Jun 2026, Gingrich et al., 2015, Reinhardt et al., 2022).

Several misconceptions are explicitly contradicted by the cited results. First, sampling individual observations and then forming pairs is not equivalent to sampling pairs directly; the survey-sampling analysis shows a strict variance disadvantage for the observation-level strategy under the stated assumptions. Second, stronger preprocessing is not automatically better: in the co-movement pipeline, cropping and filtering did not consistently improve performance, and the strongest fine-tuned configuration used overlap checking without filtering or cropping. Third, acceptance independence of kk1 in noise-guided path sampling does not by itself guarantee efficiency; it depends on whether noise correlation propagates into state-space overlap, which fails in continuous chaotic systems (Davy et al., 1 Jun 2026, Cardei et al., 2024, Gingrich et al., 2015).

The limitations are likewise domain-specific. In co-movement analysis, performance depends on sensor quality, missing GPS samples, class balance, self-reported ground truth, privacy constraints, and the choice of kk2, pixel thresholds, and margin kk3. In pairwise learning, the stated stability results do not cover non-convex pairwise losses, and heavy-tailed gradients or adversarial sampling beyond convex-concave SGDA require additional assumptions. In PoTs, foreground segmentation quality is important, and camera rotation or zoom can affect the descriptor because rotation invariance is not enforced. In assignment-based similarity, Euclidean geometry, GPS drift, anisotropic noise, and very unbalanced sampling rates can affect the alignment, even though many-to-one matching and the semi-continuous extension mitigate some of these issues (Cardei et al., 2024, Zhou et al., 3 Apr 2025, Pero et al., 2014, Sankararaman et al., 2013).

The proposed future directions remain pair-centric. For co-movement, suggested extensions include group co-movement beyond pairs via multi-branch Siamese or set encoders, robust overlap metrics such as Hausdorff or Fréchet distances between polylines, self-supervised pretraining on trajectory images, temporal attention across windows, and adaptive window sizing. For video motion analysis, suggested extensions include triplets or higher-order groups, learned anchor selection, and appearance-motion fusion. In pairwise learning, the open problems include non-convex stability tools and structured analyses for trajectory data with internal dependencies. These proposals suggest that the next stage of the field is not to abandon pairwise constructions but to generalize them: from fixed pairwise schemes to adaptive, structured, and higher-order relation models grounded in the same principle that the informative unit is the relation between trajectories rather than the trajectory in isolation.

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 Pairwise Trajectory Sampling.