Adaptive parameter adjustment method, system and device for coping with behavior pattern drift and medium

By using an adaptive parameter adjustment method, the parameters of the machine learning model are monitored and updated in real time, which solves the problem of behavior pattern drift caused by changes in the power grid environment, improves detection accuracy and model stability, and reduces computing resource consumption.

CN121614903APending Publication Date: 2026-03-06GUIZHOU POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511666603.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-14
Publication Date
2026-03-06

Smart Images

  • Figure CN121614903A_ABST
    Figure CN121614903A_ABST
Patent Text Reader

Abstract

The invention discloses a self-adaptive parameter adjustment method, system and device for coping with behavior mode drift and a medium, and belongs to the technical field of power system optimization, and the method comprises the steps: carrying out the statistics of historical behavior probability distribution and current observation probability distribution of a machine learning model, and judging whether the self-adaptive adjustment needs to be carried out or not; initial parameters of the machine learning model are obtained, an optimization objective function is constructed, parameter updating is carried out according to the offset degree, intermediate parameters are obtained, and then weighted fusion is carried out to obtain optimization parameters; applying the optimization parameters and comparing the performance evaluation indexes of the machine learning model before and after applying the optimization parameters, and determining whether to roll back the parameters of the machine learning model; according to the method, behavior drift is monitored in real time, and it is ensured that parameters of a machine learning model are adaptively adjusted in time when behavior mode drift occurs; in a parameter updating process, an optimization objective function considering detection precision and drift amplitude is constructed, so that adaptive adjustment of parameters is realized, and the suitability of a machine learning model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power system optimization technology, specifically to an adaptive parameter adjustment method, system, device, and medium for addressing behavior pattern drift. Background Technology

[0002] With the increasing complexity and diversity of power grid environments, state monitoring and security protection technologies based on operational behavior patterns have gradually become a research focus. Traditional detection models typically rely on fixed parameters trained from historical sample data. These parameters can effectively distinguish between normal and abnormal power grid conditions in the early stages of machine learning model deployment. However, over time, changes in electricity load characteristics, renewable energy output patterns, equipment health status, and new power grid attack methods cause the operational behavior distribution upon which the machine learning model relies to drift, reducing the accuracy of state identification and anomaly detection.

[0003] Behavioral pattern drift primarily stems from fluctuations in data distribution, meaning the statistical attributes of features no longer remain consistent. For example, user access frequency, request paths, or resource call patterns may change due to business adjustments; attackers may also iterate their attack strategies to gradually make abnormal behavior approach normal patterns. In such situations, fixed parameter configurations are difficult to adapt to dynamic environments, easily leading to an increase in false positives or false negatives.

[0004] Existing solutions often employ periodic retraining or manual parameter tuning to mitigate the degradation of machine learning models. However, these methods are inefficient and slow to respond. Periodic training consumes significant computational and storage resources, while manual parameter tuning heavily relies on the experience of technical personnel, making it difficult to achieve rapid convergence and real-time adaptation. Therefore, when faced with rapidly evolving behavioral patterns, such as high penetration rates of new energy sources and rapid load growth, existing technologies struggle to maintain the long-term stability and efficiency of detection models.

[0005] Therefore, there is an urgent need to introduce a method in the detection process that can adaptively adjust parameters according to dynamic changes in behavioral patterns to improve the robustness and flexibility of machine learning models in monitoring and control. Summary of the Invention

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

[0007] Therefore, the technical problem solved by this invention is that the distribution of the operating behavior on which the machine learning model depends drifts over time, thereby reducing the accuracy of the machine learning model's state identification and anomaly detection. It is difficult to maintain the long-term stability and efficiency of the machine learning model by periodically retraining or manually tuning parameters.

[0008] To solve the above-mentioned technical problems, the present invention provides the following technical solution: an adaptive parameter adjustment method for coping with behavioral pattern drift, comprising the following steps, The distribution of behavioral features in historical and current behavioral data of the machine learning model is statistically analyzed and normalized to obtain the historical behavior probability distribution and the current observation probability distribution. The degree of offset is calculated based on the historical behavior probability distribution and the current observation probability distribution, and it is determined whether adaptive adjustment is needed. Calculate the drift amount based on the degree of offset, and construct an optimization objective function; The initial parameters of the machine learning model for the current application are obtained and combined with the optimization objective function to update the parameters, resulting in intermediate parameters. The initial parameters and intermediate parameters are then weighted and fused to obtain the optimized parameters. Apply optimized parameters and compare the performance evaluation metrics of the machine learning model before and after applying the optimized parameters to determine whether to roll back the parameters of the machine learning model.

[0009] As a preferred embodiment of the adaptive parameter adjustment method for addressing behavioral pattern drift described in this invention, the steps of obtaining the historical behavior probability distribution and the current observation probability distribution include: Obtain historical behavioral data during the initial training phase of the machine learning model and current behavioral data after the machine learning model has been trained; The distribution of behavioral characteristics of historical behavioral data and current behavioral data are statistically analyzed to obtain the initial historical behavioral characteristics and the initial current behavioral characteristics. The initial historical behavior features and the initial current behavior features are normalized to obtain the historical behavior probability distribution and the current observation probability distribution.

[0010] As a preferred embodiment of the adaptive parameter adjustment method for addressing behavioral pattern drift described in this invention, the step of calculating the degree of shift and determining whether adaptive adjustment is necessary includes: Calculate the KL divergence and Wasserstein distance based on the historical behavior probability distribution and the current observation probability distribution, and output the KL divergence and Wasserstein distance as the degree of offset; Compare the KL divergence and Wasserstein distance with the set offset thresholds. If the KL divergence is greater than the set offset threshold or the Wasserstein distance is greater than the set offset threshold, adaptive adjustment is required. If the KL divergence is less than or equal to the set offset threshold and the Wasserstein distance is less than or equal to the set offset threshold, then no adaptive adjustment is required.

[0011] The beneficial effects of this preferred technical solution are as follows: by monitoring behavior drift in real time, the parameters of the machine learning model are adaptively adjusted in a timely manner when behavior pattern drift occurs; during the parameter update process, an optimization objective function that considers detection accuracy and drift amplitude is constructed to achieve adaptive adjustment of parameters, avoiding model adaptation deviation caused by single-dimensional optimization.

[0012] As a preferred embodiment of the adaptive parameter adjustment method for addressing behavioral pattern drift described in this invention, the steps of calculating the drift amount based on the degree of shift and constructing an optimized objective function include: The drift intensity is determined based on the KL divergence and Wasserstein distance; Construct an optimization objective function based on the drift intensity.

[0013] As a preferred embodiment of the adaptive parameter adjustment method for addressing behavioral pattern drift described in this invention, the step of weighted fusion of initial parameters and intermediate parameters to obtain optimized parameters includes: The initial parameters of the machine learning model for the current application are obtained and combined with the optimization objective function to update the parameters, thus obtaining intermediate parameters; The initial parameters and intermediate parameters are weighted and fused to obtain the optimized parameters.

[0014] As a preferred embodiment of the adaptive parameter adjustment method for addressing behavioral pattern drift described in this invention, the step of determining whether to roll back the parameters of the machine learning model includes: Deploy the optimized parameters to the machine learning model, replacing the initial parameters currently applied by the machine learning model, to ensure that the machine learning model processes the current behavioral data in real time based on the optimized parameters; Run the machine learning model with optimized parameters and obtain the updated performance evaluation metrics; Compare the updated performance evaluation metrics with the pre-update performance evaluation metrics of the machine learning model before deploying the optimized parameters. If the updated performance evaluation metrics are greater than the pre-update performance evaluation metrics, the machine learning model will continue to run with the optimized parameters. If the updated performance evaluation metric is less than or equal to the original performance evaluation metric, the optimized parameters will be replaced with the original running parameters and deployed to the machine learning model.

[0015] The beneficial effects of this preferred technical solution are: by comparing the model performance indicators before and after optimization, the effectiveness of parameter update results is ensured, closed-loop feedback verification is achieved, the detection accuracy of the machine learning model is improved, and misjudgment of state due to behavior drift is reduced.

[0016] As a preferred embodiment of the adaptive parameter adjustment method for addressing behavioral pattern drift described in this invention, the formula for constructing the optimization objective function based on the drift intensity is as follows: ; in, To optimize the objective function, we need to consider the overall loss of the machine learning model under parameter θ. For drift strength, For machine learning models in parameters The following performance evaluation metrics These are the weighting coefficients for performance indicators. The weighting coefficient for drift intensity; The formula for updating the initial parameters based on the objective function and drift intensity is as follows: ; in, To update and obtain the intermediate parameters for round t+1, Let be the initial parameters of the machine learning model in the t-th round. Let be the learning rate in round t. To optimize the objective function in terms of parameters Regarding The gradient.

[0017] The beneficial effects of this preferred technical solution are: by rapidly updating model parameters through gradient descent, it can quickly respond when behavioral pattern drift occurs, achieve efficient parameter adjustment, reduce computing resource consumption in scenarios with large amounts of data, and reduce hardware load and operation and maintenance costs.

[0018] This invention provides an adaptive parameter adjustment system for dealing with behavioral pattern drift.

[0019] To address the aforementioned technical problems, the present invention further provides the following technical solution: an adaptive parameter adjustment system for coping with behavioral pattern drift, comprising: Data acquisition module: Acquires the distribution of behavioral features from historical and current behavioral data of the machine learning model; Data calculation module: Statistically analyzes the distribution of behavioral characteristics in historical and current behavioral data, normalizes it to obtain the historical behavior probability distribution and the current observation probability distribution; calculates the degree of deviation based on the historical behavior probability distribution and the current observation probability distribution; Adaptive adjustment judgment module: Determines whether adaptive adjustment is needed based on the degree of offset; Parameter calculation module: Obtains the initial parameters of the machine learning model, constructs the optimization objective function and updates the parameters according to the offset to obtain intermediate parameters; and performs weighted fusion based on the initial parameters to obtain the optimized parameters. Performance evaluation module: Apply optimized parameters and compare the performance evaluation metrics of the machine learning model before and after applying optimized parameters to determine whether to roll back the parameters of the machine learning model.

[0020] The present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, characterized in that the processor, when executing the computer program, implements the steps of the adaptive parameter adjustment method for responding to behavioral pattern drift.

[0021] The present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that, when the computer program is executed by a processor, it implements the steps of the adaptive parameter adjustment method for responding to behavioral pattern drift.

[0022] The beneficial effects of this invention are as follows: By monitoring behavioral drift in real time, the parameters of the machine learning model are adaptively adjusted promptly when behavioral pattern drift occurs; during parameter update, an optimization objective function considering both detection accuracy and drift amplitude is constructed to achieve adaptive parameter adjustment, avoiding model adaptation bias caused by single-dimensional optimization; the gradient descent method is used to quickly update model parameters, reducing computational resource overhead in scenarios with large amounts of data and meeting the real-time requirements of power systems; by comparing model performance indicators before and after optimization, the validity of parameter update results is ensured, achieving closed-loop feedback verification, improving the detection accuracy of the machine learning model, and reducing misjudgments of state caused by behavioral drift. Attached Figure Description

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

[0024] Figure 1 The above is a flowchart of an adaptive parameter adjustment method for dealing with behavioral pattern drift, provided as an embodiment of the present invention.

[0025] Figure 2 The present invention provides a system flowchart of an adaptive parameter adjustment method for dealing with behavioral pattern drift, according to an embodiment of the present invention. Detailed Implementation

[0026] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.

[0027] Example 1, referring to Figure 1This is the first embodiment of the present invention, which provides an adaptive parameter adjustment method for responding to behavioral pattern drift, comprising: S100: Statistically analyze the distribution of behavioral features of historical and current behavioral data of the machine learning model, and normalize them to obtain the historical behavior probability distribution and the current observation probability distribution; S200: Calculate the degree of offset based on the historical behavior probability distribution and the current observation probability distribution, and determine whether adaptive adjustment is needed; S300: Obtain the initial parameters of the machine learning model, construct the optimization objective function, update the parameters according to the offset, and obtain the intermediate parameters; S400: Optimized parameters are obtained by weighted fusion of preliminary parameters; S500: Apply optimized parameters and compare the performance evaluation metrics of the machine learning model before and after applying optimized parameters to determine whether to roll back the parameters of the machine learning model.

[0028] It should be noted that traditional machine learning models typically rely on fixed parameters trained on historical sample data. These parameters can effectively distinguish between normal and abnormal operating conditions in the early stages of a machine learning model's deployment. However, as time goes on, the distribution of operating behaviors on which the machine learning model relies drifts, thereby reducing the accuracy of the machine learning model's state identification and anomaly detection. Improving the model through periodic retraining or manual parameter tuning is difficult to maintain the long-term stability and efficiency of the machine learning model. Therefore, real-time parameter adjustment of machine learning models is very important.

[0029] Therefore, to address the drift problem arising from the distribution of operational behaviors upon which machine learning models rely, an adaptive parameter adjustment method is constructed through steps S100-S500 to cope with behavioral pattern drift. Real-time monitoring of behavioral drift ensures timely adaptive adjustment of the machine learning model parameters when it occurs. During parameter updates, an optimization objective function considering both detection accuracy and drift amplitude is constructed to achieve adaptive parameter adjustment, avoiding model adaptation bias caused by single-dimensional optimization. Gradient descent is used to quickly update model parameters, reducing computational resource overhead in scenarios with large amounts of data and meeting the real-time requirements of power systems. By comparing model performance indicators before and after optimization, the validity of the parameter update results is ensured, achieving closed-loop feedback verification, improving the detection accuracy of the machine learning model, and reducing misjudgments of states caused by behavioral drift.

[0030] Example 2, refer to Figure 1 and Figure 2 This is the second embodiment of the present invention, which provides an adaptive parameter adjustment method to cope with behavioral pattern drift.

[0031] In this embodiment of the application, obtaining the historical behavior probability distribution and the current observation probability distribution in step S100 includes the following steps A1-A3: A1: Obtain historical behavior data during the initial training phase of the machine learning model and current behavior data after the machine learning model has been trained; In this embodiment of the application, it is assumed that an enterprise has deployed a power system substation equipment status monitoring model, and selected 100,000 load current monitoring data during the healthy operation phase of a transformer in a substation as historical behavior data; after the model is trained, the model is used to collect the load current monitoring data of the transformer for nearly 1 hour in real time as current behavior data.

[0032] A2: Statistically analyze the distribution of behavioral characteristics in historical behavioral data and current behavioral data respectively to obtain the initial historical behavioral characteristics and the initial current behavioral characteristics; In this application embodiment, the load current in the historical behavior data is classified into four different current values, and the number of times each load current is counted to obtain the initial historical behavior characteristics: 100A, 20,000 times, 120A, 30,000 times, 140A, 30,000 times, and 160A, 20,000 times. The load current in the current behavior data is classified into four different current values, and the number of times each load current is counted to obtain the initial current behavior characteristics: 100A, 100 times, 120A, 200 times, 140A, 300 times, and 160A, 400 times. A3: Normalize the initial historical behavior features and the initial current behavior features to obtain the historical behavior probability distribution and the current observation probability distribution; In this embodiment of the application, the formulas for obtaining the historical behavior probability distribution and the current observation probability distribution through normalization processing are as follows: in, The probability of the load current value occurring. To count the number of times each type of load current is used, x is the load current category index, and N is the number of load current categories. Substitute the initial historical behavior characteristics obtained in step A2 into the normalization formula to calculate the probability of each load current value, and obtain the historical behavior probability distribution as follows: 100A, 0.2, 120A, 0.3, 140A, 0.2, and 160A, 0.2. Substitute the initial current behavior features obtained in step A2 into the normalization formula to calculate the probability of each load current value, and obtain the current observation probability distribution as follows: 100A, 0.1, 120A, 0.2, 140A, 0.3, and 160A, 0.4.

[0033] In this embodiment of the application, the step S200 of calculating the degree of offset and determining whether adaptive adjustment is needed includes the following steps B1-B3: B1: Calculate the KL divergence and Wasserstein distance based on the historical behavior probability distribution and the current observation probability distribution, and output the KL divergence and Wasserstein distance as the degree of offset; In this embodiment of the application, the formula for calculating the KL divergence is: in, The KL divergence is the distance between the historical behavior probability distribution and the current observation probability distribution. For historical behavior probability distribution, This represents the current observation probability distribution; It should be noted that the larger the calculated KL divergence value, the more significant the information difference between the historical behavior probability distribution and the current observed probability distribution, and the higher the degree of behavior pattern drift. The formula for calculating the Wasserstein distance is: in, The Wasserstein distance between the historical behavior probability distribution and the current observation probability distribution. The optimal way to transport historical behavior probability distributions to previously observed probability distributions. To minimize the total transportation cost, The total transportation cost; Substituting the historical behavior probability distribution and the current observation probability distribution from step A3 into the KL divergence calculation formula and the Wasserstein distance calculation formula respectively, we obtain a KL divergence of 0.1215 and a Wasserstein distance of 10. It should be noted that the Wasserstein distance calculation formula is to find the transmission plan that minimizes the sum of the distances of each step of feature value transmission when transforming the historical behavior probability distribution into the current observation probability distribution. The final minimum sum is the Wasserstein distance. The larger the distance value, the more significant the difference in position or shape between the two distributions, and the higher the degree of behavior pattern drift.

[0034] B2: Compare the KL divergence with the divergence threshold, and compare the Wasserstein distance with the offset threshold. If the KL divergence is greater than the divergence threshold or the Wasserstein distance is greater than the offset threshold, adaptive adjustment is required. In this embodiment of the application, the divergence threshold is set to 0.2 and the offset threshold is 5. According to the KL divergence obtained in step B1, it is 0.1215 and the Wasserstein distance is 10. At this time, although the KL divergence is less than the divergence threshold, the Wasserstein distance is greater than the offset threshold, so adaptive adjustment is required. Continue with steps S300~S500 to adjust the parameters of the machine learning model. B3: If the KL divergence is less than or equal to the divergence threshold and the Wasserstein distance is less than or equal to the offset threshold, then no adaptive adjustment is required.

[0035] In this embodiment, the divergence threshold is set to 0.2 and the offset threshold is set to 5; the calculated KL divergence is set to 0.112 and the Wasserstein distance is set to 4. At this time, the KL divergence is less than the divergence threshold and the Wasserstein distance is less than the offset threshold, so no adaptive adjustment is required, and the parameters of the current machine learning model continue to run.

[0036] In an optional implementation, the degree of shift can also be calculated through the difference in distribution shape and the amplitude of characteristic fluctuations. The shape difference index between the historical behavior probability distribution and the current observed distribution is calculated, such as skewness difference and kurtosis difference. Skewness difference reflects the shift in the symmetry of the distribution, and kurtosis difference reflects the change in the steepness of the distribution. At the same time, the amplitude of fluctuation of characteristic values, such as the standard deviation ratio, is calculated to reflect the change in the dispersion of data. Skewness difference threshold, kurtosis difference threshold, and standard deviation ratio threshold are set. If any index exceeds the set threshold, it is determined that there is behavior drift.

[0037] In another alternative implementation, the degree of offset can also be calculated using the cumulative distribution function distance. By calculating the maximum difference of the cumulative distribution functions, i.e., the KS distance, the deviation of the two distributions in the overall cumulative trend is measured. At the same time, the overlap area of ​​the probability density function PDF is calculated to reflect the degree of distribution overlap. KS distance threshold and PDF overlap area threshold are set. If the KS distance is greater than the KS distance threshold or the PDF overlap area is less than the PDF overlap area threshold, then behavioral drift is determined to exist.

[0038] In this embodiment of the application, the step S300, which calculates the drift amount based on the degree of offset and constructs the optimization objective function, includes the following steps C1-C2: C1: The drift amount is determined based on the KL divergence and Wasserstein distance; In this embodiment of the application, the drift amount is calculated using the following formula: ; in, For drift amount, Let KL divergence be the KL divergence. For the divergence threshold, For Wasserstein distance, This is the offset threshold. For KL divergence weights, For offset weights; With the KL divergence set to 0.3, the divergence threshold to 0.2, the Wasserstein distance to 10, the offset threshold to 4, the KL divergence weight to 0.5, and the offset weight to 0.5, the drift amount is calculated to be 1 when substituted into the drift calculation formula. It should be noted that by quantizing the KL divergence and Wasserstein distance into calculable drift amounts using the drift amount calculation formula, a quantitative input basis is provided for subsequent parameter updates, which need to be combined with the drift amplitude. Furthermore, the weight coefficients of the divergence weight and the offset weight can be adjusted to meet the actual needs of engineering scenarios.

[0039] C2: Construct an optimization objective function based on the drift amount; In this embodiment of the application, the formula for constructing the optimization objective function based on the drift amount is as follows: ; in, To optimize the objective function, it is the comprehensive loss of the machine learning model under parameters θ, reflecting the combined cost of performance loss and drift adaptation requirements under the current parameters; For drift amount, For machine learning models in parameters The following performance evaluation metrics These are the weighting coefficients for performance indicators. The weighting coefficient for drift intensity; In the embodiments of this application, the machine learning model has parameters The performance evaluation index used is the F1 score. The F1 score of the machine learning model for detecting load current is set to 0.89. The drift amount is calculated to be 1 through step C1. The weight coefficient of the performance index is 0.6, and the weight coefficient of the drift intensity is 0.4. Substituting these values ​​into the optimization objective function, the optimization objective function is calculated to be 0.466.

[0040] In an alternative implementation, the objective function for optimization based on the drift amount can also be constructed using performance loss, drift intensity, and L1 regularization. When constructing the objective function, in addition to considering the current performance loss of the model and the drift intensity of the behavior pattern, an L1 regularization term is added to limit the sum of the absolute values ​​of the model parameters and avoid the model from overfitting due to too many or too large parameters. Furthermore, by setting the weights of the three, the objective function can ensure that the parameters remain sparse and concise while pursuing performance improvement and drift adaptation, thereby improving the model's generalization ability on new data.

[0041] In another alternative implementation, the objective function for optimization based on the drift amount can also be constructed using multi-task performance, drift intensity, and task weights. When constructing the objective function, the performance loss of each sub-task and the overall behavioral drift intensity are considered comprehensively, and weights are assigned to different tasks to reflect their importance. The objective function calculates the performance loss and drift intensity of each task by weighting, ensuring that the performance of high-weight tasks is prioritized when updating parameters, while also taking into account the overall adaptability to drift and balancing the needs among multiple tasks.

[0042] In this embodiment of the application, step S400 involves updating the parameters based on the initial parameters of the current machine learning model and the optimization objective function to obtain intermediate parameters. The weighted fusion of the initial parameters and intermediate parameters to obtain the optimized parameters includes the following steps D1-D2: D1: Obtain the initial parameters of the machine learning model for the current application, combine them with the optimization objective function to update the parameters, and obtain the intermediate parameters; In this embodiment, the formula for updating the initial parameters based on the objective function and the drift amount to obtain the intermediate parameters is as follows: ; in, To update and obtain the intermediate parameters for round t+1, Let be the initial parameters for the current application of the machine learning model in round t. Let be the learning rate in round t. To optimize the objective function in terms of parameters Regarding The gradient; In this embodiment, the machine learning model is set with initial parameters consisting of three main parameters: [0.4, 0.3, 0.2], and a learning rate of 0.0178. The gradient of the objective function with respect to each parameter is obtained by calculating the partial derivatives of the objective function with respect to each parameter through the backpropagation algorithm, which is [0.25, 0.18, 0.12]. Substituting these values ​​into the intermediate parameter calculation formula, the intermediate parameters are calculated as: [0.39555, 0.2966796, 0.197864]. D2: The initial parameters and intermediate parameters are weighted and fused to obtain the optimized parameters.

[0043] In this embodiment of the application, the formula for calculating the optimization parameters is: ; in, These are the optimized parameters after the (t+1)th round update. These are the intermediate parameters calculated in step D1 of round t+1. Let be the initial parameters for the current application of the machine learning model in round t. These are the weighting coefficients; The machine learning model is set with initial parameters consisting of three main parameters: [0.4, 0.3, 0.2]. The intermediate parameters are calculated in step D1 as [0.39555, 0.2966796, 0.197864], with a weight coefficient of 0.7. Substituting these parameters into the optimization parameter calculation formula, the optimized parameters are calculated as [0.3969, 0.2977, 0.1985].

[0044] In one alternative implementation, the parameter update magnitude of the machine learning model can be dynamically adjusted according to the degree of drift. First, the degree of drift is calculated and classified into mild, moderate and severe. When updating the parameters, the drift degree is classified into corresponding adjustment coefficients, and the components of the current parameters related to the drift feature are adjusted in a targeted manner according to the adjustment coefficients.

[0045] In another alternative implementation, parameter updates for the machine learning model can also focus on targeted updates of sensitive parameters. The model analysis reveals that some parameters are significantly more sensitive to changes in behavioral patterns than others. For example, the influence of a certain parameter on the model output increases by 30% when drift occurs. When updating parameters, only these highly sensitive parameters are adjusted, while the less sensitive parameters remain unchanged. This method of targeted updates of sensitive parameters can reduce interference with the overall stability of the machine learning model while dealing with drift.

[0046] In this embodiment of the application, determining whether to roll back the parameters of the machine learning model in step S500 includes the following steps E1-E3: E1: Deploy the optimized parameters to the machine learning model, replacing the initial parameters of the current application of the machine learning model to ensure that the machine learning model processes the current behavioral data in real time based on the optimized parameters; run the machine learning model after deploying the optimized parameters and obtain the updated performance evaluation metrics; In this embodiment of the application, the initial parameters of the machine learning model are [0.4, 0.3, 0.2], and the optimized parameters calculated in step D2 are [0.3969, 0.2977, 0.1985]. The optimized parameters [0.3969, 0.2977, 0.1985] are deployed to the machine learning model, and the machine learning model after the optimized parameters are deployed is run to monitor and collect the load current monitoring data of the transformer, and obtain the performance evaluation index after the machine learning model parameters are updated. In this embodiment of the application, the performance evaluation metric is the F1 score, and the F1 score after the machine learning model parameters are updated is 0.91.

[0047] E2: Compare the updated performance evaluation metrics with the pre-update performance evaluation metrics of the machine learning model before deploying the optimized parameters. If the updated performance evaluation metrics are greater than the pre-update performance evaluation metrics, the machine learning model will continue to run with the optimized parameters. In this embodiment of the application, the updated performance evaluation index of the machine learning model after parameter update is set to an F1 score of 0.91, and the pre-update performance evaluation index of the machine learning model before deploying optimized parameters is set to an F1 score of 0.89. At this time, the updated performance evaluation index is greater than the pre-update performance evaluation index, so the machine learning model continues to run using the optimized parameters calculated in step D2. E3: If the updated performance evaluation metric is less than or equal to the original performance evaluation metric, the optimized parameters will be replaced with the original running parameters and deployed to the machine learning model.

[0048] In this embodiment, the updated performance evaluation index of the machine learning model after parameter update is set to an F1 score of 0.88, and the pre-update performance evaluation index of the machine learning model before deploying optimized parameters is set to an F1 score of 0.89. At this time, the updated performance evaluation index is less than the pre-update performance evaluation index, so the machine learning model will abandon the optimized parameters calculated in step D2 and roll back the parameters, redeploy the initial parameters before parameter update to the machine learning model, and the machine learning model will run using the initial parameters.

[0049] It should be noted that step S500 ensures that the machine learning model pursues better performance through parameter optimization to cope with behavioral drift, and also controls the risk by comparing performance evaluation indicators, ensuring that the machine learning model always operates in a better state, balancing the benefits and potential risks brought by parameter updates.

[0050] In one alternative implementation, determining whether to roll back the parameters of the machine learning model can also be achieved through a statistical significance test. After deploying the optimized parameters, performance data is obtained through repeated tests. A t-test is used to determine whether the difference between the performance of the new parameters and the old parameters is statistically significant. If the test results show a significant difference, the new parameters are retained; if the difference is not significant, even if the mean is slightly higher, it is still determined to be random fluctuation, and the parameters are rolled back to the initial parameters.

[0051] In another alternative implementation, determining whether to roll back the parameters of the machine learning model can also be achieved by incorporating user feedback into the parameter retention decision. After applying the optimized parameters, in addition to the machine learning model's own performance metrics, feedback from actual users on the model's output results is collected, such as the error rate of manually labeled data and user satisfaction scores. This feedback is then fused with the performance metrics proportionally to obtain a fusion score. If the fusion score is lower than the initial parameters, a rollback is determined. If there are no negative changes in user feedback and the machine learning model metrics improve, the currently applied optimized parameters are retained.

[0052] Example 3, referring to Figure 1 This is a third embodiment of the present invention, which provides an adaptive parameter adjustment system for responding to behavioral pattern drift, comprising: Data acquisition module: Acquires the distribution of behavioral features from historical and current behavioral data of the machine learning model; Data calculation module: Statistically analyzes the distribution of behavioral characteristics in historical and current behavioral data, normalizes it to obtain the historical behavior probability distribution and the current observation probability distribution; calculates the degree of deviation based on the historical behavior probability distribution and the current observation probability distribution; Adaptive adjustment judgment module: Determines whether adaptive adjustment is needed based on the degree of offset; Parameter calculation module: Obtains the initial parameters of the machine learning model, constructs the optimization objective function and updates the parameters according to the offset to obtain intermediate parameters; and performs weighted fusion based on the initial parameters to obtain the optimized parameters. Performance evaluation module: Apply optimized parameters and compare the performance evaluation metrics of the machine learning model before and after applying optimized parameters to determine whether to roll back the parameters of the machine learning model.

[0053] Example 4, the fourth embodiment of the present invention, differs from the previous three embodiments in that: if the function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

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

[0055] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.

[0056] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0057] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method of adaptive parameter adjustment to cope with behavior pattern drift, characterized in that, The method comprises the following steps: statistical machine learning model of the historical behavior data and the current behavior data of the behavior characteristics distribution, and normalization to obtain the historical behavior probability distribution and the current observation probability distribution; According to the historical behavior probability distribution and the current observation probability distribution, the offset degree is calculated and it is judged whether adaptive adjustment is needed; According to the offset degree, the drift amount is calculated, and the optimization objective function is constructed; Get the initial parameters of the current application of the machine learning model, combine the optimization objective function to update the parameters, get the intermediate parameters, and get the optimization parameters by weighting and fusing the initial parameters and the intermediate parameters; Apply the optimization parameters and compare the performance evaluation indexes of the machine learning model before and after applying the optimization parameters to determine whether to roll back the parameters of the machine learning model.

2. The method of claim 1, wherein, The step of obtaining the historical behavior probability distribution and the current observation probability distribution comprises: Get the historical behavior data in the initial training stage of the machine learning model and the current behavior data after the training of the machine learning model is completed; Statistical behavior feature distribution of historical behavior data and current behavior data respectively, get initial historical behavior feature and initial current behavior feature; The initial historical behavior feature and the initial current behavior feature are normalized to obtain the historical behavior probability distribution and the current observation probability distribution.

3. The method of claim 2, wherein the step of adjusting the parameter comprises: The step of calculating the offset degree and judging whether adaptive adjustment is needed comprises: According to the historical behavior probability distribution and the current observation probability distribution, the KL divergence and the Wasserstein distance are calculated respectively, and the KL divergence and the Wasserstein distance are output as the offset degree; Compare the KL divergence and the Wasserstein distance with the set offset threshold value, if the KL divergence is greater than the set offset threshold value or the Wasserstein distance is greater than the set offset threshold value, adaptive adjustment is needed; If the KL divergence is less than or equal to the set offset threshold value and the Wasserstein distance is less than or equal to the set offset threshold value, adaptive adjustment is not needed.

4. The method of claim 3, wherein the step of adjusting the parameter comprises: The step of calculating the drift amount according to the offset degree and constructing the optimization objective function comprises: According to the KL divergence and the Wasserstein distance, the drift intensity is determined; According to the drift intensity, the optimization objective function is constructed.

5. A method of adaptive parameter adjustment to cope with behavior pattern drift as claimed in claim 4, wherein, The step of weighting and fusing the initial parameters and the intermediate parameters to obtain the optimization parameters comprises: Get the initial parameters of the current application of the machine learning model, combine the optimization objective function to update the parameters, get the intermediate parameters; Weight and fuse the initial parameters and the intermediate parameters to obtain the optimization parameters.

6. A method of adaptive parameter adjustment to cope with behavior pattern drift as claimed in claim 5, wherein, The step of determining whether to roll back the parameters of the machine learning model comprises: Deploy the optimization parameters to the machine learning model, replace the initial parameters currently applied by the machine learning model to ensure that the machine learning model processes the current behavior data based on the optimization parameters in real time; Run the machine learning model after deploying the optimization parameters, and get the updated performance evaluation index; Compare the updated performance evaluation index with the updated performance evaluation index of the machine learning model before deploying the optimization parameters, if the updated performance evaluation index is greater than the updated performance evaluation index, the machine learning model applies the optimization parameters for continuous operation; If the performance evaluation index after the update is less than or equal to the performance evaluation index before the update, the optimization parameter is replaced by the original running parameter to deploy to the machine learning model.

7. The method of claim 4, wherein the step of adjusting the parameter comprises the step of: adjusting the parameter based on the difference between the current behavior pattern and the target behavior pattern. The formula for constructing the optimization objective function according to the drift intensity is: ; in, To optimize the objective function, we need to consider the overall loss of the machine learning model under parameter θ. For drift strength, For machine learning models in parameters The following performance evaluation metrics These are the weighting coefficients for performance indicators. The weighting coefficient for drift intensity; The formula for updating the initial parameter according to the objective function and the drift intensity is: ; wherein, is the updated intermediate parameter of the t+1th round, is the initial parameter of the tth round machine learning model, is the learning rate of the tth round, is the gradient of the optimization objective function with respect to at the parameter .

8. An adaptive parameter adjustment system for coping with behavior pattern drift, applying an adaptive parameter adjustment method for coping with behavior pattern drift according to any one of claims 1 to 7, characterized in that The method comprises the following steps: a data acquisition module: acquiring the behavior feature distribution of the historical behavior data and the current behavior data of the machine learning model; a data calculation module: calculating the behavior feature distribution of the historical behavior data and the current behavior data, normalizing to obtain the historical behavior probability distribution and the current observation probability distribution, and calculating the offset degree according to the historical behavior probability distribution and the current observation probability distribution; an adaptive adjustment judgment module: judging whether adaptive adjustment is needed according to the offset degree; a parameter calculation module: acquiring the initial parameter of the machine learning model, constructing the optimization objective function, and updating the parameter according to the offset degree to obtain the intermediate parameter; the optimization parameter is obtained by weighted fusion according to the preliminary parameter; an effect evaluation module: applying the optimization parameter and comparing the performance evaluation index of the machine learning model before and after the application of the optimization parameter to determine whether to roll back the parameter of the machine learning model. 9.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-8 when the computer program is executed by the processor. The processor executes the computer program to realize the steps of the adaptive parameter adjustment method for coping with behavior pattern drift according to any one of claims 1 to 7.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to realize the steps of the adaptive parameter adjustment method for coping with behavior pattern drift according to any one of claims 1 to 7.