I. Introduction

Nowadays, IT activities generate a significant amount of high-dimensional sensor data. Although big data analytics and deep learning have made handling massive amounts of data possible, identifying irregularities in such data remains challenging due to the vast volume, noise, and uneven data distribution that make it difficult to detect anomalies. This phenomenon is called the ‘dimensionality curse’ (). Moreover, anomalies can arise from interactions between multiple causes, which further complicates the detection process. This problem domain is particularly crucial in data-driven industries that generate many unstable, dispersed, and multimodal time series datasets, such as source management, autonomous driving, and the Internet of Things (IoT).

Anomalies reveal unusual characteristics within the systems and entities responsible for supplying data. These atypical traits offer valuable insights for real-world applications. Detecting data anomalies can uncover outliers, identify environmental conditions requiring human attention, or optimize computing resources by preemptively filtering undesired data segments. For cloud systems, promptly identifying anomalies following an incident is crucial in preventing more significant failures that may impact customers (). The research also explained that intrusion detection plays a vital role in computer network systems by distinguishing between illegal and malicious behaviors. Another aspect that the research covered was the electrocardiography (ECG) signals for assessing heart conditions in medicine. Typically, medical practitioners manually evaluate the resulting time series signal to detect arrhythmia. Finally, a multivariate industrial time series monitors these processes, incorporating data from sensors and control systems within the gas-oil plant heating loop (GHL). An LSTM-based technique is used to detect defects in this context.

Anomaly detection involves identifying data points, patterns, or traffic that significantly deviate from a system’s expected behavior. Outliers that deviate substantially from the rest of the distribution are labeled as anomalies (). Anomaly detection is essential for creating trustworthy computer systems () in commercial, industrial, healthcare, and military applications to ensure crucial processes or decisions are safe (). Anomaly detection based on statistical, rule-based, machine learning, and neural networks with unsupervised methods is becoming increasingly important. These methods provide fast inference speed, improve quality of service, and efficiently manage high-dimensional time series data ().

Various statistical, rule-based, and machine-learning methods have previously been developed to find abnormalities in time series data. Rule-based methods compare data to an anomaly rule, which can be flawed and require frequent updates, making it time-consuming. Statistical methods estimate parameters based on a particular distribution but may fail to capture underlying nonlinearities and dynamical linkages. Machine learning approaches come in three types: supervised, unsupervised, and weakly supervised learning. Unsupervised techniques such as One-Class Support Vector Machine (OC-SVM) (), k-Nearest Neighbor (KNN) (), Support Vector Data Description (SVDD) (), Expectation Maximization (EM) (), Histogram-Based Outlier Score (HBOS) (), Local Outlier Factor (LOF) (), and Local Density Cluster-based Outlier Factor (LDCOF) () have already been employed for identifying anomalies in time series data. However, they may have issues in capturing temporal correlation and performance. Statistical methods such as wavelet theory, Hilbert transform (), principal component analysis (PCA) (), and Markov chain models () has also been used for time series data analysis. Recently, machine learning methods such as SVM (), Regression models (), and clustering () have been created to forecast the distribution of time series data. However, memory constraints can limit their ability to detect temporal patterns.

Anomaly detection methods using deep learning have attracted interest and become popular due to their ability to handle challenging detection problems in various real-world applications. Recurrent neural networks (RNNs) can be a good option to solve sequence modeling problems. However, traditional RNNs struggle to capture remote relationships due to gradient disappearance in long-sequence modeling problems. Popular RNN () variations, including gated recurrent unit (GRU) () and long short-term memory (LSTM) () have already been created to get around this restriction. In modeling temporal patterns, RNNs can benefit from the attention mechanism. However, the computational intensity and slow speed of recursive models such as LSTM hinder their ability to replicate long-term trends accurately. In contrast, some time-series anomaly detection tasks, such as detecting anomalies in sensor data or financial transactions, may require detecting subtle deviations from normal behavior over long periods. The dual-path network has been proposed as an effective method to solve this problem ().

Recently, the Transformer model’s encoding of large sequences allows for almost independent accuracy and inference time, making it an excellent choice for anomaly detection models that mine long-term dependencies and deal with nonlinear dynamics. Nonetheless, the Transformer model can only handle sequences with a length of a few hundred (). The Transformer model has a significant computational complexity for extended sequences, and the training is slow. To address these issues, recent research has proposed combining temporal convolution networks (TCN) with transformers to capture temporal dependencies while avoiding the pitfalls of recursive models ().

While there have been notable improvements in anomaly detection for time series data, conventional statistical approaches and machine learning algorithms have limitations in effectively handling nonlinear, high-dimensional, and noisy data. Although LSTM and GRU neural networks can capture contextual information, they face challenges due to their slow inference speed and inefficiency. On the other hand, transformers demonstrate strengths in parallelization and capturing long-range dependencies in input sequences. However, slow training and high computational complexity hinder their performance on longer sequences.

Based on the aforementioned considerations, we introduce a novel model called KBJNet, which integrates the TCN and transformers architectures using a dual-path network for detecting abnormalities in multivariate time series data. The KBJNet model incorporates an adaptable multi-head mechanism for attention that comprehensively captures the characteristics of each dimension in the data, enabling effective anomaly detection. Our key contributions include:

  • Our study proposes a new model architecture for capturing anomalies involving a combination of dilated TCN and transformers. The TCN utilizes dilation convolution to establish a perceptual field. To ensure a global perceptual field that covers the whole input sequence, the minimum number of convolutional layers is determined based on factors such as the input sequence length, convolution kernel size, and dilation coefficient. In other words, the range of the dilation convolution is adjusted to encompass the entire input sequence.
  • We embed this combined TCN and transformers into a dual-path network, which enhances its efficiency and effectiveness for modeling extremely long sequences and high dimensions.
  • We introduce a dual path network that utilizes a shared TCN Attention mechanism for assigning weights to time steps. This approach facilitates recognizing and prioritizing crucial information within a multivariate time series.
  • Our method has undergone comprehensive testing on standard datasets and has demonstrated superior performance compared to the current leading techniques in benchmark tests.

II. Literature Review

This section presents a comprehensive literature review on anomaly detection, emphasizing three crucial areas: statistical and machine learning approaches, neural network and deep learning techniques, and the current state-of-the-art. Table I summarizes terminologies used in this study.

Table I

Summary of terminology used.


TERMINOLOGYDEFINITION

ARIMAAutoregressive Integrated Moving Average

AUCArea under the ROC Curve.

CAVConnected and Autonomous Vehicle

COPODCopula-Based Outlier Detection

CPODCore Point-based Outlier Detection

DAGMMDeep Autoencoding Gaussian Mixture Model

DTAADDual Tcn-Attention Networks for Anomaly Detection in Multivariate Time Series Data

ECGElectrocardiography

EVTExtreme Value Theory

FFNFeedforward Neural Network

GANGenerative Adversarial Network

GDNGraph Deviation Networks

GHLGas-oil Plant Heating Loop

GPDGeneralized Pareto Distribution

GRUGated Recurrent Unit

GTAGraph Learning with Transformer for Anomaly Detection

HBOSHistogram-Based Outlier Score

IoTInternet of Things

KBJNetKinematic Bi-Joint Temporal Convolutional Network Attention for Anomaly Detection

KDDKnowledge Discovery and Data Mining

KNNk-Nearest Neighbor

LDCOFLocal Density Cluster-based Outlier Factor

LOFLocal Outlier Factor

LSTMLong Short-Term Memory Networks

LSTM-VAELong Short-Term Memory Networks and Variational Autoencoder

MAD-GANMultivariate Anomaly Detection for Time Series Data with Generative Adversarial Networks

MAMLModel-Agnostic and Meta-Learning

MBAMIT-BIH Supraventricular Arrhythmia Database

MSCREDMulti-Scale Convolutional Recurrent Encoder-Decoder

MSDSMaterial Safety Data Sheet

MSEMean Squared Error

MSLMars Science Laboratory

MTAD-GATMultivariate Time-Series Anomaly Detection via Graph Attention Networks

MTSMultivariate Time Series

NABNumenta Anomaly Benchmark

NSIBFNeural System Identification and Bayesian Filtering

PCAPrincipal Component Analysis

POTPeaks Over Threshold

ReLURectified Linear Unit

RNNRecurrent Neural Network

SMAPSoil Moisture Active Passive

SMDServer Machine Dataset

SoTaState of the Art

SVDSupport Vector Data

SVDDSupport Vector Data Description

SVMSupport Vector Machine

SWaTSecure Water Treatment

TCNTemporal Convolutional Network

TranADDeep Transformer Networks for Anomaly Detection in Multivariate Time Series Data

TWSVMTwin Support Vector Machine

USADUnsupervised Anomaly Detection

UTRADAnomaly Detection and Localization with U-Transformer

WADIWater Distribution

A. Statistical and machine learning

Several commonly used time series anomaly detection techniques include 3sigma, PCA, KNN, copula-based outlier detection (COPOD), LOF, and OC-SVM. The 3sigma method measures deviations from historical averages, while PCA calculates eigenvector distance differences according to Shyu et al. (). KNN determines anomalies based on the mean distance of nearest neighbors, as discussed in Kiss et al. (). COPOD utilizes statistical probability functions, OC-SVM seeks to learn decision boundaries for typical observations, and LOF is an unsupervised method based on density, as described by Li et al. ().

Patcha & Park () introduced an outline of several methods for anomaly detection, including hidden Markov chains, PCA, process regression, and isolation forest, while also highlighting their limitations. Yaacob et al. () introduced an auto-regressive integrated moving average (ARIMA) method, as a representative statistical approach for modeling and detecting anomalous behaviors. Bandaragoda et al. () widely used isolation forest, which recursively divides the feature space using multiple isolation trees for anomaly detection.

In the healthcare sector, Salem et al. () utilized linear regression combined with SVM to capture anomaly detection in wireless sensor networks. Shang et al. () introduced SVM combined with mean clustering to increase the effectiveness of model training and enhance anomaly detection precision. Boniol et al. () presented GraphAn, a graph-based approach that converts time series data using interval graph distance. Tran et al. () employed clustering and database manipulation history in their outlier detection method, called CPOD. Kingsbury & Alvaro () proposed Elle, another outlier detection method that leverages clustering and database manipulation history.

In their study, Dhiman et al. () employed adaptive threshold techniques and Twin Support Vector Machines (TWSVM) to detect anomalies within two univariate time series data. They proposed these methods as effective approaches in their study. On the other hand, Wang et al. () focused on enhancing the security of CAV (connected and autonomous vehicle) systems. They used an adaptive extended Kalman filter with a pre-trained single-class SVM. Their strategy attempted to increase the CAV systems’ overall security.

B. Neural network and deep learning

Several deep learning-based methods have already been proposed to resolve it. For robust anomaly detection, LSTM-based neural network architecture is used by neural system identification and Bayesian filtering (NSIBF) for Bayesian filtering and system identification. EncDec-AD () used LSTM as the base cell for both the encoder and decoder. To recreate the error for each input data and produce a representation with low-dimension, deep autoencoding Gaussian mixture model (DAGMM) () uses a deep autoencoder. The advantage of this method is it will not exploit temporal information. Meanwhile, MSCRED () uses a convolutional encoder-decoder and an attention-based Conv-LSTM to recreate a multi-scale signature matrix. This will use residual signature matrices to detect anomalies, but it may take longer training time and limited performance with insufficient data.

Ergen and Kozat () introduced an algorithm that uses LSTM to transform dynamic data length sequences into sequences with static length, then a single-class support vector machine-based anomaly detector decision function or a support vector data description technique comes next. OmniAnomaly () proposed a recurrent neural network incorporating stochasticity to identify irregularities in multivariate time series data. LSTM-VAE () combined LSTM and variational autoencoder but overlooked the interconnection between stochastic variables. Multivariate anomaly detection for time series data with generative adversarial networks (MAD-GAN) () adopts generator and discriminator base models in the GAN framework that utilizes LSTM-RNN to visualize time series distributions’ temporal relations. TCN-AE () ignores the correlation between time series and combines TCN and AE. Multivariate time-series anomaly detection via GAN (MTAD-GAT) () employs GAT (GATs) () in both the feature and time dimensions to capture temporal and feature correlations. Anomaly Transformer () proposed a minimax training strategy and used self-attention weights to identify anomalies. Graph learning with transformer for anomaly detection (GTA) () employed an architecture based on transformers to learn and capture temporal dependencies. They utilized this approach to acquire a graph structure that accurately represents the relationships between different elements within the data. Deep transformer networks for anomaly detection (TranAD) () incorporated adversarial training and self-conditioning techniques in a transformer-based model to improve performance.

Huang et al. introduced HitAnomaly, an anomaly detection model based on log analysis. HitAnomaly utilizes a hierarchical transformer structure to capture and represent both the sequences of log templates and their corresponding parameter values. The classification model developed by the researchers was constructed by incorporating an attention mechanism. Additionally, they devised separate log sequences and parameter value encoders to obtain their respective representations. The study provides evidence that the transformer model outperforms LSTM and illustrates the successful modeling of log sequences using a hierarchical framework. Using three log datasets, the results demonstrated that Other currently used log-based anomaly detection methods have not performed as well as HitAnomaly ().

Yu et al. () combines autoregressive (AR) and adaptive ensemble (AE) with the addition of the transformer to capture the information of long sequences. Design convolution and dilated convolution as local TCN, introduce feedback mechanism, and loss ratio to improve detection accuracy and expand association differences.

C. State of the art

The deep learning methodology has promising performance in multivariate time series (MTS) anomaly detection. Various approaches, including transformer-based models, autoencoder-based models, and others, have been proposed, each with unique architectures and techniques. These models represent substantial progress in MTS anomaly detection and offer enticing possibilities for future research endeavors. However, a notable challenge in deep learning methodologies is the slow training process and the considerable computational complexity, potentially hindering their efficacy, particularly when dealing with longer sequences. We summarize the features of the state-of-the-art methods in Table II, highlighting the capabilities of our proposed method.

Table II

Summary of literature review multivariate time series.


METHODAPPROACHMAIN ARCHITECTURESUPERVISED/UNSUPERVISEDABLE TO HANDLE LIMITED DATAINTERPRETABILITY

DAGMM ()ForecastingAEUnsupervised××

HitAnomaly ()ForecastingTransformerSupervised××

TCN-AE ()ReconstructionAEUnsupervised××

OmniAnomaly ()ReconstructionVAEUnsupervised××

LSTM-VAE ()ReconstructionVAESemi××

GTA ()ReconstructionGNNSemi××

MSCRED ()ReconstructionAEUnsupervised×

MAD-GAN ()ReconstructionGANUnsupervised××

USAD ()ReconstructionAEUnsupervised××

MTAD-GAT ()HybridGNNSupervised×

CAE-M ()HybridAEUnsupervised××

GDN ()ForecastingGNNUnsupervised×

TranAD ()ReconstructionTransformerUnsupervised

DTAAD ()ReconstructionTransformerUnsupervised

KBJNetReconstructionTransformerUnsupervised

III. Methodology

In this section, we present a comprehensive methodology for addressing the problem formulation of anomaly detection using a combination of advanced machine learning techniques. Our methodology encompasses various stages, including data preprocessing, the implementation of dilated temporal convolutional networks (TCN), transformers, and a novel kinematic bi-joint TCN and transformer model. We also describe the training, meta-learning techniques, and inference procedures for efficient anomaly detection and diagnosis. Furthermore, we provide a summary of the performance measures employed to assess the efficiency of our approach in detecting anomalies. By integrating these components, our methodology offers a resilient and precise solution for identifying anomalies in real-world applications.

A. Preprocess

We examine a set of data points or observations organized in a time-stamped sequence and numerous variables. Each datapoint in the set T is gathered at a unique timestamp t, forming the datapoints xt of the set T. Each xt belongs to the vector space of real numbers with dimension m, for all values of t. In the univariate setting, m = 1. We assume that the joint probability of the entire time series x can be factorized into a product of conditional probabilities, where each observation at time t is conditionally dependent on the past observations x1(i),x2(i),,xt1(i) in the same time series component i.

Given a multivariate time series input as the sum of values zi,1:t0l for each time series i and dimension l. Each zi,1:t0l represents a sequence of values zi,1l,zi,2l,,zi,1:t0l in the l-th dimension of the time series data, where zi,1:t0l is a vector in m. Each data point xt(i) is a vector in m. To increase training stability and strengthen the resilience of KBJNet, we take steps to standardize datasets obtained from different sources.

In the data preprocessing stage, we filter out nonessential information from the datasets to concentrate only on the crucial data for anomaly detection. We exclude irrelevant details such as the source and description of the dataset and other unnecessary information. Instead, we emphasize essential elements like the dataset size, anomaly labels, and the time steps. Additionally, we standardize the data formats and specifications to ensure consistency throughout the dataset.

The data is normalized and transformed into time-series windows for training and testing. The normalization of the time-series data is conducted by applying the following equation:

(1)
xtxtmin(T)max(T)min(T)+ϵ,

B. Sliding window

To represent the relationship of a value xt in a specific timestamp t, we investigate a relevant window of a certain length K as

(2)
Wt={xtK+1,,xt}

For timestamps less than K, to incorporate replication padding, we extend the window Wt by adding a constant vector of length K-t. The input time series T is then converted into a sequence of sliding windows W={W1,,WT}. The use of sliding windows with replication padding helps preserve the data points’ local context, as shown in Figure 2.

Figure 1 

Kinematic bi-joint network architecture for anomaly detection.

Figure 2 

An illustration or depiction of data that involves multiple variables and occurs over a period of time.

Wt and Ot, the anomaly score st is computed.

The input window is labeled anomalous if its anomaly score is greater than the threshold value, which is calculated using the anomaly scores of the previous input windows.

C. Dilated TCN

We have developed a novel architecture to enhance feature-sharing efficiency while retaining the network’s ability to learn new features. Our approach involves implementing a bi-joint TCN design in which all blocks share a common dilated TCN. This approach significantly reduces redundancy in the feature extraction process while enabling the network to learn new features through its densely connected path.

The dilated convolution operation, concluded in Figure 3, is used in convolutional neural networks, known as a jump filter, that expands the receptive field exponentially in each layer. For a 1-D sequence input xn and a convolutional filter f={0,,k1}, the operation F on an element s of the sequence is defined as

(3)
(s)=(x*df)(s)=i=0k1f(i)xsdi

where d denotes the dilation factor, k is the convolutional filter size, and sdi indicates the index to the past according to d. In general, the receptive field r of a 1D convolutional network with n layers and a kernel size of k is given by r=1+n(k1). To completely cover the input length, we set the number of layers n such that n=(l1)/(k1), where is rounded up. However, this causes the network to become too deep, resulting in a model with many parameters. We obtain a minimum number of layers required by the global TCN ().

Figure 3 

The convolution has specific dilation factors of 1, 2, and 4 and a kernel size of 3. The input is represented as x, and the output is represented as y.

Our proposed approach involves feeding the decoder output back into the same TCN for additional processing, which helps the model improve the input data representation over time. This process potentially captures more complex patterns. The feedback loop between the decoder facilitates the model’s learning and adjustment to the input data.

D. Transformer

The Transformer model, widely used in natural language processing and machine vision, is based on attention. Attention scoring computes the dot product of dk-dimensional queries and keys and the dv-dimensional value, then applies a softmax activation function to the result to obtain weights multiplied by the value. This scoring function is efficient and compact. In the transformer, inputs undergo a transformation process, creating query, key, and value matrices Q, K, and V. To simplify the subsequent neural network model inference operations, the matrix V is compressed into a smaller representative embedding space using the softmax distribution to generate convex combination weights. The square root of the dk is used to stabilize the model’s gradient, reduce weight fluctuations, and promote more stable training.

(4)
Attention(Q,K,V)=softmax(QKTdk)V,

where Q, K, and V are matrices in n×dmodel, and dmodel is a learned dimension. Multi-headed attention enables the model to focus on diverse information simultaneously, and the result is concatenated and transformed using a linear projection to obtain dmodel-dimensional features. The model consists of two encoders and one decoder, with position encoding added to the output of the model’s first half to obtain the encoders’ input.

Position encoding is performed using sine and cosine functions where pos is the token’s position in the sequence, i is the index of the dimension in the encoding, and d_model is the dimension of the model. The FFN layers apply two linear layers with leaky ReLU activation functions to the input data. The first FFN’s output was then routed through the second linear layer to generate the FFN’s final output. In the decoder, the last FFN is then passed through by a sigmoid activation function.

E. Kinematic bi-joint TCN and transformer

The kinematic bi-joint TCN and transformer, as concluded in Figure 1 model processes input from a dilated TCN with dimensions (B, L, C), where B is the batch size, and L is the sequence length, and C is the number of features. The input is normalized using LayerNorm, which calculates the mean (μ) and variance (σ2) along the feature dimension as follows:

(5)
μ=1Ll=1LXblc
(6)
σ2=1Ll=1L(Xblcμ)2

The normalized input X^blc at position (b, l, c) is obtained by subtracting μ from Xblc and dividing by the square root of σ2+ϵ, where ϵ is a small constant added for increasing numerical stability:

(7)
X^blc=Xblcμσ2+ϵ

The normalized tensor is then adjusted by scaling and shifting using γc and βc learnable parameters to get the output Yblc of the LayerNorm operation at position (b, l, c):

(8)
Yblc=γcX^blc+βc

Both γc and βc are learnable parameters updated during training. The sliding window output T is then transferred to a stack of B bi-joint TCN transformer blocks.

Each bi-joint block part of our model comprises one transformer encoder and one decoder. We then combine the output of the first part of the model with position encoding to obtain the input Ii, which is then passed through two separate encoders:

(9)
Ii1=Layer-Norm(Ii+MultiHead(Ii,Ii,Ii))
(10)
Ii1=Layer-Norm(Ii+MultiHead(Tb,Tb,Tb))

where i{1,2} for the first and second encoder. The encoder’s output is then connected to the feedforward layer using residual connections and sent separately to the two decoders to obtain the final predicted outputs:

(11)
Ii3=Ii2+FFN1(LeakyReLU(FFN2(Ii2)))
(12)
Oi=Sigmoid(FFN(Ii3))

The sigmoid activation function is used to constrain the output range of Oi to be between 0 and 1, which is suitable for the later error reconstruction with the normalized sliding window input.

F. Procedure for training

We use mean squared error (MSE) as the loss criterion to measure the error between the output prediction of each decoder and the original input window xt. We calculate the losses of the two decoders as L1 and L2, respectively, using the following equations:

(13)
L1=1ni=1n(O1xi)2,L2=1ni=1n(O2xi)2

To obtain the total loss , we combine the losses of the two decoders from the first TCN and the second TCN by taking a weighted sum with a hyperparameter λ. The goal is to minimize the total loss of the hyperparameters W and model parameters Θ:

(14)
{Θ*,W*}=argminΘ,WxX(ψ(ϕ(x;Θ);W))

where ϕ represents the overall network with total model parameters Θ, W denotes the collection of hyperparameters, and ψ represents the overall learning mapping for anomaly detection task.

G. Meta learning

To improve the training of our KBJNet model with limited data, which exists in Algorithm 1 line 12, In every training epoch, we update the weights of neural networks θ with a gradient descent step using the loss function L and the learning rate α.

Algorithm 1 

The KBJNet Training Algorithm.

This gives us the updated weights θ¢. Model-agnostic and meta-learning (MAML) () is performed at the end of each epoch using the updated weights to update the model parameters θ with a meta step-size β. As a result, the model can be trained quickly with limited data. The algorithm can be written as:

(15)
θθαθL(f(θ)),θθβθL(f(θ))

H. Inference procedure, anomaly detection, and diagnosis

Our approach, as concluded in Algorithm 2, involves performing online inference sequentially on a sliding window of input data, generating anomaly scores for each timestamp in each dimension. The Peak Over Threshold () approach is used to dynamically select thresholds for each dimension by applying the Extreme Value Theory (EVT) to the univariate time series of anomaly scores obtained during offline training. Instead of manually setting thresholds and making assumptions about the distribution, we use the Generalized Pareto Distribution (GPD) () function following EVT to fit the data and determine the appropriate value-at-risk (label) for dynamically setting the threshold, which is consistent with OmniAnomaly (), TranAD (), and DTAAD () (Figure 4).

Algorithm 2 

The KBJNet Testing Algorithm.

Figure 4 

Visualization of anomaly prediction.

IV. Experiments

We did tests to assess the effectiveness of our model, KBJNet. The dataset used in our experiments, as well as the performance metrics used, are described. We compared KBJNet with the most widely used models and advanced methods currently available as part of our baseline performed tests. We determined the hyperparameter values using the following values:

  • Optimizer = Adam
  • Learning rate = 0.009 and 0.5 step size step-scheduler
  • Window size = 5
  • Convolutional kernel size TCN = 3
  • Transformer encoders = 2
  • Layers of the encoder’s hidden units = 1
  • Encoders dropout = 0.2

A. Dataset sources

We use nine datasets in our experiments (eight public data sets). Table III shows the details of datasets. As an illustration, the SMAP dataset contains 55 distinct entities, each with 25 dimensions.

Table III

Dataset characteristics.


TYPEDIMENSIONSTRAINVALIDATIONANOMALIES RATE (%)

MSDS10 (1)1464301464305.37

SMD38 (4)7084207084204.16

SWaT51 (1)49680044991911.98

MSL55 (3)583177372910.72

SMAP25 (55)13518342761713.13

MBA2 (8)1000001000000.14

UCR1 (4)160059001.88

NAB1 (6)403340330.92

WADI123 (1)10485711728015.99

  1. Numenta Anomaly Benchmark (NAB) is an actual data stream containing marked exceptions from various sources, ranging from social media to temperature sensors to server network utilization (). We removed incorrectly tagged sequences of anomalies from this dataset for our performed tests.
  2. HexagonML (UCR) is a multivariate time series dataset used in the KDD 2021 cup (). We only used the portion of the dataset obtained from the real world.
  3. MIT-BIH Supraventricular Arrhythmia Database (MBA) contains standard test materials for arrhythmia detectors (). This dataset has been used in around 500 studies of cardiac dynamics.
  4. Soil Moisture Active Passive (SMAP) is a 25-dimensional dataset collected by NASA that contains telemetry information anomaly data extracted from Anomalous Event Anomaly (ISA) reports from spacecraft monitoring systems ().
  5. Mars Science Laboratory (MSL) is a SMAP-like dataset that includes actuator and sensor data from the Mars rover itself. We used only three non-trivial sequences (A4, C2, and T1) dataset in Hundman et al. ().
  6. Secure Water Treatment (SWaT) consists of data obtained from 51 sensors in a continuously operating water treatment system (). The data includes water level, flow rate, and other sensor readings.
  7. Server Machine Dataset (SMD) was gathered over five weeks from a major internet company (). SMD was split into two sets of the same size, one used for training and the other for testing. Only the four non-trivial sequences from this dataset were utilized.
  8. Multi-Source Distributed System (MSDS) consists of application logs, metrics, and distributed traces from a multi-source distributed system ().
  9. Water Distribution (WADI) refers to an expansion of the SWaT system, which includes over two times the sensors and actuators compared to the original SWaT model. Additionally, the dataset was obtained over a longer period of time, covering 14 days for normal scenarios and two days for attack scenarios system ().

B. Result and analysis

We comprehensively compared our newly proposed algorithm, KBJNet, and several state-of-the-art algorithms in the field, such as MSCRED, MAD-GAN, USAD, MTAD-GAT, CAE-M, GDN, and DTAAD. To evaluate the performance of these algorithms, we employed a set of relevant metrics, including Precision (P), Recall (R), Area Under Curve (AUC), and F1 scores. We partition the data into 80% and 20% subsets for training purposes, respectively. This division allows us to examine how the models perform when provided with limited training examples and when trained on a larger volume of data. By assessing the model’s behavior in these contrasting scenarios, we can gain valuable insights into its scalability and generalization capabilities and identify potential challenges that may arise in real-world applications with varying data availability. This evaluation provides a comprehensive understanding of how our models perform with substantial data and a limited dataset, allowing us to make informed decisions regarding their suitability for different operational environments.

1) Performance with 20% of the training dataset: Recently developed models, including unsupervised anomaly detection (USAD), multivariate time-series anomaly detection via graph attention networks (MTAD-GAT), and graph deviation networks (GDN), utilize attention mechanisms to concentrate on particular features of the data and capture long-term trends by adjusting neural network weights. However, KBJNet, which utilizes self-attention, outperforms USAD, MTAD-GAT, and GDN across all datasets as shown Table V. USAD and MTAD-GAT have constraints when classifying anomalies that occur over an extended period because they only consider a local contextual window. To surpass this restriction, KBJNet utilizes self-conditioning on embedding the entire trace along with position encoding, which enhances temporal attention, except for DTAAD on the MBA dataset. The utilization of a meta-learning strategy with MAML enables KBJNet to swiftly acquire anomaly features within sequential data, even with a limited dataset volume (Figure 5). By employing only 20% of the available data, the performance of TranAD and DTAAD closely approaches that of KBJNet, primarily due to their utilization of a generative adversarial training approach for training the encoder-decoder structure. In general, KBJNet demonstrates better performance compared to all other methods.

Table V

Comparison of KBJNet model with baseline methods with 20% of anomalies dataset.


METHODNABUCRMBASMAPMSLSWATSMDMSDSWADI









AUC*F1*AUC*F1*AUC*F1*AUC*F1*AUC*F1*AUC*F1*AUC*F1*AUC*F1*AUC*F1*

MSCRED0.82980.70120.96360.49280.94980.91070.98100.80490.97960.82310.83840.79210.97670.80030.77150.82820.60280.0412

MAD-GAN0.81930.71080.99580.82150.95490.91910.98760.84670.96480.81890.84550.80110.86340.93170.50010.73890.53820.0936

USAD0.72680.67820.99680.85390.96980.94260.98840.83800.96500.81910.84390.80880.98550.92140.76140.83900.70120.0734

MTAD-GAT0.69570.70120.99750.86720.96890.94260.98150.82260.97830.80250.84600.80800.97990.66620.61230.82490.62680.0521

CAE-M0.73130.71270.99270.75260.96170.90030.98930.83130.98370.73040.84590.78420.95700.93190.60020.83900.61100.0782

GDN0.83000.70140.99380.80300.96720.93170.98880.84120.94150.89600.83910.80730.98120.71080.68200.83900.61220.0413

TranAD0.92160.84200.99830.92110.99460.98970.98840.89360.98560.91710.84610.80930.98470.87940.81120.83890.68520.0698

DTAAD0.93300.90570.99840.92200.99550.99120.98940.89960.98640.92120.84600.80870.98660.89410.81150.83900.78180.0977

KBJNet0.99990.92310.99990.93280.99320.98690.98940.90070.99070.94510.84600.80870.99860.99830.98290.91070.84530.1511

Figure 5 

Results in UCR.

2) Performance with 80% of the training dataset:Table IV provided illustrates a comparison between the KBJNet approach and other baseline methods in terms of performance metrics related to anomaly detection.

Table IV

Comparison of KBJNet model with baseline methods with 80% of the training dataset.


METHODNABUCRMBASMAPSWaT





PRAUCF1PRAUCF1PRAUCF1PRAUCF1PRAUCF1

MSCRED0.85210.67000.84000.75010.54400.97170.99190.69750.92711.00000.97980.96220.81740.92150.98200.86630.99910.67690.84320.8071

MAD-GAN0.86650.70110.84770.77510.85370.98900.99830.91640.93951.00000.98350.96880.81560.92150.98900.86530.95920.69560.84620.8064

USAD0.84210.66670.83320.74430.89531.00000.99900.89530.89540.99900.97020.94440.74810.96280.98900.84190.99770.68790.84600.8143

MTAD-GAT0.84220.72730.82220.78030.78130.99730.99790.87620.90191.00000.97200.94830.79920.99920.98460.88820.97190.69580.84650.8110

CAE-M0.79190.80200.80200.79690.69821.00000.99580.82230.84430.99980.96620.91550.81940.95680.99020.88280.96980.69580.84650.8102

GDN0.81300.78730.85430.79990.68950.99890.99600.81590.88330.98930.95290.93330.74810.98920.98650.85190.96980.69580.84630.8102

TranAD0.88890.98920.95410.93640.94071.00000.99940.96940.95761.00000.98860.97830.81040.99980.98870.89530.99770.68790.84380.8143

DTAAD0.88890.99990.99960.94120.88801.00000.99880.94070.96081.00000.98960.98000.82200.99990.99110.90230.96970.69570.84620.8101

KBJNet0.88890.99990.99960.94120.99991.00000.99990.99990.98051.00000.98980.98050.83020.99990.99010.90720.97180.69570.84630.8109

METHODSMDMSLMSDSWADI




PRAUCF1PRAUCF1PRAUCF1PRAUCF1

MSCRED0.72750.99730.99200.84130.89110.98610.98060.93620.99980.79820.89420.88780.25120.73180.84110.3740

MAD-GAN0.99900.84390.99320.91490.85150.99290.98610.91680.99810.61060.80530.75780.22320.91230.80250.3587

USAD0.90610.99750.99340.94960.79490.99120.97950.88220.99130.79600.89800.88290.18740.82970.87240.3057

MTAD-GAT0.82110.92160.99220.86840.79180.98250.98900.87690.99200.79650.89830.88350.28190.80130.88220.4170

CAE-M0.90810.96700.97820.93680.77521.00000.99040.87340.99090.84400.90140.91150.27830.79170.87270.4118

GDN0.71710.99750.99250.83430.93090.98930.98150.95920.99900.80270.91060.89000.29130.79320.87780.4261

TranAD0.90510.99730.99330.94900.90370.99990.99150.94930.99980.86250.90120.89040.39590.82950.89980.5360

DTAAD0.84630.99740.98920.91470.90380.99990.99180.94950.99990.80260.90130.89050.90170.39100.69500.5455

KBJNet0.99850.99740.99870.99850.90380.99990.99160.94960.95920.95540.92480.95730.84650.82960.91300.8379

The POT method is used in models such as TranAD, DTAAD, and KBJNet to determine more precise threshold values by considering localized peak values in data sequences. Models like MSCRED use sequential observations as input and retain temporal information, but they may not detect anomalies close to normal trends. KBJNet addresses this issue by amplifying errors using a bi-joint network, enabling it to detect even mild anomalies in datasets such as SMD, where abnormal data is relatively close to regular data, shown in Figure 10.

Figure 10 

Ground truth and predicted for the SMD using the KBJNet.

MSCRED is effective in storing time information due to its continuous observation and good performance on partial datasets, but it struggles to identify anomalies close to normal and operates at a lower speed. The KBJNet architecture can effectively capture information from various dimensions simultaneously. At the same time, KBJNet can efficiently track input and capture long-range dependencies due to Position Encoding and residual connections. As seen in Figure 8, TranAD, DTAAD, and KBJNet demonstrate advantages over other models because they utilize meta-learning to accelerate model training. Among other models, MSCRED and GRU from the MTAD-GAT model make their operation speed quite inefficient as they are not executed in parallel. On large-volume datasets, their training time is slower than KBJNet. Apart from KBJNet, USAD considers time performance optimization with limited effect. Therefore, USAD and MAD-GAN adopt generative adversarial training, making USAD less computationally intensive than MAD-GAN. Figure 6 and Figure 7 illustrate the training time and inference time in all datasets.

Figure 6 

Training time in all datasets.

Figure 7 

Inference time in all datasets.

Figure 8 

Sensitivity to window size.

3) Sensitivity to the number of training epoch: The correlation between the performance of the anomaly detection model and the number of training epochs is illustrated in Table VI. It reveals that the model’s recall rate remains consistently high at 0.9974 across all training epochs. This indicates that the model can accurately identify the significance of the true positive cases and has a low rate of false negatives, which is important for effectively detecting anomalies in non-normal datasets. The AUC score, which evaluates the model’s performance, increases from 0.9200 in the first epoch to 0.9985 in the tenth. This indicates that the model’s ability to accurately differentiate between anomalies and normal data points improves with increased training epochs. The F1-Score shows an increasing trend from 0.9393 in the second epoch to 0.9972 in the tenth. This suggests that the model achieves a better balance between precision and recall as the number of training epochs increases, which is important for an effective anomaly detection model.

Table VI

The connection epochs and the performance on SMD datasets.


EPOCHPRECISIONRECALLAUCF1-SCORE

10.95670.84400.92000.8968

20.88760.99740.99220.9393

30.88310.99740.99190.9368

40.89960.99740.99290.9460

50.96620.99740.99690.9815

60.99850.99740.99860.9979

70.99960.99740.99870.9985

80.99920.99740.99860.9983

90.99850.99740.99860.9979

100.99700.99740.99850.9972

4) Sensitivity to window size: In this study, we present our findings derived from three multivariate datasets: SMD, MSDS, and WADI. This choice is based on the consistently better performance demonstrated by KBJNet across diverse datasets. Increasing the window size can affect the time dependency values in the data. A larger window size will result in increased dependency on other data points. This enhancement also impacts the speed of anomaly detection. Figure 8 illustrates the detection results for four window sizes across three datasets. Better performance is observed with window sizes of 5 and 20 for SMD and 20 for WADI. The results suggest that smaller windows are more suitable for datasets with weak dependencies. In the case of the SMD dataset, a decrease in performance is evident when the window size reduces the model’s generalization ability. Moreover, larger windows increase memory and computational requirements, thus slowing down the training process.

5) Sensitivity to MAML: The utilization of MAML enables KBJNet to swiftly discern unusual patterns in sequential data, even when dealing with a limited dataset (Table VII). The response of KBJNet to different datasets with varying K values in a sensitivity analysis is contingent upon the specific dataset under consideration. The effectiveness of MAML varies based on the degree of similarity between the meta-tasks and the target task. The findings suggest that selecting smaller K values in MAML is more suitable. In the case of the MSL dataset, we observe a deterioration in performance as K increases in SMD, impacting both computational efficiency and overall performance. Furthermore, larger K values impose greater computational demands and result in a slowdown of the training process.

Table VII

Sensitivity KBJNet to MAML 20% datasets according to meta step-size.


METHODS5101520

NAB0.92310.90570.90570.9231

UCR0.93280.93280.93280.9328

MBA0.98690.98710.98670.9871

SMAP0.90070.89260.89260.9338

MSL0.94510.89980.89980.8998

SWaT0.80870.80870.80940.8087

SMD0.99830.99700.98200.9983

MSDS0.91070.91070.91070.9107

WADI0.15110.11040.12080.1071

6) Sensitivity to kernel size: In these findings, we maintained the global TCN layer and adjusted the filter size by altering the receptive field. Once again, we experimented using SMD, MSDS, and WADI datasets. The results are presented in Figure 9. Optimal performance was achieved for the SMD and MSDS datasets, with a slight decrease observed for WADI. Therefore, kernel size becomes a consideration. However, due to the consistent expansion factor, kernel size changes do not significantly impact the final results.

Figure 9 

Sensitivity to kernel size.

7) Ablation analysis:Table VIII summarizes the F1 scores and AUC values for KBJNet and its ablated versions, each with 80% of the training dataset. First, our proposed KBJNet model has proven effective as it achieves the highest performance regarding both AUC and F1 scores on most datasets.

Table VIII

F1 scores and AUC for KBJNet with 80% of the training datasets.


ComponentNABUCRMBA



AUCF1AUCF1AUCF1

KBJNet0.99960.94120.99990.99990.98980.9805

(-)Bi-Joint TCN0.99960.94110.99860.93270.98980.9787

(-)MAML0.99960.94120.99900.95270.98890.9787

(-)Transformer0.93250.90500.99800.91880.99260.9858

COMPONENTSMAPMSLSWAT



AUCF1AUCF1AUCF1

KBJNet0.99010.90720.99160.94960.84630.8109

(-)Bi-Joint TCN0.99030.90830.95650.78480.84620.8101

(-)MAML0.98900.89740.95730.78780.84620.8101

(-)Transformer0.98530.86820.97000.84120.84590.8086

COMPONENTSMDMSDS


AUCF1AUCF1

KBJNet0.99870.99850.92480.9573

(-)Bi-Joint TCN0.99110.87320.98090.8991

(-)MAML0.99230.87900.97840.8872

(-)Transformer0.98520.85820.97890.8937

We conducted ablation experiments on the KBJNet model to evaluate the impact of each component by removing the bi-joint TCN, MAML, and transformer from the KBJNet model. From Table VIII, by observing the results, it is evident that eliminating the bi-joint TCN module slightly reduces the F1 scores for most datasets. However, its effect on the AUC scores of the UCR, MBA, SMAP, and MSL datasets is more pronounced. This indicates that the bi-joint TCN module contributes significantly to capturing temporal dependencies and enhancing the overall effectiveness of the KBJNet model.

Next, we observe that removing the MAML module has a greater impact on the F1 scores than on the AUC values of most datasets, indicating that the MAML module contributes to improving the model’s ability to adapt to new tasks and data distributions. Finally, removing the transformer module exerts the greatest influence on the AUC values of the NAB and MSL datasets. This suggests that the transformer module is essential for capturing global contextual information and enhancing the model’s discriminative power. Figure 6 reveals that KBJNet requires significantly less time than the baseline methods. These findings indicate the lightweight nature of our model and highlight the benefits of incorporating positional encoding.

In summary The Table VIII, our ablation study confirms that the KBJNet model’s component contributes to performance as a whole in anomaly detection, with the bi-joint TCN module playing the most critical role in capturing temporal dependencies, followed by the MAML module for better adaptation to new tasks and the transformer module for capturing global contextual information.

V. Conclusion

This research developed the KBJNet, a novel anomaly detection model based on bi-joint TCN, which accurately identifies anomalies within multivariate time series data. Leveraging the power of the transformer architecture, our model adeptly handles lengthy data sequences.

Through rigorous experimentation across nine benchmark datasets, KBJNet outperforms established state-of-the-art methods, yielding substantial enhancements in F1 and F1* scores, ranging from 2% to 9%, for complete and compact datasets, respectively. We noticed that our algorithm did not surpass all aspects of the other algorithms. However, it is worth highlighting that KBJNet exhibited superior performance to most algorithms under consideration. Furthermore, KBJNet is versatile and can adapt for deployment across diverse devices, making it particularly well-suited for contemporary industrial and embedded systems demanding accurate and efficient anomaly detection.

To ensure a more comprehensive assessment of its efficacy, further experimentation with datasets from diverse fields will be beneficial. This broader testing approach will enable us to determine the model’s applicability and performance in various contexts beyond the industrial domain. Optimizing our model’s efficiency remains open to further research, potentially enhancing processing speed and resource utilization.