Industrial internet multi-instance sequential network flow data processing method
By converting network traffic data into multi-channel images and using deep learning technology, the problem of insufficient data processing capabilities and poor adaptability of network traffic analysis in the industrial Internet is solved, and more efficient and accurate network security event predictions are achieved.
Patent Information
- Application Number
- CN202410654323.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-24
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-05-24
AI Technical Summary
Network traffic analysis in the industrial Internet faces problems such as insufficient large-scale data processing capabilities, inaccurate data labels, unbalanced categories, poor adaptability to dynamic network environments, and low efficiency of fine-grained data processing, resulting in poor prediction of network security events.
A time-series network traffic data processing method based on multi-instance learning is used to convert the network traffic data into a multi-channel image format, and deep learning technology is used for analysis. Security event prediction is performed through preprocessing, feature extraction, image coding and deep learning models.
It improves the accuracy and efficiency of network traffic analysis, enhances adaptability to dynamic network environments, solves the problem of inaccurate data labels and category imbalance, and improves the efficiency and accuracy of network security event detection.
Smart Images

Figure CN118631501A
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of network security technology, and specifically relates to a method for processing multi-instance time-series network traffic data of an industrial Internet. Background Art
[0002] In the industrial Internet scenario, the challenges in the field of network security are more prominent. As the interconnection and intelligence of industrial equipment continue to increase, the risk of network attacks is also increasing. Traditional network traffic analysis methods are inadequate in this environment, and more efficient and accurate solutions are needed.
[0003] In the Industrial Internet, data is huge and diverse, and network traffic analysis must be able to handle this data. The fixed rules and features of traditional methods are no longer applicable because the threats facing industrial networks are constantly evolving. For example, traditional intrusion detection systems may not be able to identify new attacks against industrial control systems in a timely manner. At the same time, traffic analysis tools respond slowly when processing large amounts of data, which may lead to the omission of key information and reduce data processing capabilities.
[0004] The diversification and continuous evolution of security threats in the Industrial Internet make fine-grained network traffic analysis more difficult. The traffic generated by industrial equipment can be highly complex, and it becomes critical to accurately mark each packet or event. However, traditional methods often fail to meet this demand, resulting in the accuracy of the analysis results being affected. At the same time, there is a quantitative difference between normal and abnormal traffic in industrial networks, which also poses challenges to traditional anomaly detection methods.
[0005] The invention patent application with publication number CN117313035A disclosed on December 29, 2023 a cross-layer anomaly detection method for industrial information-physical systems based on information-physical feature fusion. First, the network traffic is divided based on communication event triggering, and the overall traffic is divided into multiple data packet sequences to achieve alignment of physical space data and network space data on a time scale; then each data packet sequence is deeply analyzed and divided into dedicated data packets and general data packets according to the communication protocol type, and information layer and physical layer features are extracted for each type of data packet; then, feature splicing and stacking are used to process the information layer features in the dedicated data packet subset, the general unicast data packet subset, and the general broadcast data packet subset, respectively, and the results are fused with the physical layer features and the coarse-grained features of the sequence to obtain the overall feature vector of the sequence, and finally, based on the KSVD algorithm considering label constraints, the feature vector training dictionary and classifier model are used to achieve anomaly detection. In this technical solution, the sequence coarse-grained features include a small number of indicators such as the number of data packets, communication duration and bit rate; the amount of information represented by the sequence coarse-grained features is relatively low, and it is difficult to fully reflect the changing pattern of network traffic; the sequence coarse-grained features may be difficult to distinguish different types of anomalies, affecting the learning and judgment of subsequent classifiers; as the network environment becomes more complex, the sequence coarse-grained features need to be continuously supplemented and improved, otherwise it will be difficult to adapt to changes in the operating environment.
[0006] Fine-grained network traffic analysis focuses on a single network flow, that is, a series of packets with the same protocol type, source IP address, destination IP address, source port number, and destination port number within a specific time period. Using traffic feature extraction tools such as CICflowmeter, the packet sequence in the pcap file can be converted into a CSV format data set so that each line of record corresponds to the characteristics of an independent network flow.
[0007] In the field of network security, the current network traffic analysis mainly has the following problems:
[0008] (1) Insufficient large-scale network data processing capabilities: Traditional methods are often unable to cope with the huge amount of network traffic data and cannot meet the requirements of efficient processing and real-time response.
[0009] (2) Inaccurate data labeling problem: In fine-grained network traffic analysis, existing methods often find it difficult to accurately label each data packet, which affects the accuracy of the analysis results.
[0010] (3) Class imbalance problem: Traditional methods are not effective in dealing with the quantitative difference between normal and abnormal traffic, making it difficult to effectively identify network anomalies.
[0011] (4) Poor adaptability to dynamic network environments: The rapid changes in the network environment make it difficult for traditional methods to adapt to new applications and services, affecting the analysis results.
[0012] (5) Limitations of fine-grained data processing: Despite providing detailed information, fine-grained methods are inefficient in large-scale data processing and are unable to cope with rapidly changing cyber threats.
[0013] In this context, a new method is needed to solve these problems and improve the effectiveness of network security incident prediction. Summary of the invention
[0014] In response to the above problems, the present invention proposes a time-series network traffic data processing method based on multi-instance learning, innovatively represents the network traffic data as coarse-grained multi-instance time-series network traffic data, and then converts the network traffic data into image format, uses deep learning technology to analyze the data, performs network traffic data analysis and security incident prediction, improves the accuracy and efficiency of network traffic analysis, and effectively responds to the challenges faced by the field of network security today.
[0015] The method for processing time series network traffic data based on multiple instance learning of the present invention comprises the following steps:
[0016] Step 1: Preprocess the network traffic data, extract the network traffic data features, and organize them into time series feature data;
[0017] The preprocessing includes: filtering out data related to security incident detection from network traffic data, cleaning noise and redundant information, then extracting features from the cleaned data, standardizing the feature data, and then reorganizing the standardized features into time series data according to timestamps; the extracted features include network flow collection time, source IP address, target IP address, source port, target port, protocol type, and statistical information of network traffic; let the extracted feature dimension be d;
[0018] Step 2: instantiate and image-encode the time series feature data; the present invention adopts a method combining time window division and advanced algorithm conversion to achieve effective representation of network flow, including the following:
[0019] (2.1) First, the network traffic data is coarsely divided according to the set time length of the bag, and then each bag is finely divided according to the set time window. It is assumed that the division is k sub-packets, each sub-packet contains all network flow instances in the corresponding time window, and the proportion of malicious traffic in the bag is counted, and a security event label is assigned to the bag; d features of each network flow instance are extracted;
[0020] (2.2) Then, for each sub-packet, the Simple-MI algorithm is used to map the features of all network flow instances in each sub-packet into a fixed-dimensional vector, and a set of functions for calculating statistical data is set. The Simple-MI algorithm is used to calculate the statistical data of all network flow instances of sub-packets in each feature dimension, and the sub-packet features of the corresponding time window are obtained by aggregation. The sub-packet features are: vector, d is the characteristic dimension, For collection The number of functions in the bag; then the bag feature is obtained from the sub-bag feature, and the bag feature is A vector of , k is the number of sub-bags contained in the bag, is the dimension of bag features;
[0021] (2.3) Use the GAF algorithm to construct a multi-channel graph for each bag feature, including: converting each feature dimension of the bag into a channel in the multi-channel graph, using the GAF algorithm to calculate the Gramian matrix of the feature sequence under the same dimension and converting it into an image, converting the bag feature into a channel number The image group;
[0022] Step 3: Build a deep learning model for the target task, preprocess and extract features of the real-time collected network traffic data according to step 1, convert it into a multi-channel image sequence according to step 2, and input the multi-channel image into the deep learning model for target task detection.
[0023] Compared with the prior art, the advantages and positive effects of the present invention are:
[0024] (1) The method of the present invention innovatively proposes a coarse-grained representation method for network traffic data with time series characteristics, converting multi-instance time series data into a multi-channel graph of fixed dimensions, which not only captures the global trend and pattern of network traffic, but also lays the foundation for the use of advanced image recognition technology, and can improve the detection and prediction capabilities of security incidents. The method of the present invention provides a new perspective for the detection of network traffic data security incidents, showing a new development direction for network security technology, not only improving the ability to process large-scale data, but also enhancing the accuracy of fine-grained network traffic analysis. By converting network traffic time series data to multi-channel graphs, it can effectively solve the problem of inaccurate data labels and category imbalance, and improve the adaptability to dynamic network environments.
[0025] (2) The method of the present invention is suitable for big data network traffic scenarios. When processing large-scale network traffic data, the method of the present invention can effectively process and analyze complex network traffic in a big data environment, especially the coarse-grained detection and prediction of overall trends, which is particularly important in the current rapidly developing network environment.
[0026] (3) The method of the present invention can fully utilize the powerful potential of image recognition technology. By converting network traffic data into image form, complex network traffic analysis can be performed with the help of mature image processing tools and algorithms. This conversion greatly expands the analysis toolbox in the field of network security and provides an intuitive and powerful tool for network security analysis.
[0027] (4) The method of the present invention uses a method combined with image processing to analyze network traffic. Compared with traditional text or numerical data analysis methods, the method of the present invention has significant improvements in detection efficiency and accuracy, making the detection of security incidents faster and more accurate, and being able to quickly respond to network security incidents.
[0028] (5) The technical means for coarse-grained characterization of time-series network traffic data provided in the method of the present invention is also applicable to other scenarios that require coarse-grained analysis, such as traffic monitoring, behavior analysis, etc. This technical means not only has the potential for wide application in the field of network security, but can also play an important role in other data analysis fields. The method of the present invention provides an innovative perspective and method for big data analysis of network traffic through the application of coarse-grained multi-instance time-series network traffic characterization and multi-channel graphs, significantly improving the efficiency and accuracy of network security event detection, while also providing possibilities for the application of related technologies in other fields, and has broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 This is an overall flow chart of an embodiment of the present invention using the method of the present invention to perform network flow security event warning;
[0030] Figure 2 It is a flow chart of performing multi-instance data graph representation according to an embodiment of the present invention. DETAILED DESCRIPTION
[0031] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.
[0032] Based on the problems existing in current network traffic analysis, it is particularly important to characterize network flow data in a coarse-grained manner. By aggregating multiple instances into one label, the problem of inaccurate data labels can be effectively addressed. This is particularly critical in the field of network security, as it is often impractical to accurately label each data packet. Combining multiple data packets into a large instance (or "packet") not only improves the efficiency and accuracy of the labeling process, but also helps solve the problem of class imbalance. In network traffic data, the difference in the amount of normal traffic and abnormal traffic is huge. The use of coarse-grained methods can more effectively identify and handle this imbalance, thereby improving the accuracy of anomaly detection. Compared with fine-grained methods, which are often limited by their processing power and efficiency when processing large data traffic, coarse-grained characterization makes it feasible to process large-scale data while maintaining the effectiveness of analysis. This approach can better adapt to new network environments and security requirements to provide more comprehensive and flexible network security solutions.
[0033] Based on this, the present invention provides an innovative network traffic data processing method, which integrates multiple instance learning (MIL) and deep learning technology to convert network traffic data into image format for processing. Through visual analysis technology, especially deep learning technology, network traffic data analysis and security event prediction can be further performed.
[0034] The present invention is a method for processing time series network flow data based on multiple instance learning. First, from the perspective of multiple instance learning, the network flow data is grouped into multiple packets, each packet has multiple network flow instances. The key here is to understand the definition of each packet and how it represents the collective characteristics of network flow.
[0035] Data packets are the cornerstone of network communication. They are responsible for breaking complex information into manageable units for transmission across the network. This process involves encapsulating and decapsulating data layer by layer in the multi-layer architecture of the network. Specifically, a piece of information initially exists in the form of application layer data, which is then encapsulated into a segment at the transport layer, further encapsulated into a packet at the network layer, and then into a frame at the data link layer, and finally transmitted as a bitstream at the physical layer. In network analysis, these packets are often recorded in the PCAP (Packet Capture) format, which is the industry standard for network packet capture technology and can be captured and analyzed using tools such as Wireshark or TcpDump. Although a single packet may contain only a small amount of information and is not enough to reflect the entire communication process, they are the basic building blocks for building network flows.
[0036] A network flow consists of a string of data packets transmitted between fixed source IP addresses and destination IP addresses, source ports and destination ports through the same protocol within a certain period of time. The uniqueness of a flow is usually identified by a five-tuple: source IP address, destination IP address, source port number, destination port number and protocol type. According to the transmission direction of the data packet, network flows can be divided into unidirectional flows and bidirectional flows. A unidirectional flow means that all data packets flow from one endpoint to another, while a bidirectional flow captures a complete communication session between two endpoints and the roles of source and destination can be exchanged in the flow. Considering that data packets are only a small part of the entire communication, network flows provide a more continuous and complete view, so network flows are regarded as a higher-level analysis unit in network traffic analysis.
[0037] For example, a Pcap packet is an hour of communication information captured by TcpDump. Cicflowmeter can be used to parse this Pcap and extract network flow information, which can be parsed into feature content counted by second, as shown in Table 1. Each second of network flow feature sequence can be regarded as an instance, which is the smallest unit for network traffic analysis. This structured data can be used as the input of the model and directly applied to machine learning and other models for training.
[0038] Table 1 Description of the main characteristics of network flows
[0039] Feature Name describe datetime Flow collection time srcip Source IP address sport Source port number dstip Destination IP address dsport Destination port number proto Protocol Type state Connection status dur Duration of the stream sbytes Data Bytes from Source to Destination dbytes Data bytes from destination to source sttl TTL value of the IP packet from source to destination dttl TTL value of the IP packet from the destination to the source sloss Number of packets lost from source to destination dloss Number of packets lost from destination to source service Service type, such as http, ftp, etc. Sload Data load from source to target Dload Data load from target to source attack_cat Attack Types Label Is it an attack? True means it is an attack, False means it is normal.
[0040] In traditional network analysis methods, the analysis of each network flow instance is often independent, while in the multi-instance learning of the present invention, a packet is analyzed as a whole, so as to better understand and identify complex patterns in network traffic. Next, considering that the network flow within each packet is continuous in the time domain, the present invention adopts a special method to process this time series data. This method involves dividing the network flow within each packet into different time periods, each of which represents a specific state or feature of the network flow. Then, the SimpleMI algorithm is used to map the network flow in each time period, which allows the originally dynamically changing network flow to be converted into a new form with fixed dimensions.
[0041] Secondly, the present invention adopts the Gram matrix angular frequency analysis (GAF) algorithm to convert the time series data into an image. In the present invention, each feature sequence is converted into an image representation. This means that the network flow data originally in the form of a numerical sequence is converted into an image that can be analyzed visually.
[0042] Then, the present invention aggregates the multiple channel graphs obtained by converting all feature sequences. This aggregation not only retains the unique information of each feature sequence, but also forms a multi-channel image containing rich network traffic features by combining this information. This multi-channel image represents a comprehensive visual representation of the original network traffic and provides rich input data for the deep learning model.
[0043] In the method of the present invention, the deep learning technology used, especially the convolutional neural network (CNN), plays a vital role in analyzing these images. CNN is able to identify patterns and features in images, which makes it particularly suitable for processing converted network traffic images. Through training, CNN can learn how to identify signs of network security events such as intrusions, abnormal traffic patterns, etc. from these images.
[0044] In summary, the present invention provides a new and efficient method for network traffic data analysis by combining multi-instance learning with image conversion and deep learning technology. This method provides an effective solution for processing large-scale network data in network security event detection and prediction.
[0045] The following is combined with an application scenario task of network flow security event detection to illustrate the time-series network traffic data processing method based on multi-instance learning of an embodiment of the present invention. The main process includes: first, collecting the original network traffic data, preprocessing the data, and parsing it into a structured form; next, through the feature extraction step, extracting key information from the structured data, such as traffic size, duration, and protocol type; then, these data are divided into different event windows, based on time or specific traffic patterns, and the multiple instance data in these windows are then converted into image format. Using this characterization method, image processing technology can be used for in-depth analysis. Finally, the model is trained through appropriate machine learning or deep learning models (such as CNN), and prediction results are output, such as identifying different types of network security events. The whole process not only improves the accuracy of event detection, but also enhances the adaptability of the model to complex network environments. As Figure 1 As shown, the embodiment of the present invention includes the following 6 steps.
[0046] Step 1: In the embodiment of the present invention, the original network traffic data is collected through the pcap tool.
[0047] The UNSW-NB15 dataset was developed by the Cyber Security Laboratory at the University of New South Wales, Australia, to provide a comprehensive and modern network traffic dataset to support cyber security research, especially research on intrusion detection systems. This dataset contains rich network interaction data, covering various types of normal and malicious network activities, thus providing a practical and challenging environment for analyzing cyber security events. A key feature of the UNSW-NB15 dataset is its diversity and real-time nature. It not only includes common types of network attacks, such as DoS attacks, worms, backdoor attacks, etc., but also includes some newer attack types, ensuring that the dataset keeps pace with current cyber security threats. In addition, each network flow in the dataset is annotated with detailed labels, including information such as the type of flow, the type of attack (if any), etc., which provides important ground truth for machine learning-based models.
[0048] In the embodiment of the present invention, the UNSW-NB15 dataset is used as the basis for the research on the characterization and processing of multi-instance time-series network traffic data, which can demonstrate the effectiveness and applicability of the method of the present invention in processing real-world data. Through in-depth analysis and model training of this dataset, the effectiveness of the method proposed in the present invention can be better verified, especially in identifying and classifying different types of network security events. Therefore, the use of the UNSW-NB15 dataset not only provides a comprehensive evaluation platform, but also helps to demonstrate the potential and advantages of the new method in practical applications.
[0049] Step 2: pre-process the collected network traffic data, parse it into a structured form and store it.
[0050] Data preprocessing is a key step in network traffic data analysis, especially when dealing with raw pcap files. This process involves converting raw network traffic data into a more structured and easy-to-analyze format. First, you need to use a specialized network data acquisition and analysis tool, such as Wireshark or tcpdump, to read the raw data in the pcap file. These tools can capture data packets on the network and store information in binary form, including source address, destination address, transport layer protocol, etc.
[0051] Secondly, the network traffic data is preprocessed. This process mainly involves parsing the collected raw network traffic data and extracting the key attributes of the network traffic. The preprocessing process mainly involves screening out data related to security event detection, cleaning data, etc. The network traffic data is screened out for data related to security event detection, that is, using advanced data analysis technology to identify features and patterns related to security events, such as data packet size, request frequency, etc., while removing data that is not related to security events. The key attributes extracted by the embodiment of the present invention include but are not limited to the size, duration, source IP address, destination IP address, port number, protocol type (such as TCP, UDP, etc.), and possible flags (such as SYN, ACK, etc.) of the data packet. These attributes are crucial for understanding the behavior pattern of network traffic. Cleaning data mainly eliminates noise and redundant information in the data set, such as removing incomplete or damaged data packets, removing duplicate data, removing data with incorrect formats, etc., to ensure the data quality and accuracy of subsequent analysis.
[0052] Step 3: Extract features from structured network traffic data.
[0053] Feature extraction is a key link in processing structured network traffic data, and its purpose is to extract information that is crucial to understanding network behavior and detecting security incidents from raw network traffic data. In this process, the present invention extracts a series of key features from structured network traffic data, which not only include basic network attributes such as traffic size, duration, and protocol type, but may also include more complex statistical information, such as average packet size, the proportion of different types of data packets in the traffic, and the trend of traffic changes over a certain period of time. In addition, feature extraction may also involve more advanced analysis, such as behavior-based features, which may include session establishment and termination patterns, burst behavior of traffic, and comparative analysis of normal and abnormal patterns of traffic. These advanced features can help deep learning models more accurately identify potential security threats in the network, such as DDoS attacks, port scanning or other malicious behaviors.
[0054] In the entire feature extraction process, not only the accuracy and relevance of the data should be considered, but also the efficiency of data processing and analysis. Selecting an appropriate feature set can significantly improve the efficiency of model training and the performance of the final detection system. Therefore, feature extraction is not only the basis for improving the quality of data analysis, but also a key step in building an efficient and accurate network security incident detection system. In an embodiment of the present invention, the key features extracted from each network flow data processed in step 3 include at least network flow acquisition time, source IP address, target IP address, source port, target port, protocol type, statistical information of network traffic, etc. The features extracted from each network flow data can be represented by a d-dimensional vector, where d represents the number of features.
[0055] The present invention also standardizes the extracted feature data. In the embodiment of the present invention, the standardized data mainly standardizes the IP address and port number. For example, the IP address may need to be converted into a unified representation, and the port number may need to be mapped to a standard service type. The standardized features are timestamp aligned to achieve time series data reorganization. The standardized features are reorganized into time series data according to their timestamps to ensure that each data instance can reflect its continuity and dynamic changes in time. For example, scattered data packets are reorganized into complete streams according to sessions or connections, or snapshots of time points are merged into a continuous time series, and the data is synchronized and serialized.
[0056] Cleaning improves the quality and accuracy of data, and standardization eliminates the differences between data collected from different sources or at different times to ensure the consistency and comparability of the feature data extracted subsequently in the feature space. Time series data reorganization helps capture and understand the behavior patterns of network traffic, especially complex security events such as lateral movement and data penetration, laying a solid foundation for subsequent pattern recognition and machine learning model training. In general, data preprocessing and feature extraction stages are important steps to convert raw network traffic data into a clear, orderly data set that can be used for in-depth analysis.
[0057] Step 4: divide the collected network traffic data into event windows.
[0058] The embodiment of the present invention collects network flow data at a frequency of 1 second, and the network flow data obtained is in seconds. The embodiment of the present invention divides the UNSW-NB15 dataset into event windows to meet the needs of multi-instance learning. In the UNSW-NB15 dataset, each network flow is marked with a minimum time unit of one second. The embodiment of the present invention defines the dataset as a multi-instance dataset Z = {(B1, y1), (B2, y2), …, (B N ,y N )}, where each B i Represents a network event within one minute, each B i Contains 60 network flow instances S j , S j Represents the network traffic data of the jth second in a minute; y i Represents network event B i The embodiment of the present invention uses "bag" to represent the set of network flow instances contained in each minute, and each bag represents the set of network flow instances corresponding to each minute. A d-dimensional feature vector is extracted for each network flow instance.
[0059] The embodiment of the present invention performs second-by-second statistical analysis on the network events in each bag. If the malicious traffic exceeds 50% in a certain second, this second is marked as 1; otherwise, it is marked as 0. Calculate each bag B i The proportion of seconds marked as 1 in r j And accordingly give B i Assign labels as follows:
[0060] a) If r j ≤0.45, then mark B i It is a low-risk security event, represented by label E1, that is, y i =E1.
[0061] b) If 0.45 <r j <0.75, then mark B i This is a medium-risk safety event and is denoted by label E2.
[0062] c) If r j ≥0.75, then mark B i This is a high-risk safety event and is indicated by label E3.
[0063] This labeling strategy takes into account the frequency and intensity of malicious network flows at different times, aims to more accurately predict continuous security events at different levels, reflects the attacker's behavior patterns and strategies, and takes into account the characteristics of various types of attacks, such as DDoS attacks and data theft, thereby helping to more comprehensively understand and respond to network security threats.
[0064] In this step, unlike the fine-grained instance in the prior art that assigns a label to each network flow, the method of the present invention first divides the network traffic data with time series characteristics into instances, each instance corresponds to the network traffic in a specific time window, which is called a sub-bag. Corresponding to the embodiment of the present invention, each sub-bag is the network traffic within 1 second, which can be 1 or more instances. The method of the present invention uses a label reflecting the security events under the communication behavior in the time period for the coarse-grained instance, that is, the bag containing several network flow instances. Such a division method can capture the network behavior in each time window and reflect the dynamic changes and overall trends of network traffic. It should be noted that the time window size selected for dividing the coarse-grained instance will directly affect the accuracy of subsequent model recognition, so it is necessary to adjust the time window size. In the embodiment of the present invention, a bag is set as a time window of 1 minute, and the time window contains all the collected network flow instances corresponding to 1 minute. The length of each network flow instance is 1 second. Such a setting has a higher recognition accuracy in the subsequent model.
[0065] Step 5: Multi-instance data graph representation.
[0066] The whole process of multi-instance data graph representation is divided into two stages, such as Figure 2 As shown, each stage uses a special data conversion technique. The first stage is "Time Slice SimpleMI Conversion", which applies the SimpleMI algorithm to process network traffic at different time slices within the packet to generate time-hierarchical packets. The second stage is "Packet to Image Conversion using GAF", where the Gramian Angular Field (GAF) method is used to convert these structured data packets into multi-channel images. This step-by-step process is crucial to convert time series network data into an image-based format, which facilitates the application of complex image classification techniques to predict network security events. In this way, time series data is converted into an intuitive image form, preserving the important temporal relationships in the original sequence.
[0067] (1) The process of Simple-MI conversion of time slices is as follows:
[0068] Input: A dataset containing multiple instances of network flows. In the previous step, the network traffic in each bag is time-sliced, and each slice is the traffic data within a time window. The Simple-MI algorithm is used to convert the multiple instance data in each time window into a single instance dataset. The Simple-MI algorithm is used to process the feature data in each time window, such as calculating the average, median, and sum of all network traffic instances in each time window, and the corresponding conversion obtains the features of each time window instance.
[0069] For each divided instance (bag), the Simple-MI algorithm is used to map the data in the instance into a vector of fixed dimension. This step simplifies the multi-dimensional network traffic data into a form that can be effectively processed by the machine learning model, reducing the complexity while retaining key information. In the embodiment of the present invention, 1 minute has 60 seconds, so each bag B i It becomes a vector with a fixed dimension, which is 60.
[0070] The embodiment of the present invention uses the Simple-MI algorithm to divide and aggregate multi-instance network flow data sets. For an implementation, see the following Algorithm 1:
[0071]
[0072] Suppose a multi-instance network flow dataset Z, where bag B i Contains i network flow instances, each with d features extracted as in step 3. The original network flow dataset can be represented as: Z = {(B1,y1),(B2,y2),…,(B N ,y N)}. In order to capture the changes in network traffic in different sub-time periods, it is necessary to analyze each bag B i The network flow instance of k sub-time windows contained in is represented by K = {t1, t2, ... t k In the embodiment of the present invention, each bag contains 60 time windows, that is, 60 sub-packets.
[0073] Simple-MI uses a set of characteristic functions Different time windows t i The following instances are aggregated into a fixed dimension. For each feature dimension of the sub-package, the embodiment of the present invention uses the following feature function Calculate three kinds of statistics of subpackages in each feature dimension:
[0074]
[0075] It contains three calculation functions, as follows:
[0076] Used to calculate bag B i The j-th subpacket b i,j The average value of the characteristics of all network flow instances; |b i,h | indicates subpackage b i,j The number of network flow instances contained in , x represents the eigenvalue;
[0077] f median (b i,j ), used to calculate bag B i Subpackage b i,j The median value of the feature;
[0078] Used to calculate bag B i b i,j The sum of the characteristics of all network flow instances.
[0079] In Algorithm 1, the above three functions are used to calculate the sub-package under different features. Statistical values, and then aggregate to obtain the feature vector M of sub-packets containing different numbers of network flow instances i,j , the feature vector M of each sub-packet i,j The dimension is Therefore, each bag B i It can be expressed as The eigenvector M i In Algorithm 1 Φ(b i,j ,f l ) = f l (b i,j ), for the obtained vector M i,jStandardize it as follows:
[0080]
[0081] Among them, M i,j,l is the vector M i,j The lth statistical feature, M′ i,j,l For M i,j,l The standardized value, min(M i,:l ) and max(M i,:,l ) are bag B i The eigenvector M i The minimum and maximum values in the lth statistical feature.
[0082] Finally, bag B is obtained i The standardized fixed-dimensional feature matrix M′ i In this way, the data set Z is transformed into the data set Z′={(M′1,y1),(M′2,y2),…,(M′ N ,y N )}.
[0083] The present invention uses the SimpleMI algorithm to convert the internal network flow data of each sub-packet into a vector with fixed dimension. This fine-grained division and conversion can capture the detailed characteristics of the network flow in each time window and represent it in the form of a vector, providing a detailed data basis for subsequent analysis.
[0084] (2) Use GAF to convert the bag feature matrix into an image.
[0085] In order to deeply explore the spatiotemporal characteristics of the network flow of each bag, the present invention adopts the GAF algorithm. Through this algorithm, the network flow feature sequence of each bag is converted into a multi-channel image. In this conversion process, each feature is regarded as a sequence and converted into a channel in the multi-channel image respectively. Therefore, the network flow data of the entire bag is represented as a multi-channel image with rich information, in which each channel represents a specific feature of the network flow, so that the spatiotemporal characteristics of the network flow can be comprehensively and deeply represented in the form of an image.
[0086] In the method of the present invention, each feature dimension of the bag is converted into a channel in a multi-channel graph, and the feature sequence under the same dimension is converted into an image representation using the GAF algorithm, and then a multi-channel image can be obtained. In the embodiment of the present invention, the multi-instance network flow is first aggregated per second through the Simple-MI algorithm, so that the coarse-grained features containing one minute are represented as vectors with 60 seconds, and the feature dimension is expanded on the basis of the feature dimension of the original network flow, from d dimension to 3d dimension, and each dimension is a feature sequence with a duration of 60 seconds.
[0087] In the process of using GAF to convert feature sequences to images, the method of the present invention adopts two key methods: GASF (Gramian Angular Summation Field) and GADF (Gramian Angular DifferenceField). First, the eigenvalues of each feature sequence in the same dimension are normalized to the amplitude range of [-1,1] to adapt to the angle value in the polar coordinate system. Then the normalized feature sequence is mapped to the polar coordinate system, the amplitude of the feature is encoded as the angular cosine, and the time axis is encoded as the radius. Then GASF and GADF are used to convert the feature sequence into two images respectively. Assume that the angles of the i-th and j-th eigenvalues in the feature sequence mapped to the polar coordinates are θ i and θ j In GASF, the Gramian matrix is formed by calculating the cosine value of the angle sum of the normalized data, which is expressed as GASF(i,j)=cos(θ i +θ j ), i, j = 1, 2, ... d. GADF focuses on the difference in angles, and the resulting matrix is GADF(i, j) = sin(θ i -θ j ), i, j = 1, 2, ... d. (i, j) represents the image coordinates. The numerical values of the obtained GASF matrix and GADF matrix are directly imaged as a grayscale image or mapped as a pseudo-color image. Finally, a multi-channel GASF image and a multi-channel GADF image are obtained.
[0088] The present invention converts the network traffic feature sequence into an image form through the GAF algorithm, retains the basic characteristics of time series data, and increases the visualization and analysis dimensions of the data, providing a strong foundation for subsequent image processing and classification tasks. Through this method, the features of network traffic data are effectively extracted and converted into images, making it possible to use image recognition technology for deep learning analysis.
[0089] Step 6: Build a deep learning model for the target task, train the model, preprocess and extract features of the real-time network traffic data according to the above steps, convert it into a multi-channel image sequence, and input it into the deep learning model for target task detection.
[0090] The method of the present invention converts network traffic data into an image format, and then uses deep learning technology to predict and detect network security events. The deep learning part of the present invention mainly relies on convolutional neural networks (CNNs). When processing these multi-channel images, CNNs can effectively identify patterns and features in the images, thereby detecting signs of network security events from the converted network traffic images.
[0091] When building a deep learning model, since it is specifically designed to process multi-channel image data of network traffic, it is important to ensure that the model can accept input data that matches the number of channels in the multi-channel image. When designing the convolutional layer of a deep learning model, the input channel parameter of the first convolutional layer must be set to the number of channels of the image. This ensures that the features of each channel can be captured and analyzed by the model. For example, if each multi-channel image has 10 channels, the number of input channels of the first layer of CNN should also be set to 10. This setting enables the model to process each channel separately, thereby learning the features of each channel and combining the information of all channels for comprehensive analysis.
[0092] During the deep learning model training phase, the model must not only learn to extract features from each individual channel, but also understand the relationship between different channels. During the training process, the model is "fed" with a large amount of multi-channel image data, each of which is accompanied by a corresponding label indicating normal or abnormal traffic. The features learned by the deep learning model from this data include not only the patterns within a single channel, but also the dynamic relationships across channels. Through this multi-dimensional learning, the model is able to generate advanced features that have keen insights into network security threats.
[0093] In the model training phase, an embodiment of the present invention uses an appropriate machine learning or deep learning model, such as a ResNet network. In the training phase, the model parameters are optimized to adapt to the training data so that the model can effectively identify and classify network security incidents. After the training is completed, the trained model is saved as an offline model. In the testing phase, this offline model is used to make predictions on the test set. This step is a key step in verifying the performance of the model. By applying the model on a test set that is different from the training data, the model's ability to identify specific types of network security incidents in actual scenarios can be evaluated. The output of the model typically includes information such as the category of the security incident, the likelihood score, and other information. These results are critical to understanding and responding to network security threats.
[0094] Furthermore, the use of the method of the present invention in real-time traffic monitoring, abnormal pattern detection and security incident response is explained, which is the core part of the network security system.
[0095] (1) Real-time traffic monitoring: Based on the method of the present invention, an efficient real-time network traffic monitoring system is implemented. The core of the system lies in the continuous capture of network traffic data and the immediate preprocessing and visualization of these data. In the preprocessing stage, the system will perform a series of operations such as denoising, standardization, and time series analysis on the traffic data. These operations lay the foundation for converting the data into an analyzable image format. Subsequently, according to the previously defined conversion rules, the preprocessed data is mapped to the image, and the image generated by each traffic instance is transmitted to the deep learning model in real time for analysis. The optimization of this process aims to minimize latency, thereby achieving real-time reflection of network conditions and providing a time window for emergency response. The deep learning model used by the system is used to detect network status.
[0096] (2) Abnormal pattern detection: Based on the method of the present invention or based on the above-mentioned real-time monitoring of network traffic, a deep learning model is constructed to identify and detect abnormal patterns in network traffic in real time. This process involves continuous analysis of traffic images to promptly detect any variations that do not conform to known normal behavior patterns, which may indicate potential security threats. The real-time analysis capability of the model is based on its recognition patterns obtained through training with a large amount of historical data. It can identify abnormal behaviors such as DDoS attacks, network scanning, and unauthorized access. The key to real-time detection is speed and accuracy, so the model needs to be continuously tuned to adapt to new changes in network behavior and emerging types of threats.
[0097] (3) Security incident response: When an abnormal pattern is detected through the deep learning model, a predefined security response mechanism is immediately initiated. These response measures include but are not limited to sending automatic warning notifications to network administrators, implementing network traffic isolation to contain the potential spread of threats, and initiating automated or manual further investigation processes. The response mechanism is designed to quickly and effectively mitigate threats, reduce the impact on network users and services, and collect sufficient information for post-analysis and adjustment of defense strategies. The rapidity of security incident response is critical to protecting network resources from damage. Therefore, the system also includes real-time evaluation of the effectiveness of response measures to ensure timely updating and improvement of security measures.
[0098] In summary, the present invention combines multiple instance learning, time series data processing, image conversion and deep learning technology to provide an innovative and efficient method for network traffic data analysis and network security event prediction, which not only improves the accuracy of network security event detection, but also provides an effective solution for processing large-scale network data. In practical applications, it can cope with a variety of network security challenges:
[0099] (a) Detect and predict network security events: By converting network traffic data into image form, the present invention uses deep learning and image processing technology to analyze these images to discover potential network security threats. Specifically, it can effectively identify and predict security events such as unauthorized intrusions, abnormal traffic patterns, and malware propagation. This conversion mechanism not only improves the intuitiveness of the data, allowing security analysts to more directly identify network anomalies, but also, with the assistance of image analysis technology, can significantly improve the speed and accuracy of event detection. In addition, the present invention can also be applied to continuous network monitoring. Through the time series analysis of the converted images, real-time evaluation and prediction of network security situation can be achieved, thereby providing strong technical support for network security management.
[0100] (b) Performing large-scale data processing: The present invention can efficiently identify and parse complex network traffic patterns by converting network traffic data into image format and applying image processing technology for analysis, and is particularly suitable for processing large-scale data sets. The uniqueness of this method is that it can capture and analyze the overall characteristics and trends of network traffic from a more macroscopic perspective (i.e., a coarse-grained perspective), rather than being limited to microscopic detail analysis. When processing high-dimensional and large amounts of network data, the present invention not only maintains efficient processing speed and accuracy, but also provides a macroscopic view of network traffic patterns through coarse-grained analysis. This helps to quickly identify overall traffic trends and abnormal patterns, and is suitable for application scenarios that require real-time or near real-time data analysis. In addition, the method of the present invention has good scalability and can adapt to the growing amount of data and the ever-changing network environment. By analyzing from a coarse-grained perspective, the method can not only handle the current data load, but also adapt to future data growth, ensuring long-term and effective analysis and processing of network traffic.
[0101] The method of the present invention is applied to security incident detection and compared with CCE, EM-DD, MIHI, SimpleMI, miFV, and miVLAD multi-instance data characterization methods. The detection models are tested using DecisionTree, MLP, RandomForest, XGBoost, ResNet18, and ResNet50 models, respectively. The experimental results are shown in Table 1 on the experimental dataset UNSW-NB15.
[0102] Table 1 Experimental results
[0103]
[0104]
[0105] In Table 1, Precision represents the accuracy, Recall represents the recall, and F1-Score is a weighted average of the accuracy and recall. Experimental results show that the detection method based on MI-GAF, i.e., the above MI-GADF and MI-GASF, of the present invention performs best in terms of accuracy and stability.
[0106] Except for the technical features described in the specification, all of them are known technologies to those skilled in the art. The present invention omits the description of known components and known technologies to avoid redundancy and unnecessary limitation of the present invention. The implementation methods described in the above embodiments do not represent all implementation methods consistent with the present application. On the basis of the technical solution of the present invention, various modifications or variations that can be made by those skilled in the art without creative labor are still within the protection scope of the present invention.
Claims
1. A method for processing time series network traffic data based on multi-instance learning, characterized in that: The steps include: Step 1: Preprocess the network traffic data, extract network traffic features, and organize them into time series feature data; The preprocessing includes: filtering out data related to security incident detection from network traffic data, cleaning noise and redundant information, then extracting features from the cleaned data, standardizing the feature data, and then reorganizing the standardized features into time series data according to timestamps; the extracted features include network flow collection time, source IP address, target IP address, source port, target port, protocol type, and statistical information of network traffic; let the extracted feature dimension be d; Step 2: Instantiate and image-encode the extracted time series feature data, including: (2.1) First, the network traffic data is coarsely divided according to the set time length of the bag, and then each bag is finely divided according to the set time window. It is assumed that the division is k sub-packets, each sub-packet contains all network flow instances in the corresponding time window, and the proportion of malicious traffic in the bag is counted, and a security event label is assigned to the bag; the d-dimensional features of each network flow instance are extracted; (2.2) Then, for each sub-packet contained in each bag, the Simple-MI algorithm is used to calculate the statistical data of all network flow instances of the sub-packet in each feature dimension, and the sub-packet features of the corresponding time window are aggregated. The sub-packet features are The vector of is a set of functions for computing statistics, Representing a collection The number of functions in the bag; then the bag feature is obtained from the sub-bag feature, and the bag feature is The dimension of the bag feature is (2.3) Use the GAF algorithm to construct a multi-channel graph for each bag feature, including: converting each feature dimension of the bag into a channel in the multi-channel graph, using the GAF algorithm to calculate the Gramian matrix of the feature sequence with a length of k under the same dimension, and converting it into an image, converting the bag feature into a channel with a length of k. The image group; Step 3: Build a deep learning model for the target task, convert the real-time collected network traffic data into a multi-channel image sequence according to steps 1 and 2, and input the multi-channel image into the deep learning model for target task detection.
2. The method according to claim 1, characterized in that In step 2, assigning security event labels to the bag includes: for each network flow instance in the bag, if the malicious traffic in the network flow instance exceeds 50%, marking the instance as 1, otherwise marking it as 0; counting the proportion r of network flow instances marked as 1 in the bag j ; If r j ≤0.45, the bag is assigned a label of low risk safety event; If 0.45 <r j <0.75, the bag is assigned a label of medium-risk safety event; If r j ≥0.75, the bag is assigned a label of high risk safety event.
3. The method according to claim 1 or 2, characterized in that: In the step 2, a time window is set according to the time length corresponding to the acquisition frequency, each time window has at least one network flow instance, and all network flow instances in the time window are divided into one sub-packet.
4. The method according to claim 1 or 2, characterized in that: In step 2, the acquisition frequency is set to 1 second, the time window is set to 1 second, and the bag time length is set to 1 minute.
5. The method according to claim 1, characterized in that In step 2, the function set for calculating statistical data is set as follows: For a certain dimension feature of a sub-package, through f mean Calculate the average value of this feature for all network flow instances of this subpacket, through f median Calculate the median value of this feature for all network flow instances of this subpacket, through f sum Calculate the sum of this feature for all network flow instances of this subpacket.
6. The method according to claim 1, characterized in that In the step 2, after obtaining the sub-package features, for each statistical data under each feature dimension, the minimum and maximum values in the bag where the sub-package is located are obtained, and then each feature of the sub-package is standardized.
7. The method according to claim 1, characterized in that In step 2, the Gramian matrix of the feature sequence is calculated using the GAF algorithm and converted into an image, including: First, the eigenvalues in the feature sequence are normalized to the amplitude interval of [-1,1], and the normalized eigenvalues are mapped to the polar coordinate system; Then, GASF and GADF are used to calculate the polar coordinate angles of the eigenvalues of the characteristic sequence, respectively, to form Gramian matrices, which are marked as GASF matrix and GADF matrix. The GASF matrix and GADF matrix are directly imaged as grayscale images or mapped as pseudo-color images.
8. The method according to claim 1, characterized in that In step 3, the input channel parameter of the convolution layer of the first layer of the constructed deep learning model is the number of channels of the multi-channel image converted from the network flow data.
9. The method according to claim 1, characterized in that: In the step 1, the characteristic data is standardized, including: converting the IP address into a unified representation method, and mapping the port number to a standard service type.
Citation Information
Patent Citations
Network encryption traffic classification method and system based on multi-feature learning
CN113037730A
Encrypted traffic classification method based on deep neural network
CN116232696A
Network intrusion detection method fusing TextCNN and GAN
CN117201082A
Intrusion detection system using SVM and method for operating the same
KR1020090079330A
Cited By
Malicious traffic classification method and system of feature fusion network based on gradient sharing
CN120075802A
