{"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/video-corpus-moment-retrieval-with","title":"Video Corpus Moment Retrieval with Contrastive Learning","arxiv_id":"2105.06247","date":"2021-05-13","proceeding":null,"authors":["Hao Zhang","Aixin Sun","Wei Jing","Guoshun Nan","Liangli Zhen","Joey Tianyi Zhou","Rick Siow Mong Goh"],"abstract":"Given a collection of untrimmed and unsegmented videos, video corpus moment retrieval (VCMR) is to retrieve a temporal moment (i.e., a fraction of a video) that semantically corresponds to a given text query. As video and text are from two distinct feature spaces, there are two general approaches to address VCMR: (i) to separately encode each modality representations, then align the two modality representations for query processing, and (ii) to adopt fine-grained cross-modal interaction to learn multi-modal representations for query processing. While the second approach often leads to better retrieval accuracy, the first approach is far more efficient. In this paper, we propose a Retrieval and Localization Network with Contrastive Learning (ReLoCLNet) for VCMR. We adopt the first approach and introduce two contrastive learning objectives to refine video encoder and text encoder to learn video and text representations separately but with better alignment for VCMR. The video contrastive learning (VideoCL) is to maximize mutual information between query and candidate video at video-level. The frame contrastive learning (FrameCL) aims to highlight the moment region corresponds to the query at frame-level, within a video. Experimental results show that, although ReLoCLNet encodes text and video separately for efficiency, its retrieval accuracy is comparable with baselines adopting cross-modal interaction learning.","url_abs":"https://arxiv.org/abs/2105.06247v1","url_pdf":"https://arxiv.org/pdf/2105.06247v1.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":"video-corpus-moment-retrieval-with","repo_url":"https://github.com/IsaacChanghau/ReLoCLNet","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"contrastive-learning","task_name":"Contrastive Learning"},{"task_slug":"moment-retrieval","task_name":"Moment Retrieval"},{"task_slug":"retrieval","task_name":"Retrieval"},{"task_slug":"video-corpus-moment-retrieval","task_name":"Video Corpus Moment Retrieval"}],"methods":[{"method_slug":"contrastive-learning","method_name":"Contrastive Learning"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2105.06247","atlas_url":"https://app.syntology.ai/?focus=2105.06247","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2105.06247"}},"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/IsaacChanghau/ReLoCLNet","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":9,"ran_honours":1,"unverified":4},"by_repo_kind":{"listed":{"samples":14,"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":0,"samples":[{"code_sha256_prefix":"74637d0535a2a594","entry":"compute_overlap","repo":"IsaacChanghau/ReLoCLNet","repo_kind":"listed","path":"utils/basic_utils.py","file_url":"https://github.com/IsaacChanghau/ReLoCLNet/blob/HEAD/utils/basic_utils.py","link_basis":"harvester_set","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":"74637d0535a2a594"}},{"code_sha256_prefix":"ea2ba2c075c6b18b","entry":"compute_temporal_iou","repo":"IsaacChanghau/ReLoCLNet","repo_kind":"listed","path":"utils/temporal_nms.py","file_url":"https://github.com/IsaacChanghau/ReLoCLNet/blob/HEAD/utils/temporal_nms.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":"ea2ba2c075c6b18b"}},{"code_sha256_prefix":"4f45aaa5d5ee3903","entry":"get_negative_expectation","repo":"IsaacChanghau/ReLoCLNet","repo_kind":"listed","path":"method_tvr/contrastive.py","file_url":"https://github.com/IsaacChanghau/ReLoCLNet/blob/HEAD/method_tvr/contrastive.py","link_basis":"harvester_set","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":"4f45aaa5d5ee3903"}},{"code_sha256_prefix":"d71a913407877e0a","entry":"get_positive_expectation","repo":"IsaacChanghau/ReLoCLNet","repo_kind":"listed","path":"method_tvr/contrastive.py","file_url":"https://github.com/IsaacChanghau/ReLoCLNet/blob/HEAD/method_tvr/contrastive.py","link_basis":"harvester_set","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":"d71a913407877e0a"}},{"code_sha256_prefix":"1c17153fb5488283","entry":"mask_logits","repo":"IsaacChanghau/ReLoCLNet","repo_kind":"listed","path":"method_tvr/model.py","file_url":"https://github.com/IsaacChanghau/ReLoCLNet/blob/HEAD/method_tvr/model.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1c17153fb5488283"}},{"code_sha256_prefix":"286f821a3988fcbe","entry":"pool_across_time","repo":"IsaacChanghau/ReLoCLNet","repo_kind":"listed","path":"utils/model_utils.py","file_url":"https://github.com/IsaacChanghau/ReLoCLNet/blob/HEAD/utils/model_utils.py","link_basis":"harvester_set","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":"286f821a3988fcbe"}},{"code_sha256_prefix":"493ba890112a446e","entry":"prepare_batch_inputs","repo":"IsaacChanghau/ReLoCLNet","repo_kind":"listed","path":"method_tvr/start_end_dataset.py","file_url":"https://github.com/IsaacChanghau/ReLoCLNet/blob/HEAD/method_tvr/start_end_dataset.py","link_basis":"harvester_set","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":"493ba890112a446e"}},{"code_sha256_prefix":"d235ed6d33e43a98","entry":"temporal_non_maximum_suppression","repo":"IsaacChanghau/ReLoCLNet","repo_kind":"listed","path":"utils/temporal_nms.py","file_url":"https://github.com/IsaacChanghau/ReLoCLNet/blob/HEAD/utils/temporal_nms.py","link_basis":"harvester_set","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":"d235ed6d33e43a98"}},{"code_sha256_prefix":"65345dbb8096725d","entry":"time_to_index","repo":"IsaacChanghau/ReLoCLNet","repo_kind":"listed","path":"utils/basic_utils.py","file_url":"https://github.com/IsaacChanghau/ReLoCLNet/blob/HEAD/utils/basic_utils.py","link_basis":"harvester_set","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":"65345dbb8096725d"}},{"code_sha256_prefix":"2429bc2313c0669b","entry":"uniform_feature_sampling","repo":"IsaacChanghau/ReLoCLNet","repo_kind":"listed","path":"utils/basic_utils.py","file_url":"https://github.com/IsaacChanghau/ReLoCLNet/blob/HEAD/utils/basic_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":"2429bc2313c0669b"}},{"code_sha256_prefix":"edb929dece68582e","entry":"count_parameters","repo":"IsaacChanghau/ReLoCLNet","repo_kind":"listed","path":"utils/model_utils.py","file_url":"https://github.com/IsaacChanghau/ReLoCLNet/blob/HEAD/utils/model_utils.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":"edb929dece68582e"}},{"code_sha256_prefix":"381069cbe9170bdd","entry":"get_proposal_interface","repo":"IsaacChanghau/ReLoCLNet","repo_kind":"listed","path":"method_tvr/proposal.py","file_url":"https://github.com/IsaacChanghau/ReLoCLNet/blob/HEAD/method_tvr/proposal.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":"381069cbe9170bdd"}},{"code_sha256_prefix":"80b5572ac3d22dd3","entry":"log_sum_exp","repo":"IsaacChanghau/ReLoCLNet","repo_kind":"listed","path":"method_tvr/contrastive.py","file_url":"https://github.com/IsaacChanghau/ReLoCLNet/blob/HEAD/method_tvr/contrastive.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":"80b5572ac3d22dd3"}},{"code_sha256_prefix":"23b5db90923f7386","entry":"onehot","repo":"IsaacChanghau/ReLoCLNet","repo_kind":"listed","path":"method_tvr/model_components.py","file_url":"https://github.com/IsaacChanghau/ReLoCLNet/blob/HEAD/method_tvr/model_components.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":"23b5db90923f7386"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}