Two is Better Than One: Digital Siblings to Improve Autonomous Driving Testing

Simulation-based testing represents an important step to ensure the reliability of autonomous driving software. In practice, when companies rely on third-party general-purpose simulators, either for in-house or outsourced testing, the generalizability of testing results to real autonomous vehicles is at stake. In this paper, we enhance simulation-based testing by introducing the notion of digital siblings, a multi-simulator approach that tests a given autonomous vehicle on multiple general-purpose simulators built with different technologies, that operate collectively as an ensemble in the testing process. We exemplify our approach on a case study focused on testing the lane-keeping component of an autonomous vehicle. We use two open-source simulators as digital siblings, and we empirically compare such a multi-simulator approach against a digital twin of a physical scaled autonomous vehicle on a large set of test cases. Our approach requires generating and running test cases for each individual simulator, in the form of sequences of road points. Then, test cases are migrated between simulators, using feature maps to characterize the exercised driving conditions. Finally, the joint predicted failure probability is computed, and a failure is reported only in cases of agreement among the siblings. Our empirical evaluation shows that the ensemble failure predictor by the digital siblings is superior to each individual simulator at predicting the failures of the digital twin. We discuss the findings of our case study and detail how our approach can help researchers interested in automated testing of autonomous driving software.


Introduction
The development of autonomous vehicles (AVs) has received great attention in the last decade.As of 2020, more than $150 billions have been invested in AVs, a sum that is expected to double in the near future [16].AVs typically integrate multiple advanced driver-assistance systems (e.g., for adaptive cruise control, parking assistance, and lane-keeping) into a unified control unit, using a perception-planexecution strategy [87].Advanced driver-assistance systems based on Deep Neural Networks (DNNs) are trained on labeled input-output samples of real-world driving data provided by the vehicle sensory to learn human-like driving actions [31].
Before deployment on public roads, AVs are thoroughly tested in the field, on private test tracks [10,13,17,64].While essential for fully assessing the dependability of AVs on the road, field testing has known limitations in terms of cost, safety and adequacy [64].To overcome these limitations, driving simulators are used to generate several real-life edge case scenarios that are unlikely to be experienced during field testing, or that are dangerous to reproduce for human operators [13,43].Simulation-based testing represents a consolidated testing practice, being more affordable than field testing, yet capable of exposing many bugs before deployment [10,13,17,64].
In this paper, we distinguish two main categories of driving simulators, namely digital twins (DTs) and general-purpose simulators (GPSims).DTs provide a software replica of specific real vehicles, that are digitally recreated in terms of appearance, aerodynamics, and physical interactions with the environment [13].In the context of mixed-reality testing approaches [70,76], such as Hardware-in-the-Loop and Vehicle-in-the-Loop, the digital twin is connected to physical AV components to further increase the degree of fidelity.In this paper, we consider simulationbased testing where the digital twin is a software replica of a specific real vehicle.Developing a DT is expensive [44,79] and can take up to five years [85].Hence, it remains an exclusive prerogative of big companies such as Uber (Waabi World [83]), Waymo (Simulation City [84]) or Wayve (Infinity Simulator [85]).GPSim are generally designed without the need to faithfully reproduce a specific vehicle or testing scenario, as they rather offer generic APIs to run one or more AVs on virtual road tracks.GPSim such as Siemens PreScan [62] or ESI Pro-SiVIC [32] offer a more affordable alternative to the expensive DT development, and are widely used for outsourcing testing tasks to third-party companies [49], for which access to, or customizations of the original DT are not feasible for each individual vehicle [35].
Despite affordability, GPSim can be affected by a fidelity and reality gap, when the simulated experience does not successfully transfer from the GPSim to the reference DT and eventually to the real AV [35].These discrepancies can lead to a distrust in simulation-based testing, as reported by recent surveys [1,29,35,70].While comparative works of GPSim exist in the literature [39,58], crosssimulator testing for AVs is a relatively unexplored avenue for research.Only a recent study [13] investigates the use of multiple GPSim for testing a pedestrian vision detection system.The study compares a large set of test scenarios on both PreScan [62] and Pro-SiVIC [32] and reports inconsistent results in terms of safety violations and behaviors across these simulators.Consequently, using a singlesimulator approach for AV testing might be unreliable, as the testing results are highly dependent on the chosen GPSim.
In this paper, we target the fidelity gap between GPSim and DT by proposing a multi-simulator approach for AV testing called digital siblings (DSS).Our approach involves automated test generation and a novel cross-simulator feature map analysis that combines the outcome of several simulator-specific test generators into a unified view.We use DSS as a surrogate model of the behavior of a DT.Our intuition is that agreement among multiple GPSim will increase the confidence in observing the same behavior in DT.On the other hand, in the presence of disagreements, DSS can mitigate or even eliminate the risk of choosing the worst GPSim, which would give poor simulation testing results.
In detail, our case study consists in the automatic generation of test cases, i.e., sequences of road points determining the roads where the AV drives, to test the lane-keeping component of an AV.We then use feature maps to characterize both the structure of such test cases, and the behaviors of the AV in each of them, to group failures by similarity, and to avoid reporting the same failures repeatedly.To account for the specificities of each GPSim, we execute test generation separately for each sibling.Then, we migrate the tests generated for one sibling to the other sibling.Finally, we merge failing and non failing executions based on similarity of features and estimate the overall joint failure probability.
In our case study we use DSS to test three state-of-the-art DNN lane-keeping models, i.e., Nvidia Dave-2 [12], Chauffeur [18], and Epoch [19] (the last two were developed by the respective teams in the Udacity challenge competition [73]).We consider as siblings two open-source simulators, namely Udacity [72] and BeamNG [7], widely used in previous studies to test lane-keeping software [28,36,57,68,93].As DT, we adopt an open-source framework [71] used in previous research [64,70,81,82,90] featuring a virtual replica of a 1:16 scale electric AV.We evaluate DSS with both offline and online testing [34], i.e., the lane-keeping models are tested both w.r.t. the accuracy of its predictions on labeled individual inputs, and at the system-level for their capability to control the vehicle on several hundreds automatically-generated roads.
Our empirical evaluation shows that, at the model-level, the distribution of prediction errors of DSS is statistically indistinguishable from that of the DT.Overall, at the system-level, the failure probability of DSS highly correlates with the true failure probability of the DT.More notably, the quality of driving measured in DSS can predict the true failure probability of the DT, which suggests that we can use the digital siblings to possibly anticipate the failures of the lanekeeping component of the real-world AV more reliably than with a single GPSim.A practical implication of our findings for software engineers is the usage of digital siblings when testing DNN-based lane-keeping software, to increase the level of fidelity of the observed behaviors and failures.The same recommendation holds for AV testing researchers.

Our paper makes the following contributions:
-Digital Siblings.A novel approach for testing DNN-based lane-keeping software that generates road scenarios in multiple general-purpose simulators, and combines their testing outcomes to approximate a digital twin.This is the first solution that leverages a multi-simulator approach to overcome the simulation fidelity gap.-Evaluation.An empirical study showing that the digital siblings are effective at predicting the failures of the AV under test in the digital twin for a physical scaled vehicle in the lane-keeping task.

Motivation and Background
In this section, we provide additional motivation for our approach, and we briefly describe the main concepts to understand the rest of the paper.In particular, we discuss the lane-keeping functionality of an AV, and we introduce evolutionary search as a tool to generate challenging test scenarios for AVs.

Motivation
In practice, test engineers use simulation platforms for testing early releases of their autonomous driving software, prior to real-world physical testing.The gap between simulated and real-world test outcomes hinders trustworthiness in the testing process.Thus, efforts must be made to provide evidence that simulationbased testing campaigns can expose real-world AV failures.
In an ideal scenario, the chosen simulation platform is able to accurately replicate the physics of the AV under test.Such high-fidelity digital twins are used by automotive companies as a proxy for their physical AVs.Under this assumption, the high-fidelity digital twin allows to safely carry out a testing campaign while saving costs and, at the same time, improving the robustness of the software.
However, high-fidelity digital twins are costly to develop and maintain, and not all manufacturers can afford them (those who can are not keen to disclose their high-fidelity digital twins, as these are valuable assets that give them a competitive advantage).Moreover, AV manufacturers outsource most of the testing processes to small/medium companies and such high-fidelity digital twins are not available to them.These companies adopt GPSims as a low-cost alternative for simulationbased testing of AVs.
The goal of our approach is to increase the reliability of simulation-based testing of AVs, specifically targeting environments that adopt general purpose simulators that are not designed to represent a specific AV, but rather focus on high-level scenario-based testing.To mitigate this design limitation, we propose a testing methodology employing an ensemble of GPSims.This approach involves aggregating the outcomes of multiple GPSims to mitigate the risks associated with simulator flakiness or representativeness.We combine multiple relatively low-cost simulators to obtain reliable test results as if we used a very costly dataset from the real operation or a high-cost simulator such as a high-fidelity digital twin.Our approach is particularly beneficial when these GPSims exhibit complementary behaviors, allowing them to compensate for each other's weaknesses while combining their strengths.Our research hypothesis is that the combination of complementary GPSims provides a more reliable estimation of testing outcomes than the usage of a single GPSim.In this paper, we present the initial findings supporting this hypothesis, exploring and evaluating one practical implementation of our approach using widely accessible open-source simulation platforms.
We instantiate our approach for testing the lane-keeping component of an AV, implemented with a DNN.The test cases are sequences of road points, which determine the two-lane roads where the AV is supposed to drive autonomously.To assess the benefits of our multi-simulator approach (i.e., DSS), we use the digital twin (DT) of a physical 1:16 scale electric AV [71], as a surrogate for the real-world AV behaviors.Indeed, we assume having access only to multiple GPSims as, in practice, a DT is often unavailable.In our evaluation, we validate our hypothesis by comparing the extent to which both DSS and each individual sibling can predict the failures of the DNN lane-keeping component in DT, thus quantifying the reliability of testing.

Lane-keeping
This paper focuses on testing AVs that perform the lane-keeping functionality from driving samples labeled by humans.Lane-keeping, also called lane-centering or lane-following, is an automated driving assistance feature of an AV to keep the vehicle at the center of the lane.This system can be implemented at different levels, from a warning to the driver when the vehicle crosses one of the lanes up to the driverless version, which steers the vehicle automatically when it detects a departure from the center of the lane.
In this paper we consider the driverless version since it is a crucial component for the safe deployment of AVs on public roads.Indeed, according to a report by NHTSA [75], off-road crashes due to failures of the lane-keeping component are first in cost ($15 billion) and second in frequency.From a technical standpoint, the lane-keeping task is implemented by behavior cloning DNNs, which learn endto-end from supervised expert demonstrations.The training dataset consists of driving images captured with a camera sensor mounted on board of the vehicle, appropriately labeled with the driving commands of a human driver.
We consider lane-keeping DNN models, such as NVIDIA's Dave-2 [12], that predict the steering angle at which the car should steer to keep the vehicle in lane, given a single driving image.These models are generally trained with stochastic gradient descent [59] on stationary datasets, with the goal of minimizing the error between the predicted and the ground-truth steering angles.
Such labels are typically an array of commands, i.e., steering, throttle and brake, although in the simplest case only the steering is provided, while the throttle is determined as a function of the steering and the velocity of the vehicle.Given the dataset, a DNN model, such as the Dave-2 model from Nvidia [12], is trained to predict the label given an image by minimizing the Mean Squared Error (MSE) between the current prediction and the ground-truth label.Fig. 1: Overview of our multi-simulator approach and its usage.

Evolutionary Search
Evolutionary or metaheuristic search is a class of techniques that apply randomness and heuristics to find near-optimal solutions to optimization problems [48].Such techniques are very general, since they only require evaluating how good a candidate solution is.The goodness of a solution is called fitness and the objective of the search algorithm is to optimize it (either maximize it or minimize it).The algorithm manipulates a solution to exploit the known parts of the search space, and creates new solutions to explore the parts that are unknown.
Search algorithms have been applied to testing problems and have been particularly effective tools for test generation [25,47,52].In this paper, we use the MapElites search algorithm [51], implemented in the DeepHyperion tool [93], to generate test cases for the DNN model under test.The algorithm explores the solution feature space at large, in order to provide a comprehensive characterization of the behaviors of the driving model.

Multi-simulator AV Testing with Digital Siblings
The goal of our approach is to use digital siblings to test the DNN-based lanekeeping component of an AV, by generating a large set of road scenarios.Our approach takes as input a DNN lane-keeping model M , and uses an existing road generator to test its behavior, by generating roads for multiple driving simulators.The key intuition is that multiple GPSims can better approximate the driving behavior of the AV executed in DT, which we use as a proxy for the behavior of the real-world AV, as opposed to a single-simulator approach.
Our approach supports an arbitrary number of digital siblings.For simplicity of exposition, engineering effort, and evaluation, we describe and experiment it using two simulators.However, we present the most important steps of our approach, i.e., migration (step ❸) and merge (step ❹), in a generic manner that accommodates any number of siblings.
Figure 1 (top) shows an overview of our approach in which two digital siblings, namely DS 1 and DS 2 , are used to test the behavior of a driving model under test M , i.e., an end-to-end DNN for lane-keeping.In the first phase, M is either trained or fine-tuned (step ❶) to run on both DS 1 and DS 2 , as well as on the target platform (i.e., DT).A test generation phase (step ❷) is executed for each digital sibling, generating road scenarios for each simulator and producing two feature maps F M DS 1 and F M DS 2 .Feature maps group together test cases with similar feature combination values, to reduce redundancy and summarize the AV behaviors in unique feature combination [92,93].The value in a feature map cell, displayed in a colored heat scale, represents the average test case outcome, i.e., the behavioral information about the execution of M in each test scenario (e.g., the failure probability).For each simulator, the test generation algorithm produces test scenarios that are executed to assess the behavior of the driving model M under many different circumstances.Hence, the output of test generation is simulator and model dependent and the feature maps of DS 1 (F M DS 1 ) and DS 2 (F M DS 2 ) can be different.
The next step of our approach (step ❸) requires to migrate the test cases across simulators.In detail, the test cases in F M DS 1 are executed on DS 2 , resulting in the feature map F M DS 1 .Similarly, the test cases in F M DS 2 are executed on DS 1 , resulting in the feature map F M DS 2 .Then, for both DS 1 and DS 2 , we compute the union of the two feature maps, obtaining F M U 1 for DS 1 and F M U 2 for DS 2 .Both maps contain the same set of test cases, although executed on two different simulators.The final output of the digital siblings (step ❹) is obtained by merging F M U 1 and F M U 2 into the final feature map F M DSS .
Step ❺ assesses the correlation of the F M DSS map with the F M DT map, to evaluate the predictive capability of the digital siblings.Figure 1 (bottom) shows an overview of the evaluation of our approach (detailed later, in Section 4).All the test cases in the final feature map F M DSS are executed (i.e., migrated) on the DT, to obtain the ground truth feature map F M DT .

Representation
We adopted an abstract representation of the road in each driving simulator so that only a sequence of road control points is needed when creating a new road in the driving scene.We follow the representation given by Riccio and Tonella [57] who defined a two-lane road using a series of control points (displayed as red stars in Figure 2).The control points are interpolated using Catmull-Rom splines [6], giving the road its final shape (yellow solid line).Figure 2 shows the visualization of a test scenario generated at step ❷.Specifically, the road is defined using nine control points whereas the Catmull-Rom spline only goes through seven of them.This is because a spline segment (e.g., P 2 − P 3 ) is always defined by four control points (e.g., P 1 , P 2 , P 3 , P 4 ).Since two of them are on either side of the endpoints of the spline segment (e.g., P 1 and P 4 ), the spline cannot traverse the extreme endpoints (e.g., P 1 and P 9 ).Hence, P 2 defines the start point of the road (depicted as a black triangle) whereas P 8 defines the end point (depicted as a black square).

Implementation
The default initial state of each test case involves positioning the vehicle in the first drivable control point (i.e., P 2 in Figure 2), at the center of the right lane following the road orientation.
We uniformed the 3D rendering of each simulator such that the driving scenarios have the same look and feel: a two-lane asphalt road, where the road is delimited by two solid white lines on each side and the two driving lanes are separated by a single solid yellow line.The road is placed on top of a green plane representing grass.Harmonization of the driving scenarios across simulators ensures that geometrical features are preserved for the collected driving images and that any color transformation applied to them during training preprocessing remains applicable [12].

Validity and Oracle
After interpolation, a road is deemed valid if it respects the following constraints: (1) the start and end points are different; (2) the road is contained within a squared bounding box of a predefined size (specifically 250 × 250); and, (3) there are no intersections.A test case is deemed successful when the vehicle drives within the right lane until the last road control point (e.g., P 8 in Figure 2).On the contrary, a test case failure occurs when the vehicle drives out of bound (OOB).

Data Collection
For the creation or fine-tuning of a self-driving model (step ❶), a labeled dataset of driving scenes is needed.We automate labeled data collection by resorting to autopilots that have global knowledge of the driving scenario such as the detailed road geometry and precise vehicle position.In particular, in each simulator, at each step of the simulation, the steering angle of the autopilot is computed by a Proportional-Integral-Differential (PID) controller [24] according to the formula: where LP stands for lateral position [66] (in particular, the lateral position is zero when the vehicle drives at the center of the lane).Equation 1states that the proportional constant K P acts on the raw error while the derivative constant K D controls the difference between two consecutive errors and the integral constant K I considers the total sum of the errors during the whole simulation until the current timestep.Finally, the steering value is clipped in the interval [−1, +1], where −1 means steering all the way to the left and +1 to the right (0 means the vehicle goes straight as no steering is applied).The steering values are normalized in order to account for the different simulators that we use in our approach.
The autopilot produces a steering angle label for each image which is used to train the driving model.We aligned the frame rates of the different simulators at 20 fps such that, in each simulator, the autopilot collects a comparable number of labeled images.The speed of the vehicle, both for the autopilot and M , is controlled by the throttle via a linear interpolation between the minimum speed and maximum speed so that the car decreases the speed when the steering angle increases (e.g., in a curve).The following formula computes the throttle based on the speed of the vehicle and the steering: where K is set to a predefined low value L when the measured speed is greater than a given maximum speed threshold, to enforce strong deceleration; viceversa, K is set to a high value H when the measured speed is lower than or equal to the maximum speed threshold, to reduce the deceleration component.From Equation 2, we can see that the throttle is close to 1 (the highest possible value) when the vehicle does not steer (steering = 0) and the speed is substantially lower than the maximum allowed speed (in this case, K = H); when one of the two conditions is false the throttle decreases, because of either deceleration component.Similarly to the steering angle values, we clip the throttle value in the interval [0, 1].

Model Fine-Tuning via Hybrid Training
The next step involves training the model M using all simulators and the data collected in step ❶.Alternatively, if an existing trained model M is available for the target DT, our approach requires fine-tuning it for all digital siblings.In both scenarios, we use hybrid training based on gradient descent [15].Hybrid training requires combining the datasets collected for different simulators/platforms into a unified dataset, making sure that each dataset is equally represented (i.e., the unified dataset contains the same number of samples from each simulator/platform specific dataset).Then, the unified dataset is split into training and validation sets (e.g., using the standard 80/20 ratio).The training pipeline is designed in such a way that each image, of dimensions 320×160, is processed according to the simulator/platform it was taken from.For example, images may be cropped differently.Depending on the vehicle size, the front part of the car may, or may not be visible in the frame captured by the camera.Another example of simulator-specific adaptation is the cropping of the above-horizon portion of the image, unnecessary for the lane-keeping task.After cropping, each image is resized to the size required for training, i.e., 320×160.
The training pipeline can be further configured to use plain synthetic virtual images from the driving simulators, or pseudo-real images resembling real-world driving images.The first configuration represents the standard practice in AV testing.In the second configuration, the reality gap due to low photo-realism is reduced by an image-to-image transformation that translates the driving images of each simulator into images similar to those captured by the real-world AV during on-road driving.This practice was proposed in the literature [64] and in industry [9] to increase the transferability of the driving model tested in simulation to the real world.
More specifically, this second configuration requires training a CycleGAN model for each driving simulator [91].CycleGAN entails two generators, one that learns how to translate images from simulated to real world (sim2real) and the other that learns the opposite transformation (real2sim).During training of the model, we use the sim2real generator trained for the respective simulator to translate the corresponding training set images.During testing, the sim2real generator translates images at runtime, i.e., during the execution of the simulation.We refer to the translated images as pseudo-real, since they are the output of a generative process designed to resemble real images.Figure 3 shows an example of image translation with a CycleGAN trained for each simulator.The corresponding networks translate an image of a road curve taken in the simulated domain (left) to an image belonging to the real domain (right)-the test track of a small scale physical AV.During training and testing of the driving model in a given simulator, we use the generator of the CycleGAN trained for such simulator.
In our evaluation (Section 4), we consider both configurations of our approach, i.e., training using either simulator or pseudo-real images.We refer to the model trained on simulator images as M S , and the model trained on pseudo-real images as M R .

Test Generation
While our approach is compatible with any test generation algorithm, in this paper we adopt the MapElites [51] algorithm implemented in DeepHyperion [93], because the output of DeepHyperion is projected to a feature map that characterizes each generated test scenario according to its features.In other words, test cases having equivalent features (e.g., 3 turns and maximum curvature of 0.2) are grouped into the same cell of the feature map. Figure 4 shows an example of feature map generated by DeepHyperion.The roads (i.e., the test cases) in the map are characterized by two structural features, i.e., the number of turns in the road (x axis) and the curvature of the road (y axis), the latter defined as the minimum radius of the circles going through each sequence of three consecutive road points [93].Such features have been used in previous work and have been shown to be effective at characterizing the search space of road generators [93].Characterizing a test case based on its structural features, i.e., only based on the properties of the road, allows us to identify unique failure scenarios, i.e., failure scenarios with distinctive road properties.
During test generation, the test cases are distributed in the map according to their features.The value of each cell is influenced by the behavior of M when driving on the roads pertaining to a cell.The minimum lateral distance recorded by the simulator is used by DeepHyperion as a fitness of the generated test case.The lateral distance is the opposite of the lateral position, i.e., it has the highest value when the vehicle drives at the center of the lane, and it decreases as the vehicle approaches the roadside.In particular, it is negative when the model misbehaves (i.e., the vehicle goes out of bound).In Figure 4 the two dashed-encircled cells point out two failure cells for M (i.e., cells containing roads with negative fitness).
Algorithm 1 shows the pseudocode of the DeepHyperion algorithm.It takes as input the driving model under test M , the simulator instance S and two hyperparameters, i.e., the population size P s and the number of iterations N the search is allowed to run, i.e., the budget of the algorithm.The algorithm starts by initializing an empty feature map and population (Lines 1-2).Then, the while The assignment to the feature map (Line 7) is done by the procedure pla-ceIndividualMap based on the feature values of the individual t c (to determine the coordinates of the target cell) and its fitness value.If the target cell is empty, the individual is placed in the cell.If the cell is non-empty (i.e., another test case was already generated for that cell), a local competition based on the value of the fitness takes place.If the fitness of the individual in the cell is greater than the fitness of the candidate individual, the individual in the cell gets replaced with the candidate individual.Otherwise, no replacement is carried out, which also holds if the individual in the cell already has a negative fitness.The selection function ensures that the search space of the features is explored at large, while the local competition on the individual cells keeps only the lowest performing individuals (i.e., potential misbheaviours) at the end of the generation in order to guide the search towards misbehaviors with unique feature values.
The while loop at Lines 11-16 evolves the initial population of individuals.First, an individual is selected (Line 12) and mutated (Line 13), i.e., the control points of the road are changed in order to form a new individual tc with different features.Such individual is then executed (Line 14) and placed in the map (Line 15).The algorithm terminates after a number N of iterations (Line 16).
Algorithm 1 returns a feature map with a single individual for each cell, i.e., the one with the lowest fitness (Line 17).In order to further explore the search space, we run DeepHyperion multiple times for each digital sibling to generate multiple feature maps.Then, we combine such maps by considering the bounds of each feature map axis in all the runs (i.e., minimum and maximum value), and place each generated individual in the combined map, whose bounds are the lowest (resp.highest) bound values across maps.In this way, there are potentially multiple individuals in each cell, and the value of a cell represents the metric of interest averaged over all individuals in that cell (see F M DS 1 and F M DS 2 in Figure 1).For instance, considering the failure probability, the value of a cell represents the number of times the model under test failed over the number of all individuals in the cell (a failure occurs when the fitness of an individual is negative).

Migration and Union
The test generation step produces two feature maps F M DS 1 and F M DS 2 , for DS 1 and DS 2 , respectively (in general, N feature maps, i.e., F M DS 1 , . . ., F M DS N ).The next step of our approach (i.e., step ❸, see Figure 1) consists of migrating the test cases in F M DS 1 to DS 2 (producing F M DS 1 ) and viceversa (producing F M DS 2 ).In general, migrating the test cases in F M DS i (with i = 1, . . ., N ) to DS j (with j ̸ = i), would produce F M DS ij .For instance, if N = 3, migrating the test cases in F M DS 2 to the other siblings, would produce F M DS 21 when migrating to DS 1 , and F M DS 23 when migrating to DS 3 .Such operation consists of instantiating the abstract (control point based) road representation of the test case being migrated, such that it respects the dimensionality constraints, and it can be supplied as input to the target simulator.
After migration, for both DS 1 and DS 2 (in general, DS 1 , . . ., DS N ), we consider the union of their maps.We consider the bounds of each feature in the two maps, and we place the respective test cases in a new unified map according to their coordinates, producing the map Hence, the two maps, or N maps in general, contain the same tests that fill the same cells at the same coordinates.
The value of each cell in the union maps F M U 1 , F M U 2 is recomputed from the individuals assigned to them.For the failure probability, if a given cell in F M DS 1 has n 1 /N 1 failing individuals, while the corresponding cell in F M DS 2 has n 2 /N 2 failing individuals, the failure probability value of the cell in the union map F M U 1 will be (n 1 + n 2 )/(N 1 + N 2 ).In general, for a given cell in F M U i , the failure probability is computed as (n . When a quality of driving metric is computed instead of a failure probability, the union map contains the average of the respective quality of driving metrics: qm = (qm 1 + qm 2 )/2, where qm 1 , qm 2 are the quality of driving metrics found in the same cell in the two feature maps being united (F M DS 1 , F M DS 2 , or F M S 2 , F M S 1 ), while qm is the resulting quality of driving metric, in the union map (F M U 1 or F M U 2 ).In general, for a given cell in F M U i , the quality metric is computed as

Merge
The final step of the approach (i.e., step ❹ in Figure 1) requires to merge the two union maps F M U 1 and F M U 2 into F M DSS (in general, N union maps F M U 1 , . . ., F M U N ).The objective of the merge operation is to combine the testing output of the two digital siblings.Since we aim to use the digital siblings to approximate the behavior of M on DT and predict its failures, the merge operator privileges agreements between the maps of the two digital siblings, i.e., only cells in the maps that have a hot color (e.g., a high failure probability) will produce a hot color in the merged cell.Indeed, such tests are likely to represent simulator-independent misbehaviors of the model under test, which are critical for the safety of the system.Specifically, if the failure probability of in the merged map the failure probability will be the product, f p = f p 1 × f p 2 (in general, the failure probability of a given cell in DSS would be When a quality of driving (resp.lack of quality of driving) metric is computed instead of a failure probability, the merged map will conservatively contain the maximum (resp.minimum) of the respective quality of driving metrics.In particular, qm = max{qm 1 , qm 2 } (resp.qm = min{qm 1 , qm 2 }), where qm 1 , qm 2 are the quality of driving metrics found in the same cell in F M U 1 and F M U 2 respectively, while qm is the resulting quality of driving metric in the merged map.In general, the quality metric of a given cell in DSS would be qm = max{qm 1 , . . ., qm i , . . ., qm N }, and the lack of quality of driving of a given cell would be qm = min{qm 1 , . . ., qm i , . . ., qm N }.By giving priority to failures (resp.quality of driving degradations) that occur in both siblings and are hence very likely to be relevant for the target platform, this choice better accommodates the limited testing budget available for production/field testing [10,13,17,49,64].

Evaluation Scenario
While our approach assumes that DT is not available in practice, to evaluate whether the DSS can approximate the behavior of M and predict its failures when executed on DT, we migrate all the tests in the digital siblings feature map (i.e., F M DSS ) to an actual DT, which is used to obtain the ground truth map F M DT (see "Evaluation Scenario" in Figure 1 (bottom)).The two maps being compared contain the same tests in the same cells, but the values of the cells might differ, depending on the behavior of M in the different simulators.Thus, we analyze and compare the two feature maps F M DSS and F M DT , to assess the capability of DSS at predicting the failures of the model when executed on DT.

Case Study
The goal of the empirical study is to evaluate whether two digital siblings (DSS) can better approximate the behavior of a driving model and predict its failures on a digital twin (DT), w.r.t.using only one general-purpose simulator (GPSim).We rely on DT only to evaluate the benefits of our multi-simulator approach, as a proxy for the behaviors of the AV in the real world, since DT is often unavailable in practice.In our empirical study, we focus on testing a lane-keeping DNN model by generating road scenarios.To this aim, we consider the following research questions: RQ 1 (Offline Evaluation).How do the offline prediction errors by the DSS compare to those of the DT?
We first test our hypothesis at the model-level.For all simulators, we compute the errors between the model predictions and each autopilot ground truth labels on a stationary driving images dataset.We compare the error distributions of each individual simulator with the DT, as well as their combination as digital siblings.
With RQ 1 we aim to assess whether a correlation between the offline predictions exists at the model-level, which can be useful for developers to gain trust about their DNN model prediction accuracy, prior to running system-level tests.RQ 2 (Failure Probability).How does the failure probability of the DSS compare to that of the DT?
In RQ 2 we test the model at the system-level, specifically the hypothesis that combining the failure probabilities of the two digital siblings provides a better predictor of the ground truth failure probability of the model executed on DT w.r.t.using a single simulator.A positive answer to RQ 2 would imply that a multi-simulator approach can predict, and possibly anticipate, the failures of the DNN-based lane-keeping model on DT, which are expected to be accurate proxies of the AV real-world failures.RQ 3 (Quality of Driving).How does the quality of driving of the DSS compare to the failure probability of the DT?
By considering only the failure probability, we might overlook the correlation between real failures on DT and near-failures on DSS-test cases in which the model exhibits a degraded driving quality without necessarily going off-road.Thus, with RQ 3 , we also assess whether finer-grained driving quality metrics can predict the ground truth failure probability of the lane-keeping model on DT.
Architecturally, Dave-2 consists of five convolutional layers, followed by three fully-connected layers [12].Chauffeur has six convolutional layers each followed by a dropout and a max pooling layer (except the last one) [18].Epoch has three convolutional layers and one fully-connected layer, which makes up for most of the parameter count of the model [19].

Digital Siblings (DSS)
We implemented and investigated the effectiveness of DSS using the simulators BeamNG [7] and Udacity [77].We chose them as digital siblings because: (1) they support training and testing of a DNN that performs lane-keeping, including Dave-2, Chauffeur and Epoch; (2) they are often used as simulator platforms for AV testing, as highlighted by a recent survey on autonomous driving testing [70]; (3) they are potentially complementary because they are developed with different technologies/game engines, and they are characterized by different physics implementations (e.g., rigid vs soft-body dynamics); (4) they are publicly available under open-source or academic-oriented licenses, hence customizable.
BeamNG [7] is a framework specialized in autonomous driving developed by BeamNG GmbH.The framework is released under an academic-oriented license, and it has been downloaded 5.5k times as of January 2023.From a technical standpoint, BeamNG features a soft-body dynamics simulation based on a spring-mass model.Such a model is composed of nodes (mass points) that are connected by beams (springs), i.e., weightless elements that allow accurate vehicle deformation and other aerodynamic properties [27].
Udacity [77] is developed with Unity 3D [78], a popular cross-platform game engine.The project has been publicly released in 2016 by the for-profit educational organization Udacity, to allow people from all over the world to access some of their technology and to contribute to an open-source self-driving car project.As of January 2023, the simulator has 3.7k stars on GitHub.From a technical standpoint, Udacity is based on the Nvidia PhysX engine [54], featuring discrete and continuous collision detection, ray-casting, and rigid-body dynamics simulation.

Digital Twin (DT)
We use the Donkey Car ™ open-source framework [23] as digital twin for our study.This platform has been used for AV testing research with physical self-driving cars in physical environments [64,82,90].The framework includes open hardware to build 1:16 scale radio-controlled cars with self-driving capabilities, a Python framework for training and testing DNN models with lane-keeping functionalities using supervised or reinforcement learning, and a simulator in which the realworld Donkey Car is faithfully modeled.This was assessed by a recent work [64] reporting that, for three lane-keeping models, the steering angle distribution of the AV model driving in the real-world environment is statistically indistinguishable from the steering angle distribution of the AV model driving in the digital twin.
In the rest of the section, we refer to BeamNG as DS 1 , Udacity as DS 2 , the combined digital siblings as DSS, and DonkeyCar as DT.

CycleGAN Models
Data Collection.We collected 15k simulated images, 5k for DS 1 and DS 2 by running the autopilots on a set of randomly generated roads.Moreover, we collected 5k real-world images [64] by manually driving the physical twin of the DT on a physical road track in our lab.Training.We trained three CycleGAN models, one for each simulator, with the obtained training sets (5k virtual images and 5k real-world images).Each model was trained for 60 epochs using the default hyper-parameters of the original paper [91].We saved a checkpoint model every 5 epochs, and we ultimately chose the one that achieved the best neural translations (in terms of visual quality) using a test set of ≈8k simulated images for each simulator, representing a test road driven from beginning to the end [64].While a quantitative assessment of the output of CycleGAN is still a major challenge [14,45] and out of the scope of this paper, the driving capability of the lane-keeping model, as the experimental evaluation shows, represents an implicit validation of the CycleGAN model's ability to retain all essential features needed for an accurate steering angle prediction.

Driving Models
Data Collection.For all simulators (i.e., DS 1 , DS 2 and DT), we collected a training set by running the autopilots on a set of randomly generated roads (this set is different from the one used to train the CycleGAN).To ensure having non-trivial driving scenarios and appropriate labels for challenging curves, the maximum angle of a curve was set to be less than or equal to 270 • .In particular, for our training set, we generated 25 roads with 8 control points [93].To collect a balanced dataset where left and right curves are equally represented, each road was driven by the autopilot in both directions, i.e., from the start point to the end point and from the end point to the start point.The autopilot drove successfully the totality of the roads on all simulators; our training set comprises ≈70k images, equally distributed across the simulators.Training.For each self-driving architecture we trained two models, one by using the plain simulated images (M S ) and the other by translating the images of each simulator into pseudo-real images (M R ) using the respective CycleGAN generator.
We followed the guidelines by Bojarski et al. [12] to train AV autopilots.We used custom hyperparameters for each self-driving architecture, and the Adam optimizer [41] to minimize the mean squared error (MSE) between the predicted steering angles and the ground truth value.For all models, we set a learning rate of 10 −4 and a batch size of 128.We used 50 epochs for Dave-2 and Chauffeur (only for the M R model) and 500 epochs for Epoch and the M S model of Chauffeur.We used an early stopping of 10 epochs for the models where the number of training epochs was 50 and an early stopping of 20 epochs otherwise.We evaluated the performance of the trained lane-keeping models on DT, as it is the target simulator we want to approximate using the digital siblings.We collected a labeled dataset by running the autopilot on DT on 25 randomly generated roads each with 8 control points and a maximum angle of 270 • , i.e., the same road parameters as the training set.We computed the mean squared error (MSE) between the steering angle prediction of the model on each image and the steering angle of the autopilot.Table 1 shows the MSE of all models on the first and third columns; on average, the MSE is low for both the models trained using simulated images (i.e., M S ), and the models trained using real images (i.e., M R ).We also measured the success rate of each model by driving it on the 25 randomly generated roads, and counting the number of times the model was able to arrive at the end of the road without going out of bound.Overall, each model is able to successfully complete the majority of the generated roads.Most notably, M R models are able to complete more than 90% of the test set roads.

Offline Evaluation
We collected a labeled dataset for offline evaluation by generating 20 roads (i.e., 10 roads driven in both directions) with the same parameters as the training set.The images collected for the offline evaluation dataset amount to ≈26k, considering all simulators.

Test Generation
After training M S and M R for each self-driving architecture, we executed Deep-Hyperion twice to generate tests using the two digital siblings DS 1 and DS 2 .We chose a population size of 20 individuals and a number of search iterations respectively equal to 150 for M S and 100 for M R , as we observed from preliminary experiments that this choice of hyperparameters allows an extensive coverage of the feature maps.For both M S and M R and each digital sibling in each self-driving architecture, we repeated test generation five times to diversify the exploration of the search space and to collect multiple test cases for each cell in the feature maps.Overall, across all runs and driving models, DeepHyperion generated 10,260 tests for both siblings.
Concerning the simulations, for all simulators, we set the maximum speed for the vehicle to 30 km/h [93].When testing M R in a given simulator, we engineered the testing pipeline to load the appropriate sim2real CycleGAN generator to translate the simulated image generated by BeamNG/Udacity into pseudo-real images in real-time during driving.For each executed test case, we collected the lateral position of the vehicle for each simulation step as well as its lateral distance.The former determines the quality of driving of the model [36], while the latter is the fitness of the test case.

Migration and Union
For the initial (F M DS 1 , F M DS 2 ) and for the union (F M U 1 , F M U 2 ) feature maps, we compute the failure probability as the number of tests with a negative fitness divided by the total number of tests in the respective cell.To evaluate the quality of driving, we adopted the maximum lateral position (i.e., the distance between the center of the vehicle and the center of the lane [66]) experienced during the test case execution.Previous work showed that such metric is effective at characterizing the degradation in the quality of autonomous driving [36], since the lower the value of such metric, the higher is the quality of driving (thus, it actually measures lack of quality of driving).When considering the quality of driving, the value of each cell in a feature map represents the average of the maximum lateral positions of each test case in that cell.Furthermore, we normalized the maximum lateral position values in the interval [0, 1] before taking the union.

Merge
Merging the maps of the two digital siblings requires a different treatment for failure probability and quality of driving.Regarding the failure probability, the merge operator that ensures a conservative aggregation of two values is the product.Regarding the lack of quality of driving, the conservative merge operator is the minimum, since the quantities to merge are not probabilities.In fact, by taking the minimum we get a high lack of driving quality only when both simulators exhibit high values for such a metric.

RQ 1 (Offline Evaluation)
We computed the prediction errors given by the difference between the predictions of the model (M R ) on images of the offline evaluation dataset (see Section 4.2), and the corresponding ground truth labels given by the autopilot.We binned the prediction errors of the model on each simulator and built the respective probability density (i.e., the number of errors in each bin is divided by the total number of prediction errors) such that different distributions could be compared.
Then, we computed the distance between each digital sibling distribution, as well as their combination, and the DT using the Wasserstein distance [4] (also known as the earth mover's distance).Given two one-dimensional distributions A and B, the Wasserstein distance W (A, B) is defined by the following formula [55]: where CDF is the cumulative distribution function of a distribution.In other words, the Wasserstein distance between two distributions is defined as the difference between the area formed by their cumulative distribution functions.We assess whether the difference between two distributions is statistically significant using the Wilcoxon test [21] applied to the density functions of the two error distributions to compute the p-value (with threshold α ≤ 0.05).We also perform power analysis (with statistical power β ≥ 0.8) on the prediction errors to check whether a non-significant p-value is due to a low data sample size or to the difference being statistically insignificant.

RQ 2 (Failure Probability) and RQ 3 (Quality of Driving)
For RQ 2 , we computed the pairwise Pearson correlation between maps along with the corresponding p-value.In particular, correlations are computed between each union feature map of each digital sibling (F M U 1 , F M U 2 ) and the feature map of the DT (F M DT ), and between F M DSS and F M DT .For RQ 3 , the setting is equivalent to that of the failure probability but considering quality of driving maps, comparing DS 1 , DS 2 and DSS against the ground truth DT.
To evaluate the capabilities of the digital siblings (individually or jointly) to predict failures on DT, we computed the area under the curve Precision-Recall (AUC-PRC) at increasing thresholds, for both RQ 2 and RQ 3 .This requires the discretization of failure probabilities into binary values (failure vs non-failure) for the ground truth (i.e., DT): we consider a cell in the DT feature map to be a failure cell if the associated failure probability is > 0.0.AUC-PRC is more informative than the AUC-ROC metric (i.e., the area under of the curve of the Receiver Operating Characteristics) when dealing with imbalanced [60] datasets, which is the case of our study (the number of failures in the feature maps is lower than the number of non-failures with an average 10 to 20% ratio).

Offline Evaluation (RQ 1 )
Table 2 reports the results for our first research question.The first column shows the simulators being compared.Columns 2-5 report the Wasserstein distance between the prediction error densities of the corresponding simulators, and the pvalue concerning the statistical significance of the differences between the two densities, for M S and M R .
For M S (Columns 3-4), our results show that, for Dave-2, the distance between the steering angle errors obtained for the combined digital siblings DSS and the errors obtained for DT is lower than the distance of DS 1 (0.03776 vs 0.046) and higher than the distance of DS 2 (0.02648).The distribution of the steering angle errors of DS 2 is statistically different from the errors of DT (i.e., p-value 0.02 < 0.05), while the distribution of the steering angle errors of DSS is statistically indistinguishable from the errors of DT (i.e., p-value 0.053 > 0.05 and power > 0.8).This behavior is also consistent for Epoch, with the exception that the distribution of the prediction errors for DS 2 is statistically indistinguishable from that of DT.However, the distance between DSS and DT is lower than the distance of DS 1 from DT, with a statistically indistinguishable distribution of prediction errors w.r.t.DT.For Chauffeur, the combined digital siblings DSS have the only distribution of errors that is equivalent to that of DT, and its distance to it is the lowest considering the individual digital siblings.
Regarding M R (Columns 5-6), our results show that, for Dave-2, the distance between the steering angle errors obtained for the combined digital siblings DSS and the errors obtained for DT is 2.8 times lower than the distance of each simulator taken individually (as a percentage, the distance of DSS is respectively 70% and 56% smaller than the distance of the two individual siblings, DS 1 , DS 2 ).The statistical test confirms that the error distributions of DSS and DT are statistically indistinguishable (p-value > 0.05 and power > 0.8), which is not the case for the error distributions of DS 1 (p-value < 0.05).Likewise, for all the other self-driving architectures, the digital siblings DSS have the lowest distance to DT w.r.t. the individual siblings and their distribution is always statistically indistinguishable from that of DT.
Figure 5 offers a visual explanation of these scores for the Dave-2 model. 1 The subplots compare the steering angle error distributions, respectively, of DS 1 , DS 2 and DSS (shown in light red) with that of DT (shown in light blue).The x-axis of each subplot represents the magnitude of the prediction errors of the model M R w.r.t. the predictions of the autopilot, while the y-axis indicates their percentage for each bin.
From the plots we can see that, overall, at the model-level, M R makes prediction errors with small magnitudes on DS 1 , DS 2 and DSS (i.e., most of the errors are between 0.0 and 0.3).On the digital sibling DS 1 (i.e., BeamNG), M R has a high agreement with the autopilot, as most errors have a low magnitude.It has numerous small errors (< 0.2), while it has only a negligible portion of the distribution being above 0.2.The agreement with DT is low as M R under-approximates the true error distribution on DT: M R on DT has fewer errors with low magnitude and has a longer tail of errors greater than 0.2 (even greater than 0.3 in some cases).Differently, on the digital sibling DS 2 (i.e., Udacity), the error distribution has a longer tail than that on DT.Indeed, M R executed on DS 2 over-approximates the errors it would have on DT, as the errors observed on DS 2 have higher magnitude than those observed on DT.
The error distribution of the model on DSS shows why it is appropriate to combine the outcome of two simulators.At the model-level, DSS better approximates the true error distribution of the model on DT, by providing an intermediate error between DS 1 and DS 2 for both M S and M R .RQ 1 : Overall, at the model-level, the digital siblings produce a steering angle error distribution that is statistically indistinguishable from the true steering angle error distribution of the model on the digital twin.Considering all the models, in 5 out of 6 cases, the digital siblings are better at approximating the distribution of prediction errors of the digital twin than each individual sibling.

Failure Probability (RQ 2 )
Table 3 shows the Pearson correlation (r ), the p-value, and the AUC-PRC for the comparison between DS 1 , DS 2 , DSS and DT, respectively.The analysis is reported separately for M S (Columns 3-5) and M R (Columns 6-8).
Concerning M S -i.e., the model driving with simulated driving scenes-the failure probabilities for Dave-2 have a high positive correlation with the true failure probability of ((Column 3).All such correlations are statistically significant for DSS, as well as for each individual sibling DS 1 and DS 2 (p-values < 0.05, see Column 4).Likewise, the correlations are high and statistically significant for the other lane-keeping models (Epoch features slightly lower correlations).However, for Dave-2 the correlation of DSS is 9% higher than the best individual correlation (i.e., DS 1 ) and 21% higher than the worst individual correlation (i.e., DS 2 ).In terms of failure prediction, DSS have the highest AUC-PRC value, 4% higher than DS 1 and 33% higher than DS 2 .
This also happens with Epoch, where the correlation of DSS is slightly higher than that of the best sibling DS 1 (i.e., 0.571 vs 0.561) and 33% higher than that of the worst sibling DS 2 .Regarding failure prediction on DT, DSS are 3% better than the best sibling.In the case of Chauffeur, DS 1 has the best results both in terms of correlation and failure prediction.However, DSS are better than the worst of the two siblings DS 2 both in terms of correlation and failure prediction.Figure 6 shows the feature maps related to M S of Dave-2. 2 The first three feature maps represent the failure probability of DS 1 , DS 2 and DSS, respectively.The last feature map represents the ground truth failure probability of DT.The color of each cell ranges from green (i.e., non-failure, or failure probability = 0) to red (i.e., failure probability = 1).Let us analyze a false positive case.The test cases at coordinates (3, 0.25), whose corresponding cells are highlighted with a dashed line, represent road tracks having three curves and a maximum curvature of 0.25.In DT, this cell is green, i.e., all test cases for M S driving on DT succeed.On the other hand, M S has contrasting behaviors when the same test cases are executed on DS 1 or DS 2 .These test cases did not exhibit any failure in DS 1 , whereas they did trigger failures in DS 2 .This disagreement is canceled out when combining the two digital siblings with the product operator and the cell is green in the DSS map.As such, digital siblings are conservative w.r.t.failures, as a failure is reported only when both digital siblings are in agreement.This can be noticed for test cases at coordinates (1, 0.23), which represent road tracks having one curve with a maximum curvature of 0.23-an instance of a true positive case (the corresponding cells in each map are highlighted with a solid line).Both DS 1 and DS 2 have a failure probability of 1 and, as a consequence, the DSS map also does.On DT, M S has also a high failure probability (0.5), which confirms the high effectiveness of the DSS framework at approximating the true failure probability of DT.
Concerning the failure probability for M R -i.e., the model driving with pseudoreal driving scenes, for Dave-2 and Chauffeur, DSS are better than each individual sibling in terms of correlation with DT.For Dave-2, DS 1 better predicts the failures of DT, while for Chauffeur, the digital siblings are better than each individual sibling.Interestingly, for Epoch, DS 2 better correlates with DT but the AUC-PRC value of DSS is the higher than the individual siblings.
RQ 2 : At the system-level, in four cases out of six, the failure probability of the digital siblings better correlates with the true failure probability of the digital twin w.r.t. each individual sibling.In four cases out of six, the failures obtained on the digital siblings are a better predictor of the ground truth failures experienced on the digital twin.prediction of failures from the quality of driving metric.The analysis is reported separately for both M S (Columns 3-5) and M R (Columns 6-8) models.
For M S , the correlation between DSS and DT is lower than the best individual correlation for all the lane-keeping models (0.553 of DSS vs 0.621 of DS 1 for Dave-2, 0.792 of DSS vs 0.798 of DS 1 for Chauffeur, and 0.491 of DSS vs 0.511 of DS 1 for Epoch).For Dave-2, the DSS correlation is 22% higher than the worst individual correlation (0.553 of DSS vs 0.429 of DS 2 ); percentages are similar for Chauffeur and Epoch.For AUC-PRC, DSS and DS 1 have the same predictive power both for Dave-2 and Chauffeur (i.e., respectively 0.659 and 0.940), while for Epoch the DSS prediction is slightly better than that of DS 1 .Thus, DSS mitigate the risk of relying on the testing results of a low-quality GPSim (i.e., DS 2 ).
Concerning M R , we observed a similar trend, i.e., the correlation of DS 1 with DT are higher than the correlations of DSS with DT, although DSS always have a better correlation than the worst of the two siblings, i.e., DS 2 , for all lane-keeping models.The digital siblings DSS better predict the failures of DT for Dave-2 and are equivalent to DS 1 for Chauffeur.For Epoch, the best predictor of the failures of DT is DS 2 , although the digital siblings are only 9% worse.
Figure 7 shows the four feature maps related to the quality of driving of the M R Dave-2 model on the two digital siblings and the failure probability of M R on DT. 3 We can observe that the feature map of DS 1 and the feature map of DSS are similar.As a consequence, the two correlations are similar (0.396 of DS 1 vs 0.379 of DSS).On the other hand, the feature map of DS 2 is quite different from the failure probability map of DT, which causes the correlation to be low (0.287).We can observe that all siblings are able to capture the failure of the DT at coordinates (1, 0.23) (see the corresponding cells highlighted with a solid line).On the other hand, the test cases at coordinates (4, 0.24) triggered failures only in DS 2 , and DSS correctly predict that in DT such tests will not cause a failure.RQ 3 : At the system-level, for most lane-keeping models, the quality of driving of the digital siblings correlates with the failure probability of the digital twin.This correlation is either equivalent to that of the best digital sibling or falls within the range of the two siblings.In five cases out of six, the quality of driving in the digital siblings has a failure prediction capability w.r.t. the digital twin, which is equal or higher than the best individual sibling.As a result, digital siblings reduce the risk associated with relying on the least reliable simulator.

Discussion
GPSims Complementarity.When choosing candidate GPSims, our approach requires that the simulators exhibit some degree of complementarity (i.e., different physics engines), while still supporting the same encoding of test inputs.Therefore, the selected GPSims must meet the following conditions.Firstly, the simulators must be equipped with appropriate API interfaces that allow the instantiation of analogous test cases.In our context, both Udacity and BeamNG support a sequence of road points as input to instantiate the two-lane roads where the AV drives.Secondly, the simulators need to support communication with the DNN-based systems under test.In the case of a DNN-based lane-keeping AV, the simulators should be able to capture images from the vehicle's on-board camera and execute throttle steering commands to drive the vehicle.Finally, the selected simulators should implement different physics engines.Specifically, Udacity implements soft-body dynamics, while BeamNG uses a rigid-body dynamics engine.
The worst case occurs when the two siblings disagree and the over-approximating sibling (e.g., predicting a failure) is not compensated by the under-approximating sibling (see Figure 6).In most cases, we empirically observed that by predicting a failure only when there is agreement, the digital siblings are equivalent to the best of the two siblings (see RQ 3 ).However, for the Epoch model, when considering the failure probabilities of the M R model, the correlation of the digital siblings is slightly worse than the worst sibling, i.e., DS 1 (specifically, 0.450 of DSS vs 0.469 of DS 2 ).Despite the lowest correlation, the digital siblings have the highest capabilities of detecting the failures of DT.
Simulated and Pseudo-real Models.We experimented with both simulated (M S ) and real-world models (M R ) as such setting is representative of the current industrial testing practices described by the NHTSA [76].From the feature maps in Figure 6 and Figure 7, we can observe that the driving quality of M S is superior w.r.t.M R (the failure probabilities in the feature map of DT are higher), presumably because it is easier for a DNN to process plain artificial images from a simulator, rather than the images collected by a real-world camera during driving.

Internal validity
We compared all simulators under identical parameter settings.One threat to internal validity concerns our custom implementation of DeepHyperion within the simulators.We mitigated this threat by faithfully replicating the code available in the replication package of the paper [22].Another threat may be due to our own data collection phase and training of the lane-keeping models, which may exhibit many misbehaviors if trained inadequately.We mitigated this threat by training and fine-tuning a model which was able to drive on the majority of the training set roads consistently on all simulators.

External validity
We considered only a limited number of DNN models and simulators, which poses a threat in terms of the generalizability of our results.We tried to mitigate this threat by choosing three popular real-world DNN models, which achieved competitive scores in the Udacity challenge [73].Their diversity in terms of both size and architectural structure determines different driving behaviors and increases the generalizability of our results.We considered two open-source GPSims, and we chose DonkeyCar as DT, as it was used as a proxy for full size self-driving cars also in previous studies [64,65,81,82,90].Generalizability to other GPSims or DTs would require further studies.
Our proposal focuses on testing the DNN-based lane-keeping component of an AV, by generating a large set of road scenarios.Although there are works in the literature that modify other environment objects such as weather conditions, pedestrian and other vehicles' dynamics [8,13,33], we chose to generate road scenarios to test the lane-keeping behavior of the DNN in isolation, avoiding the interference of other tasks, such as obstacle and pedestrian avoidance.Further studies are needed to assess the generalizability of our multi-simulator approach to driving tasks different from lane-keeping.On this regard, feature maps are a flexible tool to encode different characteristics of a test case (e.g., the intensity of the rain or the number of vehicles in the driving scenario), by adding new dimensions for each new desired feature.

Construct validity
Threats to construct validity may come from selecting inappropriate metrics to measure the agreement of the siblings with DT.To address this threat we assessed such agreement from two points of view, i.e., at the model-level (RQ 1 ), by measuring the distance between the two distributions under analysis and testing the statistical significance of the difference, and at the system-level, by measuring failure probability and quality of driving.Overall, our results show that the digital siblings are better at predicting the behavior of the lane-keeping model under test on DT.
6 Related Work

Digital Twins for AV Testing
Digital twins are used by researchers to reproduce real-world conditions within a simulation environment for testing purposes [2,5,38,61,86].
Yun et al. [86] test an object recognition system using the GTA videogame.In particular, they exploit the realism of the game engine to collect data for training an object recognition system for both collision avoidance and lane-departure prevention.Barosan et al. [5] describe a digital twin for testing an autonomous truck.No testing was performed using the digital twin to assess the faithfulness of the simulator at reproducing real-world failures.Almeaibed et al. [2], analyze the safety and security of digital twins and propose a general framework to address such issues during development.Kapteyn et al. [38], propose a probabilistic graphical model to link the digital twin with its physical replica.The formal definition ensures that the calibration of the digital twin and its update with real-world data is principled and scalable.Similarly, San et al. [61] rely on the same mathematical tool to formalize the update of the digital twin with the goal of using it throughout the whole lifecycle of its physical replica, i.e., from the design to the operation phase.Veledar et al. [80] propose a multi-metrics approach for security and safety validation for the design of a digital twin for autonomous driving.
Such works mostly focus on the design of the digital twin and its update during the development of the physical replica.Differently, in our paper we investigate testing transferability between digital siblings, i.e., a multi-simulator approach considering both simulated and pseudo-real images as input to the DNN.

Empirical Studies
Simulation platforms are often decoupled from the real world complexities [1], which confirmed the need for real-world testing of cyber-physical Our work is the first to propose the usage of a multi-simulator approach, called digital siblings, to mitigate the fidelity gap in the field of autonomous driving testing.
Concerning comparative studies across simulators, to the best of our knowledge, the only study that empirically compares the same AV on different simulation platforms is by Borg et al. [13].The authors investigate the use of multiple GPSim for testing a pedestrian vision detection system.The study compares a large set of test scenarios on both PreScan [62] and Pro-SiVIC [32] and reports low agreement between testing results across the two simulation platforms.No assessment is performed of their correlation with a digital twin or a physical vehicle.In our paper, we take a step ahead, and we show how the (dis)agreements can be leveraged to mitigate the fidelity gap: by combining the predictions of two general-purpose simulators we successfully covered the gap with a DT for a scaled physical vehicle.In another work, Amini et al. [3] evaluates the degree of flakiness affecting two widely-used open-source AV simulators and five diverse test setups, showing that test flakiness in AV is a common issue and can significantly impact the test results obtained by randomized algorithms.
Other studies compare model-level vs system-level testing metrics within a simulation environment [34].In our empirical work, we focused on the difference between general-purpose and digital twin driving simulators.We use offline and online testing to measure the gap between single-and multi-simulator approaches at approximating a digital twin, a previously unexplored topic.Our proposition is also meant to prevent the flakiness occurring within a single simulation platform, by relying on an ensemble of simulators.

AV Testing Approaches
Most approaches use model-level testing (i.e., offline testing of single image predictions) to test DNN autopilots under corrupted images [42,74] or GAN-generated driving scenarios [88], without however testing the self-driving software in its operational domain.In our work, we assess the effectiveness of our digital siblings with model-level testing in terms of prediction error distributions, but we also consider online testing at the system-level.
Another model-level testing approach is by Talwar et al. [69].Their focus is to test the generalizability on real-world data of multiple object detection models trained on simulated images.On the other hand, we use an Image-to-Image trans-lation architecture [91] to translate simulated images into real-world images both to evaluate the lane-keeping model offline and to test it online at the system-level.
Concerning system-level testing for AVs, researchers proposed techniques to generate scenarios that cause AVs to misbehave [20,28,30,37,40,46,50,63,67,68,88,89].Among the existing test generators, in this work we adopted DeepHyperion by Zohdinasab et al. [93], a tool that uses illumination search to extensively cover a map of structural input features, which allowed us to easily group identical or equivalent failure conditions occurring in the same feature map cell.Ul Haq et al. [33] use ML regressors as surrogate models to mimic the simulator's outcome.
These works only consider single-simulator approaches to testing.Their generalizability to a multi-simulator approach, such as the digital siblings proposed in this paper, or to cross-simulator testing, is overlooked in the existing literature.

Conclusions and Future Work
In this paper, we propose a multi-simulator approach named digital siblings, to improve simulation-based testing of the lane-keeping component of an autonomous vehicle.In our approach, we test the autonomous driving software by generating road scenarios in two general-purpose simulators, to better approximate the behavior of the lane-keeping model on a digital twin.We combine the testing outputs of the model on the two simulators in a conservative way, giving priority to the agreements on possible failures, where it is more likely to observe the same failing behavior on the digital twin.
At the model level, our results show that the digital siblings approximate the model predictions on the digital twin better than each individual simulator.At the system-level, the digital siblings are able to predict the failures of the model on the digital twin better than each single simulator.
In our future work we plan to extend our case study to more than two generalpurpose simulators, and to study different ways to combine them based on the characteristics of each simulator and those of the digital twin.

Version of Record
This version of the contribution has been accepted for publication, after peer review (when applicable) but is not the Version of Record and does not reflect post-acceptance improvements, or any corrections.The Version of Record is available online at: https://doi.org/10.1007/s10664-024-10458-4.Use of this Accepted Version is subject to the publisher's Accepted Manuscript terms of use https://www.springernature.com/gp/open-research/policies/accepted-manuscriptterms.

Fig. 2 :
Fig. 2: Example of test scenario for a lane-keeping autonomous driving system.

Fig. 4 : 6 f
Fig. 4: Example of feature map by DeepHyperion.The two axes represent structural features of the generated roads (i.e., curvature and number of bends).

Fig. 5 :
Fig. 5: Distributions of prediction errors of Dave-2 M R in the two digital siblings, i.e., DS 1 and DS 2 , their combination (DSS) and DT.Best viewed in color.

4. 4 . 3 Fig. 6 :
Fig. 6: Feature maps representing the failure probability of Dave-2 M S on the two digital siblings, DS 1 and DS 2 , their combination (DSS) and on DT.Solid line cells represent a true failure predicted by DSS while dashed line cells represent a false positive of DS 2 .Best viewed in color.

Fig. 7 :
Fig. 7: Feature maps representing the quality of driving of Dave-2 M R (i.e., the maximum lateral position) on the two digital siblings, DS 1 and DS 2 , their combination (DSS) and the failure probability on DT.Solid line cells represent a true failure predicted by DSS, while dashed line cells represent a false positive of DS 2 .Best viewed in color.

Table 1 :
Offline and online performance on the test set of the lane-keeping models on DT.

Table 2 :
Results for RQ 1 .Bold-faced values indicate the best approach.

Table 3 :
Results for RQ 2 .Bold-faced values indicate the best approach.

Table 4 :
Results for RQ 3 .Bold-faced values indicate the best approach.