Boundary-Aware Contrastive Learning for Log Anomaly Detection

Log anomaly detection in modern distributed systems is challenging. Anomalous behaviors are rare. Manual labeling is expensive. Session boundaries are often set by fixed heuristics before model training. This fixed-boundary assumption is problematic because segmentation errors propagate into representation learning and cannot be corrected during optimization. To address this, this paper proposes BASN (Boundary-Aware Sessionization Network), a boundary-aware contrastive learning framework that jointly learns session boundaries and anomaly representations using a differentiable soft-reset mechanism. BASN does not treat sessionization as a separate step. Instead, it predicts boundary probabilities from event semantics and temporal gaps, then modulates end-to-end session-state updates. The session representations are optimized with self-supervised contrastive learning, enabling effective zero-shot anomaly detection and few-shot adaptation. Experiments on four benchmark datasets (BGL, HDFS, OpenStack, SSH) show strong zero-shot performance (area under the receiver operating characteristic curve, AUROC 0.935–0.975) and boundary alignment with expert-validated proxy segmentation (boundary F1 0.825–0.877). Comparative gains over baselines are reported in the article after bibliography correction, baseline verification, and expanded statistical analysis. BASN is also computationally efficient, requiring less than 10 ms per session on a Graphics Processing Unit (GPU) and less than 45 ms on a Central Processing Unit (CPU). This is compatible with real-time inference needs in the evaluated settings. However, cross-system transfer AUROC (0.735–0.812) remains below in-domain performance. Domain-specific adaptation is still needed for deployment in environments that differ greatly from the training domain.

Authors

Institutions

Publication Details

Journal
Applied Sciences
Published
2026-03-26
DOI
https://doi.org/10.3390/app16073208
Primary Topic
Software System Performance and Reliability
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Boundary-Aware Contrastive Learning for Log Anomaly Detection

Fouad Ailabouni, Jesús-Ángel Román-Gallego, Maria-Luisa Perez-Delgado, Laura Grande Pérez
Applied Sciences
Software System Performance and Reliability
article

Boundary-Aware Contrastive Learning for Log Anomaly Detection

Fouad Ailabouni, Jesús-Ángel Román-Gallego, Maria-Luisa Perez-Delgado, Laura Grande Pérez
article en

Abstract

Log anomaly detection in modern distributed systems is challenging. Anomalous behaviors are rare. Manual labeling is expensive. Session boundaries are often set by fixed heuristics before model training. This fixed-boundary assumption is problematic because segmentation errors propagate into representation learning and cannot be corrected during optimization. To address this, this paper proposes BASN (Boundary-Aware Sessionization Network), a boundary-aware contrastive learning framework that jointly learns session boundaries and anomaly representations using a differentiable soft-reset mechanism. BASN does not treat sessionization as a separate step. Instead, it predicts boundary probabilities from event semantics and temporal gaps, then modulates end-to-end session-state updates. The session representations are optimized with self-supervised contrastive learning, enabling effective zero-shot anomaly detection and few-shot adaptation. Experiments on four benchmark datasets (BGL, HDFS, OpenStack, SSH) show strong zero-shot performance (area under the receiver operating characteristic curve, AUROC 0.935–0.975) and boundary alignment with expert-validated proxy segmentation (boundary F1 0.825–0.877). Comparative gains over baselines are reported in the article after bibliography correction, baseline verification, and expanded statistical analysis. BASN is also computationally efficient, requiring less than 10 ms per session on a Graphics Processing Unit (GPU) and less than 45 ms on a Central Processing Unit (CPU). This is compatible with real-time inference needs in the evaluated settings. However, cross-system transfer AUROC (0.735–0.812) remains below in-domain performance. Domain-specific adaptation is still needed for deployment in environments that differ greatly from the training domain.

Applied SciencesVol. 16(7)
Universidad de Zamora (MX)
Openalex Percentile: Top 7%
Software System Performance and Reliability
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.