Unsupervised anomaly detection method based on autoencoder fusion of spatiotemporal contextual relationship

By using autoencoders to fuse spatio-temporal context relationships in the detection of abnormal behavior within the enterprise, and combining user behavior and attribute feature networks, the problem of insufficient detection performance in the existing technology is solved, and more efficient abnormal behavior identification is achieved.

CN118277213BActive Publication Date: 2024-09-27NANJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410712480.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-04
Publication Date
2024-09-27
Estimated Expiration
2044-06-04

AI Technical Summary

Technical Problem

Existing technologies are difficult to effectively capture potential features in high-dimensional, complex, heterogeneous and sparse data when detecting abnormal behavior within an enterprise, resulting in insufficient detection performance.

Method used

An unsupervised anomaly detection method based on autoencoders is adopted, by combining the user behavior feature network and the user attribute feature network, using a dual-time convolutional network and a combined autoencoder with the Transformer module and a GRU autoencoder with an adversarial learning mechanism. Extract and reconstruct user behavior and attribute features, and comprehensively evaluate the reconstruction error to determine abnormal behavior.

Benefits of technology

It improves the performance of abnormal behavior detection of internal personnel in the enterprise, and enhances the accuracy and robustness of anomaly detection by integrating spatiotemporal context relationships.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118277213B
    Figure CN118277213B
Patent Text Reader

Abstract

The present invention belongs to the technical field of system log anomaly detection, and discloses an unsupervised anomaly detection method based on autoencoder fusion of spatiotemporal contextual relationship, which integrates the historical baseline of user behavior and the social attributes of the user himself, thereby designing an autoencoder network fusion of spatiotemporal contextual relationship to improve the accuracy of anomaly detection. First, a temporal convolutional network and a series model of Transformer are used to form an anomaly detection framework with local and global attention mechanisms to extract and reconstruct user behavior features; secondly, a GRU autoencoder with adversarial learning is used to extract and reconstruct user attribute features; finally, the reconstruction results of user behavior features and user attribute features are comprehensively judged, and the behavior sequence with a reconstruction result higher than a threshold is judged as an abnormal behavior sequence. This method improves the detection performance of abnormal behavior of internal personnel of an enterprise.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of system log anomaly detection, and specifically relates to an unsupervised anomaly detection method based on autoencoder fusion of spatiotemporal contextual relationship Background Art

[0002] The modernization and globalization of enterprises have made their structures more complex than in the past, and many companies have digitized many parts of their businesses to improve operational efficiency. The security protection of enterprise information systems has become increasingly important, and the damage caused by intrusions and sabotages they suffer has become increasingly serious. Today, the boundaries of enterprise system security protection have become blurred. Unlike traditional external intrusions, attacks from insiders have a higher destructive potential due to their close understanding of the organizational framework and their awareness of key attributes or content. Therefore, internal threat detection has become an important issue that needs to be urgently addressed in the current cyberspace.

[0003] At present, internal threat detection technology can be mainly divided into two categories: rule-based feature detection and behavior-based anomaly detection. Rule-based feature detection methods aim to identify known attacks or threats and require the formulation of rules to match the features of current activities with previously stored attack features. Behavior-based anomaly detection methods rely on user behavior and adopt anomaly detection methods based on user behavior patterns to identify internal threats. With the widespread application of deep learning in user behavior, anomaly detection based on user behavior has received more extensive attention in academic research and practical applications. On the other hand, the inherent imbalance and irregularity of abnormal samples pose a huge challenge to traditional supervised learning methods in achieving the best anomaly detection accuracy in anomaly detection tasks. Therefore, unsupervised or semi-supervised deep learning methods have become one of the common strategies to deal with these challenges. Autoencoders are one of the most well-known unsupervised anomaly detection techniques. The reconstruction-based anomaly detection model of autoencoders focuses on learning the reconstruction of normal data during the modeling process, thereby using the difference between the input data and its reconstruction to identify potential anomalies when the reconstruction error exceeds a predefined threshold. This reconstruction-based unsupervised learning method greatly reduces human intervention and has achieved good results in the field of anomaly detection.

[0004] However, deep neural networks learning features and obtaining reconstruction errors are the basis of unsupervised anomaly detection. How to improve the detection performance of abnormal behaviors of internal employees in enterprises and capture the potential characteristics of complex behaviors in high-dimensional, complex, heterogeneous and sparse data sets are issues that need to be solved urgently. Summary of the invention

[0005] In order to achieve the above objectives, the present invention provides an unsupervised anomaly detection method based on an autoencoder fusing spatiotemporal contextual relationships. The method uses an anomaly detection framework to extract and reconstruct user features to improve the detection performance of abnormal behaviors of internal personnel in an enterprise.

[0006] In order to achieve the above object, the present invention is achieved through the following technical solutions:

[0007] The present invention is an unsupervised anomaly detection method based on the fusion of spatiotemporal contextual relationships by an autoencoder. The unsupervised anomaly detection method is implemented by an unsupervised anomaly detection system. The unsupervised anomaly detection system includes a preprocessing module, a user behavior feature network, a user attribute feature network, and an abnormal behavior recognition module. Specifically, the unsupervised anomaly detection method specifically includes the following steps:

[0008] Step 1: Extract user behavior information and user attribute information from multi-source audit logs through a preprocessing module;

[0009] Step 2: Use a sliding window to transform the user behavior information extracted in step 1 into a user behavior feature matrix containing time changes and input it into a user behavior feature network;

[0010] Step 3: Update the user attribute information extracted in step 1 according to the working state and the non-working state to create a user attribute feature matrix, and input the created user attribute feature matrix into the user attribute feature network;

[0011] Step 4: construct a user behavior feature anomaly detection framework and a user attribute feature anomaly detection framework according to the properties of the input user behavior feature matrix and the user attribute feature matrix, and design corresponding loss functions to train the user behavior feature anomaly detection framework and the user attribute feature anomaly detection framework;

[0012] The user behavior feature network includes a user behavior feature anomaly detection framework, which is a combined autoencoder of a dual-time convolutional network and a Transformer module, and the dual-time convolutional network includes a local time convolutional network and a global time convolutional network;

[0013] The user attribute feature network includes a user attribute feature anomaly detection framework, and the user attribute feature anomaly detection framework is a GRU autoencoder with an adversarial learning mechanism;

[0014] Step 5: During the test, the user behavior anomaly detection framework and the user attribute feature anomaly detection framework output the reconstructed user behavior feature matrix and the user attribute feature matrix respectively;

[0015] Step 6: Comprehensively evaluate the reconstruction results of the user behavior feature matrix and the user attribute feature matrix, and judge the behavior sequence with a reconstruction error higher than a threshold as an abnormal behavior sequence.

[0016] A further improvement of the present invention is that in step 1, user behavior information and user attribute information are extracted from the multi-source audit log by a preprocessing module, and more comprehensive user features in the log are mined by joint modeling of the behavior information and personal attribute information, which specifically includes the following steps:

[0017] Step 1.1: Multi-source audit logs contain The behavior log of each user is aggregated at one-day intervals, and the complete view of user activities within one day is aggregated into one data instance:

[0018] }

[0019] in, The user's daily behavior sequence, ∈ , Indicates User activities recorded for the day, Indicates user The day Frequency statistics of activities, Represents all activity feature entries in a day, Indicates user No. Tiandi Frequency statistics of activities, For users No. Frequency statistics of the last activity of the day;

[0020] Step 1.2: Extract user attribute information based on the team, project, and permissions the user has in the company, and pre-process the user attribute information based on the different states of working days and non-working days.

[0021] A further improvement of the present invention is that: the step 2 is specifically: using a sliding window to convert the user's daily behavior sequence Aggregate into a multidimensional numerical feature matrix containing time window information, define is the window size, represents a tensor containing window information, Indicates the frequency statistics of all employee activities in one day. Represents the number of activity frequency statistics entries for all employees within the time range, each tensor containing window information The calculation is as follows:

[0022] for :

[0023] W i =[ D 1 , D 1 ,…, D 1 ⏟ wi Second-rate , D 1 , D 2 ,…, D i ]

[0024] for :

[0025]

[0026] The multidimensional numerical feature matrix is ​​expressed as The stacking result is

[0027] Among them, each is a size of The final output is a tensor of size A tensor of 1 is the dimension of different user behavior activity characteristics.

[0028] A further improvement of the present invention is that the user attribute features in step 3 are not continuous in time and are not divided by time windows. The dimension of the user attribute feature matrix is ,in Dimensions that represent different attribute characteristics of users.

[0029] A further improvement of the present invention is that in step 4, the local temporal convolutional network includes a causal convolutional layer to process local data. Suppose the input sequence is , convolution kernel is the weight array used for the convolution operation, where is the size of the convolution kernel, the output of the causal convolution At time step The calculation formula is as follows:

[0030]

[0031] The global temporal convolutional network includes a dilated convolutional layer to process global data. The dilation factor is introduced when calculating the dilated convolutional layer. , the output of the dilated convolutional layer At time step The calculation formula is as follows:

[0032]

[0033] in, is the weight of each convolution operation, Represents the input sequence at time step The value at .

[0034] A further improvement of the present invention is that in step 5, the user attribute feature anomaly detection framework reconstructs the user attribute feature matrix, wherein the encoder and decoder in the GRU autoencoder use the same architecture.

[0035] A further improvement of the present invention is that in step 5, the user behavior feature anomaly detection framework reconstructs the user behavior feature matrix specifically including the following steps:

[0036] Step 5.1: The preprocessed user behavior features are input into the local time convolution network of the combined autoencoder. After the local time convolution network captures the local time information, it is sent to the Transformer module to capture the noteworthy part of the input sequence. Then, the matrix with the same format as the input is reconstructed through the decoder of the combined autoencoder, which becomes the reconstruction result of the local time convolution network. ,

[0037] Step 5.2: Reconstruction results of local temporal convolutional network The information that the local temporal convolutional network considers important or abnormal is encapsulated and transmitted to the global temporal convolutional network through a pipeline connecting the local temporal convolutional network and the global temporal convolutional network. The global temporal convolutional network is combined with the original window sequence to form the input of the global temporal convolutional network. As an attention matrix, it helps the attention network of the global temporal convolutional network focus on more important or abnormal sequences, and the output is ;

[0038] Step 5.3: The reconstruction error of the input and output of the local time convolution network and the global time convolution network is calculated through the mean square error function, which is recorded as the local reconstruction error , global reconstruction error ;

[0039] Step 5.4: At the beginning of iterative training, the number of iterations of the user behavior feature anomaly detection framework training Small, and 1 / The value of is large, the local reconstruction error The weight assigned is high, and the reconstruction performance is suboptimal in the initial stage. The attention information in becomes unreliable, and the global reconstruction error At the beginning of iterative training, the weight is given low. Converge to the input window, The accuracy of the attention information encapsulated in gradually improves, so the global reconstruction error The weight gradually increases.

[0040] A further improvement of the present invention is that in step 6, the reconstruction results of the user behavior feature matrix and the user attribute feature matrix are comprehensively evaluated, and the behavior sequence with a reconstruction error higher than a threshold is judged as an abnormal behavior sequence, which is expressed as:

[0041]

[0042]

[0043] in, Represents user attribute sequence input, Represents the result of the user attribute sequence reconstructed by the framework, represents the reconstruction error of user attribute features, is the user behavior sequence input, It is the result of the user behavior sequence being reconstructed by the framework. represents the reconstruction error of user behavior, represents the reconstruction error result of comprehensive evaluation, It is the threshold for judging whether it is abnormal behavior. The behavior recorded by the user marked as abnormal behavior is abnormal behavior. and The results of comprehensive evaluation Used to identify abnormal behavior, the comprehensive reconstruction error Above threshold The behavior is marked as abnormal behavior to improve the accuracy of abnormal behavior detection.

[0044] The beneficial effects of the present invention are as follows: the present invention integrates the historical baseline of user behavior and the social attributes of the user himself, and provides an autoencoder network that integrates spatiotemporal contextual relationships to improve the accuracy of anomaly detection. First, the present invention uses a tandem model of a temporal convolutional network and a Transformer to form an anomaly detection framework with a local and global attention mechanism to extract and reconstruct user behavior features; secondly, a GRU autoencoder with adversarial learning is used to extract and reconstruct user attribute features; finally, the present invention comprehensively evaluates the reconstruction results of user behavior features and user attribute features, and judges the behavior sequence whose reconstruction results are higher than the threshold as an abnormal behavior sequence. This method improves the detection performance of abnormal behavior of internal personnel in an enterprise. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 It is a flow chart of the unsupervised anomaly detection method of the present invention.

[0046] Figure 2 It is a network structure diagram of the present invention.

[0047] Figure 3 This is a network structure diagram of the combined autoencoder based on a dual-time convolutional network and a Transformer in the present invention.

[0048] Figure 4 It is the performance of the combined autoencoder based on dual temporal convolutional network and Transformer of the present invention with window sizes of 1, 4, 8, and 12 on the CERT r4.2 dataset.

[0049] Figure 5 It is the performance of the combined autoencoder based on dual temporal convolutional network and Transformer of the present invention with window sizes of 1, 4, 8, and 12 on the CERT r5.2 dataset.

[0050] Figure 6 It is the performance of the combined autoencoder based on dual temporal convolutional network and Transformer of the present invention with window sizes of 1, 4, 8, and 12 on the CERT r6.2 dataset.

[0051] Figure 7 It is the performance of the combined autoencoder based on dual-temporal convolutional network and Transformer in different abnormal scenarios when the window size is 1, 4, 8, and 12 on the CERT r4.2 dataset.

[0052] Figure 8 It is the performance of the combined autoencoder based on dual-temporal convolutional network and Transformer in different abnormal scenarios when the window size is 1, 4, 8, and 12 on the CERT r5.2 dataset.

[0053] Fig. 9 It is the performance of the combined autoencoder based on dual-temporal convolutional network and Transformer in different abnormal scenarios when the window size is 1, 4, 8, and 12 on the CERT r6.2 dataset. DETAILED DESCRIPTION

[0054] The following will disclose the embodiments of the present invention with drawings. For the purpose of clear description, many practical details will be described together in the following description. However, it should be understood that these practical details should not be used to limit the present invention. That is to say, in some embodiments of the present invention, these practical details are not necessary.

[0055] like Figure 1-2As shown, the present invention is an unsupervised anomaly detection method based on the fusion of spatiotemporal contextual relationship of the autoencoder. The unsupervised anomaly detection method is implemented by an unsupervised anomaly detection system. The unsupervised anomaly detection system includes a preprocessing module, a user behavior feature network, a user attribute feature network and an abnormal behavior recognition module. Specifically, the unsupervised anomaly detection method specifically includes the following steps:

[0056] Step 1: Extract user behavior information and user attribute information from multi-source audit logs through the preprocessing module. Through joint modeling of behavior information and personal attribute information, more comprehensive user features in the logs are mined. Specifically, the following steps are included:

[0057] Step 1.1: Multi-source audit logs contain The behavior logs of each user record in detail a series of operations performed by each employee on the company computer, such as logging in and out of a certain PC, web pages browsed, etc. The data is aggregated at one-day intervals, and the complete view of user activities within one day is aggregated into a data instance:

[0058] }

[0059] in, The user's daily behavior sequence, ∈ , Indicates User activities recorded for the day, Indicates user The day Frequency statistics of activities, Represents all activity feature entries in a day, Indicates user No. Tiandi Frequency statistics of activities, For users No. Frequency statistics of the last activity on the day; for example, statistics on the number of times user 1 plugged in and unplugged a USB on the computer on the 10th day.

[0060] Step 1.2: Figure 2 As shown, user attribute information is extracted according to the team, project and authority the user belongs to in the company, and the user attribute information is preprocessed according to the different states of working days and non-working days.

[0061] Step 2: Use a sliding window to sequence the user’s daily behavior Aggregate into a multidimensional numerical feature matrix containing time window information, define is the window size, represents a tensor containing window information, Indicates the frequency statistics of all employee activities in one day. Represents the number of activity frequency statistics entries for all employees within the time range, each tensor containing window information The calculation is as follows:

[0062] for :

[0063] W i =[ D 1 , D 1 ,…, D 1 ⏟ wi Second-rate , D 1 , D 2 ,…, D i ]

[0064] for :

[0065]

[0066] The multidimensional numerical feature matrix is ​​expressed as The stacking result is

[0067] Among them, each is a size of A tensor of 1 is the dimension of different user behavior activity characteristics.

[0068] Taking advantage of the fact that internal threats often do not start and end within a day, the present invention proposes a data representation method using a time window to process user behavior information. The processed behavior information will be transformed into a multi-dimensional numerical feature matrix containing time changes, which can highlight the trend of each user's behavior over time and more accurately capture abnormal operations that are difficult to find in user behavior.

[0069] Step 3: Since the attribute information of enterprise users will change in working state and non-working state, such as the permission to operate sensitive files, the permission to log in to the PC, and the permission to send emails to the outside, etc., the present invention updates the user attribute information extracted in step 1 according to the working state and non-working state to create a user attribute feature matrix, and inputs the created user attribute feature matrix into the user attribute feature network; the user attribute features in step 3 are not continuous in time, and time window division is not used. The dimension of the user attribute feature matrix is ,in Dimensions that represent different attribute characteristics of users.

[0070] Step 4: The feature matrix of user behavior contains time-varying properties and belongs to long sequence modeling. The present invention proposes to construct a user behavior feature anomaly detection framework and a user attribute feature anomaly detection framework according to the properties of the input user behavior feature matrix and the user attribute feature matrix, and design corresponding loss functions to train the user behavior feature anomaly detection framework and the user attribute feature anomaly detection framework. During training, the goal of the present invention is to make the output sequence of the encoder as similar as possible to the input sequence, so the mean square error (MSE) loss function is defined as:

[0071]

[0072] The user behavior feature network of the present invention includes a user behavior feature anomaly detection framework, which is a combined autoencoder of a dual-time convolutional network and a Transformer module, and the dual-time convolutional network includes a local time convolutional network and a global time convolutional network.

[0073] The dual-time convolution network is composed of multiple cascaded residual blocks based on convolutional layers. In each residual block, a one-dimensional convolutional layer (Conv1D) is first defined. In Conv1D, the number of input channels, i.e., the input feature dimension, the number of output channels, i.e., the output feature dimension, the size of the convolution kernel, set to ), the stride of the convolution operation, set to 1, and weight normalization (Weight-Norm) is applied, which can help speed up training and stabilize the model. In addition, the present invention sets a custom layer to crop the redundant part introduced by padding in the convolution operation, and adds a ReLU activation function to introduce nonlinearity. Finally, in order to prevent overfitting, regularization is introduced by dropout after each convolution layer of each residual block. The specific implementation is as follows:

[0074] Weight-Norm Conv1D

[0075] The user attribute feature network of the present invention includes a user attribute feature anomaly detection framework, and the user attribute feature anomaly detection framework is a GRU autoencoder with an adversarial learning mechanism.

[0076] like Figure 2 As shown in the figure, the feature matrix of user behavior contains time-varying properties and belongs to long sequence modeling. The present invention proposes a combined autoencoder using a dual-time convolutional network and a Transformer to form an anomaly detection framework with a temporal attention mechanism and capable of capturing long-range relationships, called GLAITD. Its encoder part combined with a dual-time convolutional network enables the model to model predictive behavior by combining extensive historical data.

[0077] Transformer is used in autoencoders due to its excellent sequence modeling and long-term dependency capture mechanism. By introducing the self-attention mechanism, Transformer can flexibly focus on different positions in the sequence, thereby more keenly detecting potential abnormal patterns in user behavior sequences. Its multi-attention mechanism further enhances the ability to learn from multiple relations, enabling the model to understand user behavior data more comprehensively. Combining TCN with Transformer provides an effective solution for processing large-scale user behavior data.

[0078] The local temporal convolutional network includes a causal convolutional layer to process local data. Suppose the input sequence is , convolution kernel is the weight array used for the convolution operation, where is the size of the convolution kernel, the output of the causal convolution At time step The calculation formula is as follows:

[0079]

[0080] The global temporal convolution network includes a dilated convolution layer to process global data. The dilated convolution layer expands the receptive field by inserting holes between the convolution kernel elements without increasing the computational complexity. This is very effective for capturing long-term dependencies. The dilation factor is introduced during the dilated convolution calculation. , the output of the dilated convolutional layer At time step The calculation formula is as follows:

[0081]

[0082] in, is the weight of each convolution operation, Represents the input sequence at time step The value at .

[0083] By combining causal and dilated convolutions, the receptive field can be expanded while maintaining causality, allowing the model to capture long-term dependencies in user behavior sequence data.

[0084] The Transformer module includes a multi-head self-attention mechanism and a feedforward neural network, each of which contains residual connections and dropout mechanisms. The multi-head self-attention mechanism is used to capture the global dependencies in the input sequence, and the feedforward neural network is used to further process the user behavior context information in the sequence.

[0085] The present invention also uses a GRU-based autoencoder to reconstruct user attribute features. The encoder and decoder in the GRU autoencoder use the same architecture to ensure the optimization of the reconstruction process. The user attribute feature matrix is ​​reconstructed using an autoencoder based on a deep recurrent neural network (GRU). During the encoding process, a multi-layer unidirectional GRU layer is used to process sequence data, including input dimensions, hidden layer dimensions, and GRU network layers. The output of the encoding process is as follows:

[0086]

[0087] in, It is The input of time steps, It is The hidden state at time step.

[0088] The decoder layer uses a multi-layer GRU layer and a linear layer.

[0089] The input and output of the GRU layer:

[0090]

[0091] in, The decoder is The input of time steps, It is The hidden state of the time step. The linear layer outputs:

[0092]

[0093] is the weight matrix of the linear layer, is the bias vector, is the output of the GRU layer.

[0094] Furthermore, adversarial learning is introduced, the GRU autoencoder acts as a generator, and a discriminator is set. The goal of the discriminator is to maximize the probability of correctly classifying real data and generated data.

[0095] The generator tries to generate realistic data to deceive the discriminator, while the discriminator tries to distinguish between real data and generated data. Under mutual confrontation, the model can more robustly identify normal and abnormal samples in adversarial situations, thereby improving the accuracy of anomaly detection.

[0096] Step 5: During testing, the user behavior anomaly detection framework and the user attribute feature anomaly detection framework output the reconstructed user behavior feature matrix and the user attribute feature matrix respectively, and calculate the reconstruction errors of the two matrices respectively.

[0097] like Figure 3 As shown in the figure, the user behavior anomaly detection framework is designed based on user behavior features. It integrates two autoencoders interconnected in a serial manner, namely a dual-time convolutional network and a Transformer, thereby dividing the user behavior anomaly detection framework training process into two different stages. The training loss of the user behavior feature anomaly detection framework is:

[0098]

[0099]

[0100] Loss

[0101] in, is the tensor containing window information after user behavior feature extraction, is the reconstruction result of the local time convolutional network, The original input window and The matrix and, is the encoder of a local temporal convolutional network consisting of a causal convolutional layer and a Transformer. It is the encoder of a global temporal convolutional network consisting of an expanded convolutional layer and a Transformer. It is a decoder. Indicates the number of iterations during model training.

[0102] The user behavior feature anomaly detection framework reconstructs the user behavior feature matrix specifically including the following steps:

[0103] Step 5.1: The preprocessed user behavior features are input into the local time convolution network of the combined autoencoder. After the local time convolution network captures the local time information, it is sent to the Transformer module to capture the noteworthy part of the input sequence. Then, the matrix with the same format as the input is reconstructed through the decoder of the combined autoencoder, which becomes the reconstruction result of the local time convolution network. ,

[0104] Step 5.2: Reconstruction results of local temporal convolutional network The information that the local temporal convolutional network considers important or abnormal is encapsulated and transmitted to the global temporal convolutional network through a pipeline connecting the local temporal convolutional network and the global temporal convolutional network. The global temporal convolutional network is combined with the original window sequence to form the input of the global temporal convolutional network. As an attention matrix, it helps the attention network of the global temporal convolutional network focus on more important or abnormal sequences, and the output is ;

[0105] Step 5.3: The reconstruction error of the input and output of the local time convolution network and the global time convolution network is calculated through the mean square error function, which is recorded as the local reconstruction error , global reconstruction error ;

[0106] Step 5.4: At the beginning of iterative training, the number of iterations of the user behavior feature anomaly detection framework training Small, and 1 / The value of is large, the local reconstruction error The weight assigned is high, and the reconstruction performance is suboptimal in the initial stage. The attention information in becomes unreliable, and the global reconstruction error At the beginning of iterative training, the weight is given low. Converge to the input window, The accuracy of the attention information encapsulated in gradually improves, so the global reconstruction error The weight gradually increases.

[0107] Step 6: In the detection stage, since the training data only contains normal samples, the model tends to capture the normal behavior pattern and cannot correctly reconstruct the abnormal user behavior sequence, so the abnormal behavior sequence has a higher reconstruction error. The reconstruction results of the user behavior feature matrix and the user attribute feature matrix are comprehensively evaluated, and the behavior sequence with a reconstruction error higher than the threshold is judged as an abnormal behavior sequence, which is expressed as:

[0108]

[0109]

[0110] in, Represents user attribute sequence input, Represents the result of the user attribute sequence reconstructed by the framework, represents the reconstruction error of user attribute features, is the user behavior sequence input, It is the result of the user behavior sequence being reconstructed by the framework. represents the reconstruction error of user behavior, represents the reconstruction error result of comprehensive evaluation, It is the threshold for judging whether it is abnormal behavior. The behavior recorded by the user marked as abnormal behavior is abnormal behavior. and The results of comprehensive evaluation Used to identify abnormal behavior, the comprehensive reconstruction error Above threshold The behavior is marked as abnormal behavior to improve the accuracy of abnormal behavior detection.

[0111] In order to better illustrate the present invention, the following experiments are disclosed:

[0112] 1. Experimental Setup

[0113] Datasets: The performance of our method is evaluated on three benchmark datasets, CERT 4.2, CERT 5.2, and CERT 6.2, which are widely used in video anomaly detection.

[0114] Evaluation indicators: In order to evaluate the performance of the model at different thresholds, the present invention uses the receiver operating characteristic (ROC) curve and the area under the curve (AUC) as evaluation indicators. The ROC curve shows the relationship between the true positive rate (TPR) and the false positive rate (FPR) at different thresholds. By visualizing the relationship between TPR and FPR, the ROC curve provides a comprehensive overview of the performance of the classifier at different threshold levels.

[0115] Experimental details: All experiments in the present invention were conducted on a PC running Windows 10 (x64 version), equipped with an Intel i7 12700 processor, a GeForce RTX 3060Ti GPU, and 32GB of RAM. The present invention trained the entire model 50 times using the Adam optimizer. Initially, the learning rate was set to 0.0001, and then reduced to one-tenth of the previous value after the 5th, 15th, and 30th cycles. To prevent overfitting, a Dropout rate of 0.1 was used. In all data sets, namely CERT r4.2, r5.2, and r6.2, 75% of the normal samples were assigned as training samples, and 25% of the normal samples and all abnormal samples were assigned to the test set.

[0116] 2. Experimental results

[0117] In this study, we compared the most advanced internal threat detection methods and demonstrated the effectiveness of our proposed model. The following table shows the detailed comparison results, indicating that our proposed method performs well in multiple abnormal scenarios.

[0118]

[0119] 3. Experimental results presentation

[0120] The data instances processed by the time window can highlight the trend of each user's behavior changing over time, so the size of the time window is a key parameter that directly affects the user behavior interpretation and anomaly detection performance of the detection system. Therefore, the present invention sets up a comparative test of different window sizes to evaluate the performance of the model under different time window sizes.

[0121] like Figure 4-6 As shown, the present invention sets four comparative experiments of time window sizes of 1, 4, 8 and 12 on three data sets. Among them, CERT r4.2 performs best when the window size is 4, while CERT r5.2 and r6.2 reach peak values ​​when the window size is 1, with AUC values ​​of 0.95 and 0.96 respectively.

[0122] In addition, the present invention also conducted experiments to examine the ability of the present invention to detect each anomaly under different time window sizes. Figure 7-9 As shown in the figure, CERT r4.2 only contains 3 anomaly scenarios, among which scenarios 1 and 3 show the best performance when the window size is set to 4, which indicates that these scenarios have short-term deviations in user behavior and require a smaller time window to avoid missing reports. Scenario 2 shows the effectiveness of a window size of 12, indicating that the anomalies therein gradually emerge over time and require a larger time window to reveal their long-term threat behavior. In contrast, CERT r5.2 introduces a fourth scenario, and CERT r6.2 includes both the fourth and fifth scenarios. It is worth noting that when the window size is set to 1, the model detects anomalies in scenarios 4 and 5 most effectively, similar to scenarios 1 and 3, indicating that these anomalies occur within a single day and that a larger time window may hinder the capture of local anomalies. Through experiments in various scenarios, the GLAITD framework can be precisely tailored to enhance detection accuracy.

[0123] The above description is only an embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.

Claims

1. An unsupervised anomaly detection method based on autoencoder fusion of spatiotemporal contextual relationship, characterized by: The unsupervised anomaly detection method is implemented by an unsupervised anomaly detection system, which includes a preprocessing module, a user behavior feature network, a user attribute feature network, and an abnormal behavior recognition module. Specifically, the unsupervised anomaly detection method includes the following steps: Step 1: Extract user behavior information and user attribute information from multi-source audit logs through a preprocessing module; Step 2: Use a sliding window to transform the user behavior information extracted in step 1 into a user behavior feature matrix containing time changes and input it into a user behavior feature network; Step 3: Update the user attribute information extracted in step 1 according to the working state and the non-working state to create a user attribute feature matrix, and input the created user attribute feature matrix into the user attribute feature network; Step 4: construct a user behavior feature anomaly detection framework and a user attribute feature anomaly detection framework according to the properties of the input user behavior feature matrix and the user attribute feature matrix, and design corresponding loss functions to train the user behavior feature anomaly detection framework and the user attribute feature anomaly detection framework; The user behavior feature network includes a user behavior feature anomaly detection framework, which is a combined autoencoder of a dual-time convolutional network and a Transformer module, and the dual-time convolutional network includes a local time convolutional network and a global time convolutional network; The user attribute feature network includes a user attribute feature anomaly detection framework, and the user attribute feature anomaly detection framework is a GRU autoencoder with an adversarial learning mechanism; Step 5: During the test, the user behavior anomaly detection framework and the user attribute feature anomaly detection framework output the reconstructed user behavior feature matrix and the user attribute feature matrix respectively; Step 6: Comprehensively evaluate the reconstruction results of the user behavior feature matrix and the user attribute feature matrix, and judge the behavior sequence with a reconstruction error higher than a threshold as an abnormal behavior sequence.

2. The unsupervised anomaly detection method based on autoencoder fusion of spatiotemporal contextual relationship according to claim 1 is characterized by: In step 1, user behavior information and user attribute information are extracted from the multi-source audit logs through a preprocessing module, and more comprehensive user features in the logs are mined through joint modeling of the behavior information and personal attribute information, which specifically includes the following steps: Step 1.1: Multi-source audit logs contain The behavior log of each user is aggregated at one-day intervals, and the complete view of user activities within one day is aggregated into one data instance: } in, The user's daily behavior sequence, ∈ , Indicates User activities recorded for the day, Indicates user The day Frequency statistics of activities, Represents all activity feature entries in a day, Indicates user No. Tiandi Frequency statistics of activities, For users No. Frequency statistics of the last activity of the day; Step 1.2: Extract user attribute information based on the team, project, and permissions the user belongs to in the company, and pre-process the user attribute information based on the different states of working days and non-working days.

3. The unsupervised anomaly detection method based on autoencoder fusion of spatiotemporal contextual relationship according to claim 2 is characterized in that: The step 2 is specifically as follows: using a sliding window to map the user's daily behavior sequence Aggregated into a multidimensional numerical feature matrix containing time window information, defined is the window size, represents a tensor containing window information, Indicates the frequency statistics of all employee activities in one day. Represents the number of activity frequency statistics entries for all employees within the time range, each tensor containing window information The calculation is as follows: for : , for : , The multidimensional numerical feature matrix is ​​expressed as The stacking result is Among them, each is a size of A tensor of 1 is the dimension of different user behavior activity characteristics.

4. The unsupervised anomaly detection method based on autoencoder fusion of spatiotemporal contextual relationship according to claim 1 is characterized in that: The user attribute features in step 3 are not continuous in time, and no time window division is used. The dimension of the user attribute feature matrix is ,in Dimensions that represent different attribute characteristics of users.

5. The unsupervised anomaly detection method based on autoencoder fusion of spatiotemporal contextual relationship according to claim 1, characterized in that: In step 4, the local temporal convolutional network includes a causal convolutional layer to process local data. Suppose the input sequence is , convolution kernel is the weight array used for the convolution operation, where is the size of the convolution kernel, the output of the causal convolution At time step The calculation formula is as follows: , The global temporal convolutional network includes a dilated convolutional layer to process global data. The dilation factor is introduced when calculating the dilated convolutional layer. , the output of the dilated convolutional layer At time step The calculation formula is as follows: , in, is the weight of each convolution operation, Represents the input sequence at time step The value at .

6. The unsupervised anomaly detection method based on autoencoder fusion of spatiotemporal contextual relationship according to claim 1, characterized in that: In step 5, the user attribute feature anomaly detection framework reconstructs the user attribute feature matrix, wherein the encoder and decoder in the GRU autoencoder use the same architecture.

7. The unsupervised anomaly detection method based on autoencoder fusion of spatiotemporal contextual relationship according to claim 1 or 6, characterized in that: In step 5, the user behavior feature anomaly detection framework reconstructs the user behavior feature matrix specifically including the following steps: Step 5.1: The preprocessed user behavior features are input into the local time convolution network of the combined autoencoder. After the local time convolution network captures the local time information, it is sent to the Transformer module to capture the noteworthy part of the input sequence. Then, the matrix with the same format as the input is reconstructed through the decoder of the combined autoencoder, which becomes the reconstruction result of the local time convolution network. , Step 5.2: Reconstruction results of local temporal convolutional network The information that the local temporal convolutional network considers important or abnormal is encapsulated and transmitted to the global temporal convolutional network through a pipeline connecting the local temporal convolutional network and the global temporal convolutional network. The global temporal convolutional network is combined with the original window sequence to form the input of the global temporal convolutional network. As an attention matrix, it helps the attention network of the global temporal convolutional network focus on more important or abnormal sequences, and the output is ; Step 5.3: The reconstruction error of the input and output of the local time convolution network and the global time convolution network is calculated through the mean square error function, which is recorded as the local reconstruction error , global reconstruction error ; Step 5.4: At the beginning of iterative training, the number of iterations of the user behavior feature anomaly detection framework training Small, and 1 / The value of is large, the local reconstruction error The weight assigned is high, and the reconstruction performance is suboptimal in the initial stage. The attention information in becomes unreliable, and the global reconstruction error At the beginning of iterative training, the weight is given low. Converge to the input window, The accuracy of the attention information encapsulated in gradually improves, so the global reconstruction error The weight gradually increases.

8. The unsupervised anomaly detection method based on autoencoder fusion of spatiotemporal contextual relationship according to claim 1, characterized in that: In step 6, the reconstruction results of the user behavior feature matrix and the user attribute feature matrix are comprehensively evaluated, and the behavior sequence with a reconstruction error higher than the threshold is judged as an abnormal behavior sequence, which is expressed as: , , in, Represents user attribute sequence input, Represents the result of the user attribute sequence reconstructed by the framework, represents the reconstruction error of user attribute features, is the user behavior sequence input, It is the result of the user behavior sequence being reconstructed by the framework. represents the reconstruction error of user behavior, represents the reconstruction error result of comprehensive evaluation, It is the threshold for judging whether it is abnormal behavior. The behavior recorded by the user marked as abnormal behavior is abnormal behavior. and The results of comprehensive evaluation Used to identify abnormal behavior, the comprehensive reconstruction error Above threshold The behavior is marked as abnormal behavior to improve the accuracy of abnormal behavior detection.