Identification of evasive manoeuvres in traffic interactions and conflicts

: The study presents a simple and easy to implement method for detection of the evasive action start in traffic interactions. The method is based on comparison of the studied trajectory with a reference set of ‘unhindered’ trajectories, interpreting the start of evasive action as the moment when no more similarities can be found. The suggested algorithm performs well for primary interactions when road users arrive in an unhindered state. It fails, however, in case of secondary interactions. Explorative application of the method on a large dataset of normal and conflict traffic situations concludes that traffic conflicts occur more frequently in secondary interactions, presumably due to higher cognitive load on the involved road users. Despite the limitations, the method can be used both for the safety studies based on traffic conflicts and for more general quantification and visualisation of the road user behaviour.


Introduction
Surrogate measures of safety (SMoS) are meant to be an alternative/complement to crash-data in traffic safety analysis (Saunier & Laureshyn 2021;Chang et al. 2017;Tarko et al. 2009). The main idea behind SMoS is that near-crash events in traffic can be used as surrogates for real crashes and by studying these events it is possible to learn about safety of a specific traffic system. The advantage of using SMoS is that near-crashes occur much more frequently compared to crashes, which makes it possible to directly observe these events in traffic and to perform safety studies during relatively short periods of time.
Following this idea, many different indicators have been developed that attempt identify these near-crash events (or conflicts) in traffic. Some of these indicators are based on observations from human observers while others are specifically designed to be calculated from trajectory data gathered from either video analysis or simulations.
The most frequently used SMoS indicator is Time-to-Collision, TTC (Laureshyn et al. 2016), which is the time remaining before the two road users collide given they continue travelling as intended. Obviously, TTC is a continuous indicator, and it provides a value as long as the road Since more and more SMoS studies utilize trajectory data from either video analysis tools or microscopic simulations, the use of TTCmin has become more or less exclusive compared to TA (Johnsson et al. 2018). The reasons for that, however, are purely pragmatic-while it is quite straightforward to choose the lowest value in a sequence of numbers, identification of the moment of evasive action requires understanding of the interaction development process and its operationalization is not trivial.
From the theoretical perspective, however, there are many arguments that favour TA in front of TTCmin. Güttinger (1982) introduced the two models of reasoning when defining a traffic conflict, also showing how the choice of the conflict-defining indicators has a direct impact on which track will be followed (see Figure 1). In the first model ( Figure 1a), a conflict is defined as a set of initial conditions that depending on the presence and effectiveness of an evasive action either result in a collision or resolve without further consequences. Defined in this way, conflicts and collisions are steps within the same causal chain, conflict being the required predecessor for a collision. This model is expandable-for example, one can further construct mathematical framework that quantifies the probability of a given conflict to become a crash. The instance of an evasive action onset (the moment for which TA is measured) is a good candidate for defining a conflict since it represents the qualitative change in the situation development from unawareness of the danger to active actions to avert it.
(a) (b) Figure 1 Two models of relation between traffic conflicts and crashes-adopted from Güttinger (1982): (a) conflict precedes a collision; (b) conflict is mutually exclusive with a collision The alternative model (Figure 1b) defines the conflict as the outcome of evasive actions. This track is followed if conflict is defined on the basis of TTCmin, but also many other outcomebased indicators, such as Post-Encroachment Time, PET (Allen et al. 1978), as well as indicators describing the intensity of the evasive action itself (Tageldin & Sayed 2016;Bagdadi 2013;Gettman et al. 2008;af Wåhlberg 2004). Being defined this way, conflicts land on a parallel track with collisions since by the moment the conflict is identified we can be sure that the collision has already been avoided (knowing that the lowest TTC value is TTCmin, we also know that it cannot go down to zero to become a crash). The theoretical foundation for using conflicts belonging to one chain of events as a predictor for frequency of crashes belonging to a parallel chain of events becomes quite shaky. Another theoretical challenge is related to the motion prediction necessary for calculation of TTC. The classical definition of TTC suggested by Hayward (1972) assumed that both road users will keep the same speed and heading. It has been repeatedly shown that this assumption does not hold, particularly in situations when the road geometry, the nature of the manoeuvre performed or interaction with the traffic light actually require adjustments of both speed and travelling path Lefèvre et al. 2014;Mohamed & Saunier 2013;van der Horst 1990). The simplistic kinematic-based methods for addressing the issue, such adding constant acceleration or angular speed assumptions, rather make the predictions even more unrealistic than solve the problem (van der Horst 1990).
Context-based motion prediction which utilises the historical trajectories of other road users performing the same manoeuvres shows better performance (Lefèvre et al. 2014;St-Aubin et al. 2014;Mohamed & Saunier 2013). It is reasonable to assume that, in case of no conflict, the road users would travel just as many others did before them. However, as soon as they realise the danger and initiate an evasive action, using the historical data becomes irrelevant, since it comes from the situations without a conflict. Lefèvre et al. (2014) theorise that in this occasion, special interaction-aware motion models should be used. To our knowledge, however, there are hardly any models available that can describe the functional road user behaviour in a safetycritical situation. Practically, this means that while TTC calculation until the start of evasive action (moment of TA) are relatively reliable with the context-based motion predictions, any calculations after that, including the moment of TTCmin, involve simplistic/unrealistic assumptions and cannot be trusted.
Finally, an additional argument in favour of TA can be drawn from the studies on the human perception of the traffic conflicts. Even though human judgements are often questioned for their subjectivity, there is also a solid bulk of evidence showing that humans generally agree both in identifying the traffic conflicts and in ranking the conflicts by their severity (Yastremska-Kravchenko et al. 2022;Madsen 2018;Kruysse & Wijlhuizen 1992;Kruysse 1991;Hydén 1987;Grayson 1984;Lightburn & Howarth 1979). Traffic conflict validation studies in which observer's judgements were the main conflict definition tool or at least had potentially significant influence on how the conflicts were coded through the objective measures, show much better correlations with crash counts compared to what is found in more recent studies utilising automated methods for conflict detection (Svensson 1992;Hydén 1987;Migletz et al. 1985). These results point in the direction of that while we cannot fully rely on human judgements as the absolute ground truth, they may provide valuable insights in what traffic conflict 'ingredients' are important, including which moments are the most relevant, in the holistic perception of a traffic situation dangerousness by a human observer.
In the study of Kruysse (1991), the observers were shown videos containing traffic conflicts, interrupted in the beginning, culmination and the final resolution stages of the conflict. The results showed, both for traffic professionals and observers with no traffic background, that the initial phase of a conflict contained sufficient information to predict the final severity score of the situation, while the later stages hardly contributed to the opinion already formed at the beginning. The recent study of Yastremska-Kravchenko et al. (2022) attempted to mimic human ranking of traffic situation dangerousness using objective indicators calculated, similarly to approach used in Kruysse (1991), for the start of an evasive action ('beginning'), moments of indicators reaching their extremes ('culmination') and the latest moment of the road users still being on a crossing path ('outcome'). Both the fact of presence of an evasive action and the indicator values calculated for these moments came as the strongest explanatory variables in the built decision machine (for the situations with no evasive action, the 'culmination' variables came out as significant).
It can be concluded that the moment of evasive action initiation appears to have a special meaning within the SMoS discourse both from the theoretical perspective and supported by empirical evidence. This paper suggests and tests an automated method to identify the start of an evasive action from trajectory data, as well as provide some insights related to the differences and challenges in detection of evasive actions in normal and safety-critical situations.

Method
This section will present a general method for identifying the start of an evasive action from any road user based on trajectory data and how a simple manoeuvre-based motion model can then be used to make motion prediction from the moment before an evasive action is detected.
The method relies on comparing the trajectory under examination to a reference set of trajectories from unhindered road users and calculating its similarity to that set. The top row images in Figure 2 show the trajectory of a motor vehicle and a bicycle during their interaction. These two trajectories are then compared each with a set of trajectories from unhindered cars/bicycles performing the same manoeuvre (bottom row in Figure 2). If a trajectory is significantly different from the unhindered set at any point in time, this indicates that it has stopped being 'unhindered' and is therefore in an interaction (evasive action has begun). what is a proper measure of (un)similarity between two trajectories.
Starting with unhindered traffic, the term refers to road users performing a certain manoeuvre without interacting with any other road user. The unhindered trajectories are meant to capture travel patterns at the studied location when the road users only negotiate the infrastructure geometry and interact with the traffic light.
As for the similarity between trajectories, we propose a simple method that relies on the average distance between two trajectories. The calculation of 'similarity' at a specific position (and time instance) of the trajectory under examination is made in two steps. First, the point in the unhindered trajectory closest the current position is identified. Second, using the closest point as a starting point for the unhindered trajectory, the distances between the points (∆ , see Figure 3) in the two trajectories can be calculated (of course, this assumes that the trajectory points in both trajectories have the same temporal resolution).

Figure 3 The calculation process for the similarity between two trajectories at a specific point in time
The final 'similarity' at the timestep is the average distance calculated from the current position/closest position and steps backwards in time as shown in the equation (1): By counting the number of similar trajectories for each time step it becomes possible to determine at which step the evasive action starts. Figure 4 illustrates how the number of similar trajectories decreases over time during an interaction between a motor vehicle and a cyclist. Assuming that the evasive action starts when there are no more similar unhindered trajectories (i.e. no one would travel like that in an unhindered situation), it can be concluded that the motor vehicle starts interacting at the time step 49 and the cyclist at the time step 47 (see Figure 4).
Besides the identification of an evasive action, the presented similarity concept can be used for motion prediction assuming that the studied road user will continue to travel in the same way as the trajectories found to be similar. As long as there is more than one similar trajectory, several potential future paths are possible. Figure 5 shows an example of what the predications would look for both the cyclist and the motor vehicle at a given time instance. The black trajectory shows the actual path of the road user with small dots representing the travel until the moment for which the prediction is made and the larger dots representing the travel from that moment on. The remaining trajectories show the range of predictions based on the unhindered traffic classified as 'similar' for the current moment (with their corresponding speeds visualized by colour-coding). Such prediction is only possible while at least one similar trajectory is found, meaning that a prediction can no longer be made once an evasive action has been identified. The latest time instance the prediction can be done for is thus just one time step before the evasive action start.
6 Figure 4 The number of similar trajectories for each time step between two interacting trajectories and a set of unhindered trajectories Figure 5 Motion prediction based on similar trajectories found Multiple possible future paths for both the motor vehicle and the cyclists' results in several possible combinations, some with a collision course and a corresponding TTC value, and some without. The probability of a collision course (PCC) can be calculated then as the share of the trajectory pairs with a collision course in the total number of trajectory combinations. As for the TTC, Saunier et al. (2010) provide a calculation procedure for the 'probabilistic TTC' that aggregates the individual values into one indicator: ( 2) where is the probability of the road users to collide at collision point i and TTCi is the predicted time at which they will reach it. The 'probabilistic TA', accordingly, would equal the TTC value at the onset of the evasive action.
For the following experiments, all trajectories were produced using the T-Analyst software (T-Analyst 2020). The software allows a human to browse the video frame by frame, marking positions of the road user and thus producing their trajectories (in world coordinate system) and speed profiles. The screenshot of the program is shown in Figure 6. The code for detection of evasive action, the presence of a collision course as well for calculating collision course probability was implemented in the MATLAB software (MathWorks 2022). The collision was defined as the proximity of the two trajectory points below 0.8 meter (the trajectory point represents the middle of the road user ground projection). The trajectory data had a time resolution of 15 frames per second.

Data origins
To test the proposed method, this study uses trajectories from 7 signalized intersections in Spain (1), the Netherlands (3)  More specifically, the dataset includes trajectories from interactions between right-turning motor vehicles approaching from the intersection leg closest to the camera and straight-moving cyclists arriving from the same direction (both have green at the same time). Figure 7 shows the camera views at the seven sites. Figure 7 The camera view at the seven intersections and the studied interaction; thermal camera was used in Denmark and the Netherlands

Calibration and validation dataset
The calibration/validation dataset contained two types of data: • A set of unhindered trajectories for both motor vehicles and cyclists. A human observer selected 50 trajectories of each road user type based on the reasoning presented in the Method section (free passage with no interactions involved; presence of other road users on non-conflicting course was allowed). Since the speed profiles are highly affected by the traffic light, the instruction was to include both road users arriving during the green or the red traffic light phases in approximately equal proportion. The procedure was then repeated for each of the studied locations. • A set of events with an observable evasive action. 48 interactions were manually selected based on the criteria that there must be a clearly observable evasive action present. 29 of these interactions come from the Spanish site and the remaining 19 were uniformly spread among the other locations. Four human observers with significant experience in traffic conflict analysis were then asked to produce the ground truth by identifying the moment of the evasive action onset in each situation. The observers had an opportunity to rewatch and examine the videos frame-by-frame if needed. The videos had a resolution of 15 frames per second (66.7 ms per frame).

Exploration dataset
The calibrated algorithm was then applied on a large set of interactions coming from the Spanish site. This included:

• All encounters between a motor vehicle and a cyclist within a 24-hour period.
The encounters (n = 417) were manually selected using the following definition-two road users must be heading towards the common conflict area in a way that: (i) both road users are in motion, and the latest one should have crossed the stop line before the first one leaves the conflict area (i.e. a collision at least hypothetically should be possible); (ii) if the encounter involved queueing motor vehicles or/and a group of cyclists, trajectories were only made for the pair of cyclist/motor vehicle that were closest to each other; the elaborated reasoning behind this definition can be found in Johnsson et al. (2020). • A dataset of safety critical events (conflicts). The conflicts (n = 142) were manually detected from ca 6 weeks of continuous video recording. The definition of a conflict used was somewhat loose and formulated as any breakdown in otherwise smooth traffic flowing that might indicate that the safety margins were compromised. Despite the inclusiveness of this definition, the dataset has a relatively high share of serious conflicts and even actual collisions (collisions were excluded from the tests in this paper).

Calibration
The proposed method relies on two parameters to identify similarity between the trajectories: (i) a threshold for the average distance between the trajectories, i.e. the similarity value in equation (1), and (ii) a limit on how far into the past the calculation should be made, i.e. n in the same equation.
The aim of the calibration was to find a set of parameters that provide the best agreement with the ground truth produced by the human observers. The Intraclass Correlation Coefficient (ICC) can be used to measure the reliability among several raters (Fisher 1932). The ICC produces a reliability index between 0 and 1 when comparing the result from different raters. Values less than 0.5, between 0.5 and 0.75, between 0.75 and 0.9, and greater than 0.9 are indicative of poor, moderate, good, and excellent reliability respectively (Koo & Li 2016). There are many different forms of the ICC index. Following the guideline by Koo & Li (2016), a Two-Way Mixed-Effects Model focused on absolute agreement was chosen for the following test.
The ICC value represents the inter-rater reliability among the raters. The optimisation problem then is to find the parameter values which produces the highest ICC value between the algorithm result with human observations. For the calibration, this comparison was made using the 19 events selected from the Danish and Dutch sites. The tested combinations included distance values from 0.05 to 5 meters (0.05 m step) and the time parameter from 1/15 s to 4 s (1/15 s step).
The best result was found using an average distance value of 0.75 m and a time parameter of 1.67 s (25 frames). Figure 8 shows the time of the evasive action onset suggested by the algorithm using these parameters, compared to the time instances suggested by the four human observers. The zero value on the Y-axis corresponds to the moment at which the front wheels of the car leave the pedestrian/bicycle crossing at the entering to the intersection (see Figure 7). The ICC value of 0.58 shows a moderate reliability between the human observers and the algorithm; however it is still a bit difficult to discern what this means in practice. Assuming the average of the human observers to be the best ground truth estimate, Table 1 examines how individual observers and the algorithm differ from it. The algorithm is generally somewhat early (average difference from the ground truth -0.3 s) and there also seems to be a higher variation in the computer detection times compared to the human observers.

Validation
The aim of validation is to test whether the proposed algorithm parameters are suitable at another location with different design (in our case, whether the parameters calibrated on 19 situation from Danish and Dutch sites still perform well in the remaining 29 interactions from the Spanish site). Figure 9 shows the algorithm results compared to the human observers. The ICC value of 0.55 indicate a moderate reliability between the average human time and the computer results.  Table 2 shows how individual observers and the algorithm differ from the ground truth (the average of the human observers). Similarly, the algorithm results have a larger standard deviation and are a bit early in detections (-0.1 s).

Exploration
The previous section established that the best parameter values is an average distance 0.75 meters as a similarity threshold while looking 25 frames (1.67 s) into the past. Using these values, the following section present the result of analysing the 417 encounters and 142 conflicts (exploration dataset) between right-turning motor vehicles and cyclists observed at the Spanish intersection.
Following the structure of the proposed method, each interaction can be classified into one of four main categories: 1. Events with no detected evasive action, i.e. the number of similar trajectories never dropped to zero for either road user.
2. Events with a detected evasive action with zero probability of collision course (PCC), i.e. an evasive action was detected but none of the trajectory combinations would lead to a collision. 3. Events with a detected evasive action and a non-zero PCC, i.e. an evasive action was detected and at least one of the trajectory combinations would lead to a collision. 4. Abnormal and secondary events.
The first three categories follow from the method description in the method section; however, the fourth type of events were first identified when examining the results. These abnormal events are immediately detected as evasive actions the very first moment a road user enters the scene. In these cases, the algorithm is unable to make any motion predictions since no similar trajectories were ever detected. Looking at these situations in more detail, they can be further divided into two main types: • Type A. In these events, one or both road users show uncommon behaviour which is too different from the behaviour of the unhindered trajectories that are used by the algorithm. Some examples of such behaviours include motor vehicles turning right from the wrong lane and cyclists entering the intersection from irregular locations. • Type B. The second type of abnormal events are secondary interactions in which one of the road users have already interacted with another road user before the second road user have entered the scene. The algorithm correctly identifies that an evasive action has occurred the moment in which the second road user enters the camera view but cannot make any motion predictions from that point. Table 3 shows how the events from both exploration datasets are split between the four categories. As expected, the traffic conflicts contain significantly fewer events without any evasive actions and also contain a higher percentage of events with a non-zero probability of a collision course (PCC). There is also a higher percentage of abnormal events within the conflict dataset. For the events with a detected evasive action and a non-zero PCC, it is possible to further investigate the distribution of both the PCC values and the estimated probabilistic TA. The cumulative frequency distributions are shown in Figure 10. The results show a clear difference between the encounters and conflicts in both probability of a collision course and in the TAvalues. This suggests that when the algorithm is able to proceed and produces the indicators values, the results are consistent with what human observers would consider to be more severe events.
It has been pointed out already that the share of abnormal/secondary events (category 4) is higher in the conflict dataset compared to the encounters. Further visual examination of these events indicates that out of the 43 'normal' encounters 24 (56%) are caused by abnormal situations, like motor vehicles arriving from the wrong lane or the bicyclist coming from the wrong direction. In the conflict dataset, however, only 3 (13%) of events are explained by such abnormalities, the rest being multi-step interactions. Figure 10 The cumulative frequency distribution of the probability of collision course (PCC) and the probabilistic Time-to-Accident (TA) for the events in Category 3 Such situation is illustrated in Figure 11. The studied interaction is between the car and the bicycle marked red and green respectively. However, at the moment shown in the upper image, the car start braking for the cyclist ahead of the green one, an evasive action being correctly detected. However, from that moment on, the car is no longer 'unhindered', which makes it impossible to detect the second evasive action that takes place at the moment shown in the right image, now for the studied green bicycle.
Visual examination of the entire dataset reveals that encounters contain 81% of primary events (only one interaction involved) while only 60% primary events are found among the conflicts. Figure 11 A secondary interaction in which the car (marked red) first brakes for one bicyclist (marked with an arrow) and then again brakes for the second bicyclist (marked green)

Discussion
The calibration and validation of the proposed algorithm showed moderate agreement between the human observers and the results from the algorithm, with the algorithms results being quite close on average but showing a larger amount of variation when compared to the human observers. Here, some caution should be taken in interpreting the results, since the situations used both for training and validation were 'exemplary' and contained very clear and easily identifiable evasive actions. Have the evasive actions been less pronounced, a higher degree of disagreement between the human observers as well as between the observers and the algorithm could be expected.
The method performs well for primary interactions, i.e. in situations when the road users arrive from an unhindered state. It fails, however, in case a several interactions follow each other since, after the first adjustment, the road user is no longer unhindered and thus there is no data available to suggest what would be a 'normal' course of action from such starting conditions. Another problem discovered is that the evasive action is sometimes erroneously assigned to the studied interaction even though it actually belongs to an earlier interaction (as illustrated in Figure 11). This might lead to the situation being scored lower on the dangerousness scale, since the algorithm interprets it as having an early evasive action while the real evasive action is still to come later. Visual examination of the studied situations might help to identify and filter out such erroneous decisions.
The choice of the studied manoeuvre favours the algorithm performance since the right-turning vehicle and the cyclist come directly in contact with each other. This is not the case, for example, for the left-turning vehicles interacting with the same cycle flow, since before reaching the cyclists, they must first negotiate the oncoming traffic.
The abnormal situations (like turning from a wrong lane) contributed to more frequent algorithm failures. However, this issue can probably be addressed by increasing the reference set of the unhindered passages so that even such unusual manoeuvres get represented. Otherwise, detection of odd situations, particularly if they are relatively frequent, might also provide valuable insights in the functioning of the studied location and what additional safety problems to anticipate that, otherwise, might not be easily identifiable without seeing the actual-not simply assumed based on drawings or traffic rules-behaviour.
It has been found that secondary interactions are much more common in the traffic conflicts dataset. This finding makes sense, since one could expect that it is easier to make a mistake leading to a conflict or potentially a crash in a complex situation involving several road users to be negotiated simultaneously or closely one after another. It is thus quite unfortunate that the method is least fit for situations which have the most relevance for traffic safety. On the other hand, the majority of the conflicts in the dataset are still primary interactions for which the method can be applied. Also, at least for some crash scenarios, it is also more common for 'free vehicles' to be involved in severe crashes compared to those moving in platoons or hindered in some other way (Pasanen 1993).
This study utilized probability of a collision course (PCC) and Time-to-Accident (TA) as two measures describing a situation severity. However, one can imagine many other additional indicators to be introduced, for example those reflecting the potential consequences in case the conflict develops into a crash, such as speed, kinetic energy, or Delta-V (Yastremska- Kravchenko et al. 2022). Alternatively, more general analysis of the road user behaviour can be performed, for example by counting the frequencies of evasive actions being necessary or by mapping the locations of the evasive action initiations. Such data might provide insights into how well the current infrastructure design functions and whether it encourages smooth and early adjustments rather than last-minute emergency reactions.

Conclusions
The paper suggests a relatively simple and easy to implement method for detection of the first evasive action in a traffic interaction, as well as for quantifying its dangerousness through the probability of collision course (PCC) and Time-to-Accident (TA) measures. The following conclusions can be drawn: • The method works well for primary interactions, but frequently fails in case of secondary interactions. • Secondary interactions are more common in traffic conflict situations, which limits applicability of the method.
• The method could be used both for studying traffic conflict situations (using PCC, TA and other indictors), but also for quantifying and visualising the general behaviour at studied locations. • Expanding the reference dataset may improve the algorithm performance, but it will not solve some problems of the more fundamental nature.

Declaration of competing interests
The authors report no competing interests.