Network intrusion detection method and system based on FC-Trans

Through the FC-Trans method, the characteristics of network traffic data are dynamically optimized, and combined with the convolutional neural network and Transformer structure, it solves the problem of data imbalance and feature capture in network intrusion detection, achieving higher detection accuracy and robustness, and improving network security protection capabilities.

CN118540122APending Publication Date: 2024-08-23SHANGHAI UNIVERSITY OF ELECTRIC POWER +1
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410630044.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-21
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Existing network intrusion detection algorithms have poor accuracy when faced with imbalanced network data traffic and high-dimensional data features, making it difficult to effectively identify abnormal behaviors and respond to complex network threats.

Method used

Adopt a method based on FC-Trans to dynamically optimize the feature representation of network traffic data through the feature transformer, combine the self-attention mechanism and residual structure of the convolutional neural network and Transformer to capture long-term feature dependencies, and use multi-class focus loss and cross-entropy Loss function for model training.

Benefits of technology

It improves the accuracy and robustness of network intrusion detection, enhances the ability to identify abnormal behaviors, reduces network security risks, and improves network security protection capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118540122A
    Figure CN118540122A
Patent Text Reader

Abstract

The invention discloses a network intrusion detection method and system based on FC-Trans, and relates to the technical field of network intrusion detection, and the method comprises the steps: employing a Feature Tokenizer method to dynamically optimize the network flow data feature representation; extracting features from the network traffic data by using a convolutional neural network, and performing convolution operation and pooling operation on the data; in combination with a self-attention mechanism and a residual structure of Transform, capturing long-term feature dependence of network traffic data; the multi-classification focus loss MultiF Loss is used as a training loss function of a multi-classification task, and a cross entropy loss function is combined to train the model. According to the method, the abnormal behavior can be identified more accurately, the method has stronger anti-interference capability and robustness, the network security risk is reduced, the network security protection capability is improved, and remarkable improvement and superior performance are achieved in the network intrusion detection task.
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, in particular to a network intrusion detection method and system based on FC-Trans. Background Art

[0002] Network security is an important issue in the field of information technology today. As an important part of network security, network intrusion detection aims to timely detect and prevent network attacks and ensure the safe operation of network systems. With the continuous development and popularization of the Internet, network intrusion detection technology faces increasingly complex challenges, including but not limited to distributed denial of service (DDoS) attacks, malware propagation, data leakage, etc. Therefore, developing an accurate, efficient, and robust network intrusion detection method and system is of great significance to ensure network security.

[0003] Network security is one of the most important areas in today's information society. As an important part of network security, network intrusion detection aims to identify and respond to malicious behaviors and attacks in the network. Traditional network intrusion detection methods are usually based on rules and specific feature sets, which have certain limitations in facing unknown attacks or responding in real time.

[0004] In recent years, deep learning-based methods have made significant progress in the field of network intrusion detection. Deep learning models can automatically extract features and patterns by learning a large amount of network traffic data, and are more flexible and generalizable than traditional methods. In particular, deep learning models such as convolutional neural networks (CNN) and Transformer have achieved great success in the fields of image and natural language processing, and have therefore been introduced into network intrusion detection.

[0005] However, there are still some challenges in the existing deep learning-based network intrusion detection methods. First, network traffic data is high-dimensional and complex, and traditional feature representation methods often have difficulty in fully expressing the characteristics of the data. Second, network intrusion detection faces the problem of sample imbalance, that is, the ratio between normal traffic and malicious traffic is seriously unbalanced, which affects the classification performance of the model. In addition, problems such as capturing long-term feature dependencies and gradient vanishing are also challenges that current methods need to address. Therefore, there is an urgent need for a new method that can improve the accuracy and robustness of network intrusion detection to cope with increasingly complex and diverse network security threats. Summary of the invention

[0006] In view of the above-mentioned problems, the present invention is proposed.

[0007] Therefore, the problem to be solved by the present invention is: how to solve the problem of poor accuracy of existing intrusion detection algorithms due to unbalanced network data traffic and large data feature dimensions.

[0008] To solve the above technical problems, the present invention provides the following technical solutions: a network intrusion detection method based on FC-Trans, comprising: using a feature converter FeatureTokenizer method to dynamically optimize the feature representation of network traffic data; using a convolutional neural network to extract features from network traffic data, and performing convolution and pooling operations on the data; combining the self-attention mechanism and residual structure of Transformer to capture the long-term feature dependency of network traffic data; using a multi-classification focal loss MultiFLoss as a training loss function for multi-classification tasks, and training the model in combination with a cross entropy loss function.

[0009] As a preferred solution of the FC-Trans based network intrusion detection method described in the present invention, the dynamically optimized network traffic data feature representation includes preprocessing and feature extraction of the original network traffic data, and the Feature Tokenizer module calculates and fuses the input feature x into T∈R k×d In, it is expressed as:

[0010] T j =b j +f j (x j )∈R d f j :

[0011] Among them, b j is the characteristic deviation of the jth feature, T j is the feature vector after the jth sample is fused, X j is the specific eigenvector value.

[0012] As a preferred solution of the network intrusion detection method based on FC-Trans described in the present invention, the feature vector after sample fusion includes a continuous feature vector and a discrete feature vector, and the continuous feature vector and the discrete feature vector are fused to form the final fused feature vector, which is expressed as:

[0013]

[0014]

[0015]

[0016] in, is implemented as a vector Element-wise operation of Implemented as a lookup table of discrete features is the feature vector value of the jth continuous feature, is the One-Hot encoding of the corresponding classification feature, T is the final fusion feature vector, k (num) is the number of continuous type eigenvectors, k (cat) is the number of discrete type feature vectors.

[0017] As a preferred solution of the network intrusion detection method based on FC-Trans described in the present invention, the convolution operation and pooling operation on the data include entering the convolutional neural network CNN through the network traffic data after feature optimization, and performing convolution operation and pooling operation, which is expressed as:

[0018]

[0019] T0=H concat (G flatten (y1, y2, ..., y k ))

[0020] Among them, y k is the result of the kth convolution kernel process, S is the batch processing block, σ is the activation function, ω is the weight, and b i is the bias, c is the input channel of the convolutional neural network, is the weight of the kth convolution kernel applied to the ith input channel, G flatten is the flattening process, H concat is a cascade operation, and T0 is the extracted multi-spatial feature.

[0021] As a preferred solution of the network intrusion detection method based on FC-Trans described in the present invention, the long-term feature dependency of capturing network traffic data includes generating the final token by CNN, sending it to the Transformer structure, and mapping it to a high-dimensional space through an L-layer Transformer. The Transformer module uses a multi-head self-attention mechanism and a residual connection, which is expressed as:

[0022] T e =F e (T e-1 )

[0023] Among them, T e is the output after the e-layer Transformer structure, T e-1 is the output after the e-1 layer Transformer structure, F e The function used for the e-1 layer input to the e layer output.

[0024] As a preferred solution of the network intrusion detection method based on FC-Trans described in the present invention, the long-term feature dependency of capturing network traffic data also includes mapping the features to a high-dimensional space through CNN-Trans, and finally completing the traffic classification operation through a fully connected layer according to the extracted features, which is expressed as:

[0025]

[0026] Among them, x is the fully connected input layer, that is, T L , W is the weight, b is the bias, The probability of Softmax output.

[0027] As a preferred solution of the network intrusion detection method based on FC-Trans described in the present invention, the multi-classification focus loss MultiF Loss is expressed as:

[0028] MultiF(p t )=-α t (1-p t ) β ·log(p t )

[0029] Among them, MultiF(p t ) is the loss function, p t is the probability of model output, α t is the adjustment factor.

[0030] Another object of the present invention is to provide a system of a network intrusion detection method based on FC-Trans, which can solve the problem of network intrusion detection based on FC-Trans by constructing a network intrusion detection system.

[0031] To solve the above technical problems, the present invention provides the following technical solutions: a network intrusion detection system based on FC-Trans, comprising a feature conversion module, a CNN module, a Transformer module and a training module; the feature conversion module uses a feature converter FeatureTokenizer method to dynamically optimize the feature representation of network traffic data; the CNN module uses a convolutional neural network to extract features from network traffic data and performs convolution and pooling operations on the data; the Transformer module is used to capture the long-term feature dependency of network traffic data in combination with the self-attention mechanism and residual structure of the Transformer; the training module uses a multi-classification focal loss MultiFLoss as a training loss function for multi-classification tasks, and trains the model in combination with a cross entropy loss function.

[0032] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-mentioned FC-Trans-based network intrusion detection method when executing the computer program.

[0033] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above-mentioned FC-Trans-based network intrusion detection method.

[0034] The beneficial effects of the present invention are as follows: the network intrusion detection method based on FC-Trans provided by the present invention combines feature optimization, CNN, Transformer and other technologies, so that the network intrusion detection system can more accurately identify abnormal behaviors and have stronger anti-interference ability and robustness. The method of the invention can monitor and analyze network traffic data in real time, promptly discover and respond to network intrusion behaviors, thereby effectively reducing network security risks and improving network security protection capabilities. The introduction of MultiF Loss as a training loss function can effectively solve the problem of sample imbalance, improve the performance and generalization ability of the model in multi-classification tasks, thereby enhancing the system's ability to detect various types of intrusion behaviors. After a large number of experimental verifications, the method of the present invention has achieved significant improvements and superior performance in network intrusion detection tasks, proving its reliability and effectiveness in practical applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0036] Figure 1 The present invention provides a flowchart of a network intrusion detection method based on FC-Trans according to the first embodiment of the present invention.

[0037] Figure 2 A schematic flow chart of a network intrusion detection method based on FC-Trans provided in the first embodiment of the present invention.

[0038] Figure 3 A calculation process diagram of a Feature Tokenizer feature fusion method of a network intrusion detection method based on FC-Trans provided in the first embodiment of the present invention.

[0039] Figure 4A detailed structural diagram of a network intrusion detection method based on FC-Trans provided in the first embodiment of the present invention.

[0040] Figure 5 A structural diagram of a network intrusion detection system based on FC-Trans provided in the second embodiment of the present invention. DETAILED DESCRIPTION

[0041] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings.

[0042] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0043] Example 1

[0044] Reference Figure 1 to Figure 4 , which is the first embodiment of the present invention, and this embodiment provides a network intrusion detection method based on FC-Trans, including: using a feature converter Feature Tokenizer method to dynamically optimize the feature representation of network traffic data; using a convolutional neural network to extract features from the network traffic data, and performing convolution and pooling operations on the data; combining the self-attention mechanism and residual structure of the Transformer to capture the long-term feature dependency of the network traffic data and alleviate the gradient vanishing problem; using multi-classification focus loss MultiF Loss as the training loss function of the multi-classification task, and combining the cross entropy loss function to train the model.

[0045] like Figure 2 Shown is a schematic diagram of the process of the present invention.

[0046] S1. Use the feature tokenizer method to dynamically optimize the feature representation of network traffic data.

[0047] The feature tokenizer method is used to optimize the feature representation of network traffic data. Traditional network intrusion detection systems usually use static feature sets, which are difficult to capture the feature differences between different data sets. To this end, the present invention introduces the feature tokenizer method, which dynamically optimizes the feature representation of network traffic data, so that the system can better adapt to the characteristics of different data sets, thereby improving the generalization ability of network intrusion detection. Figure 3 shown.

[0048] Dynamic optimization of network traffic data feature representation includes preprocessing and feature extraction of raw network traffic data. The Feature Tokenizer module calculates and fuses the input feature x into T∈R k×d In, it is expressed as:

[0049] T j =b j +f j (x j )∈R d f j :

[0050] Among them, b j is the characteristic deviation of the jth feature, T j is the feature vector after the jth sample is fused, X j is the specific eigenvector value, R d is a feature set.

[0051] The feature vector after sample fusion includes a continuous feature vector and a discrete feature vector. The continuous feature vector and the discrete feature vector are fused to form the final fused feature vector, which is expressed as:

[0052]

[0053]

[0054]

[0055] in, is implemented as a vector Element-wise operation of Implemented as a lookup table of discrete features is the feature vector value of the jth continuous feature, is the One-Hot encoding of the corresponding classification feature, T is the final fusion feature vector, k (num) is the number of continuous type eigenvectors, k (cat) is the number of discrete type feature vectors, S j Output the number of feature dimensions for the j-th matrix.

[0056] S2. Use convolutional neural networks to extract features from network traffic data and perform convolution and pooling operations on the data.

[0057] Utilize CNN modules to extract features with strong local correlation from the data. Use 1D-CNN to compute spatial diagrams of salient and important regions. Extract local correlation features and construct multiple spatial feature subsets to achieve parameter sharing and spatial arrangement.

[0058] The network traffic data after feature optimization enters the convolutional neural network CNN for convolution and pooling operations, which can be expressed as:

[0059]

[0060] T0=h concat (G flatten (y1,y2,…,y k ))

[0061] Among them, y k is the result of the kth convolution kernel process, S is the batch processing block, σ is the activation function, ω is the weight, and b i is the bias, c is the input channel of the convolutional neural network, is the weight of the kth convolution kernel applied to the ith input channel, G flatten is the flattening process, H concat is a cascade operation, and T0 is the extracted multi-spatial feature.

[0062] S3. Combine the self-attention mechanism and residual structure of Transformer to capture the long-term feature dependency of network traffic data.

[0063] By combining the self-attention mechanism and residual structure of Transformer, the method of the present invention can capture the long-term feature dependencies in the data and effectively alleviate the gradient vanishing problem. The self-attention mechanism of the Transformer model enables the system to model the complex relationship between data in a global scope, thereby improving the robustness and interpretability of network intrusion detection. Figure 4 shown.

[0064] The final token is generated by CNN and sent to the Transformer structure, which is mapped to a high-dimensional space through L layers of Transformers. The Transformer module uses a multi-head self-attention mechanism and residual connection, which can be expressed as:

[0065] T e =F e (T e-1 )

[0066] Among them, T e is the output after the e-layer Transformer structure, T e-1 is the output after the e-1 layer Transformer structure, F e It is the function used from the input of layer e-1 to the output of layer e. After passing through the L-layer Transformer structure, the output is T L .

[0067] After mapping the features to a high-dimensional space through CNN-Trans, the traffic classification operation is finally completed through the fully connected layer based on the extracted features, which is expressed as:

[0068]

[0069] Among them, x is the fully connected input layer, that is, T L , W is the weight, b is the bias, The probability of Softmax output.

[0070] S4. Use MultiF Loss as the training loss function for multi-classification tasks, and combine it with the cross entropy loss function to train the model.

[0071] In order to solve the sample imbalance problem in network traffic data, we draw inspiration from the design of the Focal Loss loss function and extend its application to our multi-classification tasks. We design MultiF Loss as a training loss function, focusing on samples that are difficult to classify. The use of this loss function helps balance the training effects between different categories, thereby improving the performance of the model in multi-classification tasks.

[0072] Multi-classification focus loss MultiF Loss is expressed as:

[0073] MultiF(p t )=-α t (1-p t ) β ·log(p t )

[0074] Among them, MultiF(p t ) is the loss function, p t is the probability output by the model, indicating the predicted probability that the current sample belongs to its true category. The loss function is evaluated during the training process based on the output of each sample. The probability of each sample softmax output is the result predicted by the model. t is a regulatory factor used to adjust the importance or influence of each category, β is the degree of loss attenuation, log(p t ) is the logarithm of the predicted probability and is part of the cross entropy loss function, which is used to quantify the difference between the probability distribution of the model output and the probability distribution of the true label.

[0075] This loss function is inspired by the design of Focal Loss loss function and extended to multi-classification tasks. Focal Loss mainly solves the problem of sample imbalance. It focuses on samples that are difficult to classify by reducing the weight of samples that are easy to classify, which helps improve the performance of the model on unbalanced data sets. Specifically, Focal Loss consists of two parts: one is the ordinary cross entropy loss, which is used to deal with samples that are easy to classify; the other is an adjustment factor, which is used to adjust the weight of samples that are easy to classify. This adjustment factor is usually related to the class probability of the sample and is used to reduce the contribution of samples that are easy to classify to the loss function. For MultiF Loss, we can construct a loss function similarly, but consider the case of multiple categories. Specifically, for each category, we can use the idea of ​​Focal Loss to adjust the weight of the sample through the adjustment factor to better focus on samples that are difficult to classify. Then, the losses of all categories are added as the final loss function. In this way, MultiF Loss can be applied in multi-classification tasks, focusing on samples that are difficult to classify, thereby improving the performance of the model.

[0076] The present invention proposes a network intrusion detection method and system, a hybrid deep learning model named FC-Trans, which combines feature optimization, convolutional neural network (CNN) and the self-attention mechanism and residual structure of Transformer. By optimizing feature representation, extracting local and global features, and adopting the training loss function of multi-classification tasks, the present invention can improve the accuracy and robustness of network intrusion detection and solve the problem of unbalanced sample distribution.

[0077] Traditional network intrusion detection methods are usually based on rules and specific feature sets, which are difficult to adapt to the characteristics of different data sets, and have problems such as unbalanced sample distribution and inability to capture long-term feature dependencies. The present invention optimizes feature representation by introducing the FeatureTokenizer method, dynamically optimizes the feature representation of network traffic data, and improves the generalization ability of network intrusion detection. It combines the self-attention mechanism and residual structure of convolutional neural networks (CNN) and Transformer to capture local and long-term feature dependencies in the data and solve problems such as gradient disappearance. Using MultiF Loss as the training loss function, it focuses on samples that are difficult to classify, solves the problem of unbalanced sample distribution, and improves the classification performance of the model.

[0078] Example 2

[0079] Reference Figure 5, which is the second embodiment of the present invention, is different from the previous embodiment in that it provides a network intrusion detection system based on FC-Trans, including: a feature conversion module, a CNN module, a Transformer module and a training module.

[0080] The feature conversion module uses the feature tokenizer method to dynamically optimize the feature representation of network traffic data.

[0081] The CNN module uses convolutional neural networks to extract features from network traffic data and perform convolution and pooling operations on the data.

[0082] The Transformer module is used to combine the Transformer’s self-attention mechanism and residual structure to capture the long-term feature dependencies of network traffic data.

[0083] The training module uses MultiF Loss as the training loss function for multi-classification tasks and combines it with the cross entropy loss function to train the model.

[0084] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.

[0085] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0086] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0087] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0088] Example 3

[0089] The third embodiment of the present invention is different from the first two embodiments in that it is used to verify the technical effects adopted in the present invention in order to verify the real effects of the method.

[0090] The traditional method is a rule-based method that uses a predefined rule set or a specific feature engineering method to perform intrusion detection. The present invention and the traditional method are used to conduct simulation experiments simultaneously to detect data such as accuracy, missed alarm rate and false alarm rate, and provide comparative results.

[0091] This embodiment uses the traditional method and the method of the present invention to perform detection simultaneously, and the detection comparison results are shown in the following table:

[0092] Table 1 Comparison between traditional method and the method of the present invention

[0093] Experimental indicators Based on FC-Trans method Traditional methods Accuracy 0.95 0.85 False negative rate 0.02 0.15 False Positive Rate 0.03 0.12 Training time (seconds) 300 500 Test time (seconds) 50 100

[0094] As can be seen from the table, the present invention shows obvious advantages in evaluation indicators such as accuracy, false alarm rate and false alarm rate. Specifically, the accuracy of the present invention reaches 0.95, while the accuracy of the traditional method is only 0.85. This shows that the present invention can more accurately identify abnormal behavior and improve the accuracy of network intrusion detection. In addition, the false alarm rate and false alarm rate of the present invention are also significantly lower than those of the traditional method, indicating that it is better in balancing the detection of normal traffic and malicious traffic.

[0095] In addition to the performance indicators, the present invention also has shorter training and testing times, which shows that the present invention is not only better in performance, but also has certain advantages in computing efficiency.

[0096] In summary, the present invention has achieved significant improvements and superior performance in network intrusion detection tasks, proving its reliability and effectiveness in practical applications. Therefore, our invention can indeed improve the accuracy and robustness of network intrusion detection, effectively reduce network security risks, and enhance network security protection capabilities.

[0097] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A network intrusion detection method based on FC-Trans, characterized in that: include, Use the feature tokenizer method to dynamically optimize the feature representation of network traffic data; Use convolutional neural networks to extract features from network traffic data and perform convolution and pooling operations on the data; Combined with Transformer's self-attention mechanism and residual structure, it captures the long-term feature dependency of network traffic data; MultiF Loss is used as the training loss function for multi-classification tasks, and the model is trained in combination with the cross entropy loss function.

2. The FC-Trans based network intrusion detection method according to claim 1, characterized in that: The dynamic optimization of network traffic data feature representation includes preprocessing and feature extraction of the original network traffic data. The FeatureTokenizer module calculates and fuses the input feature x into T∈R k×d In, it is expressed as, Among them, b j is the characteristic deviation of the jth feature, T j is the feature vector after the jth sample is fused, X j is the specific eigenvector value.

3. A network intrusion detection method based on FC-Trans as claimed in claim 2, characterized in that: The feature vector after sample fusion includes a continuous feature vector and a discrete feature vector. The continuous feature vector and the discrete feature vector are fused to form a final fused feature vector, which is expressed as: in, is implemented as a vector Element-wise operation of Implemented as a lookup table of discrete features is the feature vector value of the jth continuous feature, is the One-Hot encoding of the corresponding classification feature, T is the final fusion feature vector, k (num) is the number of continuous type eigenvectors, k (cat) is the number of discrete type feature vectors.

4. The FC-Trans based network intrusion detection method according to claim 3, characterized in that: The convolution operation and pooling operation on the data include entering the convolutional neural network CNN through the network traffic data after feature optimization, and performing convolution operation and pooling operation, which is expressed as: T0=H concat (G flatten (y1, y2,…, y k )) Among them, y k is the result of the kth convolution kernel process, S is the batch processing block, σ is the activation function, ω is the weight, and b i is the bias, c is the input channel of the convolutional neural network, is the weight of the kth convolution kernel applied to the ith input channel, G flatten is the flattening process, H concat is a cascade operation, and T0 is the extracted multi-spatial feature.

5. The FC-Trans based network intrusion detection method according to claim 4, characterized in that: The long-term feature dependency of capturing network traffic data includes generating the final token by CNN, feeding it into the Transformer structure, and mapping it to a high-dimensional space through L layers of Transformers. The Transformer module uses a multi-head self-attention mechanism and residual connections, which is expressed as, T e =F e (T e-1 ) Among them, T e is the output after the e-layer Transformer structure, T e-1 is the output after the e-1 layer Transformer structure, F e The function used for the e-1 layer input to the e layer output.

6. The FC-Trans based network intrusion detection method according to claim 5, characterized in that: The long-term feature dependency of capturing network traffic data also includes mapping the features to a high-dimensional space through CNN-Trans, and finally completing the traffic classification operation through a fully connected layer based on the extracted features, which is expressed as: Among them, x is the fully connected input layer, that is, T L , W is the weight, b is the bias, The probability of Softmax output.

7. The FC-Trans based network intrusion detection method according to claim 6, characterized in that: The multi-classification focus loss MultiF Loss is expressed as: MultiF(p t )=-a t (1-p t ) β ·log(p t ) Among them, MultiF(p t ) is the loss function, p t is the probability of model output, α t is the adjustment factor.

8. A system using the FC-Trans based network intrusion detection method as claimed in any one of claims 1 to 7, characterized in that: Including feature conversion module, CNN module, Transformer module and training module; The feature conversion module uses a feature converter Feature Tokenizer method to dynamically optimize the network traffic data feature representation; The CNN module uses a convolutional neural network to extract features from network traffic data and perform convolution and pooling operations on the data; The Transformer module is used to capture the long-term feature dependency of network traffic data by combining the self-attention mechanism and residual structure of the Transformer; The training module uses the multi-classification focal loss MultiF Loss as the training loss function for the multi-classification task, and trains the model in combination with the cross entropy loss function.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of a network intrusion detection method based on FC-Trans as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of a network intrusion detection method based on FC-Trans as described in any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Train communication network intrusion detection method based on multi-scale residual network

    CN119652559A

  • Intrusion detection method based on self-attention depth self-encoding neural network

    CN121037112A