Model parameter dynamic adjustment method and device for malicious software detection

By monitoring the inference process of the malware detection model, generating incremental training data, and dynamically adjusting the model parameters, the problem of traditional detection methods being unable to cope with new types of attacks is solved, achieving higher detection accuracy and robustness.

CN121786834APending Publication Date: 2026-04-03HARBIN ANTIY TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-31
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Traditional malware detection methods rely on static rules and fixed models, which are difficult to cope with new and unknown attacks, leading to a decline in detection performance.

Method used

By monitoring the inference process of the malware detection model, incremental training data is generated and the model parameters are dynamically adjusted, enabling the model to adapt to changes in feature representation and improving the detection accuracy and robustness against new attacks.

Benefits of technology

This improves the model's detection accuracy and robustness in the face of new and unknown attacks, ensuring that the model can adapt to changes in the threat environment in a timely manner.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121786834A_ABST
    Figure CN121786834A_ABST
Patent Text Reader

Abstract

The invention discloses a model parameter dynamic adjustment method and device for malicious software detection, and belongs to the technical field of artificial intelligence. The method comprises the following steps: in a reasoning stage of a malicious software detection model, monitoring software feature representation input in a reasoning process, and determining whether the feature representation changes relative to learned features of the model; when it is determined that the feature representation changes, incremental training data is generated based on the changed feature representation; and dynamically adjusting model parameters by utilizing the incremental training data so as to enable the model to adapt to the change of the feature representation. According to the method, a dynamic adjustment mechanism is introduced, so that the model can adjust the model performance according to the change of input data and the evolution of threat features, and the detection accuracy and robustness of the model when facing novel and unknown attacks are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of machine learning, artificial intelligence, and cybersecurity, and in particular to a method and apparatus for dynamically adjusting model parameters for malware detection. Background Technology

[0002] In the field of malware detection, traditional static detection methods face increasing challenges as malware types and attack methods continue to evolve. These traditional techniques typically rely on static rules and fixed models, making it difficult to maintain good detection performance when facing new and unknown attacks. Summary of the Invention

[0003] This invention provides a method and apparatus for dynamically adjusting model parameters for malware detection. The technical solution is as follows: On the one hand, a method for dynamically adjusting model parameters for malware detection is provided, the method comprising: During the inference phase of the malware detection model, the input software feature representations are monitored during the inference process, and it is determined whether the feature representations have changed relative to the features already learned by the model. When it is determined that the feature representation has changed, incremental training data is generated based on the changed feature representation; The model parameters are dynamically adjusted using the incremental training data to adapt the model to changes in feature representation.

[0004] On the other hand, a device for dynamically adjusting model parameters for malware detection is provided, the device comprising: The determining unit is used to monitor the software feature representation input during the inference phase of the malware detection model and determine whether the feature representation has changed relative to the features already learned by the model. A generation unit is configured to generate incremental training data based on the changed feature representation when it is determined that the feature representation has changed. The adjustment unit is used to dynamically adjust the model parameters using the incremental training data so that the model can adapt to changes in feature representation.

[0005] On the other hand, a computer device is provided, the computer device including a memory and a processor, the memory for storing computer programs, and the processor for executing the computer programs stored in the memory to implement the steps of the above-described method for dynamically adjusting model parameters for malware detection.

[0006] On the other hand, a computer-readable storage medium is provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, it implements the steps of the above-described method for dynamically adjusting model parameters for malware detection.

[0007] On the other hand, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the above-described method for dynamically adjusting model parameters for malware detection.

[0008] The technical solution provided by this invention can bring at least the following beneficial effects: The system monitors the input malware feature representations during inference and determines whether these representations have changed relative to features already learned by the model. If a change occurs, incremental training data is generated based on this changed representation. This incremental training data is then used to dynamically adjust the model parameters, allowing the model to adapt to the changes in feature representations. Therefore, this invention, by introducing a dynamic adjustment mechanism, enables the model to adjust its performance according to changes in input data and the evolution of threat features, thereby improving the model's detection accuracy and robustness against novel and unknown attacks. Attached Figure Description

[0009] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0010] Figure 1 This is a flowchart of a method for dynamically adjusting model parameters for malware detection, provided by an embodiment of the present invention. Figure 2 This is a structural diagram of a model parameter dynamic adjustment device for malware detection provided in an embodiment of the present invention; Figure 3 This is a hardware architecture diagram of a computer device provided in an embodiment of the present invention. Detailed Implementation

[0011] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0012] Most current malware detection systems rely on fixed hyperparameter settings and model architectures. These static models can only be optimized based on training data and cannot be effectively dynamically adjusted according to real-time data. Therefore, when faced with emerging attack methods, detection systems often experience performance degradation and cannot adapt to changes in the threat environment in a timely manner.

[0013] Based on this, the inventive concept of the present invention is to provide a mechanism for dynamically adjusting model parameters, so that the model can automatically adjust the model parameters according to the input feature representation, thereby enhancing the model's responsiveness and adaptability to new types of malware.

[0014] Please refer to Figure 1 This invention provides a method for dynamically adjusting model parameters for malware detection, the method comprising: Step 100: During the inference phase of the malware detection model, monitor the input software feature representations during the inference process and determine whether the feature representations have changed relative to the features already learned by the model. Step 102: When it is determined that the feature representation has changed, incremental training data is generated based on the changed feature representation; Step 104: Dynamically adjust the model parameters using the incremental training data to adapt the model to changes in feature representation.

[0015] In this embodiment of the invention, the input malware feature representation is monitored during the inference process, and it is determined whether the feature representation has changed relative to the features already learned by the model. When the feature representation changes, incremental training data is generated based on the changed feature representation. This incremental training data is then used to dynamically adjust the model parameters, allowing the model to adapt to the changes in feature representation. Therefore, this invention, by introducing a dynamic adjustment mechanism, enables the model to adjust its performance according to changes in input data and the evolution of threat features, thereby improving the model's detection accuracy and robustness against new and unknown attacks.

[0016] The following description Figure 1 The execution method of each step is shown.

[0017] First, for step 100, during the inference phase of the malware detection model, the software feature representation input during the inference process is monitored, and it is determined whether the feature representation has changed relative to the features already learned by the model.

[0018] In detecting whether software is malware, one implementation can utilize the software's static and / or dynamic characteristics as feature representations.

[0019] In another implementation, the feature is represented as an image generated by structurally encoding a software binary file, where the spatial information in the image corresponds to the structural information in the binary file. This is because the byte sequence included in the software binary file contains the essential features of the software, which enable the model to more accurately identify the software. However, byte sequences cannot be used as training samples to train the model. Therefore, the software binary file can be structurally encoded into an image to utilize the image for model training and recognition.

[0020] In one embodiment of the present invention, in order to ensure that the spatial information in the encoded image corresponds to the structural information in the binary file, the structured encoding method may include: Step A1: Determine the encoding method of the structural information and the mapping relationship between binary bytes and image pixels.

[0021] In one embodiment of the present invention, the structural information includes: segment information and / or high-entropy regions.

[0022] The following sections explain segment information, high-entropy regions, and their encoding methods.

[0023] I. Segment Information.

[0024] In this embodiment of the invention, the structure of a binary file typically includes multiple distinct parts, such as code segments and data segments, each referred to as a segment. The location and content of segments within the binary file are crucial for malware identification. In this embodiment of the invention, by preserving segment information and optimizing it through an attention mechanism, the malware detection system can better understand the structural characteristics of the binary file.

[0025] In one implementation, segment information includes segment boundaries. Segment boundaries are physical separation points between different segments in a binary file, used to distinguish different parts of the binary file. In other words, during encoding, it's necessary to ensure that the image can distinguish which locations are segment boundaries.

[0026] In another implementation, the segment information also includes the segment type. Segment types can include: .text segment, .data segment, .bss segment, .rodata segment, .stack segment, and .heap segment. In other words, the encoded image needs to be able to distinguish which region contains which segment type.

[0027] Based on the content of segment information, in one embodiment of the present invention, the segment information is encoded in at least one of the following ways: each segment occupies a different area in the encoded image; different segments are distinguished by pixel intervals or line intervals; and different segment types are encoded using different colors.

[0028] II. High-entropy region.

[0029] High-entropy regions typically contain complex or random content and are often associated with malicious behavior. In this embodiment of the invention, high-entropy regions of the binary file are determined by calculating the byte probability distribution of each window region in the binary file one by one. The attention mechanism is optimized by extracting entropy features to accurately identify key parts of malicious files.

[0030] Encoding high-entropy regions can be achieved by setting the pixel positions of the encoded image corresponding to the byte range of the high-entropy region in the binary file as specific feature markers. These feature markers include specific colors and / or specific shapes. This allows the malware detection model to focus more on these high-entropy regions during training, improving the accuracy of malware detection.

[0031] In this embodiment of the invention, it is necessary to encode the byte sequence in the binary file into image pixels, therefore, it is necessary to determine the mapping relationship between binary bytes and image pixels. This mapping relationship can include single-channel mapping and multi-channel mapping. Single-channel mapping encodes one byte into one pixel; multi-channel mapping encodes multiple bytes (three bytes for RGB channels and four bytes for RGBA channels) into one pixel.

[0032] Step A2: Based on the encoding method and the mapping relationship, the binary file is structured and encoded into the image.

[0033] In this embodiment of the invention, after determining the encoding method of the structural information and the mapping relationship between binary bytes and image pixels, the binary file can be directly structured and encoded into an image according to the encoding method and the mapping relationship.

[0034] Since different software produces binary files of varying sizes, encoding images of the same size would result in structural distortion of the binary files. To further improve the accuracy of spatial information in images, in one embodiment of this invention, binary files of different sizes produce images of different sizes after structured encoding.

[0035] In one implementation, the size of the encoded image can be determined as follows: Based on the encoding method, the mapping relationship, and the total number of bytes in the binary file, determine the required total number of pixels; The initial line width is determined based on the total number of pixels and the target aspect ratio. The initial line width is then adjusted based on a preset line width range so that the adjusted adaptive line width is within the preset line width range. The size of the encoded image is then obtained based on the adjustment result.

[0036] Assuming the target aspect ratio is W / H and the total number of pixels is N, the initial line width can be determined by W×H≥N. To avoid extreme imbalance or excessively large blank areas, the line width can be adjusted to the preset line width range using the following formula: Adaptive line width = max(min(initial line width, maximum line width endpoint), minimum line width endpoint) This ensures that the adaptive line width remains within the preset line width range, and that the width and height of the image are as balanced as possible. Preferably, the preset line width range is 32-1024 bytes.

[0037] In this embodiment of the invention, by dynamically selecting an adaptive line width, the amount of data in each line is ensured to be appropriate, so as not to lose the relationship between segments. Using different line widths for different binary files ensures that each binary file can adapt to image generation while preserving the structural information of the binary file.

[0038] In this embodiment of the invention, in order to ensure that the malware detection model has high detection accuracy when facing new and unknown attacks, the malware feature representation input during the inference process can be monitored to see if it changes relative to the features already learned by the model. If it changes, it indicates that a new and unknown attack exists at this stage, and the malware detection model needs to adjust its parameters to cope with the situation.

[0039] In one embodiment of the present invention, determining whether the feature representation has changed relative to the features learned by the model includes: The feature representation is determined to have changed relative to the features already learned by the model if any of the following conditions are met: The first scenario: The model's confidence level in predicting the current input is lower than the first confidence threshold; The second scenario: The position of the currently input feature representation in the model feature space exceeds a first distance threshold when its minimum distance to the cluster centers of features of known categories exceeds a first distance threshold; and, The third scenario: The difference between the current input model's internal activation pattern and the historical activation pattern is higher than the first difference threshold.

[0040] The following sections will explain each of these three scenarios.

[0041] Regarding the first scenario: The malware detection model infers from the input software feature representation and outputs the inference result. This inference result includes at least a classification result and a prediction confidence level.

[0042] It is understandable that a well-trained model will give a high-confidence prediction when classifying familiar feature representations; conversely, if the input feature representation is not fully learned by the model, the model will still give a classification result, but it will be hesitant, resulting in a lower probability of the highest category output, that is, a lower prediction confidence.

[0043] Based on this, a first confidence threshold can be preset. If the model infers the current input feature representation and outputs the inference result, it is determined whether the prediction confidence in the inference result is lower than the first confidence threshold. If so, it is determined that the feature representation has changed relative to the features already learned by the model.

[0044] That is, the input feature representation is considered to have changed relative to the features already learned by the model when the following conditions exist: in, For the input feature representation, This is the first confidence threshold.

[0045] In this embodiment of the invention, the first confidence threshold can be predetermined by performing performance analysis on a validation set containing known positive and negative samples, or it can be dynamically adjusted according to the overall risk level of the detection environment.

[0046] By determining whether the first scenario exists, we can reflect the uncertainty of the model when faced with insufficiently learned or out-of-distribution samples.

[0047] Regarding the second scenario: During model training, the feature extraction layer extracts features from the feature representations of the input samples, and samples of the same category cluster together in the feature space. After model training is complete, the cluster centers for each known category feature vector are pre-stored. During inference, classification based on the input feature representation is performed based on the distance between the input feature representation and the cluster centers of the known categories.

[0048] If the input feature representation is far from the feature cluster centers of all known categories, but there is still a minimum distance, the category with the minimum distance is usually taken as the classification result. Therefore, a first distance threshold can be preset. If the minimum distance between the position of the current input feature representation in the model's feature space and the feature cluster centers of known categories exceeds the first distance threshold, it indicates that the feature representation of the current sample is far from the core distribution area of ​​all known categories, and it is determined that the feature representation has changed significantly relative to the features already learned by the model.

[0049] After the model is trained, feature cluster centers are maintained for each known category in the feature space. For input samples Its characteristic is denoted as The sample can be calculated using the following formula. Distance to the nearest cluster center: The input feature representation has changed relative to the features already learned by the model when the following conditions exist: in, For the sample Distance to the nearest cluster center This is the first distance threshold.

[0050] Similar to the method for determining the first confidence threshold, the first distance threshold can be predetermined by performing performance analysis on a validation set containing known positive and negative samples, or it can be dynamically adjusted according to the overall risk level of the detection environment.

[0051] By determining whether the second case exists, the structural shift of the input sample at the representation space level can be characterized.

[0052] Regarding the third scenario: Different input features will trigger specific activation patterns in different neurons or combinations of neurons within the model.

[0053] In this embodiment of the invention, the distribution of neuron activation values ​​in a specific network layer under normal input and known malicious input can be statistically analyzed, and a statistical baseline of historical activation patterns can be established based on the statistical results.

[0054] Specifically, the distribution of neuron activation values ​​in a specific network layer can be characterized by the activation matrix output by that specific network layer. Statistical features are calculated on the activation matrix, which can be the mean vector and standard deviation vector of activation values ​​in each channel. These statistical features are then used as the statistical baseline for historical activation patterns.

[0055] Historical activation patterns can include activation patterns from normal inputs and activation patterns from malicious inputs. When a new threat is introduced, it may trigger activation patterns that deviate significantly from this baseline. This specific network layer can be an intermediate convolutional layer or a fully connected layer.

[0056] In this embodiment of the invention, when performing statistical feature testing on the current input model internal activation mode and historical activation mode, if the difference between the statistical feature (e.g., mean) of the current input model internal activation mode and the statistical feature of the historical activation mode exceeds a first difference threshold, it is determined that the feature representation of the current input has triggered an abnormal model internal response, that is, the feature representation has changed relative to the features already learned by the model.

[0057] For a specific network layer pre-selected in the model, the activation statistics (such as channel mean vectors) corresponding to historical samples are used as the statistical baseline of historical activation patterns. For the sample The statistical characteristics of the activation patterns within the model are denoted as The difference between the statistical characteristics of the current input model's internal activation patterns and the statistical characteristics of historical activation patterns is: The input feature representation has changed relative to the features already learned by the model when the following conditions exist: in, For the degree of difference, This is the first difference threshold.

[0058] By using the existence of this third case as a criterion, it is possible to capture unstable behaviors of the model that are not explicitly reflected in the final output at the intermediate representation level.

[0059] The above three situations are used to perceive whether the input feature representation has changed from three dimensions: uncertainty of the model decision layer, geometric distribution of the feature space layer, and abnormality of the model's internal processing. As long as any of the above situations is met, the subsequent dynamic adjustment process is triggered.

[0060] Furthermore, to reduce the risk of any single indicator being falsely triggered in the above three situations, in a preferred embodiment of the present invention, the above three situations are combined to statistically score the change. When the change score exceeds the score threshold, it is determined that the input feature representation has changed relative to the features already learned by the model, thus triggering the subsequent dynamic adjustment process.

[0061] Specifically, the change score is calculated using the following formula: The input feature representation is considered to have changed relative to the features already learned by the model when the following conditions are met, thus triggering the subsequent dynamic adjustment process: in, Rate the changes. The feature distance reference value used for normalization can be the maximum value among the distances between the current input feature representation and the cluster centers of each feature. The activation difference reference value used for normalization can be the maximum value of each channel activation value in the current input model's internal activation mode. These are the weighting coefficients.

[0062] By combining multiple scenarios to statistically score changes, the stability and accuracy of feature change detection can be improved.

[0063] Then, for step 102, when it is determined that the feature representation has changed, incremental training data is generated based on the changed feature representation.

[0064] In this embodiment of the invention, when the feature representation changes, it indicates that the input software feature representation is a new feature for the model. In order for the model to learn the new feature, incremental training data can be generated based on the changed feature representation for subsequent dynamic adjustment of model parameters.

[0065] When the input feature representation changes, the model's inference results may also be inaccurate. In one implementation, when generating incremental training data, the inference results output by the model for the changed feature representation can be validated, and then the validation results can be used to generate incremental training data.

[0066] The verification of the reasoning results can be carried out through in-depth analysis processes such as sandbox analysis, dynamic behavior analysis, or manual review.

[0067] Verifying all inference results is costly. Therefore, in one embodiment of the present invention, a tiered verification method can be introduced. The generation of incremental training data can be achieved by: determining whether the inference results output by the model for the changed feature representation need to be verified based on the amount of change corresponding to the changed feature representation; if verification is required, incremental training data is generated based on the verification results; if not, incremental training data is generated based on the inference results.

[0068] Specifically, based on the amount of change corresponding to the changed feature representation, it is determined whether the inference results output by the model for the changed feature representation need to be verified, including: If any of the following conditions are found, then it is determined that the inference results output by the model for the changed feature representation need to be verified: The model's prediction confidence for the current input is lower than the second confidence threshold; the second confidence threshold is lower than the first confidence threshold. The current input feature represents its position in the model's feature space, and the minimum distance to the feature cluster center of the known category exceeds a second distance threshold; the second distance threshold is greater than the first distance threshold; and, The difference between the current input model's internal activation pattern and historical activation patterns is higher than the second difference threshold; the second difference threshold is greater than the first difference threshold.

[0069] Validation is required if the input sample meets any of the following conditions: ,and ; ,and ; ,and ; in, The second confidence threshold. The second distance threshold, This is the second difference threshold.

[0070] In this embodiment of the invention, when the feature representation of the model input changes, the model parameters need to be adjusted. However, when the change in the feature representation of the model input is large enough, it indicates that the model's inference results may not be accurate, thus requiring result verification. This method allows for rapid screening of which inference results need verification, improving the speed of incremental training.

[0071] Furthermore, when generating incremental training data, in order to reduce the noise introduced by unvalidated samples, training weights can be assigned to the samples: in, This is a sample Weights assigned when used as incremental training data; This indicates whether the sample has been validated. If it has been validated, the value is 1; otherwise, the value is 0. These are learnable parameters.

[0072] In this way, while ensuring model adaptability, the negative impact of high uncertainty samples on model stability can be suppressed.

[0073] The embodiments of the present invention can improve the quality of incremental training data through hierarchical verification and sample weight control.

[0074] Finally, for step 104, the model parameters are dynamically adjusted using the incremental training data to adapt the model to changes in feature representation.

[0075] In this embodiment of the invention, when the incremental training data reaches a certain amount, the model parameters can be dynamically adjusted by combining historical training data.

[0076] It should be noted that dynamic adjustment of model parameters does not involve a full update of all model parameters, but rather an adjustment of the controlled parameters of the model to ensure model stability and interpretability.

[0077] In one implementation, the controlled parameters of the model include at least one of the following: Low-rank adapter parameters (LoRA) in the Parameter Efficient Fine-Tuning Module (PEFT); Classification confidence mapping or calibration function parameters; Classification decision threshold parameters; and Some weight parameters in the output header (classification head).

[0078] The embodiments of the present invention only update the controlled parameters of the model, which can avoid catastrophic forgetting of the model and ensure the stable operation of the system.

[0079] In this embodiment of the invention, the methods for dynamically adjusting model parameters may include: online calibration, decision threshold reestimation, and mini-batch incremental training.

[0080] Online calibration primarily addresses the issue of inaccurate confidence levels in model outputs. The calibration goal is to align the model's confidence level with the actual accuracy, ensuring that the model parameters remain unchanged after calibration. Decision threshold re-evaluation, based on relatively reliable confidence levels, redetermines the confidence threshold according to the latest business objectives or data distribution. Mini-batch incremental training requires the model to learn new knowledge or correct systematic biases, resulting in changes to the model parameters after mini-batch incremental training.

[0081] In one implementation, the model parameter adjustment strategy can be generated by a policy network that receives feature change information of the current sample and outputs adjustment actions for the controlled parameters of the model.

[0082] The policy network is trained using a policy optimization method based on advantage estimation. Its reward signal is obtained by weighting multiple sub-rewards, which include at least two of the following: structural consistency reward, key element hit reward, and confidence calibration reward.

[0083] The structural consistency reward is used to evaluate whether the generated structured explanatory text conforms to the set structural specifications. The structural consistency score can be calculated based on the degree of conformity to the set structural specifications.

[0084] A key element hit reward is used to evaluate the degree of key element matching, and a key element hit score can be calculated based on the degree of matching. Key elements include at least malware family tags and attack behaviors. In one implementation, this key element hit score can be achieved using precision and recall.

[0085] The confidence calibration reward is used to calibrate the generated prediction confidence level to approximate a preset operational indicator. A confidence calibration score can be calculated based on the deviation between the generated prediction confidence level and the target confidence level threshold. This operational indicator may include the false positive rate (FPR) and the true positive rate (TPR).

[0086] After calculating the structural consistency score, key element hit score, and confidence calibration score, the reward signal can be calculated using a weighted method.

[0087] The optimization objective of the policy network is to maximize the long-term comprehensive reward, thereby learning the adjustment strategy for the controlled parameters of the model under different changing scenarios.

[0088] Furthermore, a rolling evaluation mechanism can be introduced during model deployment and operation. Within a fixed time window, operational metrics of the model during actual operation are statistically analyzed. These operational metrics may include the false positive rate (FPR) and the true positive rate (TPR). When the operational metrics deviate from the target range, at least one of the following operations can be triggered: adjusting the confidence calibration parameters, updating the classification threshold, or initiating a new round of mini-batch incremental training.

[0089] By introducing a rolling evaluation mechanism over time, the model parameters are adjusted to form a closed-loop process of "inference-evaluation-adjustment-re-inference", enabling the model to continuously adapt to the evolution of threat characteristics during long-term operation.

[0090] Please refer to Figure 2 This invention provides a device for dynamically adjusting model parameters for malware detection, the device comprising: The determining unit 200 is used to monitor the software feature representation input during the inference phase of the malware detection model and determine whether the feature representation has changed relative to the features already learned by the model. The generation unit 202 is used to generate incremental training data based on the changed feature representation when it is determined that the feature representation has changed. The adjustment unit 204 is used to dynamically adjust the model parameters using the incremental training data so that the model can adapt to changes in feature representation.

[0091] In one embodiment of the present invention, the feature is represented as an image generated by structurally encoding a software binary file, wherein the spatial information in the image corresponds to the structural information in the binary file.

[0092] In one embodiment of the present invention, when the determining unit performs the step of determining whether the feature representation has changed relative to the features already learned by the model, it specifically includes: The feature representation is determined to have changed relative to the features already learned by the model if any of the following conditions are met: The model's prediction confidence for the current input is lower than the first confidence threshold; The current input feature represents its position in the model's feature space, and its minimum distance to the feature cluster centers of known categories exceeds a first distance threshold; and, The difference between the current input model's internal activation pattern and historical activation patterns is higher than the first difference threshold.

[0093] In one embodiment of the present invention, the generation unit is specifically used to: determine whether it is necessary to verify the inference results output by the model for the changed feature representation based on the amount of change corresponding to the changed feature representation; if so, generate incremental training data based on the verification results; if not, generate incremental training data based on the inference results.

[0094] In one embodiment of the present invention, when the generation unit performs the step of determining whether it is necessary to verify the inference result output by the model for the changed feature representation based on the amount of change corresponding to the changed feature representation, the specific steps include: If any of the following conditions are found, then it is determined that the inference results output by the model for the changed feature representation need to be verified: The model's prediction confidence for the current input is lower than the second confidence threshold; the second confidence threshold is lower than the first confidence threshold. The current input feature represents its position in the model's feature space, and the minimum distance to the feature cluster center of the known category exceeds a second distance threshold; the second distance threshold is greater than the first distance threshold; and, The difference between the current input model's internal activation pattern and historical activation patterns is higher than the second difference threshold; the second difference threshold is greater than the first difference threshold.

[0095] In one embodiment of the present invention, the dynamically adjusted model parameter is at least one of the following model controlled parameters: Low-rank adapter parameters in the parameter high-efficiency fine-tuning module; Classification decision threshold parameters; and Some weight parameters in the output header.

[0096] It should be noted that the above-described embodiment of the dynamic adjustment device for model parameters in malware detection is merely an example illustrating the division of the functional modules. In practical applications, the functions can be assigned to different functional modules as needed, i.e., the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the above-described embodiment of the dynamic adjustment device for model parameters in malware detection and the embodiment of the method for dynamic adjustment of model parameters in malware detection belong to the same concept; their specific implementation process is detailed in the method embodiment and will not be repeated here.

[0097] Embodiments of this application also provide a computer device, please refer to... Figure 3The computer device includes a processor and a memory, the memory storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, at least one program, code set, or instruction set is loaded and executed by the processor to implement the method for dynamically adjusting model parameters for malware detection provided in the above-described method embodiments.

[0098] Embodiments of this application also provide a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, at least one program, code set, or instruction set is loaded and executed by a processor to implement the method for dynamically adjusting model parameters for malware detection provided in the above-described method embodiments.

[0099] Embodiments of this application also provide a computer program product, which includes a computer program. A processor of a computer device reads the computer program from a computer-readable storage medium and executes the computer program, causing the computer device to perform any of the above embodiments of the method for dynamically adjusting model parameters for malware detection.

[0100] For ease of description, the above systems or devices are described separately as various modules or units based on their functions. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware components.

[0101] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.

[0102] Finally, it should be noted that in this document, relational terms such as first, second, third, and fourth are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0103] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for dynamically adjusting model parameters for malware detection, characterized in that, The method includes: During the inference phase of the malware detection model, the input software feature representations are monitored during the inference process, and it is determined whether the feature representations have changed relative to the features already learned by the model. When it is determined that the feature representation has changed, incremental training data is generated based on the changed feature representation; The model parameters are dynamically adjusted using the incremental training data to adapt the model to changes in feature representation.

2. The method according to claim 1, characterized in that, The feature is represented as an image generated by structurally encoding a software binary file, wherein the spatial information in the image corresponds to the structural information in the binary file.

3. The method according to claim 1, characterized in that, Determining whether the feature representation has changed relative to the features already learned by the model includes: The feature representation is determined to have changed relative to the features already learned by the model if any of the following conditions are met: The model's prediction confidence for the current input is lower than the first confidence threshold; The current input feature represents its position in the model's feature space, and its minimum distance to the feature cluster centers of known categories exceeds a first distance threshold; and, The difference between the current input model's internal activation pattern and historical activation patterns is higher than the first difference threshold.

4. The method according to claim 3, characterized in that, The generation of incremental training data based on the changed feature representation includes: Based on the amount of change corresponding to the changed feature representation, determine whether it is necessary to verify the inference results output by the model for the changed feature representation; if so, generate incremental training data based on the verification results; if not, generate incremental training data based on the inference results.

5. The method according to claim 4, characterized in that, The determination of whether the inference results output by the model for the changed feature representation need to be verified based on the amount of change corresponding to the changed feature representation includes: If any of the following conditions are found, then it is determined that the inference results output by the model for the changed feature representation need to be verified: The model's prediction confidence for the current input is lower than the second confidence threshold; the second confidence threshold is lower than the first confidence threshold. The current input feature represents its position in the model's feature space, and the minimum distance to the feature cluster center of the known category exceeds a second distance threshold; the second distance threshold is greater than the first distance threshold; and, The difference between the current input model's internal activation pattern and historical activation patterns is higher than the second difference threshold; the second difference threshold is greater than the first difference threshold.

6. The method according to any one of claims 1-5, characterized in that, The dynamically adjusted model parameters are at least one of the following model-controlled parameters: Low-rank adapter parameters in the parameter high-efficiency fine-tuning module; Classification decision threshold parameters; and Some weight parameters in the output header.

7. A device for dynamically adjusting model parameters for malware detection, characterized in that, The device includes: The determining unit is used to monitor the software feature representation input during the inference phase of the malware detection model and determine whether the feature representation has changed relative to the features already learned by the model. A generation unit is configured to generate incremental training data based on the changed feature representation when it is determined that the feature representation has changed. The adjustment unit is used to dynamically adjust the model parameters using the incremental training data so that the model can adapt to changes in feature representation.

8. A computer device, characterized in that, The computer device includes a memory and a processor. The memory is used to store computer programs, and the processor is used to execute the computer programs stored in the memory to implement the steps of the method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the steps of the method described in any one of claims 1-6.

10. A computer program product, characterized in that, Includes a computer program, which, when executed by a processor, implements the steps of the method according to any one of claims 1-6.