{"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/madi-learning-to-mask-distractions-for","title":"MaDi: Learning to Mask Distractions for Generalization in Visual Deep Reinforcement Learning","arxiv_id":"2312.15339","date":"2023-12-23","proceeding":null,"authors":["Bram Grooten","Tristan Tomilin","Gautham Vasan","Matthew E. Taylor","A. Rupam Mahmood","Meng Fang","Mykola Pechenizkiy","Decebal Constantin Mocanu"],"abstract":"The visual world provides an abundance of information, but many input pixels received by agents often contain distracting stimuli. Autonomous agents need the ability to distinguish useful information from task-irrelevant perceptions, enabling them to generalize to unseen environments with new distractions. Existing works approach this problem using data augmentation or large auxiliary networks with additional loss functions. We introduce MaDi, a novel algorithm that learns to mask distractions by the reward signal only. In MaDi, the conventional actor-critic structure of deep reinforcement learning agents is complemented by a small third sibling, the Masker. This lightweight neural network generates a mask to determine what the actor and critic will receive, such that they can focus on learning the task. The masks are created dynamically, depending on the current input. We run experiments on the DeepMind Control Generalization Benchmark, the Distracting Control Suite, and a real UR5 Robotic Arm. Our algorithm improves the agent's focus with useful masks, while its efficient Masker network only adds 0.2% more parameters to the original structure, in contrast to previous work. MaDi consistently achieves generalization results better than or competitive to state-of-the-art methods.","url_abs":"https://arxiv.org/abs/2312.15339v1","url_pdf":"https://arxiv.org/pdf/2312.15339v1.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":"madi-learning-to-mask-distractions-for","repo_url":"https://github.com/bramgrooten/mask-distractions","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"data-augmentation","task_name":"Data Augmentation"},{"task_slug":"deep-reinforcement-learning","task_name":"Deep Reinforcement Learning"}],"methods":[{"method_slug":"focus","method_name":"Focus"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2312.15339","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2312.15339"}},"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/bramgrooten/mask-distractions","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":6},"by_repo_kind":{"official":{"samples":6,"ran":6,"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":"6c2c84b4ccb7f17b","entry":"cat","repo":"bramgrooten/mask-distractions","repo_kind":"official","path":"src/utils.py","file_url":"https://github.com/bramgrooten/mask-distractions/blob/HEAD/src/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6c2c84b4ccb7f17b"}},{"code_sha256_prefix":"2df17488b927be0b","entry":"gaussian_logprob","repo":"bramgrooten/mask-distractions","repo_kind":"official","path":"src/algorithms/modules.py","file_url":"https://github.com/bramgrooten/mask-distractions/blob/HEAD/src/algorithms/modules.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2df17488b927be0b"}},{"code_sha256_prefix":"17e5c541e0e7b3af","entry":"load_config","repo":"bramgrooten/mask-distractions","repo_kind":"official","path":"src/utils.py","file_url":"https://github.com/bramgrooten/mask-distractions/blob/HEAD/src/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"17e5c541e0e7b3af"}},{"code_sha256_prefix":"1ac4e5bffc3dbbd3","entry":"make_dir","repo":"bramgrooten/mask-distractions","repo_kind":"official","path":"src/utils.py","file_url":"https://github.com/bramgrooten/mask-distractions/blob/HEAD/src/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1ac4e5bffc3dbbd3"}},{"code_sha256_prefix":"121cb336a1e1278a","entry":"squash","repo":"bramgrooten/mask-distractions","repo_kind":"official","path":"src/algorithms/modules.py","file_url":"https://github.com/bramgrooten/mask-distractions/blob/HEAD/src/algorithms/modules.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"121cb336a1e1278a"}},{"code_sha256_prefix":"1387f0bafec9b149","entry":"trunc_normal_","repo":"bramgrooten/mask-distractions","repo_kind":"official","path":"src/algorithms/modules.py","file_url":"https://github.com/bramgrooten/mask-distractions/blob/HEAD/src/algorithms/modules.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1387f0bafec9b149"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}