{"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/bigr-harnessing-binary-latent-codes-for-image","title":"BiGR: Harnessing Binary Latent Codes for Image Generation and Improved Visual Representation Capabilities","arxiv_id":"2410.14672","date":"2024-10-18","proceeding":null,"authors":["Shaozhe Hao","Xuantong Liu","Xianbiao Qi","Shihao Zhao","Bojia Zi","Rong Xiao","Kai Han","Kwan-Yee K. Wong"],"abstract":"We introduce BiGR, a novel conditional image generation model using compact binary latent codes for generative training, focusing on enhancing both generation and representation capabilities. BiGR is the first conditional generative model that unifies generation and discrimination within the same framework. BiGR features a binary tokenizer, a masked modeling mechanism, and a binary transcoder for binary code prediction. Additionally, we introduce a novel entropy-ordered sampling method to enable efficient image generation. Extensive experiments validate BiGR's superior performance in generation quality, as measured by FID-50k, and representation capabilities, as evidenced by linear-probe accuracy. Moreover, BiGR showcases zero-shot generalization across various vision tasks, enabling applications such as image inpainting, outpainting, editing, interpolation, and enrichment, without the need for structural modifications. Our findings suggest that BiGR unifies generative and discriminative tasks effectively, paving the way for further advancements in the field. We further enable BiGR to perform text-to-image generation, showcasing its potential for broader applications.","url_abs":"https://arxiv.org/abs/2410.14672v3","url_pdf":"https://arxiv.org/pdf/2410.14672v3.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":"bigr-harnessing-binary-latent-codes-for-image","repo_url":"https://github.com/haoosz/BiGR","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"conditional-image-generation","task_name":"Conditional Image Generation"},{"task_slug":"image-generation","task_name":"Image Generation"},{"task_slug":"image-inpainting","task_name":"Image Inpainting"},{"task_slug":"text-to-image-generation-1","task_name":"Text to Image Generation"},{"task_slug":"text-to-image-generation","task_name":"Text-to-Image Generation"},{"task_slug":"zero-shot-generalization","task_name":"Zero-shot Generalization"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2410.14672","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.14672"}},"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/haoosz/BiGR","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":6,"ran_draft_wrong":3,"unverified":4},"by_repo_kind":{"official":{"samples":13,"ran":9,"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":"7c91d7cbaabb7970","entry":"add_weight_decay","repo":"haoosz/BiGR","repo_kind":"official","path":"train_ddp.py","file_url":"https://github.com/haoosz/BiGR/blob/HEAD/train_ddp.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":"7c91d7cbaabb7970"}},{"code_sha256_prefix":"c115fefb450f7ccc","entry":"adjust_mask","repo":"haoosz/BiGR","repo_kind":"official","path":"apps/inpaint.py","file_url":"https://github.com/haoosz/BiGR/blob/HEAD/apps/inpaint.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":"c115fefb450f7ccc"}},{"code_sha256_prefix":"3dc19396537db789","entry":"all_reduce_mean","repo":"haoosz/BiGR","repo_kind":"official","path":"misc.py","file_url":"https://github.com/haoosz/BiGR/blob/HEAD/misc.py","link_basis":"plan_row","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":"3dc19396537db789"}},{"code_sha256_prefix":"ea73360d2d5d9224","entry":"center_crop_arr","repo":"haoosz/BiGR","repo_kind":"official","path":"apps/enrich.py","file_url":"https://github.com/haoosz/BiGR/blob/HEAD/apps/enrich.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ea73360d2d5d9224"}},{"code_sha256_prefix":"3164da5cbc56c361","entry":"focal_loss","repo":"haoosz/BiGR","repo_kind":"official","path":"bae/binarylatent.py","file_url":"https://github.com/haoosz/BiGR/blob/HEAD/bae/binarylatent.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":"3164da5cbc56c361"}},{"code_sha256_prefix":"fc854711df9c23ee","entry":"load_pretrain","repo":"haoosz/BiGR","repo_kind":"official","path":"bae/binaryae.py","file_url":"https://github.com/haoosz/BiGR/blob/HEAD/bae/binaryae.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":"fc854711df9c23ee"}},{"code_sha256_prefix":"3ebba5eb3f84bf5c","entry":"process","repo":"haoosz/BiGR","repo_kind":"official","path":"apps/inpaint.py","file_url":"https://github.com/haoosz/BiGR/blob/HEAD/apps/inpaint.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":"3ebba5eb3f84bf5c"}},{"code_sha256_prefix":"011230b2b9b8fb6f","entry":"rand_brightness","repo":"haoosz/BiGR","repo_kind":"official","path":"bae/diffaug.py","file_url":"https://github.com/haoosz/BiGR/blob/HEAD/bae/diffaug.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"011230b2b9b8fb6f"}},{"code_sha256_prefix":"5b0d8787e670fc63","entry":"rand_saturation","repo":"haoosz/BiGR","repo_kind":"official","path":"bae/diffaug.py","file_url":"https://github.com/haoosz/BiGR/blob/HEAD/bae/diffaug.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5b0d8787e670fc63"}},{"code_sha256_prefix":"1d566d068b0ed0af","entry":"DiffAugment","repo":"haoosz/BiGR","repo_kind":"official","path":"bae/diffaug.py","file_url":"https://github.com/haoosz/BiGR/blob/HEAD/bae/diffaug.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":"1d566d068b0ed0af"}},{"code_sha256_prefix":"8382f7e48cc8a309","entry":"create_logger","repo":"haoosz/BiGR","repo_kind":"official","path":"train_ddp.py","file_url":"https://github.com/haoosz/BiGR/blob/HEAD/train_ddp.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":"8382f7e48cc8a309"}},{"code_sha256_prefix":"ba1356e8ceb654d2","entry":"get_grad_norm_","repo":"haoosz/BiGR","repo_kind":"official","path":"misc.py","file_url":"https://github.com/haoosz/BiGR/blob/HEAD/misc.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":"ba1356e8ceb654d2"}},{"code_sha256_prefix":"8909297ddc746f30","entry":"get_lr","repo":"haoosz/BiGR","repo_kind":"official","path":"train_ddp.py","file_url":"https://github.com/haoosz/BiGR/blob/HEAD/train_ddp.py","link_basis":"first_harvest_node","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":"8909297ddc746f30"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}