Giter Club home page Giter Club logo

causal-agents's Introduction

CausalAgents: A Robustness Benchmark for Motion Forecasting using Causal Relationships

The causal agent labels are an additional attribute to the Waymo Open Motion Dataset. In addition to causal agent labels, we also release perturbed copies of the Waymo Open Motion Dataset validation dataset, which serve as robustness benchmarks to aid the research community in building more reliable and safe models for motion forecasting. For more information, please see the paper CausalAgents: A Robustness Benchmark for Motion Forecasting using Causal Relationships.

Accessing the Data

In order to access the data, please go to https://www.waymo.com/open and click on Access Waymo Open Dataset, which requires a user to sign in with Google and accept the Waymo Open Dataset license terms. After logging in, please visit https://console.cloud.google.com/storage/browser/waymo_open_dataset_causal_agents to download the labels.

Dataset format

Causal Agent Labels

The causal agent labels are released as a TFRecord of causal labels protos (causal_label.proto).

The protocol buffer format for causal labels includes the following fields:

CausalLabels

  • scenario_id: The unique string identifier for the scenario.
  • labeler_results: A list of LabelerResults, one from each individual who labeled the datasets. Each scenario should have at least 5 individual labelers.

LabelerResults

  • causal_agent_ids: A list of causal agent id strings entered by the labeler in the submission box. The agent ids should correspond to the "id" field for the object Track in the Scenario proto. Note that the agent ids may be repeated in the list (they are not necessarily unique), and in a small number of cases the labeler may have entered a string that cannot be parsed as an agent id.

Perturbed Datasets

We release four perturbed datasets:

  1. RemoveNoncausal
    • Removes all non-causal agents in the dataset.
  2. RemoveNoncausalEqual
    • Removes an equal number of randomly selected non-causal agents as there are causal agents in the scene. RemoveNoncausalEqual is meant to be a less aggressive form of RemoveNoncausal since it deletes fewer agents and it allows us to compare to RemoveCausal when controlling for the number of agents deleted.
  3. RemoveStatic
    • Removes agents whose xyz positions do not change above a certain threshold (e.g. parked cars). Not all static agents are non-causal.
  4. RemoveCausal
    • Removes all causal agents in the dataset, i.e., the complement of RemoveNoncausal.

Among them, we categorize both RemoveNoncausal and RemoveNoncausalEqual as “non-causal” perturbations and we recommend these datasets as benchmarks for measuring robustness in future work.

We include RemoveStatic and RemoveCausal as baselines. In our own work, we used these datasets to sanity check model behavior (e.g. we expect the model to be more sensitive to removing causal agents than non-causal or static agents).

To delete an agent from the original dataset, we set the valid bit of the corresponding agent to False for all time steps. Please double check that any model you evaluate on the perturbed datasets correctly ignores all agent state if the valid bit is false. (We verified this for all models we evaluated in the paper).

We provide each perturbed dataset as sharded TFRecord files containing WOMD tf.Example protos.

License

This code repository is licensed under the Apache License, Version 2.0.

Citation

If you use this data, please include the following citation:

@article{roelofs2022causalagents, title={CausalAgents: A Robustness Benchmark for Motion Forecasting using Causal Relationships}, author={Roelofs, Rebecca and Sun, Liting and Caine, Ben and Refaat, Khaled S and Sapp, Ben and Ettinger, Scott and Chai, Wei}, journal={arXiv preprint arXiv:2207.03586}, year={2022} }

Disclaimer

This is not an officially supported Google product.

causal-agents's People

Contributors

rolloff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

causal-agents's Issues

Dropping all objects in the `state/tracks_to_predict` field

Hi,

I have just realized that in some of the scenes, all of the objects in the state/tracks_to_predict are dropped as a result, if that is the case people can't simply use those prediction tags to filter out the agents to predict right, we need to label some of our own agents to predict.

Thanks

Cannot load the perturbed dataset

Behavior

I am using the Waymo Open Dataset Motion Tutorial to visualize the perturbed validation dataset, but when creating the dataset I got the error below, which I suspect that the roadgraph_samples/* features are missing, is this expected?

---------------------------------------------------------------------------
InvalidArgumentError                      Traceback (most recent call last)
[<ipython-input-27-64935651141a>](https://localhost:8080/#) in <cell line: 3>()
      1 dataset = tf.data.TFRecordDataset(FILENAME, compression_type='')
      2 data = next(dataset.as_numpy_iterator())
----> 3 parsed = tf.io.parse_single_example(data, features_description)

1 frames
[/usr/local/lib/python3.10/dist-packages/tensorflow/python/eager/execute.py](https://localhost:8080/#) in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name)
     50   try:
     51     ctx.ensure_initialized()
---> 52     tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
     53                                         inputs, attrs, num_outputs)
     54   except core._NotOkStatusException as e:

InvalidArgumentError: {{function_node __wrapped__ParseExampleV2_Tdense_55_num_sparse_0_ragged_split_types_0_ragged_value_types_0_sparse_types_0_device_/job:localhost/replica:0/task:0/device:CPU:0}} Key: roadgraph_samples/xyz.  Can't parse serialized Example. [Op:ParseExampleV2]

Steps to Reproduce the Problem

  1. Just to make sure the file is not corrupted I downloaded one single file directly from v1.1/validation/RemoveNoncausal/RemoveNoncausalAgents.tfrecord-00000-of-01127 and uploaded to this tutorial to run.
  2. I tried with the dataset from WODM: validation_tfexample.tfrecord-00000-of-00150 and it worked.

How to read the causal-label?

Issue Description:

Hi, thanks for your amazing work! I'm encountering an issue while parsing TFRecord files using TensorFlow. I'm unable to parse the data within them, and I'm getting the following error message:

Error Message:

2023-09-08 15:07:54.635147: W tensorflow/core/framework/op_kernel.cc:1830] OP_REQUIRES failed at example_parsing_ops.cc:94: INVALID_ARGUMENT: Could not parse example input, value: '
...
InvalidArgumentError: {{function_node _wrapped__ParseExampleV2_Tdense_0_num_sparse_2_ragged_split_types_0_ragged_value_types_0_sparse_types_2_device/job:localhost/replica:0/task:0/device:CPU:0}} Could not parse example input, value: '

Specifications:

  • TensorFlow Version: 2.0.0
  • Operating System: Ubuntu 20.04

Background:

I'm encountering an issue while attempting to parse TFRecord files using TensorFlow. The error message suggests a problem with parsing the example input.

Issue Details:

I've defined the dataset description, including variable-length features (VarLenFeature), but it seems there's an issue during parsing. Here's a code snippet:

filename = "causal_labels.tfrecord"
dataset = tf.data.TFRecordDataset(filename, compression_type='')
data = next(dataset.as_numpy_iterator())

features_description = {}
causal_features = {
    'scenario_id': tf.io.VarLenFeature(tf.string),
    'labeler_results': tf.io.VarLenFeature(tf.string),
}

features_description.update(causal_features)
parsed = tf.io.parse_single_example(data, features_description)

Expected Outcome:

I hope to successfully parse the data within the TFRecord file for further data processing and analysis.

Please help me identify the cause of the parsing issue and how to resolve it. Thank you for your assistance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.