{"id":53278,"date":"2019-11-28T00:00:00","date_gmt":"2019-11-27T21:00:00","guid":{"rendered":"https:\/\/prohoster.info\/blog\/blog_prohoster\/9-podhodov-dlya-vyyavleniya-anomalij"},"modified":"2020-02-18T14:01:10","modified_gmt":"2020-02-18T11:01:10","slug":"9-podhodov-dlya-vyyavleniya-anomalij","status":"publish","type":"post","link":"https:\/\/prohoster.info\/en\/blog\/news\/9-podhodov-dlya-vyyavleniya-anomalij","title":{"rendered":"9 Approaches for Detecting Anomalies","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>In <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/477206\/\">the previous article<\/a><\/noindex> We talked about time series forecasting. A logical continuation would be an article on anomaly detection. <\/p>\n<h3>The use of<\/h3>\n<p>\nAnomaly detection is used in areas such as: <\/p>\n<h3>1) Predicting equipment failures<\/h3>\n<p>\nFor instance, in 2010, Iranian centrifuges were attacked by the Stuxnet virus, which set the equipment to an optimal operating mode and caused part of it to fail due to accelerated wear. <\/p>\n<p>If anomaly detection algorithms were used on the equipment, these failures could have been avoided. <\/p>\n<p><img decoding=\"async\" alt=\"9 Approaches for Detecting Anomalies\" src=\"\/wp-content\/uploads\/2019\/11\/ea0ea13fb9d18be333eaeb43cbd0fadc.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><br \/>\nAnomaly detection in equipment operation is used not only in the nuclear industry but also in metallurgy and aviation turbine operation, and in other areas where predictive diagnostics are cheaper than the potential losses from unforeseen failures.<\/p>\n<h3>2) Predicting fraudulent activities<\/h3>\n<p>\nIf money is withdrawn from a card you use in Podolsk while in Albania, it may be wise to verify the transactions.<\/p>\n<h3>3) Identifying anomalous consumer patterns<\/h3>\n<p>\nIf a portion of customers is demonstrating abnormal behavior, there may be an issue that you are unaware of.<\/p>\n<h3>4) Detecting abnormal demand and workload<\/h3>\n<p>\nIf sales in an FMCG store drop below the lower limit of the confidence interval forecast, it is worth finding the cause of the situation.<\/p>\n<h2>Approaches to anomaly detection<\/h2>\n<p><\/p>\n<h3>1) One-Class SVM<\/h3>\n<p>\nSuitable when the training set data follow a normal distribution, while the test data contain anomalies.<\/p>\n<p>The one-class support vector method constructs a nonlinear surface around the origin. It allows setting a cutoff boundary to determine what data is considered anomalous.<\/p>\n<p>Based on the experience of our DATA4 team, One-Class SVM is the most frequently used algorithm for solving the anomaly detection task. <\/p>\n<p><img decoding=\"async\" alt=\"9 Approaches for Detecting Anomalies\" src=\"\/wp-content\/uploads\/2019\/11\/2a9a33456ce1a96e89dfde27cdd84428.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<\/p>\n<h3>2) Isolation Forest<\/h3>\n<p>\nWith a 'random' method of tree construction, outliers will end up in leaves at early stages (with a small tree depth), i.e., outliers are easier to 'isolate'. Anomalous values are identified in the early iterations of the algorithm's operation.<\/p>\n<p><img decoding=\"async\" alt=\"9 Approaches for Detecting Anomalies\" src=\"\/wp-content\/uploads\/2019\/11\/5a8023f2ec0c68ee554c8fea70982d97.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<\/p>\n<h3>3) Elliptic Envelope and statistical methods<\/h3>\n<p>\nUsed when data is normally distributed. The closer the measurement is to the tails of the distribution mixture, the more anomalous the value.<\/p>\n<p>This class can also include other statistical methods.<\/p>\n<p><img decoding=\"async\" alt=\"9 Approaches for Detecting Anomalies\" src=\"\/wp-content\/uploads\/2019\/11\/049b2ea6236b6c1b70a4a976251099fe.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\n<img decoding=\"async\" alt=\"9 Approaches for Detecting Anomalies\" src=\"\/wp-content\/uploads\/2019\/11\/d7b47d7ab35ae001ab924509d9f52362.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<i>Image from dyakonov.org<\/i><\/p>\n<h3>4) Metric methods<\/h3>\n<p>\nThe methods include algorithms such as k-nearest neighbors, k-th nearest neighbor, ABOD (angle-based outlier detection), or LOF (local outlier factor).<\/p>\n<p>They are suitable if the distances between values in the features are equivalent or normalized (to avoid measuring a python in parrots). <\/p>\n<p>The k-nearest neighbors algorithm assumes that normal values are located within a certain area of the multidimensional space, and the distance to anomalies will be greater than to the separating hyperplane. <\/p>\n<p><img decoding=\"async\" alt=\"9 Approaches for Detecting Anomalies\" src=\"\/wp-content\/uploads\/2019\/11\/4759e0c1f2b858adbbccc04e8d337932.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<\/p>\n<h3>5) Cluster methods<\/h3>\n<p>\nThe essence of cluster methods is that if a value is far from the cluster centers by more than a certain amount, it can be considered an anomaly. <\/p>\n<p>The main thing is to use an algorithm that properly clusters the data, which depends on the specific task. <\/p>\n<p><img decoding=\"async\" alt=\"9 Approaches for Detecting Anomalies\" src=\"\/wp-content\/uploads\/2019\/11\/89ee7d8f70e0a66672c9859296eed2d7.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<\/p>\n<h3>6) Principal component method<\/h3>\n<p>\nSuitable where directions of greatest variance are highlighted.<\/p>\n<h3>7) Time series forecasting algorithms<\/h3>\n<p>\nThe idea is that if a value falls outside the confidence interval of the prediction, it is considered an anomaly. Algorithms such as triple smoothing, S(ARIMA), boosting, etc., are used for time series forecasting.<\/p>\n<p>The time series forecasting algorithms were discussed in the previous article.<\/p>\n<p><img decoding=\"async\" alt=\"9 Approaches for Detecting Anomalies\" src=\"\/wp-content\/uploads\/2019\/11\/5dc3bcee7f7b1e9bacc108e5300181b5.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<\/p>\n<h3>8) Supervised learning (regression, classification)<\/h3>\n<p>\nIf the data allows, we use algorithms ranging from linear regression to recurrent networks. We will measure the difference between the prediction and the actual value, and conclude how much the data deviates from the norm. It is important that the algorithm has sufficient generalization ability and the training sample does not contain anomalies.<\/p>\n<h3>9) Model tests<\/h3>\n<p>\nWe will approach the task of anomaly detection as a recommendation problem. We will decompose our feature matrix using SVD or factorization machines, and values in the new matrix that significantly differ from the original will be accepted as anomalous. <\/p>\n<p><img decoding=\"async\" alt=\"9 Approaches for Detecting Anomalies\" src=\"\/wp-content\/uploads\/2019\/11\/32bb36c5fd31d113de3351fdc1bcd022.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\n<i>Image from dyakonov.org<\/i><\/p>\n<h3>Conclusion<\/h3>\n<p>\nIn this article, we reviewed the main approaches to anomaly detection. <\/p>\n<p>Anomaly detection can largely be considered an art. There is no perfect algorithm or approach that solves all tasks. A combination of methods is often used to tackle specific cases. Anomaly detection is carried out using the one-class support vector method, isolation forests, metric and clustering methods, as well as principal component analysis and time series forecasting.<\/p>\n<p>If you know other methods, please share them in the comments section of the article.<br \/>\n<br \/>Source: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/477450\/\">habr.com<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u0438 \u043e \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0440\u044f\u0434\u043e\u0432. \u041b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0430\u0442\u044c\u044f \u043e \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0439. \u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0412\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0442\u0430\u043a\u0438\u0445 \u043e\u0431\u043b\u0430\u0441\u0442\u044f\u0445 \u043a\u0430\u043a: 1) \u041f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u043e\u043c\u043e\u043a \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0422\u0430\u043a, \u0432 2010 \u0433\u043e\u0434\u0443 \u0418\u0440\u0430\u043d\u0441\u043a\u0438\u0435 \u0446\u0435\u043d\u0442\u0440\u0438\u0444\u0443\u0433\u0438 \u0431\u044b\u043b\u0438 \u0430\u0442\u0430\u043a\u043e\u0432\u0430\u043d\u044b \u0432\u0438\u0440\u0443\u0441\u043e\u043c Stuxnet, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0434\u0430\u043b \u043d\u0435\u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0432\u044b\u0432\u0435\u043b \u0438\u0437 \u0441\u0442\u0440\u043e\u044f \u0447\u0430\u0441\u0442\u044c \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430 \u0441\u0447\u0435\u0442 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u0437\u043d\u043e\u0441\u0430. \u0415\u0441\u043b\u0438 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[702],"tags":[],"class_list":["post-53278","post","type-post","status-publish","format-standard","hentry","category-news"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.2 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u0438 \u043e \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0440\u044f\u0434\u043e\u0432. \u041b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0430\u0442\u044c\u044f \u043e \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0439.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/en\/blog\/news\/9-podhodov-dlya-vyyavleniya-anomalij\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.2\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd479 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 \u0434\u043b\u044f \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0439 | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u0438 \u043e \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0440\u044f\u0434\u043e\u0432. \u041b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0430\u0442\u044c\u044f \u043e \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0439.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/en\/blog\/news\/9-podhodov-dlya-vyyavleniya-anomalij\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-11-27T21:00:00+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-02-18T11:01:10+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd479 Approaches to Anomaly Detection | ProHoster","description":"In the previous article, we discussed time series forecasting. A logical continuation would be an article on anomaly detection.","canonical_url":"https:\/\/prohoster.info\/en\/blog\/news\/9-podhodov-dlya-vyyavleniya-anomalij","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd479 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 \u0434\u043b\u044f \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0439 | ProHoster","og:description":"\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u0438 \u043e \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0440\u044f\u0434\u043e\u0432. \u041b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0430\u0442\u044c\u044f \u043e \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0439.","og:url":"https:\/\/prohoster.info\/en\/blog\/news\/9-podhodov-dlya-vyyavleniya-anomalij","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2019-11-27T21:00:00+00:00","article:modified_time":"2020-02-18T11:01:10+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"53278","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-01-24 06:46:20","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-02-28 20:28:47","updated":"2026-01-24 06:46:20","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/53278","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/comments?post=53278"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/53278\/revisions"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media?parent=53278"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/categories?post=53278"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/tags?post=53278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}