Skip to main content
Nature Communications logoLink to Nature Communications
. 2024 Jun 5;15:4808. doi: 10.1038/s41467-024-49194-0

Curse of rarity for autonomous vehicles

Henry X Liu 1,2,✉, Shuo Feng 3,✉
PMCID: PMC11153604  PMID: 38839817

The curse of rarity—the rarity of safety-critical events in high-dimensional variable spaces—presents significant challenges in ensuring the safety of autonomous vehicles using deep learning. Looking at it from distinct perspectives, we identify three potential approaches for addressing the issue.

Subject terms: Civil engineering, Mechanical engineering


The curse of rarity—the rarity of safety-critical events in high-dimensional variable spaces—presents significant challenges in ensuring the safety of autonomous vehicles using deep learning. Looking at it from distinct perspectives, the authors identify three potential approaches for addressing the issue.


The concept of autonomous vehicles (AVs) has been around for about a century. Over the past two decades, AVs have attracted extensive attention from academic institutions, government agencies, professional organizations, and industries. By 2015, multiple companies had announced that they would mass-produce AVs before 2020 (Ref. 1). However, the reality has not lived up to expectations, and there are currently no commercially available SAE Level 4 (Ref. 2) AVs. One of the main reasons is the significant gap in safety performance of AVs1. This gap poses a major challenge as AVs struggle to effectively handle a multitude of rare safety-critical events, despite the accumulation of millions of testing miles on public roads. The occurrence of these events, characterized by a probability distribution resembling a long tail that is far from the head or central part of the distribution, is commonly referred to as the long-tail challenge for AV safety3,4. The catchphrase “long-tail challenge” for AV safety, however, is frequently used in a handwaving manner without a formal definition in the literature. This lack of understanding impedes progress in resolving the issue.

In this Comment, we uncover that the shape of the probability distribution for safety-critical occurrences, whether it exhibits a long tail or not, is not essential to the issue at hand. Instead, the primary challenge in defining the problem stems from the rareness of safety-critical situations in highly complex driving environments, which encompass various factors such as different weather conditions, diverse road infrastructures, and behavioral distinctions among road users. The safety-critical circumstances may arise due to a variety of reasons, such as misidentification of an unknown object or inaccurate prediction of nearby pedestrian’s movement, all of which have a low probability of occurrence. We term this challenge as the curse of rarity (CoR) and mathematically define CoR for a generic deep learning problem, which is commonly used for perception, behavior modelling, prediction and decision making in AVs. CoR emerges from the combination of rare occurrence of safety-critical situations and the vast number of variables involved, resulting in a compounding effect. Such an effect hinders the ability of deep learning models to perform safely in real-time5,6.

In the following, we elaborate the CoR in different AV tasks including perception, prediction, planning, as well as validation and verification. Based on these analyses, we discuss potential solutions towards addressing the CoR. We hope that this Comment can provide a better understanding of the safety challenges faced by the AV community, and a rigorous formulation of CoR can help accelerate the development and deployment of AVs as well as other safety-critical autonomous systems.

What is the curse of rarity?

The basic concept of CoR is that the occurrence probability for the events of interest in high-dimensional space is so rare that most available data contain very little information of the rare events. Therefore, it is hard for a deep-learning model to learn, since valuable information of rare events could be buried under a large amount of normal data. It becomes particularly challenging to improve safety performance because better safety performance also means a lower frequency of safety-critical events, which makes it more difficult for the deep-learning model to learn. An illustration of CoR can be found in Box 1.

Box 1 Curse of rarity for deep learning models.

Box 1 Curse of rarity for deep learning models

The key to deep learning is to obtain the optimal parameters θ* of neural networks by optimizing the expectations of the objective function fθ(∙) over the data X with an underlying distribution P. To solve this optimization problem, the most commonly used approach is based on the gradient descent (see Chapter 8 in ref. 19). Existing approaches estimate the gradient with Monte Carlo estimation20 using a batch of data at each training step. However, the estimation variance could increase exponentially with the rarity of safety-critical events (see Theorem 1 in Methods), resulting in the curse of rarity. This analysis is applicable to various deep-learning approaches. In the case of deep reinforcement learning, the data consists of the state-action pairs, and the objective function is based on the reward function (see our previous work5 for details); whereas in deep supervised learning, the data comprises the labelled data, and the objective function is based on the loss function. More details can be found in the Methods section.

What challenges does it bring for autonomous vehicles?

In this section, we elaborate on the CoR in various aspects of AVs including perception, prediction, planning, validation and verification.

Perception

Deep learning methods have been extensively utilized in perception tasks to acquire information and extract pertinent knowledge from the surrounding environment. The problem of imbalanced data has been studied in perception tasks, where a small portion of object classes have a large number of samples, while the remaining classes have only a few samples3,7. However, this issue becomes particularly challenging for safety-critical perception tasks of AVs, as the imbalance ratios are much more severe, often exceeding 106 (Ref. 8). Existing approaches such as class rebalancing, information augmentation, and module improvement are inadequate in addressing this problem, as they can only handle a limited imbalance ratio, usually smaller than 103 (Ref. 7). This significant difference in magnitude fundamentally transforms the problem from an imbalanced data issue to the CoR problem. Moreover, the cumulative effects of a series of perception errors could be dangerous, even if each individual error appears insignificant. For example, an object misclassification in a single frame might be less of an issue, while multiple object misclassifications in a sequence of frames may lead to safety-critical outcomes. Since the occurrence probability of such a sequence is much lower than that of any individual error, the issue of CoR becomes even more severe.

Behavior prediction and simulation

AV’s high safety performance requirements necessitate precise behavior modeling and accurate prediction of surrounding road users. Even a minor error in predicting the behaviors of surrounding road users can be deemed unacceptable in safety-critical situations. For example, in a jaywalking scenario, precise prediction of pedestrian trajectories is crucial for AVs to avoid collisions. A small prediction error could result in either a false alarm or a missed alarm, leading to overly cautious driving decisions or overly confident decision that cause an accident. The same holds true for driving behavior simulation. Inaccuracies in simulations can lead to underestimation or overestimation of AV’s safety performance, thereby misleading the development process9. To achieve the required level of safety, behavior prediction models must effectively handle rare events in high-dimensional driving environments, which are prone to the CoR.

Decision making

Deep learning techniques, such as deep imitation learning and deep reinforcement learning, have been applied in the decision-making process of AVs. However, when it comes to safety-critical scenarios, deep learning models suffers from the CoR due to the scarcity of real-world data. This scarcity may lead to severe variance in the estimation of policy gradients, thereby impeding the effectiveness of deep learning5. Another approach aiming to ensure the safety of decision-making involves using formal methods based on a set of assumptions. Typical assumptions include the availability of a system model, which may be characterized by bounded unknown dynamics and noise10. Due to the CoR, it is difficult to verify these assumptions to account for all rare safety-critical events in high-dimensional driving environments.

Verification and validation

Verification and validation of safety performance play a crucial role in assessing the readiness of AVs for widespread deployment5. Prevailing approaches usually test AVs in the naturalistic driving environment through a combination of software simulation, closed test track, and on-road testing. Due to the CoR, however, hundreds of millions of miles would be required to evaluate the safety performance of AVs, which is impractical and inefficient8. To accelerate the process, various approaches have been developed, such as scenario-based approaches, which focus on testing AVs in purposely generated scenarios. Unfortunately, the complexity of generating spatiotemporally intricate safety-critical scenarios poses significant challenge due to the CoR. For example, it has been found that the importance-sampling-based approaches could suffer from a severe inefficiency owing to the dramatic variance for generating complex safety-critical scenarios6. As a result, many existing approaches are limited to handling short scenario segments with limited dynamic objects, failing to capture the full complexity and variability of real-world safety-critical events6.

What are the potential solutions?

Based on the analyses and discussions above, we identify three potential approaches for solving the CoR problem, each addressing it from a distinct perspective. It is important to note that these approaches are not mutually exclusive, and combining these approaches holds immense potential in resolving the CoR issue and expediting the widespread deployment of AVs.

Approach #1: Effective training with more rare event data

The first approach focuses on data and aims to continually improve the handling of rare events by making better use of additional data. One potential method is to utilize exclusively the data associated with rare events, which could significantly reduce the estimation variance, as stated in Theorem 1 in Methods section. However, defining and identifying rare events are challenging, as they depend on problem-specific objective functions and suffer from the spatiotemporal complexity of safety-critical autonomous systems. More importantly, theoretical foundations that can guide the utilization of rare event data remain lacking. For AV safety validation tasks, tackling the CoR issue has been attempted by developing the dense deep reinforcement learning (D2RL) approach in our prior work5. Theoretical and experimental results show that D2RL can dramatically reduce the variance of the policy gradient estimation, a significant step towards addressing the CoR. Another crucial concern is how to gather or generate more rare event data. Tesla proposed the concept of shadow mode testing11, where rare events of interest are identified by comparing human driving behavior with autonomous driving behavior, but no details are given in the literature. Other than collecting data from naturalistic driving environment, various data augmentation methods have been developed to generate safety-critical scenarios12.

Approach #2: Improving capabilities of generalization and reasoning

The second approach centers around improving the generalization and reasoning capabilities of machine learning models to overcome the data insufficiency. Intuitively, as humans can learn to drive with limited experience (typically less than one hundred hours of training), future AI agents for AVs may be able to overcome the CoR without relying on extensive task-specific data. This requires an AI agent to possess both bottom-up reasoning (sensing data-driven) and top-down reasoning (cognition expectation-driven) capabilities13, bridging the information gap not found in the data. These requirements are in line with the development of artificial general intelligence (AGI). Recently, foundational models such as large language models (LLMs) and vision-language models (VLMs) have exhibited remarkable generalization and reasoning abilities in terms of natural language processing and visual comprehension and reasoning by employing techniques such as fully supervised fine-tuning, in-context learning, and chain of thought. By leveraging the extensive data available, LLMs and VLMs present a promising solution for enabling top-down reasoning to address the CoR issue14, although issues like hallucinations still need further investigations15.

Approach #3: Reducing the occurrence of safety-critical events

The third approach aims to mitigate the consequences of CoR on AV systems by reducing the occurrences of safety-critical events. Potentially, one can combine traditional model-based approaches with deep learning approaches, taking advantages of the strengths of both16. For example, formal methods have been developed to prevent unsafe behaviors of AVs based on abstract models, potentially leading to defensive driving strategies. However, as discussed in ref. 10,17, multiple challenges need to be addressed to fully harness the potential of formal methods. Another approach is to enhance situational awareness by utilizing infrastructure-based sensors or cooperative awareness, aiding AVs in overcoming the limitations of their own onboard sensors. Nevertheless, effectively utilizing this additional information to achieve improved performance remains a challenging task, especially in safety-critical scenarios. Many existing approaches may even result in inferior perception and decision-making outcomes in such scenarios, due to the increased complexity and latency associated with gathering and integrating this extra information18.

Methods

Let us consider a general deep learning problem that can be formulated as an optimization problem:

maxθEPfθX, 1

where θ∈Rd denotes the parameters of a neural network, d is the dimension of the parameters, X∈Ω denotes the training data with an underlying distribution P, and fθX denotes the objective function given the neural network θ and training data X. To optimize the objective function, the key is to estimate the gradient of the neural network parameters at each training iteration (see Chapter 8 in ref. 19) as

μ=def∇θEPfθX≈μ~=def1n∑i=1n∇θfθXi,Xi~P 2

where n denotes the number of training data samples at each iteration, ∇θ denotes the gradient of parameters, and the approximation is obtained using the Monte Carlo method20. Let μ~(k) denote the kth component of μ~, where k = 1,…,d. According to the Monte Carlo method, μ~ is an unbiased estimation of μ, that is, EPμ~=μ. The variance of μ~(k) can be denoted as σP2(μ~(k)). To simplify the notations, we denote Y=def∇θfθX as a random vector where Y=Y1,…,Yd∈Rd, so μ~ in Eq. (2) can be represented as

μ~=1n∑i=1nYi. 3

Now let’s focus on a special set of deep learning problems where only a very small portion of training data (safety-critical data) can contribute effectively to the gradient estimation, while a vast majority of training data (non-safety-critical data) contributes little. To be more specific, we can define normal events A⊂Ω and critical but rare events B⊂Ω, where A∩B=∅ and A∪B=Ω. We can also define the corresponding indicator function IA(X), where IAX=1 if X belongs to the set A and otherwise IAX=0. IB(X) can be defined similarly. Then, we can obtain a new estimator of the gradient that only utilizes the samples associated with the events B as

μ^=def1n∑i=1nYi⋅IBXi, 4

where μ^(k) denotes the kth component of μ^ and the variance of μ^(k) can be denoted as σP2(μ^(k)).

Then we have the following theorem, and the proof can be found at the end of Methods.

Theorem 1:

If the set A satisfies the following condition:

EPY⋅IAX=0, 5

we have the following properties:

  1. EPμ~=EPμ^=μ;

  2. σP2(μ~(k))≥σP2(μ^(k)); and

  3. σP2(μ~k)≥10r⋅σP2(μ^(k)), with the assumption

EPYk2⋅IB(X)=EPYk2⋅EPIBX,k=1,…,d, 6

where r=def−log10EPIBX is defined as the rarity of the events B in all samples with the sampling distribution P.

Remark 1. The condition in Eq. (5) indicates that the non-safety-critical data (IAX=1) contributes little to the gradient. Taking the AV safety testing task as an example (see ref. 5 for details), the key is to learn a deep model to control background vehicles to conduct adversarial maneuvers. In this case, the non-safety-critical data that could be identified by safety metrics usually contains no information for learning such adversarial maneuvers, so the condition could be satisfied. We note that the condition is primarily for the theoretical analysis to be clean and is not strictly required in practice. For example, if EPY⋅IAX is a near-zero value and dramatically smaller than EPY⋅IBX, we can still find that the variance of μ~ increases dramatically with the rarity of safety-critical events.

Remark 2. Defining and identifying the events A and B are non-trivial and dependent on specific deep learning tasks. An important aspect of these definitions is the approximate fulfillment of the condition stated in Eq. (5), as explained in Remark 1. To illustrate, in the context of AV safety testing, we have chosen safety-critical states as events B and non-safety-critical states as events A (see ref. 5 for details). The definitions will vary across different AV tasks, warranting further exploration.

Remark 3. The assumption in Eq. (6) can be satisfied if all Yk2,k=1,…,d are independent of the events B. For deep learning approaches, the gradient Y=def∇θfθX is mainly determined by the parameters θ of neural networks. As the parameters are usually randomly initiated, Y could have an uncertainty that is approximately independent of the events A and B, particularly at the beginning of the learning process. Therefore, the assumption could be approximately satisfied particularly at the beginning of the learning process, so the CoR hinders the effectiveness of learning from the very beginning. Again, we note that the assumption is primarily for the theoretical analysis to be clean and is not strictly required in practice.

Remark 4. The third property suggests that the variance σP2(μ~k) will grow exponentially with the rarity of the events B, provided that σP2(μ^(k)) does not decrease exponentially with the rarity. As the estimator μ^ is primarily focused on estimating the gradient using safety-critical events, its variance σP2(μ^(k)) will not be affected significantly by the rarity.

Proof of Theorem 1.

  1. Proof of EPμ~=EPμ^=μ:

    EPμ^=EP1n∑i=1nY(Xi)⋅IBXi=EPY(Xi)⋅IBXi=μ=EPμ~.

    End of proof.

  2. Proof of σP2(μ~(k))≥σP2(μ^(k)):

    σP2(μ^(k))=VarPYk⋅IBX=EPYk2⋅IBX−EP2Yk⋅IBX=EPYk2⋅IBX−EP2Yk≤EPYk2⋅IBX+EPYk2⋅IAX−EP2Yk=EPYk2−EP2Yk=σP2(μ~(k)).

    End of proof.

  3. Proof of σP2(μ~k)≥10r⋅σP2(μ^(k)):

σP2(μ^(k))=EPYk2⋅IBX−EP2Yk=EPYk2⋅EPIBX−EP2Yk≤EPYk2⋅EPIBX−EP2Yk⋅EPIBX=EPIBX⋅EPYk2−EP2Yk=10−r⋅σP2(μ~(k)).

End of proof.

Acknowledgements

This research was partially funded by the US Department of Transportation (USDOT) Region 5 University Transportation Center: Center for Connected and Automated Transportation (CCAT) of the University of Michigan (#69A3551747105) and the National Science Foundation (CMMI #2223517). Any opinions, findings, conclusions, or recommendations expressed in this material are those of the authors and do not necessarily reflect the official policy or position of the US government.

Author contributions

H.X.L. and S.F. equally contributed to the preparation of the manuscript.

Peer review

Peer review information

Nature Communications thanks Matthias Althoff, Fredrik Warg and Colin Paterson for their contribution to the peer review of this work.

Competing interests

The authors declare no competing interests.

Footnotes

Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Contributor Information

Henry X. Liu, Email: henryliu@umich.edu

Shuo Feng, Email: fshuo@tsinghua.edu.cn.

References

  • 1.Safe driving cars. Nat. Mach. Intell4, 95-96 (2022).
  • 2.Society of Automotive Engineers. Taxonomy and definitions for terms related to driving automation systems for on-road motor vehicles. J3026-202104 Available at https://www.sae.org/standards/content/j3016_202104/ (2021).
  • 3.Zhang Y, Kang B, Hooi B, Yan S, Feng J. Deep long-tailed learning: a survey. IEEE Trans. Pattern Anal. Mach. Intell. 2023;45:10795–10816. doi: 10.1109/TPAMI.2023.3268118. [DOI] [PubMed] [Google Scholar]
  • 4.Wang J, et al. Parallel vision for long-tail regularization: initial results from IVFC autonomous driving testing. IEEE Trans. Intell. Veh. 2022;7:286–299. doi: 10.1109/TIV.2022.3145035. [DOI] [Google Scholar]
  • 5.Feng S, et al. Dense reinforcement learning for safety validation of autonomous vehicles. Nature. 2023;615:620–627. doi: 10.1038/s41586-023-05732-2. [DOI] [PubMed] [Google Scholar]
  • 6.Feng S, Yan X, Sun H, Feng Y, Liu HX. Intelligent driving intelligence test for autonomous vehicles with naturalistic and adversarial environment. Nat. Commun. 2021;12:748. doi: 10.1038/s41467-021-21007-8. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7.Johnson JM, Khoshgoftaar TM. Survey on deep learning with class imbalance. J. Big Data. 2019;6:1–54. doi: 10.1186/s40537-019-0192-5. [DOI] [Google Scholar]
  • 8.Kalra N, Paddock SM. Driving to safety: how many miles of driving would it take to demonstrate autonomous vehicle reliability? Transp. Res. Part A Policy Pract. 2016;94:182–193. doi: 10.1016/j.tra.2016.09.010. [DOI] [Google Scholar]
  • 9.Yan X, et al. Learning naturalistic driving environment with statistical realism. Nat. Commun. 2023;14:2037. doi: 10.1038/s41467-023-37677-5. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 10.Brunke L, et al. Safe learning in robotics: from learning-based control to safe reinforcement learning. Annu. Rev. Control Robot. Auton. Syst. 2021;5:411–444. doi: 10.1146/annurev-control-042920-020211. [DOI] [Google Scholar]
  • 11.Karpathy, A. Tesla Inc. System and method for obtaining training data. U.S. Patent Application 17/250,825 Available at https://patents.google.com/patent/US20210271259A1/en (2021).
  • 12.Wang, J. et al. Advsim: Generating safety-critical scenarios for self-driving vehicles. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 9909–9918 https://openaccess.thecvf.com/content/CVPR2021/html/Wang_AdvSim_Generating_Safety-Critical_Scenarios_for_Self-Driving_Vehicles_CVPR_2021_paper.html (2021).
  • 13.Cummings ML. Rethinking the maturity of artificial intelligence in safety-critical settings. AI Mag. 2021;42:6–15. [Google Scholar]
  • 14.Tian, X. et al. DriveVLM: The convergence of autonomous driving and large vision-language models. Preprint at: https://arxiv.org/abs/2402.12289 (2024).
  • 15.Kandpal, N., Deng, H., Roberts, A., Wallace, E. & Raffel, C. Large language models struggle to learn long-tail knowledge. In International Conference on Machine Learning, 15696–15707 https://proceedings.mlr.press/v202/kandpal23a.html (2023).
  • 16.Krasowski, H. et al. Provably safe reinforcement learning: Conceptual analysis, survey, and benchmarking. Trans. Mach. Learn. Res., 1–38 available at https://openreview.net/pdf?id=mcN0ezbnzO (2023).
  • 17.Seshia SA, Sadigh D, Sastry SS. Toward verified artificial intelligence. Commun. ACM. 2022;65:46–55. doi: 10.1145/3503914. [DOI] [Google Scholar]
  • 18.Bai, Z. et al. Infrastructure-based object detection and tracking for cooperative driving automation: a survey. In 2022 IEEE Intelligent Vehicles Symposium, 1366–1373 10.1109/IV51971.2022.9827461 (IEEE, Aachen, Germany 2022).
  • 19.Goodfellow, I., Bengio, Y. & Courville, A. Deep learning. available at https://mitpress.mit.edu/9780262035613/deep-learning/ (MIT Press, 2016).
  • 20.Owen, A. B. Monte Carlo Theory, Methods and Examples. Preprint at https://artowen.su.domains/mc/ (2013).

Articles from Nature Communications are provided here courtesy of Nature Publishing Group

RESOURCES