{"id":19797869,"url":"https://github.com/podgorskiy/gpnd","last_synced_at":"2025-09-16T10:07:46.839Z","repository":{"id":83552976,"uuid":"133181863","full_name":"podgorskiy/GPND","owner":"podgorskiy","description":"Generative Probabilistic Novelty Detection with Adversarial Autoencoders","archived":false,"fork":false,"pushed_at":"2020-12-07T03:26:08.000Z","size":5985,"stargazers_count":131,"open_issues_count":7,"forks_count":31,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-03-20T13:30:39.126Z","etag":null,"topics":["aae","adversarial-autoencoders","adversarial-learning","anomaly-detection","autoencoder","deep-learning","deep-neural-networks","deep-novelty-detection","gan","generative-adversarial-network","machine-learning","mnist","nips-2018","novelty-detection","novelty-detector","pdf","probability","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","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/podgorskiy.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}},"created_at":"2018-05-12T20:39:10.000Z","updated_at":"2024-03-10T22:30:52.000Z","dependencies_parsed_at":"2023-07-07T18:31:39.669Z","dependency_job_id":null,"html_url":"https://github.com/podgorskiy/GPND","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/podgorskiy%2FGPND","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/podgorskiy%2FGPND/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/podgorskiy%2FGPND/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/podgorskiy%2FGPND/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/podgorskiy","download_url":"https://codeload.github.com/podgorskiy/GPND/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224234229,"owners_count":17277925,"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":["aae","adversarial-autoencoders","adversarial-learning","anomaly-detection","autoencoder","deep-learning","deep-neural-networks","deep-novelty-detection","gan","generative-adversarial-network","machine-learning","mnist","nips-2018","novelty-detection","novelty-detector","pdf","probability","pytorch"],"created_at":"2024-11-12T07:27:10.641Z","updated_at":"2025-09-16T10:07:41.812Z","avatar_url":"https://github.com/podgorskiy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Generative Probabilistic Novelty Detection with Adversarial Autoencoders\n\n**Stanislav Pidhorskyi, Ranya Almohsen, Donald A Adjeroh, Gianfranco Doretto**\n\nLane Department of Computer Science and Electrical Engineering, West\n    Virginia University\\\n    Morgantown, WV 26508\\\n    {stpidhorskyi, ralmohse, daadjeroh, gidoretto} @mix.wvu.edu\n    \n[The e-preprint of the article on arxiv](https://arxiv.org/abs/1807.02588).\n\n[NeurIPS Proceedings](https://papers.nips.cc/paper/7915-generative-probabilistic-novelty-detection-with-adversarial-autoencoders).\n\n\n    @inproceedings{pidhorskyi2018generative,\n      title={Generative probabilistic novelty detection with adversarial autoencoders},\n      author={Pidhorskyi, Stanislav and Almohsen, Ranya and Doretto, Gianfranco},\n      booktitle={Advances in neural information processing systems},\n      pages={6822--6833},\n      year={2018}\n    }\n\n\n### Content\n\n* **partition_mnist.py** - code for preparing MNIST dataset.\n* **train_AAE.py** - code for training the autoencoder.\n* **novelty_detector.py** - code for running novelty detector\n* **net.py** - contains definitions of network architectures. \n\n### How to run\n\nYou will need to run **partition_mnist.py** first.\n\nThen run **schedule.py**. It will run as many concurent experiments as many GPUs are available. Reusults will be written to **results.csv** file\n\n___\nAlternatively, you can call directly functions from **train_AAE.py** and **novelty_detector.py**\n\nTrain autoenctoder with **train_AAE.py**, you need to call *train* function:\n\n    train_AAE.train(\n      folding_id,\n      inliner_classes,\n      ic\n    )\n  \n   Args:\n   -  folding_id: Id of the fold. For MNIST, 5 folds are generated, so folding_id must be in range [0..5]\n   -  inliner_classes: List of classes considered inliers.\n   -  ic: inlier class set index (used to save model with unique filename).\n   \nAfter autoencoder was trained, from **novelty_detector.py**, you need to call *main* function:\n\n    novelty_detector.main(\n      folding_id,\n      inliner_classes,\n      total_classes,\n      mul,\n      folds=5\n    )\n   -  folding_id: Id of the fold. For MNIST, 5 folds are generated, so folding_id must be in range [0..5]\n   -  inliner_classes: List of classes considered inliers.\n   -  ic: inlier class set index (used to save model with unique filename).\n   -  total_classes: Total count of classes (deprecated, moved to config).\n   -  mul: multiplier for power correction. Default value 0.2.\n   -  folds: Number of folds (deprecated, moved to config).\n   \n### Generated/Reconstructed images\n\n![MNIST Reconstruction](images/reconstruction_58.png?raw=true \"MNIST Reconstruction\")\n\n*MNIST Reconstruction. First raw - real image, second - reconstructed.*\n\n\u003cbr\u003e\u003cbr\u003e\n\n![MNIST Reconstruction](images/sample_58.png?raw=true \"MNIST Generation\")\n\n*MNIST Generation.*\n\n\u003cbr\u003e\u003cbr\u003e\n![COIL100 Reconstruction](images/reconstruction_59_one.png?raw=true \"COIL100 Reconstruction\")\n\n*COIL100 Reconstruction, single category. First raw - real image, second - reconstructed. Only 57 images were used for training.*\n\n\u003cbr\u003e\u003cbr\u003e\n\n![COIL100 Generation](images/sample_59_one.png?raw=true \"COIL100 Generation\")\n\n*COIL100 Generation. First raw - real image, second - reconstructed. Only 57 images were used for training.*\n\n\u003cbr\u003e\u003cbr\u003e\n\n![COIL100 Reconstruction](images/reconstruction_59_seven.png?raw=true \"COIL100 Reconstruction\")\n\n*COIL100 Reconstruction, 7 categories. First raw - real image, second - reconstructed. Only about 60 images per category were used for training*\n\n\u003cbr\u003e\u003cbr\u003e\n\n![COIL100 Generation](images/sample_59_seven.png?raw=true \"COIL100 Generation\")\n\n*COIL100 Generation. First raw - real image, second - reconstructed. Only about 60 images per category were used for training.*\n\n\u003cbr\u003e\u003cbr\u003e\n\n![PDF](images/PDF.png?raw=true \"PDF\")\n\n*PDF of the latent space for MNIST. Size of the latent space - 32*\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpodgorskiy%2Fgpnd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpodgorskiy%2Fgpnd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpodgorskiy%2Fgpnd/lists"}