{"id":18897766,"url":"https://github.com/zurutech/anomaly-toolbox","last_synced_at":"2025-05-07T08:25:22.883Z","repository":{"id":47078520,"uuid":"406007120","full_name":"zurutech/anomaly-toolbox","owner":"zurutech","description":"Anomaly detection using GANs.","archived":false,"fork":false,"pushed_at":"2024-07-03T12:48:44.000Z","size":298,"stargazers_count":93,"open_issues_count":0,"forks_count":12,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-21T11:07:54.511Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zurutech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2021-09-13T14:30:11.000Z","updated_at":"2025-04-11T20:03:49.000Z","dependencies_parsed_at":"2024-11-08T08:51:24.185Z","dependency_job_id":null,"html_url":"https://github.com/zurutech/anomaly-toolbox","commit_stats":{"total_commits":189,"total_committers":7,"mean_commits":27.0,"dds":0.5026455026455027,"last_synced_commit":"d7cea8fadf80d9f4483bbbea5d5630238d911df5"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zurutech%2Fanomaly-toolbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zurutech%2Fanomaly-toolbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zurutech%2Fanomaly-toolbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zurutech%2Fanomaly-toolbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zurutech","download_url":"https://codeload.github.com/zurutech/anomaly-toolbox/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252840821,"owners_count":21812369,"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":[],"created_at":"2024-11-08T08:39:30.408Z","updated_at":"2025-05-07T08:25:22.829Z","avatar_url":"https://github.com/zurutech.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Anomaly Toolbox\n\n## Description\n\n_Anomaly Toolbox Powered by GANs._ \n\nThis is the accompanying toolbox for the paper \"**A \nSurvey on GANs for Anomaly Detection**\" (https://arxiv.org/pdf/1906.11632.pdf).\n\nThe toolbox is meant to be used by the user to explore the performance of different GAN based \narchitectures (in our work aka \"**experiments**\"). It also already provides some datasets to \nperform experiments on: \n* _MNIST_, \n* _Corrupted MNIST_, \n* _Surface Cracks_ (https://www.kaggle.com/arunrk7/surface-crack-detection),\n* _MVTec AD_ (https://www.mvtec.com/fileadmin/Redaktion/mvtec.\n  com/company/research/datasets/mvtec_ad.pdf).\n\nWe provided the _MNIST_ dataset because the original works extensively use it. On the other hand, \nwe have also added the previously listed datasets both because used by a particular \narchitecture and because they contribute a good benchmark for the models we have implemented.\n\nAll the architectures were tested on commonly used datasets such as _MNIST_, _FashionMNIST_, \n_CIFAR-10_, and _KDD99_. Some of them were even tested on more specific datasets, such as an \nX-Ray dataset that, however, we could not provide because of the impossibility of getting the \ndata (privacy reasons). \n\nThe user can create their own dataset and use it to test the models.\n\n## Quick Start\n\n* First thing first, install the toolbox\n\n```bash \npip install anomaly-toolbox\n```\n\nThen you can choose what experiment to run. For example:\n\n* Run the GANomaly experiment (i.e., the GANomaly architecture) with hyperparameters tuning \n  enabled, the pre-defined hyperparameters file _hparams.json_ and the _MNIST_ dataset:\n\n```bash\nanomaly-box.py --experiment GANomalyExperiment --hps-path path/to/config/hparams.json --dataset \nMNIST \n```\n* Otherwise, you can run all the experiments using the pre-defined hyperparameters file _hparams.\n  json_ and the _MNIST_ dataset:\n\n```bash\nanomaly-box.py --run-all --hps-path path/to/config/hparams.json --dataset MNIST \n```\n\nFor any other information, feel free to check the help:\n\n```bash \nanomaly-box.py --help\n```\n\n## Contribution\n\nThis work is completely open source, and **we would appreciate any contribution to the code**. \nAny merge request to enhance, correct or expand the work is welcome.\n\n## Notes\n\nThe structures of the models inside the toolbox come from their respective papers. We have tried to \nrespect them as much as possible. However, sometimes, due to implementation issues, we had to make \nsome minor-ish changes. For this reason, you could find out that, in some cases, some features \nsuch as the number of layers, the size of kernels, or other such things may differ from the \noriginals. \n\nHowever, you don't have to worry. The heart and purpose of the architectures have remained intact.\n\n## Installation\n\n```console\npip install anomaly-toolbox\n```\n\n## Usage\n\n```\nOptions:\n  --experiment [AnoGANExperiment|DeScarGANExperiment|EGBADExperiment|GANomalyExperiment]\n                                  Experiment to run.\n  --hps-path PATH                 When running an experiment, the path of the\n                                  JSON file where all the hyperparameters are\n                                  located.  [required]\n  --tuning BOOLEAN                If you want to use hyperparameters tuning,\n                                  use 'True' here. Default is False.\n  --dataset TEXT                  The dataset to use. Can be a ready to use\n                                  dataset, or a .py file that implements the\n                                  AnomalyDetectionDataset interface\n                                  [required]\n  --run-all BOOLEAN               Run all the available experiments\n  --help                          Show this message and exit.\n```\n\n## Datasets and Custom Datasets\n\nThe provided datasets are:\n\n* MNIST \n* Corrupted Mnist\n* Surface Crack (https://www.kaggle.com/arunrk7/surface-crack-detection)\n*  MVTec AD (https://www.mvtec.com/fileadmin/Redaktion/mvtec.com/company/research/datasets/mvtec_ad.pdf)\n\nand are automatically downloaded when the user makes a specific choice: [\"MNIST\", \n\"CorruptedMNIST\", \"SurfaceCracks\",\"MVTecAD\"].\n\nThe user can also add its own specific dataset. To do this, the new dataset should inherit from \nthe `AnomalyDetectionDataset` abstract class implementing its own `configure` method. For a more \ndetailed guide, the user can refer to the `README.md` file inside the \n`src/anomaly_toolbox/datasets` folder. Moreover, in the `examples` folder, the user can find a \n`dummy.py` module with the basic skeleton code to implement a dataset.\n\n## References\n\n- **GANomaly**:\n    - Paper: https://arxiv.org/abs/1805.06725\n    - Code: https://github.com/samet-akcay/ganomaly\n- **EGBAD (BiGAN)**:\n    - Paper: https://arxiv.org/abs/1802.06222\n    - Code: https://github.com/houssamzenati/Efficient-GAN-Anomaly-Detection\n- **AnoGAN**:\n    - Paper: https://arxiv.org/abs/1703.05921\n    - Code (not official): https://github.com/LeeDoYup/AnoGAN\n    - Code (not official): https://github.com/tkwoo/anogan-keras\n- **DeScarGAN**:\n    - Paper: https://arxiv.org/abs/2007.14118\n    - Code: https://github.com/JuliaWolleb/DeScarGAN\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzurutech%2Fanomaly-toolbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzurutech%2Fanomaly-toolbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzurutech%2Fanomaly-toolbox/lists"}