A neural network anomaly detection method and system driven by time-series behavioral data

By combining hybrid feature extraction networks and generative adversarial networks, the problems of rule dependence and threshold adaptability in network anomaly detection are solved, achieving efficient and accurate anomaly detection for multivariate temporal behaviors, and improving the sensitivity and robustness of detection.

CN123116080APending Publication Date: 2026-11-17SHANGHAI LINGWEI INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611328968.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-31
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing technologies for network anomaly detection suffer from several problems, including reliance on domain expert experience for rule base maintenance, inability of fixed statistical thresholds to adapt to behavioral pattern drift, neglect of correlations between behavioral variables by univariate statistical methods, and inaccurate assessment of reconstruction errors. These issues lead to frequent false positives and false negatives.

Method used

A hybrid feature extraction network combined with a generative adversarial network is used to adaptively fuse and adversarially train multivariate temporal behavioral sequences. Multi-scale dependencies are captured through local temporal convolution and global self-attention. The adversarial loss of the generator and discriminator is used to optimize the reconstruction autoencoder. The weighted reconstruction error is calculated by combining the historical volatility of behavioral variables and dynamic threshold updates are performed.

Benefits of technology

It significantly improves the sensitivity and accuracy of detecting complex abnormal behaviors, reduces the false alarm rate, has strong adaptability, can maintain efficient detection in non-stationary behavior scenarios, and does not require a large number of anomaly annotations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123116080A_ABST
    Figure CN123116080A_ABST
Patent Text Reader

Abstract

This invention relates to a neural network anomaly detection method and system driven by temporal behavioral data, comprising the following steps: collecting multi-source behavioral data and constructing a multivariate temporal behavioral sequence; inputting the multivariate temporal behavioral sequence into a hybrid feature extraction network, which extracts features through parallel local temporal convolutional branches and global self-attention branches, and adaptively fuses the outputs of the two branches using a gating mechanism to obtain a fused behavioral representation; using the fused behavioral representation as a condition, performing adversarial training on the reconstructed autoencoder within a generative adversarial network framework, forcing the reconstructed autoencoder to learn the compact reconstruction distribution of normal behavior, thereby obtaining an optimized reconstruction network; this invention enhances the reconstruction discriminative power through hybrid feature extraction and adversarial training, and achieves adaptive, high-precision anomaly detection using volatility weighting and dynamic thresholding.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of network anomaly detection, and more specifically to a neural network anomaly detection method and system driven by time-series behavioral data. Background Technology

[0002] As enterprises continuously improve their informatization levels, various business systems, network devices, and terminal applications generate massive amounts of heterogeneous behavioral data from multiple sources, such as user operation logs, system call records, and network access records, during daily operations. Mining and analyzing this time-series behavioral data to automatically detect abnormal behaviors such as system intrusion, internal violations, and account theft has become an important technical means in the fields of network security and operation and maintenance assurance.

[0003] Traditional anomaly detection methods typically rely on expert rules or statistical thresholds, determining anomalies by matching or calculating behavioral indicators against preset fixed rules to see if they exceed historical statistical ranges. However, these methods reveal the following shortcomings when faced with increasingly complex and covert anomaly behaviors: the maintenance of the rule base is highly dependent on domain expert experience, making it difficult to cover unknown attack patterns; fixed statistical thresholds cannot adapt to normal drift in behavioral patterns, leading to a large number of false positives or false negatives; and univariate statistical methods ignore the inherent correlation between behavioral variables, making them vulnerable to attackers who can bypass detection by mimicking normal univariate distributions.

[0004] In recent years, deep learning-based temporal anomaly detection methods have gradually become a research hotspot. These methods utilize neural networks to model normal behavior and identify anomalies by the degree of deviation from the reconstruction error. Among these, autoencoders are one of the most commonly used architectures, aiming to minimize reconstruction error on normal data and expecting anomalous samples to exhibit larger reconstruction biases due to their lack of learning. However, a single autoencoder only targets pixel-level reconstruction, lacking structured constraints on the distribution of normal behavior, resulting in blurred reconstruction boundaries. This leads to some anomalous samples still being reconstructed relatively well, resulting in insufficient detection sensitivity. Generative adversarial networks (GANs) impose adversarial constraints on the reconstruction distribution by introducing a discriminator, forcing the autoencoder to learn a more compact manifold of normal behavior. However, in standard GAN training, the generator only focuses on deceiving the discriminator, easily ignoring the spatiotemporal dependencies of the behavior sequence and failing to adequately model the structure of temporal data.

[0005] In addition, existing deep learning methods have the following bottlenecks in temporal behavior modeling: On the one hand, anomalies in behavior sequences often manifest as a combination of local mutations and global pattern deviations. A single convolutional network or self-attention mechanism is difficult to capture multi-scale local dependencies and long-distance global dependencies at the same time, resulting in incomplete feature extraction. On the other hand, multi-source behavior data contains discrete operation types and continuous resource indicators, which are heterogeneous in format and have different dimensions. Traditional data preprocessing methods are difficult to effectively integrate them into a unified temporal representation.

[0006] In terms of reconstruction error assessment, common methods typically calculate the overall reconstruction error by equally weighting each behavioral variable, failing to distinguish the fluctuation differences of different variables under normal patterns. For variables that are inherently highly volatile, their large reconstruction error values ​​can easily mask minor deviations in key stability indicators, leading to a decrease in the detection signal-to-noise ratio. Simultaneously, fixed anomaly detection thresholds cannot adapt to dynamic changes in data distribution, easily generating a large number of false alarms during peak business periods or when behavioral patterns gradually change, while overly lenient thresholds may lead to detection delays and missed detections. Summary of the Invention

[0007] To address the shortcomings of existing technologies, this invention provides a neural network anomaly detection method driven by time-series behavioral data, comprising the following steps: Collect multi-source behavioral data and construct multivariate time-series behavioral sequences; The multivariate temporal behavior sequence is input into the hybrid feature extraction network. The hybrid feature extraction network extracts features through parallel local temporal convolution branches and global self-attention branches, and uses a gating mechanism to adaptively fuse the outputs of the two branches to obtain a fused behavior representation. Using fused behavioral representations as a condition, adversarial training is performed on the reconstructed autoencoder within the generative adversarial network framework, forcing the reconstructed autoencoder to learn the compact reconstruction distribution of normal behavior, thus obtaining an optimized reconstruction network. The input sequence is reconstructed using an optimized reconstruction network to generate a reconstructed sequence. Weights are assigned to each variable based on the historical volatility of each behavioral variable, and the weighted reconstruction error is calculated. The time series of weighted reconstruction error is dynamically updated with a threshold. When the weighted reconstruction error at a certain moment exceeds the dynamic threshold, an anomaly is determined to have occurred at that moment.

[0008] Furthermore, the processing procedure of the hybrid feature extraction network is as follows: Multivariable time series behavior sequences The data are fed into the parallel local temporal convolution branch and the global self-attention branch, respectively, where T is the number of time steps and D is the dimension of the behavior variable; In the local temporal convolution branch, feature transformation of X is performed through multiple stacked layers of one-dimensional dilated causal convolutions. The dilation rate of each convolution increases with the number of layers, thereby capturing local dependencies at different time scales. This branch ultimately outputs a local feature matrix. ; In the global self-attention branch, a learnable positional encoding is first added to each time step of X. Then, the attention weight between any two time steps in the sequence is calculated through a multi-head self-attention mechanism. Finally, the features of all time steps are weighted and aggregated to capture global dependencies and output a global feature matrix. ; Subsequently, the local feature matrix and global feature matrix The concatenation matrix is ​​obtained by concatenating the features along the feature dimension. Global average pooling is then performed on this concatenated matrix along the time dimension to obtain a fused feature vector of dimension D. This fused feature vector is then linearly transformed through a fully connected layer, and the output value is compressed to between 0 and 1 using a sigmoid function to obtain a gated weight vector of dimension D. The calculation formula is as follows: ; in, and These are the weight matrix and bias term of the fully connected layer, respectively. This indicates a splicing operation. This represents global average pooling along the time dimension. Represents the Sigmoid function; Finally, the local and global features are fused element-wise using the gated weight vector g: Copy and expand g along the time dimension to the local feature matrix. Gated extended matrices of the same shape , where each element in each row is equal to g; With gated extended matrix For local feature matrix Weighted, with For the global characteristic matrix Weighted summation, followed by addition of the two, yields the fused behavioral representation. : ; This indicates element-wise multiplication.

[0009] Furthermore, adversarial training of the reconstructed autoencoder is performed within the generative adversarial network framework, specifically including: Construct a generative adversarial network consisting of a generator G and a discriminator D; The generator G is the reconstructive autoencoder, which is characterized by its fusion behavior. As input, a reconstruction sequence is generated through a decoder network. ; Discriminator D uses either the true sequence X or the reconstructed sequence As input, output a probability value indicating that the input comes from real data; During training, for the generator G, it is necessary to simultaneously optimize its reconstruction capability and its ability to deceive the discriminator: First, calculate the reconstruction loss, which is the difference between the real sequence X and the reconstructed sequence. The sum of squared Euclidean distances between the points is used to measure the fidelity of the reconstruction; then the adversarial loss term is calculated. By minimizing this item, it prompts Decrease, that is, increase the output probability of the discriminator for the reconstructed sequence. Approaching 1 achieves a deceptive effect; the reconstruction loss is multiplied by the weighting coefficient. The adversarial loss terms are added together to form the generator loss function. : ; For discriminator D, the goal is to correctly distinguish between the true sequence and the reconstructed sequence: calculate the expected value of the log probability output by the discriminator for the true sequence, and the expected value of the log probability output by the discriminator for the reconstructed sequence, and take the negative of the sum of the two as the discriminator loss function. : ; Minimize by alternation and The parameters of the generator and discriminator are iteratively updated until the preset training termination condition is reached, resulting in an optimized and reconstructed network.

[0010] Furthermore, weights are assigned to each variable based on its historical volatility, and a weighted reconstruction error is calculated, including: For each behavioral variable, maintain a sliding window of length W, which stores the historical values ​​of the variable over the most recent W time steps; For behavioral variable i, calculate the variance of all its values ​​within the sliding window. This is used to measure the degree of fluctuation of the variable under normal conditions; To give stable variables higher weights in anomaly detection, while appropriately suppressing variables with volatile behavior, for each variable i, we first calculate the reciprocal of its historical variance, then sum the reciprocals of the variances of all variables and use the sum as the denominator to calculate the normalized weights. ; To avoid division-by-zero errors when the historical variance is zero, a small constant is added to the denominator. The calculation formula is as follows: ; In the error calculation step by step, for time t, the true value of each variable i is taken. With reconstructed value The difference is squared, and then multiplied by the weight of that variable. ; Summing the products of all variables yields the weighted reconstruction error at time t. : .

[0011] Furthermore, the time series of weighted reconstruction errors is dynamically updated with thresholds to identify anomalies, including: The initial error mean is calculated using the weighted reconstruction error of the first M time steps and the sample mean. The initial error variance is calculated using the sample variance. M is the preset initial window length; For each subsequent time step The exponentially weighted moving average method is used to perform online statistical analysis on the weighted reconstruction error sequence with a preset smoothing decay coefficient α. The weighted reconstruction error at the current moment Mean error compared to the previous time step Perform a weighted average to obtain the updated mean error. : ; At the same time, using the current error and the updated mean The square of the difference, and the variance of the error at the previous time step. Perform a weighted average and update the error variance. : ; To obtain the mean error at the current moment and variance Then, calculate the standard deviation. The mean plus β times the standard deviation is used as the dynamic threshold at the current time. : ; Where β is a preset threshold adjustment coefficient, used to control the strictness of anomaly detection; when When the weighted reconstruction error at the current moment exceeds the dynamic threshold, it is determined that there is abnormal behavior at time t.

[0012] Furthermore, before adversarial training, the reconstructed autoencoder includes a self-supervised pre-training step based on a masked autoencoder, which specifically includes: For a multivariate time-series behavioral sequence X, a random binary mask matrix M with the same shape as X is generated according to a preset mask ratio, wherein the elements take the value 0 with a preset probability p and take the value 1-p with a preset probability p, where p is the mask ratio. An element of 0 in matrix M indicates that the value of the behavior variable at that position is masked. The original sequence is masked using a masking matrix to obtain a corrupted sequence. This indicates element-wise multiplication; Damaged sequence The encoder part of the reconstructed autoencoder is input, the compressed latent representation is extracted, and then the decoder part generates the predicted value of the complete sequence. ; During the pre-training phase, the loss is calculated by minimizing the mean squared error between the predicted and actual values ​​of the occluded portion. ; After pre-training, the parameters of the reconstructed autoencoder are retained as the initial parameters for adversarial training.

[0013] Furthermore, the multi-source behavioral data includes at least user operation logs, system call sequences, and network access records; a multivariate time-series behavioral sequence is constructed, specifically including: Align behavioral data from various sources according to a unified time window, and perform statistics or sampling on the behaviors that occur within each time window; For discrete behavioral data, such as operation type, command invocation, and access domain name, each discrete identifier is mapped to a continuous vector of a preset dimension through its respective embedding layer. This mapping process is represented as follows: , where k is the integer index of the discrete identifier. For trainable embedding lookup operations; For numerical behavioral data, including CPU utilization and network traffic, maximum-minimum normalization is performed to map the value range to the [0,1] interval. The normalization calculation is as follows: Where v is the original value, and These are the minimum and maximum values ​​of the numerical feature within the pre-statistical period, respectively. The embedded vectors mapped from all discrete behaviors within the same time step are concatenated with the normalized values ​​of all numerical behaviors to form the complete behavioral feature vector for that time step, thus constituting a multivariate temporal behavioral sequence.

[0014] Furthermore, a learnable temporal position encoding is superimposed on the complete behavioral feature vector formed by splicing, so as to explicitly inject time step sequence information; The specific operation is as follows: maintain a learnable vector for each time step t. Combine it with the complete behavioral feature vector Sum the results to obtain the final vector for that time step. ,in Dimensions and The same applies, and it is jointly optimized with other network parameters during training; the vectors of all time steps Stacked along the time dimension, they form a multivariate temporal behavior sequence matrix. , as input to the hybrid feature extraction network.

[0015] A neural network anomaly detection system driven by time-series behavioral data includes: The data acquisition and sequence construction module is used to collect multi-source behavioral data and construct multivariate time-series behavioral sequences. The hybrid feature extraction module receives multivariate temporal behavior sequences, extracts features through parallel local temporal convolution branches and global self-attention branches, and uses a gating mechanism to adaptively fuse the outputs of the two branches to obtain a fused behavior representation. The adversarial training module is used to perform adversarial training on the reconstructed autoencoder within the generative adversarial network framework, using fused behavioral representations as conditions. This forces the reconstructed autoencoder to learn the compact reconstructed distribution of normal behavior, resulting in an optimized reconstructed network. The reconstruction and error calculation module is used to reconstruct the input sequence using an optimized reconstruction network, generate a reconstructed sequence, assign weights to each variable based on the historical volatility of each behavioral variable, and calculate the weighted reconstruction error. The dynamic threshold anomaly detection module is used to dynamically update the threshold of the time series of weighted reconstruction error. When the weighted reconstruction error at a certain moment exceeds the dynamic threshold, an anomaly is determined to have occurred at that moment.

[0016] The present invention has the following advantages over the prior art: By gating and adaptively fusing local temporal convolution with global self-attention, multi-scale local dependencies and long-range global dependencies in temporal behavioral data can be captured simultaneously, significantly improving the ability to represent complex behavioral patterns. Based on this, adversarial training of the reconstruction autoencoder within a generative adversarial network framework forces the reconstruction network to learn a compact reconstruction distribution of normal behavior, significantly increasing the reconstruction error of anomalous samples and thus enhancing the sensitivity to detect unknown anomalies. The historical volatility of each behavioral variable is used to assign weights to the reconstruction error, allowing stable variables to play a greater role in anomaly detection, effectively suppressing interference from highly volatile noise variables and reducing the false alarm rate. An exponentially weighted moving average method is used to statistically analyze the weighted reconstruction error online and dynamically update the threshold, enabling the judgment boundary to adapt to changes in data distribution and avoiding the failure of fixed thresholds in non-stationary behavioral scenarios. Furthermore, through self-supervised pre-training of the masked autoencoder, the reconstruction autoencoder possesses a priori understanding of the intrinsic relationships between behaviors before adversarial training, accelerating model convergence and improving reconstruction accuracy, further ensuring the reliability and real-time performance of anomaly detection. Attached Figure Description

[0017] Figure 1 This is the overall flowchart of the present invention. Detailed Implementation

[0018] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided below.

[0019] like Figure 1 As shown, the neural network anomaly detection method driven by time-series behavioral data includes the following steps: Collect multi-source behavioral data and construct multivariate time-series behavioral sequences; The multivariate temporal behavior sequence is input into the hybrid feature extraction network. The hybrid feature extraction network extracts features through parallel local temporal convolution branches and global self-attention branches, and uses a gating mechanism to adaptively fuse the outputs of the two branches to obtain a fused behavior representation. Using fused behavioral representations as a condition, adversarial training is performed on the reconstructed autoencoder within the generative adversarial network framework, forcing the reconstructed autoencoder to learn the compact reconstruction distribution of normal behavior, thus obtaining an optimized reconstruction network. The input sequence is reconstructed using an optimized reconstruction network to generate a reconstructed sequence. Weights are assigned to each variable based on the historical volatility of each behavioral variable, and the weighted reconstruction error is calculated. The time series of weighted reconstruction error is dynamically updated with a threshold. When the weighted reconstruction error at a certain moment exceeds the dynamic threshold, an anomaly is determined to have occurred at that moment.

[0020] The specific processing steps of the hybrid feature extraction network are as follows: Multivariable time series behavior sequences The data are fed into the parallel local temporal convolution branch and the global self-attention branch, respectively, where T is the number of time steps and D is the dimension of the behavior variable; In the local temporal convolution branch, feature transformation of X is performed through multiple stacked layers of one-dimensional dilated causal convolutions. The dilation rate of each convolution increases with the number of layers, thereby capturing local dependencies at different time scales. This branch ultimately outputs a local feature matrix. ; In the global self-attention branch, a learnable positional encoding is first added to each time step of X. Then, the attention weight between any two time steps in the sequence is calculated through a multi-head self-attention mechanism. Finally, the features of all time steps are weighted and aggregated to capture global dependencies and output a global feature matrix. ; Subsequently, the local feature matrix and global feature matrix The concatenation matrix is ​​obtained by concatenating the features along the feature dimension. Global average pooling is then performed on this concatenated matrix along the time dimension to obtain a fused feature vector of dimension D. This fused feature vector is then linearly transformed through a fully connected layer, and the output value is compressed to between 0 and 1 using a sigmoid function to obtain a gated weight vector of dimension D. The calculation formula is as follows: ; in, and These are the weight matrix and bias term of the fully connected layer, respectively. This indicates a splicing operation. This represents global average pooling along the time dimension. Represents the Sigmoid function; Finally, the local and global features are fused element-wise using the gated weight vector g: Copy and expand g along the time dimension to the local feature matrix. Gated extended matrices of the same shape , where each element in each row is equal to g; With gated extended matrix For local feature matrix Weighted, with For the global characteristic matrix Weighted summation, followed by addition of the two, yields the fused behavioral representation. : ; This indicates element-wise multiplication; By setting up local temporal convolutional branches and global self-attention branches in parallel and adaptively fusing them using a gating mechanism, the model can simultaneously capture local mutation features of adjacent time steps and global dependencies of distant time steps in the behavior sequence. This effectively compensates for the incomplete coverage of behavior patterns by a single feature extraction method, thus preserving more complete contextual information in normal behavior modeling. During the fusion process, the gating weight vector is automatically learned from the concatenated features through global pooling and fully connected layers. It can dynamically adjust the contribution ratio of local and global features according to the input data, so that the high-response features of the local convolutional branch are fully preserved when local abnormal mutations occur, while the smooth features of the global attention branch are enhanced in the stable period phase. This achieves differentiated representation of different behavior states, thereby causing the reconstruction autoencoder to produce significantly larger reconstruction errors at abnormal moments, greatly improving the sensitivity and accuracy of anomaly detection.

[0021] Detection of abnormal user login behavior on the enterprise intranet: Two behavioral metrics were collected from a user every 5-minute time window: login interval (in minutes) and number of failed login attempts (in times), forming a multivariate time-series behavioral sequence. The sequence was then taken over four consecutive time steps. This represents the process of normal use → one failed login attempt → recovery → brute-force attack, with specific values ​​as follows: ; The fourth login step, which involved a sudden increase in the login interval to 20 minutes and five failed attempts, is considered abnormal behavior.

[0022] After the hybrid feature extraction network processes X, the local temporal convolutional branch outputs a local feature matrix. The global self-attention branch outputs the global feature matrix. : ; Will and Concatenate along the feature dimension (the second dimension) to obtain the concatenated matrix. : ; Perform global average pooling along the time dimension (the first dimension) on the concatenated matrix, that is, calculate the mean of each column at the four time steps to obtain a fused feature vector with dimension 4: ; The fused feature vector is then input into the fully connected layer for linear transformation. In this example, the weight matrix of the fully connected layer... and bias terms The value can be: ; The linear output of the fully connected layer (i.e., the input to the sigmoid function) is then: ; The linear output z is processed by the Sigmoid function. Activation yields the gating weight vector. : ; In actual operation and These are the trainable parameters of the network, which are updated iteratively as the model is trained. For ease of subsequent calculation demonstration, this example makes a slight adjustment to g while maintaining numerical reasonableness, and then takes g=[0.6,0.7].

[0023] Copy and expand g along the time dimension into a gated matrix. Each row contains [0.6, 0.7].

[0024] Then the fusion behavior representation Calculated by the following formula: ; Element-by-element calculation yields: ; Analyzing the fourth time step (the anomaly step): the local convolutional branch, capturing the sharp changes in login interval and failure count, outputs feature values ​​as high as 0.9 and 0.8; while the global self-attention branch, fusing the smooth features of the entire sequence, outputs only 0.4 and 0.5. The gating weights [0.6, 0.7] assign higher weights to local features, increasing the feature values ​​of this time step to 0.7 and 0.71 after fusion, while the feature values ​​of normal time steps (such as steps 1 and 3) are all below 0.16. This adaptive amplification mechanism of abnormal local responses significantly increases the reconstruction error of the reconstruction autoencoder at abnormal moments, facilitating accurate anomaly detection by subsequent dynamic thresholds, while avoiding false alarms for normal periodic fluctuations.

[0025] Adversarial training of the reconstructed autoencoder within the generative adversarial network framework specifically includes: Construct a generative adversarial network consisting of a generator G and a discriminator D; The generator G is the reconstructive autoencoder, which is characterized by its fusion behavior. As input, a reconstruction sequence is generated through a decoder network. ; Discriminator D uses either the true sequence X or the reconstructed sequence As input, output a probability value indicating that the input comes from real data; During training, for the generator G, it is necessary to simultaneously optimize its reconstruction capability and its ability to deceive the discriminator: First, calculate the reconstruction loss, which is the difference between the real sequence X and the reconstructed sequence. The sum of squared Euclidean distances between the points is used to measure the fidelity of the reconstruction; then the adversarial loss term is calculated. By minimizing this item, it prompts Decrease, that is, increase the output probability of the discriminator for the reconstructed sequence. Approaching 1 achieves a deceptive effect; the reconstruction loss is multiplied by the weighting coefficient. The adversarial loss terms are added together to form the generator loss function. : ; For discriminator D, the goal is to correctly distinguish between the true sequence and the reconstructed sequence: calculate the expected value of the log probability output by the discriminator for the true sequence, and the expected value of the log probability output by the discriminator for the reconstructed sequence, and take the negative of the sum of the two as the discriminator loss function. : ; Minimize by alternation and The parameters of the generator and discriminator are iteratively updated until the preset training termination condition is reached, resulting in an optimized and reconstructed network. By training the reconstruction autoencoder adversarially within a generative adversarial network (GAN) framework, and replacing single-reconstruction-loss training with joint optimization of reconstruction loss and adversarial loss, the reconstruction autoencoder is forced to learn a compact reconstruction distribution of normal behavior under the dynamic constraints of the discriminator. This pulls the reconstruction sequence of normal samples toward the center of the true distribution in the feature space, resulting in minimal reconstruction error at normal times. However, abnormal samples, deviating from this distribution, exhibit significantly amplified deviations from the true sequence in their reconstruction, leading to more pronounced reconstruction error peaks during anomaly detection and a substantial improvement in detection sensitivity. Simultaneously, the adversarial loss term encourages the generator to deceive the discriminator, effectively suppressing overfitting of the autoencoder to noise or non-essential patterns in the training data. This enhances the model's generalization ability to the intrinsic structure of behavioral patterns, maintaining a stable low reconstruction error even under non-stationary normal behavioral fluctuations, avoiding false alarms. Furthermore, alternating training can establish a highly discriminative anomaly detection boundary without requiring abnormal samples.

[0026] Detection of abnormal user login behavior on the enterprise intranet: In the aforementioned login behavior monitoring, a fusion behavior representation has been obtained. The generator G (i.e., the decoder part of the autoencoder) and the discriminator D are constructed.

[0027] During the training phase, only normal login behavior data is used to force the generator to learn the normal behavior distribution. The original behavior feature vector (normalized, dimensionless) corresponding to a typical sample from a normal time period is taken as X=[0.5,0], representing a login interval of 0.5 minutes and 0 login failures. After passing through a hybrid feature extraction network to obtain a fused behavior representation, it is fed into the generator G. The generator outputs a reconstructed vector as follows: The discriminator outputs probabilities for both real and reconstructed samples. Let the adversarial loss weights be defined. .

[0028] Calculate generator loss : ; Reconstruction loss is ; Countermeasures against loss items Substituting, we get: ; Discriminator loss for: ; Minimize by alternation and The generator is designed to reduce It will promote Further reduction, i.e., pushing The algorithm tends towards 1, thus generating a more realistic reconstruction; the discriminator, on the other hand, improves its ability to distinguish between real and fake samples.

[0029] After multiple iterations, the generator's ability to reconstruct normal samples is significantly enhanced, for example, the output... ,at this time Reconstruction loss reduced to Combating losses The model converged.

[0030] After training, for anomalous samples such as the original behavioral feature vector at the brute-force moment... After the fused behavioral representation is obtained through a hybrid feature extraction network, it is fed into the generator G. Since the generator has not learned this abnormal distribution, the reconstructed output is still close to the normal pattern, such as... The reconstruction error is as high as The abnormal peak value is significantly amplified, far exceeding the reconstruction error level of normal samples (0.0005), making it easy to detect by the dynamic threshold, and the smooth fluctuation of normal samples will not trigger false alarms.

[0031] In engineering implementation, to further alleviate the gradient vanishing problem in the early stages of training, an unsaturated generator loss can be used simultaneously as a gradient aid.

[0032] Weights are assigned to each variable based on its historical volatility, and the weighted reconstruction error is calculated, including: For each behavioral variable, maintain a sliding window of length W, which stores the historical values ​​of the variable over the most recent W time steps; For behavioral variable i, calculate the variance of all its values ​​within the sliding window. This is used to measure the degree of fluctuation of the variable under normal conditions; To give stable variables higher weights in anomaly detection, while appropriately suppressing variables with volatile behavior, for each variable i, we first calculate the reciprocal of its historical variance, then sum the reciprocals of the variances of all variables and use the sum as the denominator to calculate the normalized weights. ; To avoid division-by-zero errors when the historical variance is zero, a small constant is added to the denominator. The calculation formula is as follows: ; In the error calculation step by step, for time t, the true value of each variable i is taken. With reconstructed value The difference is squared, and then multiplied by the weight of that variable. ; Summing the products of all variables yields the weighted reconstruction error at time t. : ; By normalizing the weights based on the inverse variance of the historical volatility of each behavioral variable, variables that are stable and have small variance under normal conditions are given a larger proportion in the reconstruction error, while noisy variables that are highly volatile and have large variance are automatically suppressed. This highlights the deviation of key stable indicators when calculating anomaly scores, effectively preventing high-noise variables from masking real anomalies or causing false alarms, and significantly improving detection accuracy and robustness. The weights are updated online with the sliding window, which can adapt to the non-stationary drift of the data, and no anomaly labeling is required, thus maintaining the unsupervised nature of the method.

[0033] Scenario: Anomaly detection of user login behavior on the enterprise intranet: The sliding window length W=4 stores the normalized values ​​of the four most recent normal time steps: Variable 1 (login interval): [0.50, 0.45, 0.52, 0.48]; Variable 2 (Number of failed login attempts): [0.00, 0.10, 0.05, 0.00]; Calculate the historical variance of the two variables, and take... : ; ; True value at abnormal moments (Brute-force attack), reconstructed value (Approaching normal mode).

[0034] Unweighted error: ; Weighted reconstruction error: ; As can be seen from the comparison, the contribution of high-noise login failures (with larger var2) is significantly reduced after weighting, the abnormal deviation of the stable index login interval is highlighted, and the overall error value is pulled back to a reasonable dynamic range; for normal samples, the errors of both are minimal and no false alarms are generated.

[0035] Dynamically update the threshold of the time series of weighted reconstruction errors to identify anomalies, including: The initial error mean is calculated using the weighted reconstruction error of the first M time steps and the sample mean. The initial error variance is calculated using the sample variance. M is the preset initial window length; For each subsequent time step The exponentially weighted moving average method is used to perform online statistical analysis on the weighted reconstruction error sequence with a preset smoothing decay coefficient α. The weighted reconstruction error at the current moment Mean error compared to the previous time step Perform a weighted average to obtain the updated mean error. : ; At the same time, using the current error and the updated mean The square of the difference, and the variance of the error at the previous time step. Perform a weighted average and update the error variance. : ; To obtain the mean error at the current moment and variance Then, calculate the standard deviation. The mean plus β times the standard deviation is used as the dynamic threshold at the current time. : ; Where β is a preset threshold adjustment coefficient, used to control the strictness of anomaly detection; when When the weighted reconstruction error at the current moment exceeds the dynamic threshold, it is determined that there is abnormal behavior at time t. The weighted reconstruction error is estimated online using an exponentially weighted moving average method. The mean and variance are updated in real time using the current error. This method has low computational resource consumption and does not require storing all historical data, making it suitable for streaming behavior monitoring scenarios. In the initial stage, reasonable priors are provided by the statistical values ​​of the first M samples to avoid drastic threshold oscillations during the cold start period. The dynamic threshold is adaptively adjusted according to the data distribution. When behavior patterns change gradually, the threshold smoothly follows, avoiding lag false alarms caused by fixed thresholds. When a sudden anomaly causes a sharp increase in reconstruction error, even if the mean is partially increased, the threshold rise is significantly delayed compared to the error peak due to the smoothing coefficient controlling the update rate, ensuring that the anomaly is reliably captured. The threshold adjustment coefficient β is independent of the detection logic and can be flexibly adapted to different security level scenarios to achieve a controllable balance between false alarm rate and false negative rate.

[0036] Detection of abnormal user login behavior on the enterprise intranet: The initial window length M=4, and the weighted reconstruction errors accumulated over the first 4 normal time steps are as follows: .

[0037] The initial error mean was calculated using the sample mean. The initial error variance is calculated by dividing the sample variance by (M-1) : ; ; Set the smooth attenuation coefficient α=0.05 and the threshold adjustment coefficient β=3.

[0038] Time step 5 (normal): Weighted reconstruction error Update the mean and variance: ; ; Dynamic threshold The result is normal.

[0039] Time step 6 (abnormal, brute force): Weighted reconstruction error suddenly increases to Update the mean and variance: ; ; Dynamic threshold An anomaly was detected.

[0040] The threshold during the normal phase stabilizes at approximately The magnitude of the error is stable; at abnormal moments, the error spikes to 0.2311. Although the mean is raised to 0.012, the threshold only rises to 0.159 due to the small α value. The error still significantly exceeds the threshold, successfully triggering an alarm. If the error subsequently falls back, the threshold will slowly converge to the normal level, maintaining detection sensitivity.

[0041] Before adversarial training, the reconstructed autoencoder also includes a self-supervised pre-training step based on a masked autoencoder, which specifically includes: For a multivariate time-series behavioral sequence X, a random binary mask matrix M with the same shape as X is generated according to a preset mask ratio, wherein the elements take the value 0 with a preset probability p and take the value 1-p with a preset probability p, where p is the mask ratio. An element of 0 in matrix M indicates that the value of the behavior variable at that position is masked. The original sequence is masked using a masking matrix to obtain a corrupted sequence. This indicates element-wise multiplication; Damaged sequence The encoder part of the reconstructed autoencoder is input, the compressed latent representation is extracted, and then the decoder part generates the predicted value of the complete sequence. ; During the pre-training phase, the loss is calculated by minimizing the mean squared error between the predicted and actual values ​​of the occluded portion. ; After pre-training is completed, the parameters of the reconstructed autoencoder are retained as the initial parameters for adversarial training; Before adversarial training, a self-supervised pre-training method based on a masked autoencoder is introduced. By randomly masking partial variable values ​​in the behavioral sequence, the reconstruction autoencoder is forced to predict missing values ​​based on the unmasked context. This process allows the model to fully learn the spatiotemporal dependencies and intrinsic correlation patterns among multivariate behaviors without any anomaly labeling, providing high-quality initial parameters for subsequent generative adversarial training, significantly accelerating convergence and enhancing training stability. The pre-trained reconstruction autoencoder has a stronger reconstruction capability for normal behaviors, resulting in a denser reconstruction distribution during the adversarial training phase. The reconstruction error of normal samples is lower, while the reconstruction bias of abnormal samples is further amplified, effectively improving the sensitivity and robustness of anomaly detection.

[0042] Anomaly detection of user login behavior on enterprise intranet (pre-training phase): Take a continuous sequence of login behavior over four time steps. The two features are login interval and number of login failures (normalized): ; With a preset mask ratio p=0.5, a random binary mask matrix is ​​generated. (Element 0 represents covering): ; That is, the number of login failures in the first time step and the login interval in the third time step are covered.

[0043] The original sequence is masked using a mask matrix to obtain a corrupted sequence. : ; Will The input is a reconstructed autoencoder (encoder-decoder structure). The encoder extracts compressed latent representations, and the decoder generates predicted values ​​for the complete sequence. .

[0044] Assuming that after several rounds of pre-training, the model has initially learned behavioral associations, the predicted value output for this sample is: ; The pre-training loss only calculates the mean square error at the occluded location (M=0), i.e., for... Find the sum of squares: ; ; ; loss: ; By minimizing this loss, the model is forced to infer the value of the occluded position using normal behavior information from the unoccluded location, thereby learning the temporal correlation between the login interval and the number of failures. After pre-training, these parameters are used as the initial parameters for subsequent adversarial training, enabling the generator to have good normal behavior reconstruction capabilities from the start, significantly shortening the convergence time of adversarial training and improving the final detection accuracy.

[0045] Multi-source behavioral data includes at least user operation logs, system call sequences, and network access records; constructing multivariate time-series behavioral sequences specifically includes: Align behavioral data from various sources according to a unified time window, and perform statistics or sampling on the behaviors that occur within each time window; For discrete behavioral data, such as operation type, command invocation, and access domain name, each discrete identifier is mapped to a continuous vector of a preset dimension through its respective embedding layer. This mapping process is represented as follows: , where k is the integer index of the discrete identifier. For trainable embedding lookup operations; For numerical behavioral data, including CPU utilization and network traffic, maximum-minimum normalization is performed to map the value range to the [0,1] interval. The normalization calculation is as follows: Where v is the original value, and These are the minimum and maximum values ​​of the numerical feature within the pre-statistical period, respectively. The embedded vectors mapped from all discrete behaviors within the same time step are concatenated with the normalized values ​​of all numerical behaviors to form the complete behavioral feature vector for that time step, thus constituting a multivariate temporal behavioral sequence. By aligning multi-source heterogeneous behavioral data such as user operation logs, system call sequences, and network access records into a unified time window, and mapping discrete behaviors into dense vectors using an embedding layer and performing maximum-minimum normalization on numerical behaviors, the original semantically different behavioral information is uniformly transformed into a multivariate temporal behavioral sequence with physical consistency. This effectively solves the problem of difficulty in joint modeling due to heterogeneous formats and inconsistent dimensions of multi-source data. This allows the subsequent hybrid feature extraction network to fully utilize the complementary information of cross-domain behaviors, significantly enhancing the representation and identification capabilities of complex abnormal patterns. Furthermore, the embedding layer parameters can be trained end-to-end and can automatically learn the optimal discrete behavioral semantic representation adapted to the task.

[0046] Anomaly detection of user login behavior on the enterprise intranet (data construction): Take multi-source behavioral data within a 5-minute time window, including three types of discrete behaviors: user operation type, system call command, and access domain name, as well as two types of numerical behaviors: CPU utilization and network traffic.

[0047] Discrete behavioral data: Operation type: `LOGIN`, index ; System call command: `execve`, index ; Access domain: `mail.internal.com`, index ; Numerical behavioral data (minimum and maximum values ​​within the pre-statistical period have been recorded): CPU utilization (raw value) ; Raw network traffic values , ; Discrete identifiers are mapped through their respective embedding layers (assuming embedding dimension). The parameter is a trainable lookup table. Assume that after training, the embedding vector is: ; ; ; Perform maximum-minimum normalization on the numerical features, mapping them to [0,1]: ; ; Concatenate all feature vectors at this time step to obtain the complete behavioral feature vector. (3×3D embedding + 2D numerical): ; Construct each time step in the same manner This constitutes a multivariate temporal behavior sequence, which serves as the input to the subsequent hybrid feature extraction network. This process unifies semantically heterogeneous login operations, system commands, domain name access, and resource consumption indicators into a fixed-dimensional numerical vector, thus comprehensively and without information loss depicting the full picture of user behavior at that time step.

[0048] The concatenated complete behavioral feature vector is also superimposed with learnable temporal position encoding to explicitly inject time step sequence information; The specific operation is as follows: maintain a learnable vector for each time step t. Combine it with the complete behavioral feature vector Sum the results to obtain the final vector for that time step. ,in Dimensions and The same applies, and it is jointly optimized with other network parameters during training; the vectors of all time steps Stacked along the time dimension, they form a multivariate temporal behavior sequence matrix. , as input to the hybrid feature extraction network; By superimposing a learnable temporal position encoding onto the complete behavioral feature vector at each time step, temporal sequence information is explicitly injected into the multivariate behavioral sequence. This enables the global self-attention branch in the subsequent hybrid feature extraction network to effectively distinguish the context of different time steps, avoiding the loss of temporal structure due to permutation invariance, thereby enhancing the ability to perceive periodic behavioral patterns and trend anomalies. As a trainable parameter, this position encoding vector is jointly optimized with other network parameters during training, enabling adaptive learning of the optimal temporal position representation in specific scenarios. Compared with fixed sine and cosine encoding, it better matches the temporal dependency features of real business data, further improving the accuracy and robustness of anomaly detection.

[0049] Anomaly detection of user login behavior on enterprise intranet (time and location code overlay): Based on the previous example, the complete behavioral feature vectors (each with a dimension of 5) for time steps 1, 2, and 3 have been obtained, as follows: ; ; ; Maintain a learnable vector for each time step. Dimensions and Same (5 dimensions here). Assume that after training, the position encoding vector values ​​at each time step are as follows: ; ; ; The corresponding time step and Element-wise addition yields the final vector input to the hybrid feature extraction network. : ; ; ; Vectors of all time steps Stacked along the time dimension, they form a multivariate temporal behavior sequence matrix. : ; This matrix is ​​directly used as input to the hybrid feature extraction network. The introduction of learnable positional encoding ensures that the feature vector at each time step carries a unique temporal identifier, for example... The addition of this feature causes a specific shift in the behavioral representation of the second time step in the feature space, which helps the self-attention branch accurately distinguish the temporal relationship between the "current step", "previous step" and "next step", thereby effectively capturing the temporal evolution of login behavior and improving the sensitivity of anomaly detection to temporal pattern anomalies.

[0050] A neural network anomaly detection system driven by time-series behavioral data includes: The data acquisition and sequence construction module is used to collect multi-source behavioral data and construct multivariate time-series behavioral sequences. The hybrid feature extraction module receives multivariate temporal behavior sequences, extracts features through parallel local temporal convolution branches and global self-attention branches, and uses a gating mechanism to adaptively fuse the outputs of the two branches to obtain a fused behavior representation. The adversarial training module is used to perform adversarial training on the reconstructed autoencoder within the generative adversarial network framework, using fused behavioral representations as conditions. This forces the reconstructed autoencoder to learn the compact reconstructed distribution of normal behavior, resulting in an optimized reconstructed network. The reconstruction and error calculation module is used to reconstruct the input sequence using an optimized reconstruction network, generate a reconstructed sequence, assign weights to each variable based on the historical volatility of each behavioral variable, and calculate the weighted reconstruction error. The dynamic threshold anomaly detection module is used to dynamically update the threshold of the time series of weighted reconstruction error. When the weighted reconstruction error at a certain moment exceeds the dynamic threshold, an anomaly is determined to have occurred at that moment.

[0051] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. A neural network anomaly detection method driven by time-series behavioral data, characterized in that, Includes the following steps: Collect multi-source behavioral data and construct multivariate time-series behavioral sequences; The multivariate temporal behavior sequence is input into the hybrid feature extraction network. The hybrid feature extraction network extracts features through parallel local temporal convolution branches and global self-attention branches, and uses a gating mechanism to adaptively fuse the outputs of the two branches to obtain a fused behavior representation. Using fused behavioral representations as a condition, adversarial training is performed on the reconstructed autoencoder within the generative adversarial network framework, forcing the reconstructed autoencoder to learn the compact reconstruction distribution of normal behavior, thus obtaining an optimized reconstruction network. The input sequence is reconstructed using an optimized reconstruction network to generate a reconstructed sequence. Weights are assigned to each variable based on the historical volatility of each behavioral variable, and the weighted reconstruction error is calculated. The time series of weighted reconstruction error is dynamically updated with a threshold. When the weighted reconstruction error at a certain moment exceeds the dynamic threshold, an anomaly is determined to have occurred at that moment.

2. The neural network anomaly detection method driven by time-series behavioral data according to claim 1, characterized in that: The specific processing steps of the hybrid feature extraction network are as follows: Multivariable time series behavior sequences The data are fed into the parallel local temporal convolution branch and the global self-attention branch, respectively, where T is the number of time steps and D is the dimension of the behavior variable; In the local temporal convolution branch, feature transformation of X is performed through multiple stacked layers of one-dimensional dilated causal convolutions. The dilation rate of each convolution increases with the number of layers, thereby capturing local dependencies at different time scales. This branch ultimately outputs a local feature matrix. ; In the global self-attention branch, a learnable positional encoding is first added to each time step of X. Then, the attention weight between any two time steps in the sequence is calculated through a multi-head self-attention mechanism. Finally, the features of all time steps are weighted and aggregated to capture global dependencies and output a global feature matrix. ; Subsequently, the local feature matrix and the global feature matrix are concatenated along the feature dimension to obtain a concatenated matrix; global average pooling is performed on the concatenated matrix along the time dimension to obtain a fused feature vector of dimension D; the fused feature vector is linearly transformed through a fully connected layer, and then the output value is compressed to between 0 and 1 by the Sigmoid function to obtain a gated weight vector of dimension D. Finally, the local and global features are fused element-wise using the gated weight vector g: The gate weight vector is copied and expanded along the time dimension into a gate expansion matrix with the same shape as the local feature matrix. ; With gated extended matrix Weighting the local feature matrix, with The global feature matrix is ​​weighted, and then the two are added together to obtain the fused behavioral representation.

3. The neural network anomaly detection method driven by time-series behavioral data according to claim 2, characterized in that: Adversarial training of the reconstructed autoencoder within the generative adversarial network framework specifically includes: Construct a generative adversarial network consisting of a generator G and a discriminator D; The generator G is the reconstruction autoencoder, which takes the fused behavioral representation as input and generates the reconstruction sequence through the decoder network. ; Discriminator D uses either the true sequence X or the reconstructed sequence As input, output a probability value indicating that the input comes from real data; During training, for the generator G, it is necessary to simultaneously optimize its reconstruction capability and its ability to deceive the discriminator: First, calculate the reconstruction loss, which is the difference between the real sequence X and the reconstructed sequence. The sum of squared Euclidean distances between the points is used to measure the fidelity of the reconstruction; then the adversarial loss term is calculated. By minimizing this item, it prompts Decrease, that is, increase the output probability of the discriminator for the reconstructed sequence. Approaching 1 achieves a deceptive effect; the reconstruction loss is multiplied by the weighting coefficient. The adversarial loss terms are added together to form the generator loss function. ; For discriminator D, the goal is to correctly distinguish between the real sequence and the reconstructed sequence: calculate the expected value of the log probability output by the discriminator for the real sequence and the expected value of the log probability output by the discriminator for the reconstructed sequence, and take the negative of the sum of the two as the discriminator loss function. By alternately minimizing the generator loss function and the discriminator loss function, the parameters of the generator and discriminator are iteratively updated until the preset training termination condition is reached, thus obtaining an optimized and reconstructed network.

4. The neural network anomaly detection method driven by time-series behavioral data according to claim 3, characterized in that: Weights are assigned to each variable based on its historical volatility, and the weighted reconstruction error is calculated, including: For each behavioral variable, maintain a sliding window of length W, which stores the historical values ​​of the variable over the most recent W time steps; For behavioral variable i, calculate the variance of all its values ​​within the sliding window. This is used to measure the degree of fluctuation of the variable under normal conditions; In order to give stable variables higher weight in anomaly detection, while suppressing variables that fluctuate wildly, for each variable i, we first calculate the reciprocal of its historical variance, and then sum the reciprocals of the variances of all variables as the denominator to calculate the normalized weight. To avoid division by zero when the historical variance is zero, a small constant is added to the denominator; In the error calculation step by step, for time t, the difference between the true value and the reconstructed value of each variable i is taken, its square is calculated, and then multiplied by the weight of that variable. Summing the products of all variables yields the weighted reconstruction error at time t.

5. The neural network anomaly detection method driven by time-series behavioral data according to claim 4, characterized in that: Dynamically update the threshold of the time series of weighted reconstruction errors to identify anomalies, including: The initial error mean is calculated using the weighted reconstruction error of the first M time steps and the sample mean. The initial error variance is calculated using the sample variance. M is the preset initial window length; For each subsequent time step The exponentially weighted moving average method is used to perform online statistical analysis on the weighted reconstruction error sequence with a preset smoothing decay coefficient α. The weighted reconstruction error at the current moment Mean error compared to the previous time step Perform a weighted average to obtain the updated mean error. ; At the same time, using the current error and the updated mean The square of the difference, and the variance of the error at the previous time step. Perform a weighted average and update the error variance. ; To obtain the mean error at the current moment and variance Then, calculate the standard deviation. The mean plus β times the standard deviation is used as the dynamic threshold at the current time. ; when When the weighted reconstruction error at the current moment exceeds the dynamic threshold, it is determined that there is abnormal behavior at time t.

6. The neural network anomaly detection method driven by time-series behavioral data according to claim 5, characterized in that: Before adversarial training, the reconstructed autoencoder also includes a self-supervised pre-training step based on a masked autoencoder, which specifically includes: For a multivariate time-series behavioral sequence X, a random binary mask matrix M with the same shape as X is generated according to a preset mask ratio, wherein the elements take the value 0 with a preset probability p and take the value 1-p with a preset probability p, where p is the mask ratio. An element of 0 in matrix M indicates that the value of the behavior variable at that position is masked. The original sequence is masked using a masking matrix to obtain a corrupted sequence. This indicates element-wise multiplication; Damaged sequence The encoder part of the reconstructed autoencoder is input, the compressed latent representation is extracted, and then the decoder part generates the predicted value of the complete sequence. ; The pre-training phase minimizes the mean square error between the predicted and actual values ​​of the occluded portion. After pre-training, the parameters of the reconstructed autoencoder are retained as the initial parameters for adversarial training.

7. The neural network anomaly detection method driven by time-series behavioral data according to claim 6, characterized in that: Multi-source behavioral data includes at least user operation logs, system call sequences, and network access records; constructing multivariate time-series behavioral sequences specifically includes: Align behavioral data from various sources according to a unified time window, and perform statistics or sampling on the behaviors that occur within each time window; For discrete behavioral data, such as operation type, command call, and access domain name, each discrete identifier is mapped to a continuous vector of a preset dimension through its respective embedding layer; For numerical behavioral data, including CPU utilization and network traffic, maximum-minimum normalization is performed to map the value range to the [0,1] interval. The embedded vectors mapped from all discrete behaviors within the same time step are concatenated with the normalized values ​​of all numerical behaviors to form the complete behavioral feature vector for that time step, thus constituting a multivariate temporal behavioral sequence.

8. The neural network anomaly detection method driven by time-series behavioral data according to claim 7, characterized in that: The concatenated complete behavioral feature vector is also superimposed with learnable temporal position encoding to explicitly inject time step sequence information; The specific operation is as follows: maintain a learnable vector for each time step t. Combine it with the complete behavioral feature vector Sum the results to obtain the final vector for that time step. ,in Dimensions and The same applies, and it is jointly optimized with other network parameters during training; the vectors of all time steps Stacked along the time dimension, they form a multivariate temporal behavior sequence matrix. , as input to the hybrid feature extraction network.

9. A neural network anomaly detection system driven by time-series behavioral data, wherein the system is applied in the method described in any one of claims 1-8, characterized in that: include: The data acquisition and sequence construction module is used to collect multi-source behavioral data and construct multivariate time-series behavioral sequences. The hybrid feature extraction module receives multivariate temporal behavior sequences, extracts features through parallel local temporal convolution branches and global self-attention branches, and uses a gating mechanism to adaptively fuse the outputs of the two branches to obtain a fused behavior representation. The adversarial training module is used to perform adversarial training on the reconstructed autoencoder within the generative adversarial network framework, using fused behavioral representations as conditions. This forces the reconstructed autoencoder to learn the compact reconstructed distribution of normal behavior, resulting in an optimized reconstructed network. The reconstruction and error calculation module is used to reconstruct the input sequence using an optimized reconstruction network, generate a reconstructed sequence, assign weights to each variable based on the historical volatility of each behavioral variable, and calculate the weighted reconstruction error. The dynamic threshold anomaly detection module is used to dynamically update the threshold of the time series of weighted reconstruction error. When the weighted reconstruction error at a certain moment exceeds the dynamic threshold, an anomaly is determined to have occurred at that moment.