## 3 Methodology
### Data Processing  
The RounD dataset from RWTH Aachen University in Germany provided the data used in this investigation [40]. This dataset records the trajectories and their types of road users at three separate sites by using drones at a collection frequency of 25. Utilizing state-of-the-art computer vision algorithms, the trajectory position errors are typically less than 10 cm. The roundabout dataset provides four files for every record: a segment image, a file that describes the location where the recording was made, a file that gives a summary of the recorded vehicle trajectories, and a file describing the trajectories. The detailed data include vehicle IDs, timestamps, vehicle positions both longitudinally and laterally, speeds, accelerations, headings, and so on. As depicted in Figure 2, a multi-lane roundabout with a dual-lane entrance and a dedicated right-turn lane was selected from the roundabout dataset. Trajectory data spanning a total of 6 h during different time periods from Tuesday to Thursday were extracted, with a total of approximately 13,000 vehicles. Figure 1: Research framework. Based on the aforementioned roundabout dataset, vehicle trajectories under merging scenarios were further extracted. During the merging process, the driver prepares to turn right in advance, adjust their driving speed, and steer clear of objects that could obstruct their path, so that the vehicle can safely drive into the roundabout. In this study, an interacting vehicle pair consisting of two vehicles was taken into consideration, as shown in Figure 3. The vehicle attempting to merge into the roundabout was designated as the merging subject vehicle (MSV), which is depicted in blue. This vehicle was the primary focus of our study, as it navigates the complexities of entering the roundabout. The nearby roundabout vehicle (NRV) was identified as the vehicle circling the roundabout closest to the MSV, and it is highlighted in red. This particular vehicle was selected because it poses the highest potential collision risk to the MSV during the merging maneuver. Each vehicle entering the roundabout with a risk can find a corresponding vehicle inside the roundabout that poses a significant collision risk. The two vehicles together form a dangerous interaction pair. The roundabout merging critical hazard scenario was combined with the fundamental information of the interacting vehicle pair and 3 s of trajectory data, resulting in a complete, continuous, and uninterrupted trajectory data of the two vehicles. The details of the data processing and extraction are depicted in Figure 4. The first step involved identifying the MSV, which is the vehicle attempting to merge into the roundabout. Detailed information about the merging process of the MSVs was extracted. This included data on speed,  
Figure 3: Description of interactive vehicle pairs in the merge scenario. Figure 2: Data collection segments of the RounD dataset [40]. acceleration, steering angles, and other relevant parameters. Next, the system identified the NRV that has the least time to collision with the MSV inside the roundabout. The workflow then evaluated whether there is a risk of collision between the MSVs and CVs. If no risk was detected, the interactive vehicle pairs were deleted from further analysis. For vehicle pairs identified as having a collision risk, the trajectories were trimmed to include only a full three-second interaction. This trimming ensured that the data analyzed focused on the critical moments leading up to potential collisions, providing a detailed view of the interaction dynamics. After trimming, the system checked if the data for these interactive vehicle pairs were complete. Incomplete datasets were deleted to maintain the quality and reliability of the analysis. If the datasets were complete, the trajectories for all vehicle pairs were visualized. Following this, safe scenarios were deleted, further refining the dataset to include only those scenarios that were critical for safety analysis.