{"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/fedtgp-trainable-global-prototypes-with","title":"FedTGP: Trainable Global Prototypes with Adaptive-Margin-Enhanced Contrastive Learning for Data and Model Heterogeneity in Federated Learning","arxiv_id":"2401.03230","date":"2024-01-06","proceeding":null,"authors":["Jianqing Zhang","Yang Liu","Yang Hua","Jian Cao"],"abstract":"Recently, Heterogeneous Federated Learning (HtFL) has attracted attention due to its ability to support heterogeneous models and data. To reduce the high communication cost of transmitting model parameters, a major challenge in HtFL, prototype-based HtFL methods are proposed to solely share class representatives, a.k.a, prototypes, among heterogeneous clients while maintaining the privacy of clients' models. However, these prototypes are naively aggregated into global prototypes on the server using weighted averaging, resulting in suboptimal global knowledge which negatively impacts the performance of clients. To overcome this challenge, we introduce a novel HtFL approach called FedTGP, which leverages our Adaptive-margin-enhanced Contrastive Learning (ACL) to learn Trainable Global Prototypes (TGP) on the server. By incorporating ACL, our approach enhances prototype separability while preserving semantic meaning. Extensive experiments with twelve heterogeneous models demonstrate that our FedTGP surpasses state-of-the-art methods by up to 9.08% in accuracy while maintaining the communication and privacy advantages of prototype-based HtFL. Our code is available at https://github.com/TsingZ0/FedTGP.","url_abs":"https://arxiv.org/abs/2401.03230v1","url_pdf":"https://arxiv.org/pdf/2401.03230v1.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":"fedtgp-trainable-global-prototypes-with","repo_url":"https://github.com/tsingz0/fedtgp","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"contrastive-learning","task_name":"Contrastive Learning"},{"task_slug":"federated-learning","task_name":"Federated Learning"}],"methods":[{"method_slug":"contrastive-learning","method_name":"Contrastive Learning"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2401.03230","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2401.03230"}},"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":"deterministic:regex_extraction","url":"https://github.com/TsingZ0/FedTGP","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/tsingz0/fedtgp","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":1,"ran_draft_wrong":2,"unverified":5},"by_repo_kind":{"official":{"samples":8,"ran":3,"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":"ac1be2fc541bc784","entry":"Trainable_Global_Prototypes","repo":"tsingz0/fedtgp","repo_kind":"official","path":"system/flcore/servers/servertgp.py","file_url":"https://github.com/tsingz0/fedtgp/blob/HEAD/system/flcore/servers/servertgp.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ac1be2fc541bc784"}},{"code_sha256_prefix":"34ebb1820a560b2b","entry":"agg_func","repo":"tsingz0/fedtgp","repo_kind":"official","path":"system/flcore/servers/servertgp.py","file_url":"https://github.com/tsingz0/fedtgp/blob/HEAD/system/flcore/servers/servertgp.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"34ebb1820a560b2b"}},{"code_sha256_prefix":"130f1778fd817237","entry":"proto_cluster","repo":"tsingz0/fedtgp","repo_kind":"official","path":"system/flcore/servers/servertgp.py","file_url":"https://github.com/tsingz0/fedtgp/blob/HEAD/system/flcore/servers/servertgp.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"130f1778fd817237"}},{"code_sha256_prefix":"9cffef012e449576","entry":"BaseHeadSplit","repo":"tsingz0/fedtgp","repo_kind":"official","path":"system/flcore/servers/servertgp.py","file_url":"https://github.com/tsingz0/fedtgp/blob/HEAD/system/flcore/servers/servertgp.py","link_basis":"first_harvest_node","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":"9cffef012e449576"}},{"code_sha256_prefix":"42de4e65658e7ceb","entry":"Client","repo":"tsingz0/fedtgp","repo_kind":"official","path":"system/flcore/servers/servertgp.py","file_url":"https://github.com/tsingz0/fedtgp/blob/HEAD/system/flcore/servers/servertgp.py","link_basis":"first_harvest_node","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":"42de4e65658e7ceb"}},{"code_sha256_prefix":"e3b929e7aa0f98ff","entry":"FedTGP","repo":"tsingz0/fedtgp","repo_kind":"official","path":"system/flcore/servers/servertgp.py","file_url":"https://github.com/tsingz0/fedtgp/blob/HEAD/system/flcore/servers/servertgp.py","link_basis":"first_harvest_node","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":"e3b929e7aa0f98ff"}},{"code_sha256_prefix":"03bdd9abb57b35ce","entry":"Server","repo":"tsingz0/fedtgp","repo_kind":"official","path":"system/flcore/servers/servertgp.py","file_url":"https://github.com/tsingz0/fedtgp/blob/HEAD/system/flcore/servers/servertgp.py","link_basis":"first_harvest_node","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":"03bdd9abb57b35ce"}},{"code_sha256_prefix":"a36d77b5524b396c","entry":"clientTGP","repo":"tsingz0/fedtgp","repo_kind":"official","path":"system/flcore/servers/servertgp.py","file_url":"https://github.com/tsingz0/fedtgp/blob/HEAD/system/flcore/servers/servertgp.py","link_basis":"first_harvest_node","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":"a36d77b5524b396c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}