{"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-better-time-series-contrastive","title":"Towards Enhancing Time Series Contrastive Learning: A Dynamic Bad Pair Mining Approach","arxiv_id":"2302.03357","date":"2023-02-07","proceeding":null,"authors":["Xiang Lan","Hanshu Yan","Shenda Hong","Mengling Feng"],"abstract":"Not all positive pairs are beneficial to time series contrastive learning. In this paper, we study two types of bad positive pairs that can impair the quality of time series representation learned through contrastive learning: the noisy positive pair and the faulty positive pair. We observe that, with the presence of noisy positive pairs, the model tends to simply learn the pattern of noise (Noisy Alignment). Meanwhile, when faulty positive pairs arise, the model wastes considerable amount of effort aligning non-representative patterns (Faulty Alignment). To address this problem, we propose a Dynamic Bad Pair Mining (DBPM) algorithm, which reliably identifies and suppresses bad positive pairs in time series contrastive learning. Specifically, DBPM utilizes a memory module to dynamically track the training behavior of each positive pair along training process. This allows us to identify potential bad positive pairs at each epoch based on their historical training behaviors. The identified bad pairs are subsequently down-weighted through a transformation module, thereby mitigating their negative impact on the representation learning process. DBPM is a simple algorithm designed as a lightweight plug-in without learnable parameters to enhance the performance of existing state-of-the-art methods. Through extensive experiments conducted on four large-scale, real-world time series datasets, we demonstrate DBPM's efficacy in mitigating the adverse effects of bad positive pairs.","url_abs":"https://arxiv.org/abs/2302.03357v3","url_pdf":"https://arxiv.org/pdf/2302.03357v3.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-better-time-series-contrastive","repo_url":"https://github.com/lanxiang1017/dynamicbadpairmining_iclr24","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"contrastive-learning","task_name":"Contrastive Learning"},{"task_slug":"representation-learning","task_name":"Representation Learning"},{"task_slug":"time-series-1","task_name":"Time Series"},{"task_slug":"time-series","task_name":"Time Series Analysis"}],"methods":[{"method_slug":"contrastive-learning","method_name":"Contrastive Learning"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2302.03357","atlas_url":"https://app.syntology.ai/?focus=2302.03357","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2302.03357"}},"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/lanxiang1017/dynamicbadpairmining_iclr24","reach":null}],"summary":{"ran":4,"ran_draft_wrong":2,"ran_fixture":1,"unverified":2},"by_repo_kind":{"official":{"samples":9,"ran":7,"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":9,"samples":[{"code_sha256_prefix":"97f4b7a71f2a6dc1","entry":"BasicBlock","repo":"lanxiang1017/dynamicbadpairmining_iclr24","repo_kind":"official","path":"models/dbpm_model.py","file_url":"https://github.com/lanxiang1017/dynamicbadpairmining_iclr24/blob/HEAD/models/dbpm_model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"97f4b7a71f2a6dc1"}},{"code_sha256_prefix":"13196a05922a4556","entry":"InfoNCE","repo":"lanxiang1017/dynamicbadpairmining_iclr24","repo_kind":"official","path":"models/dbpm_model.py","file_url":"https://github.com/lanxiang1017/dynamicbadpairmining_iclr24/blob/HEAD/models/dbpm_model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"13196a05922a4556"}},{"code_sha256_prefix":"070f933207345be3","entry":"LinearClassifier","repo":"lanxiang1017/dynamicbadpairmining_iclr24","repo_kind":"official","path":"models/dbpm_model.py","file_url":"https://github.com/lanxiang1017/dynamicbadpairmining_iclr24/blob/HEAD/models/dbpm_model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"070f933207345be3"}},{"code_sha256_prefix":"d18829d3a6df39e9","entry":"ResNet","repo":"lanxiang1017/dynamicbadpairmining_iclr24","repo_kind":"official","path":"models/dbpm_model.py","file_url":"https://github.com/lanxiang1017/dynamicbadpairmining_iclr24/blob/HEAD/models/dbpm_model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d18829d3a6df39e9"}},{"code_sha256_prefix":"3a802f69ecd390d5","entry":"ResNet34","repo":"lanxiang1017/dynamicbadpairmining_iclr24","repo_kind":"official","path":"models/dbpm_model.py","file_url":"https://github.com/lanxiang1017/dynamicbadpairmining_iclr24/blob/HEAD/models/dbpm_model.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":"3a802f69ecd390d5"}},{"code_sha256_prefix":"c18b03944ec98848","entry":"get_scores","repo":"lanxiang1017/dynamicbadpairmining_iclr24","repo_kind":"official","path":"models/dbpm_model.py","file_url":"https://github.com/lanxiang1017/dynamicbadpairmining_iclr24/blob/HEAD/models/dbpm_model.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":"c18b03944ec98848"}},{"code_sha256_prefix":"1743b3639fe9448a","entry":"loss_ntxent","repo":"lanxiang1017/dynamicbadpairmining_iclr24","repo_kind":"official","path":"models/dbpm_model.py","file_url":"https://github.com/lanxiang1017/dynamicbadpairmining_iclr24/blob/HEAD/models/dbpm_model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1743b3639fe9448a"}},{"code_sha256_prefix":"c995c24f3dfc702c","entry":"save_model","repo":"lanxiang1017/dynamicbadpairmining_iclr24","repo_kind":"official","path":"models/dbpm_model.py","file_url":"https://github.com/lanxiang1017/dynamicbadpairmining_iclr24/blob/HEAD/models/dbpm_model.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":"c995c24f3dfc702c"}},{"code_sha256_prefix":"e99558104673f3e0","entry":"simpleModel","repo":"lanxiang1017/dynamicbadpairmining_iclr24","repo_kind":"official","path":"models/dbpm_model.py","file_url":"https://github.com/lanxiang1017/dynamicbadpairmining_iclr24/blob/HEAD/models/dbpm_model.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":"e99558104673f3e0"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}