Multi-modal anomaly detection method and system for big data network traffic
By adopting multi-modal anomaly detection methods in big data network traffic and combining machine learning and deep learning models, the accuracy and efficiency problems of network traffic detection in the existing technology are solved, and efficient abnormal behavior identification in complex environments is achieved. and real-time detection.
Patent Information
- Application Number
- CN202410695649.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-09-10
AI Technical Summary
Existing network traffic anomaly detection methods are difficult to obtain accurate detection results in massive data, especially because there is a competitive relationship between detection time and accuracy, and are difficult to apply to spatial networks, resulting in low detection efficiency and accuracy.
The multi-modal anomaly detection method of big data network traffic is used to obtain intranet traffic data for flow analysis, extract deep packet inspection features, and use machine learning and deep learning models for abnormal behavior detection and feature fusion, combined with Boosting and random forests. and Bagging's integrated learning algorithm to perform multiple detections to improve accuracy.
It achieves efficient and accurate identification of abnormal behaviors in small sample sizes and complex and changing network environments, improves detection accuracy, and continuously iterates through offline training and model updates, making it suitable for real-time online detection of massive network traffic.
Smart Images

Figure CN118626982A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network security technology, and in particular to a multimodal anomaly detection method and system for big data network traffic. Background Art
[0002] In the era of mobile big data, with the development of artificial intelligence and mobile communication technology, 5G networks have promoted the emergence of new mobile applications, such as live video, short video, VR and AR. New technologies have improved service quality and user experience, which makes users more dependent on mobile networks; on the other hand, it also makes smart mobile devices and systems more vulnerable to attacks by attackers. By attacking mobile devices, attackers can gain illegal access to user information and computing resources. Therefore, the quality management of mobile networks and the protection of user information have become an important issue. The main method for detecting malicious network attacks is to identify suspicious behaviors based on network traffic. At present, there are two main types of research on malicious attack analysis of network traffic.
[0003] The first is a signature-based method that obtains information from network traffic to discover the signature of malicious attacks; the second is an anomaly-based method, which is a technology that performs anomaly detection by analyzing the behavioral patterns of network traffic logs; however, both detection methods require the analysis of massive amounts of network traffic data. That is, since each smart mobile device generates network traffic data in real time, this results in a large amount of network traffic data being generated on the backbone network of the Internet Service Provider (ISP). Massive amounts of network traffic data pose a huge challenge to ISPs in identifying malicious attacks or malicious applications in the network.
[0004] In these two detection methods, first, there is a competitive relationship between detection time and detection accuracy. In order to complete the detection quickly, the number of features and the complexity of the algorithm are limited; in order to improve the accuracy, it is necessary to extract deep statistical information about the network traffic (e.g., flow duration, number of requests, request frequency, etc.), but this inevitably increases the completion time. Second, network traffic is complex and difficult to track. The network traffic data generated by all applications / websites are mixed together, and the network traffic sequences are randomly transmitted alternately, which makes it difficult to match the application / website with its network traffic. Therefore, it is difficult to comprehensively measure the traffic of an application / website. In addition, network traffic anomaly detection is an inherently unbalanced classification problem. In order to verify the effectiveness of the detection algorithm, there must be a certain number of labeled abnormal traffic samples to cover different types of intrusions and attacks. However, labeled abnormal traffic samples are rare, and they only account for a small proportion of the entire data set, especially in the massive network traffic data from ISPs. Therefore, it is difficult to verify the accuracy of the algorithm in the detection method, and it is difficult to obtain an algorithm model with high detection accuracy, resulting in the detection results obtained using the algorithm model being inaccurate. In addition, using these two detection methods, it is difficult for the future space Internet to perform network detection. The space transmission distance is long, and it is affected by the speed of light delay effect and frame and packet loss. The computing and storage capabilities are limited, which means that the existing ground network anomaly detection methods are not fully applicable to space network anomaly detection, which in turn makes it difficult to conduct network defense.
[0005] Therefore, the existing detection methods are mainly difficult to obtain accurate anomaly detection algorithms based on a small number of abnormal samples, resulting in low accuracy of anomaly detection results for massive network traffic. In order to improve detection accuracy, it is necessary to obtain deep statistical information of a large amount of network traffic, resulting in low detection efficiency. Summary of the invention
[0006] In order to overcome the above-mentioned deficiencies of the prior art, the present invention proposes a multimodal anomaly detection method for big data network traffic, comprising:
[0007] Acquire traffic data generated in the intranet, and perform flow analysis on the traffic data to obtain deep packet inspection features of the traffic data;
[0008] Performing abnormal behavior detection on the traffic data based on the deep packet inspection feature through a machine learning model to obtain multiple suspected abnormal behavior traffic in the traffic data;
[0009] Each of the suspected abnormal behavior traffic is input into the deep learning model, the multimodal features of each of the suspected abnormal behavior traffic are extracted and feature fusion is performed to obtain a characterization vector of each of the suspected abnormal behavior traffic; detection and classification are performed based on the characterization vector of each of the suspected abnormal behavior traffic to obtain an abnormal behavior classification result of each of the suspected abnormal behavior traffic.
[0010] Optionally, performing flow analysis on the traffic data to obtain deep packet detection features of the traffic data includes:
[0011] The traffic data is encapsulated into multiple batches of traffic data according to multiple time periods through the spark platform, and features are extracted for each batch of traffic data to obtain deep packet detection features for each batch of traffic data.
[0012] Optionally, the deep packet inspection features of the traffic data include URL and traffic behavior features of the traffic data.
[0013] Optionally, obtaining the traffic data generated in the intranet includes:
[0014] Kafka is used to collect the traffic data generated in the intranet, and the traffic data is written into the specified queue of Kafka and transmitted to the spark platform.
[0015] Optionally, after performing abnormal behavior detection on the traffic data based on the deep packet inspection feature by using a machine learning model to obtain a plurality of suspected abnormal behavior traffic in the traffic data, the method further includes:
[0016] Verifying and marking the plurality of suspected abnormal behavior traffic flows, and using the verification and marking results as a standard set to perform offline training on the machine learning model to obtain a new machine learning model;
[0017] If the preset update time corresponding to the machine learning model is reached, the new machine learning model is used to update the machine learning model currently saved in the big data platform.
[0018] Optionally, after performing detection and classification based on the characterization vector of each of the suspected abnormal behavior traffic and obtaining the abnormal behavior classification result of each of the suspected abnormal behavior traffic, the method further includes:
[0019] Verifying and annotating the abnormal behavior classification results of each of the suspected abnormal behavior traffic flows, and using the verification and annotation results as a standard set to perform offline training on the deep learning model to obtain a new deep learning model;
[0020] If the preset update time corresponding to the deep learning model is reached, the new deep learning model is used to update the deep learning model currently saved in the big data platform.
[0021] Optionally, the machine learning model adopts an integrated learning algorithm of Boosting, random forest and Bagging.
[0022] Optionally, inputting each of the abnormal behavior traffic into a deep learning model, extracting multimodal features of each of the suspected abnormal behavior traffic and performing feature fusion to obtain a representation vector of each of the suspected abnormal behavior traffic, includes:
[0023] For each suspected abnormal behavior traffic:
[0024] Inputting the suspected abnormal behavior traffic into a deep learning model, and using an encoder of the deep learning model to respectively extract multimodal features of the suspected abnormal behavior traffic, wherein the multimodal features include statistical features and byte features;
[0025] Position encoding is performed on the statistical features and byte features of the suspected abnormal behavior traffic to obtain the encoded statistical feature vector and byte feature vector;
[0026] Inputting the encoded statistical feature vector and byte feature vector into the cross-modal encoder of the deep learning model for feature fusion, and respectively obtaining the statistical features and byte features after the suspected abnormal behavior traffic is enhanced;
[0027] The enhanced statistical features and the byte features are input into a self-attention-based transformer sequence model to obtain final feature representations of the statistical features and the byte features respectively; the representation vector of the suspected abnormal behavior traffic is obtained by splicing the final feature representations of the statistical features and the byte features.
[0028] Based on the same inventive concept, the present invention proposes a multi-modal anomaly detection system for big data network traffic, comprising:
[0029] A data processing module, used to obtain the flow data generated by the intranet, and perform flow analysis on the flow data to obtain deep packet detection features of the flow data;
[0030] An abnormal behavior detection module, used to perform abnormal behavior detection on the traffic data based on the deep packet detection feature through a machine learning model to obtain multiple suspected abnormal behavior traffic in the traffic data;
[0031] The abnormal behavior classification module is used to input each of the suspected abnormal behavior traffic into the deep learning model, extract the multimodal features of each of the suspected abnormal behavior traffic and perform feature fusion to obtain the characterization vector of each of the suspected abnormal behavior traffic; perform detection and classification based on the characterization vector of each of the suspected abnormal behavior traffic to obtain the abnormal behavior classification result of each of the suspected abnormal behavior traffic.
[0032] Optionally, the data processing module includes:
[0033] The data encapsulation submodule is used to encapsulate the traffic data into multiple batches of traffic data according to multiple time periods through the spark platform;
[0034] The feature extraction sub-model is used to extract features from each batch of traffic data to obtain deep packet detection features of each batch of traffic data.
[0035] Optionally, in the feature extraction sub-model, the deep packet detection features of the traffic data include URL and traffic behavior features of the traffic data.
[0036] Optionally, the data processing module further includes:
[0037] The data acquisition module is used to use Kafka to collect the traffic data generated in the intranet, and write the traffic data into the specified queue of Kafka and transmit it to the Spark platform.
[0038] Optionally, the anomaly detection system further includes: a machine learning model offline training module, configured to perform abnormal behavior detection on the traffic data based on the deep packet inspection feature through the machine learning model, and after obtaining a plurality of suspected abnormal behavior traffic in the traffic data:
[0039] Verifying and marking the plurality of suspected abnormal behavior traffic flows, and using the verification and marking results as a standard set to perform offline training on the machine learning model to obtain a new machine learning model;
[0040] If the preset update time corresponding to the machine learning model is reached, the new machine learning model is used to update the machine learning model currently saved in the big data platform.
[0041] Optionally, the anomaly detection system further includes: a deep learning model offline training module, which is used to perform detection and classification based on the characterization vector of each of the suspected abnormal behavior traffic, and after obtaining the abnormal behavior classification result of each of the suspected abnormal behavior traffic:
[0042] Verifying and annotating the abnormal behavior classification results of each of the suspected abnormal behavior traffic flows, and using the verification and annotation results as a standard set to perform offline training on the deep learning model to obtain a new deep learning model;
[0043] If the preset update time corresponding to the deep learning model is reached, the new deep learning model is used to update the deep learning model currently saved in the big data platform.
[0044] Optionally, the machine learning model adopts an integrated learning algorithm of Boosting, random forest and Bagging.
[0045] Optionally, the abnormal behavior classification module includes:
[0046] A feature extraction submodule is used for: for each of the suspected abnormal behavior traffic: inputting the suspected abnormal behavior traffic into a deep learning model, and using an encoder of the deep learning model to extract multimodal features of the suspected abnormal behavior traffic, wherein the multimodal features include statistical features and byte features;
[0047] A position encoding submodule, used for performing position encoding on the statistical features and byte features of the suspected abnormal behavior traffic to obtain the encoded statistical feature vector and byte feature vector;
[0048] A feature fusion submodule, used for inputting the encoded statistical feature vector and byte feature vector into the cross-modal encoder of the deep learning model for feature fusion, so as to obtain the statistical features and byte features after the suspected abnormal behavior traffic is enhanced;
[0049] A representation vector determination submodule is used to input the enhanced statistical features and the byte features into a self-attention-based transformer sequence model to obtain the final feature representations of the statistical features and the byte features respectively; and to obtain the representation vector of the suspected abnormal behavior traffic by splicing the final feature representations of the statistical features and the byte features.
[0050] Compared with the closest prior art, the present invention has the following beneficial effects:
[0051] The present invention provides a multimodal anomaly detection method and system for big data network traffic, comprising: obtaining traffic data generated by an intranet, and performing flow analysis on the traffic data to obtain deep packet detection features of the traffic data; performing abnormal behavior detection on the traffic data based on the deep packet detection features through a machine learning model to obtain multiple suspected abnormal behavior traffic in the traffic data; inputting each of the suspected abnormal behavior traffic into a deep learning model, extracting the multimodal features of each of the suspected abnormal behavior traffic and performing feature fusion to obtain a characterization vector of each of the suspected abnormal behavior traffic; performing detection and classification based on the characterization vector of each of the suspected abnormal behavior traffic to obtain an abnormal behavior classification result of each of the suspected abnormal behavior traffic; after the present invention uses a machine learning model to perform a detection once, in order to further improve the detection accuracy, the deep learning model is used to perform a secondary detection on the suspected abnormal behavior traffic obtained by the first detection based on the multimodal features, so that the abnormal behavior traffic in the network traffic can be more accurately identified; and in this solution, the multimodal features are used to perform anomaly detection, which increases the feature quantity compared with the traditional detection algorithm, does not need to obtain a large number of abnormal samples, is suitable for small sample sizes and complex changes in real networks, that is, can meet the abnormal behavior detection of massive network traffic with a small sample size.
[0052] In the present invention, anomaly detection is performed through an offline trained machine learning model (and deep learning model), and the detection results obtained by anomaly detection and verification annotation are used to train the machine learning model (and deep learning model) again, forming a cycle, and continuously iterating and updating the machine learning model (and deep learning model), so that the detection accuracy of the model is gradually improved, and the detection results can be made more accurate.
[0053] The present invention uses Kafka to collect and process network traffic. Kafka can process a large amount of high-speed traffic data with low processing delay and server failure performance, ensuring efficient storage and secure transmission of traffic data, and can be applied to the future space Internet; and uses the Spark platform to encapsulate network traffic into multiple batches of small batches of data, and extracts statistical features of the traffic data. The statistical features of the network traffic are input into a machine learning model in batches to detect abnormal behavior. Batch detection realizes real-time online detection of network traffic and realizes online real-time processing of massive traffic data. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 A schematic diagram of a multi-modal anomaly detection method for big data network traffic provided by the present invention Figure 1 ;
[0055] Figure 2 A schematic diagram of a multi-modal anomaly detection method for big data network traffic provided by the present invention Figure 2 ;
[0056] Figure 3 A schematic diagram of the cross-modal feature fusion process provided by the present invention;
[0057] Figure 4 A schematic diagram of the structure of a multi-modal anomaly detection system for big data network traffic provided by the present invention;
[0058] Figure 5 The present invention provides a schematic structural diagram of an electronic device. DETAILED DESCRIPTION
[0059] The specific implementation modes of the present invention are further described in detail below with reference to the accompanying drawings.
[0060] In order to cope with the new challenges brought by future networks, this application proposes a multi-modal anomaly detection method and system for big data network traffic, which provides the collection, processing, analysis and update functions of massive data traffic to cope with massive data traffic. In particular, by analyzing the specific characteristics of abnormal traffic data from traffic and user behavior, first use an integrated machine learning method to detect on a big data framework deployed on a server cluster, and then dig out different pattern characteristics of abnormal behavior traffic and use deep learning algorithms for classification.
[0061] The detection method and system proposed in this application are designed for the small sample size and complex changes in the current real network. Deep Packet Inspection (DPI) data is considered by ISPs (Internet Service Providers) to be the most effective data for traffic classification, traffic control and anomaly detection. The human-in-the-loop anomaly detection architecture proposed in this article uses DPI data as training data and application scenarios. Due to the large amount of DPI data, the detection system is divided into two stages: offline and online. The machine learning model and the deep learning model are trained offline, and then the model is deployed in a distributed online streaming system for online detection (the distributed online streaming system includes a kafka cluster (distributed stream processing cluster) to collect intranet traffic and transmit it to the spark platform (distributed stream analysis platform). After the spark platform extracts features of the data traffic in batches, it loads two algorithm models, and uses the two algorithm models to successively detect the data traffic in batches). In addition, the detection architecture expands the anomaly detection algorithm into a "human-in-the-loop" system (i.e., by setting the model that has completed offline training on the big data platform, and then using the results obtained from model detection and manual annotation to train the model again, and then updating the model on the big data platform at a set time to form a loop), which is used to iteratively improve the accuracy of the algorithm through continuous manual verification results.
[0062] Example 1
[0063] The present invention provides a multimodal anomaly detection method for big data network traffic. Through a streaming network abnormal behavior detection framework, it can process a large amount of network traffic data in real time, efficiently and quickly detect abnormal behaviors in the network and classify them. This detection structure is designed for the sample size and complex changes in real networks, and mainly consists of two stages. In the first stage, deep packet inspection data (DPI) is used as training data and application scenarios, and the URL (Uniform Resource Locator) features in the DPI data are used as the initial judgment criteria to screen out abnormal traffic in massive traffic data. Then, a deep learning model trained offline is used to perform multi-classification tasks on abnormal traffic, such as Figure 1 As shown, this method is implemented by the following steps:
[0064] S1. Obtaining traffic data generated in the intranet, and performing flow analysis on the traffic data to obtain deep packet inspection features of the traffic data;
[0065] S2. Perform abnormal behavior detection on the traffic data based on the deep packet inspection feature through a machine learning model to obtain multiple suspected abnormal behavior traffic in the traffic data;
[0066] S3. Input each of the suspected abnormal behavior traffic into the deep learning model, extract the multimodal features of each of the suspected abnormal behavior traffic and perform feature fusion to obtain the characterization vector of each of the suspected abnormal behavior traffic; perform detection and classification based on the characterization vector of each of the suspected abnormal behavior traffic to obtain the abnormal behavior classification result of each of the suspected abnormal behavior traffic.
[0067] Combination Figure 2 The following is a detailed description of this plan:
[0068] In step S1, Kafka is used to collect and pre-process the traffic data generated by the intranet.
[0069] Specifically, Figure 2 As shown, when a user device (computer, server, workstation, etc.) is connected to a local area network through a router to conduct network activities, a large amount of intranet network traffic data will be generated. The traffic collector is used to obtain the uplink and downlink data packets of mobile users, capture HTTP (Hypertext Transfer Protocol) data packets, and combine the data packets into traffic, that is, the network traffic includes multiple data packets generated by the uplink and downlink of the user device. Among them, the data packets are combined into traffic based on the IP source address, IP destination address, source port number, destination port number and transport protocol data packets.
[0070] Kafka is used to collect traffic data generated in the intranet, that is, the Kafka cluster is used to obtain the intranet traffic data collected by the traffic collector. The Kafka cluster serves as a data processing center and receives intranet traffic data from multiple links in multiple provinces and cities. Kafka provides a message queue that allows producers to send messages to a specific topic partition order, and consumers view messages in order. In this solution, the Kafka cluster handles a large amount of high-speed traffic data with low processing latency and server failure performance, ensuring efficient storage and secure transmission of data.
[0071] Write the network traffic received by the Kafka cluster to the specified queue and send it to the Spark platform for stream processing and stream analysis. Specifically, it is sent to Spark Streaming, which is a major Spark streaming library that uses fast scheduling to perform stream data analysis. Spark streaming receives network traffic data as a message consumer.
[0072] The traffic data is encapsulated into batch network traffic of multiple time periods through Spark streaming in the spark platform (the multiple time periods can be specified by the user), that is, the traffic data is encapsulated into multiple batches of traffic data according to multiple time periods, and feature extraction is performed on each batch of traffic data in each time period to obtain statistical features of each batch of traffic data. Network flow analysis is performed on small batches of traffic to obtain deep packet inspection features (statistical features) in time and space of the network flow.
[0073] Since the collected data traffic is mixed and disordered, in order to meet the real-time requirements, this solution follows the following principles in the selection of deep packet inspection features:
[0074] ①Fully reflect user behavior;
[0075] ②Statistics can be calculated on individual traffic records without having to remember related links.
[0076] Based on the above principles, two types of statistical features are selected: URL features and traffic behavior features. URL features are the most important features in network traffic data. URLs are composed of various types of characters, which contain fixed structural patterns and keywords, and usually reflect the nature and type of accessible resources on remote servers. URLs are filtered out by black and white lists loaded by Spark streaming into HDFS (distributed file system), and semantic and statistical features such as URL character length, domain character length, whether it contains IP addresses, and whether it is a top-level domain are mainly extracted in order to discover the structural model of normal URLs. Traffic behavior features are rich information about networks, applications, and users extracted by TMA devices from mobile network data traffic, including user ID, current time, location, number of upstream and downstream bytes, device type, protocol type, etc.
[0077] In step S2, abnormal behavior detection is performed on the traffic data based on the deep packet detection features through a machine learning model to obtain multiple suspected abnormal behavior traffic in the traffic data.
[0078] Specifically, since the machine learning model detects high-speed and massive big data network traffic, a single machine learning algorithm may not be able to fully utilize the data information, so the machine learning model adopts an integrated learning algorithm composed of multiple classifiers. The integrated learning algorithm can better mine the features and patterns in the traffic and improve the detection efficiency of suspicious behavior through the collaborative work of multiple classifiers. Since the detection is performed on a big data platform based on Spark and Kafka, the integrated learning algorithm selects Boosting algorithm, random forest and Bagging algorithm. These algorithms can divide each iterative process into independent calculation steps, realize algorithm parallelization, and can be deployed in parallel in the Spark mllib library. The integrated algorithm fuses the prediction results of a single algorithm through a voting mechanism to improve the detection capability of the model.
[0079] In the real-time detection stage, the statistical features of each batch of network traffic are used as the input of the machine learning model to detect abnormal behavior, and multiple abnormal behavior traffic is obtained. The abnormal behavior traffic initially detected in the machine learning model is recorded as suspected abnormal behavior traffic. The machine learning model here is a machine learning model trained in the offline stage. The trained machine learning model is deployed in the big data platform of the server cluster to perform real-time anomaly detection on massive network traffic.
[0080] In the offline training stage, it includes: before using the statistical features of each batch of network traffic as the input of the machine learning model for abnormal behavior detection, pre-training the machine learning model offline;
[0081] And for each time, after performing abnormal behavior detection on the traffic data based on the deep packet inspection features through the machine learning model and obtaining multiple suspected abnormal behavior traffic in the traffic data, it also includes verifying and marking the multiple suspected abnormal behavior traffic (which can be sent to manual verification);
[0082] Using the verification and annotation results as a standard set to perform offline training on the machine learning model again to obtain a new machine learning model;
[0083] If the preset update time corresponding to the machine learning model is reached, the new machine learning model is used to update the machine learning model currently saved in the big data platform, that is, the updated machine learning model is saved to HDFS for Spark Streaming to load.
[0084] After using the machine learning algorithm to preliminarily determine whether there is abnormal behavior traffic in the network traffic, the deep learning model is then used to perform specific detection and classification of the detected suspected abnormal behavior traffic.
[0085] In step S3, S31, each of the suspected abnormal behavior traffic is input into the deep learning model, the multimodal features of each of the suspected abnormal behavior traffic are extracted, and feature fusion is performed to obtain a representation vector of each of the suspected abnormal behavior traffic.
[0086] For each suspected abnormal behavior traffic:
[0087] S311. Input the suspected abnormal behavior traffic into a deep learning model, and use the encoder of the deep learning model to extract multimodal features of each piece of the suspected abnormal behavior traffic, where the multimodal features include statistical features and byte features.
[0088] Specifically, in the detection phase using the deep learning model, the suspected abnormal behavior traffic detected by the machine learning integrated algorithm in Spark is used as the input of this phase, and the suspected abnormal behavior traffic is specifically multi-classified. In the feature selection of this phase, in addition to the statistical features added above, the byte features of the suspected abnormal behavior traffic are also added. In the original traffic data, the data packets are arranged in order in hexadecimal bytes. The byte features of the traffic provide very detailed traffic information, and the changes between bytes can more accurately detect abnormal behavior. Features can be extracted directly from the bytes of the original traffic, and the traffic bytes are presented in the form of image pixels to construct traffic map data. The traffic map is a representation form based on the original traffic hexadecimal message, and the feature extraction of abnormal behavior traffic can be realized by representation learning in the field of computer vision.
[0089] Encoder 1D_CNN and encoder CNN are used to extract features from the statistical sequence and byte grayscale image (traffic map) of each suspected abnormal behavior traffic, respectively, to obtain multimodal features, that is, feature vectors X1 and X2 in different forms, where X1 represents statistical features and X2 represents byte features.
[0090] S312: Positionally encode the statistical features and byte features of the suspected abnormal behavior traffic to obtain encoded statistical feature vectors and byte feature vectors.
[0091] Perform position encoding on the feature vectors of each suspected abnormal behavior flow in different forms, calculate the embedding of each position of the feature vector, and obtain the feature vector after position encoding. and
[0092]
[0093] Among them, PE represents position encoding, X represents the feature vector before position encoding, Represents the position-encoded feature vector.
[0094] S313. Input the encoded statistical feature vector and byte feature vector of the suspected abnormal behavior traffic into the cross-modal encoder of the deep learning model for feature fusion, and obtain the enhanced statistical features and byte features of each suspected abnormal behavior traffic.
[0095] Specifically, the encoded statistical feature vector and byte feature vector of the suspected abnormal behavior traffic are input into the cross-modal Transformer encoder of the deep learning model to learn the attention between the two feature sequences and repeatedly strengthen its own modality with the features of other modalities (feature sequence is another representation of feature vector). Transformer is a deep neural network model based on the self-attention mechanism. The core of the cross-modal Transformer encoder is the cross-modal attention block, which focuses on the interaction between different modal features. By repeatedly strengthening the source feature sequence (here it refers to the byte feature sequence and the statistical feature sequence), it can potentially adapt the feature sequence in one mode to the feature sequence of other modalities. Taking the example of transferring information from the encoded byte feature sequence of suspected abnormal behavior traffic to the statistical feature sequence, the inputs are the position-encoded feature sequences. and
[0096] like Figure 3As shown in FIG. 1 , in each layer of the cross-modal attention module, the low-level signals of other modalities (here, statistical features) after layer normalization are converted into a set of different key-value pairs K and V, and the signals of the target modality (here, byte features) after layer normalization are converted into a query matrix Q. The three matrices Q, K, and V are used to calculate the cross-modal attention Y, so that the target modality Z continuously updates its feature sequence. After the cross-modal attention module, the enhanced source modality feature sequence is obtained, which here refers to the enhanced byte feature sequence, denoted as Figure 3 In, W K , W V , W Q They are the weight matrices assigned when calculating the key-value pairs K and V and the query matrix Q. The parameter T in the softmax function used to calculate the attention represents the time step length of the input feature sequence, and d represents the dimension of the input feature sequence.
[0097] In the same way, cross-modal feature fusion is performed on the statistical features based on byte features to obtain an enhanced statistical feature sequence.
[0098] S314. Input the enhanced statistical features and byte features into the self-attention-based Transformer sequence model to obtain final feature representations of the statistical features and byte features respectively; and concatenate the final feature representations of the statistical features and byte features to obtain a representation vector of the suspected abnormal behavior traffic.
[0099] After the cross-modal attention module, the two feature sequences of the enhanced source modality are obtained, and then input into the cross-modal Transformer sequence model based on self-attention to obtain the final feature representation of each modality (statistical features and byte features).
[0100] After obtaining the final feature representation of each mode, the last feature sequence is extracted from each mode sequence (byte feature sequence and statistical feature sequence) of the suspected abnormal behavior traffic, and they are concatenated to obtain the final representation vector of the suspected abnormal behavior traffic.
[0101] S32: Detect and classify the plurality of suspected abnormal behavior flows based on the characterization vector to obtain classification results.
[0102] In the real-time detection stage, the representation vectors of multiple suspected abnormal behavior flows are input into the fully connected layer of the deep learning model, and softmax detection and classification are performed to obtain classification results. The classification results include normal flows and multiple types of abnormal flows. The multiple types of abnormal flows include: DoS (Denial of Service), DDoS (Distributed Denial-Of-Service attack), scanning (network scanning attack), FTP (File Transfer Protocol) and other malicious flows.
[0103] The deep learning model here is a deep learning model trained in the offline stage. The trained deep learning model is deployed in the server cluster to perform real-time detection and classification of suspected abnormal behavior traffic.
[0104] In the offline training stage, it includes: before inputting each of the suspected abnormal behavior traffic into the deep learning model, it also includes pre-training the deep learning model offline;
[0105] And for each time, after the detection and classification is performed based on the characterization vector of each suspected abnormal behavior traffic and the abnormal behavior classification result of each suspected abnormal behavior traffic is obtained, it also includes: verifying and marking the abnormal behavior classification result of each suspected abnormal behavior traffic (it can be sent to manual verification);
[0106] Using the verification and annotation results as a standard set to perform offline training on the deep learning model to obtain a new deep learning model;
[0107] If the preset update time corresponding to the deep learning model is reached, the new deep learning model is used to update the deep learning model currently saved in the big data platform, that is, the new deep learning model is saved to HDFS for Spark Streaming to load.
[0108] In summary, this solution includes three stages: data mining and data processing stage, abnormal behavior detection stage and abnormal behavior classification stage. Among them, the data mining and data processing stage is used to collect and stream massive intranet traffic data. The data mining and processing stage specifically includes: the data mining stage is used to collect and transmit the massive traffic data generated in the intranet; the data processing stage is used to batch process the traffic data collected in the intranet;
[0109] The abnormal behavior detection stage is used to detect abnormal behavior of the traffic processed by the big data platform. The abnormal behavior detection stage includes: feature selection stage: selecting URL features and traffic behavior features of network traffic for input of machine learning integration algorithm; anomaly detection stage: used to detect abnormal behavior in network traffic;
[0110] The abnormal behavior classification stage is used to specifically classify the detected suspected abnormal behaviors. The abnormal behavior classification stage includes a feature fusion stage, which is used to fuse the different pattern features extracted by the encoder; and an abnormal behavior classification stage, which is used to perform softmax classification on the representation vector after feature fusion.
[0111] That is, this solution targets small sample sizes and complex changes in real networks. First, it uses the URL and traffic behavior characteristics in the DPI data as the main features of traffic analysis to discover malicious behaviors hidden in the traffic; the detected suspected abnormal behavior traffic is sent to the deep learning model, and different abnormal behavior traffic is collectively classified to discover more features of different types of abnormal traffic.
[0112] Example 2
[0113] The method proposed in the present invention is used to test massive network traffic. The CIC-IDS-2017 public data set is used. In order to ensure the balance of data training, this embodiment samples data of each category as the initial input data of network traffic. For network traffic data, four commonly used evaluation indicators of machine learning models (accuracy, recall, precision, and F1 score) are selected to judge the quality of the model. The F1 score is a measurement indicator for classification problems.
[0114] The CIC-IDS-2017 dataset is used in the offline training model of this application. After the abnormal behavior traffic is classified by the deep learning model, the experimental results are shown in Table 1.
[0115] Table 1 Comparison results
[0116] category Accuracy Precision Recall F1 Machine learning method based on ensemble learning 87.26% 87.30% 87.30% 85.96% Methods based on statistical features 96.1% 94.3% 97.1% 95.6% Byte Grayscale Image Based Method 99.22% 98.81% 98.43% 98.64% Method based on statistics and byte feature fusion 99.30% 99.18% 99.39% 99.22%
[0117] Based on the above comparison result table, it can be concluded that the network traffic anomaly detection method proposed in this application has a higher detection accuracy.
[0118] Example 3
[0119] Based on the same inventive concept, the present invention also provides a multi-modal anomaly detection system for big data network traffic, such as Figure 4 As shown, including:
[0120] A data processing module, used to obtain the flow data generated by the intranet, and perform flow analysis on the flow data to obtain deep packet detection features of the flow data;
[0121] An abnormal behavior detection module, used to perform abnormal behavior detection on the traffic data based on the deep packet detection feature through a machine learning model to obtain multiple suspected abnormal behavior traffic in the traffic data;
[0122] The abnormal behavior classification module is used to input each of the suspected abnormal behavior traffic into the deep learning model, extract the multimodal features of each of the suspected abnormal behavior traffic and perform feature fusion to obtain the characterization vector of each of the suspected abnormal behavior traffic; perform detection and classification based on the characterization vector of each of the suspected abnormal behavior traffic to obtain the abnormal behavior classification result of each of the suspected abnormal behavior traffic.
[0123] The data processing module comprises:
[0124] The data encapsulation submodule is used to encapsulate the traffic data into multiple batches of traffic data according to multiple time periods through the spark platform;
[0125] The feature extraction sub-model is used to extract features from each batch of traffic data to obtain deep packet detection features of each batch of traffic data.
[0126] In the feature extraction sub-model, the deep packet detection features of the traffic data include the URL and traffic behavior features of the traffic data.
[0127] The data processing module further includes:
[0128] The data acquisition module is used to use Kafka to collect the traffic data generated in the intranet, and write the traffic data into the specified queue of Kafka and transmit it to the Spark platform.
[0129] The anomaly detection system further includes: a machine learning model offline training module, which is used to:
[0130] Verifying and marking the plurality of suspected abnormal behavior traffic flows, and using the verification and marking results as a standard set to perform offline training on the machine learning model to obtain a new machine learning model;
[0131] If the preset update time corresponding to the machine learning model is reached, the new machine learning model is used to update the machine learning model currently saved in the big data platform.
[0132] The anomaly detection system further includes: a deep learning model offline training module, which is used to:
[0133] Verifying and annotating the abnormal behavior classification results of each of the suspected abnormal behavior traffic flows, and using the verification and annotation results as a standard set to perform offline training on the deep learning model to obtain a new deep learning model;
[0134] If the preset update time corresponding to the deep learning model is reached, the new deep learning model is used to update the deep learning model currently saved in the big data platform.
[0135] The machine learning model adopts an integrated learning algorithm combining Boosting, random forest and Bagging.
[0136] The abnormal behavior classification module includes:
[0137] A feature extraction submodule is used for: for each of the suspected abnormal behavior traffic: inputting the suspected abnormal behavior traffic into a deep learning model, and using an encoder of the deep learning model to extract multimodal features of the suspected abnormal behavior traffic, wherein the multimodal features include statistical features and byte features;
[0138] A position encoding submodule, used for performing position encoding on the statistical features and byte features of the suspected abnormal behavior traffic to obtain the encoded statistical feature vector and byte feature vector;
[0139] A feature fusion submodule, used for inputting the encoded statistical feature vector and byte feature vector into the cross-modal encoder of the deep learning model for feature fusion, so as to obtain the statistical features and byte features after the suspected abnormal behavior traffic is enhanced;
[0140] A representation vector determination submodule is used to input the enhanced statistical features and the byte features into a self-attention-based transformer sequence model to obtain the final feature representations of the statistical features and the byte features respectively; and to obtain the representation vector of the suspected abnormal behavior traffic by splicing the final feature representations of the statistical features and the byte features.
[0141] Example 4
[0142] like Figure 5 As shown, the present invention also provides an electronic device, which may be a computer device, a single-chip device, an intelligent mobile device, etc. The electronic device in this embodiment may include a processor, a memory, a transceiver component, etc. The memory, the processor, and the transceiver component are connected via a bus; the memory may be used to store an execution program, and an exemplary execution program may include instructions; the processor is used to execute the instructions stored in the memory. The memory may also be used to store data, which may be called and / or modified when the instructions are executed.
[0143] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions in a storage medium to implement the corresponding method flow or corresponding functions, so as to implement the steps of a multi-modal anomaly detection method for big data network traffic in the above embodiment.
[0144] Example 5
[0145] Based on the same inventive concept, the present invention also provides a readable storage medium, specifically an electronic device readable storage medium (Memory), which is a memory device in an electronic device for storing programs and data. It can be understood that the storage medium here can include both built-in storage media in electronic devices and, of course, extended storage media supported by electronic devices. The storage medium provides a storage space that stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by a processor are also stored in the storage space, and these instructions can be one or more execution programs (including program codes). It should be noted that the storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The processor loads and executes one or more instructions stored in the storage medium to implement the steps of a multimodal anomaly detection method for a large data network flow in the above embodiment.
[0146] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0147] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0148] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0149] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0150] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit its protection scope. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that after reading the present invention, those skilled in the art can still make various changes, modifications or equivalent substitutions to the specific implementation methods of the application, but these changes, modifications or equivalent substitutions are all within the protection scope of the claims to be approved.
Claims
1. A multimodal anomaly detection method for big data network traffic, characterized in that: include: Acquire traffic data generated in the intranet, and perform flow analysis on the traffic data to obtain deep packet inspection features of the traffic data; Performing abnormal behavior detection on the traffic data based on the deep packet inspection feature through a machine learning model to obtain multiple suspected abnormal behavior traffic in the traffic data; Each of the suspected abnormal behavior traffic is input into the deep learning model, the multimodal features of each of the suspected abnormal behavior traffic are extracted and feature fusion is performed to obtain a characterization vector of each of the suspected abnormal behavior traffic; detection and classification are performed based on the characterization vector of each of the suspected abnormal behavior traffic to obtain an abnormal behavior classification result of each of the suspected abnormal behavior traffic.
2. The method according to claim 1, characterized in that The performing flow analysis on the flow data to obtain deep packet detection features of the flow data includes: The traffic data is encapsulated into multiple batches of traffic data according to multiple time periods through the spark platform, and features are extracted for each batch of traffic data to obtain deep packet detection features for each batch of traffic data.
3. The method according to claim 2, characterized in that The deep packet inspection features of the traffic data include the URL and traffic behavior features of the traffic data.
4. The method according to claim 2, characterized in that The acquisition of traffic data generated in the intranet includes: Kafka is used to collect the traffic data generated in the intranet, and the traffic data is written into the specified queue of Kafka and transmitted to the spark platform.
5. The method according to any one of claims 1 to 4, characterized in that: After performing abnormal behavior detection on the traffic data based on the deep packet inspection feature by using a machine learning model to obtain a plurality of suspected abnormal behavior traffic in the traffic data, the method further includes: Verifying and marking the plurality of suspected abnormal behavior traffic flows, and using the verification and marking results as a standard set to perform offline training on the machine learning model to obtain a new machine learning model; If the preset update time corresponding to the machine learning model is reached, the new machine learning model is used to update the machine learning model currently saved in the big data platform.
6. The method according to claim 1, characterized in that After performing detection and classification based on the characterization vector of each of the suspected abnormal behavior traffic and obtaining the abnormal behavior classification result of each of the suspected abnormal behavior traffic, the method further includes: Verifying and annotating the abnormal behavior classification results of each of the suspected abnormal behavior traffic flows, and using the verification and annotation results as a standard set to perform offline training on the deep learning model to obtain a new deep learning model; If the preset update time corresponding to the deep learning model is reached, the new deep learning model is used to update the deep learning model currently saved in the big data platform.
7. The method according to claim 1, characterized in that The machine learning model adopts an integrated learning algorithm combining Boosting, random forest and Bagging.
8. The method according to claim 1, characterized in that The step of inputting each abnormal behavior traffic into a deep learning model, extracting multimodal features of each suspected abnormal behavior traffic, and performing feature fusion to obtain a representation vector of each suspected abnormal behavior traffic includes: For each suspected abnormal behavior traffic: Inputting the suspected abnormal behavior traffic into a deep learning model, and using an encoder of the deep learning model to respectively extract multimodal features of the suspected abnormal behavior traffic, wherein the multimodal features include statistical features and byte features; Position encoding is performed on the statistical features and byte features of the suspected abnormal behavior traffic to obtain the encoded statistical feature vector and byte feature vector; Inputting the encoded statistical feature vector and byte feature vector into the cross-modal encoder of the deep learning model for feature fusion, and respectively obtaining the statistical features and byte features after the suspected abnormal behavior traffic is enhanced; The enhanced statistical features and the byte features are input into a self-attention-based transformer sequence model to obtain final feature representations of the statistical features and the byte features respectively; the representation vector of the suspected abnormal behavior traffic is obtained by splicing the final feature representations of the statistical features and the byte features.
9. A multimodal anomaly detection system for big data network traffic, characterized in that: include: A data processing module, used to obtain the flow data generated by the intranet, and perform flow analysis on the flow data to obtain deep packet detection features of the flow data; An abnormal behavior detection module, used to perform abnormal behavior detection on the traffic data based on the deep packet detection feature through a machine learning model to obtain multiple suspected abnormal behavior traffic in the traffic data; The abnormal behavior classification module is used to input each of the suspected abnormal behavior traffic into the deep learning model, extract the multimodal features of each of the suspected abnormal behavior traffic and perform feature fusion to obtain the characterization vector of each of the suspected abnormal behavior traffic; perform detection and classification based on the characterization vector of each of the suspected abnormal behavior traffic to obtain the abnormal behavior classification result of each of the suspected abnormal behavior traffic.
10. The system according to claim 9, characterized in that The data processing module comprises: The data encapsulation submodule is used to encapsulate the traffic data into multiple batches of traffic data according to multiple time periods through the spark platform; The feature extraction sub-model is used to extract features from each batch of traffic data to obtain deep packet detection features of each batch of traffic data.
Citation Information
Cited By
Encrypted traffic attack behavior training and identification method
CN119254544A
A Training and Recognition Method for Encrypted Traffic Attack Behaviors
CN119254544B
Network vulnerability detection method based on Spark multi-source data fusion and feature analysis
CN119603019A
