{"id":18800565,"url":"https://github.com/xtra-computing/fedov","last_synced_at":"2025-04-13T17:31:19.780Z","repository":{"id":86257178,"uuid":"484888804","full_name":"Xtra-Computing/FedOV","owner":"Xtra-Computing","description":"Towards Addressing Label Skews in One-Shot Federated Learning (ICLR 2023)","archived":false,"fork":false,"pushed_at":"2023-11-02T05:40:47.000Z","size":113,"stargazers_count":17,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T08:22:31.919Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Xtra-Computing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-24T00:43:06.000Z","updated_at":"2024-12-13T13:40:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"1fd74426-bc2e-450d-ad95-aa51ab94404a","html_url":"https://github.com/Xtra-Computing/FedOV","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xtra-Computing%2FFedOV","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xtra-Computing%2FFedOV/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xtra-Computing%2FFedOV/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xtra-Computing%2FFedOV/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Xtra-Computing","download_url":"https://codeload.github.com/Xtra-Computing/FedOV/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248752375,"owners_count":21156080,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T22:19:07.951Z","updated_at":"2025-04-13T17:31:19.496Z","avatar_url":"https://github.com/Xtra-Computing.png","language":"Python","readme":"# FedOV\n\nThis is source code for paper [Towards Addressing Label Skews in One-Shot Federated Learning](https://openreview.net/pdf?id=rzrqh85f4Sc). \n\nAn example running script of FedOV is in `run.sh`. \n\n| Parameter                      | Description                                 |\n| ----------------------------- | ---------------------------------------- |\n| `model` | The model architecture. Options: `simple-cnn`, `vgg`, `resnet`, `mlp`. Default = `mlp`. |\n| `dataset`      | Dataset to use. Options: `mnist`, `cifar10`, `fmnist`, `svhn`|\n| `alg` | The training algorithm. Options: `vote`. |\n| `lr` | Learning rate for the local models, default = `0.01`. |\n| `batch-size` | Batch size, default = `64`. |\n| `epochs` | Number of local training epochs, default = `5`. |\n| `n_parties` | Number of parties, default = `2`. |\n| `comm_round` | Should be `1` for one-shot FL. |\n| `partition`    | The partition way. Options: `homo`, `noniid-labeldir`, `noniid-#label1` (or 2, 3, ..., which means the fixed number of labels each party owns)|\n| `beta` | The concentration parameter of the Dirichlet distribution for heterogeneous partition, default = `0.5`. |\n| `device` | Specify the device to run the program, default = `cuda:0`. |\n| `datadir` | The path of the dataset, default = `./data/`. |\n| `logdir` | The path to store the logs, default = `./logs/`. |\n| `init_seed` | The initial seed, default = `0`. |\n\nSome repos we refer to\n\nGeneral framework: https://github.com/Xtra-Computing/NIID-Bench\n\nAdversarial attacks: directly use https://github.com/utkuozbulak/pytorch-cnn-adversarial-attacks\n\nCutpaste: use an unofficial reproduction from https://github.com/Runinho/pytorch-cutpaste. The authors of Cutpaste do not make code public.\n\nAlso include code from https://github.com/lwneal/counterfactual-open-set which is the code by authors of Open Set Learning with Counterfactal Images, ECCV 2018. However, since our FL partition settings are more diverse and complicated, we find it very hard to tune the hyper-parameters to generate good counterfactual images and the voting accuracy is low, so we do not call it in the final version. \n\nIn our code, we keep the commented or unused codes (functions). We tried these but did not get good results. After many trails and errors, we summarize the current DD and AOE functions. These trials may save efforts or bring some insights for future researchers, so we keep them. \n\nFor ResNet-50 experiments, since ResNet-50 has batch normalization layers, we have to mix train data and generated outliers in a batch, otherwise the model will become very bad. Please see folder `resnet_code`. Codes are like the following\n```\nx_con = torch.cat([x,x_gen11],dim=0)\ny_con = torch.cat([target,y_gen],dim=0)\nloss = criterion(out, y_con)\n```\n\nIf you find our work useful, please cite\n```\n@inproceedings{\ndiao2023towards,\ntitle={Towards Addressing Label Skews in One-Shot Federated Learning},\nauthor={Yiqun Diao and Qinbin Li and Bingsheng He},\nbooktitle={International Conference on Learning Representations},\nyear={2023},\nurl={https://openreview.net/forum?id=rzrqh85f4Sc}\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtra-computing%2Ffedov","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxtra-computing%2Ffedov","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtra-computing%2Ffedov/lists"}