{"id":18004725,"url":"https://github.com/oscarknagg/adversarial","last_synced_at":"2025-08-23T03:35:06.437Z","repository":{"id":96853517,"uuid":"160429690","full_name":"oscarknagg/adversarial","owner":"oscarknagg","description":"Creating and defending against adversarial examples","archived":false,"fork":false,"pushed_at":"2019-01-06T23:35:11.000Z","size":88464,"stargazers_count":42,"open_issues_count":0,"forks_count":17,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-07T08:14:37.781Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oscarknagg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-12-04T22:59:01.000Z","updated_at":"2023-06-30T22:14:43.000Z","dependencies_parsed_at":"2023-05-28T11:31:10.257Z","dependency_job_id":null,"html_url":"https://github.com/oscarknagg/adversarial","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oscarknagg/adversarial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarknagg%2Fadversarial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarknagg%2Fadversarial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarknagg%2Fadversarial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarknagg%2Fadversarial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oscarknagg","download_url":"https://codeload.github.com/oscarknagg/adversarial/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscarknagg%2Fadversarial/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271737991,"owners_count":24812238,"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-08-23T02:00:09.327Z","response_time":69,"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":"2024-10-30T00:15:35.151Z","updated_at":"2025-08-23T03:35:05.792Z","avatar_url":"https://github.com/oscarknagg.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# adversarial\n\nThis repository contains PyTorch code to create and defend against\nadversarial attacks.\n\nSee [this Medium article](https://towardsdatascience.com/know-your-enemy-7f7c5038bdf3)\nfor a discussion on how to use and defend against\nthe projected gradient attack.\n\nExample adversarial attack created using this repo.\n\n![PGD Attack](https://github.com/oscarknagg/adversarial/blob/master/assets/pgd_attack_imagenet_example.png)\n\n\nCool fact - adversarially trained discriminative (_not generative!_)\nmodels can be used to interpolate between classes by creating\nlarge-epsilon adversarial examples against them.\n\n![MNIST Class Interpolation](https://media.giphy.com/media/NlGeQeG4jUViIcZRAD/giphy.gif)\n\n# Contents\n\n- A Jupyter notebook demonstrating how to use and defend against\nthe projected gradient attack (see `notebooks/`)\n\n- `adversarial.functional` contains functional style implementations of\na view different types of adversarial attacks\n    - Fast Gradient Sign Method - white box - batch implementation\n    - Projected Gradient Descent - white box - batch implementation\n    - Local-search attack - black box, score-based - single image\n    - Boundary attack - black box, decision-based - single imagae\n\n\n# Setup\n## Requirements\n\nListed in `requirements.txt`. Install with\n`pip install -r requirements.txt` preferably in a virtualenv.\n\n## Tests (optional)\n\nRun `pytest` in the root directory to run all tests.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foscarknagg%2Fadversarial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foscarknagg%2Fadversarial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foscarknagg%2Fadversarial/lists"}