A semi-supervised concept drift detection and adaptation method based on conformal martingale framework
By applying semi-supervised learning method under the conformal martingale framework, using conformal prediction framework and martingale value detection technology, the problems of concept drift and high data annotation costs in dynamic industrial environments are solved, and efficient adaptation and performance improvement of regression models are achieved. .
Patent Information
- Application Number
- CN202410967367.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-07-18
AI Technical Summary
In dynamic industrial environments, prior art is difficult to effectively detect and cope with concept drift and high data annotation costs, especially in regression tasks, where a unified framework is lacking to deal with these challenges.
The semi-supervised learning method based on the conformal martingale framework is adopted to calculate the prediction interval and width of labelless data points through the conformal prediction framework, select high reliability samples, update the regression model, and use martingale value to detect concept drift.
It realizes timely and accurately detects concept drift in a dynamic environment, and reduces data annotation costs through semi-supervised learning, significantly improving the performance and adaptability of the regression model.
Smart Images

Figure CN118885983B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of concept drift detection, and in particular, to a semi-supervised concept drift detection and adaptation method based on a conformal martingale framework. Background Art
[0002] In nonferrous metal smelting, aluminum is an important nonferrous metal and is widely used in many fields such as transportation, building materials, power transmission and aerospace industry. In the production process of aluminum, alumina plays a key role as an important raw material. The Bayer process is currently the main process for producing alumina, in which the evaporation process is a very critical process. The evaporation process mainly improves product quality by concentrating a certain aqueous solution and controlling the concentration of the discharged alkali solution (i.e., the NaOH concentration), as well as precipitating impurity solutes through the evaporator. In this industrial production process, the NaOH concentration has a decisive influence on the quality of the final product, and accurately predicting the NaOH concentration for monitoring becomes the key to production control. However, in a dynamic industrial environment, challenges such as concept drift and high data annotation costs are often encountered. Concept drift refers to the phenomenon that the statistical characteristics of data change over time, which may lead to a decline in model performance. In order to overcome these challenges, concept drift detection technology and semi-supervised learning methods are widely used to alleviate the problems of model performance degradation and high data annotation costs. Therefore, developing a method to detect concept drift and deal with data annotation cost problems in a timely and accurate manner is the current research focus and technical challenge in this field.
[0003] When dealing with the problem of high cost of obtaining labeled data in industrial scenarios, the self-training strategy is an effective semi-supervised learning method. In the self-training strategy, the learning process is optimized by selecting high-reliability samples and generating pseudo labels for them. Among them, the accurate selection of high-reliability samples is particularly critical. In classification problems, judgments can be made directly based on the output classification probability; however, there is a lack of a direct measurement indicator in regression problems. In classification problems, the introduction of the conformal prediction framework provides an effective way to select high-reliability samples. Due to the flexibility of the calculation form of its inconsistency score, this framework is not only applicable to classification problems, but can also be extended to regression problems, providing a standard for selecting high-reliability samples.
[0004] In the research field of concept drift detection, there are mainly methods based on statistical tests, model performance monitoring, and data distribution analysis. Although these methods have been widely used in classification tasks, the research on concept drift detection technology for regression tasks is still relatively insufficient. The application of the conformal martingale framework in classification problems demonstrates its potential in dealing with concept drift detection. Also due to the flexibility in the calculation of inconsistency scores, this framework also provides an effective tool for concept drift detection in regression problems. In addition, compared with traditional methods, the method based on the conformal martingale framework does not rely on any assumptions about data distribution, making it adaptable to various practical application scenarios. The sensitivity of this method to new data and its ability to respond in real time ensure its effectiveness in dynamic environments.
[0005] In dynamic industrial environments, the high cost of data annotation often makes it impossible to obtain labeled data in a timely manner, which affects the performance of the prediction model. In addition, the existence of concept drift may cause the model performance to decay. Although existing concept drift detection techniques have been widely used in classification tasks, research on regression tasks is still relatively insufficient. At present, there is still a lack of a unified framework that can handle both the high cost of data annotation and concept drift detection. Summary of the invention
[0006] According to the technical problems raised above, a semi-supervised concept drift detection and adaptation method based on a conformal martingale framework is provided. The present invention timely detects and adapts to concept drift while overcoming the challenge of high data annotation costs.
[0007] The technical means adopted by the present invention are as follows:
[0008] A semi-supervised concept drift detection and adaptation method based on a conformal martingale framework, comprising:
[0009] S1. Collect the variables X and data labels Y of the aluminum oxide evaporation process from industrial sensors to form a data set of the aluminum oxide evaporation process and perform preprocessing operations of dividing and standardizing all data sets;
[0010] S2. According to the actual characteristics of the data set of the aluminum oxide evaporation process, an initial regression model is constructed, the initial regression model is trained using the labeled data set, and the unlabeled data set is predicted;
[0011] S3, based on the conformal prediction framework, calculate the prediction interval and width of the unlabeled data points, set a threshold δ, and select data points whose width is less than the set threshold δ to form a high reliability sample set;
[0012] S4, merging the high reliability sample set with the original label data set to form a new extended training set, and using the new extended training set to update the regression model;
[0013] S5, using the regression model updated in step S4 to calculate the inconsistency score, p-value and martingale value of the calibration set and the test set, and setting a threshold γ. If the martingale value exceeds the threshold γ, it is determined that concept drift has occurred;
[0014] S6. Use the data after the concept drift occurs to retrain the regression model and obtain a new model to adapt to subsequent data;
[0015] S7. The mean absolute error and mean square error are used as evaluation indicators to calculate the MAE and MSE before and after the introduction of the high reliability training set and before and after the concept drift detection and adaptation of the test set to evaluate the effectiveness of the method.
[0016] Furthermore, step S1 specifically includes:
[0017] S11. Divide the data set D = {X, Y} into training set D train , D train ={(x1,y1),…,(x m ,y m )} and calibration set D cal , D cal ={(x m+1 ,y m+1 ),…,(x n ,y n )}; and prepare the test set T data ={(x n+1 ,y n+1 ),…,(x n+q ,y n+q )},q≥1; in the data set D={X,Y}, represents the feature matrix, represents the target variable;
[0018] S12. Standardize the features in the training set, calibration set, and test set as follows:
[0019]
[0020] Among them, x ij represents the original value of the jth feature of the feature matrix in the i-th sample; μ j represents the mean of all samples of the jth feature, σ j represents the standard deviation of all samples of the jth feature, x' ij Represents the standardized value, and the standardized feature set of each data set is obtained.
[0021] Further, step S2 specifically includes:
[0022] S21. Select regression model f according to the characteristics of the actual data set and use the labeled data set D L Train regression model f;
[0023] S22. Use the trained regression model f to analyze the unlabeled dataset D U For each data point in the prediction, we get the prediction result f(x i ),x i ∈D U .
[0024] Furthermore, step S3 specifically includes:
[0025] S31, according to the prediction results obtained in step S22, use the conformal prediction framework to calculate the prediction interval and its width for each prediction value, and the calculation formula is as follows:
[0026]
[0027] in, Indicates the inconsistency scores of the test set samples in descending order. values,
[0028] S32. Calculate the inconsistency score. The calculation formula is as follows:
[0029]
[0030] Among them, μ i represents ln(|y i -f(x i )|)’s predicted value;
[0031] S33, set a threshold δ, select data points whose prediction interval width is less than the threshold δ, and form a high reliability sample set U high_conf .
[0032] Further, step S4 specifically includes:
[0033] S41, the high reliability sample set U obtained in step S33 high_conf Compared with the original labeled dataset D L Merge to form a new extended training set D train_expanded ;
[0034] S42. Use the new extended training set D train_expanded Update the regression model.
[0035] Furthermore, step S5 specifically includes:
[0036] S51. For each data point T in the test set data[i], calculate the martingale value M[i] of each data point based on the conformal martingale framework, and initialize the martingale value sequence M[0] = 1;
[0037] S52, for the sample points in the test set, use the calibration set D cal and the test set T data The inconsistency score is calculated, and the p-value of each sample point in the test set is calculated as follows:
[0038]
[0039] Where θ represents a random number in the interval [0,1], and nm represents the number of data points in the calibration set;
[0040] S53. Based on the p-value sequence, construct the martingale value sequence as follows:
[0041]
[0042] Among them, ε∈(0,1), represents the conformal martingale value of the j-th sample point in the test set, represents the conformal martingale value of the j-1th sample point, p j Represents the p-value of the j-th sample point. If the conformal martingale value exceeds the predetermined threshold γ, it means that the concept drift is detected and the martingale value M[i] is reset to 1.
[0043] Further, step S6 specifically includes:
[0044] If concept drift occurs at the i-th sample point, use T data [i:] Retrain the regression model to get a new model f new .
[0045] Further, step S7 specifically includes:
[0046] S71. Define the evaluation index MAE as follows:
[0047]
[0048] Among them, y i represents the true value, f(x i ) represents the predicted value, n represents the number of samples;
[0049] S72. Define the evaluation index MSE as follows:
[0050]
[0051] S73. Calculate the MAE and MSE of the training set before and after the introduction of the high reliability sample set; calculate the MAE and MSE of the test set before and after the introduction of concept drift detection and adaptation.
[0052] Compared with the prior art, the present invention has the following advantages:
[0053] 1. The present invention provides a semi-supervised concept drift detection and adaptation method based on a conformal martingale framework. First, a semi-supervised learning method based on a conformal prediction framework effectively improves the accuracy of the original training model, providing a high-quality model foundation for subsequent concept drift detection. Subsequently, the conformal martingale framework is used to effectively identify the location where the concept drift occurs. After concept drift detection and adaptation, the accuracy of the test set is significantly improved, which illustrates the effectiveness of concept drift detection.
[0054] 2. The semi-supervised concept drift detection and adaptation method based on the conformal martingale framework provided by the present invention not only effectively addresses the dual challenges of concept drift and high data annotation costs, but also significantly improves the performance of the basic prediction model and the test environment model. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0056] Figure 1 The figure is a flow chart of the method of the present invention.
[0057] Figure 2 The embodiment of the present invention provides a high-reliability sample selection process based on the first 100 unlabeled sample points of the aluminum oxide evaporation process data set.
[0058] Figure 3 A conceptual drift detection diagram based on an aluminum oxide evaporation process data set provided in an embodiment of the present invention.
[0059] Figure 4 MAE indicator diagrams of the training set before and after semi-supervised learning and the test set concept drift detection and adaptation before and after provided in the embodiment of the present invention.
[0060] Figure 5 MSE indicator diagrams of the training set before and after semi-supervised learning and the test set concept drift detection and adaptation before and after provided in the embodiment of the present invention. DETAILED DESCRIPTION
[0061] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0062] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0063] like Figure 1 As shown, the present invention provides a semi-supervised concept drift detection and adaptation method based on a conformal martingale framework, comprising:
[0064] S1. Collect the variables X and data labels Y of the aluminum oxide evaporation process from industrial sensors to form a data set of the aluminum oxide evaporation process and perform preprocessing operations of dividing and standardizing all data sets;
[0065] S2. According to the actual characteristics of the data set of the aluminum oxide evaporation process, an initial regression model is constructed, the initial regression model is trained using the labeled data set, and the unlabeled data set is predicted;
[0066] S3, based on the conformal prediction framework, calculate the prediction interval and width of the unlabeled data points, set a threshold δ, and select data points whose width is less than the set threshold δ to form a high reliability sample set;
[0067] S4, merging the high reliability sample set with the original label data set to form a new extended training set, and using the new extended training set to update the regression model;
[0068] S5, using the regression model updated in step S4 to calculate the inconsistency score, p-value and martingale value of the calibration set and the test set, and setting a threshold γ. If the martingale value exceeds the threshold γ, it is determined that concept drift has occurred;
[0069] S6. Use the data after the concept drift occurs to retrain the regression model to obtain a new model;
[0070] S7. Mean Absolute Error (MAE) and Mean Squared Error (MSE) are used as evaluation indicators. MAE and MSE are calculated before and after the introduction of the high-reliability training set and before and after the concept drift detection and adaptation of the test set to evaluate the effectiveness of the method.
[0071] In specific implementation, as a preferred embodiment of the present invention, step S1 specifically includes:
[0072] S11. Divide the data set D = {X, Y} into training set D train , D train ={(x1,y1),…,(x m ,y m )} and calibration set D cal , D cal ={(x m+1 ,y m+1 ),…,(x n ,y n )}; and prepare the test set T data ={(x n+1 ,y n+1 ),…,(x n+q ,y n+q )},q≥1; in the data set D={X,Y}, represents the feature matrix, represents the target variable;
[0073] S12. Standardize the features in the training set, calibration set, and test set as follows:
[0074]
[0075] Among them, x ij represents the original value of the jth feature of the feature matrix in the i-th sample; μ j represents the mean of all samples of the jth feature, σ j represents the standard deviation of all samples of the jth feature, x' ij Represents the standardized value, and the standardized feature set of each data set is obtained.
[0076] In this embodiment, D train The size is 2833, where D L The size is 654, D U The size is 2179, D calThe size is 281, T data The size is 1017, and the data set D includes 12 input variables and 1 output variable.
[0077] In specific implementation, as a preferred embodiment of the present invention, step S2 specifically includes:
[0078] S21. Select regression model f according to the characteristics of the actual data set and use the labeled data set D L Train regression model f;
[0079] S22. Use the trained regression model f to analyze the unlabeled dataset D U For each data point in the prediction, we get the prediction result f(x i ),x i ∈D U .
[0080] In this embodiment, the basic prediction model selects the stochastic gradient descent regression model.
[0081] In specific implementation, as a preferred embodiment of the present invention, step S3 specifically includes:
[0082] S31, according to the prediction results obtained in step S22, use the conformal prediction framework to calculate the prediction interval and its width for each prediction value, and the calculation formula is as follows:
[0083]
[0084] in, Indicates the inconsistency scores of the test set samples in descending order. values,
[0085] S32. Calculate the inconsistency score. The calculation formula is as follows:
[0086]
[0087] Among them, μ i represents ln(|y i -f(x i )|) based on the regression model trained on the training dataset.
[0088] S33, set a threshold δ, select data points whose prediction interval width is less than the threshold δ, and form a high reliability sample set U high_conf .
[0089] In this embodiment, the threshold δ is 55, and the high reliability sample set U high_conf The size is 1511. Figure 2As shown, samples with narrower prediction intervals are selected and added to the high reliability sample set, where the points marked are the points where the prediction interval width is less than δ.
[0090] In specific implementation, as a preferred embodiment of the present invention, step S4 specifically includes:
[0091] S41, the high reliability sample set U obtained in step S33 high_conf Compared with the original labeled dataset D L Merge to form a new extended training set D train_expanded ;
[0092] S42. Use the new extended training set D train_expanded Update the regression model.
[0093] In this embodiment, the new extended training set D train_expanded The size is 2165.
[0094] In specific implementation, as a preferred embodiment of the present invention, step S5 specifically includes:
[0095] S51. For each data point T in the test set data [i], calculate the martingale value M[i] of each data point based on the conformal martingale framework, and initialize the martingale value sequence M[0] = 1;
[0096] S52, for the sample points in the test set, use the calibration set D cal and the test set T data The inconsistency score is calculated, and the p-value of each sample point in the test set is calculated as follows:
[0097]
[0098] Where θ represents a random number in the interval [0,1], and nm represents the number of data points in the calibration set;
[0099] S53. Based on the p-value sequence, construct the martingale value sequence as follows:
[0100]
[0101] Among them, ε∈(0,1), represents the conformal martingale value of the j-th sample point in the test set, represents the conformal martingale value of the j-1th sample point, p j Represents the p-value of the j-th sample point. If the conformal martingale value exceeds the predetermined threshold γ, it means that the concept drift is detected and the martingale value M[i] is reset to 1.
[0102] In this embodiment, the threshold γ is 1.5; Figure 3 As shown in the figure, a significant drift point is successfully identified in the alumina evaporation process data set, indicating that the data distribution has changed and the model needs to be adjusted accordingly.
[0103] In specific implementation, as a preferred embodiment of the present invention, step S6 specifically includes:
[0104] If concept drift occurs at the i-th sample point, use T data [i:] Retrain the regression model to get a new model f new .
[0105] In this embodiment, the conceptual drift position based on the aluminum oxide evaporation process data set is the 14th sample point, that is, using T data [14:] Retrain the regression model.
[0106] In specific implementation, as a preferred embodiment of the present invention, step S7 specifically includes:
[0107] S71. Define the evaluation index MAE as follows:
[0108]
[0109] Among them, y i represents the true value, f(x i ) represents the predicted value, n represents the number of samples;
[0110] S72. Define the evaluation index MSE as follows:
[0111]
[0112] S73. Calculate the MAE and MSE of the training set before and after the introduction of the high reliability sample set; calculate the MAE and MSE of the test set before and after the introduction of concept drift detection and adaptation.
[0113] In this embodiment, Figure 4 As shown in Figure 2, after the model was trained with a high reliability sample set, the MAE of the training set dropped from 4.6569 to 2.8285, and the MSE dropped from 43.8390 to 18.8775. Figure 5 As shown in the figure, after concept drift detection and adaptation, the MAE of the test set dropped from 5.0379 to 0.6191, and the MSE dropped from 46.4957 to 1.1456. This verifies that the method of the present invention can effectively solve the problems of high sample annotation cost and concept drift.
[0114] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A semi-supervised concept drift detection and adaptation method based on a conformal martingale framework, characterized in that: include: S1. Collect the variables X and data labels Y of the aluminum oxide evaporation process from industrial sensors to form a data set of the aluminum oxide evaporation process and perform preprocessing operations of dividing and standardizing all data sets; S2. According to the actual characteristics of the data set of the aluminum oxide evaporation process, an initial regression model is constructed, the initial regression model is trained using the labeled data set, and the unlabeled data set is predicted; S3, based on the conformal prediction framework, calculate the prediction interval and width of the unlabeled data points, set a threshold δ, and select data points whose width is less than the set threshold δ to form a high reliability sample set; S4, merging the high reliability sample set with the original label data set to form a new extended training set, and using the new extended training set to update the regression model; S5, using the regression model updated in step S4 to calculate the inconsistency score, p-value and martingale value of the calibration set and the test set, and setting a threshold γ. If the martingale value exceeds the threshold γ, it is determined that concept drift has occurred; S6. Use the data after the concept drift occurs to retrain the regression model to obtain a new model; S7. The mean absolute error and mean square error are used as evaluation indicators to calculate the MAE and MSE before and after the introduction of the high reliability training set and before and after the concept drift detection and adaptation of the test set to evaluate the effectiveness of the method.
2. According to the semi-supervised concept drift detection and adaptation method based on the conformal martingale framework of claim 1, it is characterized by: Step S1 specifically includes: S11. Divide the data set D = {X, Y} into training set D train , D train ={(x1,y1),,(x m ,y m )} and calibration set D cal , D cal ={(x m+1 ,y m+1 ),,(x n ,y n )}; and prepare the test set T data ={(x n+1 ,y n+1 ),,(x n+q ,y n+q )},q≥1; in the data set D={X,Y}, represents the feature matrix, represents the target variable; S12. Standardize the features in the training set, calibration set, and test set as follows: Among them, x ij represents the original value of the jth feature of the feature matrix in the i-th sample; μ j represents the mean of all samples of the jth feature, σ j represents the standard deviation of all samples of the jth feature, x i ' j Represents the standardized value, and the standardized feature set of each data set is obtained.
3. The semi-supervised concept drift detection and adaptation method based on the conformal martingale framework according to claim 1, characterized in that: Step S2 specifically includes: S21. Select regression model f according to the characteristics of the actual data set and use the labeled data set D L Train regression model f; S22. Use the trained regression model f to analyze the unlabeled dataset D U For each data point in the prediction, we get the prediction result f(x i ),x i ∈D U .
4. The semi-supervised concept drift detection and adaptation method based on the conformal martingale framework according to claim 1, characterized in that: Step S3 specifically includes: S31, according to the prediction results obtained in step S22, use the conformal prediction framework to calculate the prediction interval and its width for each prediction value, and the calculation formula is as follows: in, Indicates the inconsistency scores of the test set samples in descending order. values, S32. Calculate the inconsistency score. The calculation formula is as follows: Among them, μ i represents ln(|y i -f(x i )|)’s predicted value; S33, set a threshold δ, select data points whose prediction interval width is less than the threshold δ, and form a high reliability sample set U high_conf .
5. The semi-supervised concept drift detection and adaptation method based on the conformal martingale framework according to claim 1, characterized in that: Step S4 specifically includes: S41, the high reliability sample set U obtained in step S33 high_conf Compared with the original labeled dataset D L Merge to form a new extended training set D train_expanded ; S42. Use the new extended training set D train_expanded Update the regression model.
6. The semi-supervised concept drift detection and adaptation method based on the conformal martingale framework according to claim 1, characterized in that: Step S5 specifically includes: S51. For each data point T in the test set data [i], calculate the martingale value M[i] of each data point based on the conformal martingale framework, and initialize the martingale value sequence M[0] = 1; S52, for the sample points in the test set, use the calibration set D cal and the test set T data The inconsistency score is calculated, and the p-value of each sample point in the test set is calculated as follows: Where θ represents a random number in the interval [0,1], and nm represents the number of data points in the calibration set; S53. Based on the p-value sequence, construct the martingale value sequence as follows: Among them, ε∈(0,1), represents the conformal martingale value of the j-th sample point in the test set, represents the conformal martingale value of the j-1th sample point, p j Represents the p-value of the j-th sample point. If the conformal martingale value exceeds the predetermined threshold γ, it means that the concept drift is detected and the martingale value M[i] is reset to 1.
7. The method for semi-supervised concept drift detection and adaptation based on conformal martingale framework according to claim 1, characterized in that: Step S6 specifically includes: If concept drift occurs at the i-th sample point, use T data [i:] Retrain the regression model to get a new model f new .
8. The semi-supervised concept drift detection and adaptation method based on the conformal martingale framework according to claim 1, characterized in that: Step S7 specifically includes: S71. Define the evaluation index MAE as follows: Among them, y i represents the true value, f(x i ) represents the predicted value, n represents the number of samples; S72. Define the evaluation index MSE as follows: S73. Calculate the MAE and MSE of the training set before and after the introduction of the high reliability sample set; calculate the MAE and MSE of the test set before and after the introduction of concept drift detection and adaptation.
Citation Information
Patent Citations
Evaporation process discharge caustic alkali concentration measurement device accuracy compensation method
CN110794093A
Detection method for concept drift in malicious encrypted DoH traffic
CN116668139A
Cited By
Real-time drift detection in time-series data for automated AI model re-training
US12646003B1