{"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/towards-accurate-binary-neural-networks-via","title":"Towards Accurate Binary Neural Networks via Modeling Contextual Dependencies","arxiv_id":"2209.01404","date":"2022-09-03","proceeding":null,"authors":["Xingrun Xing","Yangguang Li","Wei Li","Wenrui Ding","Yalong Jiang","Yufeng Wang","Jing Shao","Chunlei Liu","Xianglong Liu"],"abstract":"Existing Binary Neural Networks (BNNs) mainly operate on local convolutions with binarization function. However, such simple bit operations lack the ability of modeling contextual dependencies, which is critical for learning discriminative deep representations in vision models. In this work, we tackle this issue by presenting new designs of binary neural modules, which enables BNNs to learn effective contextual dependencies. First, we propose a binary multi-layer perceptron (MLP) block as an alternative to binary convolution blocks to directly model contextual dependencies. Both short-range and long-range feature dependencies are modeled by binary MLPs, where the former provides local inductive bias and the latter breaks limited receptive field in binary convolutions. Second, to improve the robustness of binary models with contextual dependencies, we compute the contextual dynamic embeddings to determine the binarization thresholds in general binary convolutional blocks. Armed with our binary MLP blocks and improved binary convolution, we build the BNNs with explicit Contextual Dependency modeling, termed as BCDNet. On the standard ImageNet-1K classification benchmark, the BCDNet achieves 72.3% Top-1 accuracy and outperforms leading binary methods by a large margin. In particular, the proposed BCDNet exceeds the state-of-the-art ReActNet-A by 2.9% Top-1 accuracy with similar operations. Our code is available at https://github.com/Sense-GVT/BCDN","url_abs":"https://arxiv.org/abs/2209.01404v1","url_pdf":"https://arxiv.org/pdf/2209.01404v1.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":"towards-accurate-binary-neural-networks-via","repo_url":"https://github.com/sense-gvt/bcdnet","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"binarization","task_name":"Binarization"},{"task_slug":"inductive-bias","task_name":"Inductive Bias"}],"methods":[{"method_slug":"convolution","method_name":"Convolution"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2209.01404","atlas_url":"https://app.syntology.ai/?focus=2209.01404","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2209.01404"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/sense-gvt/bcdnet","reach":{"status":"ok"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/Sense-GVT/BCDNet","reach":{"status":"ok"}}],"summary":{"ran":7,"ran_draft_wrong":3,"unverified":7},"by_repo_kind":{"official":{"samples":17,"ran":10,"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":17,"samples":[{"code_sha256_prefix":"576cf54b92fc2045","entry":"BinaryActivation","repo":"Sense-GVT/BCDNet","repo_kind":"official","path":"prototype/model/a_3.py","file_url":"https://github.com/Sense-GVT/BCDNet/blob/HEAD/prototype/model/a_3.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"576cf54b92fc2045"}},{"code_sha256_prefix":"9f5b3152cc94a478","entry":"GlobalShift","repo":"Sense-GVT/BCDNet","repo_kind":"official","path":"prototype/model/a_3.py","file_url":"https://github.com/Sense-GVT/BCDNet/blob/HEAD/prototype/model/a_3.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9f5b3152cc94a478"}},{"code_sha256_prefix":"96414cb31453317f","entry":"HardBinaryConv","repo":"Sense-GVT/BCDNet","repo_kind":"official","path":"prototype/model/a_3.py","file_url":"https://github.com/Sense-GVT/BCDNet/blob/HEAD/prototype/model/a_3.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"96414cb31453317f"}},{"code_sha256_prefix":"484fb153ec2ac5f4","entry":"LearnableBias","repo":"Sense-GVT/BCDNet","repo_kind":"official","path":"prototype/model/a_3.py","file_url":"https://github.com/Sense-GVT/BCDNet/blob/HEAD/prototype/model/a_3.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"484fb153ec2ac5f4"}},{"code_sha256_prefix":"ebd2689700cf8691","entry":"Shift","repo":"Sense-GVT/BCDNet","repo_kind":"official","path":"prototype/model/a_3.py","file_url":"https://github.com/Sense-GVT/BCDNet/blob/HEAD/prototype/model/a_3.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ebd2689700cf8691"}},{"code_sha256_prefix":"890ea919c4eae756","entry":"binaryconv1x1","repo":"Sense-GVT/BCDNet","repo_kind":"official","path":"prototype/model/a_3.py","file_url":"https://github.com/Sense-GVT/BCDNet/blob/HEAD/prototype/model/a_3.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":"890ea919c4eae756"}},{"code_sha256_prefix":"c8fd8f1b353d36a3","entry":"binaryconv3x3","repo":"Sense-GVT/BCDNet","repo_kind":"official","path":"prototype/model/a_3.py","file_url":"https://github.com/Sense-GVT/BCDNet/blob/HEAD/prototype/model/a_3.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":"c8fd8f1b353d36a3"}},{"code_sha256_prefix":"8a98753263fba59d","entry":"get_bn","repo":"Sense-GVT/BCDNet","repo_kind":"official","path":"prototype/model/a_3.py","file_url":"https://github.com/Sense-GVT/BCDNet/blob/HEAD/prototype/model/a_3.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":"8a98753263fba59d"}},{"code_sha256_prefix":"426074b9c7f8d0b4","entry":"get_rank","repo":"Sense-GVT/BCDNet","repo_kind":"official","path":"prototype/model/a_3.py","file_url":"https://github.com/Sense-GVT/BCDNet/blob/HEAD/prototype/model/a_3.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":"426074b9c7f8d0b4"}},{"code_sha256_prefix":"63a4bdc62e66305d","entry":"get_world_size","repo":"Sense-GVT/BCDNet","repo_kind":"official","path":"prototype/model/a_3.py","file_url":"https://github.com/Sense-GVT/BCDNet/blob/HEAD/prototype/model/a_3.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":"63a4bdc62e66305d"}},{"code_sha256_prefix":"32055d142ffca233","entry":"BasicBlock","repo":"Sense-GVT/BCDNet","repo_kind":"official","path":"prototype/model/a_3.py","file_url":"https://github.com/Sense-GVT/BCDNet/blob/HEAD/prototype/model/a_3.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":"32055d142ffca233"}},{"code_sha256_prefix":"5468426c40c8c5bc","entry":"Block","repo":"Sense-GVT/BCDNet","repo_kind":"official","path":"prototype/model/a_3.py","file_url":"https://github.com/Sense-GVT/BCDNet/blob/HEAD/prototype/model/a_3.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":"5468426c40c8c5bc"}},{"code_sha256_prefix":"5b128936059e4741","entry":"PointBlock","repo":"Sense-GVT/BCDNet","repo_kind":"official","path":"prototype/model/a_3.py","file_url":"https://github.com/Sense-GVT/BCDNet/blob/HEAD/prototype/model/a_3.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":"5b128936059e4741"}},{"code_sha256_prefix":"c843b0dd7c6ad11c","entry":"Reactnet","repo":"Sense-GVT/BCDNet","repo_kind":"official","path":"prototype/model/a_3.py","file_url":"https://github.com/Sense-GVT/BCDNet/blob/HEAD/prototype/model/a_3.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":"c843b0dd7c6ad11c"}},{"code_sha256_prefix":"d0829f23d319c6c4","entry":"ShiftBlock","repo":"Sense-GVT/BCDNet","repo_kind":"official","path":"prototype/model/a_3.py","file_url":"https://github.com/Sense-GVT/BCDNet/blob/HEAD/prototype/model/a_3.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":"d0829f23d319c6c4"}},{"code_sha256_prefix":"872a669394bfc1d1","entry":"firstconv3x3","repo":"Sense-GVT/BCDNet","repo_kind":"official","path":"prototype/model/a_3.py","file_url":"https://github.com/Sense-GVT/BCDNet/blob/HEAD/prototype/model/a_3.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":"872a669394bfc1d1"}},{"code_sha256_prefix":"7bd0c3b833e49d56","entry":"simple_group_split","repo":"Sense-GVT/BCDNet","repo_kind":"official","path":"prototype/model/a_3.py","file_url":"https://github.com/Sense-GVT/BCDNet/blob/HEAD/prototype/model/a_3.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":"7bd0c3b833e49d56"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}