{"id":32976583,"url":"https://github.com/google/revisiting-self-supervised","last_synced_at":"2025-11-16T08:01:50.419Z","repository":{"id":65981497,"uuid":"167518008","full_name":"google/revisiting-self-supervised","owner":"google","description":null,"archived":true,"fork":false,"pushed_at":"2020-02-13T11:26:24.000Z","size":47,"stargazers_count":353,"open_issues_count":1,"forks_count":40,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-11-08T23:27:14.041Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-25T09:06:03.000Z","updated_at":"2025-10-31T08:12:48.000Z","dependencies_parsed_at":"2023-02-19T19:01:12.434Z","dependency_job_id":null,"html_url":"https://github.com/google/revisiting-self-supervised","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/google/revisiting-self-supervised","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Frevisiting-self-supervised","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Frevisiting-self-supervised/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Frevisiting-self-supervised/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Frevisiting-self-supervised/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/revisiting-self-supervised/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Frevisiting-self-supervised/sbom","scorecard":{"id":437814,"data":{"date":"2025-08-11","repo":{"name":"github.com/google/revisiting-self-supervised","commit":"b530e3b53312ed404a856e88f8c0b6dd9ebcfd4b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.2,"checks":[{"name":"Code-Review","score":2,"reason":"Found 1/4 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/google/.github/SECURITY.md:1","Info: Found linked content: github.com/google/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/google/.github/SECURITY.md:1","Info: Found text in security policy: github.com/google/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}}]},"last_synced_at":"2025-08-19T05:04:47.474Z","repository_id":65981497,"created_at":"2025-08-19T05:04:47.474Z","updated_at":"2025-08-19T05:04:47.474Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283962104,"owners_count":26923739,"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","status":"online","status_checked_at":"2025-11-12T02:00:06.336Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-11-13T06:00:31.219Z","updated_at":"2025-11-16T08:01:50.407Z","avatar_url":"https://github.com/google.png","language":"Python","funding_links":[],"categories":["Computer Vision"],"sub_categories":["Image Representation Learning"],"readme":"# Revisiting self-supervised visual representation learning\n\nTensorflow implementation of experiments from\n[our paper on unsupervised visual representation learning](http://arxiv.org/abs/1901.09005).\n\nIf you find this repository useful in your research, please consider citing:\n\n```\n@inproceedings{kolesnikov2019revisiting,\n    title={Revisiting self-supervised visual representation learning},\n    author={Kolesnikov, Alexander and Zhai, Xiaohua and Beyer, Lucas},\n    journal={The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},\n    month={June},\n    year={2019}\n}\n```\n\n## Overview\n\nThis codebase allows to reproduce core experiments from our paper. It contains\nour re-implementation of four self-supervised representation learning\ntechniques, utility code for running training and evaluation loops (including on\nTPUs) and an implementation of standard CNN models, such as ResNet v1, ResNet v2\nand VGG19.\n\nSpecifically, we provide a re-implementation of the following self-supervised\nrepresentation learning techniques:\n\n1.  [Unsupervised Representation Learning by Predicting Image Rotations](https://arxiv.org/abs/1803.07728)\n2.  [Unsupervised Visual Representation Learning by Context Prediction](https://arxiv.org/abs/1505.05192)\n3.  [Unsupervised Learning of Visual Representations by Solving Jigsaw Puzzles](https://arxiv.org/abs/1603.09246)\n4.  [Discriminative Unsupervised Feature Learning with Exemplar Convolutional\n    Neural Networks](https://arxiv.org/abs/1406.6909)\n\n## Usage instructions\n\nIn the paper we train self-supervised models using 32 or 128 TPU cores. We\nevaluate the resulting representations by training a logistic regression model\non 32 TPU cores.\n\nIn this codebase we provide configurations for training/evaluation of our models\nusing an 8 TPU core setup as this setup is more affordable for public TPU users\nthrough the Google Cloud API. These configurations produce results close to those\nreported in the paper, which used more TPU chips.\n\nFor debugging or running small experiments we also support training and\nevaluation using a single GPU device.\n\n### Preparing data\n\nPlease refer to the\n[instructions in the slim library](https://github.com/tensorflow/models/blob/master/research/inception/README.md#getting-started)\nfor downloading and preprocessing ImageNet data.\n\n### Clone the repository and install dependencies\n\n```\ngit clone https://github.com/google/revisiting-self-supervised\ncd revisiting-self-supervised\npython -m pip install -e . --user\n```\n\nWe depend on some external files that need to be downloaded and placed in the\nroot repository folder. You can run the following commands to download them:\n\n```\nwget https://raw.githubusercontent.com/tensorflow/models/master/research/slim/preprocessing/inception_preprocessing.py\nwget https://github.com/MehdiNoroozi/JigsawPuzzleSolver/raw/master/permutations_100_max.bin\n```\n\n### Running locally on a single GPU\n\nRun any experiment by running the corresponding shell script with the following\noptions, here exemplified for the fully supervised experiment:\n\n```\n./config/supervised/imagenet.sh \\\n  --workdir \u003cWORKING_DIRECTORY\u003e \\\n  --nouse_tpu \\\n  --master='' \\\n  --dataset_dir \u003cPREPROCESSED_IMAGENET_PATH\u003e\n```\n\n### Running on Google Cloud using TPUs\n\n#### Step 1:\n\nCreate your own TPU cloud instance by following the\n[official documentation](https://cloud.google.com/tpu/).\n\n#### Step 2:\n\nClone the repository and install dependencies as described above.\n\n#### Step 3:\n\nRun the self supervised model training script with TPUs. For example:\n\n```\ngsutil mb gs://\u003cWORKING_DIRECTORY\u003e\nexport TPU_NAME=\u003cTPU_PROJECT_NAME\u003e\nconfig/supervised/imagenet.sh --workdir gs://\u003cWORKING_DIRECTORY\u003e --dataset_dir gs://\u003cPREPROCESSED_IMAGENET_PATH\u003e\n```\n\nAfter/during training, run the self supervised model evaluation script with\nTPUs. It generates the loss and metric on the validation set, and exports a hub\nmodule under directory `gs://\u003cWORKING_DIRECTORY\u003e/export/hub/\u003cTIMESTAMP\u003e/module`:\n\n```\nconfig/supervised/imagenet.sh --workdir gs://\u003cWORKING_DIRECTORY\u003e --dataset_dir gs://\u003cPREPROCESSED_IMAGENET_PATH\u003e --run_eval\n```\n\nNote, that `\u003cTPU_PROJECT_NAME\u003e` is set by the user when creating the Cloud TPU\nnode. Moreover, ImageNet data and the working directory should be placed in a\nGoogle Cloud bucket storage.\n\n#### Step 4:\n\nEvaluates the self supervised models with logistic regression. You need to pass\nthe exported hub module from step 3 above as an additional argument:\n\n```\ngsutil mb gs://\u003cEVAL_DIRECTORY\u003e\nexport TPU_NAME=\u003cTPU_PROJECT_NAME\u003e\nconfig/evaluation/rotation_or_exemplar.sh --workdir gs://\u003cEVAL_DIRECTORY\u003e --dataset_dir gs://\u003cPREPROCESSED_IMAGENET_PATH\u003e --hub_module gs://\u003cPATH_TO_YOUR_HUB_MODULE\u003e\n\nconfig/evaluation/rotation_or_exemplar.sh --workdir gs://\u003cEVAL_DIRECTORY\u003e --dataset_dir gs://\u003cPREPROCESSED_IMAGENET_PATH\u003e --hub_module gs://\u003cPATH_TO_YOUR_HUB_MODULE\u003e --run_eval\n```\n\nYou could start a tensorboard to visualize the training/evaluation progress:\n\n```\ntensorboard --port 2222 --logdir gs://\u003cEVAL_DIRECTORY\u003e\n```\n\n## Pretrained models\n\nIf you want to download and try our best self-supervised models please see this [Ipython\nnotebook](https://colab.research.google.com/drive/1HdApkScZpulQrACrPKZiKYHhy7MeR3iN).\n\n\n## Authors\n\n- [Alexander Kolesnikov](https://github.com/kolesman)\n- [Xiaohua Zhai](https://sites.google.com/site/xzhai89/)\n- [Lucas Beyer](http://lucasb.eyer.be/)\n- [Marvin Ritter](https://github.com/Marvin182)\n\n### This is not an official Google product\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Frevisiting-self-supervised","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Frevisiting-self-supervised","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Frevisiting-self-supervised/lists"}