{'fraction_non_alphanumeric': 0.02587630757937236, 'fraction_numerical': 0.007585489692298281, 'mean_word_length': 4.897366522366522, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Action Sequence Predictions of Vehicles in Urban Environments using Map and Social Context

This work studies the problem of predicting the sequence of future actions for surround vehicles in real-world driving scenarios. To this aim, we make three main contributions. The first contribution is an automatic method to convert the trajectories recorded in real-world driving scenarios to action sequences with the help of HD maps. The method enables automatic dataset creation for this task from large-scale driving data. Our second contribution lies in applying the method to the well-known traffic agent tracking and prediction dataset Argoverse, resulting in 228,000 action sequences. Additionally, 2,245 action sequences were manually annotated for testing. The third contribution is to propose a novel action sequence prediction method by integrating past positions and velocities of the traffic agents, map information and social context into a single end-to-end trainable neural network. Our experiments prove the merit of the data creation method and the value of the created dataset - prediction performance improves consistently with the size of the dataset and shows that our action prediction method outperforms comparing models.


I. INTRODUCTION
Autonomous driving is expected to fundamentally change our understanding of mobility and give us safer and more efficient roads. One fundamental building block to achieve this, is the ability to predict future actions of other road users. Only if one is able to accurately predict the potentially multimodal future, collisions can be avoided. However, predicting future actions and trajectories of other road users requires a fundamental understanding of traffic scenarios. This includes understanding the static and dynamic environment, as well as the traffic rules and the unwritten rules that govern how road user interact with each other.
The most common approach in this research direction is to directly predict trajectories of other vehicles. While this is intuitive, allows for fully automatic data collection with today's test vehicles and yields a good representation for decision making and planning algorithms, it does not consider well that humans learn driving as a sequence of actions and also interpret driving scenarios that way. Furthermore, many traffic rules are defined with high-level representations as driving maneuvers. Thus an autonomous driving system requires emphasis on anticipating high-level actions of surround vehicles to better plan its own actions and to be more interpretable to humans.
To overcome the aforementioned challenges, we propose to state the problem of predicting traffic agents as the task of predicting action sequences and create a large-scale action prediction dataset based on real driving data. To circumvent the expenditure of annotating a dataset manually, we design an automatic method to convert trajectories of real-world traffic agents into action sequences. We apply the method to the large-scale tracking dataset Argoverse [1] and compile a new action prediction dataset. The dataset contains 228,000 action sequences and features five distinct driving actions: cruise ( , c), turn left ( , tl), turn right ( , tr), lane change left ( , ll) and lane change right ( , lr) that describe normal vehicle operation. For testing, 2,245 trajectories from the validation set have been manually annotated. The dataset allows us to train and compare models in a quantitative way in terms of their ability to predict a sequence of plausible future actions. To our best knowledge, this is the largest dataset for action prediction of traffic agents derived from publicly available data.
We further propose an end-to-end trainable neural network that uses the past positions and velocities of the traffic agents, the map information and the social context to predict the future actions of the traffic agents. To fully leverage the power of convolutional neural networks (CNNs), we encode these information into a rendered image with multiple channels and use 2D and 3D CNN modules for prediction. Because the future actions are often uncertain and multimodal, out model outputs a probabilistic distribution of all plausible actions which can facilitate downstream planning. Fig.1 showcases the concept of our action prediction approach.

II. RELATED WORK
Behaviour prediction formulated as trajectory forecasting for humans as well as vehicles has been extensively studied.
The line of research closest to ours focuses on predicting high level intention of traffic agents. One group of work in driver action prediction concentrates on the ego vehicle where rich information about the state is available. Morris et al. [2] use rich sensor data including radar, lane marking detection and a head tracking camera to predict lane changes in a highway driving scenario. Jain et al. [3] extend this approach to a larger set of maneuvers and base their method on a video of the driver, maps, vehicle dynamics and outside view in more diverse environments. In [4] surround video and map renderings are used to predict yaw and acceleration in an end-to-end framework. [5] forecast lane-changes of other traffic agents in highway scenarios and analyze the challenge of heavily unbalanced data in this context. In more challenging urban environments, [6] classify driving actions at structured four way intersections with an LSTM.
Early approaches to trajectories prediction, combine maneuver recognition with parametric motion models for each maneuver. Laugier et al. [7] use a Hidden Markov Model (HMM) with access to high level information such as distance to lane borders, signaling light status or proximity to an intersection to recognize behaviour of traffic agents. Trajectories are then sampled from a Gaussian process and used for evaluating collision risks. The same task is approached in [8] by detecting maneuvers with a Bayesian network. Houenou et al. [9] propose a heuristic maneuver detection module with full environment knowledge including each vehicle's acceleration and yaw angle, together with an analytic description of trajectory sets. By using a variational Gaussian Mixture Model, Deo et al. [10], [11] implement probabilistic trajectory prediction for highway scenarios in the combined maneuver and trajectory prediction framework. Recently, [12] used a neural network based approach to combine intention and trajectory prediction with dynamic HD maps and LIDAR information.
A second group of trajectory prediction algorithms directly approaches the task without intermediate state representations. Lee et al. [13] propose an end-to-end trainable recurrent neural network structure that includes scene context and samples multiple trajectories to capture the multi-modal nature of trajectory prediction. In [14], a wide range of output representations are evaluated in combination with a fully convolutional encoder structure. By defining a graph structure, [15] explicitly models the relation between multiple traffic agents and uses an LSTM-based encoder-decoder to predict trajectories. Closely related to trajectory prediction, researchers at Waymo [16] learn a driving policy using rich maps and employ data augmentation to train robust models.
In the context of pedestrian prediction and tracking, a central challenge is modeling of interactions. Pellegrini et al. [17] show that social interactions and scene knowledge can boost tracking performance. [18], [19] predict trajectories based on past ego and social trajectory observations,

III. METHOD
First, our method introduces an interpretable representation of traffic agents by forecasting high level action sequences of a single traffic agent. Second, our method is completely learning based and uses a sequence of map, agent, as well as social information (other traffic agents) to predict the agent action sequence. This is done using a fully convolutional neural network with two-dimensional convolutions for computing spatial features and two three-dimensional layers for late and early fusion of temporal features. The networks head is a fully connected layer that predicts the full action sequence of the traffic agent at once with a single forward pass through the network. Finally, to make this method applicable for large scale datasets, we introduce an automatic approach to generate action sequences from X-Y trajectory data and map information. Note that our method is entitycentric and only predicts the action sequence of one agent, however we consider other traffic agents during prediction.

A. Network Architecture
We use a VGG-inspired architecture for action sequence prediction. Like [14], early and late fusion of temporal features is performed with three-dimensional convolutions. To avoid overfitting on the training data, we use a smaller model compared to some fully convolutional trajectory prediction approaches [14].

B. Input and Output Representation
The input to our neural network consists of three parts, target agent, map and social information. All the information comes as a tensors with spatial dimension 128 × 128. We consider this combined information as our observation at time t, which we denote as O t . More precisely, O t is given as, where, all components are rendered frames, spanning 50 m × 50 m. All frames are centered at the target agent's last observed position and rotated towards its driving direction. Each observation O t contains one layer for the rendered lane centerlines m which stays fixed for all time steps. As the map only consists of centerline information, it can easily be captured with current industry grade perception systems and is present in most rich maps. Still, it naturally extends to more extensive information that might be available from manual annotations or more advanced data acquisition systems. Additionally, in O t the target agent is represented by three layers: 1 target,t , which is the indicator function representing the target agent's position by a onehot encoded layer and two layers v target,t representing the current velocity in global coordinates. The other agents are represented the same way, but with all agents jointly rendered into the three available channels. Finally, the input to the network are the last five observation, where the observations are spread over the last two seconds, with t ∈ (−2 s, −1.5 s, −1 s, −0.5 s, 0 s).
To improve the performance and robustness of our method we also perform data augmentation. More precisely, we rotate the network input randomly by θ, which is uniformly sampled from the range −5 • ≤ θ ≤ 5 • . To perform the augmentation efficiently and without artifacts, all input data is stored in parametric form and rendered on-the-fly.
The output of the network is an action sequence for the next 3 s, resulting in a prediction horizon of 30 steps with a sampling time of 100 ms. The output of the network model at each time step is an independent probability distribution of the 5 action classes. Note that the temporal relation and implicit dependence needs to be learned by the model from the training data.

C. Probabilistic Action Predictions
In contrast to trajectory forecasting methods, our approach directly returns probabilistic predictions, without any requirement for sampling multiple forecasts [13] or defining spatially discretized grid-maps, as done in [21], [14]. Furthermore, this also allows for transparent performance measures since action classes can easily be interpreted by humans. The performance evaluation of trajectory prediction methods on the other hand normally uses averaged displacements errors. Even thought this seems to be an transparent evaluation, due to inbalanced datasets where following the current lane (our cruise action) is heavily over-represented, getting better displacement errors not necessarily implies that the method is better at forecasting the important corner cases. Note that the imbalance in the datasets can be massive, e.g. our dataset consists of 80% cruise trajectory, however, there are other traffic environments where cruise trajectories can make up as much as 99% of the dataset [5]. This imbalance also explains that often simple constant velocity forecasting methods are competitive for short prediction horizons [14], even thought they lack any understanding of the traffic scenario.
By predicting action sequences, our method does not solve the imbalance in the dataset. However, our evaluation can be balanced easily and we can focus on complex scenarios that require to understand the traffic scene.

IV. DATASET
Many large scale datasets for visual tasks in autonomous driving such as image segmentation, object detection or depth estimation have been released in recent years and fueled the development of corresponding learning based methods [1], [22], [23], [24]. In contrast to this, modeling and prediction of human decision making in driving scenarios is heavily underrepresented in terms of published methods. One reason for this definitely is the lack of data. Public datasets, while being suitable for vision tasks, fall short when approaching the task of modeling human driving behaviour in complex environments. Furthermore, most datasets directly intended for this purpose remain private [12], [14].

A. Argoverse
An exception is the Argoverse Trajectory Forecasting dataset [1], which contains approximately 325,000 automatically detected trajectories in an urban environment. Out of them, 245,000 cover 5s segments that can by used for our approach 1 . The dataset further provides basic semantic map information, including lane centerlines and the drivable area. In our work we augment this dataset by automatically annotating high-level actions such as lane changes and turns that are interpretable by humans and have the potential to boost low level tasks like trajectory forecasting [11]. Finally, we also automatically extract velocity information of the agents, which further helps our prediction model.

B. Map Information
As shown and discussed in Section II, using HD-map information can be fundamental for traffic agent forecasting. However, in this paper we show that HD-maps can also be used to automatically annotate data, or in our case generate high-level action sequences from trajectories. This avoids, time and labor intensive manual labeling, and at approximately 245,000 trajectories in Argoverse, which corresponds to roughly 7.5M action annotations, this is the only viable approach.
One the one hand, relying on HD-maps for the action sequence generation, is in our opinion not restrictive, since maps are regarded essential for safe operation of autonomous vehicles. On the other had, for large scale datasets, annotating a semantic map with lane centerlines, which remains constant over time, scales favorably compared to annotating every time step of every agent recorded during driving. Furthermore, as current lane detection algorithms show an impressive performance in a wide range of practical scenarios, automatic extraction of local map information could be feasible to further automate the labeling process.
For the task of action sequence annotation, the semantic HD-map available in [1], can be represented as a graph where each node corresponds to a short sequence of line segments and edges represent the relation of between the line segments, which is visualized in Fig. 3. Edges can have the labels successor, predecessor, and neighbor lane-segment. Nodes contain the geometric properties describing the lane segments and semantic information if the segments describe a turn (either left or right) or a lane driving straight forward.

C. Automatic Action Labeling
Action extraction from trajectories is performed in a threestage pipeline described in the following paragraphs. a) Trajectory Smoothing: As the trajectories are generated from automatically detected objects, all samples are noisy and need to be filtered in the first stage. For this purpose we use a bidirectional Kalman filter with a standard constant acceleration model, where the jerk is modelled as a noise input and we use the agent's noisy position as the measurement. Note that this filter does not only help to smooth the agent's position but also estimates the velocity of the agent. b) Lane Assignment: In the second stage of the annotation pipeline, each sample from the trajectory is assigned to a node, which represents a lane-segment in the graph-map as shown in Fig. 3. Following the temporal order of samples, each trajectory induces a sequence of nodes that are visited. If the sequence of nodes follows a valid path through the graph, i.e. the path only contains transitions between nodes that are connected by an edge, actions can be extracted from the graph. The property that only a valid path allows for the extraction of an action sequence has major impact on designing the node assignment algorithm. Using a purely geometric approach, where each sample is assigned to its nearest neighbor in an arbitrary measure, could lead to a large fraction of invalid trajectories. We thus propose to use a joint geometric and semantic lane assignment algorithm based on the Viterbi algorithm.
One can interpret a trajectory as the observation from a Hidden Markov Model (HMM) defined by the graph-map together with actions as latent variables. The graph-map induces a HMM, where the lane segment used by the agent at time step t corresponds to the hidden state X t and the position Y t ∈ R 2 is the symbol emitted by the state. The emission probability captures the driver's behaviour of not perfectly following the centerline, uncertainties in the map and measurement noise. Using this viewpoint, the actions taken by the agent define the sequence of hidden states, or inversely: inferring the most likely sequence of hidden states from the observed trajectory is equivalent to finding the underlying action sequence. This task can be solved with the Viterbi algorithm.
To reduce computational complexity, only lane segments that are closer than a threshold of 5 m to the observed trajectory are included as hidden states in the HMM. Prior knowledge about the driving behaviour can be encoded in the transition matrix A between lane segments, which we populate using the edges of the graph-map that describe the relation between lane segments. For the possible transitions to a successor, predecessor or neighbor lane, values of 1.0, 0.5 and 0.3 are assigned respectively. For transitions between not connected lanes, a skew variable α is introduced. Setting α = 0, yields state sequences that can be annotated in any case, given the map information is correct. This also includes trajectories that actually cannot be modelled by the 5 action classes used in this work, such as U-turns. Thus, we set α = 0.001 which allows for transitions between unconnected lane segments, preventing the annotation of an action sequence for cases that cannot be annotated with the given actions. It is important to note that for the transition matrix A the sum of entries from a state does not necessarily sum up to 1 and thus, does not represent a traditional transition probability matrix, but rather a matrix of negative transition costs. We use this representation to not penalize lane-segments that have multiple lanes connected to them in the graph-map, such that trajectories going through them do not come at a higher cost.

D. Test Data and Ordered Action Sequences
For testing, 2245 trajectories from the validation set have been manually annotated. However, the annotator did not generate temporal action sequences, but what we call ordered action sequences. Whereas action sequences, as produced by our automatic labeling, contain an action for each time step, ordered action sequences only contain the order of actions. To make this clear, let us consider an simple left lane change example where the prediction horizon is six time steps. In our example the the action sequence is given by a s = (c,c,ll,ll,c,c). This action sequence would correspond to the following order action sequence a os = (c,ll,c), thus the exact temporal location of the lane change is lost, however, the gist of the maneuver is captured.
Annotating, ordered action sequences is also significantly simpler and less error prune, compared to temporal action sequences. Thus, for our 2245 test trajectories, we have hand annotated ordered action sequences for the 3 s prediction horizon. Note that to avoid bias, the annotator had no access the automatically generated labels.

E. Dataset Statistics
While the trajectories present in the Argoverse dataset are already filtered to show challenging behaviour, the extracted action data is still unbalanced, with the majority of the samples representing the cruise class as shown in Table  I. While this mostly stems from the lower probability of encountering an active maneuver compared to just following a lane in cruise, it also reflects the fact that a turn or lanechange is most of the times followed by the traffic agent stabilizing in the cruise state.
Whereas generating the dataset statistics for our automatically generated action sequences in the training and validation set is based on the number of occurrences, the statistics for the ordered action sequences used an adapted method. State proportions are estimated by counting states with the inverse number of total states annotated for the corresponding sequence, e.g. a sequence only annotated as cruise counts 100% towards cruise, while a sequence consisting of cruise and a following lane change counts with 50% towards both classes. In total, the state distribution for the train, validation, and test set is as shown in Table I.

A. Training
Network parameters are optimized with the Adam optimizer and an initial learning rate of 10 −4 . A step decay schedule with a stepsize of 10 epochs and a factor of 0.5 is used for adapting the learning rate. Dropout of 0.5 is used to reduce overfitting. All variations of the network are trained for 50 epochs.
To compensate for the heavily imbalanced dataset, weighted random sampling is used for dataloading. Weights are assigned based on the presence of actions anywhere in the prediction horizon: if a turn is present, the sample gets weighted with a factor of 3, if a lane-change is present, the weighting factor is set to 10. This does not fully compensate for the imbalance, but performed better than strictly weighting samples by their inverse probability.
Note that the positions and velocities of all traffic agents used in the input representation (1) are extracted from the noisy trajectory data with a bidirectional Kalman-filter, as described in Section IV-C. However, the filter is only applied to the observed values, to ensure causality.

B. Baseline Model
By proposing a new formulation of the traffic agent prediction task, no direct comparison to other methods would be possible. However, trajectory forecasting methods are intended to predict a trajectory that represents the future actions of the agent. Therefore, it is possible to adapt a method originally designed for trajectory prediction to the new task. For our evaluation, a k-Nearest-Neighbor (k-NN) based method that was evaluated in [1] 3 and outperformed all their tested deep learning models for multimodal prediction is adapted to our problem statement and used as a baselinemodel for comparison. With the nearest neighbor in the training set, the automatically extracted action sequences can be used as a prediction for the task at hand. Given the predictions from k-NN, the class labels can be averaged at each time step, resulting in a prediction that matches the probabilistic form of our proposed approach. We set k ∈ {9, 50, 100} to compare the influence of sampling multiple trajectories and select the best model for further comparison.
C. Evaluation Approach 1) Direct Evaluation of Predictions: Interpreting every time step as an independent classification problem, allows for the direct evaluation of the networks performance. As the data is heavily imbalanced, classification accuracy on the whole dataset does not provide sufficient insight. Therefore, we measure performance by representing every action class as a binary classification problem, which allows the calculation of the average precision (AP) score. AP for each class and their unweighted average denoted as mean AP across all five action classes are used as a performance measure. This direct evaluation approach jointly measures the performance of predicting the right action classes together with the performance of predicting the right time step for a transition between two actions.  2) N -Most Likely Ordered Action Sequences: In addition to directly measuring the model's precision on the temporal action predictions, we evaluate our method by extracting the N -most likely ordered sequences of actions, i.e. sequences that are only defined by the order of actions, not their exact length or transition times.
The extraction of the N -most likely ordered action sequences, is sensible as the number of different actions in the 3 s prediction horizon is small. For our test set only 10 samples, corresponding to 0.45% of the manual annotations, where labeled as as sequence of more than two actions. Therefore, for extracting ordered action sequences from the temporal action sequence predictions, we only consider sequences with at most two actions, which makes the approach tractable.
When extracting ordered action sequences, the model of independent actions used during training needs to be taken into account. While this assumption is a good model for the probability of an agent performing action a t at time step t, it is not suitable to approximate the probability of observing a full action sequence a s = (a 0 , ...a T ). By just using the product of the predicted probabilities as an estimate for the sequence probability, the high temporal correlation of actions is neglected. We thus model the probability of a sequence with the two actions (a b1 , a b2 ) by p b (a b1 , a b2 , t s ) = min(p a b1 t0 , ...,p a b1 ts ) min(p a b2 ts+1 , ...,p a b2 T ), where the transition happens after time step t s leading to the blocks t 0 ≤ t ≤ t s of a b1 and t s < t ≤ T of a b2 . Given that within a block no transition may happen, the transition probabilities between identical actions are 1. Therefore, the total probability of the first block can be modelled as the lowest predicted probability for a b1 within t 0 ≤ t ≤ t s min(p a b1 t0 , ...,p a b1 ts ).
Note that the same holds for a b2 and the second block. Under the assumption that rare combinations, such as a left turn directly followed by a right turn, are assigned low probabilities by the network, the transition probabilities between the blocks are modeled as being equal for all action pairs (a b1 , a b2 ).   The problem of finding the most likely ordered sequence of two actions can then be defined as finding (a b1 , a b2 , t s ) that maximize the product of the two block probabilities By repeatedly searching for the most likely sequence while suppressing already extracted action pairs (a b1 , a b2 ), the Nmost likely ordered sequences can be extracted. We report total and per sequence top-N accuracy with N ∈ {1, 2, 3} in Table III. A sequence is rated as being detected if the groundtruth ordered state sequence is one of the top-N predictions. Trajectories that are annotated with sequences of length > 2 are always treated as being detected incorrectly.

A. Direct Evaluation
Performance metrics for the direct evaluation of predictions for the k-NN baseline [1] and our proposed method are shown in Table II. The results affirm that increasing the number of sampled nearest neighbors by one magnitude (k=100) compared to the usual setting can improve its performance. Across all methods, the AP for the cruise state is on a high level, followed by turn actions. Lane changes are harder to predict with AP values at a much lower level. Also, the largest relative improvement of the proposed method compared to the baseline implementation can be seen for the two lane change action classes.
This may be explained by the dataset statistics together with shape of lane change trajectories. While lane changes as well as turns are underrepresented in the training data, turns have a much more distinct trajectory shape and thus can be detected more easily, even without modeling them explicitly.

B. N -Most Likely Ordered Sequences
Results of evaluating our proposed as well as the best performing baseline method on the manually annotated ordered sequences are provided in Table III. In contrast to the baseline model, where the cruise action class is overrepresented, our proposed method predicts a more diverse set of action sequences. While a relatively high Top1-accuracy is observed for sequences that require detecting a maneuver, e.g. (tl), (ll, c), (lr, c), sequences that involve the prediction of maneuvers such as (c, ll) or (c, lr) show a high improvement in the Top2-accuracy. The observation that some action classes heavily improve in Top2-accuracy is in line with the commonly accepted assumption that agent prediction needs to be multimodal to account for the uncertainty of the future. Fig. 4 and 5 show the confusion matrix for the top-1 and top-2 sequence prediction, with sequences ordered according to their frequency in the dataset. For top-1 prediction, the classification errors mostly stem from assigning sequences with an incorrect second action, e.g. (tl) instead of (tl, c), which confirms that prediction is a much harder task than classification. Still, the top-2 predictions allow for correcting for many of these errors, resulting in substantially higher values on the diagonal.

C. Ablation Study
An ablation study is conducted to evaluate the impact of the separate modules. Ablated methods are compared using the mean AP on the validation dataset, with results shown in Table IV. To investigate the influence of input representation the input tensor is grouped into following modules: The target agent information (Target) includes positions and velocities of the target agent (1 target , v target ). Social    Besides ablating the input representation, we show that traffic agent action prediction can profit from the presented data augmentation approach of rotating the complete contextual information by a small random angle.
The results confirm the usefulness of providing all three sources of information jointly, with the map having the biggest impact. Interestingly, adding social information to a representation that does not contain a map, has substantially higher impact than adding it to a representation that does contain a map. This indicates that there is redundant information available in the map and social context the network is able to use.

D. Dataset Scale study
The second ablation study investigates the relevance of the dataset size for the action prediction task while using our full model. Thus, the network is trained with three subsets of our data that reflect 50%, 10% and 5% of the full set of action sequences. The dataset reduction is implemented by skipping the corresponding number of samples, to avoid changing the   Table V, show a large difference in performance between the different scales, indicating that the amount of data has major impact on the prediction performance. Furthermore, the considerable improvement from 50% of the data to the full dataset allows for the conclusion that the performance did not saturate at the scale present in the Argoverse dataset and larger amounts of data could benefit the community.

VII. CONCLUSION AND FUTURE WORK
In this paper we investigated the task of predicting highlevel actions of vehicles in urban environments. To make this task viable, we proposed an algorithm to automatically extract action sequences using HD-maps, from the public Argoverse [1] dataset. Furthermore, we proposed an action prediction network, that predicts the future actions sequence considering agent, map, and social information. The network is completely based in rendered images and can be trained in an end-to-end fashion using the automatically generated large scale action sequence dataset. We showed that our action prediction model, together with our dataset, can significantly outperform existing methods that are adapted from trajectory prediction. This additionally shows that action prediction is not solved by trajectory prediction. Thus, in our future work we will investigate how action prediction and trajectory prediction can be combined to get the best of both worlds.