{"id":20572949,"url":"https://github.com/giakoumoglou/synco","last_synced_at":"2026-02-14T23:02:30.334Z","repository":{"id":262692477,"uuid":"821943286","full_name":"giakoumoglou/synco","owner":"giakoumoglou","description":"[arXiv 2024] PyTorch implementation of SynCo: https://arxiv.org/abs/2410.02401","archived":false,"fork":false,"pushed_at":"2025-03-19T14:55:10.000Z","size":1049,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-14T17:31:50.212Z","etag":null,"topics":["computer-vision","contrastive-learning","deep-learning","pytorch","representation-learning","self-supervised-learning","unsupervised-learning"],"latest_commit_sha":null,"homepage":"https://giakoumoglou.com/src/synco.pdf","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/giakoumoglou.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,"zenodo":null}},"created_at":"2024-06-29T21:45:08.000Z","updated_at":"2025-03-19T14:55:13.000Z","dependencies_parsed_at":"2024-11-13T19:32:02.255Z","dependency_job_id":"5eea7cff-e985-49af-8325-3659d58e05c0","html_url":"https://github.com/giakoumoglou/synco","commit_stats":null,"previous_names":["giakoumoglou/synco"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/giakoumoglou/synco","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giakoumoglou%2Fsynco","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giakoumoglou%2Fsynco/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giakoumoglou%2Fsynco/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giakoumoglou%2Fsynco/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/giakoumoglou","download_url":"https://codeload.github.com/giakoumoglou/synco/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giakoumoglou%2Fsynco/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29460136,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T22:42:09.113Z","status":"ssl_error","status_checked_at":"2026-02-14T22:42:05.053Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["computer-vision","contrastive-learning","deep-learning","pytorch","representation-learning","self-supervised-learning","unsupervised-learning"],"created_at":"2024-11-16T05:24:50.089Z","updated_at":"2026-02-14T23:02:30.316Z","avatar_url":"https://github.com/giakoumoglou.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## _SynCo_: Synthetic Hard Negatives for Contrastive Visual Representation Learning\n\nThis is a PyTorch implementation of the [SynCo paper](https://arxiv.org/abs/2410.02401):\n```\n@misc{giakoumoglou2024synco,\n  author  = {Nikolaos Giakoumoglou and Tania Stathaki},\n  title   = {SynCo: Synthetic Hard Negatives for Contrastive Visual Representation Learning},\n  journal = {arXiv preprint arXiv:2410.02401},\n  year    = {2024},\n}\n```\n\n### Preparation\n\nInstall PyTorch and ImageNet dataset following the [official PyTorch ImageNet training code](https://github.com/pytorch/examples/tree/master/imagenet).\n\nThis repo is based on [MoCo v2](https://github.com/facebookresearch/moco) and [Barlow Twins](https://github.com/facebookresearch/barlowtwins) code:\n```\ndiff main_synco.py \u003c(curl https://raw.githubusercontent.com/facebookresearch/moco/main_moco.py)\ndiff main_lincls.py \u003c(curl https://raw.githubusercontent.com/facebookresearch/moco/main_lincls.py)\ndiff main_semisup.py \u003c(curl https://raw.githubusercontent.com/facebookresearch/barlowtwins/evaluate.py)\n```\n\n### Unsupervised Training\n\nThis implementation only supports **multi-gpu**, **DistributedDataParallel** training, which is faster and simpler; single-gpu or DataParallel training is not supported.\n\nTo do unsupervised pre-training of a ResNet-50 model on ImageNet in an 8-gpu machine, run:\n```\npython main_synco.py \\\n  -a resnet50 \\\n  --lr 0.03 \\\n  --batch-size 256 \\\n  --dist-url 'tcp://localhost:10001' --multiprocessing-distributed --world-size 1 --rank 0 \\\n  --mlp --moco-t 0.2 --aug-plus --cos \\\n  --n-hard 1024 --n1 256 --n2 256 --n3 256 --n4 64 --n5 64 --n6 64 \\\n  [your imagenet-folder with train and val folders]\n```\n\nThis script uses all the default hyper-parameters as described in the [MoCo v2 paper](https://arxiv.org/abs/1911.05722).\n\n### Linear Classification\n\nWith a pre-trained model, to train a supervised linear classifier on frozen features/weights in an 8-gpu machine, run:\n```\npython main_lincls.py \\\n  -a resnet50 \\\n  --lr 30.0 \\\n  --batch-size 256 \\\n  --pretrained [your checkpoint path]/checkpoint_0199.pth.tar \\\n  --dist-url 'tcp://localhost:10001' --multiprocessing-distributed --world-size 1 --rank 0 \\\n  [your imagenet-folder with train and val folders]\n```\n\nThis script uses all the default hyper-parameters as described in the [MoCo v2 paper](https://arxiv.org/abs/1911.05722).\n\n### Semi-supervised Learning\n\nTo fine-tune the model end-to-end, including training a linear classifier on features/weights using a pre-trained model on an 8-GPU machine with a subset of the ImageNet training set, run:\n```\npython main_semisup.py \\\n  -a resnet50 \\\n  --lr-backbone [YOUR_LR] --lr-classifier [YOUR_LR] \\\n  --train-percent 1 --weights finetune \\\n  --batch-size 256 \\\n  --pretrained [your checkpoint path]/checkpoint_0199.pth.tar \\\n  --dist-url 'tcp://localhost:10001' --multiprocessing-distributed --world-size 1 --rank 0 \\\n  [your imagenet-folder with train and val folders]\n```\n\n### Transferring to Object Detection\n\nSee [./detection](detection).\n\n### Models\n\nOur pre-trained ResNet-50 models can be downloaded as follows:\n\n\u003ctable\u003e\n\u003ctbody\u003e\n\u003c!-- START TABLE --\u003e\n\u003c!-- TABLE HEADER --\u003e\n\u003cth valign=\"bottom\"\u003e\u003c/th\u003e\n\u003cth valign=\"bottom\"\u003eepochs\u003c/th\u003e\n\u003cth valign=\"bottom\"\u003etop-1 acc.\u003c/th\u003e\n\u003cth valign=\"bottom\"\u003emodel\u003c/th\u003e\n\u003c!-- TABLE BODY --\u003e\n\u003ctr\u003e\n\u003ctd align=\"left\"\u003e\u003ca href=\"https://arxiv.org/abs/2410.02401\"\u003eSynCo\u003c/a\u003e\u003c/td\u003e\n\u003ctd align=\"center\"\u003e200\u003c/td\u003e\n\u003ctd align=\"center\"\u003e68.1\u003c/td\u003e\n\u003ctd align=\"center\"\u003e\u003ca href=\"https://drive.google.com/file/d/1sdc9Q5zIOdyEEL47pq9aJrCkrN6RVPOe/view?usp=drive_link\"\u003edownload\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd align=\"left\"\u003e\u003ca href=\"https://arxiv.org/abs/2410.02401\"\u003eSynCo\u003c/a\u003e\u003c/td\u003e\n\u003ctd align=\"center\"\u003e800\u003c/td\u003e\n\u003ctd align=\"center\"\u003e70.7\u003c/td\u003e\n\u003ctd align=\"center\"\u003e\u003ca href=\"https://drive.google.com/file/d/1ZOoUmB6slrQxGRA9AdaCeIN3J-r6NaWI/view?usp=drive_link\"\u003edownload\u003c/a\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n### License\n\nThis project is under the CC-BY-NC 4.0 license. See [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiakoumoglou%2Fsynco","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiakoumoglou%2Fsynco","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiakoumoglou%2Fsynco/lists"}