{"id":15396615,"url":"https://github.com/hupe1980/torchadv","last_synced_at":"2026-01-28T06:07:43.699Z","repository":{"id":245744127,"uuid":"819076612","full_name":"hupe1980/torchadv","owner":"hupe1980","description":"🔥🛡️⚔️ Tiny package designed to support red teams and penetration testers in creating and analyzing adversarial attacks on PyTorch models.","archived":false,"fork":false,"pushed_at":"2024-06-28T09:25:38.000Z","size":6109,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T19:56:03.835Z","etag":null,"topics":["adversarial-attacks","cybersecurity","pytorch"],"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/hupe1980.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":"2024-06-23T17:54:50.000Z","updated_at":"2024-06-28T09:25:41.000Z","dependencies_parsed_at":"2024-06-28T10:41:03.871Z","dependency_job_id":null,"html_url":"https://github.com/hupe1980/torchadv","commit_stats":{"total_commits":14,"total_committers":2,"mean_commits":7.0,"dds":0.0714285714285714,"last_synced_commit":"396b6f287a3803dcf8efdca1248b1b6bea160595"},"previous_names":["hupe1980/torchadv"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hupe1980%2Ftorchadv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hupe1980%2Ftorchadv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hupe1980%2Ftorchadv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hupe1980%2Ftorchadv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hupe1980","download_url":"https://codeload.github.com/hupe1980/torchadv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252949317,"owners_count":21830150,"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":["adversarial-attacks","cybersecurity","pytorch"],"created_at":"2024-10-01T15:34:23.397Z","updated_at":"2026-01-28T06:07:43.676Z","avatar_url":"https://github.com/hupe1980.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔥🛡️⚔️ TorchAdv\n\nTorchAdv is a Python package designed to facilitate the creation and execution of adversarial attacks on PyTorch models. This library aims to provide easy-to-use tools for generating adversarial examples, evaluating model robustness, and implementing state-of-the-art adversarial attack methods.\n\n## Features\n\n- **Adversarial Attacks**: Implementations of popular adversarial attacks such as FGSM, PGD, and more.\n- **Compatibility**: Designed to work seamlessly with PyTorch models.\n- **Customizable**: Easily extendable to include new attack methods or custom functionality.\n\n## Installation\n\nInstall the package via pip:\n\n```bash\npip install torchadv\n```\n\n## Usage\n\nHere is a simple example of how to use TorchAdv to perform an FGSM attack on a PyTorch model:\n\n```python\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torchvision import models, transforms\nfrom PIL import Image\n\nfrom torchadv.attacks import PGD\n\n# Load a pre-trained model\nmodel = models.resnet18(pretrained=True)\nmodel.eval()\n\n# Load an image and preprocess it\ntransform = transforms.Compose([\n    transforms.Resize((224, 224)),\n    transforms.ToTensor(),\n])\nimage = Image.open('path_to_image.jpg')\norig = transform(image).unsqueeze(0)\n\n# Define the target label\ntarget_label = torch.tensor([your_target_label])\n\n# Perform the attack\nattack = PGD(model)\nadv = attack(orig, target_label)\n```\n\n## Contributing\n\nContributions are welcome! If you have any ideas for new features, improvements, or bug fixes, feel free to open an issue or submit a pull request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhupe1980%2Ftorchadv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhupe1980%2Ftorchadv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhupe1980%2Ftorchadv/lists"}