Skip to main content

Generative AV testing environment for unknown unsafe events discovery

Project description

Generative Autonomous Vehicle Testing Environment for Unknown Unsafe Events Discovery


WebsitePaperExamplesCommunity

PyPI python PyPI version License GitHub issues

About

TeraSim is an open-source traffic simulation platform designed for naturalistic and adversarial testing of autonomous vehicles (AVs). It enables high-speed, AI-driven testing environment generation to expose AVs to both routine and rare, high-risk driving conditions.

Developed with researchers, AV developers, and regulators in mind, TeraSim is designed to better support ISO 21448 (SOTIF) and ISO 34502 compliance, providing a scalable, automated, and unbiased AV evaluation framework.

Built upon the open-source traffic simulation software SUMO (Simulation of Urban MObility), TeraSim extends its capabilities to provide specialized features for autonomous vehicle testing.

🎥 Demo Video

TeraSim Demo Video

TeraSim is built upon a series of foundational academic works in autonomous vehicle testing:

  • NDE (Paper | Code): Learning naturalistic driving environment with statistical realism. Yan, X., Zou, Z., Feng, S., et al. Nature Communications 14, 2037 (2023).

  • NADE (Paper | Code): Intelligent driving intelligence test for autonomous vehicles with naturalistic and adversarial environment. Feng, S., Yan, X., Sun, H. et al. Nature Communications 12, 748 (2021).

  • D2RL (Paper | Code): Dense reinforcement learning for safety validation of autonomous vehicles. Feng, S., Sun, H., Yan, X., et al. Nature 615, 620–627 (2023).


🌟 Key Features

Generative Driving Environment Testing
Adaptive and interactive environments replace static, manually designed scenarios.
Automatically uncovers unknown unsafe events, enhancing AV safety validation.
Scalable and efficient, reducing manual effort while expanding test coverage.

Naturalistic & Adversarial Driving Environments (NADE)
→ Real-world traffic behavior modeling based on large-scale naturalistic driving data.
→ Injects corner cases (e.g., jaywalking pedestrians, sudden lane changes) to rigorously test AV safety.

Scalable & Automated AV Testing
→ AI-driven naturalistic and adversarial driving environment accelerates AV validation by 1,000x - 100,000x compared to real-world testing.
→ Dynamically adapts test cases to urban, highway, and mixed-traffic conditions.

Seamless Integration with Third-Party Simulators
→ Works with CARLA, Autoware, and more.
→ API-driven design enables plug-and-play simulation for integration with third-party simulators.

City-Scale AV Testing with TeraSim-Macro
→ Extends simulations from single intersections to entire cities, supporting policy-level AV impact analysis.

Multimodal Inputs & AI-Assisted Environment Creation
→ TeraSim-GPT enables language-driven environment customization.
→ Define test cases in natural language: "Create a left-turn driving environment at a busy intersection."


🛠️ System Architecture

TeraSim is modular, allowing users to customize and extend simulations easily.

Architecture

📌 Core Components:

  • TeraSim: Base simulation engine for generating AV test environments.
  • TeraSim-NDE-NADE: Realistic & adversarial driving environments for safety evaluation.
    • Vehicle Adversities (e.g., aggressive cut-ins, emergency braking).
    • VRU Adversities (e.g., jaywalking pedestrians, erratic cyclists).
  • TeraSim-Service: RESTful API service built with FastAPI for seamless integration with popular simulators like CARLA and AWSim. Enables standardized communication and control.
  • TeraSim-Macro (coming soon): Enables mesoscopic city-scale AV testing.
  • TeraSim-Data-Zoo (coming soon): Repository for real-world driving data (Waymo, NuScenes, NuPlan).
  • TeraSim-GPT (coming soon): AI-powered multimodal user input handling for environment customization.

📌 Plug-and-Play Compatibility:
✅ SUMO-based microsimulation
✅ CARLA & Autoware integration
✅ Real-world dataset support


🔧 Installation

Currently, TeraSim is under active development. Please install it from source using poetry (required) and Anaconda (optional).

conda create -n terasim python=3.10
conda activate terasim
git clone https://github.com/mcity/TeraSim.git
cd TeraSim
poetry install

🚀 Why TeraSim?

🔍 Uncover Hidden AV Risks
→ Dynamically generates realistic and adversarial traffic environments, identifying corner cases.

Automated & Scalable
→ Uses AI to generate simulations across cities, with 1000x faster testing efficiency than real-world methods.

🔗 Seamless Integration
→ Plugin-based design works with existing AV stacks & third-party simulators.

📢 Open-Source & Extensible
→ Encourages industry collaboration for safer, more reliable AV deployment.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

terasim-0.1.0.tar.gz (44.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

terasim-0.1.0-py3-none-any.whl (60.5 kB view details)

Uploaded Python 3

File details

Details for the file terasim-0.1.0.tar.gz.

File metadata

  • Download URL: terasim-0.1.0.tar.gz
  • Upload date:
  • Size: 44.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.14 Linux/5.15.167.4-microsoft-standard-WSL2

File hashes

Hashes for terasim-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dd0ea832c10c0e4a1e2a85a4e3ece409a30574ca52326cea4f61e209ecffa197
MD5 83f0e0471b28323fa0b1eb3f911355e3
BLAKE2b-256 75fc0a58315f4d74e43ea227d2daa234549a9b0c5224aa73670bc3a6dd83a05c

See more details on using hashes here.

File details

Details for the file terasim-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: terasim-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 60.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.14 Linux/5.15.167.4-microsoft-standard-WSL2

File hashes

Hashes for terasim-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d6f489aa554b4df219659529ce23ee6a34cedbb3efccdf221330da414cce9cda
MD5 917850959625c5586a0e92b906777ead
BLAKE2b-256 b656d94ced00aa061c41c4a3479e5e6182337d5129455ae0744c9290dd8e343c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page