{"id":13737961,"url":"https://github.com/TACJu/Bi-Sampling","last_synced_at":"2025-05-08T15:32:07.578Z","repository":{"id":54608364,"uuid":"372687259","full_name":"TACJu/Bi-Sampling","owner":"TACJu","description":"This is the official PyTorch implementation of the paper \"Rethinking Re-Sampling in Imbalanced Semi-Supervised Learning\" (Ju He, Adam Kortylewski, Shaokang Yang, Shuai Liu, Cheng Yang, Changhu Wang, Alan Yuille).","archived":false,"fork":false,"pushed_at":"2021-11-18T20:12:47.000Z","size":18,"stargazers_count":27,"open_issues_count":1,"forks_count":2,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-11-15T06:32:56.854Z","etag":null,"topics":["imbalanced-classification","semi-supervised-learning"],"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/TACJu.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}},"created_at":"2021-06-01T03:10:59.000Z","updated_at":"2024-10-30T07:17:15.000Z","dependencies_parsed_at":"2022-08-13T21:20:34.896Z","dependency_job_id":null,"html_url":"https://github.com/TACJu/Bi-Sampling","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/TACJu%2FBi-Sampling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TACJu%2FBi-Sampling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TACJu%2FBi-Sampling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TACJu%2FBi-Sampling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TACJu","download_url":"https://codeload.github.com/TACJu/Bi-Sampling/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253096287,"owners_count":21853571,"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":["imbalanced-classification","semi-supervised-learning"],"created_at":"2024-08-03T03:02:07.230Z","updated_at":"2025-05-08T15:32:07.288Z","avatar_url":"https://github.com/TACJu.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Rethinking Re-Sampling in Imbalanced Semi-Supervised Learning\n\n## Dependencies\n\n* `python3`\n* `pytorch`\n* `torchvision`\n* `randAugment (Pytorch re-implementation: https://github.com/ildoonet/pytorch-randaugment)`\n\n### Command for reproducing results in the paper \nTo train a model on CIFAR-10 with imbalanced ratio $\\beta$ = 100,  unlabeled ratio $\\lambda$ = 2, random sampler for labeled data and random sampler for unlabeled data\n```\npython3 fix_train.py --gpu 0 --dataset cifar10 --imb_ratio 100 --ratio 2 \\\n--sampler random --semi-sampler random --out cifar10_fix_100_2_random_random\n```\n\nTo fine-tune a model (here the model trained with above command) on CIFAR-10 with imbalanced ratio $\\beta$ = 100,  unlabeled ratio $\\lambda$ = 2, mean sampler for labeled data and mean sampler for unlabeled data\n```\npython3 fix_finetune.py --gpu 0 --dataset cifar10 --imb_ratio 100 --ratio 2 \\\n--sampler mean --semi-sampler mean --resume cifar10_fix_100_2_random_random/checkpoint.pth.tar --out cifar10_fix_100_2_random_random_stage2\n```\n\nTo train a Bi-Sampling model on CIFAR-10 with imbalanced ratio $\\beta$ = 100,  unlabeled ratio $\\lambda$ = 2, random sampler + random sampler for the first stage and mean sampler + mean sampler for the second stage\n```\npython3 fix_BiS.py --gpu 0 --dataset cifar10 --imb_ratio 100 --ratio 2 \\\n--sampler1 random --semi-sampler1 random --sampler2 mean --semi-sampler2 mean --out cifar10_fix_100_2_BiS\n```\n\nTo analyze the per-class precision and recall of a pertained model on CIFAR-10 with imbalanced ratio $\\beta$ = 100,  unlabeled ratio $\\lambda$ = 2\n\n```\npython3 fix_analysis.py --gpu 0 --dataset cifar10 --imb_ratio 100 --ratio 2 \\\n--resume cifar10_fix_100_2_BiS/checkpoint.pth.tar\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTACJu%2FBi-Sampling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTACJu%2FBi-Sampling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTACJu%2FBi-Sampling/lists"}