{"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/adversarially-robust-out-of-distribution","title":"Adversarially Robust Out-of-Distribution Detection Using Lyapunov-Stabilized Embeddings","arxiv_id":"2410.10744","date":"2024-10-14","proceeding":null,"authors":["Hossein Mirzaei","Mackenzie W. Mathis"],"abstract":"Despite significant advancements in out-of-distribution (OOD) detection, existing methods still struggle to maintain robustness against adversarial attacks, compromising their reliability in critical real-world applications. Previous studies have attempted to address this challenge by exposing detectors to auxiliary OOD datasets alongside adversarial training. However, the increased data complexity inherent in adversarial training, and the myriad of ways that OOD samples can arise during testing, often prevent these approaches from establishing robust decision boundaries. To address these limitations, we propose AROS, a novel approach leveraging neural ordinary differential equations (NODEs) with Lyapunov stability theorem in order to obtain robust embeddings for OOD detection. By incorporating a tailored loss function, we apply Lyapunov stability theory to ensure that both in-distribution (ID) and OOD data converge to stable equilibrium points within the dynamical system. This approach encourages any perturbed input to return to its stable equilibrium, thereby enhancing the model's robustness against adversarial perturbations. To not use additional data, we generate fake OOD embeddings by sampling from low-likelihood regions of the ID data feature space, approximating the boundaries where OOD data are likely to reside. To then further enhance robustness, we propose the use of an orthogonal binary layer following the stable feature space, which maximizes the separation between the equilibrium points of ID and OOD samples. We validate our method through extensive experiments across several benchmarks, demonstrating superior performance, particularly under adversarial attacks. Notably, our approach improves robust detection performance from 37.8% to 80.1% on CIFAR-10 vs. CIFAR-100 and from 29.0% to 67.0% on CIFAR-100 vs. CIFAR-10.","url_abs":"https://arxiv.org/abs/2410.10744v2","url_pdf":"https://arxiv.org/pdf/2410.10744v2.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":"adversarially-robust-out-of-distribution","repo_url":"https://github.com/adaptivemotorcontrollab/aros","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"ood-detection","task_name":"Out of Distribution (OOD) Detection"},{"task_slug":"out-of-distribution-detection","task_name":"Out-of-Distribution Detection"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2410.10744","atlas_url":"https://app.syntology.ai/?focus=2410.10744","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.10744"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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":"deterministic:regex_extraction","url":"https://github.com/AdaptiveMotorControlLab/AROS","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/Trustworthy-AI-Group/TransferAttack","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/adaptivemotorcontrollab/aros","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":6,"ran_fixture":1},"by_repo_kind":{"official":{"samples":7,"ran":7,"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":"ba2910ec4cc8d077","entry":"compute_aupr","repo":"AdaptiveMotorControlLab/AROS","repo_kind":"official","path":"aros_node/evaluate.py","file_url":"https://github.com/AdaptiveMotorControlLab/AROS/blob/HEAD/aros_node/evaluate.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ba2910ec4cc8d077"}},{"code_sha256_prefix":"986e9e947c04d66f","entry":"compute_auroc","repo":"AdaptiveMotorControlLab/AROS","repo_kind":"official","path":"aros_node/evaluate.py","file_url":"https://github.com/AdaptiveMotorControlLab/AROS/blob/HEAD/aros_node/evaluate.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"986e9e947c04d66f"}},{"code_sha256_prefix":"c44b1d15acf1f8fa","entry":"compute_fpr95","repo":"AdaptiveMotorControlLab/AROS","repo_kind":"official","path":"aros_node/evaluate.py","file_url":"https://github.com/AdaptiveMotorControlLab/AROS/blob/HEAD/aros_node/evaluate.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c44b1d15acf1f8fa"}},{"code_sha256_prefix":"950b12c6482f8bdf","entry":"df_dz_regularizer","repo":"AdaptiveMotorControlLab/AROS","repo_kind":"official","path":"aros_node/utils.py","file_url":"https://github.com/AdaptiveMotorControlLab/AROS/blob/HEAD/aros_node/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"950b12c6482f8bdf"}},{"code_sha256_prefix":"20fbd90f627225b3","entry":"f_regularizer","repo":"AdaptiveMotorControlLab/AROS","repo_kind":"official","path":"aros_node/utils.py","file_url":"https://github.com/AdaptiveMotorControlLab/AROS/blob/HEAD/aros_node/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"20fbd90f627225b3"}},{"code_sha256_prefix":"9e4e19e702a0b6d6","entry":"get_subsampled_subset","repo":"AdaptiveMotorControlLab/AROS","repo_kind":"official","path":"aros_node/data_loader.py","file_url":"https://github.com/AdaptiveMotorControlLab/AROS/blob/HEAD/aros_node/data_loader.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9e4e19e702a0b6d6"}},{"code_sha256_prefix":"64975423655410b6","entry":"one_hot","repo":"AdaptiveMotorControlLab/AROS","repo_kind":"official","path":"aros_node/utils.py","file_url":"https://github.com/AdaptiveMotorControlLab/AROS/blob/HEAD/aros_node/utils.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"64975423655410b6"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}