A network passive traffic analysis method and system based on convolutional neural network
Through the combination of the lightweight model of the convolutional neural network and the isolated forest model, the problem of insufficient real-time performance and high false positive rate caused by the large amount of data in passive network traffic data analysis is solved, and efficient abnormal data identification is achieved, improving the analysis efficiency. accuracy and real-time.
Patent Information
- Application Number
- CN202410236792.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-01
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-03-01
AI Technical Summary
Existing network passive traffic data analysis methods are not timely enough to process large-scale data, have low real-time performance and accuracy in identifying abnormal data, and have a high false alarm rate, making it difficult to effectively complete the task of identifying abnormal data.
Using a lightweight model based on convolutional neural networks, and combining convolutional layer compression and the isolated forest model, an efficient outlier identification function is constructed to perform multi-level abnormal data identification, reduce computing resource consumption, and improve the real-time and accuracy of analysis. .
It improves the real-time and accuracy of passive network traffic analysis, reduces the probability of misidentification, enhances the ability to identify abnormal data, and is suitable for resource-constrained environments.
Smart Images

Figure CN118101286B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a network passive traffic analysis method and system based on convolutional neural network. Background Art
[0002] Network passive traffic refers to data transmitted in the network, which is not actively sent by a specific user or device, but is passively captured or recorded by network devices (such as routers, switches, firewalls, etc.). This passive traffic data is usually used for network monitoring, analysis, and security auditing purposes to identify activities in the network, diagnose problems, and discover potential security threats.
[0003] Network data asset passive traffic typically includes the following types of data: Packet content: The content of the data packet transmitted in the network, including the message header and payload. Packet metadata: Meta information about the data packet, such as source IP address, destination IP address, port number, protocol type, packet size, etc. Traffic statistics: Data about traffic, rate, latency and other statistical information. These passive traffic data can be used for network performance monitoring, abnormal behavior detection, security incident response and other purposes. Typically, network data asset passive traffic analysis methods use this data to analyze network traffic patterns, identify abnormal behavior, detect potential network threats, etc.
[0004] Existing network passive traffic data analysis methods usually use artificial intelligence to perform anomaly identification, which results in insufficient timeliness in processing the huge amount of network passive traffic. In addition, since artificial intelligence's high-dimensional processing of data often has analysis lags, the real-time identification of abnormal data is insufficient, the accuracy deviation is large, and the false alarm rate is high, making it difficult to efficiently complete the task of identifying abnormal data in network passive traffic. Summary of the invention
[0005] In order to solve the technical problems of insufficient real-time performance and high false alarm rate of abnormal data analysis in the prior art, the present invention provides a network passive traffic analysis method and system based on convolutional neural network.
[0006] The technical solution provided by the embodiment of the present invention is as follows:
[0007] First aspect
[0008] An embodiment of the present invention provides a network passive traffic analysis method based on a convolutional neural network, comprising:
[0009] S1: Obtain abnormal network passive traffic sample data;
[0010] S2: compress the convolutional layer of the preset convolutional neural network model to build a lightweight convolutional neural network model;
[0011] S3: inputting the abnormal network passive traffic sample data as input data into the lightweight convolutional neural network model, and training the lightweight convolutional neural network model until the abnormal recognition accuracy of the abnormal network passive traffic sample data by the lightweight convolutional neural network model is greater than a preset abnormal recognition accuracy;
[0012] S4: collect real-time network passive traffic;
[0013] S5: Construct an outlier identification function that is independent of data volume based on the isolation forest model;
[0014] S6: Use the outlier recognition function to perform an anomaly recognition on the real-time network passive traffic to obtain the anomaly data to be evaluated;
[0015] S7: Use the trained lightweight convolutional neural network model to perform secondary anomaly recognition on the abnormal data to be evaluated, and output the type of abnormal data;
[0016] S8: In case an abnormal data type is received, an alarm is issued.
[0017] Second aspect
[0018] An embodiment of the present invention provides a network passive traffic analysis system based on a convolutional neural network, which is used to execute the network passive traffic analysis method based on a convolutional neural network in the first aspect.
[0019] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0020] In the present invention, convolutional layer compression technology is introduced to compress convolution kernels that consume huge computing resources, remove unnecessary convolution kernels, optimize the computing power of the convolution layer, reduce the computing resource consumption of the monitoring process, and reduce convolution operations. At the same time, the computing efficiency is improved, and the obtained lightweight convolutional neural network is used to perform abnormal analysis of network passive traffic, thereby improving the real-time performance of data analysis. In addition, an outlier recognition function based on the isolation forest model and independent of the data volume is set before the convolution layer in the lightweight convolutional neural network model to perform anomaly recognition on the real-time network passive traffic. The data can be pre-processed for initial abnormal data recognition, so that the accuracy of outlier screening will not change with the change of data volume, thereby improving the robustness and accuracy of outlier screening. Afterwards, a high-precision lightweight convolutional neural network model is used to perform secondary anomaly recognition on the preliminary screening results, i.e., the abnormal data to be evaluated, to confirm the type of abnormal data. Only when the screened abnormal data to be evaluated is received will fine-grained secondary anomaly recognition be performed, thereby reducing the data analysis burden of the lightweight convolutional neural network model, further improving the real-time performance of data analysis, and placing more computing resources of the lightweight convolutional neural network model on the abnormal data recognition task. This multi-level abnormal data recognition scheme increases the abnormal data recognition capability, reduces the probability of misidentification, and improves the accuracy of abnormal recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 A flowchart of a network passive traffic analysis method based on a convolutional neural network provided by an embodiment of the present invention;
[0023] Figure 2 A schematic diagram of the structure of a lightweight convolutional neural network model provided by an embodiment of the present invention;
[0024] Figure 3 A structural schematic diagram of a network passive traffic analysis system based on a convolutional neural network provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0025] The technical solution of the present invention is described below in conjunction with the accompanying drawings.
[0026] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "example" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "example" is intended to present the concept in a specific way. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or it can be either of the two.
[0027] In the embodiments of the present invention, "image" and "picture" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same. "of", "corresponding, relevant" and "corresponding" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same.
[0028] In the embodiments of the present invention, sometimes a subscript such as W1 may be mistakenly written as a non-subscript such as W1. When the difference is not emphasized, the meanings to be expressed are consistent.
[0029] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0030] Reference Manual Attached Figure 1 , showing a flow chart of a network passive traffic analysis method based on convolutional neural network provided in an embodiment of the present invention.
[0031] The embodiment of the present invention provides a network passive traffic analysis method based on a convolutional neural network, which can be implemented by a network passive traffic analysis device based on a convolutional neural network, and the network passive traffic analysis device based on a convolutional neural network can be a terminal or a server. The processing flow of the network passive traffic analysis method based on a convolutional neural network can include the following steps:
[0032] S1: Obtain abnormal network passive traffic sample data.
[0033] Among them, abnormal network passive traffic sample data refers to abnormal traffic data generated in the network, which is usually used for network anomaly detection and analysis. Abnormal network passive traffic sample data may include network data packets, network traffic statistics, etc. Acquiring abnormal network passive traffic sample data is historically acquired and recorded data, which usually requires network data capture and monitoring, which can be achieved through network packet capture tools (such as Wireshark) or dedicated network traffic monitoring equipment (such as network traffic analyzers). These tools can be deployed at specific locations in the network, such as ports on network switches or routers, to capture data traffic passing through these locations.
[0034] Reference Manual Attached Figure 2 , showing a structural schematic diagram of a lightweight convolutional neural network model provided by an embodiment of the present invention.
[0035] S2: Compress the convolutional layers of the preset convolutional neural network model to build a lightweight convolutional neural network model.
[0036] The preset convolutional neural network model refers to the convolutional neural network model that already exists and is predefined in the text. This model has a conventional convolutional neural network model structure, namely, input layer, convolution layer, pooling layer, fully connected layer, and output layer. The purpose of compressing the convolutional layer of the preset convolutional neural network model is to build a lightweight convolutional neural network model to reduce the complexity of the model and the consumption of computing resources, while improving the operating efficiency of the model. By compressing the convolutional layer, the number of parameters and the amount of calculation in the model can be reduced, making the model more suitable for deployment and application in resource-constrained environments.
[0037] In this lightweight convolutional neural network model, the number of model parameters and computational complexity are reduced by compressing and streamlining the convolutional layers to improve the efficiency and applicability of the model. While retaining the basic structure, the resource consumption is reduced through reasonable design and optimization. It is suitable for scenarios with limited computing resources or high requirements for model efficiency.
[0038] In one possible implementation, the lightweight convolutional neural network model includes an input layer, a convolution layer, a pooling layer, a fully connected layer and an output layer connected in sequence, wherein the convolution layer includes multiple convolution kernels.
[0039] Among them, the input layer is used to receive input data. The convolution layer is one of the core components in the neural network and is used to extract the features of the input data. The convolution layer consists of multiple convolution kernels, each of which is responsible for detecting certain specific features in the input data. By performing convolution operations on different regions, the convolution layer can generate a series of feature maps. The pooling layer is used to reduce the size of the feature map and helps to extract the most important features. Commonly used pooling operations include maximum pooling and average pooling, which select the maximum value or calculate the average value from a specific area respectively. The fully connected layer is used to convert the feature maps extracted by the convolution and pooling layers into classification or regression predictions of the input data. Each neuron is connected to all neurons in the previous layer, and the output of the previous layer is combined through weights. The output layer produces the final model output, which is usually a classification or regression prediction of the input data.
[0040] S2 specifically includes:
[0041] S201: Setting an adjustable factor for each convolution kernel in each convolution layer in the preset convolutional neural network model.
[0042] S202: Convert the adjustable factor to the forward propagation contribution ratio:
[0043]
[0044] Among them, p ij represents the adjustable factor of the jth convolution kernel of the i-th convolution layer, b represents the limit parameter, and m ij Indicates the forward propagation contribution ratio.
[0045] Among them, the forward propagation contribution ratio refers to the effective degree of the convolution kernel during forward propagation (i.e., the forward calculation of the model), that is, the contribution of each convolution kernel to the output feature map in the forward propagation. In the convolution operation, each convolution kernel will perform a convolution operation with the input feature map to generate an output feature map. The size and number of convolution kernels affect the dimension and feature expression ability of the output feature map. The forward propagation contribution ratio refers to the proportion of each convolution kernel in the output feature map during the forward propagation process, which can also be understood as the contribution of each convolution kernel to the final output feature map.
[0046] This ratio can be determined by the weight value of the convolution kernel. The larger the weight value, the greater the contribution of the corresponding convolution kernel in the forward propagation. During the training process, the model will adjust the weight value of the convolution kernel so that the model can learn better feature representation and maximize the loss function. Therefore, the forward propagation contribution ratio is dynamically changing and is determined by the weight value learned during the training process. By adjusting the forward propagation contribution ratio of the convolution kernel, monitoring and adjusting the contribution of each convolution kernel to the output feature map in the forward propagation, the model can be compressed in a refined manner, the computational complexity can be reduced, the generalization ability can be improved, the risk of overfitting can be reduced, and the model training process can be accelerated, thereby achieving a comprehensive improvement in model performance and efficiency.
[0047] S203: Use the forward propagation contribution ratio to transform the corresponding convolution kernel output:
[0048] O′ ij =m ij ×O ij
[0049] Among them, O ij Represents the convolution kernel output, O′ ij Represents the transformed convolution kernel output.
[0050] S204: Add L1 constraints to the adjustable factors in combination with the limit parameters, and use the L1 constraints to add penalty values to the loss function of the preset convolutional neural network model, so that the forward propagation contribution ratio tends to zero and the adjustable factors tend to the limit parameters, where the loss function is the cross entropy loss function:
[0051] g=∑ i,j |p ij +b|
[0052]
[0053] Among them, g represents the penalty value, i and j represent the convolution layer index and convolution kernel index respectively, l() represents the loss function of the preset convolutional neural network model, L represents the loss function of the lightweight convolutional neural network model after adding the penalty term, f(x, W), y represent the model input data and output data respectively, and W represents the trainable weight coefficient.
[0054] S205: Iterate the shrinkage limit parameter with zero as the shrinkage end point, and set the forward propagation contribution ratio to a step function of zero or one:
[0055]
[0056] Among them, t represents the current iteration number, and T represents the maximum iteration number.
[0057] S206: Remove the convolution kernel corresponding to the forward propagation contribution ratio with a value of zero, retain the convolution kernel corresponding to the forward propagation contribution ratio with a value of one, complete the convolution layer compression of the preset convolutional neural network model, and obtain a lightweight convolutional neural network model.
[0058] Among them, the L1 constraint is a regularization technique used to penalize the parameters of the model when training a neural network to prevent the model from overfitting the training data. The L1 constraint is implemented by adding the sum of the absolute values of the parameters to the loss function, making the model more sparse, that is, the values of many parameters tend to zero. The role of the L1 constraint is to make the parameters of the model more sparse, that is, the values of many parameters become close to zero. This is because the L1 norm penalizes the absolute value of the parameter, making the optimization algorithm in the training process more inclined to change the parameter to zero, thereby reducing the complexity of the model and improving the generalization ability of the model. We add constraints to the retention factor so that more of its retention factors are aligned with the boundary -b, causing the corresponding proportion of forward reasoning to become 0, so that the corresponding convolution kernel can be removed.
[0059] Specifically, an adjustable factor is set for each convolution kernel in each convolution layer in the preset convolution neural network model, and these adjustable factors are used to control the importance or contribution of each convolution kernel. The adjustable factor is converted into a value representing the forward propagation contribution ratio to ensure that the contribution of each convolution kernel to the output is properly reflected. According to the forward propagation contribution ratio, the corresponding convolution kernel output is adjusted or converted. This step can help cut unimportant convolution kernels, thereby reducing the complexity of the model. Combined with the limit parameter, an L1 constraint is added to the adjustable factor and incorporated into the loss function to use the penalty value to make the forward propagation contribution ratio tend to zero, which helps to further compress the model and eliminate unnecessary convolution kernels. Through an iterative process, the limit parameter is gradually shrunk to zero, thereby further screening out convolution kernels with smaller contributions, and finally completing the compression of the convolution layer of the preset convolution neural network model. According to the final forward propagation contribution ratio, the convolution kernel corresponding to the forward propagation contribution ratio of zero is removed, and the convolution kernel corresponding to the forward propagation contribution ratio of one is retained, thereby obtaining a lightweight convolution neural network model. By streamlining and optimizing the convolutional layers, a lightweight convolutional neural network model with higher computational efficiency and fewer parameters is constructed to adapt to scenarios with limited resources or high requirements for computational efficiency.
[0060] S3: Input the abnormal network passive traffic sample data as input data into the lightweight convolutional neural network model, and train the convolutional neural network model until the abnormal network passive traffic sample data has an anomaly recognition accuracy rate greater than a preset anomaly recognition accuracy rate.
[0061] In a possible implementation, S3 specifically includes:
[0062] S301: Receive abnormal network passive traffic sample data, wherein the abnormal network passive traffic sample data includes abnormal data and an abnormal data type label.
[0063] Among them, abnormal data refers to data that exhibits abnormal or anomalous behavior in network traffic. This may include traffic generated by malware, unauthorized access attempts, abnormally high packet loss rates, etc. Abnormal data usually needs to be analyzed and identified to determine its abnormal nature. Abnormal data type labels are labels that classify abnormal data and are used to identify the specific type or category of abnormal data. These labels can be pre-defined, such as network attack types (such as DDoS attacks, SQL injection attacks, etc.), or dynamically generated based on the characteristics and behavior of abnormal data. Obtaining abnormal data type labels usually requires professional network security analysts or security software systems to analyze and mark them. These labels can be obtained through manual annotation, automatic analysis algorithm generation, or from security threat intelligence sharing platforms and other channels.
[0064] S302: Use the convolution layer and pooling layer of the lightweight convolutional neural network model to extract features of abnormal network passive traffic samples.
[0065] S303: Combined with the abnormal data type label, the extracted features are used to identify abnormalities through the fully connected layer of the lightweight convolutional neural network model.
[0066] S304: Calculate the anomaly recognition accuracy of the lightweight convolutional neural network model.
[0067] S305: When the anomaly recognition accuracy is less than the preset anomaly recognition accuracy, a Bayesian algorithm is introduced to perform hyperparameter optimization on the lightweight convolutional neural network model. Otherwise, the process goes to S307, where the hyperparameters include a learning rate, a number of training iterations, a batch size, and a convolution kernel size.
[0068] It should be noted that those skilled in the art can set the preset abnormality recognition accuracy rate according to actual needs, and the present invention is not limited thereto.
[0069] Specifically, first, abnormal network passive traffic sample data is prepared and used as input data, which includes network data packets, metadata or traffic statistics data, for training the model. The abnormal network passive traffic sample data is input into the lightweight convolutional neural network model, and then the model is trained to minimize the loss function and improve the ability to identify abnormal data. During the training process, the model's anomaly recognition accuracy on the abnormal network passive traffic sample data is periodically evaluated. This accuracy is obtained by verifying a part of the data with a validation set. If the model's anomaly recognition accuracy reaches a preset threshold, the training process ends and the model reaches the expected performance requirements. Otherwise, the training process will continue. If the model's anomaly recognition accuracy is lower than the preset threshold, the model is optimized by introducing a Bayesian algorithm to adjust the hyperparameters to improve its performance. Through this process, the lightweight convolutional neural network model can be continuously optimized and adjusted so that it can achieve the expected anomaly recognition accuracy on the abnormal network passive traffic sample data and accurately identify abnormal data in practical applications.
[0070] It should be noted that the Bayesian optimization algorithm improves the performance and generalization ability of machine learning models by intelligently utilizing information from previous experiments to quickly find the optimal hyperparameter combination in relatively few experiments. It has the advantages of high efficiency, adaptability, globality, and automation. It can dynamically adjust the search space during the search process to find the global optimal solution, reduce the need for manual intervention, and improve the efficiency of model hyperparameter optimization.
[0071] In a possible implementation, when the anomaly recognition accuracy is less than the preset anomaly recognition accuracy, a Bayesian algorithm is introduced to perform hyperparameter optimization on the lightweight convolutional neural network model, specifically including:
[0072] S305A: Establish an optimization function with hyperparameters as optimization variables:
[0073]
[0074] Among them, F(m λ ,X) represents the optimization function, x i ,y i denote the i-th training data and the label corresponding to the i-th training data, respectively, X denotes the training data set, λ denotes the current hyperparameter, l(m λ (x i ),y i ) represents the predicted label m corresponding to the i-th training data under the current hyperparameter λ λ (x i ) and the true label y i The cross entropy loss function of
[0075] S305B: Calculate the mean and standard deviation of the optimization function, and construct a hyperparameter decision function based on the mean and standard deviation:
[0076] a EI (λ|μ,σ)=E[max(0,F(λ)-F(λ dec ))]
[0077] Among them, a EI () represents the hyperparameter decision function, μ, σ represent the mean and standard deviation respectively, F(λ), F(λ dec ) represent the current hyperparameter λ and the decision hyperparameter λ respectively. dec The optimization function value under, max() means taking the maximum value, and E() means gain calculation;
[0078] S305C: When the decision value of the hyperparameter decision function is greater than the preset decision value, the decision hyperparameter is used to replace the current hyperparameter, and the decision hyperparameter is substituted into the optimization function.
[0079] Among them, gain calculation is used to measure the effect or impact of a certain action or decision. It is an existing calculation method that can evaluate the success or benefits of a certain action or decision. The purpose of gain calculation is to help decision makers better understand the impact of their actions or decisions so as to make more informed choices.
[0080] It should be noted that those skilled in the art can set the size of the preset decision value according to actual needs, and the present invention is not limited here.
[0081] S305D: recalculating the optimization function value of the optimization function, and when the optimization function value is less than the historical optimal optimization function value, using the decision hyperparameter as the hyperparameter of the lightweight convolutional neural network model, wherein the historical optimal optimization function value is the minimum function value under all current hyperparameters;
[0082] S305E: Change the hyperparameter type and return to S305A.
[0083] It should be noted that S305A-S305E adopts the Bayesian optimization algorithm, by establishing an optimization function with the current hyperparameter as a variable, calculating the mean and standard deviation of the optimization function, and constructing a hyperparameter decision function based on these statistical information. When the decision value of the decision function is greater than the preset value, the hyperparameter is updated and the value of the optimization function is recalculated. This process makes full use of historical information, so that the hyperparameters adjusted each time are more targeted and directional, avoiding the instability and inefficiency problems that may be caused by random search. In addition, by dynamically adjusting the hyperparameter type, the Bayesian optimization algorithm can more flexibly adapt to different types of models and data sets, thereby further improving the effect of hyperparameter optimization and the performance of the training model. Using the Bayesian optimization algorithm to optimize the hyperparameters of the lightweight convolutional neural network model has many advantages. It can automatically adjust the parameters, efficiently search the hyperparameter space, and improve the generalization ability and performance of the model. It has strong adaptability, can cope with complex and diverse optimization problems, and can quickly find the global optimal solution. Compared with the traditional hyperparameter optimization method, the Bayesian optimization algorithm improves the performance of the model while reducing the need for manual intervention, making the tuning process more intelligent and efficient.
[0084] S306: Substitute the optimized hyperparameters into the lightweight convolutional neural network model and return to S303.
[0085] S307: Output the trained lightweight convolutional neural network model.
[0086] S4: Collect real-time network passive traffic.
[0087] In one possible implementation, network passive traffic includes packet data, packet metadata, and traffic statistics data, wherein the packet data includes a message header and a message payload, the packet metadata includes a source IP address, a destination IP address, a port number, and a packet size, and the traffic statistics data includes traffic volume, network rate, and network delay.
[0088] Among them, real-time network passive traffic refers to the information that needs to be analyzed and is obtained by monitoring the data flow in the network without actively sending requests to the network or intervening in network communications.
[0089] S5: Construct an outlier identification function that is independent of data volume based on the isolation forest model.
[0090] It should be noted that the isolation forest is an existing unsupervised anomaly detection algorithm that aims to effectively isolate normal samples from abnormal samples by building a tree structure. In this embodiment, the isolation forest model is used to identify outliers. This model can work independently of the amount of data, that is, regardless of the amount of input data, the method can effectively detect anomalies. By training the abnormal network passive traffic sample data multiple times, recording the number of iterations at the end of the training, and building an outlier recognition function based on these iterations, outliers can be accurately identified without relying on the amount of data.
[0091] In a possible implementation, S5 specifically includes:
[0092] S501: using the abnormal network passive traffic sample data to train the isolation forest model multiple times until all the abnormal data in the abnormal network passive traffic sample data are identified, and recording the number of iterations at the end of each training;
[0093] S502: averaging the number of iterations to obtain a mean value of the number of iterations;
[0094] S503: Establish an outlier identification function based on the mean of the number of iterations:
[0095]
[0096]
[0097] Among them, s(x,n) represents the outlier identification function, h(x) represents the number of iterations required to identify the abnormal data x, c(n) represents the mean number of iterations required to identify all the abnormal data n, ln() represents the logarithmic operation, and γ represents the harmonic parameter.
[0098] In a possible implementation manner, the harmonic parameter is specifically 0.578.
[0099] It should be noted that the Isolation Forest Model is indeed related to the data volume during training, because it needs to construct the tree structure by randomly subsampling the data and randomly dividing the feature space multiple times. Therefore, the time and computational cost of training the Isolation Forest Model will increase with the increase of data volume. However, the outlier recognition function based on this model makes the performance of outlier recognition accuracy independent of the data volume. Regardless of the number of samples, the same standard can be used to evaluate outliers, which means that regardless of the size of the input data, the outlier recognition effect should be consistent. This property makes outlier detection based on the Isolation Forest Model more advantageous in big data scenarios, because it can cope with the challenges of large-scale data while maintaining efficient performance.
[0100] S6: Use the outlier recognition function to perform an anomaly recognition on the real-time network passive traffic to obtain the anomaly data to be evaluated.
[0101] S7: Use the trained lightweight convolutional neural network model to perform secondary anomaly recognition on the abnormal data to be evaluated and output the type of abnormal data.
[0102] It should be noted that the outlier recognition function established in S5 is used to perform an anomaly recognition on the real-time network passive traffic. This means that the system will pass the real-time collected network data to the outlier recognition function for processing. The outlier recognition function will process and analyze the incoming data according to its internal algorithm and determine the possible abnormal data. The result of the recognition will be a set of abnormal data to be evaluated. These data are considered to be abnormal but require further verification. In S7, the trained lightweight convolutional neural network model is used to perform secondary anomaly recognition on the abnormal data to be evaluated. The neural network model will perform deep learning processing on these data, try to identify the patterns and features therein, and determine whether they belong to the known abnormal data type. If the model successfully identifies the abnormal data type, it will output the type information of the abnormal data. This process fully utilizes the advantages of the improved outlier recognition function and neural network model based on the isolation forest model. Through two anomaly recognitions, while ensuring the efficiency and real-time performance of abnormal data recognition, the accuracy and reliability of the system for abnormal data are improved.
[0103] S8: In case an abnormal data type is received, an alarm is issued.
[0104] It should be noted that after receiving abnormal data types, the system can issue alarms in a variety of ways, including displaying abnormal information on the graphical user interface, automatically sending emails or text messages to notify relevant personnel, and prompting abnormal conditions on physical devices through sounds or flashing lights. The information can also be recorded in the system log for subsequent analysis, or integrated into the monitoring system and displayed together with other monitoring indicators to ensure that abnormal situations are handled in a timely manner.
[0105] In a possible implementation, it further includes:
[0106] S9: Count the abnormal data missed detection rate of real-time network passive traffic. When the abnormal data missed detection rate is greater than the preset missed detection rate, return to S3 and re-train the lightweight convolutional neural network model.
[0107] It should be noted that those skilled in the art can set the preset missed detection rate according to actual needs, and the present invention is not limited thereto.
[0108] It is understandable that S9 describes an important feedback mechanism, which is to count the missed detection rate of abnormal data during the operation of the system. The missed detection rate of abnormal data refers to the proportion of abnormal data that the system fails to correctly identify. If the missed detection rate of abnormal data exceeds the preset threshold, that is, the system misses too many abnormal situations, then the lightweight convolutional neural network model needs to be retrained to improve its ability to identify abnormal situations. This process is continuous. By constantly monitoring the missed detection rate and conducting feedback training, the system can gradually improve the accuracy of abnormal data detection, thereby improving the reliability and stability of the entire system.
[0109] In a possible implementation, it further includes:
[0110] S10: Preset an update cycle and retrain the lightweight convolutional neural network model.
[0111] It should be noted that those skilled in the art can set the size of the preset update period according to actual needs, and the present invention is not limited here.
[0112] It can be understood that by setting a preset update cycle, the lightweight convolutional neural network model will be updated regularly to ensure that it remains efficient and accurate when processing real-time network passive traffic. The size of the update cycle is determined according to actual needs and there is no fixed limit. This update mechanism can be flexibly adjusted according to changes in network traffic data and the needs of model performance, so that it can identify the latest abnormal data to maintain the stability and accuracy of the system.
[0113] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0114] In the present invention, convolutional layer compression technology is introduced to compress convolution kernels that consume huge computing resources, remove unnecessary convolution kernels, optimize the computing power of the convolution layer, reduce the computing resource consumption of the monitoring process, and reduce convolution operations. At the same time, the computing efficiency is improved, and the obtained lightweight convolutional neural network is used to perform abnormal analysis of network passive traffic to improve the real-time performance of data analysis. In addition, an outlier recognition function based on the isolation forest model and independent of the data volume is set before the convolution layer in the lightweight convolutional neural network model to perform anomaly recognition on the real-time network passive traffic. The data can be pre-processed for initial abnormal data recognition, so that the accuracy of outlier screening will not change with the change of data volume, thereby improving the robustness and accuracy of outlier screening. After that, a high-precision lightweight convolutional neural network model is used to perform secondary anomaly recognition on the preliminary screening results, i.e., the abnormal data to be evaluated, to confirm the type of abnormal data. Only when the screened abnormal data to be evaluated is received will fine-grained secondary anomaly recognition be performed, thereby reducing the data analysis burden of the lightweight convolutional neural network model, further improving the real-time performance of data analysis, and placing more computing resources of the lightweight convolutional neural network model on the abnormal data recognition task. This multi-level abnormal data recognition scheme increases the abnormal data recognition capability, reduces the probability of misidentification, and improves the accuracy of abnormal recognition.
[0115] refer to Figure 3 , showing a structural schematic diagram of a network passive traffic analysis system based on a convolutional neural network provided in an embodiment of the present invention.
[0116] An embodiment of the present invention provides a network passive traffic analysis system 20 based on a convolutional neural network, comprising a first processor 2001 and a memory 2002; the memory 2002 stores computer-readable instructions, and when the computer-readable instructions are executed by the first processor, the network passive traffic analysis method based on a convolutional neural network described in the above method embodiment is implemented.
[0117] Optionally, the network passive traffic analysis system 20 based on convolutional neural network may also include a transceiver 2003.
[0118] The first processor 2001, the memory 2002 and the transceiver 2003 may be connected via a communication bus.
[0119] Combine the following Figure 3 The various components of the network passive traffic analysis system 20 based on convolutional neural network are introduced in detail:
[0120] The first processor 2001 is the control center of the network passive traffic analysis system 20 based on the convolutional neural network, which can be a processor or a general term for multiple processing elements. For example, the first processor 2001 is one or more central processing units (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention, such as one or more microprocessors (digital signal processor, DSP), or one or more field programmable gate arrays (field programmable gate array, FPGA).
[0121] Optionally, the first processor 2001 can perform various functions of the network passive traffic analysis system 20 based on convolutional neural network by running or executing a software program stored in the memory 2002 and calling data stored in the memory 2002.
[0122] In a specific implementation, as an embodiment, the first processor 2001 may include one or more CPUs, such as Figure 3 CPU0 and CPU1 are shown in FIG.
[0123] In a specific implementation, as an embodiment, the network passive traffic analysis system 20 based on convolutional neural network may also include multiple processors, such as Figure 3 The first processor 2001 and the second processor 2004 are shown in FIG. Each of these processors can be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). The processor here can refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0124] The memory 2002 is used to store the software program for executing the solution of the present invention, and is controlled to be executed by the first processor 2001. The specific implementation method can refer to the above method embodiment, which will not be repeated here.
[0125] Optionally, the memory 2002 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 2002 may be integrated with the first processor 2001, or may exist independently, and may be connected to the first processor 2001 through the interface circuit ( Figure 3 (not shown) is coupled to the first processor 2001, which is not specifically limited in this embodiment of the present invention.
[0126] The transceiver 2003 is used to communicate with a network device or a terminal device.
[0127] Optionally, the transceiver 2003 may include a receiver and a transmitter ( Figure 3 The receiver is used to implement a receiving function, and the transmitter is used to implement a sending function.
[0128] Optionally, the transceiver 2003 can be integrated with the first processor 2001, or can exist independently, and can be connected to the first processor 2001 through the interface circuit ( Figure 3 (not shown) is coupled to the first processor 2001, which is not specifically limited in this embodiment of the present invention.
[0129] It should be noted that Figure 3 The structure of the network passive traffic analysis system 20 based on convolutional neural network shown in the figure does not constitute a limitation on the router. The actual knowledge structure identification device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0130] In addition, the technical effects of the network passive traffic analysis system 20 based on convolutional neural network can refer to the technical effects of the network passive traffic analysis method based on convolutional neural network described in the above method embodiment, and will not be repeated here.
[0131] It should be understood that the first processor 2001 in the embodiment of the present invention may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0132] It should also be understood that the memory in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0133] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0134] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.
[0135] In the present invention, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0136] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0137] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0138] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described equipment, devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0139] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0140] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0141] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0142] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0143] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A network passive traffic analysis method based on convolutional neural network, characterized in that: include: S1: Obtain abnormal network passive traffic sample data; S2: compress the convolutional layer of the preset convolutional neural network model to build a lightweight convolutional neural network model; S3: inputting the abnormal network passive traffic sample data as input data into the lightweight convolutional neural network model, and training the lightweight convolutional neural network model until the abnormal recognition accuracy of the abnormal network passive traffic sample data by the lightweight convolutional neural network model is greater than a preset abnormal recognition accuracy; S4: collect real-time network passive traffic; S5: Construct an outlier identification function that is independent of data volume based on the isolation forest model; S6: using the outlier recognition function to perform an anomaly recognition on the real-time network passive traffic to obtain anomaly data to be evaluated; S7: using the trained lightweight convolutional neural network model to perform secondary anomaly recognition on the abnormal data to be evaluated, and outputting the type of abnormal data; S8: issuing an alarm when receiving the abnormal data type; The lightweight convolutional neural network model includes an input layer, a convolution layer, a pooling layer, a fully connected layer and an output layer connected in sequence, wherein the convolution layer includes multiple convolution kernels, and S2 specifically includes: S201: Setting an adjustable factor for each convolution kernel in each convolution layer in the preset convolutional neural network model; S202: Convert the adjustable factor into a forward propagation contribution ratio: Among them, p ij represents the adjustable factor of the jth convolution kernel of the i-th convolution layer, b represents the limit parameter, and m ij represents the forward propagation contribution ratio; S203: Convert the corresponding convolution kernel output using the forward propagation contribution ratio: O i ′ j =m ij ×O ij Among them, O ij represents the convolution kernel output, O i ' j Represents the converted convolution kernel output; S204: Adding an L1 constraint condition to the adjustable factor in combination with the limit parameter, and using the L1 constraint condition to add a penalty value to the loss function of the preset convolutional neural network model, so that the forward propagation contribution ratio tends to zero, and the adjustable factor approaches the limit parameter, wherein the loss function is a cross entropy loss function: g=∑ i,j p ij +b Wherein, g represents the penalty value, i and j represent the convolution layer index and the convolution kernel index respectively, l() represents the loss function of the preset convolutional neural network model, L represents the loss function of the lightweight convolutional neural network model after adding the penalty term, f(x, W), y represent the model input data and output data respectively, and W represents the trainable weight coefficient; S205: Iteratively shrink the limit parameter with zero as the shrinkage end point, and set the forward propagation contribution ratio to a step function of zero or one: Among them, t represents the current number of iterations, and T represents the maximum number of iterations; S206: Remove the convolution kernel corresponding to the forward propagation contribution ratio with a value of zero, retain the convolution kernel corresponding to the forward propagation contribution ratio with a value of one, complete the convolution layer compression of the preset convolutional neural network model, and obtain the lightweight convolutional neural network model.
2. According to claim 1, the network passive traffic analysis method based on convolutional neural network is characterized in that: The S3 specifically includes: S301: Receive the abnormal network passive traffic sample data, wherein the abnormal network passive traffic sample data includes abnormal data and abnormal data type labels; S302: extracting features of the abnormal network passive traffic sample using the convolution layer and the pooling layer of the lightweight convolutional neural network model; S303: In combination with the abnormal data type label, the extracted features are identified as abnormal through the fully connected layer of the lightweight convolutional neural network model; S304: Counting the abnormality recognition accuracy of the lightweight convolutional neural network model; S305: When the anomaly recognition accuracy is less than the preset anomaly recognition accuracy, a Bayesian algorithm is introduced to perform hyperparameter optimization on the lightweight convolutional neural network model; otherwise, the process proceeds to S307, wherein the hyperparameters include a learning rate, a number of training iterations, a batch size, and a convolution kernel size; S306: Substitute the optimized hyperparameters into the lightweight convolutional neural network model, and return to S303; S307: Output the trained lightweight convolutional neural network model.
3. The network passive traffic analysis method based on convolutional neural network according to claim 2 is characterized in that: When the abnormality recognition accuracy is less than the preset abnormality recognition accuracy, the Bayesian algorithm is introduced to perform hyperparameter optimization on the lightweight convolutional neural network model, specifically including: S305A: Establish an optimization function with the hyperparameter as the optimization variable: Among them, F(m λ ,X) represents the optimization function, x i ,y i denote the i-th training data and the label corresponding to the i-th training data, respectively, X denotes the training data set, λ denotes the current hyperparameter, l(m λ (x i ),y i ) represents the predicted label m corresponding to the i-th training data under the current hyperparameter λ λ (x i ) and the true label y i The cross entropy loss function of S305B: Calculate the mean and standard deviation of the optimization function, and construct a hyperparameter decision function based on the mean and standard deviation: a EI (λμ,σ)=E[max(0,F(λ)-F(λ dec ))] Among them, a EI () represents the hyperparameter decision function, μ, σ represent the mean and the standard deviation respectively, F(λ), F(λ dec ) represent the current hyperparameter λ and the decision hyperparameter λ respectively. dec The optimization function value under, max() means taking the maximum value, and E() means gain calculation; S305C: When the decision value of the hyperparameter decision function is greater than a preset decision value, the current hyperparameter is replaced by the decision hyperparameter, and the decision hyperparameter is substituted into the optimization function; S305D: recalculating the optimization function value of the optimization function, and when the optimization function value is less than the historical optimal optimization function value, using the decision hyperparameter as the hyperparameter of the lightweight convolutional neural network model, wherein the historical optimal optimization function value is the minimum function value under all current hyperparameters; S305E: Change the hyperparameter type and return to S305A.
4. The network passive traffic analysis method based on convolutional neural network according to claim 1 is characterized in that: The network passive traffic includes data packet data, data packet metadata and traffic statistics data, wherein the data packet data includes a message header and a message payload, the data packet metadata includes a source IP address, a destination IP address, a port number and a packet size, and the traffic statistics data includes traffic, network rate and network delay.
5. The network passive traffic analysis method based on convolutional neural network according to claim 1 or 3, characterized in that: The S5 specifically includes: S501: training the isolation forest model multiple times using the abnormal network passive traffic sample data until all abnormal data in the abnormal network passive traffic sample data are identified, and recording the number of iterations at the end of each training; S502: taking an average of the number of iterations to obtain an average number of iterations; S503: Establishing an outlier identification function based on the mean of the number of iterations: Wherein, s(x,n) represents the outlier identification function, h(x) represents the number of iterations required to identify the abnormal data x, c(n) represents the mean number of iterations required to identify all the abnormal data n, ln() represents the logarithmic operation, and γ represents the harmonic parameter.
6. The network passive traffic analysis method based on convolutional neural network according to claim 5 is characterized in that: The harmonic parameter is specifically 0.
578.
7. The network passive traffic analysis method based on convolutional neural network according to claim 1 is characterized in that: Also includes: S9: Counting the abnormal data missed detection rate of the real-time network passive traffic, and when the abnormal data missed detection rate is greater than the preset missed detection rate, returning to S3 and retraining the lightweight convolutional neural network model.
8. The network passive traffic analysis method based on convolutional neural network according to claim 1 is characterized in that: Also includes: S10: Preset an update cycle and retrain the lightweight convolutional neural network model.
9. A network passive traffic analysis system based on convolutional neural network, comprising: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 8 is implemented.
