logo BLUE BI business intelligence & analytics

Anomaly detection: predict the unexpected



Anomaly detection is a data analysis methodology that focuses on detecting observations or unusual events within a data set. Through the use of algorithms and statistical techniques, anomaly detection identifies and signals significant deviations from normal behavior patterns, allowing timely corrective measures to be taken. This technique finds application in various industries, from cyber security to predictive maintenance, offering an advantage in risk mitigation and operations optimization. Thanks to advances in machine and learning, more sophisticated and accurate models have been developed to address the ever-increasing challenges of anomaly detection.

Types of anomalies

We can distinguish three types of anomalies:

  • Point anomalies: these are individual values that deviate within a large data set. In this case, the abnormal value can be caused by measurement errors, failures or unexpected events. For example, if monitoring the internal temperature of a refrigerator averages 0 ºC, a point anomaly can be given by a measurement of 10 ºC.
  • Contextual anomalies: some points can be considered anomalous in a certain context. In a time series, for example, some values could be considered normal in a certain month and abnormal in another period of the year.
  • Collective anomalies: when the anomalous behavior emerges from a set of points in one or more datasets. For example, a bank transaction may be abnormal by comparing data from different countries; or if sales of several products fall simultaneously.

Approaches and algorithms

Depending on the problem to be addressed and the data available, there are mainly two approaches for anomaly detection:

  • Supervised anomaly detection: if the dataset data is classified in such a way as to know whether each point is abnormal or not. In this case, the algorithms applied address a binary classification problem. One of the most used algorithms is the Support Vector Machine (SVM).
  • Unsupervised anomaly detection: the data does not present any information about their nature. In this type of approach there are two ways to train algorithms:
    1. Novelty detection: training data does not include anomalies, so that we can teach the algorithmic the concept of ‘normality’. In the test phase, we also consider outliers. In this case, we can also talk about semi-supervised anomaly detection. This type of analysis aims to detect new patterns and behaviors different from what was observed previously.
    2. Outlier Detection: in this case, outliers are also present in the training set. In this way, the algorithm is trained to identify the characteristics and patterns that differentiate outliers from the rest of the data.

Some of the most widely used algorithms in the unsupervised case are Isolation Forest, DBSCAN (Density-Based Spatial Clustering of Applications with Noise) and Gaussian Mixture Models (GMM).


Use Cases

Anomaly detection has applications in different areas and sectors. Some examples are:

  • Finance: fraud detection in financial transactions.
  • Predictive maintenance: industrial equipment fault detection and plant condition monitoring to prevent malfunctions.
  • Supply chain: identification of delays or interruptions in supply flow and transport logistics; detection of anomalies in inventory data, such as discrepancies trail physical counting and theoretical counting.
  • Hospitality: detection of suspicious bookings or transactions.
  • Energy and utilities: detection of anomalies in energy consumption to identify faults; monitoring of electrical networks to detect events such as blackouts or overloads.

Anomalies are not always as bad as fraud. Anomaly detection can also be used, for example, to identify rapid growth in market trends and sales.


Anomaly detection has become a fundamental technique for detecting and dealing with unusual events or behaviors. With advances in data analysis and machine learning, abnormal situations can be identified in a timely manner and appropriate corrective measures can be taken. All this translates into a significant increase in operational efficiency, optimization of activities and use of resources, generating tangible economic benefits and improving business decisions.

Several advanced analytics tools can bring an anomaly detection in a business context. Languages like Python or platforms like Dataiku or Amazon Sagemaker offer the possibility to explore different algorithms and allow to implement effective anomaly detection system.

Anomaly detection presents itself as an important resource to ensure the stability and efficiency of operations, and Blue BI can help you adopt this solution in your company.

We realize Business Intelligence & Advanced Analytics solutions to transform simple data into information of freat strategic value.

Table of Contents