{"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/concernet-a-contrastive-learning-based","title":"ConCerNet: A Contrastive Learning Based Framework for Automated Conservation Law Discovery and Trustworthy Dynamical System Prediction","arxiv_id":"2302.05783","date":"2023-02-11","proceeding":null,"authors":["Wang Zhang","Tsui-Wei Weng","Subhro Das","Alexandre Megretski","Luca Daniel","Lam M. Nguyen"],"abstract":"Deep neural networks (DNN) have shown great capacity of modeling a dynamical system; nevertheless, they usually do not obey physics constraints such as conservation laws. This paper proposes a new learning framework named ConCerNet to improve the trustworthiness of the DNN based dynamics modeling to endow the invariant properties. ConCerNet consists of two steps: (i) a contrastive learning method to automatically capture the system invariants (i.e. conservation properties) along the trajectory observations; (ii) a neural projection layer to guarantee that the learned dynamics models preserve the learned invariants. We theoretically prove the functional relationship between the learned latent representation and the unknown system invariant function. Experiments show that our method consistently outperforms the baseline neural networks in both coordinate error and conservation metrics by a large margin. With neural network based parameterization and no dependence on prior knowledge, our method can be extended to complex and large-scale dynamics by leveraging an autoencoder.","url_abs":"https://arxiv.org/abs/2302.05783v4","url_pdf":"https://arxiv.org/pdf/2302.05783v4.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":"concernet-a-contrastive-learning-based","repo_url":"https://github.com/wz16/concernet","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"contrastive-learning","task_name":"Contrastive Learning"}],"methods":[{"method_slug":"contrastive-learning","method_name":"Contrastive Learning"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2302.05783","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2302.05783"}},"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/wz16/concernet","reach":null}],"summary":{"ran_honours":3,"ran_fixture":3,"unverified":1},"by_repo_kind":{"official":{"samples":6,"ran":5,"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":1,"samples":[{"code_sha256_prefix":"47e5596498a1fdfc","entry":"MSE","repo":"wz16/concernet","repo_kind":"official","path":"train_contrastive_conservation.py","file_url":"https://github.com/wz16/concernet/blob/HEAD/train_contrastive_conservation.py","link_basis":"first_harvest_node","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":"47e5596498a1fdfc"}},{"code_sha256_prefix":"f6b944f50d3f15ae","entry":"count_parameters","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"f6b944f50d3f15ae"}},{"code_sha256_prefix":"0610fd33a23e90cc","entry":"evaluate","repo":"wz16/concernet","repo_kind":"official","path":"simple_projection_layer_demo.py","file_url":"https://github.com/wz16/concernet/blob/HEAD/simple_projection_layer_demo.py","link_basis":"first_harvest_node","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":"0610fd33a23e90cc"}},{"code_sha256_prefix":"d88eb049773bf0df","entry":"square_ratio_loss","repo":"wz16/concernet","repo_kind":"official","path":"train_contrastive_conservation.py","file_url":"https://github.com/wz16/concernet/blob/HEAD/train_contrastive_conservation.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d88eb049773bf0df"}},{"code_sha256_prefix":"27532e4f2baa8924","entry":"train","repo":"wz16/concernet","repo_kind":"official","path":"train_dynamics.py","file_url":"https://github.com/wz16/concernet/blob/HEAD/train_dynamics.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"27532e4f2baa8924"}},{"code_sha256_prefix":"66fddeb650dafe32","entry":"train_traj_repre","repo":"wz16/concernet","repo_kind":"official","path":"train_contrastive_conservation.py","file_url":"https://github.com/wz16/concernet/blob/HEAD/train_contrastive_conservation.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"66fddeb650dafe32"}},{"code_sha256_prefix":"642d5b6e8bd5880b","entry":"get_data","repo":"wz16/concernet","repo_kind":"official","path":"simple_projection_layer_demo.py","file_url":"https://github.com/wz16/concernet/blob/HEAD/simple_projection_layer_demo.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":"642d5b6e8bd5880b"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}