Contrastive Representation Learning for Anomaly Detection in Cloud-Based Backend Services
Main Article Content
Abstract
This study proposes an anomaly detection method based on contrastive representation learning to address the challenges of complex multi-metric coupling, dynamic dependency variation, and label scarcity in backend service systems. The method first employs a multi-scale temporal encoding module to extract dynamic features at different time granularities, capturing both short-term fluctuations and long-term trends in system operation. An adaptive dependency modeling mechanism is then constructed, which generates dynamic graph structures through feature similarity projection to characterize semantic relationships and temporal dependencies among services. On this basis, a contrastive learning objective is introduced, where structured constraints between positive and negative sample pairs enable stable feature aggregation and boundary separation under unsupervised or weakly supervised conditions. A temporal consistency regularization term is also incorporated to maintain state smoothness across time steps, enhancing robustness under non-stationary distributions. The proposed method is validated on multidimensional cloud workload datasets, and results show that it achieves high detection accuracy and stability even with incomplete labels and noisy pseudo-labels. Overall, the method not only realizes self-supervised and structure-aware anomaly detection but also demonstrates strong performance in feature representation, anomaly discrimination, and distribution shift adaptation, providing an efficient and general solution for intelligent backend operations and multi-source time-series analysis.