{"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/fedbn-federated-learning-on-non-iid-features-1","title":"FedBN: Federated Learning on Non-IID Features via Local Batch Normalization","arxiv_id":"2102.07623","date":"2021-02-15","proceeding":"ICLR 2021 1","authors":["Xiaoxiao Li","Meirui Jiang","Xiaofei Zhang","Michael Kamp","Qi Dou"],"abstract":"The emerging paradigm of federated learning (FL) strives to enable collaborative training of deep models on the network edge without centrally aggregating raw data and hence improving data privacy. In most cases, the assumption of independent and identically distributed samples across local clients does not hold for federated learning setups. Under this setting, neural network training performance may vary significantly according to the data distribution and even hurt training convergence. Most of the previous work has focused on a difference in the distribution of labels or client shifts. Unlike those settings, we address an important problem of FL, e.g., different scanners/sensors in medical imaging, different scenery distribution in autonomous driving (highway vs. city), where local clients store examples with different distributions compared to other clients, which we denote as feature shift non-iid. In this work, we propose an effective method that uses local batch normalization to alleviate the feature shift before averaging models. The resulting scheme, called FedBN, outperforms both classical FedAvg, as well as the state-of-the-art for non-iid data (FedProx) on our extensive experiments. These empirical results are supported by a convergence analysis that shows in a simplified setting that FedBN has a faster convergence rate than FedAvg. Code is available at https://github.com/med-air/FedBN.","url_abs":"https://arxiv.org/abs/2102.07623v2","url_pdf":"https://arxiv.org/pdf/2102.07623v2.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":"fedbn-federated-learning-on-non-iid-features-1","repo_url":"https://github.com/adap/flower","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"tf","reach":null},{"paper_slug":"fedbn-federated-learning-on-non-iid-features-1","repo_url":"https://github.com/med-air/FedBN","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null},{"paper_slug":"fedbn-federated-learning-on-non-iid-features-1","repo_url":"https://github.com/KarhouTam/FL-bench","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"GPL-3.0"}},{"paper_slug":"fedbn-federated-learning-on-non-iid-features-1","repo_url":"https://github.com/TsingZ0/PFL-Non-IID","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"autonomous-driving","task_name":"Autonomous Driving"},{"task_slug":"federated-learning","task_name":"Federated Learning"}],"methods":[{"method_slug":"batch-normalization","method_name":"Batch Normalization"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2102.07623","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2102.07623"}},"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/med-air/FedBN","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/adap/flower","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/TsingZ0/PFL-Non-IID","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/KarhouTam/FL-bench","reach":{"status":"ok","spdx":"GPL-3.0"}}],"summary":{"ran":3,"ran_honours":2,"ran_draft_wrong":1,"ran_fixture":1,"unverified":6},"by_repo_kind":{"official":{"samples":6,"ran":2,"repositories":2},"listed":{"samples":7,"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":5,"samples":[{"code_sha256_prefix":"e0e85ded6bac75d2","entry":"CNNModel","repo":"adap/flower","repo_kind":"official","path":"baselines/fedbn/fedbn/model.py","file_url":"https://github.com/adap/flower/blob/HEAD/baselines/fedbn/fedbn/model.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":"e0e85ded6bac75d2"}},{"code_sha256_prefix":"2bdfc3745f9a344e","entry":"Client","repo":"TsingZ0/PFL-Non-IID","repo_kind":"listed","path":"system/flcore/servers/serverbn.py","file_url":"https://github.com/TsingZ0/PFL-Non-IID/blob/HEAD/system/flcore/servers/serverbn.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":"2bdfc3745f9a344e"}},{"code_sha256_prefix":"29ee58bca6b7aa74","entry":"DLG","repo":"TsingZ0/PFL-Non-IID","repo_kind":"listed","path":"system/flcore/servers/serverbn.py","file_url":"https://github.com/TsingZ0/PFL-Non-IID/blob/HEAD/system/flcore/servers/serverbn.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":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"29ee58bca6b7aa74"}},{"code_sha256_prefix":"f39b0c07b54826f4","entry":"clientBN","repo":"TsingZ0/PFL-Non-IID","repo_kind":"listed","path":"system/flcore/servers/serverbn.py","file_url":"https://github.com/TsingZ0/PFL-Non-IID/blob/HEAD/system/flcore/servers/serverbn.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":"f39b0c07b54826f4"}},{"code_sha256_prefix":"417018913135e19a","entry":"psnr","repo":"TsingZ0/PFL-Non-IID","repo_kind":"listed","path":"system/flcore/servers/serverbn.py","file_url":"https://github.com/TsingZ0/PFL-Non-IID/blob/HEAD/system/flcore/servers/serverbn.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"417018913135e19a"}},{"code_sha256_prefix":"baa08f0b4e0d3a57","entry":"read_client_data","repo":"TsingZ0/PFL-Non-IID","repo_kind":"listed","path":"system/flcore/servers/serverbn.py","file_url":"https://github.com/TsingZ0/PFL-Non-IID/blob/HEAD/system/flcore/servers/serverbn.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":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"baa08f0b4e0d3a57"}},{"code_sha256_prefix":"c4c79d49a4db6ea4","entry":"stratified_split","repo":"med-air/FedBN","repo_kind":"official","path":"utils/data_preprocess.py","file_url":"https://github.com/med-air/FedBN/blob/HEAD/utils/data_preprocess.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c4c79d49a4db6ea4"}},{"code_sha256_prefix":"405bc33570a8c6b3","entry":"FedBN","repo":"TsingZ0/PFL-Non-IID","repo_kind":"listed","path":"system/flcore/servers/serverbn.py","file_url":"https://github.com/TsingZ0/PFL-Non-IID/blob/HEAD/system/flcore/servers/serverbn.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":"405bc33570a8c6b3"}},{"code_sha256_prefix":"ab6103d2a317e40a","entry":"Server","repo":"TsingZ0/PFL-Non-IID","repo_kind":"listed","path":"system/flcore/servers/serverbn.py","file_url":"https://github.com/TsingZ0/PFL-Non-IID/blob/HEAD/system/flcore/servers/serverbn.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":"ab6103d2a317e40a"}},{"code_sha256_prefix":"2fd0c777cb416959","entry":"communication","repo":"med-air/FedBN","repo_kind":"official","path":"federated/fed_domainnet.py","file_url":"https://github.com/med-air/FedBN/blob/HEAD/federated/fed_domainnet.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":"2fd0c777cb416959"}},{"code_sha256_prefix":"135b3dc835ffe6ad","entry":"get_confirm_token","repo":"med-air/FedBN","repo_kind":"official","path":"utils/data_preprocess.py","file_url":"https://github.com/med-air/FedBN/blob/HEAD/utils/data_preprocess.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":"135b3dc835ffe6ad"}},{"code_sha256_prefix":"ecb6e27008c12b2b","entry":"train","repo":"med-air/FedBN","repo_kind":"official","path":"federated/fed_digits.py","file_url":"https://github.com/med-air/FedBN/blob/HEAD/federated/fed_digits.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":"ecb6e27008c12b2b"}},{"code_sha256_prefix":"3c6e4c6321f0a002","entry":"train_fedprox","repo":"med-air/FedBN","repo_kind":"official","path":"federated/fed_digits.py","file_url":"https://github.com/med-air/FedBN/blob/HEAD/federated/fed_digits.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":"3c6e4c6321f0a002"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}