{"id":13671428,"url":"https://github.com/thuml/Anomaly-Transformer","last_synced_at":"2025-04-27T18:31:15.473Z","repository":{"id":40631370,"uuid":"484269010","full_name":"thuml/Anomaly-Transformer","owner":"thuml","description":"About Code release for \"Anomaly Transformer: Time Series Anomaly Detection with Association Discrepancy\" (ICLR 2022 Spotlight), https://openreview.net/forum?id=LzQQ89U1qm_","archived":false,"fork":false,"pushed_at":"2023-12-29T11:36:58.000Z","size":27290,"stargazers_count":749,"open_issues_count":30,"forks_count":196,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-11-11T09:43:41.546Z","etag":null,"topics":["anomaly-detection","deep-learning","time-series"],"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/thuml.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":"2022-04-22T02:25:58.000Z","updated_at":"2024-11-09T05:13:57.000Z","dependencies_parsed_at":"2022-07-20T13:47:58.884Z","dependency_job_id":"23914174-b2b6-4ee0-8ec4-e1296e4575a7","html_url":"https://github.com/thuml/Anomaly-Transformer","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/thuml%2FAnomaly-Transformer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thuml%2FAnomaly-Transformer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thuml%2FAnomaly-Transformer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thuml%2FAnomaly-Transformer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thuml","download_url":"https://codeload.github.com/thuml/Anomaly-Transformer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251187106,"owners_count":21549583,"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":["anomaly-detection","deep-learning","time-series"],"created_at":"2024-08-02T09:01:09.518Z","updated_at":"2025-04-27T18:31:15.146Z","avatar_url":"https://github.com/thuml.png","language":"Python","funding_links":[],"categories":["Python","时间序列","2022"],"sub_categories":["网络服务_其他"],"readme":"# Anomaly-Transformer (ICLR 2022 Spotlight)\nAnomaly Transformer: Time Series Anomaly Detection with Association Discrepancy\n\nUnsupervised detection of anomaly points in time series is a challenging problem, which requires the model to learn informative representation and derive a distinguishable criterion. In this paper, we propose the Anomaly Transformer in these three folds:\n\n- An inherent distinguishable criterion as **Association Discrepancy** for detection.\n- A new **Anomaly-Attention** mechanism to compute the association discrepancy.\n- A **minimax strategy** to amplify the normal-abnormal distinguishability of the association discrepancy.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\".\\pics\\structure.png\" height = \"350\" alt=\"\" align=center /\u003e\n\u003c/p\u003e\n\n## Get Started\n\n1. Install Python 3.6, PyTorch \u003e= 1.4.0. \n(Thanks Élise for the contribution in solving the environment. See this [issue](https://github.com/thuml/Anomaly-Transformer/issues/11) for details.)\n2. Download data. You can obtain four benchmarks from [Google Cloud](https://drive.google.com/drive/folders/1gisthCoE-RrKJ0j3KPV7xiibhHWT9qRm?usp=sharing). **All the datasets are well pre-processed**. For the SWaT dataset, you can apply for it by following its official tutorial.\n3. Train and evaluate. We provide the experiment scripts of all benchmarks under the folder `./scripts`. You can reproduce the experiment results as follows:\n```bash\nbash ./scripts/SMD.sh\nbash ./scripts/MSL.sh\nbash ./scripts/SMAP.sh\nbash ./scripts/PSM.sh\n```\n\nEspecially, we use the adjustment operation proposed by [Xu et al, 2018](https://arxiv.org/pdf/1802.03903.pdf) for model evaluation. If you have questions about this, please see this [issue](https://github.com/thuml/Anomaly-Transformer/issues/14) or email us.\n\n## Main Result\n\nWe compare our model with 15 baselines, including THOC, InterFusion, etc. **Generally,  Anomaly-Transformer achieves SOTA.**\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\".\\pics\\result.png\" height = \"450\" alt=\"\" align=center /\u003e\n\u003c/p\u003e\n\n## Citation\nIf you find this repo useful, please cite our paper. \n\n```\n@inproceedings{\nxu2022anomaly,\ntitle={Anomaly Transformer: Time Series Anomaly Detection with Association Discrepancy},\nauthor={Jiehui Xu and Haixu Wu and Jianmin Wang and Mingsheng Long},\nbooktitle={International Conference on Learning Representations},\nyear={2022},\nurl={https://openreview.net/forum?id=LzQQ89U1qm_}\n}\n```\n\n## Contact\nIf you have any question, please contact wuhx23@mails.tsinghua.edu.cn.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthuml%2FAnomaly-Transformer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthuml%2FAnomaly-Transformer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthuml%2FAnomaly-Transformer/lists"}