An industrial production line energy consumption anomaly detection method and system based on adaptive sampling
Patent Information
- Application Number
- CN202611134938.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-29
- Publication Date
- 2026-09-25
AI Technical Summary
在数据层面,正常能耗样本占比通常超过90%,异常能耗样本极度稀缺,传统过采样方法容易在正常/异常边界生成虚假样本,导致模型将正常工况误判为异常状态;
(1)在数据预处理层面采用自适应密度约束插值过采样与聚类代表性欠采样相结合的混合采样策略,通过引入局部密度自适应采样密度系数和基于簇内方差的自适应高斯噪声注入,有效避免传统过采样算法在正常/异常边界处产生模糊样本的问题,显著提高了算法对异常能耗模式的识别能力和样本多样性。
Smart Images

Figure CN122818183A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial intelligent operation and maintenance and energy management technology, specifically to a method and system for detecting abnormal energy consumption in industrial production lines based on adaptive sampling. Background Technology
[0002] Energy consumption anomaly detection in industrial production lines is a core component of refined energy management in manufacturing enterprises. It is widely used in discrete manufacturing, process industries, and hybrid production lines for equipment energy efficiency monitoring and predictive maintenance, playing a crucial role in ensuring production safety and reducing energy costs. However, most existing energy consumption detection models often face challenges when processing high-dimensional imbalanced energy consumption data, including scarce anomaly samples, severe feature redundancy, and insufficient model generalization ability. This results in excessively high false negative rates for energy consumption anomalies, failing to meet the control requirements of industrial enterprises for an energy consumption anomaly false negative rate of ≤5%.
[0003] With the continuous advancement of machine learning technology, classification algorithms based on ensemble learning have become a research hotspot in the field of industrial energy consumption anomaly detection. Random forest algorithms, as a typical ensemble learning method, have been widely applied in industrial equipment fault diagnosis and energy consumption analysis due to their advantages of high classification accuracy, low generalization error, and high tolerance for outliers.
[0004] However, traditional random forest algorithms have the following drawbacks when processing energy consumption data from industrial production lines: At the data level, normal energy consumption samples usually account for more than 90%, while abnormal energy consumption samples are extremely scarce. Traditional oversampling methods are prone to generating false samples at the normal / abnormal boundary, causing the model to misjudge normal operating conditions as abnormal states. At the algorithm level, there is a lot of redundancy among high-dimensional energy-consuming features. Traditional static feature selection methods cannot be dynamically adjusted according to the weight distribution pattern, and the unified feature extraction strategy cannot adapt to the learning needs of different anomaly patterns. At the model level, the traditional simple weighted voting method only considers the single indicator of OOB error, without integrating the classification confidence of the decision tree for specific samples, and the allocation of voting weights is not accurate enough.
[0005] Furthermore, the three levels of data sampling, feature selection, and model voting are independent of each other and lack a collaborative optimization mechanism. Summary of the Invention
[0006] The technical problem to be solved by the present invention is to provide an adaptive sampling-based method for detecting abnormal energy consumption in industrial production lines, so as to solve the problems mentioned in the background art.
[0007] To solve the above-mentioned technical problems, the present invention provides the following technical solution: First, this invention proposes a method for detecting abnormal energy consumption in industrial production lines based on adaptive sampling, comprising the following steps: Step 1: Obtain multi-dimensional energy consumption characteristic data of production line equipment; Step 2: Preprocess the multidimensional energy consumption feature data of the production line equipment using a hybrid sampling strategy that combines adaptive density-constrained interpolation oversampling with clustering representative undersampling to obtain an energy consumption anomaly detection balanced dataset. Step 3: Use the ReliefF algorithm to weight the device energy consumption features in the energy consumption anomaly detection balance dataset, dynamically divide the feature regions based on the distribution skewness coefficient of the weight values, and construct feature subsets using a hierarchical progressive extraction strategy. Step 4: Generate multiple training subsets from the energy consumption anomaly detection balanced dataset based on Bagging sampling, and extract features from the dynamically divided feature regions according to the hierarchical progressive extraction strategy to construct a decision tree and generate an energy consumption anomaly detection random forest model. Step 5: Calculate the classification error using the out-of-bag (OOB) data corresponding to each decision tree, integrate the classification confidence of each decision tree with the classification error calculated by OOB for collaborative calibration, assign adaptive voting weights to each decision tree, and output the energy consumption anomaly detection results using the weighted voting principle. Step 6: Establish a closed-loop feedback loop from the energy consumption anomaly detection results to the hybrid sampling strategy and dynamic feature region division. Use the recall rate, F-measure and AUC value of energy consumption anomaly detection as feedback indicators to dynamically adjust the sampling density parameter of adaptive density constraint interpolation and the threshold parameter of dynamic feature region division.
[0008] On the other hand, an industrial production line energy consumption anomaly detection system based on adaptive sampling is provided to implement the method described in any of the above embodiments, the system comprising: Data acquisition module: used to acquire multi-dimensional energy consumption characteristic data of production line equipment; Hybrid sampling preprocessing module: This module is used to preprocess the multidimensional energy consumption feature data of the production line equipment using a hybrid sampling strategy that combines adaptive density-constrained interpolation oversampling with clustering representative undersampling, in order to obtain an energy consumption anomaly detection balanced dataset. Dynamic feature segmentation module: used to weight the device energy consumption features in the balanced dataset using the ReliefF algorithm, and dynamically segment feature regions based on the distribution skewness coefficient of the weight values; Hierarchical sampling module: used to construct feature subsets from dynamically divided feature regions using a hierarchical progressive extraction strategy; Random forest construction module: used to generate multiple training subsets based on Bagging sampling, extract features from dynamically divided feature regions according to the hierarchical progressive extraction strategy to construct decision trees, and generate a random forest model for energy consumption anomaly detection; Collaborative calibration module: used to calculate the classification error using the out-of-bag (OOB) data corresponding to each decision tree, integrate the classification confidence of each decision tree with the classification error calculated by the OOB for collaborative calibration, assign adaptive voting weights to each decision tree, and output energy consumption anomaly detection results; Closed-loop feedback optimization module: It is used to establish a closed-loop feedback loop from the energy consumption anomaly detection results to the hybrid sampling strategy and dynamic feature region division. It uses the recall rate, F-measure and AUC value of energy consumption anomaly detection as feedback indicators to dynamically adjust the sampling density parameter and the feature region division threshold parameter.
[0009] Meanwhile, the present invention provides an electronic device, the electronic device comprising: The memory is used to store computer programs that can run on the processor; the processor is used to execute the steps of the above-described industrial production line energy consumption anomaly detection method when running the computer program.
[0010] Finally, the present invention provides a computer-readable storage medium storing a computer program that, when executed by at least one processor, implements the steps of the above-described industrial production line energy consumption anomaly detection method.
[0011] Compared with the prior art, the technical effects achieved by the present invention using the above technical solution are as follows: (1) At the data preprocessing level, a hybrid sampling strategy combining adaptive density constraint interpolation oversampling and cluster representative undersampling is adopted. By introducing local density adaptive sampling density coefficient and adaptive Gaussian noise injection based on intra-cluster variance, the problem of fuzzy samples generated at normal / abnormal boundaries by traditional oversampling algorithms is effectively avoided, and the algorithm’s ability to identify abnormal energy consumption patterns and sample diversity is significantly improved.
[0012] (2) At the feature selection level, feature weighting is performed based on the ReliefF algorithm. The feature region is dynamically divided by introducing the weight distribution skewness coefficient. A hierarchical progressive extraction strategy is adopted so that the early decision tree focuses on learning the core electrical parameter features, and the later decision tree focuses on capturing weak degradation signals. This effectively eliminates irrelevant and redundant features and achieves accurate dimensional reduction of high-dimensional energy consumption data.
[0013] (3) At the model voting level, an adaptive voting weight is assigned to each decision tree based on a collaborative calibration mechanism that integrates classification confidence and out-of-bag data error. This increases the weight of decision trees with excellent classification performance and reliable prediction when voting, while effectively suppressing the influence of overconfident decision trees with high confidence but low accuracy.
[0014] In summary, this invention establishes a three-layer closed-loop feedback architecture of data sampling, feature selection, and model voting, achieving deep collaborative optimization from the data level to the algorithm level and then to the model level. It can dynamically adjust the parameters of the preceding links according to the model output performance, forming an adaptive optimization closed loop, which meets the control requirements of industrial enterprises for an abnormal energy consumption detection rate of ≤5%. Attached Figure Description
[0015] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 The overall flowchart of the industrial production line energy consumption anomaly detection method based on adaptive sampling provided in the embodiments of the present invention; Figure 2 This is an overall structural diagram of an industrial production line energy consumption anomaly detection system based on adaptive sampling provided in an embodiment of the present invention; Figure 3 This is a flowchart of the hybrid sampling preprocessing process provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of a hierarchical progressive feature extraction strategy provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the decision tree collaborative calibration and adaptive voting mechanism provided in an embodiment of the present invention. Detailed Implementation
[0016] The following will be based on embodiments of the present invention. Figure 1 - Figure 5 The technical solutions in the embodiments of the present invention are clearly and completely described herein. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0017] Example 1: This example proposes a method for detecting abnormal energy consumption in industrial production lines based on adaptive sampling, such as... Figure 1 As shown, it includes the following steps: Step 1: Obtain multi-dimensional energy consumption characteristic data of production line equipment.
[0018] Step 2: The multidimensional energy consumption feature data of the production line equipment is preprocessed using a hybrid sampling strategy that combines adaptive density-constrained interpolation oversampling with clustering representative undersampling to obtain an energy consumption anomaly detection balanced dataset.
[0019] Step 3: Use the ReliefF algorithm to weight the device energy consumption features in the energy consumption anomaly detection balance dataset, dynamically divide the feature regions based on the distribution skewness coefficient of the weight values, and construct feature subsets using a hierarchical progressive extraction strategy.
[0020] Step 4: Generate multiple training subsets from the energy consumption anomaly detection balanced dataset based on Bagging sampling, and extract features from the dynamically divided feature regions according to the hierarchical progressive extraction strategy to construct a decision tree and generate an energy consumption anomaly detection random forest model.
[0021] Step 5: Calculate the classification error using the out-of-bag (OOB) data corresponding to each decision tree, integrate the classification confidence of each decision tree with the classification error calculated by OOB for collaborative calibration, assign adaptive voting weights to each decision tree, and output the energy consumption anomaly detection results using a weighted voting principle.
[0022] Step 6: Establish a closed-loop feedback loop from the energy consumption anomaly detection results to the hybrid sampling strategy and dynamic feature region division. Use the recall rate, F-measure and AUC value of energy consumption anomaly detection as feedback indicators to dynamically adjust the sampling density parameter of adaptive density constraint interpolation and the threshold parameter of dynamic feature region division.
[0023] As a specific embodiment of the present invention, step 1 involves acquiring multi-dimensional energy consumption characteristic data of the production line equipment, including equipment electrical parameter characteristics, mechanical state parameter characteristics, process parameter characteristics, and environmental parameter characteristics, specifically composed of the following 32 dimensions of characteristics: The electrical parameters of the equipment include: active power, reactive power, power factor, three-phase current, three-phase voltage, harmonic distortion rate, apparent power, and power quality indicators. Mechanical condition parameters include: motor speed, bearing temperature, vibration acceleration, vibration velocity, vibration displacement, lubricating oil temperature, coupling misalignment, and mechanical efficiency. Process parameter characteristics include: production cycle time, processing load rate, material flow rate, process temperature, process pressure, product qualification rate, equipment utilization rate, and changeover frequency; Environmental parameters include: ambient temperature, ambient humidity, altitude, power grid frequency fluctuation, power supply voltage stability, cooling water temperature, compressed air pressure, and workshop dust concentration.
[0024] As a specific embodiment of the present invention, step 2 is as follows: A hybrid sampling strategy combining adaptive density-constrained interpolation oversampling and clustering representative undersampling is used to preprocess the production line equipment data, such as... Figure 3 As shown.
[0025] First, the density peak clustering algorithm is used to adaptively cluster the abnormal energy consumption samples to obtain the cluster center, local density within the cluster and relative distance of each abnormal pattern cluster. The abnormal patterns include at least high energy consumption anomaly, low energy consumption anomaly, energy consumption fluctuation anomaly and gradual energy efficiency degradation.
[0026] The density peak clustering algorithm includes: (1) Calculate the local density using the truncated kernel function, set the truncated distance to 2% of the average distance between samples, and select the points with larger local density and relative distance as cluster centers; (2) Assign the remaining abnormal energy consumption samples to the nearest cluster center and update the cluster center position; (3) The clustering termination condition is that the change in cluster center is less than the adaptive threshold or the maximum number of iterations is reached. The adaptive threshold is determined based on the average local density within the cluster, and the maximum number of iterations is dynamically adjusted according to the imbalance ratio of the dataset.
[0027] Then, based on the local density of the electrical parameter characteristics of the devices in each abnormal mode cluster, the adaptive sampling density coefficient is calculated. For the original abnormal energy consumption sample in each cluster, constrained interpolation is performed on the line connecting the cluster center and the sample to generate a new abnormal energy consumption sample. The constrained interpolation introduces Gaussian noise based on the variance of the cluster.
[0028] Finally, cluster-based representative undersampling is used to undersample the normal energy consumption samples. The undersampled normal energy consumption samples are then merged with the oversampled abnormal energy consumption samples to obtain a balanced dataset for energy consumption anomaly detection.
[0029] Wherein, the adaptive sampling density coefficient ,in For the first i Local density of a cluster To achieve maximum local density, low-density anomaly clusters obtain a larger sampling range, while high-density anomaly clusters obtain a more concentrated sampling range.
[0030] The constrained interpolation formula is: ,in In the interval Uniformly distributed random numbers within the range. Based on intra-cluster variance Adaptively generated Gaussian noise, , For noise adjustment factor, c i This represents the centroid of the i-th cluster, i.e., the cluster center. ,in As the reference noise figure, This represents the imbalance ratio of the dataset.
[0031] As a specific embodiment of the present invention, step 3 is as follows: The ReliefF algorithm is used to weight the device energy consumption features in the energy consumption anomaly detection balance dataset to obtain the weight value corresponding to each feature, such as... Figure 4 As shown.
[0032] The skewness coefficient γ of the weight values is calculated, and the division threshold is dynamically determined based on the skewness coefficient. The features are divided into three regions: high weight region, medium weight region, and low weight region. The high weight region contains at least active power and power factor.
[0033] A hierarchical progressive extraction strategy is adopted to construct feature subsets: when constructing the early decision tree, the feature extraction ratio of high-weight regions is increased and the feature extraction ratio of low-weight regions is decreased, so that the early decision tree can fully learn the discrimination patterns of high-energy-consumption anomalies and low-energy-consumption anomalies; when constructing the mid-term decision tree, the extraction ratio of the three feature regions is balanced to achieve a balance between important features and diverse features; when constructing the late-term decision tree, the feature extraction ratio of high-weight regions is decreased and the feature extraction ratio of low-weight regions is increased to enhance the model's ability to capture weak signals in the early stages of progressive energy efficiency degradation.
[0034] Specifically, the division threshold is dynamically determined based on the skewness coefficient, as follows: When the skewness coefficient When using the top-biased distribution method, the high-weight region accounts for 40%, the medium-weight region accounts for 35%, and the low-weight region accounts for 25%.
[0035] When the skewness coefficient At that time, the balanced division method was adopted, and the three regions each accounted for 33.3% equally.
[0036] When the skewness coefficient When using the lower-weighted distribution method, the high-weighted region accounts for 25%, the medium-weighted region accounts for 35%, and the low-weighted region accounts for 40%.
[0037] As a specific embodiment of the present invention, step 4 is as follows: Multiple training subsets are generated from the energy consumption anomaly detection balanced dataset based on Bagging sampling. For each training subset, features are extracted from the dynamically divided feature regions according to the hierarchical progressive extraction strategy to construct a decision tree, thereby generating an energy consumption anomaly detection random forest model composed of multiple decision trees.
[0038] As a specific embodiment of the present invention, step 5 is as follows: like Figure 5 As shown, the classification error is calculated using the out-of-bag (OOB) data corresponding to each decision tree. ,in The correct classification rate for Out-of-Brow (OOB).
[0039] Calculate the classification confidence of the decision tree for the predicted samples. ,in This is the probability of each category output by the decision tree.
[0040] Based on the collaborative calibration formula Calculate the voting weights of each decision tree. The confidence level sensitivity coefficient is... The average confidence level for all decision trees.
[0041] The energy consumption anomaly detection results are output using a weighted voting principle. These results include normal energy consumption, high energy consumption anomaly, low energy consumption anomaly, energy consumption fluctuation anomaly, and gradual energy efficiency degradation.
[0042] As a specific embodiment of the present invention, step 6 is as follows: Establish a closed-loop feedback loop from energy consumption anomaly detection results to hybrid sampling strategies and dynamic feature region division.
[0043] The recall rate, F-measure, and AUC value are used as feedback indicators: when the recall rate is lower than the recall rate threshold, the adaptive sampling density coefficient is increased to enhance the coverage of abnormal energy consumption samples; when the F-measure is lower than the F-measure threshold, the skewness threshold of the dynamic feature region division is adjusted to tilt the region division towards high-weight regions; when the AUC is lower than the AUC threshold, the sampling density coefficient and feature region division parameters are adjusted simultaneously.
[0044] The feedback adjustment is executed iteratively until each indicator reaches the preset threshold or the maximum number of iterations is reached.
[0045] Example 2: This example provides an industrial production line energy consumption anomaly detection system based on adaptive sampling, such as... Figure 2 As shown, it specifically includes the following: Data acquisition module: used to acquire multi-dimensional energy consumption characteristic data of production line equipment in step 1.
[0046] Hybrid sampling preprocessing module: This module is used to preprocess the production line equipment data in step 2 using a hybrid sampling strategy that combines adaptive density constraint interpolation oversampling with cluster representative undersampling, in order to obtain an energy consumption anomaly detection balanced dataset.
[0047] Dynamic feature segmentation module: This module is used to implement the ReliefF algorithm in step 3 to weight the device energy consumption features in the balanced dataset and dynamically segment feature regions based on the distribution skewness coefficient of the weight values.
[0048] Hierarchical sampling module: used to implement the hierarchical progressive extraction strategy in step 3 to construct feature subsets from dynamically divided feature regions.
[0049] Random Forest Construction Module: Used to generate multiple training subsets based on Bagging sampling in step 4, extract features from dynamically divided feature regions according to the hierarchical progressive extraction strategy to construct decision trees, and generate an energy consumption anomaly detection random forest model.
[0050] Collaborative calibration module: This module is used to calculate the classification error using the out-of-bag (OOB) data corresponding to each decision tree in step 5, to perform collaborative calibration by fusing the classification confidence of each decision tree with the OOB error, to assign adaptive voting weights to each decision tree, and to output the energy consumption anomaly detection results.
[0051] Closed-loop feedback optimization module: It is used to realize the closed-loop feedback loop established in step 6 from the energy consumption anomaly detection result to the hybrid sampling strategy and dynamic feature region division. It uses the recall rate, F-measure and AUC value of energy consumption anomaly detection as feedback indicators to dynamically adjust the sampling density parameter and the feature region division threshold parameter.
[0052] Example 3: This example provides an electronic device, which includes: a memory for storing a computer program that can run on a processor; and a processor for executing, when running the computer program, a method for detecting abnormal energy consumption in industrial production lines based on adaptive sampling as described in Example 1.
[0053] Example 4: This example provides a computer-readable storage medium storing a computer program, which, when executed by at least one processor, implements the steps of an adaptive sampling-based method for detecting abnormal energy consumption in industrial production lines.
[0054] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for detecting abnormal energy consumption in industrial production lines based on adaptive sampling, characterized in that, The method includes: Step 1: Obtain multi-dimensional energy consumption characteristic data of production line equipment; Step 2: Preprocess the multidimensional energy consumption feature data of the production line equipment using a hybrid sampling strategy that combines adaptive density-constrained interpolation oversampling with clustering representative undersampling to obtain an energy consumption anomaly detection balanced dataset. Step 3: Use the ReliefF algorithm to weight the device energy consumption features in the energy consumption anomaly detection balance dataset, dynamically divide the feature regions based on the distribution skewness coefficient of the weight values, and construct feature subsets using a hierarchical progressive extraction strategy. Step 4: Generate multiple training subsets from the energy consumption anomaly detection balanced dataset based on Bagging sampling, and extract features from the dynamically divided feature regions according to the hierarchical progressive extraction strategy to construct a decision tree and generate an energy consumption anomaly detection random forest model. Step 5: Calculate the classification error using the out-of-bag (OOB) data corresponding to each decision tree, integrate the classification confidence of each decision tree with the classification error calculated by OOB for collaborative calibration, assign adaptive voting weights to each decision tree, and output the energy consumption anomaly detection results using the weighted voting principle. Step 6: Establish a closed-loop feedback loop from the energy consumption anomaly detection results to the hybrid sampling strategy and dynamic feature region division. Use the recall rate, F-measure and AUC value of energy consumption anomaly detection as feedback indicators to dynamically adjust the sampling density parameter of adaptive density constraint interpolation and the threshold parameter of dynamic feature region division.
2. The method as described in claim 1, characterized in that, The multi-dimensional energy consumption characteristic data of the production line equipment in step 1 includes the characteristics of equipment electrical parameters, mechanical state parameters, process parameters, and environmental parameters. The electrical parameters of the equipment include at least active power, reactive power, power factor, three-phase current, three-phase voltage, harmonic distortion rate, apparent power, and power quality indicators. The mechanical state parameters include at least the motor speed, bearing temperature, vibration acceleration, vibration velocity, vibration displacement, lubricating oil temperature, coupling alignment deviation, and mechanical efficiency. The process parameter characteristics include at least production cycle time, processing load rate, material flow rate, process temperature, process pressure, product qualification rate, equipment utilization rate, and changeover frequency. The environmental parameters include at least ambient temperature, ambient humidity, altitude, power grid frequency fluctuation, power supply voltage stability, cooling water temperature, compressed air pressure, and workshop dust concentration.
3. The method as described in claim 1, characterized in that, The hybrid sampling strategy in step 2 is as follows: First, the density peak clustering algorithm is used to adaptively cluster the abnormal energy consumption samples to obtain the cluster center, local density within the cluster and relative distance of each abnormal pattern cluster. The abnormal patterns include at least high energy consumption anomaly, low energy consumption anomaly, energy consumption fluctuation anomaly and gradual energy efficiency degradation. Secondly, based on the local density of the electrical parameter characteristics of the equipment in each abnormal mode cluster, the adaptive sampling density coefficient is calculated. For the original abnormal energy consumption sample in each cluster, constrained interpolation is performed on the line connecting the cluster center and the sample to generate a new abnormal energy consumption sample. The constrained interpolation introduces Gaussian noise based on the variance within the cluster. The intensity of the Gaussian noise is dynamically adjusted according to the imbalance ratio between abnormal samples and normal energy consumption samples in the dataset. Finally, cluster-based representative undersampling is used to undersample the normal energy consumption samples. The undersampled normal energy consumption samples are then merged with the oversampled abnormal energy consumption samples to obtain a balanced dataset for energy consumption anomaly detection.
4. The method as described in claim 3, characterized in that, The density peak clustering algorithm includes the following steps: The local density of each abnormal energy consumption sample is calculated using a truncated kernel function. The truncated distance is set to 2% of the average distance between samples. Points with both large local density and large relative distance are selected as cluster centers. Assign the remaining abnormal energy consumption samples to the nearest cluster center and update the cluster center positions; Clustering is terminated when the change in the new cluster centers is less than the adaptive threshold or when the maximum number of iterations is reached. The adaptive threshold is determined based on the average local density of samples within the cluster, and the maximum number of iterations is dynamically adjusted according to the imbalance ratio of the dataset.
5. The method as described in claim 3, characterized in that, The adaptive sampling density coefficient ,in For the first i Local density of a cluster To achieve maximum local density, low-density anomaly clusters obtain a larger sampling range, while high-density anomaly clusters obtain a more concentrated sampling range. The formula for the constrained interpolation is: ,in For in the interval Uniformly distributed random numbers within the range. Based on intra-cluster variance Adaptively generated Gaussian noise, , For noise adjustment factor, c i This represents the centroid of the i-th cluster, i.e., the cluster center; The noise modulation factor ,in As the reference noise figure, This represents the imbalance ratio of the dataset.
6. The method as described in claim 1, characterized in that, The dynamic feature segmentation and hierarchical progressive extraction strategy in step 3 specifically includes: The energy consumption features of the devices in the energy consumption anomaly detection balance dataset are weighted using the ReliefF algorithm to obtain the weight values corresponding to each feature; Calculate the skewness coefficient of the weight values The segmentation threshold is dynamically determined based on the skewness coefficient, and the feature is divided into three feature regions: high weight region, medium weight region, and low weight region. The high weight region contains at least active power and power factor. A hierarchical progressive extraction strategy is used to construct feature subsets, specifically as follows: When constructing the early decision tree, increase the feature extraction ratio of high-weight regions and decrease the feature extraction ratio of low-weight regions, so that the early decision tree can fully learn the discrimination patterns of high-energy-consumption anomalies and low-energy-consumption anomalies. When constructing the intermediate decision tree, the extraction ratio of the three feature regions is balanced to achieve a balance between important features and diverse features; When constructing the later decision tree, the feature extraction ratio of high-weight regions is reduced and the feature extraction ratio of low-weight regions is increased to enhance the model's ability to capture weak signals in the early stages of gradual energy efficiency degradation.
7. The method as described in claim 6, characterized in that, The process of dynamically determining the partitioning threshold based on the skewness coefficient is as follows: When the skewness coefficient At that time, the upper-biased distribution method was adopted, with high-weight regions accounting for 40%, medium-weight regions accounting for 35%, and low-weight regions accounting for 25%. When the skewness coefficient At that time, a balanced division method was adopted, with each of the three regions equally accounting for 33.3%. When the skewness coefficient At that time, a downward skewed distribution method was adopted, with high-weight regions accounting for 25%, medium-weight regions accounting for 35%, and low-weight regions accounting for 40%; among which, the subscript... uppper, lower These represent the upper and lower limits, respectively.
8. The method as described in claim 1, characterized in that, The collaborative calibration in step 5 includes: Calculate the classification error of each decision tree using out-of-bag data. ,in The correct classification rate for Out-of-Brow (OOB); Calculate the classification confidence of the decision tree for the predicted samples. ,in The output of the decision tree is the probability of each category. The voting weights of each decision tree are calculated based on the collaborative calibration formula: , in j =1,2,..., K , K Let be the total number of decision trees, ln be the natural logarithm, and tanh be the hyperbolic tangent function. The confidence level sensitivity coefficient is... The average confidence level for all decision trees.
9. The method as described in claim 1, characterized in that, The closed-loop feedback loop in step 6 includes: Recall rate, F-measure, and AUC value were used as feedback indicators; When the recall rate is lower than the recall rate threshold, increase the adaptive sampling density coefficient to enhance the coverage of abnormal energy consumption samples; When the F-measure is lower than the F-measure threshold, adjust the skewness threshold of the dynamic feature region division to tilt the region division towards the high-weight region. When the AUC is lower than the AUC threshold, both the sampling density coefficient and the feature region segmentation parameters are adjusted simultaneously. The feedback adjustment is executed iteratively until each indicator reaches the preset threshold or the maximum number of iterations is reached.
10. An industrial production line energy consumption anomaly detection system based on adaptive sampling, characterized in that, include: The data acquisition module is used to acquire multi-dimensional energy consumption characteristic data of production line equipment; The hybrid sampling preprocessing module is used to preprocess the multidimensional energy consumption feature data of the production line equipment using a hybrid sampling strategy that combines adaptive density-constrained interpolation oversampling method with clustering representative undersampling, so as to obtain an energy consumption anomaly detection balanced dataset. The dynamic feature segmentation module is used to weight the device energy consumption features in the balanced dataset using the ReliefF algorithm, and dynamically segment feature regions based on the distribution skewness coefficient of the weight values. The hierarchical sampling module is used to construct feature subsets from dynamically divided feature regions using a hierarchical progressive extraction strategy; The random forest construction module is used to generate multiple training subsets based on Bagging sampling, extract features from dynamically divided feature regions according to the hierarchical progressive extraction strategy to construct a decision tree, and generate a random forest model for energy consumption anomaly detection. The collaborative calibration module is used to calculate the classification error using the out-of-bag (OOB) data corresponding to each decision tree, integrate the classification confidence of each decision tree with the classification error calculated by the OOB for collaborative calibration, assign adaptive voting weights to each decision tree, and output the energy consumption anomaly detection results. The closed-loop feedback optimization module is used to establish a closed-loop feedback loop from the energy consumption anomaly detection results to the hybrid sampling strategy and dynamic feature region division. It uses the recall rate, F-measure and AUC value of energy consumption anomaly detection as feedback indicators to dynamically adjust the sampling density parameter and the feature region division threshold parameter.