Visualization method for network intrusion detection deep learning model

Through the multi-view linkage visualization method for deep learning models for network intrusion detection, the problem of difficulty in analyzing model results and identifying similar samples in the existing technology is solved, and in-depth analysis of model results and feature learning is realized, which improves the trust and optimization of the model ability.

CN119071017APending Publication Date: 2024-12-03SICHUAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411014619.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-26
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

The existing technology is difficult to simultaneously analyze the results of network intrusion detection deep learning models and identify similar samples, and it is impossible to have an in-depth understanding of the working mechanism and feature learning evolution of the model, which limits the optimization and trust of the model.

Method used

Provide a visualization method for deep learning models for network intrusion detection. Through a variety of data visualization methods and interactive linkage analysis methods, including result exploration view, data aggregation view, mutual information view and interactive concept view, helping researchers to perform models, Explore the detection results and working mechanisms of the model in terms of key sample analysis and mechanism understanding.

Benefits of technology

Allow users to freely explore from three levels: the overall detection results of the model, the detection results of attack categories and the detection results of data instances, and analyze the learning evolution of individual sample features and important feature combinations of different layers of the model, improving the model results Trust and optimization insights.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119071017A_ABST
    Figure CN119071017A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of information visualization and visual analysis, in particular to a visualization method for a network intrusion detection deep learning model. Result exploration visual mapping displays the correct prediction number and the error prediction number of the model on each category through a confusion matrix; the data aggregation visualization mapping presents t-SNE dimension reduction results of data samples associated with result overview view confusion matrix cells in the form of scatter diagrams; the mutual information visualization mapping displays the characteristics learned by each layer of the DBN model and the cross-layer sample processing of the model; the interaction concept visualization maps the independent utility of the encoded features and the interaction utility between the features. According to the method, the multi-view linkage and interaction means are combined, the visual layout is realized based on the visual mapping, and researchers can better know the advantages and disadvantages of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of information visualization and visual analysis, and specifically to a visualization method for a deep learning model for network intrusion detection. Background Art

[0002] The rapid development of the Internet has brought convenience to users, but it has also brought severe network security challenges. Criminals use various means to conduct vulnerability scanning, denial of service, botnet and other attacks to destroy systems, steal information and obtain illegal profits, which not only causes huge economic losses to individuals and enterprises, but also poses a serious threat to the information security of the entire society. Network intrusion detection technology is a network security protection technology that identifies abnormal network traffic patterns by analyzing network traffic characteristics, and promptly detects and prevents potential intrusions. It is an important research direction in the field of network security.

[0003] With the development of network technology and the iteration of attack methods, network intrusion detection technology based on deep learning models has become a hot topic of current research due to its excellent feature extraction capabilities and higher accuracy when processing large-scale data. However, due to the black-box nature of deep learning models, researchers cannot accurately understand the information extracted from the data and the patterns learned by the model, nor can they verify the model's decisions based on professional knowledge, which limits the application of deep learning models in the field of network intrusion detection. Therefore, researchers in the field of network security need a method to explore the detection results of the model and analyze its working mechanism to reveal the advantages and disadvantages of the model and increase researchers' trust in the model results.

[0004] At present, relevant studies have used visualization methods to perform visual analysis on machine learning models, assisting users in analyzing the results of the models and understanding the principles of the models. These studies present the decision-making mechanism within the model through visual coding, and help users explore the model at multiple levels from the whole to the part through interactive design, solving the difficulties faced by researchers in the field of network security in analyzing network intrusion detection models based on deep learning technology. However, these methods cannot identify similar samples while performing multi-level analysis of model results. In addition, network security analysts usually need to analyze the features of the data subsets or data instances of interest, and analyze the detection bias of samples from the perspective of feature values ​​and feature patterns. However, existing studies mainly focus on the impact of feature importance on model performance, and lack comparison of feature values ​​and feature patterns of different data subsets. Summary of the invention

[0005] In view of the above problems, the purpose of the present invention is to provide a visualization method for deep learning models of network intrusion detection, which can provide users with a variety of data visualization methods and interactive linkage analysis methods, and help researchers in the field of network security to explore the detection results of the model and deeply analyze its working mechanism from three aspects: model performance overview, key sample analysis, and model mechanism understanding, so as to reveal the advantages and limitations of the deep learning model of intrusion detection and obtain important insights for further optimization of the model. The technical solution is as follows:

[0006] A visualization method for a deep learning model for network intrusion detection includes the following steps:

[0007] S1: Data acquisition and processing

[0008] Obtain the existing network security data set as experimental data, perform data preprocessing and train the DBN (Deep Belief Network) model based on the existing open source code and hyperparameters, and then save the training result data to draw a visualization view;

[0009] S2: Visual Mapping

[0010] Visually map the data obtained in step S1 through the visual channel:

[0011] Design result exploration view: Use the navigation bar to display the overall evaluation indicators of the model, use the confusion matrix to display the number of correct predictions and incorrect predictions of the model for each category, and support users to conduct interactive exploration and analysis on a class of samples of interest;

[0012] Design data aggregation view: Use scatter plots to present the dimensionality reduction results of data samples associated with the model result exploration view cells, helping users find similar samples and special samples;

[0013] Design mutual information view: The mutual information view includes the parallel heat map above and the line graph below; the parallel heat map shows the layer-by-layer reasoning process of the DBN model, showing the learning of the features of the DBN model from the first layer to the last layer of the neural network; the line graph shows the learning evolution of each feature on different layers of the DBN model;

[0014] Design interactive concept views: The interactive concept view includes the arc association diagram above and the heat matrix diagram below; the arc association diagram encodes the independent utility of features and the interactive utility between features, helping users understand the important attack patterns learned by the model; the heat matrix diagram displays the specific utility values ​​of each feature;

[0015] S3: Visualization layout and implementation

[0016] Visualize and layout the visual modules mapped in S2:

[0017] In the result exploration view, the overall evaluation index data of the model is displayed in the top navigation bar; the rows of the confusion matrix represent the actual categories, the columns represent the predicted categories, the values ​​and colors in the matrix cells represent the number of predictions made by the model on each category, and a color legend is placed next to the confusion matrix to indicate the correspondence between the number of samples and the color;

[0018] In the data aggregation view, the samples in the cells selected by the user in the result exploration view are projected into a scatter plot using the t-SNE dimensionality reduction algorithm. The sample points of different prediction situations are coded with scatter color. The relative position relationship between different samples reflects their similarities and differences in the original high-dimensional space.

[0019] In the mutual information view, each column of the parallel heat map encodes the learning of different features by different layers of the DBN model from top to bottom. Different columns encode N different features from left to right. Directly below each column of features, a broken line is used to indicate how the model retains its information when the feature passes through each layer of the DBN model.

[0020] In the interactive concept view, the pie chart with a center mark representing the feature utility is evenly distributed at the top of the view, and a Bezier curve representing the feature interaction relationship is drawn below it; the heat matrix below sorts the interactive utility values ​​from small to large and is laid out in order below the arc association diagram; S4: Interaction Design

[0021] In the result exploration view, users can evaluate the model's performance on different categories through the confusion matrix, and select specific cells of the confusion matrix by clicking the mouse to update the content of the data aggregation view in a linked manner to jointly analyze data; the data aggregation view allows users to select data points of interest by lassoing, and further view the corresponding mutual information view and interactive concept view content of the selected sample data.

[0022] Furthermore, in step S1, data acquisition and processing are specifically as follows:

[0023] S11: Use the existing CICIDS2017 dataset as experimental data and perform the following processing on the dataset: dataset merging, data cleaning, dataset partitioning, and data conversion;

[0024] S12: Delete the features in the data set whose standard deviation is less than the set error value, and delete one of the features whose Pearson correlation coefficient between two features is greater than the set correlation value;

[0025] S13: Reorganize the attack types, merge attack classes with similar characteristics and behaviors into new attack classes, and increase the proportion of minority class samples in the entire dataset;

[0026] S14: Conduct visual analysis research and retrain the DBN model, and conduct subsequent analysis based on the training results.

[0027] Furthermore, in step S2, the visual mapping specifically includes:

[0028] S21: In the result exploration view, set the macro average F1 micro , Micro-average F1 macro , weighted average F1 weight The values ​​are displayed in the navigation bar at the top; the rows of the confusion matrix in the result exploration view represent the actual categories, which represent the label types from top to bottom; the columns represent the predicted categories, which represent the label types in the same order from left to right; a color legend is placed next to the confusion matrix to indicate the correspondence between the number of samples and the color;

[0029] S22: The data aggregation view presents the dimensionality reduction results of the data samples associated with the confusion matrix cells in the form of scatter plots. The scatter plots are reduced in dimension using the t-SNE method. The colors of the sample points in the view encode the different predictions of the sample points.

[0030] S23: The mutual information view encodes the learning of different features by neural networks at different layers of the DBN model from top to bottom, and encodes different features from left to right. The view uses linear gradient colors to map the degree to which neural networks at different layers forget feature information during the learning process of the DBN model. Directly below each column of features, a broken line is used to indicate how the model retains information about the feature when it passes through each layer of the DBN model.

[0031] S24: The interactive concept view includes a pie chart with a center mark. Each pie chart represents a feature. The outer layer encodes the ratio of positive to negative values ​​in the interactive utility value between features. The inner layer is a circular mark, marking whether the corresponding feature has independent utility in model prediction. The feature pie charts with interactive utility are connected by Bezier curves. The thickness of the Bezier curve indicates the value of the interactive utility. The matrix heat map at the bottom of the view encodes the specific utility value of the feature.

[0032] Furthermore, in step S3, the data aggregation visualization layout and implementation in the visualization layout implementation are specifically as follows:

[0033] S311: Data Sampling

[0034] S311a: Determine the sampling upper limit: Analyze the dimensionality reduction results of the sample number, and determine the sample number that can maintain the representativeness of the data as the sampling upper limit;

[0035] S311b: Determine the sampling lower limit: calculate the minimum value, upper quartile, median, lower quartile and maximum value of the data based on the number of cells in the confusion matrix, obtain the distribution of the number of data samples, and determine the sampling lower limit based on the calculation results;

[0036] S312: Sample point projection implementation

[0037] S312a: Calculate the similarity of sample data in high-dimensional space

[0038] Sample x i and x j The similarity between j|i The calculation formula is as follows:

[0039]

[0040] In the formula, σ i According to the sample x i The local density adaptive Gaussian kernel width; x k To divide the sample x in the high-dimensional space i Other samples outside

[0041] Similarly, calculate the sample x j and x i The similarity between i|j ;

[0042] S312b: Define the sample x in the high-dimensional space by averaging i and x j The symmetric similarity p between ij , the calculation method is as follows:

[0043]

[0044] Where N0 is the total number of samples;

[0045] S312c: Calculate the similarity between samples in low-dimensional space

[0046] In low-dimensional space, use t distribution to define sample y i and j The similarity between ij , the specific calculation formula is as follows:

[0047]

[0048] Among them, y k and l are any two unequal samples in the low-dimensional space;

[0049] S312d: Minimize the KL divergence between high-dimensional space and low-dimensional space

[0050] Define KL divergence as the objective function C, and minimize the objective function C by optimizing the coordinates in the low-dimensional space to obtain the final dimensionality reduction result; the calculation formula of the objective function C is as follows:

[0051]

[0052] Furthermore, in step S3, the mutual information visualization layout and implementation in the visualization layout implementation are specifically as follows:

[0053] S321: Prepare input data, including the data sample x to be explained and the forward propagation function φ of the nth layer of the DBN model to be explained n And training data set D;

[0054] S322: Calculate the regularization term: Use the dataset D and the forward propagation function φ of the nth layer of the DBN model to be explained n To calculate the regularization term, that is, to calculate the standard deviation of the hidden state of the model;

[0055] S323: Regularization term, forward propagation function φ of the nth layer n , take the data sample x to be explained as a parameter, initialize an Interpreter class, that is, initialize an interpreter of the nth layer of the explanation model;

[0056] S324: Optimize the interpreter and obtain the contribution of each feature of the data sample x to the hidden state of the nth layer of the model;

[0057] S325: Repeat steps 21 to 24 until the explanation results of each feature of the data sample x for each level of the model are obtained.

[0058] Furthermore, in step S3, the interactive concept visualization layout and implementation in the visualization layout implementation are specifically as follows:

[0059] S331: Interactive Concept Learning:

[0060] S331a: Prepare input data, including data samples x to be explained, models f to be explained, and training data sets D;

[0061] S331b: Initialize the baseline value: Set the baseline value r i Initialize to the mean value of variable i in all samples, and then r i Constrained within a relatively small range, namely ||r i -r i init||≤τ; where τ is the product of the standard deviation of variable i in all samples and the boundary threshold;

[0062] S331c: define a masking function: replace the masked features with the corresponding values ​​in the baseline, while the unmasked features keep the original values ​​in the data sample;

[0063] S331d: Compute interaction utility: Decompose the inference score of the deep learning model into the sum of all potential interaction effects as shown in the following formula:

[0064]

[0065] Where N represents all the features in the data sample to be explained, S represents all non-empty subsets of the features, I(S) represents the interactive utility of the features in S, and the calculation formula of I(S) is as follows:

[0066]

[0067] Where T is all subsets of S; x T is a mask sample, indicating that the input unit of sample x outside the set T is blocked, while the input unit in the set T remains unchanged, f(x T ) means that the neural network is in the occluded sample x T Output on;

[0068] S331e: Learn the best baseline value to further improve the sparsity of interaction patterns, thereby enhancing the simplicity of explanations;

[0069] S331f: Save the result for view drawing;

[0070] S332: Arc-related graph glyph implementation

[0071] The interactive concept visualization view glyph consists of two parts: a ring pie chart with a center mark and a Bezier curve chart; each ring pie chart represents a feature, the inner circular mark is based on the color coding whether the feature has independent utility in the model prediction, and the outer ring is calculated based on the positive and negative ratios in the interactive utility value of the feature. The calculation formula for the circular arc angle of the positive and negative utility values ​​of each feature is as follows:

[0072] θ k =2π*p (7)

[0073] θ p =2π*(1-p) (8)

[0074] Among them, θ k is the circular arc angle of each feature’s positive utility value, θ pis the circular arc angle of the negative utility value of each feature, and p represents the proportion of positive utility values ​​in the calculation results of the feature interaction concept;

[0075] The Bezier curve is used to represent the interaction utility between two features. The starting point and the end point of the Bezier curve are calculated based on the center coordinates of the annular pie charts corresponding to the two features. The coordinates of the control point are adjusted according to the distance of the annular pie charts and the height of the view to control the height of the Bezier curve.

[0076] First, calculate the distance between the two features, that is, the distance between the two doughnut pie charts. The specific calculation formula is as follows:

[0077]

[0078] Among them, (sourceX, sourceY), (targetX, targetY) are the coordinate positions of the two characteristic donut pie charts. Then calculate the height of the Bezier curve. The specific calculation formula is as follows:

[0079] linksHeight=min(distance / 2+height / 1.4) (10)

[0080] Among them, height is the height of the entire interactive concept view;

[0081] Use a cubic Bezier curve to connect two feature donut pie chart nodes in sequence; the four points needed to draw a cubic Bezier curve are: the starting point startPoint, with a coordinate position of (sourceX, sourceY), the end point endPoint, with a coordinate position of (targetX, targetY), and the control points controlPoint1 and controlPoint2, where:

[0082] controlPoint1=(sourceX,maxY+linksHeight) (11)

[0083] controlPoint2=(targetX,maxY+linksHeight) (12)

[0084] Among them, maxY is the larger value of sourceY and targetY;

[0085] The curve width is encoded according to the absolute value of the interaction utility, and the curve width is calculated as follows:

[0086] stroke_width =max(min(|link_interaction|), 10), 1) (13)

[0087] Among them, link_interaction is the interactive utility value of the feature;

[0088] S333: Draw a heat matrix diagram

[0089] Sort the obtained interaction utility values, and then draw the required rectangles in turn, fill them with the corresponding color coding scheme according to the size of the interaction utility value, and create a linear gradient from color 1 to white for mapping for interaction utility values ​​between negative values ​​and 0; create a linear gradient from white to color 2 for mapping for interaction utility values ​​between 0 and positive values; finally, display the corresponding interaction utility value on the corresponding rectangle.

[0090] The beneficial effects of the present invention are:

[0091] 1) In view of the problem that existing methods are difficult to simultaneously analyze model results and identify similar samples, the method of the present invention allows users to freely explore from three levels: the overall detection results of the model, the detection results of each attack category, and the detection results of the data instance, and encodes the similarities between data instances when analyzing specific data instances.

[0092] 2) In view of the problem that existing methods are difficult to explain the learning evolution of a single sample feature of the model and the feature combination that has a significant impact on the model results, the method of the present invention allows the user to analyze the learning evolution of a single sample feature at different layers of the model, and discover the feature combination that has a significant impact on the model results. BRIEF DESCRIPTION OF THE DRAWINGS

[0093] Figure 1 A framework for deep learning model visualization methods for network intrusion detection.

[0094] Figure 2 Schematic diagram of visual encoding and visualization layout in the result overview view of the present invention.

[0095] Figure 3 It is a schematic diagram of visual encoding and visualization layout in the data aggregation view of the present invention.

[0096] Figure 4 It is a schematic diagram of the visual encoding and visualization layout in the mutual information view of the present invention.

[0097] Figure 5 It is a schematic diagram of the visual encoding and visualization layout in the view of the interactive concept in the present invention. DETAILED DESCRIPTION

[0098] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0099] The present invention realizes a deep learning model visualization method for network intrusion detection through novel visualization design and multi-view linkage strategy. Figure 1 As shown, it includes: data acquisition and processing, visual mapping, visual layout and implementation, and interactive design, as follows:

[0100] 1. Data Collection and Preprocessing

[0101] 1) Data acquisition and preprocessing:

[0102] The CICIDS2017 dataset created by the Canadian Institute for Cyber ​​Security in 2017 is used, including 1 benign type and 14 attack types, with a total of 2,830,743 data samples; the dataset is merged, cleaned, divided, converted, and balanced. In addition, feature selection and attack type reorganization are performed on the dataset. Since some feature values ​​in the CICIDS2017 dataset have basically not changed in the entire dataset, and some feature values ​​are highly correlated, the features with a standard deviation less than 0.01 and one of the features with a Pearson correlation coefficient between two features greater than 0.98 are deleted. After feature selection, there are 49 feature columns and 1 label column left in the CICIDS2017 dataset. And refer to Panigrahi R, Borah SA detailed analysis of CICIDS2017 dataset for designing Intrusion Detection Systems[J].International Journal of Engineering & Technology, 2018, 7(3.24):479-482. to reorganize the attack types, merge the minority attack classes with similar characteristics and behaviors into new attack classes, and increase the proportion of minority class samples in the entire dataset. The specific attack type reorganization scheme is shown in Table 1.

[0103] Table 1 Attack type reorganization scheme

[0104]

[0105] 2) DBN model preparation

[0106] Through the two stages of pre-training and model fine-tuning, the DBN deep learning model for analysis is trained using the CICIDS2017 dataset. The trained model parameters (weight matrix and bias term) and the results of the model test are saved for use in the subsequent visualization module.

[0107] 2. Visual Mapping

[0108] 1) Results Overview View Visual Mapping

[0109] like Figure 2 As shown, the result overview view displays the model's F1 micro 、F1 macro 、F1 weight The overall evaluation index and the confusion matrix show the prediction of the model on each category. The rows of the confusion matrix represent the actual categories, which are Benign, Botnet ARES, Brute Force, DoS / DDoS, PortScan, and Web Attack from top to bottom; the columns represent the predicted categories, which are Benign, Botnet ARES, Brute Force, DoS / DDoS, PortScan, and Web Attack from left to right. The confusion matrix shows the prediction of the model on each category. The elements on the main diagonal (a diagonal from the upper left to the lower right) represent the number of samples correctly classified, while the elements on the non-main diagonal represent the number of samples misclassified. The value of each cell in the confusion matrix represents the number of correct predictions and wrong predictions of the model on each category. The color encodes the value size in different cells. Dark blue represents the cell with the largest value, light blue represents the cell with the smallest value, and the cells between the maximum and minimum values ​​are linearly mapped with gradient colors between the two colors. The text in the confusion matrix is ​​displayed in black by default; the text with a cell value of more than 300,000 is displayed in white to avoid the problem of unclear text display due to insufficient color contrast. At the same time, the model result overview view is the entrance to the entire visual analysis process. When the mouse clicks to select a specific cell in the confusion matrix, the content in the data aggregation view will be updated in a linked manner.

[0110] 2) Data aggregation visualization mapping

[0111] like Figure 3 As shown, the method is presented in the basic form of a scatter plot, which presents the dimensionality reduction results of the data samples associated with the confusion matrix cells.

[0112] Position: Each point in the scatter plot represents a data sample. The position coordinates of each point are calculated using the t-SNE dimensionality reduction algorithm, which maps high-dimensional data samples to specific locations in two-dimensional space. The relative position relationship between different samples reflects their similarities and differences in the original high-dimensional space.

[0113] Color: When you select a cell of interest on a non-main diagonal line in the confusion matrix of the model result overview view, this view will sample the two types of correctly predicted samples on the main diagonal line associated with the cell, and then perform t-SNE dimensionality reduction with the data samples associated with the selected cell to observe the similarity between the incorrectly predicted samples in the cell and the correctly predicted samples in the cell. The dimensionality reduction results of the data samples corresponding to the cell selected by the mouse are encoded in green, corresponding to the legend "Selected"; the dimensionality reduction results of the correctly predicted data samples corresponding to the true label of the selected cell are encoded in red, corresponding to the legend "Class1"; the dimensionality reduction results of the correctly predicted data samples corresponding to the prediction results of the selected cell are encoded in blue, corresponding to the legend "Class2". In addition, since the main diagonal of the confusion matrix represents the number of samples correctly classified by the model during the prediction process, when you select a cell of interest on the main diagonal in the result overview visualization based on the confusion matrix, the "Class1" and "Class2" of this visualization are empty, and only "Selected" has results.

[0114] 3) Mutual Information Visualization Mapping

[0115] like Figure 4 As shown, the mapping encoding of this method includes modules such as spatial position, color, and shape.

[0116] Position: The view encodes the learning of different features by different layers of the DBN model from top to bottom, and encodes 49 different features of feature selection from left to right.

[0117] Color: The processing of the DBN model is regarded as a process of forgetting input information layer by layer. This view uses a linear gradient from dark blue to light blue to map the degree to which different layers of neural networks forget feature information during the DBN model learning process. The lighter the color, the more the model forgets the feature, and the darker the color, the more the model tends to retain the feature information.

[0118] Shape: Directly below each column of features, a broken line is used to indicate how the model retains information about the feature as it passes through each layer of the DBN model. When the broken line trend fluctuates and there is no obvious upward or downward trend, it indicates that the model alternately forgets and retains information about the feature during the learning process; when the broken line shows an upward trend, it means that the model is more inclined to retain the information about the feature; and when the broken line shows a downward trend, it means that the model is more inclined to forget the information about the feature.

[0119] 4) Interactive concept visualization mapping

[0120] like Figure 5As shown in the figure, the current visualization method is divided into two parts, the top circular correlation diagram encodes the independent utility of features and the interactive utility between features, and the heat matrix diagram below shows the specific utility value of each feature. This visualization design mainly uses three visual channels, shape, color, and position, to encode the interactive concept of the model.

[0121] Shape: The present invention designs a ring-shaped pie chart with a center mark. Each ring-shaped pie chart represents a feature. The outer layer encodes the ratio of positive to negative values ​​in the interaction utility, and the inner layer is a circular mark, marking whether the feature has independent utility in the model prediction. This visualization design also connects the features with interaction utility through Bezier curves, and uses the thickness of the Bezier curve to represent the numerical value of the interaction utility. The larger the absolute value of the interaction utility between features, the thicker the Bezier curve, and the smaller the absolute value, the thinner the Bezier curve.

[0122] Color: In the arc association diagram, blue is used to encode negative values ​​of interaction utility, red is used to encode positive values ​​of interaction utility, and gray is used to encode the current feature has no utility. In the heat matrix diagram, for interaction utility values ​​between negative and 0, a linear gradient from dark blue to white is created for mapping; for interaction utility values ​​between 0 and positive, a linear gradient from white to red is created for mapping.

[0123] Position: In the arc association diagram, the pie chart with a center mark representing the feature utility is evenly distributed at the top of the view, and a Bezier curve representing the feature interaction relationship is drawn below it. In the heat matrix diagram, the interaction utility values ​​are sorted from small to large and laid out in order below the arc association diagram.

[0124] 3. Visual Layout Implementation

[0125] 1) Data aggregation visualization layout and implementation

[0126] a) Data sampling:

[0127] Step a1: Determine the sampling upper limit. Since the original data has a large number of samples, directly performing dimensionality reduction analysis on it requires a large amount of computing resources, which increases computing time and cost, increases the cognitive burden of users, and affects front-end performance. In practical applications, the characteristics and distribution of the overall data can usually be represented by an appropriate amount of samples. The method of the present invention analyzes and discusses the dimensionality reduction results with a sample size of 1000-10000, and finds that when 3000 samples are reduced in dimension, the results can maintain the representativeness of the data to a certain extent. As the amount of data increases, the dimensionality reduction results generated by t-SNE will become more dense and complex, and its visualization effect may become chaotic and crowded, making it difficult for users to obtain clear patterns and relationships from the view. Therefore, the present invention sets the sampling upper limit to 3000, and after being divided into three categories of "Selected", "Class1" and "Class2", the sampling upper limit of each category is 1000.

[0128] Step a2: Determine the sampling lower limit. In the confusion matrix, there are large differences in the number of samples in different cells, and the extreme values ​​are more prominent, and there are many zero values. When the user clicks on a single-digit cell, that is, when "Selected" is a single digit, since "Class1" and "Class2" have sampled a total of 2000 samples, the data related to "Selected" will become less noticeable. In order to improve the user experience and ensure that users can effectively discover and obtain the required information, the method of the present invention calculates the minimum value, upper quartile, median, lower quartile, and maximum value of the data based on the number of cells in the confusion matrix, understands the distribution of the number of data samples, and avoids too many or too few samples affecting the user experience and analysis effect. The calculation results are 0, 0, 2, 216 (215.75 rounded), and 403946, respectively. After communicating with experts in the same field, the sampling lower limit is set to 216. That is, when "Selected" has less than 216 samples, all samples in "Selected" are subjected to dimensionality reduction, while samples in "Class1" and "Class2" are subjected to dimensionality reduction after 216 samples are sampled.

[0129] b) Sample point projection implementation

[0130] In order to preserve the local structure and nonlinear relationship between data, visualize the clustering structure of data, and observe the similarity of data samples, we use the t-SNE dimensionality reduction algorithm to reduce the data samples to two dimensions. The specific steps are as follows:

[0131] Step b1: Calculate the similarity of sample data in high-dimensional space. In this step, we calculate the similarity of each pair of samples x i and x j The similarity between j|iThe similarity calculation is based on the Gaussian kernel function, and the Gaussian kernel width is adaptively determined according to the local density of the sample, which can better capture the local structural information. The specific calculation formula is as follows:

[0132]

[0133] In the formula, σ i According to the sample x i The local density adaptive Gaussian kernel width. k To divide the sample x in high-dimensional space i Other samples outside

[0134] Similarly, calculate the sample x j and x i The similarity between i|j .

[0135] Step b2: Define the symmetric similarity between samples in the high-dimensional space. Since the similarity p calculated in the previous step i|j is asymmetric, so it needs to be converted into a symmetric similarity. Here, the average method is used to define the sample x in the high-dimensional space i and x j The symmetric similarity p between ij , the calculation method is as follows:

[0136]

[0137] Where N0 is the total number of samples;

[0138] Step b3: Calculate the similarity between samples in low-dimensional space. In low-dimensional space, use t distribution to define sample y i and j The similarity between ij The t distribution is used because it has a heavier tail and can better capture the local structure of samples in high-dimensional space. The specific calculation formula is as follows:

[0139]

[0140] Among them, y k and l are any two unequal samples in the low-dimensional space.

[0141] Step b4: Minimize the KL divergence between the high-dimensional space and the low-dimensional space. Finally, define the KL divergence as the objective function C, which measures the difference in sample similarity between the high-dimensional space and the low-dimensional space. Minimize this objective function by optimizing the coordinates in the low-dimensional space to obtain the final dimensionality reduction result. The entire optimization process is usually iteratively solved using the gradient descent method until convergence, so that the coordinates of each sample in the two-dimensional low-dimensional space are obtained as the output result of the t-SNE algorithm. The objective function C calculation formula is as follows:

[0142]

[0143] 2) Mutual information visualization layout and implementation

[0144] Step 21: Prepare input data, including the data sample x to be explained and the forward propagation function φ of the nth layer of the DBN model to be explained n And the training dataset D.

[0145] Step 22: Calculate the regularization term. Using the dataset D and the forward propagation function φ of the nth layer of the DBN model to be explained n To calculate the regularization term, that is, to calculate the standard deviation of the model's hidden state.

[0146] Step 23: Regularization term, forward propagation function φ of the nth layer n , the data sample x to be explained is used as a parameter to initialize an Interpreter class, that is, to initialize an interpreter of the nth layer of the explanation model.

[0147] Step 24: Optimize the interpreter using Interpreter.optimize method.

[0148] Step 25: Use the Interpreter.get_sigma method to get the interpreter’s contribution of each feature of the data sample x to the hidden state of the model’s nth layer.

[0149] Step 26: Repeat steps 21 to 25 until the explanation results of each feature of the data sample x at each level of the model are obtained for view drawing.

[0150] 3) Interactive concept visualization layout and implementation

[0151] a) Interactive Concept Learning:

[0152] Step a1: Prepare input data, including the data sample x to be explained, the model f to be explained, and the data set D.

[0153] Step a2: Initialize the baseline value. Set the baseline value r iInitialize to the mean value of variable i in all samples, and then r i Constrained within a relatively small range, namely ||r i -r i init ||≤τ. τ is the product of the standard deviation of variable i in all samples and the boundary threshold, and the boundary threshold is the default value of the algorithm.

[0154] Step a3: Define the masking function. The masked features are replaced with the corresponding values ​​in the baseline, while the unmasked features retain the original values ​​in the data sample.

[0155] Step a4: Calculate interaction utility. The inference score of the deep learning model can be decomposed into the sum of all potential interaction effects, as shown in formula (5):

[0156]

[0157] Where N represents all the features in the data sample to be explained, S represents all non-empty subsets of the features, I(S) represents the interactive utility of the features in S, and the calculation formula of I(S) is as follows:

[0158]

[0159] where T is all subsets of S. T is a mask sample, indicating that the input unit of sample x outside the set T is blocked, while the input unit in the set T remains unchanged, f(x T ) means that the neural network is in the occluded sample x T The output on .

[0160] Step a5: Learn the best baseline value to further improve the sparsity of the interaction pattern, thereby enhancing the simplicity of the explanation. Use the open source AndBaselineSparsifier method of Ren J, Li M, Chen Q, et al.Defining and quantifying the emergence ofsparse concepts in dnns[C] / / Proceedings of the IEEE / CVF Conference onComputer Vision and Pattern Recognition.2023:20280-20289. to learn the best baseline value and use the remove_noisy_greedy method to retain significant causal patterns.

[0161] Step a6: Save the result for view drawing.

[0162] b) Arc-related graph glyph implementation

[0163] The interactive concept visualization view glyph consists of two parts: a ring pie chart with a center mark and a Bezier curve chart. Each ring pie chart represents a feature. The inner circular mark is based on the color coding of whether the feature has independent utility in the model prediction. The outer ring is calculated based on the positive and negative ratios in the interactive utility value of the feature. The calculation formula for the positive and negative utility values ​​of each feature is as follows:

[0164] θ k =2π*p (7)

[0165] θ p =2π*(1-p) (8)

[0166] Among them, θ k is the circular arc angle of each feature’s positive utility value, θ p is the circular arc angle of the negative utility value of each feature, and p represents the proportion of positive utility values ​​in the calculation results of feature interaction concepts.

[0167] The Bezier curve is used to represent the interaction between two features. The starting point and end point of the Bezier curve are calculated based on the center coordinates of the annular pie charts corresponding to the two features. The coordinates of the control point can be adjusted according to the distance of the annular pie charts and the height of the view to control the height of the Bezier curve.

[0168] First, calculate the distance between two features. The specific calculation formula is as follows:

[0169]

[0170] Among them, (sourceX, sourceY), (targetX, targetY) are the coordinate positions of the two characteristic donut pie charts. Then the height of the Bezier curve is calculated. The maximum height does not exceed 50. The specific calculation formula is as follows:

[0171] linksHeight=min(distance / 2+height / 1.4) (10)

[0172] Among them, distance is the distance between the two feature donut pie charts calculated previously, and height is the height of the entire interactive concept view.

[0173] Use a cubic Bezier curve to connect two feature donut pie chart nodes in sequence. Four points are needed to draw a cubic Bezier curve, namely: the starting point startPoint, the coordinate position is (sourceX, sourceY), the end point endPoint, the coordinate position is (targetX, targetY), and the control points controlPoint1 and controlPoint2, where:

[0174] controlPoint1=(sourceX,maxY+linksHeight) (11)

[0175] controlPoint2=(targetX,maxY+linksHeight) (12)

[0176] Among them, maxY is the larger value of sourceY and targetY, which ensures that the curve will not pass through the element. linksHeight is the previously calculated link line height, which is used to control the height of the curve.

[0177] The curve width is encoded according to the absolute value of the interaction utility. The larger the absolute value, the wider the curve. The maximum width does not exceed 10 pixels. The curve width calculation formula is as follows:

[0178] stroke_width =max(min(|link_interaction|), 10), 1) (13)

[0179] |link_interaction| calculates the absolute value of link_interaction to ensure that the line width is positive regardless of whether link_interaction is positive or negative. min(|link_interaction|,10) limits the value of |link_interaction| to less than 10 to prevent the line from being too thick and affecting the visual effect. max(min(|link_interaction|),10),1) further limits the calculated result to between 1 and 10 to ensure that the line width is at least 1 pixel to avoid being too thin to be seen.

[0180] c) Draw a heat matrix diagram.

[0181] In the heat matrix diagram, the obtained interaction utility values ​​are sorted, and then the required rectangles are drawn in sequence. The corresponding color coding scheme is used to fill them according to the size of the interaction utility value. For interaction utility values ​​between negative values ​​and 0, a linear gradient from dark blue to white is created for mapping; for interaction utility values ​​between 0 and positive values, a linear gradient from white to red is created for mapping. Finally, the corresponding interaction utility value is displayed on the corresponding rectangle.

[0182] 4. Interaction Design

[0183] The confusion matrix in the result overview view supports selecting specific cells by clicking the mouse, and the content of the data aggregation view will be updated accordingly. The data aggregation view is associated with the mutual information visualization and interactive concept visualization through lasso and click selection. When the user uses the lasso to select some data points in this view, the mutual information visualization and interactive concept visualization views will be linked to update their content to the feature information learned by each layer of the model corresponding to these data points. In the interactive concept visualization view, when the user hovers over the pie chart of interest, the current pie chart and the pie charts of other features that interact with the feature corresponding to the pie chart are highlighted, as well as the Bezier curve representing the size of the interactive utility between them. At the same time, the name of the currently selected feature is displayed at the top of the view. After the mouse is moved away, the original visual encoding can be restored. The user can also keep the highlighting state by clicking the mouse, and restore it by clicking again. When the user hovers over the rectangle in the heat matrix diagram, the rectangle is highlighted with a red border, and the interactive utility represented by the rectangle is highlighted in the arc association diagram. At the same time, the names of the two features with the interactive utility are displayed at the top of the view. When the user moves the mouse away, the original visual encoding is restored. The user can keep the highlight state by clicking the mouse, and restore it by clicking again.

Claims

1. A visualization method for deep learning models of network intrusion detection, characterized in that: The following steps are involved: S1: Data acquisition and processing Obtain existing network security data sets as experimental data, perform data preprocessing and train DBN models based on existing open source codes and hyperparameters, and then save the training result data to draw visualization views; S2: Visual Mapping Visually map the data obtained in step S1 through the visual channel: Design result exploration view: Use the navigation bar to display the overall evaluation indicators of the model, use the confusion matrix to display the number of correct predictions and incorrect predictions of the model for each category, and support users to conduct interactive exploration and analysis on a class of samples of interest; Design data aggregation view: Use scatter plots to present the dimensionality reduction results of data samples associated with the model result exploration view cells, helping users find similar samples and special samples; Design mutual information view: The mutual information view includes the parallel heat map above and the line graph below; the parallel heat map shows the layer-by-layer reasoning process of the DBN model, showing the learning of the features of the DBN model from the first layer to the last layer of the neural network; the line graph shows the learning evolution of each feature on different layers of the DBN model; Design interactive concept views: The interactive concept view includes the arc association diagram above and the heat matrix diagram below; the arc association diagram encodes the independent utility of features and the interactive utility between features, helping users understand the important attack patterns learned by the model; the heat matrix diagram displays the specific utility values ​​of each feature; S3: Visualization layout and implementation Visualize and layout the visual modules mapped in S2: In the result exploration view, the overall evaluation index data of the model is displayed in the top navigation bar; the rows of the confusion matrix represent the actual categories, the columns represent the predicted categories, the values ​​and colors in the matrix cells represent the number of predictions made by the model on each category, and a color legend is placed next to the confusion matrix to indicate the correspondence between the number of samples and the color; In the data aggregation view, the samples in the cells selected by the user in the result exploration view are projected into a scatter plot using the t-SNE dimensionality reduction algorithm. The sample points of different prediction situations are coded with scatter color. The relative position relationship between different samples reflects their similarities and differences in the original high-dimensional space. In the mutual information view, each column of the parallel heat map encodes the learning of different features by different layers of the DBN model from top to bottom. Different columns encode N different features from left to right. Directly below each column of features, a broken line is used to indicate how the model retains its information when the feature passes through each layer of the DBN model. In the interactive concept view, the annular pie charts with center marks representing the feature utility are evenly distributed at the top of the view, and Bezier curves representing the feature interaction relationship are drawn below them; The heat matrix diagram below sorts the interaction utility values ​​from small to large and is laid out in order below the arc association diagram; S4: Interaction Design In the result exploration view, users can evaluate the model's performance on different categories through the confusion matrix, and select specific cells of the confusion matrix by clicking the mouse to update the content of the data aggregation view in a linked manner to jointly analyze data; the data aggregation view allows users to select data points of interest by lassoing, and further view the corresponding mutual information view and interactive concept view content of the selected sample data.

2. The visualization method for deep learning model for network intrusion detection according to claim 1 is characterized in that: In step S1, data acquisition and processing are specifically as follows: S11: Use the existing CICIDS2017 dataset as experimental data and perform the following processing on the dataset: dataset merging, data cleaning, dataset partitioning, and data conversion; S12: Delete the features in the data set whose standard deviation is less than the set error value, and delete one of the features whose Pearson correlation coefficient between two features is greater than the set correlation value; S13: Reorganize the attack types, merge attack classes with similar characteristics and behaviors into new attack classes, and increase the proportion of minority class samples in the entire dataset; S14: Conduct visual analysis research and retrain the DBN model, and conduct subsequent analysis based on the training results.

3. The visualization method for deep learning model for network intrusion detection according to claim 1 is characterized in that: In step S2, the visual mapping specifically includes: S21: In the result exploration view, set the macro average F1 micro , Micro-average F1 macro , weighted average F1 weight The values ​​are displayed in the navigation bar at the top; the rows of the confusion matrix in the result exploration view represent the actual categories, which represent the label types from top to bottom; the columns represent the predicted categories, which represent the label types in the same order from left to right; a color legend is placed next to the confusion matrix to indicate the correspondence between the number of samples and the color; S22: The data aggregation view presents the dimensionality reduction results of the data samples associated with the confusion matrix cells in the form of scatter plots. The scatter plots are reduced in dimension using the t-SNE method. The colors of the sample points in the view encode the different predictions of the sample points. S23: The mutual information view encodes the learning of different features by neural networks at different layers of the DBN model from top to bottom, and encodes different features from left to right. The view uses linear gradient colors to map the degree to which neural networks at different layers forget feature information during the learning process of the DBN model. Directly below each column of features, a broken line is used to indicate how the model retains information about the feature when it passes through each layer of the DBN model. S24: The interactive concept view includes a pie chart with a center mark. Each pie chart represents a feature. The outer layer encodes the ratio of positive to negative values ​​in the interactive utility values ​​between features. The inner layer is a circular mark, which marks whether the corresponding feature has independent utility in model prediction. The feature pie charts with interactive utility are connected by Bezier curves. The thickness of the Bezier curve indicates the numerical value of the interactive utility. The matrix heat map encoding below the view shows the specific utility values ​​of the features.

4. The visualization method for deep learning model for network intrusion detection according to claim 1 is characterized in that: In step S3, the data aggregation visualization layout and implementation in the visualization layout implementation are as follows: S311: Data Sampling S311a: Determine the sampling upper limit: Analyze the dimensionality reduction results of the sample number, and determine the sample number that can maintain the representativeness of the data as the sampling upper limit; S311b: Determine the sampling lower limit: calculate the minimum value, upper quartile, median, lower quartile and maximum value of the data based on the number of cells in the confusion matrix, obtain the distribution of the number of data samples, and determine the sampling lower limit based on the calculation results; S312: Sample point projection implementation S312a: Calculate the similarity of sample data in high-dimensional space Sample x i and x j The similarity between j|i The calculation formula is as follows: In the formula, σ i According to the sample x i The local density adaptive Gaussian kernel width; x k To divide the sample x in the high-dimensional space i Other samples outside Similarly, calculate the sample x j and x i The similarity between i|j ; S312b: Define the sample x in the high-dimensional space by averaging i and x j The symmetric similarity p between ij , the calculation method is as follows: Where N0 is the total number of samples; S312c: Calculate the similarity between samples in low-dimensional space In low-dimensional space, use t distribution to define sample y i and j The similarity between ij , the specific calculation formula is as follows: Among them, y k and l are any two unequal samples in the low-dimensional space; S312d: Minimize the KL divergence between high-dimensional space and low-dimensional space Define KL divergence as the objective function C, and minimize the objective function C by optimizing the coordinates in the low-dimensional space to obtain the final dimensionality reduction result; the calculation formula of the objective function C is as follows:

5. The visualization method for deep learning model for network intrusion detection according to claim 1, characterized in that: In step S3, the mutual information visualization layout and implementation in the visualization layout implementation are specifically as follows: S321: Prepare input data, including the data sample x to be explained and the forward propagation function φ of the nth layer of the DBN model to be explained n And training data set D; S322: Calculate the regularization term: Use the dataset D and the forward propagation function φ of the nth layer of the DBN model to be explained n To calculate the regularization term, that is, to calculate the standard deviation of the hidden state of the model; S323: Regularization term, forward propagation function φ of the nth layer n , take the data sample x to be explained as a parameter, initialize an Interpreter class, that is, initialize an interpreter of the nth layer of the explanation model; S324: Optimize the interpreter and obtain the contribution of each feature of the data sample x to the hidden state of the nth layer of the model; S325: Repeat steps 21 to 24 until the explanation results of each feature of the data sample x for each level of the model are obtained.

6. The visualization method for deep learning model for network intrusion detection according to claim 1, characterized in that: In step S3, the interactive concept visualization layout and implementation in the visualization layout implementation are specifically as follows: S331: Interactive Concept Learning: S331a: Prepare input data, including data samples x to be explained, models f to be explained, and training data sets D; S331b: Initialize the baseline value: Set the baseline value r i Initialize to the mean value of variable i in all samples, and then r i Constrained within a relatively small range, i.e. Where τ is the product of the standard deviation of variable i in all samples and the boundary threshold; S331c: define a masking function: replace the masked features with the corresponding values ​​in the baseline, while the unmasked features keep the original values ​​in the data sample; S331d: Compute interaction utility: Decompose the inference score of the deep learning model into the sum of all potential interaction effects as shown in the following formula: Where N represents all the features in the data sample to be explained, S represents all non-empty subsets of the features, I(S) represents the interactive utility of the features in S, and the calculation formula of I(S) is as follows: Where T is all subsets of S; x T is a mask sample, indicating that the input unit of sample x outside the set T is blocked, while the input unit in the set T remains unchanged, f(x T ) means that the neural network is in the occluded sample x T Output on; S331e: Learn the best baseline value to further improve the sparsity of interaction patterns, thereby enhancing the simplicity of explanations; S331f: Save the result for view drawing; S332: Arc-related graph glyph implementation The interactive concept visualization view glyph consists of two parts: a ring pie chart with a center mark and a Bezier curve chart; each ring pie chart represents a feature, the inner circular mark is based on the color coding whether the feature has independent utility in the model prediction, and the outer ring is calculated based on the positive and negative ratios in the interactive utility value of the feature. The calculation formula for the circular arc angle of the positive and negative utility values ​​of each feature is as follows: i k =2π*p (7) i p =2π*(1-p) (8) Among them, θ k is the circular arc angle of each feature’s positive utility value, θ p is the circular arc angle of the negative utility value of each feature, and p represents the proportion of positive utility values ​​in the calculation results of the feature interaction concept; The Bezier curve is used to represent the interaction utility between two features. The starting point and the end point of the Bezier curve are calculated based on the center coordinates of the annular pie charts corresponding to the two features. The coordinates of the control point are adjusted according to the distance of the annular pie charts and the height of the view to control the height of the Bezier curve. First, calculate the distance between the two features, that is, the distance between the two doughnut pie charts. The specific calculation formula is as follows: Among them, (sourceX, sourceY), (targetX, targetY) are the coordinate positions of the two characteristic donut pie charts. Then calculate the height of the Bezier curve. The specific calculation formula is as follows: linksHeight=min(distance / 2+height / 1.4) (10) Among them, height is the height of the entire interactive concept view; Use a cubic Bezier curve to connect two feature donut pie chart nodes in sequence; the four points needed to draw a cubic Bezier curve are: the starting point startPoint, with a coordinate position of (sourceX, sourceY), the end point endPoint, with a coordinate position of (targetX, targetY), and the control points controlPoint1 and controlPoint2, where: controlPoint1=(sourceX,maxY+linksHeight) (11) controlPoint2=(targetX,maxY+linksHeight) (12) Among them, maxY is the larger value of sourceY and targetY; The curve width is encoded according to the absolute value of the interaction utility, and the curve width is calculated as follows: stroke_width =max(min(|link_interaction|), 10), 1) (13) Among them, link_interaction is the interactive utility value of the feature; S333: Draw a heat matrix diagram Sort the obtained interaction utility values, and then draw the required rectangles in turn, fill them with the corresponding color coding scheme according to the size of the interaction utility value, and create a linear gradient from color 1 to white for mapping for interaction utility values ​​between negative values ​​and 0; create a linear gradient from white to color 2 for mapping for interaction utility values ​​between 0 and positive values; finally, display the corresponding interaction utility value on the corresponding rectangle.