[论文解读] Self-Attentive Classification-Based Anomaly Detection in Unstructured Logs
Logsy 提出了一种基于自我注意机制的、以分类为基础的异常检测方法,用于非结构化系统日志。该方法通过训练神经网络来区分目标系统的正常日志与来自多种公开可用辅助数据集的异常日志,实现异常检测。利用一种新颖的超球面损失函数,Logsy 学习到紧凑且富含语义的日志表征,提升了泛化能力,并在先前方法的基础上将 F1 分数提高了 0.25。
The detection of anomalies is essential mining task for the security and reliability in computer systems. Logs are a common and major data source for anomaly detection methods in almost every computer system. They collect a range of significant events describing the runtime system status. Recent studies have focused predominantly on one-class deep learning methods on predefined non-learnable numerical log representations. The main limitation is that these models are not able to learn log representations describing the semantic differences between normal and anomaly logs, leading to a poor generalization of unseen logs. We propose Logsy, a classification-based method to learn log representations in a way to distinguish between normal data from the system of interest and anomaly samples from auxiliary log datasets, easily accessible via the internet. The idea behind such an approach to anomaly detection is that the auxiliary dataset is sufficiently informative to enhance the representation of the normal data, yet diverse to regularize against overfitting and improve generalization. We propose an attention-based encoder model with a new hyperspherical loss function. This enables learning compact log representations capturing the intrinsic differences between normal and anomaly logs. Empirically, we show an average improvement of 0.25 in the F1 score, compared to the previous methods. To investigate the properties of Logsy, we perform additional experiments including evaluation of the effect of the auxiliary data size, the influence of expert knowledge, and the quality of the learned log representations. The results show that the learned representation boost the performance of the previous methods such as PCA with a relative improvement of 28.2%.
研究动机与目标
- 解决现有单类深度学习方法在日志异常检测中因刚性、非语义日志表征而导致的泛化能力差的问题。
- 克服日志解析与基于模板模型的局限性,这些模型在面对未见日志消息时会失效。
- 通过利用多样且易于获取的辅助日志数据集作为正则化项,提升模型的鲁棒性与泛化能力。
- 开发一种表征学习方法,捕捉正常日志与异常日志之间的语义差异,而无需依赖大量专家标注。
- 证明所学习的日志嵌入不仅可提升 Logsy 本身,还可增强传统方法(如 PCA),从而提升其性能。
提出的方法
- 训练一个自注意力编码器网络,使用对比分类目标将原始日志消息映射为密集向量表征。
- 采用超球面损失函数,促使正常日志嵌入在超球面上紧密聚集于原点附近,而异常日志嵌入则被推向外围。
- 在目标系统日志(正常)与来自多样化辅助数据集的日志(异常)组合上进行训练,将任务视为二分类问题。
- 利用预训练的 Transformer 风格注意力机制,捕捉非结构化日志序列中的长距离依赖关系与语义结构。
- 应用 T-SNE 可视化分析所学习嵌入的几何结构,确认正常日志在中心区域紧密聚集,而异常日志则向外分散,验证了超球面损失的几何设计意图。
- 提取所学习的日志嵌入,并将其重新应用于基线方法(如 PCA),以评估其在不同异常检测流程中的通用性。
实验结果
研究问题
- RQ1与单类学习相比,使用辅助日志数据集的基于分类的方法是否能在日志异常检测中提升泛化能力?
- RQ2所提出的超球面损失函数在学习紧凑且具有判别性的日志表征方面效果如何?
- RQ3即使仅包含少量目标系统中的标注异常数据,其对检测性能的提升程度如何?
- RQ4所学习的日志嵌入是否可迁移至并提升现有非深度学习方法(如 PCA)的性能?
- RQ5辅助数据集的规模与多样性在多大程度上影响所学习表征的鲁棒性与泛化能力?
主要发现
- Logsy 在日志异常检测任务中,平均 F1 分数相比先前最先进方法提升了 0.25。
- 即使仅使用一个辅助日志样本,也能通过超球面损失正则化,防止出现平凡解,表明损失函数具有强大的归纳偏差。
- 仅包含目标系统中 2% 的标注异常数据,即可使 F1 分数提升至 0.8,证明该方法具有极高的样本效率。
- 所学习的日志嵌入显著提升了传统方法:将 TF-IDF 替换为 Logsy 嵌入后,PCA 的 F1 分数平均提升 28.2%。
- T-SNE 可视化结果表明,正常日志在超球面中心区域紧密聚集,而异常日志则向外分散,验证了超球面损失的几何设计意图。
- 该方法对未见日志具有良好的泛化能力,这在 Blue Gene/L、Thunderbird 和 Spirit 等多个基准数据集上的一致性能提升中得到验证。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。