{"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/hashnet-deep-learning-to-hash-by-continuation","title":"HashNet: Deep Learning to Hash by Continuation","arxiv_id":"1702.00758","date":"2017-02-02","proceeding":"ICCV 2017 10","authors":["Zhangjie Cao","Mingsheng Long","Jian-Min Wang","Philip S. Yu"],"abstract":"Learning to hash has been widely applied to approximate nearest neighbor\nsearch for large-scale multimedia retrieval, due to its computation efficiency\nand retrieval quality. Deep learning to hash, which improves retrieval quality\nby end-to-end representation learning and hash encoding, has received\nincreasing attention recently. Subject to the ill-posed gradient difficulty in\nthe optimization with sign activations, existing deep learning to hash methods\nneed to first learn continuous representations and then generate binary hash\ncodes in a separated binarization step, which suffer from substantial loss of\nretrieval quality. This work presents HashNet, a novel deep architecture for\ndeep learning to hash by continuation method with convergence guarantees, which\nlearns exactly binary hash codes from imbalanced similarity data. The key idea\nis to attack the ill-posed gradient problem in optimizing deep networks with\nnon-smooth binary activations by continuation method, in which we begin from\nlearning an easier network with smoothed activation function and let it evolve\nduring the training, until it eventually goes back to being the original,\ndifficult to optimize, deep network with the sign activation function.\nComprehensive empirical evidence shows that HashNet can generate exactly binary\nhash codes and yield state-of-the-art multimedia retrieval performance on\nstandard benchmarks.","url_abs":"http://arxiv.org/abs/1702.00758v4","url_pdf":"http://arxiv.org/pdf/1702.00758v4.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":"hashnet-deep-learning-to-hash-by-continuation","repo_url":"https://github.com/thuml/HashNet","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"hashnet-deep-learning-to-hash-by-continuation","repo_url":"https://github.com/hatimwen/paddle_hashnet","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"paddle","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"binarization","task_name":"Binarization"},{"task_slug":"deep-learning","task_name":"Deep Learning"},{"task_slug":"representation-learning","task_name":"Representation Learning"},{"task_slug":"retrieval","task_name":"Retrieval"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1702.00758","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1702.00758"}},"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/thuml/HashNet","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/hatimwen/paddle_hashnet","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_draft_wrong":1,"ran_honours":1,"unverified":14},"by_repo_kind":{"official":{"samples":11,"ran":2,"repositories":1},"listed":{"samples":5,"ran":0,"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":"3ce1df52d4a961b8","entry":"inv_lr_scheduler","repo":"thuml/HashNet","repo_kind":"official","path":"pytorch/src/lr_schedule.py","file_url":"https://github.com/thuml/HashNet/blob/HEAD/pytorch/src/lr_schedule.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3ce1df52d4a961b8"}},{"code_sha256_prefix":"1df9a5ffd9b38c34","entry":"pil_loader","repo":"thuml/HashNet","repo_kind":"official","path":"pytorch/src/data_list.py","file_url":"https://github.com/thuml/HashNet/blob/HEAD/pytorch/src/data_list.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1df9a5ffd9b38c34"}},{"code_sha256_prefix":"fec8bc71986e9775","entry":"CalcHammingDist","repo":"hatimwen/paddle_hashnet","repo_kind":"listed","path":"utils/tools.py","file_url":"https://github.com/hatimwen/paddle_hashnet/blob/HEAD/utils/tools.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fec8bc71986e9775"}},{"code_sha256_prefix":"ac4069aac5bd1718","entry":"CalcTopMap","repo":"hatimwen/paddle_hashnet","repo_kind":"listed","path":"utils/tools.py","file_url":"https://github.com/hatimwen/paddle_hashnet/blob/HEAD/utils/tools.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ac4069aac5bd1718"}},{"code_sha256_prefix":"9dcef767571b38d7","entry":"accimage_loader","repo":"thuml/HashNet","repo_kind":"official","path":"pytorch/src/data_list.py","file_url":"https://github.com/thuml/HashNet/blob/HEAD/pytorch/src/data_list.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":"9dcef767571b38d7"}},{"code_sha256_prefix":"5a36b6fd1493e872","entry":"config_dataset","repo":"hatimwen/paddle_hashnet","repo_kind":"listed","path":"utils/datasets.py","file_url":"https://github.com/hatimwen/paddle_hashnet/blob/HEAD/utils/datasets.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5a36b6fd1493e872"}},{"code_sha256_prefix":"a66b5598134a7bcd","entry":"get_args","repo":"hatimwen/paddle_hashnet","repo_kind":"listed","path":"deploy/inference_python/infer.py","file_url":"https://github.com/hatimwen/paddle_hashnet/blob/HEAD/deploy/inference_python/infer.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a66b5598134a7bcd"}},{"code_sha256_prefix":"3d300924bfb82d8f","entry":"get_logger","repo":"hatimwen/paddle_hashnet","repo_kind":"listed","path":"main_multi_gpu.py","file_url":"https://github.com/hatimwen/paddle_hashnet/blob/HEAD/main_multi_gpu.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3d300924bfb82d8f"}},{"code_sha256_prefix":"dff451db0315485c","entry":"image_test","repo":"thuml/HashNet","repo_kind":"official","path":"pytorch/src/pre_process.py","file_url":"https://github.com/thuml/HashNet/blob/HEAD/pytorch/src/pre_process.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":"dff451db0315485c"}},{"code_sha256_prefix":"9a338479bd269e9b","entry":"image_test_10crop","repo":"thuml/HashNet","repo_kind":"official","path":"pytorch/src/pre_process.py","file_url":"https://github.com/thuml/HashNet/blob/HEAD/pytorch/src/pre_process.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":"9a338479bd269e9b"}},{"code_sha256_prefix":"3331c5176304df6a","entry":"image_train","repo":"thuml/HashNet","repo_kind":"official","path":"pytorch/src/pre_process.py","file_url":"https://github.com/thuml/HashNet/blob/HEAD/pytorch/src/pre_process.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":"3331c5176304df6a"}},{"code_sha256_prefix":"2301055cb33836bc","entry":"make_dataset","repo":"thuml/HashNet","repo_kind":"official","path":"pytorch/src/data_list.py","file_url":"https://github.com/thuml/HashNet/blob/HEAD/pytorch/src/data_list.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":"2301055cb33836bc"}},{"code_sha256_prefix":"b0c5a2db3d6ec084","entry":"multistep_lr_scheduler","repo":"thuml/HashNet","repo_kind":"official","path":"pytorch/src/lr_schedule.py","file_url":"https://github.com/thuml/HashNet/blob/HEAD/pytorch/src/lr_schedule.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":"b0c5a2db3d6ec084"}},{"code_sha256_prefix":"1cef1cb746b4c73f","entry":"pairwise_loss","repo":"thuml/HashNet","repo_kind":"official","path":"pytorch/src/loss.py","file_url":"https://github.com/thuml/HashNet/blob/HEAD/pytorch/src/loss.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":"1cef1cb746b4c73f"}},{"code_sha256_prefix":"77901aeefce81a76","entry":"pairwise_loss_updated","repo":"thuml/HashNet","repo_kind":"official","path":"pytorch/src/loss.py","file_url":"https://github.com/thuml/HashNet/blob/HEAD/pytorch/src/loss.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":"77901aeefce81a76"}},{"code_sha256_prefix":"0dfc49084aa7fa24","entry":"step_lr_scheduler","repo":"thuml/HashNet","repo_kind":"official","path":"pytorch/src/lr_schedule.py","file_url":"https://github.com/thuml/HashNet/blob/HEAD/pytorch/src/lr_schedule.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":"0dfc49084aa7fa24"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}