{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/monte-carlo-em-for-deep-time-series-anomaly","title":"Monte Carlo EM for Deep Time Series Anomaly Detection","arxiv_id":"2112.14436","date":"2021-12-29","proceeding":null,"authors":["François-Xavier Aubet","Daniel Zügner","Jan Gasthaus"],"abstract":"Time series data are often corrupted by outliers or other kinds of anomalies. Identifying the anomalous points can be a goal on its own (anomaly detection), or a means to improving performance of other time series tasks (e.g. forecasting). Recent deep-learning-based approaches to anomaly detection and forecasting commonly assume that the proportion of anomalies in the training data is small enough to ignore, and treat the unlabeled data as coming from the nominal data distribution. We present a simple yet effective technique for augmenting existing time series models so that they explicitly account for anomalies in the training data. By augmenting the training data with a latent anomaly indicator variable whose distribution is inferred while training the underlying model using Monte Carlo EM, our method simultaneously infers anomalous points while improving model performance on nominal data. We demonstrate the effectiveness of the approach by combining it with a simple feed-forward forecasting model. We investigate how anomalies in the train set affect the training of forecasting models, which are commonly used for time series anomaly detection, and show that our method improves the training of the model.","url_abs":"https://arxiv.org/abs/2112.14436v1","url_pdf":"https://arxiv.org/pdf/2112.14436v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"monte-carlo-em-for-deep-time-series-anomaly","repo_url":"https://github.com/Francois-Aubet/gluon-ts/blob/monte_carlo_em_masking_notebook/src/gluonts/nursery/anomaly_detection/Monte-Carlo-EM-for-Time-Series-Anomaly-Detection-demo-notebook.ipynb","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mxnet","reach":null}],"tasks":[{"task_slug":"anomaly-detection","task_name":"Anomaly Detection"},{"task_slug":"time-series-1","task_name":"Time Series"},{"task_slug":"time-series","task_name":"Time Series Analysis"},{"task_slug":"time-series-anomaly-detection","task_name":"Time Series Anomaly Detection"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2112.14436","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2112.14436"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Francois-Aubet/gluon-ts/blob/monte_carlo_em_masking_notebook/src/gluonts/nursery/anomaly_detection/Monte-Carlo-EM-for-Time-Series-Anomaly-Detection-demo-notebook.ipynb","reach":null}],"summary":{"unverified":13},"by_repo_kind":{"listed":{"samples":13,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"668d3b50df5c6b08","entry":"batcher","repo":"Francois-Aubet/gluon-ts","repo_kind":"listed","path":"src/gluonts/itertools.py","file_url":"https://github.com/Francois-Aubet/gluon-ts/blob/HEAD/src/gluonts/itertools.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"668d3b50df5c6b08"}},{"code_sha256_prefix":"ae316cd671208d8e","entry":"equals","repo":"Francois-Aubet/gluon-ts","repo_kind":"listed","path":"src/gluonts/core/component.py","file_url":"https://github.com/Francois-Aubet/gluon-ts/blob/HEAD/src/gluonts/core/component.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ae316cd671208d8e"}},{"code_sha256_prefix":"f537ced69a466e08","entry":"equals_default_impl","repo":"Francois-Aubet/gluon-ts","repo_kind":"listed","path":"src/gluonts/core/component.py","file_url":"https://github.com/Francois-Aubet/gluon-ts/blob/HEAD/src/gluonts/core/component.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f537ced69a466e08"}},{"code_sha256_prefix":"f5f4848418aecf04","entry":"fqname_for","repo":"Francois-Aubet/gluon-ts","repo_kind":"listed","path":"src/gluonts/core/_base.py","file_url":"https://github.com/Francois-Aubet/gluon-ts/blob/HEAD/src/gluonts/core/_base.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f5f4848418aecf04"}},{"code_sha256_prefix":"e612a4185e637661","entry":"get_git_archive_version","repo":"Francois-Aubet/gluon-ts","repo_kind":"listed","path":"src/gluonts/_version.py","file_url":"https://github.com/Francois-Aubet/gluon-ts/blob/HEAD/src/gluonts/_version.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e612a4185e637661"}},{"code_sha256_prefix":"caf1d6df99f2e3d9","entry":"get_git_version","repo":"Francois-Aubet/gluon-ts","repo_kind":"listed","path":"src/gluonts/_version.py","file_url":"https://github.com/Francois-Aubet/gluon-ts/blob/HEAD/src/gluonts/_version.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"caf1d6df99f2e3d9"}},{"code_sha256_prefix":"8cb7cc0f64c46e08","entry":"inject","repo":"Francois-Aubet/gluon-ts","repo_kind":"listed","path":"src/gluonts/core/settings.py","file_url":"https://github.com/Francois-Aubet/gluon-ts/blob/HEAD/src/gluonts/core/settings.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8cb7cc0f64c46e08"}},{"code_sha256_prefix":"09ee4e3cd00b0599","entry":"let","repo":"Francois-Aubet/gluon-ts","repo_kind":"listed","path":"src/gluonts/core/settings.py","file_url":"https://github.com/Francois-Aubet/gluon-ts/blob/HEAD/src/gluonts/core/settings.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"09ee4e3cd00b0599"}},{"code_sha256_prefix":"7835f8524ede6d0c","entry":"maybe_len","repo":"Francois-Aubet/gluon-ts","repo_kind":"listed","path":"src/gluonts/itertools.py","file_url":"https://github.com/Francois-Aubet/gluon-ts/blob/HEAD/src/gluonts/itertools.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"7835f8524ede6d0c"}},{"code_sha256_prefix":"b5c0811c003f958f","entry":"prod","repo":"Francois-Aubet/gluon-ts","repo_kind":"listed","path":"src/gluonts/itertools.py","file_url":"https://github.com/Francois-Aubet/gluon-ts/blob/HEAD/src/gluonts/itertools.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b5c0811c003f958f"}},{"code_sha256_prefix":"98e7e3ca03b44856","entry":"search_for","repo":"Francois-Aubet/gluon-ts","repo_kind":"listed","path":"src/gluonts/_version.py","file_url":"https://github.com/Francois-Aubet/gluon-ts/blob/HEAD/src/gluonts/_version.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"98e7e3ca03b44856"}},{"code_sha256_prefix":"d6d507841deaf78b","entry":"to_markdown","repo":"Francois-Aubet/gluon-ts","repo_kind":"listed","path":"evaluations/show_results.py","file_url":"https://github.com/Francois-Aubet/gluon-ts/blob/HEAD/evaluations/show_results.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d6d507841deaf78b"}},{"code_sha256_prefix":"03c6c7d9c6ace85c","entry":"tqdm","repo":"Francois-Aubet/gluon-ts","repo_kind":"listed","path":"src/gluonts/gluonts_tqdm.py","file_url":"https://github.com/Francois-Aubet/gluon-ts/blob/HEAD/src/gluonts/gluonts_tqdm.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"03c6c7d9c6ace85c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}