{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/king-generating-safety-critical-driving","title":"KING: Generating Safety-Critical Driving Scenarios for Robust Imitation via Kinematics Gradients","arxiv_id":"2204.13683","date":"2022-04-28","proceeding":null,"authors":["Niklas Hanselmann","Katrin Renz","Kashyap Chitta","Apratim Bhattacharyya","Andreas Geiger"],"abstract":"Simulators offer the possibility of safe, low-cost development of self-driving systems. However, current driving simulators exhibit na\\\"ive behavior models for background traffic. Hand-tuned scenarios are typically added during simulation to induce safety-critical situations. An alternative approach is to adversarially perturb the background traffic trajectories. In this paper, we study this approach to safety-critical driving scenario generation using the CARLA simulator. We use a kinematic bicycle model as a proxy to the simulator's true dynamics and observe that gradients through this proxy model are sufficient for optimizing the background traffic trajectories. Based on this finding, we propose KING, which generates safety-critical driving scenarios with a 20% higher success rate than black-box optimization. By solving the scenarios generated by KING using a privileged rule-based expert algorithm, we obtain training data for an imitation learning policy. After fine-tuning on this new data, we show that the policy becomes better at avoiding collisions. Importantly, our generated data leads to reduced collisions on both held-out scenarios generated via KING as well as traditional hand-crafted scenarios, demonstrating improved robustness.","url_abs":"https://arxiv.org/abs/2204.13683v1","url_pdf":"https://arxiv.org/pdf/2204.13683v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"king-generating-safety-critical-driving","repo_url":"https://github.com/autonomousvision/king","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"imitation-learning","task_name":"Imitation Learning"}],"methods":[{"method_slug":"carla","method_name":"CARLA"},{"method_slug":"entropy-regularization","method_name":"Entropy Regularization"},{"method_slug":"ppo","method_name":"PPO"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2204.13683","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2204.13683"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/autonomousvision/king","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_violates":1,"unverified":5},"by_repo_kind":{"official":{"samples":6,"ran":1,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"af36a314f4f4a4be","entry":"normalize_imagenet","repo":"autonomousvision/king","repo_kind":"official","path":"driving_agents/king/transfuser/model.py","file_url":"https://github.com/autonomousvision/king/blob/HEAD/driving_agents/king/transfuser/model.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"af36a314f4f4a4be"}},{"code_sha256_prefix":"3a340e3918c97e06","entry":"crop_bev","repo":"autonomousvision/king","repo_kind":"official","path":"driving_agents/king/aim_bev/data.py","file_url":"https://github.com/autonomousvision/king/blob/HEAD/driving_agents/king/aim_bev/data.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3a340e3918c97e06"}},{"code_sha256_prefix":"a1437734376e1830","entry":"decode_pil_to_npy","repo":"autonomousvision/king","repo_kind":"official","path":"driving_agents/king/aim_bev/training_utils.py","file_url":"https://github.com/autonomousvision/king/blob/HEAD/driving_agents/king/aim_bev/training_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a1437734376e1830"}},{"code_sha256_prefix":"8130dc8508ed50c4","entry":"encode_npy_to_pil","repo":"autonomousvision/king","repo_kind":"official","path":"driving_agents/king/aim_bev/training_utils.py","file_url":"https://github.com/autonomousvision/king/blob/HEAD/driving_agents/king/aim_bev/training_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8130dc8508ed50c4"}},{"code_sha256_prefix":"ab5e4f6eb1d465bd","entry":"get_crop_offsets","repo":"autonomousvision/king","repo_kind":"official","path":"driving_agents/king/aim_bev/training_utils.py","file_url":"https://github.com/autonomousvision/king/blob/HEAD/driving_agents/king/aim_bev/training_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ab5e4f6eb1d465bd"}},{"code_sha256_prefix":"3648889677ef997a","entry":"load_crop_bev_png","repo":"autonomousvision/king","repo_kind":"official","path":"driving_agents/king/aim_bev/data.py","file_url":"https://github.com/autonomousvision/king/blob/HEAD/driving_agents/king/aim_bev/data.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3648889677ef997a"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}