1. Introduction
Driving risk assessment is an essential function of intelligent vehicles, as safety-critical interactions must be recognized before they develop into crashes. This requirement is particularly important in highway lane-changing scenarios. A small longitudinal or lateral mismatch between a lane-changing vehicle and its surrounding vehicles can rapidly lead to a rear-end or sideswipe conflict. For advanced driver assistance and autonomous decision-making, the central question is therefore not whether a completed maneuver was risky, but whether the future risk of an intended lane change can be estimated early enough to support preventive action. Recent studies [
1,
2] emphasize that this problem is difficult because risk is not determined solely by the target vehicle but arises from the coupled motion of the target vehicle, neighboring vehicles, road geometry, and the future responses of all interacting agents.
Research on driving risk assessment has gradually moved from instantaneous state judgment to future-oriented risk inference. Since actual crashes are extremely rare in naturalistic traffic, classical surrogate safety measures (SSM) replace sparse and delayed crash records with measurable conflict indicators derived from vehicle proximity, time margins, required braking, or hypothetical collision severity [
3,
4]. These indicators are commonly grouped into time-based measures such as Time to Collision (TTC), deceleration- and distance-based measures such as the Deceleration Rate to Avoid a Crash (DRAC), and severity-oriented measures [
5]. Earlier probabilistic scene-analysis and driver-behavior models have likewise linked predicted motion to collision probability and decision-making risk [
6,
7]. Although interpretable and computationally efficient, these measures often rely on fixed thresholds, pairwise interaction assumptions, and scenario-specific definitions, which limits their use when several vehicles interact and when both longitudinal and lateral conflicts must be considered.
Risk assessment is particularly challenging in multi-vehicle highway interactions, where the risk state depends jointly on the target vehicle and several surrounding vehicles. Xiong et al. [
2] divide multi-vehicle risk assessment methods into state-inference-based and trajectory-prediction-based approaches. Most existing lane-change risk studies fall on the state-inference side as they map historical features directly to a risk state or compute surrogate measures on observed trajectories, without retaining the predicted future segment [
8,
9,
10]. Representative examples include the rear-end crash risk index of Shangguan et al. [
8], which combines Monte Carlo crash occurrence with collision severity and was later aggregated across the four key surrounding vehicles into a Lane-Change Risk Index (LCRI) through a fault-tree formulation [
11], as well as recent generalized surrogate safety models learned from large-scale naturalistic data without crash labels [
12]. Trajectory-prediction-based methods instead forecast the future motion distribution and then evaluate collision probability or severity over the prediction horizon. Although more costly, they account for the future spatial relations among interacting vehicles and can detect collision risk earlier and more accurately [
2]. Recent studies illustrate this trend by coupling multi-vehicle trajectory prediction with collision probability, collision intensity, or aggregated lane-change risk indices [
13,
14,
15], and risk-aware predictors have begun to incorporate collision risk into the prediction objective itself [
16]. This direction naturally connects risk assessment with trajectory prediction, because forecast trajectories make the source and timing of a potential conflict observable before the maneuver unfolds. However, it requires a forecasting framework whose output is both suitable for proactive risk computation and semantically organized enough to explain why some lane-change situations are riskier than others.
Driving intention recognition provides the semantic ingredient for such forecasts. An intention denotes a deliberate, goal-level decision formed earlier in the timeline than the behavior that executes it, so recognizing it offers an earlier cue for safe decision-making than forecasting the trajectory alone [
17,
18]. Methodologically, intention recognition has evolved from inferring discrete maneuvers from vehicle kinematics with classical classifiers toward learning spatial and temporal features directly from data. This includes combined CNN–LSTM architectures for lane-change anticipation [
19], convolutional social pooling [
20] and attention-based models [
21] for capturing the interaction context, graph-based models that dynamically update relational edges [
22], and transformer-based predictors that jointly model maneuver and trajectory in a multimodal form [
23,
24]. More recent models increasingly couple intention with trajectory generation, for example by integrating intention awareness into diffusion-based prediction [
25] or by obtaining intention-aware motion modes through contrastive clustering [
26]. These studies indicate that intention information improves motion prediction. In most designs, however, intention enters as a supervised label, an auxiliary branch, or an input token. Such usage helps the predictor select a plausible mode, yet it does not yield an interpretable representation that can be tied to downstream risk.
The forecasting task itself is inherently generative, because a single observed history may correspond to multiple plausible futures. Lane-change futures are multimodal, interaction-dependent, and constrained by road topology and vehicle kinematics [
18,
27,
28,
29,
30], which makes deterministic point prediction insufficient. Early generative approaches used conditional variational autoencoders that sample latent variables to generate alternative future hypotheses [
31] and adversarial models that encourage socially compliant outputs [
32]. Conditional VAEs, however, are prone to posterior collapse and tend to regress toward an average path. GANs are hard to train and frequently exhibit mode collapse. The latent representations of both families are continuous and entangled, which makes it difficult to identify which dimensions correspond to a particular driving intent. Diffusion models have recently emerged as a more stable alternative with superior mode coverage, modeling trajectory generation as a gradual denoising process [
33], accelerating inference through leapfrog strategies [
34], and incorporating feasibility constraints by conditioning on discrete traffic contexts generated by a VQ-VAE [
35]. Nevertheless, standard diffusion predictors typically operate in a continuous latent space and lack explicit semantic control. Hence, the generation process is often blind and may require a large number of samples to cover the ground-truth mode. Many also rely on rasterized maps or time sequences that lose fine-grained topological information compared with vectorized representations [
36].
In summary, existing studies have established three important foundations for proactive lane-change risk assessment. Intention recognition provides early semantic cues about future behavior, and generative trajectory prediction represents multiple plausible futures under interaction and road constraints. Surrogate safety measures offer interpretable risk indicators when crash labels are unavailable. However, the links among these components remain weak. Intention-aware predictors often lack a risk-oriented interpretation of their latent representations. Generative predictors produce futures without exposing semantically meaningful intent structures. Most risk assessment methods compute risk from observed trajectories or historical features rather than from interpretable predicted futures. The missing link is therefore a predictor that generates feasible futures, exposes the intent structure behind them, and allows the downstream risk index to be traced back to that structure.
To address these limitations, this paper proposes IntentDiff, an intent-conditioned diffusion framework for proactive lane-change risk assessment. The proposed framework uses predicted futures as an explicit basis for evaluating how lane-change risk will evolve before the maneuver unfolds. The forecast is feasible, multimodal, and associated with discrete intent-related prototypes, so that the resulting risk index can be analyzed in terms of the interaction pattern that produces it. From an information-theoretic viewpoint, the framework compresses the high-dimensional traffic scene into a discrete latent bottleneck that retains the maneuver- and risk-relevant information, a property we quantify through the entropy, perplexity, and mutual information of the learned codebook. The main contributions of this paper are summarized as follows.
A vectorized scene context learning module is developed to provide an interpretable intent basis for risk assessment. The module combines a VectorNet backbone with a Vector Quantized Variational Autoencoder (VQ-VAE), mapping agent–map interactions onto a discrete codebook. These codes represent maneuver-associated intent prototypes, allowing complex lane-change situations to be organized into risk-relevant interaction patterns.
An intent-conditioned diffusion trajectory generator is proposed to support proactive risk inference. The learned discrete intent code serves as a high-level prior during denoising, while the model generates acceleration and yaw-rate sequences, which are integrated through a kinematic layer. The resulting trajectories are diverse, feasible, and associated with explicit intent prototypes, which makes them suitable for downstream risk computation.
A forecast-based Lane-Change Risk Index (LCRI) analysis is constructed to evaluate future collision risk prior to the maneuver. For the generated trajectories, Monte Carlo rear-end risk is evaluated against the four bounding vehicles and then fused across the lane-change conflict structure. This allows the framework to quantify proactive risk and to reveal how different intent prototypes correspond to different levels of lane-change risk.
The remainder of this paper is organized as follows.
Section 2 details the methodology, including the vectorized scene context learning, the intent-conditioned diffusion model, and the predictive lane-change risk assessment.
Section 3 introduces the experimental setup.
Section 4 presents the trajectory prediction and the predictive risk assessment results. Finally,
Section 5 concludes the paper.
2. Methodology
This section introduces the trajectory-prediction-based proactive lane-change risk assessment. The framework consists of three functional components: vectorized scene context learning, intent-conditioned diffusion trajectory generation, and predictive lane-change risk assessment. As illustrated in the IntentDiff architecture (
Figure 1), a VectorNet-based VQ-VAE encodes heterogeneous agent–map interactions into a discrete latent code associated with maneuver-level driving intents. Subsequently, a 2D U-Net DDPM, conditioned on this discrete intent code, generates dynamically feasible target-vehicle motion control sequences, which are integrated via a kinematic model to produce final forecast trajectories. Finally, the predicted target-vehicle trajectories are evaluated against the four bounding vehicles through a Monte Carlo rear-end risk model and fused into the Lane-Change Risk Index (LCRI). The remaining subsections detail the formal problem statement, scene context learning, conditional trajectory generation, and predictive risk assessment.
2.1. Problem Statement
The trajectory prediction task is formulated as the problem of generating the joint probability distribution over the target agent’s future states, conditioned on the historical context of the dynamic traffic scene. Let the dataset be composed of M distinct data samples. Each data sample holds the vectorized traffic scenario observations , the future trajectory , and a maneuver label . The scene observation encompasses the dynamic states of N interacting agents (including the ego vehicle and its neighbors) and the static high-definition map vectors over a historical horizon of length . Unlike raster-based methods that use fixed-size tensors, is represented as a set of polylines to preserve geometric sparsity. The target future trajectory is defined as , representing the 2D global coordinates over the prediction horizon . To support intent-aware prediction, each sample includes a maneuver class , which is a one-hot encoded vector representing the driving intention. Specifically, indicates whether the future trajectory corresponds to a Lane Change Left (LCL), Lane Change Right (LCR), or Keep Lane (KL) maneuver.
The objective is to predict the future trajectory for the target agent given . To ensure kinematic feasibility, our model does not directly regress positions. Instead, we define the generation target in the action space as , consisting of longitudinal acceleration and yaw rate . The final trajectory is recovered from the generated actions via a kinematic integration layer, ensuring that the output inherently satisfies vehicle non-holonomic constraints.
2.2. Vectorized Scene Context Learning
To effectively capture the complex interactions between agents and the road network and to categorize the infinite possibilities of traffic scenarios into discrete, semantically rich contexts, we employ a vectorized scene context learning module. As shown in
Figure 2, this module integrates a VectorNet-based Encoder-Decoder architecture within a VQ-VAE framework.
2.2.1. Hierarchical VectorNet Encoder
The VectorNet backbone [
36] is leveraged here to encode the rich interactions among traffic participants and the surrounding road network. This hierarchical GNN operates directly on a polyline-based scene representation, thereby avoiding the information loss inherent to rasterization. Lanes and agent trajectories are approximated as ordered sequences of short vectors: map features are obtained by uniformly sampling key points along the spline of each lane and chaining them in order, while agent histories are sampled at fixed time intervals. A vector
on polyline
becomes a node of the graph carrying features
, where
and
are the start and end coordinates,
a collects auxiliary attributes, and
j identifies the parent polyline. Translational invariance is enforced by re-centering every coordinate around the target agent’s position at the last observed time step.
Based on this representation, the encoder aggregates information hierarchically, starting from the local vector level up to the global scene level. First, to exploit spatial and semantic locality, we construct subgraphs for each polyline. For a polyline
containing vectors
, a subgraph network aggregates features using a Multi-Layer Perceptron (MLP) followed by a permutation-invariant max-pooling operation
:
This process effectively compresses the variable-length vector sequence into a fixed-size polyline embedding , encapsulating the local geometric characteristics of the road or the motion pattern of an agent.
Subsequently, to model higher-order interactions among all scene components (i.e., agents and map features), we construct a fully connected global graph where nodes are the polyline embeddings
. Following VectorNet [
36], a self-attention operation is applied to update these features by capturing long-range dependencies. Let
denote the matrix formed by stacking all polyline embeddings, and let
,
, and
be its query, key, and value projections, respectively. The global graph update is written as:
where
is the dimension of the key projection. The final output corresponding to the target agent, denoted as
, encapsulates the global scene context and serves as the continuous latent representation for the subsequent quantization module.
2.2.2. Discrete Context Quantization
To handle the continuous, unbounded nature of interactive traffic scenarios, we introduce a discrete quantization step after global feature aggregation. As illustrated in
Figure 2, the continuous global embedding
extracted by the hierarchical encoder is projected onto a finite, learnable codebook
. Rather than employing traditional continuous latent spaces, this operation maps the current scene to the nearest semantic and geometric prototype
by minimizing the Euclidean distance in the embedding space:
Assigning the dynamic observation to a discrete context cluster
significantly reduces multimodal ambiguity. To ensure these discrete representations maintain both geometric fidelity and strong correlation with high-level driving maneuvers, the codebook and network parameters are optimized simultaneously through a composite objective function:
where the scalar coefficient
controls the relative contribution of the intent classification objective compared to the reconstruction and quantization terms. This weighting steers the model toward semantically interpretable representations while preserving the geometric fidelity of the reconstructed scene.
The reconstruction term
quantifies the vector-wise discrepancy between the original scene input
and the decoded output
, so that the discrete latent code
retains the geometric information essential to the traffic scenario. It is defined as:
Simultaneously, the VQ-VAE objective
is applied to update the codebook and constrain the encoder outputs:
where
denotes the stop-gradient operation. The first term updates the codebook embeddings, while the second term (commitment loss) constrains the encoder output from fluctuating excessively.
Finally, to emphasize scenario-specific factors that influence future maneuvers, an intent classification task is incorporated into the latent space. A linear classifier
is added to predict the maneuver probability distribution
p (i.e., LCL, LCR, or KL) based on the quantized code
:
To penalize incorrect intent predictions, a cross-entropy loss is computed against the ground truth maneuver label
s:
By introducing , the latent space is encouraged to form maneuver-associated codebook entries, with each cluster q representing a specific intersection of geometric topology and driving intent, thereby providing a structured condition for the subsequent generative stage.
Since the codebook is shaped by the supervised classification loss
with LCL, LCR, and KL labels, the learned codes are maneuver-associated scene prototypes, which are discrete summaries of the agent–map interaction context that are predictive of the labeled maneuver. Throughout this paper, the terms “intent code” and “intent prototype” are used as shorthand for these supervised maneuver-associated prototypes, consistent with the common usage of “intention” for maneuver-level classes in the trajectory prediction literature [
17,
18].
2.3. Conditioned Diffusion Model
As illustrated in
Figure 3, the conditioned diffusion model uses a DDPM [
37] to generate the future action sequence
, conditioned on the discrete context index
c obtained via vectorized scene context learning.
2.3.1. Denoising Diffusion Process and Network Architecture
DDPMs form the generative core of our framework, enabling the model to learn the complex conditional distribution of future actions given the context . The training process is divided into a fixed forward diffusion phase and a learnable reverse denoising phase.
In the forward phase, the initial ground-truth action sequence
is systematically corrupted with Gaussian noise. This is achieved using a Markov chain that gradually adds Gaussian noise
over
T steps, following a variance schedule
. The transition probability at each step is defined as
. A key property of this process is that the state
at any arbitrary timestep
t can be sampled directly from
in closed form:
where
and
. As
,
, ensuring that the distribution of
converges to an isotropic Gaussian
.
In the reverse phase, the goal is to invert this diffusion process to recover the original data structure from pure noise. This is modeled as a parameterized Markov chain
that learns to denoise the state
in a step-by-step manner. Since our framework is condition-driven, the reverse transition is explicitly conditioned on the discrete context index
c, derived from the vectorized scene-context learning. The transition probability is defined as a Gaussian distribution:
where
and
are the predicted mean and covariance, respectively. Following Ho et al. [
37], we set the variance
to fixed constants
, focusing the learning capacity solely on the mean
.
However, instead of directly predicting the reverse-process mean
, it has been shown that a more stable training objective is to predict the noise component
added at step
t. By reparameterizing the Gaussian term, the mean of the reverse process can be derived from the predicted noise
as follows:
This formulation allows the model to generate new samples by sampling Gaussian noise and iteratively solving for using the learned noise estimator , guided by the semantic condition c.
To implement this noise prediction function
, we employ a 2D U-Net architecture for the target vehicle’s action sequence. Unlike traditional sequence models that process trajectories only as 1D time series, we organize the noisy target action sequence as a compact temporal feature map of shape
, where
B is the batch size and
corresponds to the action channels (longitudinal acceleration and yaw rate). Interactions with surrounding vehicles are not generated by the U-Net; instead, they are encoded beforehand by the VectorNet–VQ-VAE scene context module and injected through the discrete context index
c. The U-Net therefore denoises the target-vehicle future while receiving interaction information through the learned condition. The discrete context index
c is integrated via learnable embedding layers, which are added to the timestep embeddings to guide the denoising trajectory. The entire network is optimized by minimizing the simplified Mean Squared Error (MSE) between the actual noise
and the predicted noise
:
2.3.2. Inference with Classifier-Free Guidance
In conditioned diffusion models, guidance involves steering the generation process by incorporating additional conditioning. We utilize Classifier-Free Guidance (CFG) [
38], which enables conditional generation without an explicit external classifier. In this approach, an unconditional noise estimator
and a conditional noise estimator
are jointly trained within a single neural network. During training, the class identifier
c is randomly replaced with the null token ∅ with probability
.
During the sampling process, the noise estimate
of the guided DDPM is determined by a linear combination of the conditional and unconditional predictions:
where
denotes the guidance scale. A higher
forces the generated trajectory to strictly adhere to the identified semantic maneuver, while a lower scale preserves more diversity from the unconditional distribution. In our experiments, we set
for all forecast-based LCRI evaluations, which keeps the sampling protocol fixed across the trajectory and risk analyses.
2.3.3. Kinematic Reconstruction
Instead of predicting positions directly, our model generates a sequence of denoised motion parameters . The rationale behind this choice lies in the fundamental premise of diffusion models, which is to map a Gaussian noise distribution to the target data distribution. While the distribution of absolute trajectory positions is highly multi-modal and complex, the distributions of acceleration and yaw rate are naturally bounded and quasi-Gaussian. Therefore, transforming the target space into the action domain significantly simplifies both the forward noising process and the reverse learning task.
To recover the final trajectory, we employ a kinematic representation of motion subject to nonholonomic constraints. Given the predicted motion parameters, the vehicle state
is recursively updated using Euler integration. The state update logic at step
is formulated as:
where
is the time interval. This explicit integration ensures that the predicted paths satisfy vehicle kinematic constraints, preventing the unrealistic drift in position- based predictions.
The integration guarantees that position, speed, and heading evolve consistently under the nonholonomic vehicle model. Two mechanisms keep the generated motions within a realistic dynamic envelope. First, the action space is bounded by construction. The denoised actions are clipped to the normalized range before integration, which caps the longitudinal acceleration at and the yaw rate at rad/s, both well inside the physical capability of passenger cars and consistent with the action ranges observed in the highD training data. Second, we verified the dynamic envelope empirically on trajectories generated under the evaluation protocol, 2000 samples over 200 test conditions, , . The 99th percentiles of the generated absolute longitudinal acceleration, lateral acceleration , and jerk are , , and , respectively, all within commonly used comfort envelopes for highway driving and of the same order as the corresponding ground truth statistics. Road geometry is not imposed as a hard constraint at the integration stage. It enters through the discrete scene context code, which conditions the generator on the vectorized lane layout.
2.4. Predictive Lane-Change Risk Assessment
The central goal of this work is to translate the target agent’s multimodal forecasts into a proactive, interpretable measure of lane-change risk. To this end, we couple the generated trajectories with a rear-end collision risk model and aggregate the per-interaction risk into a single Lane-Change Risk Index (LCRI) [
11] over the prediction horizon. A lane change is risky primarily because of its longitudinal interaction with the four key vehicles that bound the maneuver: the preceding and following vehicles in the current lane, and the preceding and following vehicles in the target lane. The future trajectory of the target agent is the multimodal forecast
produced by the conditioned diffusion model. Each surrounding vehicle is propagated using a constant-velocity model from its last observed state, yielding a smooth, physically plausible future and keeping the entire pipeline dependent only on quantities available at prediction time. Although with this simplification, the reactive braking of a following vehicle, the reactive behavior most relevant to rear-end risk, is not ignored. We model it stochastically in the Monte Carlo risk computation described below, where each trial samples a reaction time and braking deceleration for the follower. Furthermore, we empirically bound the impact of this simplification in our evaluation. The realized-future reference LCRI in
Section 4.5 is computed on the actual recorded trajectories of all vehicles, including whatever reactive behavior the surrounding drivers in fact performed, so the agreement reported there already includes the full effect of the constant-velocity assumption over the prediction horizon.
At each predicted timestep, the risk between the target agent and one key vehicle is quantified by a rear-end collision risk that jointly accounts for collision likelihood and collision severity, following the surrogate-safety formulation of Shangguan et al. [
8,
11]. For a leader–follower pair with relative gap, leader speed, and follower speed read off the forecast at that frame, a Monte Carlo simulation samples the lead disturbance deceleration, the follower reaction time, and the follower maximum braking deceleration from their empirical distributions, and resolves four rear-end scenarios in closed form to decide whether a collision occurs and, if so, its severity the square of the absolute speed difference (SASD) between the two vehicles at the moment of impact. The three stochastic factors follow the empirically calibrated distributions adopted in Shangguan et al. [
8]. The disturbance deceleration imposed on the lead vehicle follows a shifted gamma distribution with shape
, scale
, and shift
(in
), originally calibrated on naturalistic rear-end conflict data by Kuang et al. [
39]. The follower reaction time follows a lognormal distribution with parameters
plus a fixed braking coordination time of
s. The maximum available deceleration rate of the follower follows a truncated normal distribution with mean
and standard deviation
, truncated to
. The rear-end collision risk index for key vehicle
i at the considered frame is:
where
is the number of Monte Carlo trials,
indicates whether trial
j results in a rear-end collision, and
is the normalized severity.
The severity is normalized by a fixed constant,
with
, and the resulting risk index is clipped to
. The constant was calibrated so that our vectorized implementation reproduces the RCRI values reported for the reference car-following episode in Shangguan et al. [
8] to within
, thereby keeping the index numerically comparable to the original formulation. The identical normalization is applied to the forecast-based and the realized-future evaluations, so it does not affect their comparison. Because the model evaluates the longitudinal closing process under stochastic but realistic braking behavior, it assigns a continuous, non-zero risk to close-but-not-colliding interactions that a binary distance threshold would miss. This is precisely the property required on naturalistic data, where almost no trajectory ends in an actual collision.
The four per-vehicle risks are fused over the maneuver into a single index through a fault-tree formulation, in which the lane change is treated as a system whose failure corresponds to an unsafe interaction with any of the four key vehicles:
where each
is taken as the maximum over the prediction horizon for that vehicle. Surrounding positions that are absent from the scene contribute
, thereby leaving the product unchanged. RCRI models the longitudinal closing process between a leader–follower pair, so the LCRI quantifies the rear-end conflict potential of the lane change with respect to its four bounding vehicles. Lateral and sideswipe conflicts—for example, a collision with a vehicle alongside during the lateral movement itself—are not explicitly modeled, although they are partially reflected in the index because an alongside vehicle becomes a leader or follower in the target lane as the maneuver progresses. Accordingly, LCRI should be read throughout this paper as a rear-end-based lane-change risk index. Following the three-level operational grouping in [
11], we stratify LCRI into low-risk, medium-risk, and high-risk levels. Because the target-agent term of every pair is drawn from the diffusion forecast, the
K samples yield a distribution of LCRI values. We report the sample mean as the expected risk and retain the per-sample maximum as a worst-case diagnostic.
Crucially, every prediction is produced under a discrete intent code
c (
Section 2), and the LCRI is computed from the same forward pass. The risk index can therefore be grouped by code, allowing us to analyze the association between learned discrete prototypes and lane-change risk. We analyze this relationship quantitatively in
Section 4.
3. Experiment Settings
3.1. Data Preparation
We evaluate our framework on the highD dataset [
40], a large-scale naturalistic vehicle trajectory dataset recorded by drone-mounted cameras over German highways. Unlike traditional datasets collected via vehicle-mounted sensors, highD provides highly accurate positioning with an error of less than 10 cm from an aerial bird’s-eye view. The dataset aggregates data from roughly 110,500 vehicles and approximately 45,000 km of cumulative driving distance across six recording sites, covering a wide range of traffic densities and interaction patterns.
The raw trajectory data is sampled at 25 Hz. For each scenario, we extract a historical observation window of s (75 frames) and predict the future trajectory for s (125 frames). To capture local interactions, we construct a heterogeneous interaction graph for each target agent. Specifically, we select up to spatial neighbors based on their relative positions (i.e., preceding, following, and alongside vehicles on the current and adjacent lanes). The coordinates of all agents and vectorized lane boundaries are normalized to the target agent’s frame at the last observed timestep ().
A significant challenge in naturalistic driving datasets is the extreme class imbalance, where KL maneuvers vastly outnumber LC maneuvers. To prevent the model from collapsing into a trivial solution that predicts only straight paths, we apply an undersampling strategy during training-time preprocessing: all LCL and LCR samples are retained, while KL samples are randomly downsampled. We use files 01–50 for training and files 51–60 for testing. The split is performed at the recording level. Every vehicle appears in exactly one highD recording, thus no trajectory windows extracted from the same vehicle can appear in both the training and the test subsets. Within each recording, samples are extracted from every eligible vehicle track with a sliding window at a stride of 10 frames (0.4 s). Consecutive windows from the same vehicle therefore overlap, but only within the same subset. This overlap enlarges the effective sample count without introducing any train–test contamination. The balanced training split contains 117,658 samples, including 42,015 KL, 40,308 LCR, and 35,335 LCL samples. For evaluation under the natural driving distribution, we use the unbalanced test split with 255,069 samples, including 238,687 KL, 8609 LCR, and 7773 LCL samples.
3.2. Implementation Details
The encoder backbone is implemented as a hierarchical VectorNet. Each subgraph branch uses a 3-layer MLP, while the global interaction graph adopts self-attention with 4 attention heads and a hidden size of 128. The codebook is configured with entries and an embedding dimension of , and the commitment loss weight is fixed at . Training is performed for 100 epochs with a batch size of 64 and the Adam optimizer at a learning rate of . To let the model first focus on geometric reconstruction, a dynamic schedule is applied to the intent classification weight . A 10-epoch warm-up with is followed by a 20-epoch linear ramp-up that brings to 1.0.
The generative model is a 2D U-Net conditioned on discrete context indices extracted from vectorized scene-context learning. Since the diffusion model generates only the target vehicle’s future action sequence, the noisy action input is organized as a 4D tensor with shape . Here, is the batch size, corresponds to the action channels, and the singleton height dimension allows the temporal action sequence to be processed by 2D convolutional blocks. Inter-agent information enters the diffusion model through the discrete scene context code rather than through generated multi-agent action channels. The network consists of residual blocks with channel multipliers of , with attention blocks applied at selected downsampled temporal resolutions. We employ a cosine noise schedule with diffusion steps. The model is optimized to minimize the Mean Squared Error (MSE) of the noise prediction. During training, the condition c is dropped with probability . During inference, we generate samples per scenario with guidance scale . The predicted actions are integrated by the kinematic layer with s.
All models were implemented using the PyTorch 2.3.0 framework. The training and inference experiments were conducted on a single NVIDIA 2080 Ti GPU with 11 GB of RAM. The training-stage hyperparameters were selected as follows. The commitment weight
follows the standard VQ-VAE setting [
41], and the training is not sensitive to it in our experiments. The codebook size
was chosen to provide sufficient capacity for intra-maneuver variation while keeping each code supported by enough training samples. A larger codebook produces finer-grained prototypes but increases the number of rarely used codes and weakens per-code statistics, whereas a smaller codebook forces distinct interaction patterns to share a single code and reduces the semantic purity of the prototypes. The warm-up schedule of the intent classification weight
allows the encoder to first learn geometric reconstruction before the semantic objective is introduced. Activating
too early or with a larger final value causes the codebook to collapse onto the three maneuver labels, at the cost of geometric fidelity. On the other hand, a smaller final value weakens the association between codes and maneuvers. The number of Monte Carlo trials
was chosen such that the standard error of the RCRI estimate is below the spacing of the three-level risk thresholds. The learning rate and the number of epochs were selected based on convergence of the validation loss. The inference-stage parameters
and
K are analyzed quantitatively in
Section 4.4. For ease of reference,
Table 1 summarizes the main symbols and tunable parameters of the proposed framework together with the values used in the experiments.
3.3. Baseline Models
To evaluate the effectiveness of the proposed framework, we compare it with several state-of-the-art trajectory prediction models reported in the literature. These baselines cover a range of methodologies, including recurrent neural networks, transformer-based architectures, and recent diffusion probabilistic models. The baseline results for model comparisons are taken from the original studies, which were evaluated on the highD dataset.
S-LSTM [
42]: An early baseline that pairs LSTM cells for individual motion modeling with a social pooling layer for aggregating features from neighboring agents; it was first proposed for pedestrian trajectory forecasting.
CS-LSTM [
20]: A vehicle-oriented extension of S-LSTM that replaces the social pooling layer with a convolutional one to better preserve the spatial grid surrounding the ego vehicle.
MHA-LSTM (+f) [
21]: A multi-head attention model that scores the relative importance of surrounding vehicles. By combining interaction features with historical motion, it explicitly weights the influence of neighbors during forecasting.
iNATran (M) [
24]: An intention-aware, non-autoregressive Transformer that combines social and temporal attention to model spatiotemporal interactions and uses an intent-driven query design to generate multimodal futures in parallel.
DACR-AMTP [
16]: An adaptive multi-modal predictor that incorporates a collision-risk-driven drivable area into a graph-augmented multi-head attention pipeline, foregrounding safety and risk in interactive scenes.
3.4. Evaluation Metrics
We utilize three standard displacement metrics: Root Mean Square Error (RMSE), Average Displacement Error (ADE), and Final Displacement Error (FDE). Given the multimodal nature of our predictions, these metrics are computed using the best-matching sample among the
K generated trajectories for each test case. RMSE assesses temporal accuracy at specific time horizons throughout the prediction window. ADE calculates the mean Euclidean distance over all predicted timesteps, whereas FDE isolates the endpoint error at the final prediction frame
. They are calculated as follows:
where
represents the
k-th predicted trajectory sample for the
m-th test case,
represents the corresponding ground-truth coordinate at prediction timestamp
t, and
M is the total number of test samples. We report RMSE at specific horizons (i.e., 1 s, 2 s, 3 s, 4 s, 5 s) to analyze temporal accuracy. As a complement to the best-of-
K protocol, single-sample results (
) are reported in the sensitivity analysis of
Section 4.4.
For the risk assessment, we evaluate both continuous and ordinal agreement. Continuous agreement is measured by Pearson correlation and Spearman rank correlation between the forecast-based LCRI and the LCRI computed from realized future trajectories. Ordinal agreement is evaluated using the three-level LCRI classes following [
11]: low risk (
), medium risk (
), and high risk (
). We report the three-class confusion matrix, overall accuracy, weighted-F1, and high-risk recall.
5. Conclusions
In this paper, we propose IntentDiff, an intent-conditioned diffusion framework for proactive lane-change risk assessment. The framework estimates lane-change risk before the maneuver unfolds by computing LCRI on predicted future trajectories rather than on completed or observed trajectories alone. A vectorized scene context learning module combines a hierarchical VectorNet with a VQ-VAE to map agent–map interactions into discrete intent codes. These codes organize complex traffic situations into interpretable intent prototypes and provide semantic guidance for diffusion-based trajectory generation. Conditioned on the learned intent code, the diffusion model generates kinematically consistent multimodal trajectories that support proactive risk computation.
The experimental findings on the highD dataset can be summarized as follows. First, the framework attains competitive trajectory prediction accuracy, with an ADE of 0.42 m and an FDE of 1.11 m over a 5-s horizon. The sensitivity analysis shows that intent conditioning is responsible for a nearly threefold reduction in displacement error relative to unconditional sampling, while the discrete–continuous conditioning ablation shows that this benefit stems from conditioning itself, whose value lies in interpretability and code-level risk stratification. Second, the learned codebook operates as an effective discrete bottleneck. Sixty codes are active, the codebook perplexity corresponds to roughly 91% capacity utilization, and the codes retain 58% of the maneuver information ( nats) with an average per-code purity of 0.83. Third, for 1500 naturalistic lane changes, the forecast-based LCRI agrees closely with the realized-future LCRI, indicating that most high-risk lane changes under the surrogate index can be identified before the maneuver is completed, with an end-to-end latency of 45 ms per scenario. These results suggest that the learned codebook captures not only maneuver semantics but also risk-relevant interaction patterns, allowing proactive risk estimates, in the sense of the adopted rear-end surrogate index, to be traced back to interpretable intent prototypes.
Several limitations of this study should be acknowledged. First, since the experiments are conducted on the highD dataset, recorded on structured German highways, the conclusions of this study are limited to structured highway scenarios. Second, the learned codebook characterizes the interaction patterns of highway traffic as represented in highD. Since driving behaviors such as following distance, gap acceptance, and lane-change timing vary across countries and driving cultures, transferring the framework to other regions or unstructured environments, such as urban roads and intersections, would require retraining the codebook on corresponding data. Third, the three-level LCRI thresholds may require recalibration in driving environments with different speed and density profiles. Fourth, the reliability analysis quantifies dataset-level variability through bootstrap resampling and inference-time variability through multiple sampling seeds, but the variability introduced by the training process, including network initialization, mini-batch ordering, codebook initialization, and the stochastic diffusion training, has not been quantified. Therefore, future work will proceed in four directions. First, we will validate the framework on naturalistic trajectory datasets from other countries and road environments. Second, we will extend the framework to more complex urban environments and incorporate joint multi-agent forecasting for surrounding vehicles. Third, we will evaluate the proposed risk index in closed-loop planning to assess its impact on autonomous decision-making. Fourth, the reliability analysis will be extended to the training process through multi-seed training of both stages, together with systematic sweeps of the intent-classification loss weight and the codebook size.