Entity Embedding-Based Anomaly Detection for Heterogeneous Categorical Events

Ting Chen, Lu An Tang, Yizhou Sun, Zhengzhang Chen, Kai Zhang

Abstract

Anomaly detection plays an important role in modern data-driven security applications, such as detecting suspicious access to a socket from a process. In many cases, such events can be described as a collection of categorical values that are considered as entities of different types, which we call heterogeneous categorical events. Due to the lack of intrinsic distance measures among entities, and the exponentially large event space, most existing work relies heavily on heuristics to calculate abnormal scores for events. Different from previous work, we propose a principled and unified probabilistic model APE (Anomaly detection via Probabilistic pairwise interaction and Entity embedding) that directly models the likelihood of events. In this model, we embed entities into a common latent space using their observed co-occurrence in different events. More specifically, we first model the compatibility of each pair of entities according to their embeddings. Then we utilize the weighted pairwise interactions of different entity types to define the event probability. Using Noise-Contrastive Estimation with "context-dependent" noise distribution, our model can be learned efficiently regardless of the large event space. Experimental results on real enterprise surveillance data show that our methods can accurately detect abnormal events compared to other state-of-the-art abnormal detection techniques.

Introduction

Real-world security logs—such as process interactions or network connections—are typically composed of heterogeneous categorical events. For example, a system log might record an event as [User: Admin, Process: bash, Destination: /etc/shadow, Time: 03:00 AM]. Detecting anomalies in such data is challenging due to two primary factors: the lack of natural distance metrics between categorical entities (e.g., comparing "User 1" to "User 50") and the combinatorial explosion of the event space, which makes it impossible to model every possible combination. Existing approaches often rely on manual heuristics or simplified statistics that fail to capture complex dependencies.

Methodology: The APE Model

The proposed APE (Anomaly detection via Probabilistic pairwise interaction and Entity embedding) model treats anomaly detection as a representation learning problem.

The APE model architecture, illustrating the flow from event entities to embedding lookup, pairwise interactions, and final probability calculation.

The model consists of several key components:

  1. Entity Embedding: Categorical values (e.g., user IDs, file paths) are mapped to $d$-dimensional vectors in a shared latent space where semantic similarity is represented by distance.
  2. Weighted Pairwise Interactions: Instead of modeling all entities simultaneously, APE calculates the compatibility of every pair of entities (e.g., User-to-Process) using a dot product of their embeddings, weighted by a learned parameter $w_{ij}$ that signifies the importance of that specific relationship.
  3. Probabilistic Modeling: These interactions are aggregated to define the event probability using a softmax-like function.
  4. Context-Dependent Noise-Contrastive Estimation (NCE): To handle the massive event space efficiently, the authors employ NCE. By using "context-dependent" noise—swapping a single entity in a real event—the model learns subtle dependencies that distinguish normal behavior from anomalies.

Experimental Results

The model was evaluated on two weeks of enterprise surveillance data: Process-to-Process (P2P) logs and Process-to-Internet (P2I) logs. Artificial anomalies were generated by randomly replacing entities to test the model's detection capabilities.

Performance comparison of APE against baseline methods using ROC and Precision-Recall (PRC) curves.

As shown in the performance curves, APE consistently outperforms state-of-the-art methods like Condition (heuristic-based) and CompreX (compression-based). On the P2P dataset, APE achieved an AUC-ROC of approximately 0.90, a significant improvement over the 0.63 achieved by the heuristic baseline. Furthermore, the NCE-based training allows APE to scale to millions of events, whereas compression-based methods often face prohibitive computational costs.

Discussion and Conclusion

APE provides both high performance and interpretability. Analysis of the learned weights ($w_{ij}$) reveals which entity relationships are most indicative of normal behavior; for instance, the relationship between source and destination processes was found to be more critical than the day of the week. Visualizations also showed that the model naturally clusters similar entities, such as "root" users or "working hours," in the latent space.

While APE is highly effective, future work could address its limitations, such as its current lack of temporal correlation modeling (treating events as isolated) and the "cold start" problem for extremely rare entities. Incorporating sequential dependencies and dynamic embeddings could further enhance its robustness in evolving security environments.

Reference: Chen, T., et al. (2016). Entity Embedding-Based Anomaly Detection for Heterogeneous Categorical Events. IJCAI-16.

Summary updated

BibTeX
@inproceedings{chen2016entity,
  author = {Ting Chen and Lu An Tang and Yizhou Sun and Zhengzhang Chen and Kai Zhang},
  title = {{Entity Embedding-Based Anomaly Detection for Heterogeneous Categorical Events}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2016},
  url = {https://openreview.net/forum?id=S1-_ONGdbr},
}
Figure