An Intrusion Detection Method Based on Hybrid Intelligence

Through the intrusion detection method based on hybrid intelligence, using one-hot coding and neural network to extract features, combined with the three-way decision-making method, the problem of difficulty in detecting internal network attacks with existing technology is solved, and efficient intrusion behavior identification and judgment is achieved, improving network security.

CN115001850BActive Publication Date: 2024-10-25HUNAN FENGHUI YINJIA SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210798768.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-06
Publication Date
2024-10-25
Estimated Expiration
2042-07-06

AI Technical Summary

Technical Problem

It is difficult for existing technologies to effectively detect and locate network attacks from within. Especially given the openness and high complexity of the Internet structure, traditional firewall technology cannot effectively respond to network attacks.

Method used

An intrusion detection method based on hybrid intelligence is used to process training data through one-hot encoding, build a recording matrix, use neural networks to extract intrusion features, and combine the three-way decision-making method to judge intrusion behavior to achieve intelligent detection of network data.

Benefits of technology

It improves the generalization ability and accuracy of network intrusion detection, can quickly identify intrusion behaviors, reduces the misjudgment rate, and enhances network security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115001850B_ABST
    Figure CN115001850B_ABST
Patent Text Reader

Abstract

The present invention relates to a technical field of network intrusion detection, and discloses an intrusion detection method based on hybrid intelligence, including: obtaining training data, performing character-type feature digitization processing on the training data using one-hot encoding to obtain digitized data records; combining and selecting M data records from N pre-processed digitized data records and constructing a record matrix; extracting intrusion features from the record matrix using a neural network model; training data according to the extracted intrusion features using a three-branch decision method to obtain an optimal decision threshold; extracting features from real-time data records in the network using a neural network model, and judging whether the data records contain intrusion behaviors using the three-branch decision method. The present invention realizes intrusion detection of network data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of network intrusion detection, and in particular to an intrusion detection method based on hybrid intelligence. Background Art

[0002] With the rapid development of technology, the Internet is becoming more and more inseparable from people's lives. While the Internet is driving rapid changes and developments in all walks of life and the entire society, it has brought convenience to people's lives, but it has also brought many other challenges. Due to the high openness of the Internet structure, it has provided more living space and propagation channels for computer viruses and Trojans.

[0003] Faced with the severe situation of network security, the commonly used countermeasures include firewall technology, notarization mechanism and other means. However, the commonly used countermeasures cannot effectively deal with network attacks from within, nor can they locate the attacks that have already occurred. Intrusion detection technology belongs to active defense, which can actively prevent attacks, especially those launched from within.

[0004] In view of this, how to implement intrusion detection of network attacks has become an urgent problem to be solved by those skilled in the art. Summary of the invention

[0005] The present invention provides an intrusion detection method based on hybrid intelligence. The method obtains training data, performs character-type feature numerical processing on the training data in the form of one-hot coding, selects M data records from N pre-processed numerical data records by combination, and constructs a record matrix, that is, reduces the coupling between data records in a random manner, and improves the generalization ability of the model; extracts intrusion features from the record matrix by using a neural network model, and trains the intrusion data according to the extracted intrusion features by using a three-branch decision method to obtain an optimal decision threshold; performs the above processing steps on the data records in the network to extract features, and uses the three-branch decision method to determine whether the data records contain intrusion behaviors, thereby realizing intelligent detection of intrusion behaviors in the network.

[0006] To achieve the above object, the present invention provides an intrusion detection method based on hybrid intelligence, comprising:

[0007] Obtain training data, and use one-hot encoding to digitize the character features of the training data to obtain digitized data records;

[0008] Selecting M data records from N pre-processed numerical data records and constructing a record matrix;

[0009] Extract intrusion features from the record matrix using a neural network model;

[0010] The three-branch decision method is used to train the data according to the extracted intrusion features to obtain the optimal decision threshold;

[0011] The neural network model is used to extract features from real-time data records in the network, and the three-branch decision method is used to determine whether the data records contain intrusion behavior.

[0012] Optionally, the acquiring training data includes:

[0013] Obtain training data for the intrusion detection algorithm. The training data is N network connection records. Each network connection record contains nine network traffic features and intrusion identifiers.

[0014] The network traffic characteristics are traffic characteristics calculated with 2 seconds as a time window, including count, serror_rate, same, dif, rerror_rate, srv, srv_serror, srv_rerror, srv_diff, where count represents the number of connections with the same destination address as the current connection in the past 2 seconds, serror_rate represents the number of SYN errors in the connections with the same destination address as the current connection, rerror_rate represents the number of REJ errors in the connections with the same destination address as the current connection, same represents the number of times the same service is established, dif represents the number of times different services are established, srv represents the number of connections with the same service as the current connection in the past 2 seconds, srv_serror represents the number of connections with SYN errors in the connections with the same service as the current connection, srv_rerror represents the number of connections with REJ errors in the connections with the same service as the current connection, and srv_diff represents the number of connections with different hosts;

[0015] The intrusion flags include Normal, DOS, Probing and R2L, where Normal indicates a normal network connection record, DOS indicates a denial of service attack in the network connection record, Probing indicates an intrusion such as monitoring in the network connection record, and R2L indicates an illegal access from a remote machine in the network connection record;

[0016] The acquired network flow features are subjected to data feature preprocessing. In a specific embodiment of the present invention, the data feature preprocessing method adopted is data feature normalization processing. The present invention performs the following normalization processing on each network flow feature:

[0017]

[0018] in:

[0019] x represents the original data features;

[0020] x min Indicates the minimum value in the characteristic dimension of the network traffic currently being processed;

[0021] x max Indicates the maximum value in the characteristic dimension of the network traffic currently being processed;

[0022] x′ represents the data features after normalization.

[0023] Optionally, the processing of digitizing character features of training data using one-hot encoding includes:

[0024] The character features of the training data are digitized using one-hot encoding to obtain digitized data records. The one-hot encoding process is as follows:

[0025] Traverse each network traffic feature dimension and obtain the number of data categories of network traffic features as z;

[0026] Set up an n-bit status register, where n>z, to encode the network traffic features. Each network traffic feature dimension has its own independent register bit, and only one bit is valid at any time.

[0027] In a specific embodiment of the present invention, the present invention performs character-type feature numerical processing on four types of intrusion identifiers. For the Normal, DOS, Probing and R2L intrusion identifiers, a 4-bit status register is established, Normal is represented as [1,0,0,0], DOS is represented as [0,1,0,0], Probing is represented as [0,0,1,0], and R2L is represented as [0,0,0,1].

[0028] Optionally, the combining and selecting M data records from the numerical data records and constructing a record matrix includes:

[0029] Randomly select M-1 data records with intrusion identification as Normal and 1 data record with intrusion identification as DOS, Probing or R2L from N pre-processed numerical data records to form a record matrix. The form of the record matrix is:

[0030]

[0031] in:

[0032] m i,j Represents the numerical result of the jth network traffic feature dimension in the i-th data record;

[0033] m M,1Indicates the Mth data record, whose intrusion mark is DOS or Probing or R2L;

[0034] Repeat the above steps to obtain K record matrices, in which each record matrix contains at most one intrusion record data. The coupling between data records is reduced by randomization, thereby improving the generalization ability of the intrusion detection method.

[0035] Optionally, the training process of the neural network model is:

[0036] 1) Initializing a neural network model, wherein the initialized neural network model only includes an input layer, a hidden layer, and an output layer, and the number of neuron nodes in the output layer, the hidden layer, and the output layer is set to be the same as the dimension of the record matrix;

[0037] 2) Input the record matrix into the initialized neural network model. At this time, the output value of the i-th neuron in the hidden layer is:

[0038]

[0039] in:

[0040] z j Represents the value of the i-th data record input;

[0041] m represents the number of samples of the jth neuron in the hidden layer;

[0042] 3) Set the loss function of the neural network model:

[0043]

[0044]

[0045] in:

[0046] L represents the number of hidden layer neurons in the neural network model;

[0047] R represents the suppression parameter, which is set to 0.6;

[0048] E represents the excitation constant, which is set to 0.5;

[0049] t represents the average value of all neuron outputs in the hidden layer;

[0050] 4) Use the constructed neural network model to train the record matrix until the loss function reaches the minimum; at this time, the output value set of the hidden layer neuron node is X = {x1, x2, ..., x L}, if there is a subset A in set X, the output values ​​in subset A are all less than the preset critical value v, and the output values ​​in set XA are all greater than the preset critical value v, then the neuron nodes corresponding to the output values ​​in subset A are suppressed neuron nodes;

[0051] 5) Delete the suppressed neuron nodes to form a new hidden layer, and add the new hidden layer before the output layer of the neural network model;

[0052] 6) Repeat steps 4) and 5) until a neural network model with three hidden layers is constructed or no suppressed neural nodes can be found;

[0053] The record matrix with DOS intrusion, the record matrix with Probing intrusion and the record matrix with R2L intrusion are respectively input into the trained neural network model, and the output result of the last hidden layer is used as the intrusion feature to extract the DOS intrusion feature, the Probing intrusion feature and the R2L intrusion feature.

[0054] Optionally, the three-branch decision method is used to train the data according to the extracted intrusion features, including:

[0055] 1) For a data set X = {x1, x2, ..., x N}, record each data x i Perform similarity determination with the extracted intrusion features to obtain each data record x i The maximum intrusion probability P(x i ), in a specific embodiment of the present invention, the similarity determination method adopted is a cosine similarity algorithm; the maximum intrusion probability is the maximum value of the similarity between each data record and the three intrusion features;

[0056] 2) Calculate the objective function for classifying data records into normal data records or unknown data records:

[0057]

[0058] in:

[0059] f pp ,f bp represents the loss function value of classifying normal data records into normal data records or unknown data records, f pp = p(a p |X p ), f bp = p(a b |X p ), a p ,a b Indicates the action of classifying data records into normal data records or unknown data records, Xp Represents a normal data record in a data set;

[0060] f pn ,f bn represents the loss function value of classifying intrusion data records into normal data records or unknown data records, f pn = p(a p |X n ), f bn = p(a b |X n ), X n Represents the intrusion data record in the data set, a n represents the action of classifying a data record as an intrusion data record;

[0061] When T p =T B , then we get (∑P(x i )) / N is the decision threshold α;

[0062] 3) Calculate the objective function for classifying data records into unknown data records or intrusion data records:

[0063]

[0064] in:

[0065] f np ,f nn represents the loss function value of classifying intrusion data records into unknown data records or intrusion data records, f nn = p(a n |X n ), f nn = p(a n |X n ), X n Represents the intrusion data record in the data set, a n represents the action of classifying a data record as an intrusion data record;

[0066] When T n =T B , then we get (∑P(x i )) / N is the decision threshold γ.

[0067] Optionally, a three-branch decision method is used to determine whether the data record contains intrusion behavior, including:

[0068] The neural network model is used to extract features from real-time data records in the network, and the extracted features are compared with the intrusion features using the cosine similarity algorithm to obtain the similarity p between the real-time data records and the intrusion data records;

[0069] If p ≥ γ, the data record is an intrusion data record, which means that the network intrusion is detected in real time;

[0070] If α<p<γ, it is impossible to accurately determine whether the data record is an intrusion data record or a normal data record, and the data record is marked as an unknown data record;

[0071] If p<α, the data record is a normal data record.

[0072] Compared with the prior art, the present invention proposes an intrusion detection method based on hybrid intelligence, which has the following advantages:

[0073] First, this patent calculates the network traffic data with 2 seconds as a time window to obtain network traffic characteristics, including count, serror_rate, same, dif, rerror_rate, srv, srv_serror, srv_rerror, and srv_diff, where count represents the number of connections with the same destination address as the current connection in the past 2 seconds, serror_rate represents the number of SYN errors that occur in the connections with the same destination address as the current connection, rerror_rate represents the number of REJ errors that occur in the connections with the same destination address as the current connection, same represents the number of times the same service is established, dif represents the number of times different services are established, srv represents the number of connections with the same service as the current connection in the past 2 seconds, and srv_serror represents the number of connections with SYN errors that occur in the connections with the same service as the current connection. , srv_rerror indicates the number of connections with REJ errors in the same connection as the current connection service, and srv_diff indicates the number of connections to different hosts; the encoding form of the data record is obtained by digitizing the character features of the training data in the form of one-hot encoding, and the data records are randomly combined according to the intrusion identification of the data records to form several record matrices. Compared with the traditional technology, this patent encodes the data records to represent the correlation similarity between different data records, and at the same time, there is at most one intrusion record data in each combined record matrix, so that the record matrix can be divided into three categories, and the record matrices of different categories are respectively input into the neural network model to extract DOS intrusion features, Probing intrusion features and R2L intrusion features, and the randomly combined record matrices reduce the coupling between data records through randomization, thereby improving the generalization ability of the intrusion detection method.

[0074] At the same time, according to the extracted different intrusion features, the present invention uses a three-branch decision method to train the N data records obtained. The process of the three-branch decision method is as follows: for the data record set X = {x1, x2, ..., xN}, record each data x i Perform similarity determination with the extracted intrusion features to obtain each data record x i The maximum intrusion probability P(x i ); Calculate the objective function for classifying data records into normal data records or unknown data records:

[0075]

[0076] Where: f pp , f bp represents the loss function value of classifying normal data records into normal data records or unknown data records, f pp = p(a p |X p ), f bp = p(a b |X p ), a p , a b Indicates the action of classifying data records into normal data records or unknown data records, X p Represents a normal data record in the data set; f pn , f bn represents the loss function value of classifying intrusion data records into normal data records or unknown data records, f pn = p(a p |X n ), f bn = p(a b |X n ), X n Represents the intrusion data record in the data set, a n Indicates the action of classifying data records as intrusion data records; when T p =T B , then we get (∑P(x i )) / N is the decision threshold α; calculate the objective function for classifying data records into unknown data records or intrusion data records:

[0077]

[0078] Where: f np , f nn represents the loss function value of classifying intrusion data records into unknown data records or intrusion data records, f nn = p(a n |X n ), f nn = p(a n |X n ), X nIndicates an intrusion data record in the data set, a n Indicates the action of dividing data records into intrusion data records; when T n = T B , at this time, (∑P(x i )) / N obtained is the decision threshold γ. Compared with traditional technologies, this patent determines the decision thresholds α and γ for dividing data records into normal data records, unknown data records, and intrusion data records by combining the three-way decision method. For real-time data records in the network, this solution uses a neural network model to extract features from real-time data records in the network, and uses the cosine similarity algorithm to compare the extracted features with intrusion features to obtain the similarity p between the real-time data record and the intrusion data record; if p≥γ, then this data record is an intrusion data record, that is, network intrusion is detected in real time; if α<p<γ, it cannot be accurately determined whether this data record is an intrusion data record or a normal data record, and this data record is marked as an unknown data record; if p<α, then this data record is a normal data record, thus quickly realizing the intrusion detection of data records. BRIEF DESCRIPTION OF THE DRAWINGS

[0079] Figure 1 is a schematic flowchart of an intrusion detection method based on hybrid intelligence provided by an embodiment of the present invention;

[0080] The implementation, functional features, and advantages of the object of the present invention will be further described in conjunction with the embodiments with reference to the drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0081] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0082] By obtaining training data, the training data is numerically processed for character features in the form of one-hot encoding, and M data records are combined and selected from N preprocessed numerical data records to construct a record matrix, that is, the coupling between data records is reduced by randomization to improve the generalization ability of the model; use a neural network model to extract intrusion features from the record matrix, use the three-way decision method to train intrusion data based on the extracted intrusion features to obtain the optimal decision threshold; perform the above processing steps on the data records in the network to extract features, and use the three-way decision method to determine whether the data records contain intrusion behavior, thereby realizing the intelligent detection of intrusion behavior in the network. Refer to Figure 1 shown, which is a schematic flowchart of an intrusion detection method based on hybrid intelligence provided by an embodiment of the present invention.

[0083] In this embodiment, the intrusion detection method based on hybrid intelligence includes:

[0084] S1. Obtain training data, and use one-hot encoding to digitize the character features of the training data to obtain digitized data records.

[0085] First, the present invention obtains training data for an intrusion detection algorithm, the training data being N network connection records, each of which contains nine network traffic features and intrusion identifiers;

[0086] The network traffic characteristics are traffic characteristics calculated with 2 seconds as a time window, including count, serror_rate, same, dif, rerror_rate, srv, srv_serror, srv_rerror, srv_diff, where count represents the number of connections with the same destination address as the current connection in the past 2 seconds, serror_rate represents the number of SYN errors in the connections with the same destination address as the current connection, rerror_rate represents the number of REJ errors in the connections with the same destination address as the current connection, same represents the number of times the same service is established, dif represents the number of times different services are established, srv represents the number of connections with the same service as the current connection in the past 2 seconds, srv_serror represents the number of connections with SYN errors in the connections with the same service as the current connection, srv_rerror represents the number of connections with REJ errors in the connections with the same service as the current connection, and srv_diff represents the number of connections with different hosts;

[0087] The intrusion flags include Normal, DOS, Probing and R2L, where Normal indicates a normal network connection record, DOS indicates a denial of service attack in the network connection record, Probing indicates an intrusion such as monitoring in the network connection record, and R2L indicates an illegal access from a remote machine in the network connection record;

[0088] Furthermore, the present invention performs data feature preprocessing on the acquired network flow features. In a specific embodiment of the present invention, the data feature preprocessing method adopted is data feature normalization processing. The present invention performs the following normalization processing on each network flow feature:

[0089]

[0090] in:

[0091] x represents the original data features;

[0092] x min Indicates the minimum value in the characteristic dimension of the network traffic currently being processed;

[0093] x maxIndicates the maximum value in the characteristic dimension of the network traffic currently being processed;

[0094] x′ represents the data features after normalization;

[0095] Furthermore, the present invention uses one-hot encoding to perform character feature digitization processing on training data to obtain digitized data records. The one-hot encoding process is as follows:

[0096] Traverse each network traffic feature dimension and obtain the number of data categories of network traffic features as z;

[0097] Set up an n-bit status register, where n>z, to encode the network traffic features. Each network traffic feature dimension has its own independent register bit, and only one bit is valid at any time.

[0098] In a specific embodiment of the present invention, the present invention performs character-type feature numerical processing on four types of intrusion identifiers. For the Normal, DOS, Probing and R2L intrusion identifiers, a 4-bit status register is established, Normal is represented as [1,0,0,0], DOS is represented as [0,1,0,0], Probing is represented as [0,0,1,0], and R2L is represented as [0,0,0,1].

[0099] S2. Combining and selecting M data records from N pre-processed numerical data records and constructing a record matrix.

[0100] Furthermore, the present invention constructs multiple record matrices from N pre-processed digitized data records, and the construction process of the record matrices is as follows:

[0101] Randomly select M-1 data records with intrusion identification as Normal and 1 data record with intrusion identification as DOS, Probing or R2L from N pre-processed numerical data records to form a record matrix. The form of the record matrix is:

[0102]

[0103] in:

[0104] m i,j Represents the numerical result of the jth network traffic feature dimension in the i-th data record;

[0105] m M,1 Indicates the Mth data record, whose intrusion mark is DOS or Probing or R2L;

[0106] Repeat the above steps to obtain K record matrices, in which each record matrix contains at most one intrusion record data. The coupling between data records is reduced by randomization, thereby improving the generalization ability of the intrusion detection method.

[0107] S3. Use the neural network model to extract intrusion features from the record matrix.

[0108] Furthermore, the present invention classifies the obtained K record matrices, namely, record matrices with DOS intrusion, record matrices with Probing intrusion, and record matrices with R2L intrusion; the record matrices of different categories are respectively input into the neural network model to extract DOS intrusion features, Probing intrusion features, and R2L intrusion features; in a specific embodiment of the present invention, the neural network model is a neural network model combined with an autoencoder;

[0109] The training process of the neural network model is as follows:

[0110] 1) Initializing a neural network model, wherein the initialized neural network model only includes an input layer, a hidden layer, and an output layer, and the number of neuron nodes in the output layer, the hidden layer, and the output layer is set to be the same as the dimension of the record matrix;

[0111] 2) Input the record matrix into the initialized neural network model. At this time, the output value of the i-th neuron in the hidden layer is:

[0112]

[0113] in:

[0114] z j Represents the value of the i-th data record input;

[0115] m represents the number of samples of the jth neuron in the hidden layer;

[0116] 3) Set the loss function of the neural network model:

[0117]

[0118]

[0119] in:

[0120] L represents the number of hidden layer neurons in the neural network model;

[0121] R represents the suppression parameter, which is set to 0.6;

[0122] E represents the excitation constant, which is set to 0.5;

[0123] t represents the average value of all neuron outputs in the hidden layer;

[0124] 4) Use the constructed neural network model to train the record matrix until the loss function reaches the minimum; at this time, the output value set of the hidden layer neuron node is X = {x1, x2, ..., x L}, if there is a subset A in the set ×, the output values ​​in the subset A are all less than the preset critical value v, and the output values ​​in the set XA are all greater than the preset critical value v, then the neuron nodes corresponding to the output values ​​in the subset A are suppressed neuron nodes;

[0125] 5) Delete the suppressed neuron nodes to form a new hidden layer, and add the new hidden layer before the output layer of the neural network model;

[0126] 6) Repeat steps 4) and 5) until a neural network model with three hidden layers is constructed or no suppressed neural nodes can be found.

[0127] The record matrix with DOS intrusion, the record matrix with Probing intrusion and the record matrix with R2L intrusion are respectively input into the trained neural network model, and the output result of the last hidden layer is used as the intrusion feature to extract the DOS intrusion feature, the Probing intrusion feature and the R2L intrusion feature.

[0128] S4. Use the three-branch decision method to train the data according to the extracted intrusion features to obtain the optimal decision threshold.

[0129] Further, according to the extracted different intrusion features β={β1, β2, β3}, where β1 is the DOS intrusion feature, β2 is the Probing intrusion feature, and β3 is the R2L intrusion feature, the present invention uses a three-branch decision method to train the obtained N data records, and the process of the three-branch decision method is:

[0130] 1) For a data record set X = {x1, x2, ..., x N}, record each data x i Perform similarity determination with the extracted intrusion features to obtain each data record x i The maximum intrusion probability P(x i ), in a specific embodiment of the present invention, the similarity determination method adopted is a cosine similarity algorithm; the maximum intrusion probability is the maximum value of the similarity between each data record and the three intrusion features;

[0131] 2) Calculate the objective function for classifying data records into normal data records or unknown data records:

[0132] in:

[0133] f pp , f bp represents the loss function value of classifying normal data records into normal data records or unknown data records, f pp = p(a p |X p ), f bp = p(a b |X p ), a p , a b represents the action of classifying data records into normal data records or unknown data records, and Xp represents the normal data records in the data set;

[0134] f pn , f bn represents the loss function value of classifying intrusion data records into normal data records or unknown data records, f pn = p(a p |X n ), f bn = p(a b |X n ), X n Represents the intrusion data record in the data set, a n represents the action of classifying a data record as an intrusion data record;

[0135] When T p =T B , then we get (∑P(x i )) / N is the decision threshold α;

[0136] 3) Calculate the objective function for classifying data records into unknown data records or intrusion data records:

[0137]

[0138]

[0139] in:

[0140] f np , f nn represents the loss function value of classifying intrusion data records into unknown data records or intrusion data records, f nn = p(a n |X n ), f nn = p(a n |X n ), X n Represents the intrusion data record in the data set, a n represents the action of classifying a data record as an intrusion data record;

[0141] When T n = T B , at this time, (∑P(x i )) / N obtained is the decision threshold γ.

[0142] S5. Use the neural network model to extract features from the real-time data records in the network, and use the three-way decision method to judge whether the data records contain intrusion behaviors, so as to realize the intelligent detection of intrusion behaviors in the network.

[0143] Furthermore, the present invention uses the neural network model to extract features from the real-time data records in the network, uses the cosine similarity algorithm to compare the extracted features with the intrusion features, and obtains the similarity p between the real-time data record and the intrusion data record;

[0144] If p≥γ, then the data record is an intrusion data record, that is, a network intrusion is detected in real time;

[0145] If α < p < γ, it is impossible to accurately judge whether the data record is an intrusion data record or a normal data record, and the data record is marked as an unknown data record;

[0146] If p < α, then the data record is a normal data record.

[0147] The following uses an algorithm experiment to illustrate the specific implementation manner of the present invention and test the processing method of the invention. The hardware test environment of the algorithm of the present invention is: Inter(R) Core(TM) i7-6700K CPU, and the software is Matlab2018b; the comparison method is the intrusion detection method based on the genetic algorithm and the intrusion detection method based on SVM.

[0148] In the algorithm experiment of the present invention, the data set is 1000 network data records, and 20% of the data records are intrusion data records. In this experiment, the network data records are input into the algorithm model, and the accuracy rate of intrusion detection is used as an evaluation index for the feasibility of the algorithm.

[0149] According to the experimental results, the intrusion detection accuracy rate of the intrusion detection method based on the genetic algorithm is 81.11%, the intrusion detection accuracy rate of the intrusion detection method based on SVM is 82.62, and the intrusion detection accuracy rate of the method of the present invention is 88.13. Compared with the comparative algorithms, the proposed hybrid intelligence-based intrusion detection method of the present invention can achieve more effective network intrusion detection.

[0150] It should be noted that the serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments. And the terms "including", "comprising" or any other variants thereof in this article are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "including a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.

[0151] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0152] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. An intrusion detection method based on hybrid intelligence, characterized in that: The method comprises: Obtain training data, and use one-hot encoding to digitize the character features of the training data to obtain digitized data records; Combining and selecting M data records from N pre-processed numerical data records and constructing a record matrix; Extract intrusion features from the record matrix using a neural network model; The three-branch decision method is used to train the data according to the extracted intrusion features to obtain the optimal decision threshold; Use the neural network model to extract features from real-time data records in the network, and use the three-branch decision method to determine whether the data records contain intrusion behavior; M data records are selected from the numerical data records and a record matrix is ​​constructed, including: Randomly select M-1 data records with intrusion identification as Normal and 1 data record with intrusion identification as DOS, Probing or R2L from N pre-processed numerical data records to form a record matrix. The form of the record matrix is: ; in: m i,j Represents the numerical result of the jth network traffic feature dimension in the i-th data record; m M,1 Indicates the Mth data record, whose intrusion mark is DOS or Probing or R2L; Repeat the steps of forming a record matrix until K record matrices are obtained, wherein each record matrix contains at most one intrusion record data; The training process of the neural network model is: 1) Initializing a neural network model, wherein the initialized neural network model only includes an input layer, a hidden layer, and an output layer, and the number of neuron nodes in the input layer, the hidden layer, and the output layer is set to be the same as the dimension of the record matrix; 2) Input the record matrix into the initialized neural network model. At this time, the output value of the i-th neuron in the hidden layer is: ; in: z j Represents the value of the jth data record input; m represents the number of samples of the i-th neuron in the hidden layer; 3) Set the loss function of the neural network model: ; ; in: L represents the number of hidden layer neurons in the neural network model; R represents the suppression parameter, which is set to 0.6; E represents the excitation constant, which is set to 0.5; t represents the average value of all neuron outputs in the hidden layer; 4) Use the constructed neural network model to train the record matrix until the loss function reaches the minimum; at this time, the output value set of the hidden layer neuron node is X = {x1, x2, ..., x L }, if there is a subset A in set X, the output values ​​in subset A are all less than the preset critical value v, and the output values ​​in set XA are all greater than the preset critical value v, then the neuron nodes corresponding to the output values ​​in subset A are suppressed neuron nodes; 5) Delete the suppressed neuron nodes to form a new hidden layer, and add the new hidden layer before the output layer of the neural network model; 6) Repeat steps 4) and 5) until a neural network model with three hidden layers is constructed or no suppressed neuron nodes can be found; The record matrix with DOS intrusion, the record matrix with Probing intrusion and the record matrix with R2L intrusion are respectively input into the trained neural network model, and the output result of the last hidden layer is used as the intrusion feature to extract the DOS intrusion feature, the Probing intrusion feature and the R2L intrusion feature.

2. The hybrid intelligence-based intrusion detection method according to claim 1, characterized in that: The obtaining of training data comprises: Obtain training data for the intrusion detection algorithm. The training data is N network connection records. Each network connection record contains nine network traffic features and intrusion identifiers. The network traffic characteristics are traffic characteristics calculated with 2 seconds as a time window, including count, serror_rate, same, dif, rerror_rate, srv, srv_serror, srv_rerror, srv_diff, where count represents the number of connections with the same destination address as the current connection in the past 2 seconds, serror_rate represents the number of SYN errors in the connections with the same destination address as the current connection, rerror_rate represents the number of REJ errors in the connections with the same destination address as the current connection, same represents the number of times the same service is established, dif represents the number of times different services are established, srv represents the number of connections with the same service as the current connection in the past 2 seconds, srv_serror represents the number of connections with SYN errors in the connections with the same service as the current connection, srv_rerror represents the number of connections with REJ errors in the connections with the same service as the current connection, and srv_diff represents the number of connections with different hosts; The intrusion flags include Normal, DOS, Probing and R2L, where Normal indicates a normal network connection record, DOS indicates a denial of service attack in the network connection record, Probing indicates an intrusion such as monitoring in the network connection record, and R2L indicates an illegal access from a remote machine in the network connection record; Each network traffic feature is normalized as follows: ; in: x represents the original data features; x min Indicates the minimum value in the characteristic dimension of the network traffic currently being processed; x max Indicates the maximum value in the characteristic dimension of the network traffic currently being processed; x′ represents the data features after normalization.

3. The hybrid intelligence-based intrusion detection method according to claim 2, characterized in that: The method of using one-hot encoding to digitize the character features of the training data includes: The character features of the training data are digitized using one-hot encoding to obtain digitized data records. The one-hot encoding process is as follows: Traverse each network traffic feature dimension and obtain the number of data categories of network traffic features as z; An n-bit status register is set, where n>z, to encode the network traffic characteristics. Each network traffic characteristic dimension has its own independent register bit, and only one bit is valid at any time.

4. The hybrid intelligence-based intrusion detection method according to claim 3, characterized in that: The three-branch decision method is used to train the data according to the extracted intrusion features, including: 1) For a data set X = {x1, x2, ..., x N }, record each data x i Perform similarity determination with the extracted intrusion features to obtain each data record x i The maximum intrusion probability P(x i ); 2) Calculate the objective function for classifying data records into normal data records or unknown data records: ; in: f pp ,f bp represents the loss function value of classifying normal data records into normal data records or unknown data records, f pp = p(a p |X p ), f bp = p(a b |X p ), a p ,a b Indicates the action of classifying data records into normal data records or unknown data records, X p Represents a normal data record in a data set; f pn ,f bn represents the loss function value of classifying intrusion data records into normal data records or unknown data records, f pn = p(a p |X n ), f bn = p(a b |X n ), X n Represents an intrusion data record in a data set; When T p =T B , then we get (∑P(x i )) / N is the decision threshold α; 3) Calculate the objective function for classifying data records into unknown data records or intrusion data records: ; in: f np ,f nn represents the loss function value of classifying intrusion data records into unknown data records or intrusion data records, f nn = p(a n |X n ), f nn = p(a n |X n ), X n Represents the intrusion data record in the data set, a n represents the action of classifying a data record as an intrusion data record; When T n =T B , then we get (∑P(x i )) / N is the decision threshold γ.

5. The hybrid intelligence-based intrusion detection method according to claim 4, characterized in that: The three-branch decision method is used to determine whether the data record contains intrusion behavior, including: The neural network model is used to extract features from real-time data records in the network, and the extracted features are compared with the intrusion features using the cosine similarity algorithm to obtain the similarity p between the real-time data records and the intrusion data records; If p ≥ γ, the data record is an intrusion data record, which means that the network intrusion is detected in real time; If α < p < γ, it is impossible to accurately determine whether the data record is an intrusion data record or a normal data record, and the data record is marked as an unknown data record; If p < α, the data record is a normal data record.