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 model consists of several key components:
- 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.
- 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.
- Probabilistic Modeling: These interactions are aggregated to define the event probability using a softmax-like function.
- 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.
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