Skip to main content
QUICK REVIEW

[Paper Review] Detecting Anomalies in Software Execution Logs with Siamese Network

Shayan Hashemi, Mika Mäntylä|arXiv (Cornell University)|Feb 2, 2021
Software System Performance and ReliabilityComputer Science32 references4 citations
TL;DR

This paper proposes a Siamese LSTM network for anomaly detection in software execution logs, leveraging contrastive learning to embed normal and anomalous sequences such that similar sequences are close in embedding space. It achieves a state-of-the-art F1-score of 0.996 on the HDFS log dataset, with a novel pair generation method reducing training pairs by 3000× while maintaining high accuracy, and introduces unsupervised log evolution monitoring and visualization for interpretability.

ABSTRACT

Logs are semi-structured text files that represent software's execution paths and states during its run-time. Therefore, detecting anomalies in software logs reflect anomalies in the software's execution path or state. So, it has become a notable concern in software engineering. We use LSTM like many prior works, and on top of LSTM, we propose a novel anomaly detection approach based on the Siamese network. This paper also provides an authentic validation of the approach on the Hadoop Distributed File System (HDFS) log dataset. To the best of our knowledge, the proposed approach outperforms other methods on the same dataset at the F1 score of 0.996, resulting in a new state-of-the-art performance on the dataset. Along with the primary method, we introduce a novel training pair generation algorithm that reduces generated training pairs by the factor of 3000 while maintaining the F1 score, merely a modest decay from 0.996 to 0.995. Additionally, we propose a hybrid model by combining the Siamese network with a traditional feedforward neural network to make end-to-end training possible, reducing engineering effort in setting up a deep-learning-based log anomaly detector. Furthermore, we examine our method's robustness to log evolutions by evaluating the model on synthetically evolved log sequences; we got the F1 score of 0.95 at the noise ratio of 20%. Finally, we dive deep into some of the side benefits of the Siamese network. Accordingly, we introduce a method of monitoring the evolutions of logs without label requirements at run-time. Additionally, we present a visualization technique that facilitates human administrations of log anomaly detection.

Motivation & Objective

  • To address the challenge of imbalanced log anomaly detection datasets where anomalies are rare and non-anomalies dominate.
  • To develop a deep learning model that effectively leverages both normal and anomalous log sequences without requiring balanced training data.
  • To reduce the computational cost of Siamese network training through an optimized pair generation algorithm.
  • To enable robust anomaly detection under log evolution, a common issue in production systems.
  • To provide interpretable monitoring and visualization of log embeddings for human-in-the-loop analysis.

Proposed method

  • A Siamese network architecture is used, where two identical LSTM-based encoders process log sequence pairs to learn a shared embedding space.
  • The model is trained via contrastive loss to minimize distance between embeddings of same-class sequences (normal-normal or anomaly-anomaly) and maximize distance between different classes.
  • A novel pair generation algorithm inspired by negative sampling reduces training pair count by a factor of 3000 while preserving F1-score at 0.995.
  • A hybrid model combines the Siamese network with a feedforward neural network to enable end-to-end training and reduce engineering overhead.
  • An unsupervised fitness score is introduced to monitor log evolution by measuring the log-likelihood of embedded sequences under a Gaussian mixture model of training data.
  • T-SNE, UMAP, and PCA are used to visualize high-dimensional embeddings, enabling human interpretation of anomaly boundaries.

Experimental results

Research questions

  • RQ1Can a Siamese network-based approach outperform existing state-of-the-art methods in log anomaly detection on the HDFS dataset?
  • RQ2How can training efficiency be improved in Siamese networks for log anomaly detection without sacrificing performance?
  • RQ3To what extent is the proposed model robust to log sequence evolution due to software updates?
  • RQ4Can the learned embedding space be used to detect log evolution without requiring labeled data?
  • RQ5Can visualization of embedded log sequences improve human understanding and supervision of anomaly detection?

Key findings

  • The proposed Siamese network achieves an F1-score of 0.996 on the HDFS log dataset, setting a new state-of-the-art performance.
  • The novel pair generation algorithm reduces the number of training pairs by a factor of 3000, with only a minimal drop in F1-score from 0.996 to 0.995.
  • The model maintains strong robustness to log evolution, achieving an F1-score of 0.95 at a 20% noise ratio in synthetically evolved log sequences.
  • The fitness score metric successfully detects log evolution without requiring labels, enabling proactive retraining decisions in production.
  • Visualization using T-SNE, UMAP, and PCA clearly separates normal and anomalous log sequences in the embedding space, confirming the model’s discriminative capability.
  • The hybrid Siamese-feedforward model enables end-to-end training and improves practical deployment, with the Siamese component being critical for achieving high performance (F1 0.996 vs. 0.973 without it).

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.