{"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/adaptive-focus-for-efficient-video","title":"Adaptive Focus for Efficient Video Recognition","arxiv_id":"2105.03245","date":"2021-05-07","proceeding":"ICCV 2021 10","authors":["Yulin Wang","Zhaoxi Chen","Haojun Jiang","Shiji Song","Yizeng Han","Gao Huang"],"abstract":"In this paper, we explore the spatial redundancy in video recognition with the aim to improve the computational efficiency. It is observed that the most informative region in each frame of a video is usually a small image patch, which shifts smoothly across frames. Therefore, we model the patch localization problem as a sequential decision task, and propose a reinforcement learning based approach for efficient spatially adaptive video recognition (AdaFocus). In specific, a light-weighted ConvNet is first adopted to quickly process the full video sequence, whose features are used by a recurrent policy network to localize the most task-relevant regions. Then the selected patches are inferred by a high-capacity network for the final prediction. During offline inference, once the informative patch sequence has been generated, the bulk of computation can be done in parallel, and is efficient on modern GPU devices. In addition, we demonstrate that the proposed method can be easily extended by further considering the temporal redundancy, e.g., dynamically skipping less valuable frames. Extensive experiments on five benchmark datasets, i.e., ActivityNet, FCVID, Mini-Kinetics, Something-Something V1&V2, demonstrate that our method is significantly more efficient than the competitive baselines. Code is available at https://github.com/blackfeather-wang/AdaFocus.","url_abs":"https://arxiv.org/abs/2105.03245v2","url_pdf":"https://arxiv.org/pdf/2105.03245v2.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":"adaptive-focus-for-efficient-video","repo_url":"https://github.com/blackfeather-wang/AdaFocus","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"adaptive-focus-for-efficient-video","repo_url":"https://github.com/leaplabthu/uni-adafocus","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"computational-efficiency","task_name":"Computational Efficiency"},{"task_slug":null,"task_name":"GPU"},{"task_slug":"video-recognition","task_name":"Video Recognition"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2105.03245","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2105.03245"}},"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/blackfeather-wang/AdaFocus","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/leaplabthu/uni-adafocus","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":8,"ran_draft_wrong":3,"ran_fixture":2,"unverified":10},"by_repo_kind":{"official":{"samples":23,"ran":13,"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":23,"samples":[{"code_sha256_prefix":"dba4e40d3ec4e1a6","entry":"Bottleneck","repo":"blackfeather-wang/AdaFocus","repo_kind":"official","path":"Experiments on ActivityNet, FCVID and Mini-Kinetics/models/gfv_net.py","file_url":"https://github.com/blackfeather-wang/AdaFocus/blob/HEAD/Experiments%20on%20ActivityNet%2C%20FCVID%20and%20Mini-Kinetics/models/gfv_net.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"dba4e40d3ec4e1a6"}},{"code_sha256_prefix":"694778287c1e57cb","entry":"ConvBNReLU","repo":"blackfeather-wang/AdaFocus","repo_kind":"official","path":"Experiments on ActivityNet, FCVID and Mini-Kinetics/models/gfv_net.py","file_url":"https://github.com/blackfeather-wang/AdaFocus/blob/HEAD/Experiments%20on%20ActivityNet%2C%20FCVID%20and%20Mini-Kinetics/models/gfv_net.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"694778287c1e57cb"}},{"code_sha256_prefix":"b0b0395a2d15fd11","entry":"InvertedResidual","repo":"blackfeather-wang/AdaFocus","repo_kind":"official","path":"Experiments on ActivityNet, FCVID and Mini-Kinetics/models/gfv_net.py","file_url":"https://github.com/blackfeather-wang/AdaFocus/blob/HEAD/Experiments%20on%20ActivityNet%2C%20FCVID%20and%20Mini-Kinetics/models/gfv_net.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b0b0395a2d15fd11"}},{"code_sha256_prefix":"0d27f8bcdbc1a81a","entry":"LinearCLassifier","repo":"blackfeather-wang/AdaFocus","repo_kind":"official","path":"Experiments on ActivityNet, FCVID and Mini-Kinetics/models/gfv_net.py","file_url":"https://github.com/blackfeather-wang/AdaFocus/blob/HEAD/Experiments%20on%20ActivityNet%2C%20FCVID%20and%20Mini-Kinetics/models/gfv_net.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0d27f8bcdbc1a81a"}},{"code_sha256_prefix":"6dab8592a6da4561","entry":"Memory","repo":"blackfeather-wang/AdaFocus","repo_kind":"official","path":"Experiments on ActivityNet, FCVID and Mini-Kinetics/models/gfv_net.py","file_url":"https://github.com/blackfeather-wang/AdaFocus/blob/HEAD/Experiments%20on%20ActivityNet%2C%20FCVID%20and%20Mini-Kinetics/models/gfv_net.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6dab8592a6da4561"}},{"code_sha256_prefix":"a0a4faf6f3826228","entry":"MobileNetV2","repo":"blackfeather-wang/AdaFocus","repo_kind":"official","path":"Experiments on ActivityNet, FCVID and Mini-Kinetics/models/gfv_net.py","file_url":"https://github.com/blackfeather-wang/AdaFocus/blob/HEAD/Experiments%20on%20ActivityNet%2C%20FCVID%20and%20Mini-Kinetics/models/gfv_net.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a0a4faf6f3826228"}},{"code_sha256_prefix":"49b0ecfe3309749c","entry":"RecurrentClassifier","repo":"blackfeather-wang/AdaFocus","repo_kind":"official","path":"Experiments on ActivityNet, FCVID and Mini-Kinetics/models/gfv_net.py","file_url":"https://github.com/blackfeather-wang/AdaFocus/blob/HEAD/Experiments%20on%20ActivityNet%2C%20FCVID%20and%20Mini-Kinetics/models/gfv_net.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"49b0ecfe3309749c"}},{"code_sha256_prefix":"8b4abacfcdbd5f34","entry":"conv1x1","repo":"blackfeather-wang/AdaFocus","repo_kind":"official","path":"Experiments on ActivityNet, FCVID and Mini-Kinetics/models/gfv_net.py","file_url":"https://github.com/blackfeather-wang/AdaFocus/blob/HEAD/Experiments%20on%20ActivityNet%2C%20FCVID%20and%20Mini-Kinetics/models/gfv_net.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8b4abacfcdbd5f34"}},{"code_sha256_prefix":"29b46555d311b33f","entry":"conv3x3","repo":"blackfeather-wang/AdaFocus","repo_kind":"official","path":"Experiments on ActivityNet, FCVID and Mini-Kinetics/models/gfv_net.py","file_url":"https://github.com/blackfeather-wang/AdaFocus/blob/HEAD/Experiments%20on%20ActivityNet%2C%20FCVID%20and%20Mini-Kinetics/models/gfv_net.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"29b46555d311b33f"}},{"code_sha256_prefix":"e8eed825e5369a09","entry":"get_patch","repo":"blackfeather-wang/AdaFocus","repo_kind":"official","path":"Experiments on ActivityNet, FCVID and Mini-Kinetics/models/gfv_net.py","file_url":"https://github.com/blackfeather-wang/AdaFocus/blob/HEAD/Experiments%20on%20ActivityNet%2C%20FCVID%20and%20Mini-Kinetics/models/gfv_net.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e8eed825e5369a09"}},{"code_sha256_prefix":"2f3f5423309d07f4","entry":"mobilenet_v2","repo":"blackfeather-wang/AdaFocus","repo_kind":"official","path":"Experiments on ActivityNet, FCVID and Mini-Kinetics/models/gfv_net.py","file_url":"https://github.com/blackfeather-wang/AdaFocus/blob/HEAD/Experiments%20on%20ActivityNet%2C%20FCVID%20and%20Mini-Kinetics/models/gfv_net.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2f3f5423309d07f4"}},{"code_sha256_prefix":"1270d498daf32c06","entry":"random_crop","repo":"blackfeather-wang/AdaFocus","repo_kind":"official","path":"Experiments on ActivityNet, FCVID and Mini-Kinetics/models/gfv_net.py","file_url":"https://github.com/blackfeather-wang/AdaFocus/blob/HEAD/Experiments%20on%20ActivityNet%2C%20FCVID%20and%20Mini-Kinetics/models/gfv_net.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1270d498daf32c06"}},{"code_sha256_prefix":"8e712c383c677282","entry":"zero_pad","repo":"blackfeather-wang/AdaFocus","repo_kind":"official","path":"Experiments on ActivityNet, FCVID and Mini-Kinetics/models/gfv_net.py","file_url":"https://github.com/blackfeather-wang/AdaFocus/blob/HEAD/Experiments%20on%20ActivityNet%2C%20FCVID%20and%20Mini-Kinetics/models/gfv_net.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8e712c383c677282"}},{"code_sha256_prefix":"aaf4fc54301dc25b","entry":"ActorCritic","repo":"blackfeather-wang/AdaFocus","repo_kind":"official","path":"Experiments on ActivityNet, FCVID and Mini-Kinetics/models/gfv_net.py","file_url":"https://github.com/blackfeather-wang/AdaFocus/blob/HEAD/Experiments%20on%20ActivityNet%2C%20FCVID%20and%20Mini-Kinetics/models/gfv_net.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"aaf4fc54301dc25b"}},{"code_sha256_prefix":"3e72f5c3aa3cfb73","entry":"BasicBlock","repo":"blackfeather-wang/AdaFocus","repo_kind":"official","path":"Experiments on ActivityNet, FCVID and Mini-Kinetics/models/gfv_net.py","file_url":"https://github.com/blackfeather-wang/AdaFocus/blob/HEAD/Experiments%20on%20ActivityNet%2C%20FCVID%20and%20Mini-Kinetics/models/gfv_net.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3e72f5c3aa3cfb73"}},{"code_sha256_prefix":"ecfff27ee4d3b4ea","entry":"Focuser","repo":"blackfeather-wang/AdaFocus","repo_kind":"official","path":"Experiments on ActivityNet, FCVID and Mini-Kinetics/models/gfv_net.py","file_url":"https://github.com/blackfeather-wang/AdaFocus/blob/HEAD/Experiments%20on%20ActivityNet%2C%20FCVID%20and%20Mini-Kinetics/models/gfv_net.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ecfff27ee4d3b4ea"}},{"code_sha256_prefix":"f2ede844bb4fec8b","entry":"GFV","repo":"blackfeather-wang/AdaFocus","repo_kind":"official","path":"Experiments on ActivityNet, FCVID and Mini-Kinetics/models/gfv_net.py","file_url":"https://github.com/blackfeather-wang/AdaFocus/blob/HEAD/Experiments%20on%20ActivityNet%2C%20FCVID%20and%20Mini-Kinetics/models/gfv_net.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f2ede844bb4fec8b"}},{"code_sha256_prefix":"778bd73246149e78","entry":"Glancer","repo":"blackfeather-wang/AdaFocus","repo_kind":"official","path":"Experiments on ActivityNet, FCVID and Mini-Kinetics/models/gfv_net.py","file_url":"https://github.com/blackfeather-wang/AdaFocus/blob/HEAD/Experiments%20on%20ActivityNet%2C%20FCVID%20and%20Mini-Kinetics/models/gfv_net.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"778bd73246149e78"}},{"code_sha256_prefix":"d95a709e40c1819c","entry":"PPO","repo":"blackfeather-wang/AdaFocus","repo_kind":"official","path":"Experiments on ActivityNet, FCVID and Mini-Kinetics/models/gfv_net.py","file_url":"https://github.com/blackfeather-wang/AdaFocus/blob/HEAD/Experiments%20on%20ActivityNet%2C%20FCVID%20and%20Mini-Kinetics/models/gfv_net.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d95a709e40c1819c"}},{"code_sha256_prefix":"8306c10e2d90a490","entry":"PatchSampler","repo":"blackfeather-wang/AdaFocus","repo_kind":"official","path":"Experiments on ActivityNet, FCVID and Mini-Kinetics/models/gfv_net.py","file_url":"https://github.com/blackfeather-wang/AdaFocus/blob/HEAD/Experiments%20on%20ActivityNet%2C%20FCVID%20and%20Mini-Kinetics/models/gfv_net.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8306c10e2d90a490"}},{"code_sha256_prefix":"076a8d0ad95b226b","entry":"ResNet","repo":"blackfeather-wang/AdaFocus","repo_kind":"official","path":"Experiments on ActivityNet, FCVID and Mini-Kinetics/models/gfv_net.py","file_url":"https://github.com/blackfeather-wang/AdaFocus/blob/HEAD/Experiments%20on%20ActivityNet%2C%20FCVID%20and%20Mini-Kinetics/models/gfv_net.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"076a8d0ad95b226b"}},{"code_sha256_prefix":"5e103ea4fee0452b","entry":"_resnet","repo":"blackfeather-wang/AdaFocus","repo_kind":"official","path":"Experiments on ActivityNet, FCVID and Mini-Kinetics/models/gfv_net.py","file_url":"https://github.com/blackfeather-wang/AdaFocus/blob/HEAD/Experiments%20on%20ActivityNet%2C%20FCVID%20and%20Mini-Kinetics/models/gfv_net.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5e103ea4fee0452b"}},{"code_sha256_prefix":"d4b9ffcd5506ea85","entry":"resnet50","repo":"blackfeather-wang/AdaFocus","repo_kind":"official","path":"Experiments on ActivityNet, FCVID and Mini-Kinetics/models/gfv_net.py","file_url":"https://github.com/blackfeather-wang/AdaFocus/blob/HEAD/Experiments%20on%20ActivityNet%2C%20FCVID%20and%20Mini-Kinetics/models/gfv_net.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d4b9ffcd5506ea85"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}