Network traffic based adaptive malware detection method and system

By optimizing the weights of a bi-branch adaptive neural network model and a sparse model, the problem of balancing storage space and detection capability in malware detection methods is solved, achieving efficient, accurate detection and wide applicability in complex network environments.

CN117879937BActive Publication Date: 2026-11-20NANJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410036097.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-10
Publication Date
2026-11-20
Estimated Expiration
2044-01-10

AI Technical Summary

Technical Problem

Existing malware detection methods cannot effectively balance storage space and detection capabilities, resulting in limited detection capabilities and poor versatility, especially in complex network environments where they cannot adapt to rapidly iterating network traffic data.

Method used

We employ a dual-branch adaptive neural network model combined with sparse model weight optimization. Through online learning, we dynamically increase the ability to identify new types of anomalies, thereby improving detection accuracy and efficiency while reducing storage space usage.

Benefits of technology

It improves the detection efficiency and identification accuracy of abnormal network traffic data and malware in complex Internet environments, enhances the versatility of the system in different scenarios, and reduces the cost and difficulty of using the software.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117879937B_ABST
    Figure CN117879937B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on network traffic adaptive malware detection method and system, method includes: obtaining network traffic data and making as network traffic dataset, network traffic data training set is imported into double-branch adaptive neural network model, obtains model prediction value;Model prediction value and training set label value are substituted into classification loss function, positive and negative samples of training set are substituted into sparse pair loss function, model weight is substituted into sparse loss function calculation, obtain classification loss value, sparse pair loss value, sparse loss value;According to classification loss value, sparse pair loss value, sparse loss value updates double-branch adaptive neural network model parameter, until the optimal double-branch adaptive neural network model is obtained;The optimal double-branch adaptive neural network model dynamically increases new class classifier, obtains the double-branch adaptive neural network model after increment;According to the double-branch adaptive neural network model after increment, online detection network traffic data, adaptive identification malware or abnormal network traffic data;The application improves the detection efficiency and identification precision of abnormal network traffic data or malware in complex internet data environment, balance the storage space and detection ability conflict problem simultaneously, and then improve the versatility in each scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of network security technology, specifically relating to an adaptive malware detection method and system based on network traffic. Background Technology

[0002] In today's information age, network traffic data is complex and iterates rapidly. Existing malware detection methods are unable to cope with the complex network environment, resulting in shortcomings in malware detection. On the one hand, existing malware detection methods have weak online learning capabilities, which generally limit their detection capabilities to specific types of malware. On the other hand, methods with strong online learning capabilities require a large amount of network traffic data for support, thus requiring a large amount of storage space. Therefore, existing technologies cannot balance storage space and detection capabilities, resulting in poor versatility of malware detection methods. Summary of the Invention

[0003] Purpose of the Invention: To overcome the shortcomings of existing technologies, this invention provides an adaptive malware detection method and system based on network traffic. It dynamically increases the ability to identify new types of anomalies by introducing sparse model weight optimization based on a dual-branch adaptive neural network model and maintaining the online learning capability of the dual-branch adaptive neural network model for network data. Under sparse model weights, it also improves the accuracy of anomaly detection, enhancing the detection efficiency and identification precision of abnormal network traffic data or malware in complex internet data environments. Simultaneously, it balances the conflict between storage space and detection capability, thereby improving its versatility in various scenarios.

[0004] Technical Solution: Firstly, this invention provides an adaptive malware detection method based on network traffic, comprising:

[0005] Step 1: Obtain network traffic data and create a network traffic dataset. The network traffic data training set contains positive and negative training samples and the label values ​​corresponding to each sample.

[0006] Step 2: Import the network traffic data training set into the dual-branch adaptive neural network model to obtain the model predictions and model weights;

[0007] Step 3: Substitute the model predictions and label values ​​into the classification loss function, the positive and negative samples of the training set into the sparse pair loss function, and the model weights into the sparse loss function to calculate the classification loss value, sparse pair loss value, and sparse loss value.

[0008] Step 4: Update the parameters of the bibranch adaptive neural network model based on the classification loss value, sparse pair loss value, and sparse loss value until the optimal bibranch adaptive neural network model is obtained;

[0009] Step 5: Dynamically add a new classifier to the optimal bi-branch adaptive neural network model to obtain the incremental bi-branch adaptive neural network model;

[0010] Step 6: Detect network traffic data online based on the incremental dual-branch adaptive neural network model, and adaptively identify malware or abnormal network traffic data.

[0011] In a further embodiment, step 1, which involves acquiring network traffic data and creating a network traffic dataset, includes:

[0012] Step 1.1: Classify the acquired network traffic data to determine normal network traffic data and abnormal network traffic data;

[0013] Step 1.2: Based on the MAC address and IP address of the network traffic data, perform data cleaning on normal network traffic data and abnormal network traffic data to obtain normal network traffic data and abnormal network traffic data with null and duplicate values ​​removed;

[0014] Step 1.3: Generate image data with uniform length and format from normal network traffic data and abnormal network traffic data by deleting null and duplicate values;

[0015] Step 1.4: Classify the image data according to the preset label values, determine the label value of each image data, and classify and store the image data according to the label values ​​to obtain the network traffic dataset for training; wherein, the preset label values ​​include: new category label values ​​and old category label values;

[0016] Normal network traffic data is used as positive samples in the training set, while abnormal network traffic data is used as negative samples in the training set.

[0017] In a further embodiment, the dual-branch adaptive neural network model includes: a stability module and a plasticity module; wherein the stability module and the plasticity module are built using residual networks and PyTorch code;

[0018] The stability module is used to detect and classify image data of old categories, and obtain data features associated with the old categories;

[0019] The plasticity module is used to detect and classify new categories of image data to obtain data features associated with the new categories.

[0020] In a further embodiment, step 2, which involves importing the network traffic data training set into a dual-branch adaptive neural network model to obtain model predictions and model weights, includes:

[0021] Step 2.1: Input the image data into the dual-branch adaptive neural network model, extract the data features associated with the old category through the stability module, and extract the data features associated with the new category through the plasticity module;

[0022] Step 2.2: Perform feature fusion based on the data features associated with the old category and the data features associated with the new category to obtain super features;

[0023] Step 2.3: Input the super features into the classifier to obtain the model predictions and the model weights associated with the model predictions.

[0024] In a further embodiment, the method for calculating the classification loss value, sparse pair loss value, and sparse loss value by substituting the model prediction value and label value into the classification loss function, substituting the positive and negative samples of the training set into the sparse pair loss function, and substituting the model weights into the sparse loss function in step 3 includes:

[0025] Step 3.1: Substitute the model's predicted values ​​and label values ​​into the classification loss function to obtain the classification loss value; substitute the positive and negative samples of the training set into the sparse pair loss function to obtain the sparse pair loss value; and substitute the model weights into the sparse loss function to obtain the sparse loss value.

[0026] In a further embodiment, the calculation expression for the classification loss function is:

[0027]

[0028] In the formula, H(y) i ,p i ) is the cross-entropy loss function, L CE The value of the cross-entropy loss function is y, where N is the total number of input categories. i p is the classification label value of the i-th sample. i The model prediction value for the i-th sample;

[0029] The expression for calculating the sparse pair loss function is as follows:

[0030]

[0031] In the formula, N is the total number of input categories. and Let T and e represent the similarity between positive samples of class j from normal network traffic in the training set and abnormal network traffic of class j from abnormal network traffic, respectively. T is the temperature coefficient and e is a mathematical constant.

[0032] The calculation expression for the sparse loss function is as follows:

[0033]

[0034] In the formula, θ k Let L represent the weight of the k-th bibranch adaptive neural network model, λ be the sparse parameter, n be the number of weights in the bibranch adaptive neural network model, and L be the weight of the k-th bibranch adaptive neural network model. RS This represents the sparse loss function value.

[0035] In a further embodiment, the method for updating the parameters of the bi-branch adaptive neural network model in step 4 based on the classification loss value, sparse pair loss value, and sparse loss value until the optimal bi-branch adaptive neural network model is obtained includes:

[0036] Step 4.1: Calculate the total loss value of the bi-branch adaptive neural network model by summing the classification loss value, the sparse pair loss value, and the sparse loss value.

[0037] Step 4.2: Perform backpropagation based on the total loss value of the two-branch adaptive neural network model to obtain the gradient;

[0038] Step 4.3: Update the parameters of the bibranch adaptive neural network model according to the gradient until the optimal bibranch adaptive neural network model is obtained.

[0039] In a further embodiment, the method for dynamically adding a new classifier to the optimal bi-branch adaptive neural network model in step 5 to obtain the incremental bi-branch adaptive neural network model includes:

[0040] Step 5.1: Freeze the stability module in the optimal bi-branch adaptive neural network model, and dynamically add new classifiers to the plasticity module to obtain a plasticity module with dynamically expanded new class detection capabilities; wherein, the new classifier has the online learning capability to maintain new classification label values ​​for network traffic data;

[0041] Step 5.2: Based on the frozen stability module and the plasticity module that dynamically expands the new category detection capability, obtain the incremental bi-branch adaptive neural network model.

[0042] In a second aspect, the present invention provides an adaptive malware detection system based on network traffic, comprising:

[0043] Data acquisition and processing module, update module, online learning module, application module;

[0044] The data acquisition and processing module is used to acquire network traffic data and create a network traffic dataset;

[0045] The update module is used to import the network traffic data training set into the bi-branch adaptive neural network model to obtain the model prediction value and model weight; substitute the model prediction value and label value into the classification loss function, substitute the positive and negative samples of the training set into the sparse pair loss function, and substitute the model weight into the sparse loss function to calculate the classification loss value, sparse pair loss value, and sparse loss value; and update the bi-branch adaptive neural network model parameters according to the classification loss value, sparse pair loss value, and sparse loss value until the optimal bi-branch adaptive neural network model is obtained.

[0046] The online learning module is used to dynamically add new classifiers to the optimal bi-branch adaptive neural network model to obtain an incremental bi-branch adaptive neural network model.

[0047] The application module is used to detect network traffic data online based on the incremental dual-branch adaptive neural network model, and adaptively identify malicious software or abnormal network traffic data.

[0048] In a further embodiment, the update module is pre-set with training parameters for a dual-branch adaptive neural network model, including: training step size, number of training iterations, and learning rate.

[0049] Beneficial effects: Compared with the prior art, the present invention has the following advantages:

[0050] By introducing sparse model weight optimization based on a bi-branch adaptive neural network model and maintaining the online learning capability of the bi-branch adaptive neural network model for network data, the ability to identify new types of anomalies is dynamically increased. Under the condition of sparse model weights, the accuracy of anomaly detection can be improved, and the detection efficiency and identification accuracy of abnormal network traffic data or malicious software in complex Internet data environments can be improved. At the same time, the conflict between storage space and detection capability is balanced, thereby improving the versatility in various scenarios.

[0051] In various scenarios of complex real-world internet data environments, signal processing, image processing, deep learning, and incremental learning are creatively introduced to comprehensively improve the detection system's efficiency and accuracy in detecting abnormal network traffic data or malware in various network environments, thereby reducing software usage costs and difficulty. Attached Figure Description

[0052] Figure 1 This is a flowchart of the network traffic malware detection method based on adaptive class incremental learning according to the present invention;

[0053] Figure 2 This is a structural diagram of the dual-branch adaptive neural network model of the present invention. Detailed Implementation

[0054] To better understand the technical content of the present invention, the technical solution of the present invention will be further introduced and explained below with reference to specific embodiments, but is not limited thereto.

[0055] Combination Figure 1 Further explanation of the adaptive malware detection method based on network traffic of the present invention includes:

[0056] Step 1: Obtain network traffic data and create a network traffic dataset. The network traffic data training set contains positive and negative training samples and the label values ​​corresponding to each sample.

[0057] Step 2: Import the network traffic data training set into the dual-branch adaptive neural network model to obtain the model predictions and model weights;

[0058] Step 3: Substitute the model predictions and label values ​​into the classification loss function, the positive and negative samples of the training set into the sparse pair loss function, and the model weights into the sparse loss function to calculate the classification loss value, sparse pair loss value, and sparse loss value.

[0059] Step 4: Update the parameters of the bibranch adaptive neural network model based on the classification loss value, sparse pair loss value, and sparse loss value until the optimal bibranch adaptive neural network model is obtained;

[0060] Step 5: Dynamically add a new classifier to the optimal bi-branch adaptive neural network model to obtain the incremental bi-branch adaptive neural network model;

[0061] Step 6: Detect network traffic data online based on the incremental dual-branch adaptive neural network model, and adaptively identify malware or abnormal network traffic data.

[0062] Preferably, step 1, which involves acquiring network traffic data and creating a network traffic dataset, includes:

[0063] Step 1.1: Classify the acquired network traffic data to determine normal network traffic data and abnormal network traffic data;

[0064] Step 1.2: Based on the MAC address and IP address of the network traffic data, perform data cleaning on normal network traffic data and abnormal network traffic data to obtain normal network traffic data and abnormal network traffic data with null and duplicate values ​​removed;

[0065] Step 1.3: Generate image data with uniform length and format from normal network traffic data and abnormal network traffic data by deleting null and duplicate values;

[0066] Step 1.4: Classify the image data according to the preset label values, determine the label value of each image data, and classify and store the image data according to the label values ​​to obtain the network traffic dataset for training; wherein, the preset label values ​​include: new category label values ​​and old category label values, and set the associated folder for each category during storage so that image data of the same category are stored in the same folder.

[0067] Normal network traffic data is used as positive samples in the training set, while abnormal network traffic data is used as negative samples in the training set.

[0068] Preferred, such as Figure 2 The dual-branch adaptive neural network model shown includes a stability module and a plasticity module; wherein the stability module and the plasticity module are built using residual networks and PyTorch code;

[0069] The stability module is used to detect and classify image data of old categories, and obtain data features associated with the old categories;

[0070] The plasticity module is used to detect and classify new categories of image data to obtain data features associated with the new categories.

[0071] Preferably, step 2, which involves importing the network traffic data training set into a dual-branch adaptive neural network model to obtain model predictions and model weights, includes:

[0072] Step 2.1: Input the image data into the dual-branch adaptive neural network model, extract the data features associated with the old category through the stability module, and extract the data features associated with the new category through the plasticity module;

[0073] Step 2.2: Perform feature fusion based on the data features associated with the old category and the data features associated with the new category to obtain super features;

[0074] Step 2.3: Input the super features into the classifier to obtain the model predictions and the model weights associated with the model predictions.

[0075] In a further embodiment, the method for calculating the classification loss value, sparse pair loss value, and sparse loss value by substituting the model prediction value and label value into the classification loss function, substituting the positive and negative samples of the training set into the sparse pair loss function, and substituting the model weights into the sparse loss function in step 3 includes:

[0076] Step 3.1: Substitute the model's predicted values ​​and label values ​​into the classification loss function to obtain the classification loss value; substitute the positive and negative samples of the training set into the sparse pair loss function to obtain the sparse pair loss value; and substitute the model weights into the sparse loss function to obtain the sparse loss value.

[0077] In this embodiment, the training data set is one-hot encoded, which converts the classification label values ​​into a category vector of classification labels represented as binary strings, where only one element is 1 and the rest are 0; the classification loss function is the cross-entropy loss function for loss calculation.

[0078] Preferably, the calculation expression for the classification loss function is:

[0079]

[0080] In the formula, H(y) i ,p i ) is the cross-entropy loss function, L CE The value of the cross-entropy loss function is y, where N is the total number of input categories. i p is the classification label value of the i-th sample. i The model predicts the i-th sample value; in this embodiment, the model is updated by comparing the predicted value with the training set labels.

[0081] The expression for calculating the sparse pair loss function is as follows:

[0082]

[0083] In the formula, N is the total number of input categories. and Let T and e represent the similarity between positive samples of class j from normal network traffic in the training set and abnormal samples of class j from abnormal network traffic, respectively. T is the temperature coefficient and e is a mathematical constant. In this embodiment, the sparse pair loss function is input into the training network traffic dataset, and the obtained sparse pair loss value is used to improve the detection accuracy of the model.

[0084] The calculation expression for the sparse loss function is as follows:

[0085]

[0086] In the formula, θ k Let L represent the weight of the k-th bibranch adaptive neural network model, λ be a sparse parameter set to 0.001, and n be the number of weights in the bibranch adaptive neural network model. RS As a sparse loss function value, this embodiment uses the sparse loss function to statistically analyze the weights of the input bi-branch adaptive neural network model, and uses the loss function to update the sparse model in the model;

[0087] Preferably, the method for updating the parameters of the bi-branch adaptive neural network model in step 4 based on the classification loss value, sparse pair loss value, and sparse loss value until the optimal bi-branch adaptive neural network model is obtained includes:

[0088] Step 4.1: Calculate the total loss value of the bi-branch adaptive neural network model by summing the classification loss value, the sparse pair loss value, and the sparse loss value.

[0089] Step 4.2: Perform backpropagation based on the total loss value of the two-branch adaptive neural network model to obtain the gradient;

[0090] Step 4.3: Update the parameters of the bibranch adaptive neural network model according to the gradient until the optimal bibranch adaptive neural network model is obtained.

[0091] Preferably, the method for dynamically adding a new classifier to the optimal bi-branch adaptive neural network model in step 5 to obtain the incremental bi-branch adaptive neural network model includes:

[0092] Step 5.1: Freeze the stability module in the optimal bi-branch adaptive neural network model, and dynamically add new classifiers to the plasticity module to obtain a plasticity module with dynamically expanded new class detection capabilities; wherein, the new classifier has the ability to learn online to maintain new classification label values ​​for network traffic data;

[0093] Step 5.2: Based on the frozen stability module and the plasticity module that dynamically expands the new category detection capability, obtain the incremental bi-branch adaptive neural network model.

[0094] Example 2:

[0095] This embodiment further illustrates an adaptive malware detection system based on network traffic, including:

[0096] Data acquisition and processing module, update module, online learning module, application module;

[0097] The update module is used to import the network traffic data training set into the bi-branch adaptive neural network model to obtain the model prediction value and model weight; substitute the model prediction value and label value into the classification loss function, substitute the positive and negative samples of the training set into the sparse pair loss function, and substitute the model weight into the sparse loss function to calculate the classification loss value, sparse pair loss value, and sparse loss value; and update the bi-branch adaptive neural network model parameters according to the classification loss value, sparse pair loss value, and sparse loss value until the optimal bi-branch adaptive neural network model is obtained.

[0098] The online learning module is used to dynamically add new classifiers to the optimal bi-branch adaptive neural network model to obtain an incremental bi-branch adaptive neural network model.

[0099] The application module is used to detect network traffic data online based on the incremental dual-branch adaptive neural network model, and adaptively identify malicious software or abnormal network traffic data.

[0100] Preferably, the update module has preset training parameters for a dual-branch adaptive neural network model, including: training step size, number of training iterations, and learning rate.

[0101] The initialization steps of the update module include:

[0102] A. Build a two-branch adaptive neural network model using residual networks and PyTorch code. The two-branch adaptive neural network model includes a stability module and a plasticity module. The built model is the base model; the base model does not involve increments. The loss function used in this model is the cross-entropy loss function, and its formula is: And no sparsity processing is performed;

[0103] B. Set the number of categories and training parameters required for training the base model, input the training set data of the selected number of categories into the model for training, and obtain the optimal base model; the training parameters of the update module are preset as shown in the table below in this embodiment:

[0104] parameter value Input data dimensions 28×28×1 Training equipment GeForce GTX 3090 Ti Training environment Pytorch Optimizer SGD Batch size 32 Learning rate 0.001 Training times 200

[0105] Table 1

[0106] In this embodiment, network traffic data containing 10 categories of labels is used for the initial training of the basic model to obtain an initial bi-branch adaptive neural network model. In the later training process, sparsity processing is introduced, and new category label values ​​are dynamically added in batches according to the network traffic data to obtain an incremental bi-branch adaptive neural network model.

[0107] In summary, this invention, by introducing sparse model weight optimization based on a bi-branch adaptive neural network model and maintaining the online learning capability of the bi-branch adaptive neural network model for network data, dynamically increases the ability to identify new types of anomalies. Under the condition of sparse model weights, it can also improve the accuracy of anomaly detection, improve the detection efficiency and identification accuracy of abnormal network traffic data or malicious software in complex Internet data environments, and balance the conflict between storage space and detection capability, thereby improving its versatility in various scenarios.

[0108] In various scenarios of complex real-world internet data environments, signal processing, image processing, deep learning, and incremental learning are creatively introduced to comprehensively improve the detection system's efficiency and accuracy in detecting abnormal network traffic data or malware in various network environments, thereby reducing software usage costs and difficulty.

[0109] Embodiments of this application may be provided as methods, systems, or computer program products. Therefore, this application may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0110] Embodiments of this application may be provided as methods, systems, or computer program products. Therefore, this application may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0111] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0112] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0113] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0114] The above description is only a preferred embodiment of the present invention. Without departing from the technical principle of the present invention, several improvements and modifications can be made, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. An adaptive malware detection method based on network traffic, characterized in that, include: Step 1: Obtain network traffic data and create a network traffic dataset. The network traffic data training set contains positive and negative training samples and the label values ​​corresponding to each sample. Step 2: Import the network traffic data training set into the dual-branch adaptive neural network model to obtain the model predictions and model weights; Step 3: Substitute the model predictions and label values ​​into the classification loss function, the positive and negative samples of the training set into the sparse pair loss function, and the model weights into the sparse loss function to calculate the classification loss value, sparse pair loss value, and sparse loss value. Step 4: Update the parameters of the bibranch adaptive neural network model based on the classification loss value, sparse pair loss value, and sparse loss value until the optimal bibranch adaptive neural network model is obtained; Step 5: Dynamically add a new classifier to the optimal bi-branch adaptive neural network model to obtain the incremental bi-branch adaptive neural network model; Step 6: Detect network traffic data online based on the incremental dual-branch adaptive neural network model, and adaptively identify malware or abnormal network traffic data; Step 3 involves substituting the model's predicted values ​​and label values ​​into the classification loss function, substituting the positive and negative samples from the training set into the sparse pair loss function, and substituting the model weights into the sparse loss function to calculate the classification loss value, sparse pair loss value, and sparse loss value. The methods for obtaining these values ​​include: Step 3.1: Substitute the model's predicted values ​​and label values ​​into the classification loss function to obtain the classification loss value; substitute the positive and negative samples of the training set into the sparse pair loss function to obtain the sparse pair loss value; and substitute the model weights into the sparse loss function to obtain the sparse loss value. The calculation expression for the classification loss function is as follows: ; In the formula, , , To input the total number of samples, For the first Each sample classification label value, No. The model predicts values ​​for each sample. The expression for calculating the sparse pair loss function is as follows: ; In the formula, To input the total number of categories, and These represent the normal network traffic from the training set, respectively. The similarity between positive samples and anomalous network traffic is the first. Similarity of anomalous network traffic For temperature coefficient, It is a mathematical constant; The calculation expression for the sparse loss function is as follows: ; In the formula, Indicates the first Weights of a dual-branch adaptive neural network model. For sparse parameters, This represents the number of weights in a two-branch adaptive neural network model. This represents the sparse loss function value.

2. The adaptive malware detection method based on network traffic according to claim 1, characterized in that, Step 1, which involves acquiring network traffic data and creating a network traffic dataset, includes the following steps: Step 1.1: Classify the acquired network traffic data to determine normal network traffic data and abnormal network traffic data; Step 1.2: Based on the MAC address and IP address of the network traffic data, perform data cleaning on normal network traffic data and abnormal network traffic data to obtain normal network traffic data and abnormal network traffic data with null and duplicate values ​​removed; Step 1.3: Generate image data with uniform length and format from normal network traffic data and abnormal network traffic data by deleting null and duplicate values; Step 1.4: Classify the image data according to the preset label values, determine the label value of each image data, and classify and store the image data according to the label values ​​to obtain the network traffic dataset for training; wherein, the preset label values ​​include: new category label values ​​and old category label values; Normal network traffic data is used as positive samples in the training set, while abnormal network traffic data is used as negative samples in the training set.

3. The adaptive malware detection method based on network traffic according to claim 1, characterized in that, The dual-branch adaptive neural network model includes a stability module and a plasticity module; wherein the stability module and the plasticity module are built using residual networks and PyTorch code. The stability module is used to detect and classify image data of old categories, and obtain data features associated with the old categories; The plasticity module is used to detect and classify new categories of image data to obtain data features associated with the new categories.

4. The adaptive malware detection method based on network traffic according to claim 1, characterized in that, Step 2 involves importing the network traffic data training set into a two-branch adaptive neural network model to obtain model predictions and model weights. Step 2.1: Input the image data into the dual-branch adaptive neural network model, extract the data features associated with the old category through the stability module, and extract the data features associated with the new category through the plasticity module; Step 2.2: Perform feature fusion based on the data features associated with the old category and the data features associated with the new category to obtain super features; Step 2.3: Input the super features into the classifier to obtain the model predictions and the model weights associated with the model predictions.

5. The adaptive malware detection method based on network traffic according to claim 1, characterized in that, Step 4 involves updating the parameters of the bibranch adaptive neural network model based on the classification loss value, sparse pair loss value, and sparse loss value until the optimal bibranch adaptive neural network model is obtained. The methods include: Step 4.1: Calculate the total loss value of the bi-branch adaptive neural network model by summing the classification loss value, the sparse pair loss value, and the sparse loss value. Step 4.2: Perform backpropagation based on the total loss value of the two-branch adaptive neural network model to obtain the gradient; Step 4.3: Update the parameters of the bibranch adaptive neural network model according to the gradient until the optimal bibranch adaptive neural network model is obtained.

6. The adaptive malware detection method based on network traffic according to claim 1, characterized in that, Step 5 involves dynamically adding new classifiers to the optimal bi-branch adaptive neural network model to obtain the incremental bi-branch adaptive neural network model. The methods include: Step 5.1: Freeze the stability module in the optimal bi-branch adaptive neural network model, and dynamically add new classifiers to the plasticity module to obtain a plasticity module with dynamically expanded new class detection capabilities; wherein, the new classifier has the ability to learn online to maintain new classification label values ​​for network traffic data; Step 5.2: Based on the frozen stability module and the plasticity module that dynamically expands the new category detection capability, obtain the incremental bi-branch adaptive neural network model.

7. An adaptive malware detection system based on network traffic, characterized in that, The method based on any one of claims 1 to 6 includes: Data acquisition and processing module, update module, online learning module, application module; The data acquisition and processing module is used to acquire network traffic data and create a network traffic dataset; The update module is used to import the network traffic data training set into the bi-branch adaptive neural network model to obtain the model prediction value and model weight; substitute the model prediction value and label value into the classification loss function, substitute the positive and negative samples of the training set into the sparse pair loss function, and substitute the model weight into the sparse loss function to calculate the classification loss value, sparse pair loss value, and sparse loss value; and update the bi-branch adaptive neural network model parameters according to the classification loss value, sparse pair loss value, and sparse loss value until the optimal bi-branch adaptive neural network model is obtained. The online learning module is used to dynamically add new classifiers to the optimal bi-branch adaptive neural network model to obtain an incremental bi-branch adaptive neural network model. The application module is used to detect network traffic data online based on the incremental dual-branch adaptive neural network model, and adaptively identify malicious software or abnormal network traffic data.

8. The adaptive malware detection system based on network traffic according to claim 7, characterized in that, The update module has preset training parameters for a bi-branch adaptive neural network model, including training step size, number of training iterations, and learning rate.