arXiv:2610.39563cs.GROct 2026

Manuscript Offprint

arXiv:2610.39563

Trajeform: Embedding Crowd Data

Marilena Lemonari, Panayiotis Charalambous, Yiorgos Chrysanthou

Marilena Lemonari D◯\textcircled{D}, Panayiotis Charalambous D◯\textcircled{D}, Yiorgos Chrysanthou D◯\textcircled{D}

Abstract—Crowd simulation aims to generate agent behaviours that are rich, natural, and appropriate to their surrounding environment. Recent advances in Machine Learning have enabled such behavioural patterns to be learned directly from trajectory data, allowing simulation models to capture increasingly complex crowd dynamics. However, the capabilities of these systems remain strongly dependent on the type and diversity of the data used during training. When evaluating how well crowd simulators generalise to real-world datasets, most existing metrics focus primarily on trajectory-level differences rather than behaviour-level similarity. In this paper, we present Trajeform, a framework that trains a reconstruction VAE (Variational Autoencoder) on real trajectory data to learn a meaningful continuous embedding that preserves behavioural characteristics of real crowds. The trained encoder can then be applied to synthetic trajectories generated by simulators and used to compare the resulting embedding distributions. Additionally, the learned embedding can be used to analyse supplementary data, such as trajectories corresponding to a simulator's principal behaviours or captured data from controlled environments (e.g., cycling), providing insight into their ability to span the real behavioural embedding space. The framework compares data from three simulators (CCP, modCCP, and RVO) against ground-truth datasets and is evaluated quantitatively and qualitatively using latent-space analysis, distributional metrics, and trajectory generation through sampling from the aggregated posterior distribution. The results indicate that the learned latent space captures meaningful trajectory dependencies found in the real data, making the framework useful both as an additional measure of synthetic data believability and as a tool for informing the training of future trajectory models.

I. INTRODUCTION

Crowd simulation aims to populate virtual environments with realistic agent movements. Within this scope, the umbrella of realism includes behaviour diversity, richness, and contextual awareness, in that agents should not only move naturally, but also behave in ways that are appropriate to the environment, e.g., a university campus. Extensive research has achieved advanced simulators for generating believable agents [1], [2], [3], utilised in crowd authoring to optimise simulator parameter spaces with respect to an authoring constraint [4], [5]. However, most of these systems either rely on manual parameterisation [1], or synthetic data [4]. Works that utilise real data are often constrained by the amount and type of data they use (single policy [6], controlled environments [7], [8]), hence hindering generalisability. Therefore, it is imperative to measure behavioural similarity by comparing differently sourced agent behaviours with real data [9]. In this work, we aim to quantify and formalise an embedding representation to assess the quality of agent behaviours in comparison with real ones. Such a tool enables comparing real and simulated behaviours in the representation space, and informing a selection of parameters spanning the real data features.

Measuring behaviour similarity properly, in the context of crowds, is a challenging undertaking due to the conceptual definition of a behaviour “match” and its non-deterministic nature. Relevant works weigh hand-crafted salient features [10], [5], perceptually validate realism [11], [12], or combine both (perceptually-validated metric) [13]. However, these works still focus on trajectory faithfulness, and are biased either on the selection of trajectory features, or the expertise of user study participants. Other works utilise entropy-based measures [14], [15]. To compare simulated and real data, several systems [16], [4] report metrics on trajectory features such as Deviation From Goal (DFG), and Optimal Path (OP) [17]. Even though these metrics are widely used and can give strong indications regarding the distribution of trajectory features in the two groups (generated and real), they are more tailored to trajectory features in an aggregated manner (e.g., DFG for all agents at every timestep); these partially capture behavioural aspects (turning left and turning right contain the same behaviour but lead to different paths) or limit controllability. We aim to investigate learnable features to complement the assembly of metrics used for comparing between two sets of behaviours.

In this paper, we introduce Trajeform, a trajectory-based framework that learns an embedding space directly from real crowd trajectory data. The learned latent distribution serves as a baseline, against which synthetic trajectories (e.g., generated by crowd simulators) can be compared. Synthetic trajectories are projected onto the learned latent space, allowing their inferred distributions to be juxtaposed with the real-data embedding distribution. The framework preserves the properties of a VAE latent space while encouraging behaviourally similar trajectories to cluster together. Since the model is trained through trajectory reconstruction, the decoder can additionally be used to project latent embeddings back into the trajectory space. Trajeform primarily aims to project crowd data onto an embedding space tailored to real behavioural features. To achieve this, the framework operates on canonicalised trajectories aligned during preprocessing, encouraging the model to focus on behavioural characteristics beyond simple positional attributes such as spawn location or orientation. Consequently, the learned embedding space captures more behaviour-relevant representations. Beyond measuring behaviour similarity, the framework can also provide indications regarding how effectively a simulator spans the real-data behavioural manifold, while additionally informing simulator parameter selections towards distributions more consistent with the arrangement of real data in the latent space. We evaluate the proposed framework through comparisons with established quantitative metrics, complemented by graphical analyses of the learned embedding distributions.

In a nutshell, we deliver a model trained on real data, that transforms trajectories to learned latent features. The trained latents compile a distribution used as a baseline for comparisons with differently-sourced data, e.g., simulated. Hence, our contribution can be summarised as follows:

• Learning to embed crowd data in a feature space aligned with real behavioural characteristics, and

• Inferring a latent distribution from real data embeddings, enabling informed sampling, and similarity measurement in latent space.

References (52)