Machine learning-based defrosting control method for dehumidifiers
The XGBoost algorithm predicts the frosting of the air inlet fins of the dehumidifier, which solves the problem of inaccurate frosting control of the dehumidifier under low temperature conditions, improves the dehumidification efficiency and compressor life, and achieves more reasonable utilization of environmental data.
Patent Information
- Application Number
- CN202310490368.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-04
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2043-05-04
AI Technical Summary
The existing dehumidifier melt-frost control strategy in low temperature conditions relies on temperature and pressure thresholds or timing melt-frost, which cannot accurately reflect the frost condition of the fin, resulting in low dehumidification efficiency or shortened compressor life.
The frost control method based on the XGBoost algorithm is adopted, and the dehumidifier historical data and working condition data are collected, data preprocessing and model optimization are carried out, the frost situation of the inlet fins is predicted, and the optimal frost time is determined.
It improves the dehumidification efficiency of the dehumidifier in low temperature environments, reduces the risk of damage caused by improper setting of melt-frost interval time of the compressor, and enhances the adaptability and accuracy of the model.
Smart Images

Figure CN116499075B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of defrosting control for a dehumidifier in a low-temperature working environment, and specifically to a defrosting control method for a dehumidifier based on machine learning. Background Art
[0002] Under low-temperature working conditions, the total dehumidification amount (drainage volume) of a dehumidifier during a certain period includes two parts: the condensate water volume and the defrost water volume. The condensate water volume is the liquid water volume that the dehumidifier condenses and discharges in a timely manner, and the defrost water volume is the water volume discharged by the dehumidifier after defrosting. The defrost water volume accounts for a larger proportion of the total dehumidification amount compared to the condensate water volume. Generally, the dehumidifier operates alternately in two working states: normal dehumidification and defrosting, with a cycle.
[0003] The purpose of defrosting is to timely remove the frost layer formed on the inlet fins of the dehumidifier during operation in a low-temperature environment, preventing the reduction of the fin inlet area due to the frost layer and resulting in insufficient air intake, which in turn affects the overall dehumidification efficiency. In the application of defrosting control for dehumidifiers under low-temperature conditions, the existing defrosting control strategies mainly include: temperature threshold method, pressure threshold method, timed defrosting method, etc.
[0004] The temperature threshold method collects the surface temperature of the inlet fins of the dehumidifier through a temperature sensor (this temperature can reflect the frosting condition of the fins to a certain extent), and compares it with the temperature threshold to select the defrosting timing. The temperature sensor data is often related to the placement position, and usually can only reflect the temperature (frosting) of the position near the fin temperature sensor. However, the frosting position of the fins is relatively random, so the temperature sensor cannot reflect the overall frosting condition of the fins. The pressure threshold method collects the intake pressure of the dehumidifier compressor through a pressure sensor, and compares it with the pressure threshold to select the defrosting timing. However, the pressure data is greatly affected by the ambient temperature, and it is often necessary to modify the pressure threshold to adapt to the change of the actual working environment temperature. An inappropriate threshold will cause the defrosting action to be too frequent or the defrosting to be untimely, both of which will lead to a reduction in dehumidification efficiency. The above two methods are essentially the same, both using on-site data to directly reflect the frosting condition of the inlet fins of the dehumidifier, and completing the judgment of the defrosting timing and defrosting control by setting thresholds. Such methods have a relatively single information source, low utilization rate and accuracy of on-site information, and poor robustness in complex environments.
[0005] The timed defrosting method needs to preset the defrosting interval and defrosting time to achieve the periodic defrosting of the dehumidifier. If the defrosting interval is too long, it will lead to incomplete defrosting and affect the dehumidification efficiency; if the defrosting interval is too short, it will shorten the service life of the compressor. This method does not utilize the on-site environmental parameters in real time, cannot adapt to the changes in the working environment, lacks theoretical basis and data support, and often fails to achieve the best defrosting effect. Summary of the Invention
[0006] To overcome the deficiencies of the above-mentioned prior art, the present disclosure provides a defrost control method for a dehumidifier based on the XGBoost algorithm, which predicts the defrost water output of the inlet fins of the dehumidifier, and then judges the frosting situation of the inlet fins, so as to determine the optimal defrost time. The entire model makes full use of environmental information, has good adaptability and high accuracy, can effectively improve the dehumidification efficiency in low-temperature environments, and reduce the risk of damage to the compressor caused by improper manual parameter setting in traditional methods.
[0007] To achieve the above object, the present invention provides the following technical solutions:
[0008] A defrost control method for a dehumidifier based on machine learning, the method steps include,
[0009] S1. Collection of historical dehumidification amount and defrost characteristic data of the dehumidifier;
[0010] S2. Obtaining of the operating condition data of the dehumidifier;
[0011] S3. Data preprocessing;
[0012] S4. Building an XGBoost model;
[0013] S5. Adjusting parameters, training and optimizing the XGBoost model;
[0014] S6. Result prediction and evaluation.
[0015] As a further solution of the present invention: In the step S1, under low-temperature working conditions, the dehumidifier works normally for more than 20 minutes, different working durations (defrost intervals) are set, the defrost time is uniformly set to 5 minutes, corresponding to different working durations, the drainage volume (condensation water output) of the dehumidifier when defrosting is started is recorded respectively, and the total drainage volume after defrosting is recorded. Then, the defrost water output = the total drainage volume in this period - the condensation water output in this period, and this defrost water output is used as the actual value of the sample.
[0016] As a further solution of the present invention: In the step S2, the operating condition data of the dehumidifier when defrosting is started are recorded: inlet air temperature, inlet air humidity, outlet air temperature, outlet air humidity, compressor temperature, compressor real-time power, compressor suction pressure, compressor discharge pressure, outlet air velocity, inlet air velocity, fan power, and they are used as the characteristic values of the sample. Among them, the temperature and humidity data are obtained by temperature and humidity sensors at the corresponding positions, the compressor temperature is obtained by an infrared temperature gun, the power data are obtained by a power monitor in the circuit, the pressures at the inlet and outlet of the compressor are obtained by pipeline pressure sensors, and the air velocity is obtained by an anemometer at the corresponding position.
[0017] As a further aspect of the present invention: In step S3, the operating condition data of the dehumidifier is obtained, the missing data values are identified and filled using the mean value, the outliers are removed, and denoising and normalization processing are performed. The time stamp dimension is converted from the time format to the sequence format. Using the Pearson correlation coefficient formula in probability statistics, the correlation between pairwise features is calculated, and the absolute value of the correlation takes values between [0, 1]. In the data used in this application, the features with an absolute value of correlation greater than or equal to 0.9 are deleted. After screening, the inlet air temperature, inlet air humidity, outlet air temperature, outlet air humidity, compressor temperature, compressor suction pressure, compressor discharge pressure, and inlet air velocity are finally selected as the feature values of the sample.
[0018] As a further aspect of the present invention: In step S4, XGBoost follows the basic process of the Boosting algorithm for modeling. Based on the result of the previous weak estimator f(x) k-1 , the loss function L is calculated and used to adaptively affect the construction of the next weak estimator f(x) k . This construction process is essentially an iterative optimization of the objective function, which makes the overall loss smaller and smaller. The result output by the integrated model is affected by all weak estimators f(x)0 to f(x) k . This estimator selects the CART tree.
[0019] As a further aspect of the present invention: In step S5, there are many hyperparameters in the XGBoost regression model algorithm. Here, 6 relatively important ones are selected as the hyperparameter combination for training optimization.
[0020] As a further aspect of the present invention: In step S6, by combining the historical dehumidification amount of the dehumidifier, the defrosting characteristics, and the operating condition characteristics of the dehumidifier, the real-time and accurate prediction of the frosting condition of the inlet fin of the dehumidifier is carried out using a relatively small amount of data, and then the frosting condition of the inlet fin is evaluated to determine the best defrosting timing.
[0021] Compared with the prior art, the beneficial effects of the present invention are:
[0022] 1. Based on the machine learning method, the present invention can more comprehensively predict the defrost drainage volume that directly reflects the frosting condition of the inlet fin according to the operating conditions of the dehumidifier, and then guide the defrosting timing. Compared with the traditional method, the utilization of environmental data is more reasonable and effective. The algorithm can select a suitable data set according to the actual operating conditions and flexibly generate a corresponding model, which can improve the dehumidification efficiency and reduce the risk of damage to the compressor life caused by inappropriate setting of the defrost interval time.
[0023] 2. In the present invention, the XGBoost model uses the hyena optimization algorithm to optimize the hyperparameters, improving the regression performance of the model. Description of the Drawings
[0024] Figure 1 This is the flowchart of the method of the present invention.
[0025] Figure 2 This is the schematic layout diagram of the verification experiment of the dehumidification algorithm of the present invention.
[0026] Figure 3 This is the comparison of the water output of different defrost control methods of the present invention Figure 1 。
[0027] Figure 4 This is the comparison of the water output of different defrost control methods of the present invention Figure 2 。 Detailed implementation manners
[0028] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0029] A defrost control method for a dehumidifier based on machine learning, the method steps include,
[0030] S1. Collection of historical dehumidification amount and defrost characteristic data of the dehumidifier. Under low-temperature working conditions, the dehumidifier works normally for more than 20 minutes, different working durations (defrost intervals) are set, the defrost time is uniformly set to 5 minutes, corresponding to different working durations, record the drainage amount (condensate water output) of the dehumidifier when defrosting is started, and record the total drainage amount after defrosting ends. Then the defrost water output = the total drainage amount during this period - the condensate water output during this period, and this defrost water output is used as the actual value of the sample;
[0031] S2. Acquisition of the working condition data of the dehumidifier. Record the working condition data of the dehumidifier when defrosting is started: inlet air temperature, inlet air humidity, outlet air temperature, outlet air humidity, compressor temperature, compressor real-time power, compressor suction pressure, compressor discharge pressure, outlet air velocity, inlet air velocity, fan power, and use them as the characteristic values of the sample. Among them, the temperature and humidity data are obtained by temperature and humidity sensors at the corresponding positions, the compressor temperature is obtained by an infrared temperature gun, the power data are obtained by a power monitor in the circuit, the compressor inlet and outlet pressures are obtained by pipeline pressure sensors, and the air velocity is obtained by an anemometer at the corresponding positions;
[0032] S3. Data preprocessing: obtain dehumidifier operating data, identify and use the mean to fill missing data values, remove outliers, perform denoising and normalization, convert the timestamp dimension from time format to sequence format, and use the Pearson correlation coefficient formula in probability statistics to calculate the correlation between two features. The absolute value of the correlation is between [0,1]. In the data used in this application, the features with an absolute value of the correlation greater than or equal to 0.9 are deleted. After screening, the inlet temperature, inlet humidity, outlet temperature, outlet humidity, compressor temperature, compressor suction pressure, compressor outlet pressure, and inlet wind speed are finally selected as the characteristic values of the sample;
[0033] S4. Build the XGBoost model. XGBoost follows the basic process of the Boosting algorithm to build a model based on the previous weak evaluator f(x) k-1 As a result, calculate the loss function L and use L to adaptively influence the next weak evaluator f(x) k The construction process is essentially an iterative optimization of the objective function to make the overall loss smaller and smaller, and the result of the integrated model output is affected by all weak evaluators f(x)0~f(x) k The evaluator selects CART tree;
[0034] Objective function definition, in XGBoost, the objective function is the objective function for a tree, which includes three parts: loss function L, number of leaves T and regularization term. Suppose a single tree f k The objective function is O k , there are T leaves in total, and the output value of the sample on each leaf (leaf weight) is w j , the loss function of any sample number i on the tree is L(y i ,H(x i )), where H(x i ) is the prediction result of sample i on the integrated model. Assume that there are a total of M samples on the tree, L2 regularization is used in the objective function (λ is not 0, α is 0), and γ is not 0, then the objective function of the tree is:
[0035]
[0036] Where: H k (x i )=H k-1 (x i )+f k (x i )L k =L(y i ,H k-1 (x i )+f k (xi ))
[0037] Objective function transformation, for the objective function O k Take the derivative to find the minimum value. There are multiple independent variables in this function, such as T, w j , f k (x i ). To find a single independent variable that minimizes the objective function, O k needs to be transformed as follows:
[0038]
[0039] y i is the actual value of the i-th sample and is a known quantity. Then the first loss function L in O k is written as a function of L with H k-1 (x i ) + f k (x i ) as variables, L(H k-1 (x i ) + f k (x i ). Perform a Taylor expansion on this function:
[0040]
[0041] Define:
[0042] Then:
[0043] Omitting the constant term of this formula, the objective function O k can be simplified to:
[0044]
[0045] For any sample i located on leaf j, that is, i ∈ j, numerically f(x i ) = w j , then g ik f(x i ) = g ik w j . Further: Similarly, Then
[0046]
[0047] Objective function solution: From it can be seen that the objective function is only related to w j and T. It is impossible to minimize the objective function by minimizing the number of leaves because too few leaves will seriously affect the fitting performance of the tree. So Derivation can only be performed with respect to w j For the j-th leaf, let
[0048]
[0049] Then
[0050]
[0051] Set this derivative equal to 0 to obtain the leaf weight w that minimizes the objective function on each leaf j :
[0052]
[0053] Role of structure gain: During the tree construction process of the XGBoost algorithm, node splitting is performed. The basis for node splitting is to maximize the degree of reduction in the objective function value after splitting. This basis is called structure gain. The optimal w that minimizes the objective function j Substitute it back into μ j The loss on one leaf (a component in the objective function) is:
[0054]
[0055] To minimize the objective function, the loss on each leaf needs to be minimized. And during the branching process, the objective function value of the parent node is greater than that of the child nodes. Therefore, (parent node objective function - sum of child node objective functions) is used to measure the quality of the branch. Then the structure gain is:
[0056]
[0057] where the subscripts L, R, and P represent the left branch, right branch, and parent node respectively. When performing tree node splitting, the splitting method that maximizes the structure gain of the current node is selected.
[0058] S5. Adjust parameters, train, and optimize the XGBoost model; There are many hyperparameters in the XGBoost regression model algorithm. Here, 6 relatively important ones are selected as the hyperparameter combination for training and optimization; They include: Parameters that affect the overall model by influencing the tree construction process: γ (the coefficient multiplied before the number of leaves), λ (the L2 regularization term coefficient). Increasing these two parameters can control overfitting; num_boost_round (the number of weak estimators, which is the actual number of iterations K and determines the overall learning ability), booster (the type of weak estimator. Here, "gbtree" and "dart" are tested), max_depth (the maximum depth allowed for the weak estimator), η (the learning rate, which affects the overall learning rate of the weighted summation process of the weak classifier results).
[0059] The global and local optimization of XGBoost hyperparameters is carried out using the Spotted Hyena Optimizer (SHO). This algorithm is a swarm intelligence optimization algorithm that simulates the predation behavior of spotted hyenas. It is applicable to function optimization and engineering optimization design, with the characteristics of simple principle, few parameters to be adjusted, easy to implement, and strong global search ability. The steps of establishing the spotted hyena mathematical model correspond to the behaviors of searching, surrounding, pursuing, and attacking prey in the hunting process.
[0060] Searching for and surrounding the prey, the spotted hyena can quickly find the location of the prey and quickly surround it (appearing near the prey location). Surrounding the prey plays a role in global search in the spotted hyena optimization algorithm. The position of the currently best spotted hyena search individual (optimal position) is identified as the position of the prey. The spotted hyenas will continuously update their current positions as the prey moves (applicable to the n-dimensional search space). The mathematical model is as follows:
[0061] D h =|B·P p (x)-P(x)|
[0062] P(x + 1) = P(x) - E·D h
[0063] Where D h is the distance between the prey and the spotted hyena; x represents the current iteration; B and E are coefficient vectors. In this algorithm, a random value of E greater than 1 or less than -1 indicates that the spotted hyena is in the stage of expanding the search for the prey. |E| > 1 helps the spotted hyena move away from the prey. In addition, a random weight is provided for the prey through the vector B. Through continuous iteration, B > 1 helps the algorithm perform global search, and B < 1 is more conducive to the local search of the algorithm; P p represents the position vector of the prey; P is the position vector of the spotted hyena; || and · represent taking the absolute value and vector multiplication respectively. The calculations of the vectors B and E are as follows:
[0064] B = 2rd1
[0065] E = 2h·rd2 - h
[0066] h = 5 - (t(5 / T))
[0067] Where t = 1, 2, …, T; T is the maximum number of iterations; rd1 and rd2 are both random vectors in [0, 1]; h indicates that it linearly decreases from 5 to 0 during the iteration to the maximum number of iterations, in order to appropriately maintain the balance between exploration and exploitation.
[0068] Hunting prey, the individual position of the optimal spotted hyena is determined as the position of the prey. The search individuals of other spotted hyenas form a community and all move towards the position of the better individual, and the currently updated best value is retained. The process of hunting prey is described by the following three equations as follows:
[0069] D h =|B·P h -P k |
[0070] P k =P h -E·D h
[0071] C h =P k +P k+1 +…+P k+N
[0072] Among them, P h is the position of the optimal spotted hyena; P k is the position of other spotted hyenas; N is the number of spotted hyenas that become the optimal position, and the calculation method is as follows:
[0073] N = count nos (P h , P h+1 , P h+2 ,…, (P h +M))
[0074] Among them, M is a random vector in [0.5, 1]; count nos is the number of internal positions in the optimal cluster after adding M; C h is the group of N optimal solutions.
[0075] Attacking prey, in the spotted hyena optimization algorithm, a group of spotted hyenas attack the prey, and the mathematical description of their behavior is:
[0076]
[0077] Among them, P(x + 1) is the best solution finally output by the optimization algorithm, which is the average value of the positions of the optimal solution group.
[0078] S6. Result prediction and evaluation. Combining the historical dehumidification amount, defrosting characteristics and operating conditions of the dehumidifier, real-time and accurate prediction of the frosting situation of the air inlet fins of the dehumidifier is carried out using a relatively small amount of data, and then the frosting situation of the air inlet fins is evaluated to determine the best defrosting timing.
[0079] Example 1
[0080] Initialization: Set the starting point of the XGBoost model iteration as H0(x):
[0081]
[0082] where y i is the true label, C is an arbitrary constant, l is the loss of each sample, and L is the overall loss of M samples. Let C that minimizes the initial loss (take the first derivative of the loss and set it to 0). When the loss function is MSE, the value of C that minimizes the overall initial loss is the mean of y i . Set the initial values of the hyperparameters of XGBoost. Within the allowable range, randomly initialize the 6 hyperparameters of the XGBoost model. The position of each hyena individual in the hyena algorithm is a vector composed of the 6 hyperparameters of the XGBoost model. Initialize the parameters h, B, E, and N of the hyena optimization algorithm, and define the maximum number of iterations T as the termination condition. Start the first-layer loop, for t in 1, 2, 3...T:
[0083] Sampling: In the existing dataset N, sample M×subsample samples to form the training set N k , where subsample is 70%.
[0084] Start the second-layer loop, for k in 1, 2, 3...K:
[0085] Find the fitting term: For any sample i, calculate the first derivative g ik , and the second derivative h ik . The specific formulas are:
[0086]
[0087]
[0088] Build a tree: Sample according to the column sampling rule on the dataset (x i , r ik ), and then build a regression tree f k according to the structure score gain rule. And the formula for the structure score gain when any branch of the leaf node j is:
[0089]
[0090] Output the result on the tree: After building the tree, output the output value (predicted value) on the leaf node according to the structure of the regression tree f k .
[0091]
[0092] For any leaf node j, the output value is:
[0093] f k (x i ) = w j
[0094] Iteratively update. According to the prediction result f k (x), for the iterative model, assuming the input step size is η, for the whole algorithm, there is:
[0095] H K (x) = H k-1 (x) + ηf k (x)
[0096] When K trees are established and the second loop ends, output the value of H K (x) as the output value of the ensemble model.
[0097] Substitute the validation set data into H K (x), and obtain the mean square error between the sample true value and the prediction result (as the fitness of the hyena algorithm). The process is as Figure 1 shown. Calculate the fitness value of each hyena individual (5-fold cross-validation, take the mean of the model mean square error), find the fitness value of the current optimal hyena individual, use its position as the prey position (optimal solution), update the position of the optimal hyena individual (only update if it is better than the previous optimal solution and put it into the optimal solution group), iteratively update the positions of each other individual according to the position of the optimal hyena individual, and check the hyena out-of-bounds situation, and adjust the individuals that exceed the boundary; when the stop criterion is met or the maximum number of iterations is reached, the first layer of the loop ends, and substitute the mean vector of the positions of the optimal solution group as hyperparameters into the XGBoost model to obtain the optimized XGBoost optimal parameter model after training.
[0098] Substitute the real-time collected monitoring data into the trained model to obtain the prediction result of the defrost water output of the inlet fin, and make a decision on whether to start defrosting the dehumidifier according to the prediction result.
[0099] Embodiment 2
[0100] Schematic diagram of the experimental layout for verifying the dehumidification algorithm Figure 2As shown in the figure, the dehumidified object is a closed rock space. The experiment used two 40kg-class heating-type pipe dehumidifiers to work simultaneously, which were located in dehumidification room 1 (machine A) and dehumidification room 2 (machine B). The air was introduced into the dehumidified space through the air duct. The two dehumidifiers were calibrated in the laboratory. The maximum error of dehumidification under standard working conditions was less than 1kg / h. Dehumidification was carried out for a total of 36 days. In order to eliminate the impact of individual deviations of the two dehumidifiers, the experiment was divided into two stages. In the first stage, machine A used the defrost control algorithm based on machine learning to work continuously for 18 days, and machine B used temperature defrost and timed defrost (defrost interval of 40 minutes, defrost time of 5 minutes) for 9 days each. The actual water output of each machine was compared. Figure 3 As shown in the figure; in the second stage, machine B uses the defrost control algorithm based on machine learning to work continuously for 18 days, and machine A uses temperature defrost and timed defrost (defrost interval 40 minutes, defrost time 5 minutes) for 9 days each. The actual water output of each machine is compared as follows: Figure 4 shown.
[0101] The results show that the dehumidifier using the defrost control algorithm based on machine learning has higher dehumidification efficiency and larger daily water output. The actual effect of the algorithm is better than the traditional defrost control method.
[0102] The original technical solution of the present invention:
[0103] The present invention discloses a dehumidifier defrost control method based on the XGBoost algorithm, which predicts the defrost water output of the air inlet fins of the dehumidifier, and then judges the frosting condition of the air inlet fins to determine the best defrost time. The entire model makes full use of environmental information, has good adaptability and high accuracy, can effectively improve the dehumidification efficiency in low temperature environments, and reduce the risk of damage to the compressor caused by improper manual parameter setting in traditional methods.
[0104] The present invention discloses a dehumidifier defrost control method based on machine learning, and the method steps include: (1) collecting historical dehumidification and defrost characteristic data of the dehumidifier; (2) acquiring dehumidifier working condition data; (3) data preprocessing; (4) building an XGBoost model; (5) adjusting parameters, training and optimizing the XGBoost model; (6) result prediction and evaluation, combining the historical dehumidification, defrost characteristics and working condition characteristics of the dehumidifier, using a relatively small total amount of data to perform real-time and accurate prediction of the frosting condition of the dehumidifier's air inlet fins, thereby achieving optimal control of the dehumidifier's defrost timing and improving the dehumidification efficiency of the dehumidifier under low temperature conditions.
[0105] Collection of historical dehumidification and defrost characteristic data of dehumidifiers: Under low temperature conditions, the dehumidifier works normally for more than 20 minutes. Different working hours (defrost intervals) are set. The defrost time is uniformly set to 5 minutes. Corresponding to different working hours, the dehumidifier drainage (condensation water output) when the defrost is started is recorded separately, and the total drainage after the defrost is completed is recorded. The defrost water output = total drainage for this period - condensation water output for this period. The defrost water output is used as the actual value of the sample.
[0106] Dehumidifier operating data acquisition: record the operating data of the dehumidifier when defrosting is started: air inlet temperature, air inlet humidity, air outlet temperature, air outlet humidity, compressor temperature, compressor real-time power, compressor suction pressure, compressor outlet pressure, air outlet wind speed, air inlet wind speed, fan power, and use them as the characteristic values of the sample. Among them, the temperature and humidity data are obtained using the temperature and humidity sensors at the corresponding positions, the compressor temperature is obtained using an infrared temperature gun, the power data is obtained using the power monitor in the loop, the compressor inlet and outlet pressures are obtained using the pipeline pressure sensor, and the wind speed is obtained by the anemometer at the corresponding position.
[0107] Data preprocessing: Obtain dehumidifier operating data, identify and use the mean to fill missing data values, remove outliers, perform denoising and normalization, and convert the timestamp dimension from time format to sequence format. Use the Pearson correlation coefficient formula in probability statistics to calculate the correlation between two features, and the absolute value of the correlation is between [0,1]; in the data used in this application, the features with an absolute value of correlation greater than or equal to 0.9 are deleted. After screening, the inlet temperature, inlet humidity, outlet temperature, outlet humidity, compressor temperature, compressor suction pressure, compressor outlet pressure, and inlet wind speed are finally selected as the characteristic values of the sample.
[0108] Building the XGBoost model: XGBoost follows the basic process of the Boosting algorithm for modeling: based on the previous weak evaluator f(x) k-1 As a result, calculate the loss function L and use L to adaptively influence the next weak evaluator f(x) k The construction process is essentially an iterative optimization of the objective function to make the overall loss smaller and smaller, and the result of the integrated model output is affected by all weak evaluators f(x)0~f(x) k The estimator selects CART tree.
[0109] Objective function definition: The objective function in XGBoost is the objective function for a tree, which includes three parts: loss function L, number of leaves T, and regularization term. k The objective function is O k, there are a total of T leaves, and the output value (leaf weight) of the sample to which each leaf belongs is w j , the loss function of any sample numbered i on this tree is L(y i , H(x i ))), where H(x i ) is the prediction result of the sample numbered i on the ensemble model. Suppose there are a total of M samples on the tree, L2 regularization (λ is not 0) is used in the objective function, and γ is not 0, then the objective function of this tree is:
[0110]
[0111] Among them: H k (x i ) = H k-1 (x i ) + f k (x i ) L k = L(y i , H k-1 (x i ) + f k (x i ))
[0112] Objective function transformation: Take the derivative of the objective function O k to find the minimum value. There are multiple independent variables in this function, such as T, w j , f k (x i ), to find a single independent variable that minimizes the objective function, O k needs to be transformed as follows:
[0113]
[0114] y i is the actual value of the sample numbered i and is a known quantity. Then the first loss function L in O k is written as a function of L(H k-1 (x i ) + f k (x i )) with H k-1 (x i ) + f k (x i ) as the variable. Perform a Taylor expansion on this function:
[0115]
[0116] Define:
[0117] Then:
[0118] Omitting the constant term of this formula, the objective function O k can be simplified to:
[0119]
[0120] For any sample i located on leaf j, that is, i ∈ j, numerically f(x i ) = w j , then g ik f(x i ) = g ik w j . Further: Similarly, then
[0121]
[0122] Solving the objective function: From it can be seen that the objective function is only related to w j and T. It is impossible to minimize the objective function by minimizing the number of leaves because too few leaves will seriously affect the fitting performance of the tree. Therefore it is only possible to take the derivative with respect to w j . For the j-th leaf, let
[0123]
[0124] then
[0125]
[0126] Let this derivative equal 0 to obtain the leaf weight w j that minimizes the objective function on each leaf:
[0127]
[0128] The role of structure gain: During the tree construction process of the XGBoost algorithm, node splitting needs to be performed. The basis for node splitting is to maximize the degree of reduction in the objective function value after splitting. This basis is called structure gain. Substituting the optimal w j that minimizes the objective function back into μ j , the loss on one leaf (the component in the objective function) is:
[0129]
[0130] To minimize the objective function, the loss on each leaf needs to be minimized. And during the branching process, the objective function value of the parent node is greater than the sum of the objective function values of the child nodes. Therefore, (parent node objective function - sum of child node objective function values) is used to measure the quality of the branch. Then the structure gain is:
[0131]
[0132] Where the subscripts L, R, and P represent the left branch, right branch, and parent node respectively. When splitting tree nodes, the splitting method that maximizes the structural gain of the current node is selected.
[0133] Adjust the parameters and train and optimize the XGBoost model: There are many hyperparameters in the XGBoost regression model algorithm. Here, 6 relatively important ones are selected as the hyperparameter combination for training and optimization. They include: parameters that affect the overall model by influencing the tree-building process: γ (the coefficient multiplied before the number of leaves), λ (the L2 regularization term coefficient). Amplifying these two parameters can control overfitting; num_boost_round (the number of weak estimators, which is the actual number of iterations K and determines the overall learning ability), booster (the type of weak estimator. Here, two options, "gbtree" and "dart", are tested), max_depth (the maximum depth allowed for weak estimators), η (the learning rate, which affects the overall learning rate of the weighted summation process of weak classifier results).
[0134] Use the Spotted Hyena Optimizer (SHO) to globally and locally optimize the XGBoost hyperparameters. This algorithm is a swarm intelligence optimization algorithm that simulates the predation behavior of spotted hyenas and is applicable to function optimization and engineering optimization design. It has the characteristics of simple principle, few parameters to be adjusted, easy to implement, and strong global search ability. The steps of establishing the spotted hyena mathematical model correspond to the behaviors of searching for, surrounding, pursuing, and attacking prey during the hunting process.
[0135] Search for and surround the prey: Spotted hyenas can quickly locate the prey's position and quickly surround the prey (appear near the prey's position). Surrounding the prey plays a role in global search in the spotted hyena optimization algorithm. Identify the position of the current best spotted hyena search individual (optimal position) as the prey's position. Spotted hyenas will continuously update their current positions as the prey moves (applicable to the n-dimensional search space). The mathematical model is as follows:
[0136] D h =|B·P p (x)-P(x)|
[0137] P(x + 1) = P(x) - E·D h
[0138] Where D his the distance between the prey and the spotted hyena; x represents the current iteration; B and E are coefficient vectors. When the random value of E is greater than 1 or less than -1, the algorithm indicates that the hyena is in the stage of expanding the search for the prey. |E|>1 helps the hyena move away from the prey. In addition, a random weight is provided for the prey through the vector B, and through continuous iteration, B>1 helps the algorithm perform a global search, and B<1 is more conducive to the local search of the algorithm; P p represents the position vector of the prey; P is the position vector of the spotted hyena; || and · represent taking the absolute value and vector multiplication respectively. The vectors B and E are calculated as follows:
[0139] B = 2rd1
[0140] E = 2h·rd2 - h
[0141] h = 5 - (t(5 / T))
[0142] where t = 1, 2,..., T; T is the maximum number of iterations; rd1 and rd2 are both random vectors in [0, 1]; h represents linearly decreasing from 5 to 0 during the iteration to the maximum number of iterations, which helps to appropriately maintain the balance between exploration and exploitation.
[0143] Hunting the prey: It is determined that the individual position of the optimal spotted hyena is the position where the prey is located. The search individuals of other spotted hyenas form a community, all moving towards the position of the better individual, and the currently updated best value is retained. The above process of hunting the prey is described by the following 3 equations as follows:
[0144] D h = |B·P h - P k |
[0145] P k = P h - E·D h
[0146] C h = P k + P k+1 +…+ P k+N
[0147] where P h is the position of the optimal spotted hyena; P k is the position of other spotted hyenas; N is the number of spotted hyenas that become the optimal position, and the calculation method is as follows:
[0148] N = count nos (P h , P h+1 , P h+2 ,…, (P h + M))
[0149] where M is a random vector in [0.5, 1]; count nos is the number of the optimal intra-cluster positions after adding M; C h is the group of N optimal solutions.
[0150] Attacking Prey: In the spotted hyena optimization algorithm, a group of spotted hyenas attack the prey, and the mathematical description of their behavior is as follows:
[0151]
[0152] where P(x + 1) is the best solution finally output by the optimization algorithm, and is the average value of the positions of the optimal solution group.
[0153] Implementation Example 1
[0154] Initialization: Set the starting point of the XGBoost model iteration as H0(x):
[0155]
[0156] where y i is the true label, C is an arbitrary constant, l is the loss of each sample, and L is the overall loss of M samples. Let C that minimizes the initial loss (take the first derivative of the loss and set the first derivative to 0). When the loss function is MSE, the value of C that minimizes the overall initial loss is the mean of y i Set the initial values of the hyperparameters of XGBoost. Within the allowable range, randomly initialize 6 hyperparameters of the XGBoost model. The position of each hyena individual in the hyena algorithm is the vector composed of 6 hyperparameters of the XGBoost model. Initialize the parameters h, B, E, and N of the hyena optimization algorithm, and define the maximum number of iterations T as the termination condition. Start the first-layer loop, for t in 1, 2, 3...T:
[0157] Sampling: In the existing dataset N, sample M × subsample samples to form the training set N k , where subsample is 70%.
[0158] Start the second-layer loop, for k in 1, 2, 3...K:
[0159] Calculate the fitting term: For any sample i, calculate the first derivative g ik , and the second derivative h ik , and the specific formulas are as follows:
[0160]
[0161]
[0162] Build a tree, sample according to the column sampling rule on the dataset (x i , r ik ), and then build a regression tree f according to the structure score gain rule k . And the formula for the structure score gain at any branch of the leaf node j is:
[0163]
[0164] After building the tree and outputting the results on the tree, according to the structure of the regression tree f k , output the output value (predicted value) on the leaf node.
[0165]
[0166] For any leaf node j, the output value is:
[0167] f k (x i ) = w j
[0168] Iterative update, iterate the model according to the prediction result f k (x). Assuming the input step size is η, for the entire algorithm, we have:
[0169] H K (x) = H k-1 (x) + ηf k (x)
[0170] When K trees are built and the second loop ends, output the value of H K (x) as the output value of the ensemble model.
[0171] Substitute the validation set data into H K (x) to obtain the mean squared error between the sample true value and the prediction result (as the fitness of the hyena algorithm). The process is as shown in the figure. Calculate the fitness value of each hyena individual (5-fold cross-validation, take the mean of the model mean squared error), find the fitness value of the current optimal hyena individual, use its position as the prey position (optimal solution), update the position of the optimal hyena individual (only update if it is better than the previous optimal solution and put it into the optimal solution group), iterate and update the position of each other individual according to the position of the optimal hyena individual, and check the hyena out-of-bounds situation. Adjust the individuals that exceed the boundary; when the stopping criterion is met or the maximum number of iterations is reached, the first layer of the loop ends. Substitute the mean vector of the optimal solution group position as the hyperparameter into the XGBoost model to obtain the optimized XGBoost optimal parameter model after training.
[0172] Substitute the real-time collected monitoring data into the trained model to obtain the prediction result of the defrost water output of the inlet fin, and make a decision on whether to start defrosting the dehumidifier according to the prediction result.
[0173] Embodiment 2
[0174] Schematic diagram of the experimental layout for verifying the dehumidification algorithm Figure 2 As shown, the object to be dehumidified is an enclosed rock mass space. In the experiment, two 40 kg-class heating-type pipeline dehumidifiers were used to work simultaneously, located in dehumidification room 1 (Machine A) and dehumidification room 2 (Machine B) respectively, and the air outlet was introduced into the space to be dehumidified through the air duct. The two dehumidifiers participating in the test were calibrated in the laboratory, and the maximum error of the dehumidification capacity under standard working conditions was less than 1 kg / h. The dehumidification was carried out for 36 days in total. To eliminate the influence of the individual deviation of the two dehumidifiers on the results, the experiment was divided into two stages. In the first stage, Machine A continuously worked for 18 days using the defrost control algorithm based on machine learning, and Machine B used temperature defrosting and timed defrosting (defrosting interval: 40 minutes, defrosting time: 5 minutes) for 9 days each. The actual water output of each machine is compared as Figure 2 shown; in the second stage, Machine B continuously worked for 18 days using the defrost control algorithm based on machine learning, and Machine A used temperature defrosting and timed defrosting (defrosting interval: 40 minutes, defrosting time: 5 minutes) for 9 days each. The actual water output of each machine is compared as Figure 3 shown. The results show that the dehumidifier using the defrost control algorithm based on machine learning has higher dehumidification efficiency and larger daily water output, and the actual effect of this algorithm is better than that of the traditional defrost control method.
[0175] The beneficial technical effects of the present invention: Based on the method of machine learning, the present invention can more comprehensively predict the defrost drainage volume that directly reflects the frosting condition of the inlet fin according to the working conditions of the dehumidifier, and then guide the defrosting timing. Compared with the traditional method, the utilization of environmental data is more reasonable and effective. The algorithm can select appropriate data sets according to the actual working conditions and flexibly generate corresponding models, which can improve the dehumidification efficiency and reduce the risk of damage to the compressor life caused by inappropriate setting of the defrost interval time. In the present invention, the XGBoost model uses the hyena optimization algorithm to optimize the hyperparameters, improving the regression performance of the model.
[0176] Although the present invention has been described in detail with reference to the foregoing embodiments, for those skilled in the art, they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A defrosting control method for a dehumidifier based on machine learning, characterized in that: The method comprises the following steps: S1. Dehumidifier historical dehumidification and defrost characteristic data collection. Under low temperature conditions, the dehumidifier works normally for more than 20 minutes. Different working hours are set: defrost interval time, and the defrost time is uniformly set to 5 minutes. Corresponding to different working hours, the dehumidifier drainage volume when starting defrost: condensed water output, and the total drainage volume after defrosting are recorded. The defrost water output = total drainage volume in this period - condensed water output in this period. The defrost water output is used as the actual value of the sample; S2. Acquisition of dehumidifier working condition data, recording the working condition data of the dehumidifier when defrosting is started: air inlet temperature, air inlet humidity, air outlet temperature, air outlet humidity, compressor temperature, compressor real-time power, compressor suction pressure, compressor outlet pressure, air outlet wind speed, air inlet wind speed, fan power, and using them as the characteristic values of the sample, wherein the temperature and humidity data are acquired using the temperature and humidity sensor at the corresponding position, the compressor temperature is acquired using an infrared temperature gun, the power data is acquired using the power monitor in the loop, the compressor inlet and outlet pressures are acquired using the pipeline pressure sensor, and the wind speed is acquired by the anemometer at the corresponding position; S3. Data preprocessing: obtain dehumidifier operating data, identify and use the mean to fill missing data values, remove outliers, perform denoising and normalization, convert the timestamp dimension from time format to sequence format, and use the Pearson correlation coefficient formula in probability statistics to calculate the correlation between two features. The absolute value of the correlation is between [0,1]. In the data used in this application, the features with an absolute value of the correlation greater than or equal to 0.9 are deleted. After screening, the inlet temperature, inlet humidity, outlet temperature, outlet humidity, compressor temperature, compressor suction pressure, compressor outlet pressure, and inlet wind speed are finally selected as the characteristic values of the sample; S4. Build an XGBoost model. XGBoost follows the basic process of the Boosting algorithm for modeling. Based on the result of the previous weak estimator f(x) k-1 , calculate the loss function L and use L to adaptively influence the construction of the next weak estimator f(x) k . The construction process is essentially an iterative optimization of the objective function, which makes the overall loss smaller and smaller. The result output by the integrated model is affected by all weak estimators f(x)0 to f(x) k . This estimator selects a CART tree; Objective function definition: In XGBoost, the objective function for a single tree consists of three main parts: the loss function L, the number of leaves T, and the regularization term. Let the single tree be f k with the objective function being O k . There are a total of T leaves, and the output value of the samples belonging to each leaf - the leaf weight is w j . The loss function for any sample i on this tree is L(y i , H(x i ))), where H(x i ) is the prediction result of sample i on the ensemble model. Assuming there are a total of M samples on the tree, L2 regularization is used in the objective function, λ is not 0, Δ is 0, and γ is not 0, then the objective function of this tree is: where: H k (x i ) = H k-1 (x i ) + f k (x i )L k = L(y i , H k-1 (x i ) + f k (x i )) Objective function transformation, for the objective function O k Take the derivative to find the minimum value; there are multiple independent variables in this function, such as T, w j , f k (x i ). To find the single independent variable that minimizes the objective function, O k needs to be transformed as follows: y i is the actual value of the i-th sample, which is a known quantity, then O k The first loss function L in is written as taking H k-1 (x i ) + f k (x i ) as a function of the variable L(H k-1 (x i ) + f k (x i )) and perform a Taylor expansion on this function: Definition: Then: Omitting the constant term of this formula, the objective function O k can be simplified to: For any sample i located on leaf j, i.e., i ∈ j, numerically f(x i ) = w j , then g ik f(x i ) = g ik w j , furthermore: Similarly, then Objective function solution: From it can be seen that the objective function is only related to w j and T. It is impossible to minimize the objective function by minimizing the number of leaves because too few leaves will seriously affect the fitting performance of the tree. Therefore only the derivative with respect to w j can be taken. For the j-th leaf, let but Set the derivative equal to 0 to obtain the leaf weight w that minimizes the objective function on each leaf j : Role of structural gain: During the tree construction process of the XGBoost algorithm, node splitting is performed. The basis for node splitting is to maximize the degree of reduction in the objective function value after splitting, which is called structural gain. Let w be the optimal value that minimizes the objective function j Bring it back to μ j In, the loss on a leaf - the component in the objective function is: To minimize the objective function, the loss on each leaf needs to be minimized, and in the branching process, the objective function value of the parent node is greater than the objective function value of the child node. Therefore, the sum of the parent node objective function and the child node objective function is used to measure the quality of the branch, and the structural gain is: The subscripts L, R, and P represent the left branch, right branch, and parent node, respectively. When splitting a tree node, the splitting method that maximizes the gain of the current node structure is selected; S5. Adjust parameters, train and optimize the XGBoost model. The XGBoost regression model algorithm has many hyperparameters. Here we select 6 of the more important ones as the hyperparameter combination for training optimization. They include: parameters that affect the overall model by affecting the tree building process: γ is the coefficient before multiplying the number of leaves, and λ is the L2 regularization coefficient. These two parameters can control overfitting. num_boost_round is the number of weak evaluators, which is the actual number of iterations K and determines the overall learning ability. booster is the type of weak evaluator. Here we test the "gbtree" and "dart" options. max_depth allows the maximum depth of the weak evaluator. η is the learning rate, which affects the overall learning rate of the weighted summation process of the weak classifier results. Using the Spotted Hyena Optimizer (SHO) to perform global and local optimization on the hyperparameters of XGBoost, the steps of establishing the spotted hyena mathematical model respectively correspond to the behaviors of searching, surrounding, pursuing, and attacking prey in the hunting process; Searching for and surrounding prey, spotted hyenas can quickly locate the prey's position and rapidly surround it. Surrounding the prey plays a role in global search in the spotted hyena optimization algorithm. The optimal position of the currently best spotted hyena search individual is determined as the position of the prey. Spotted hyenas will continuously update their current positions as the prey moves. The mathematical model is as follows: D h = |B·P p (x) - P(x)| P(x + 1) = P(x) - EgD h Among them, D h is the distance between the prey and the spotted hyena; x represents the current iteration; B and E are coefficient vectors. The algorithm uses the random value of E greater than 1 or less than -1 to indicate that the hyena is in the stage of expanding the search for prey. |E|>1 helps the hyena move away from the prey. In addition, the vector B provides a random weight for the prey. Through continuous iteration, B>1 helps the algorithm perform global search, and B<1 is more conducive to the local search of the algorithm; P p represents the position vector of the prey; P is the position vector of the spotted hyena; || and · represent taking the absolute value and vector multiplication respectively. The calculations of the vectors B and E are as follows: B = 2rd1 E = 2h·rd2 - h h = 5 - (t(5 / T)) where t = 1, 2, …, T; T is the maximum number of iterations; rd1 and rd2 are both random vectors in [0, 1]; h represents linearly decreasing from 5 to 0 during the iteration to the maximum number of iterations to help maintain an appropriate balance between exploration and exploitation; Pursuing prey, the individual position of the optimal spotted hyena is determined as the position where the prey is located. The search individuals of other spotted hyenas form a community and all move towards the position of the better individual, and the currently updated best value is retained. The above process of pursuing prey is described by the following three equations: D h = |B·P h -P k | P k = P h - EgD h C h = P k + P k+1 + … + P k+N Among them, P h is the position of the optimal spotted hyena; P k is the position of other spotted hyenas; N is the number of spotted hyenas that become the optimal position, and the calculation method is as follows: N = count nos (P h , P h+1 , P h+2 ,…, (P h + M)) where M is a random vector in [0.5, 1]; count nos is the number of the optimal intra-cluster positions after adding M; C h is the group of N optimal solutions; Attacking prey, in the spotted hyena optimization algorithm, a group of spotted hyenas attack the prey. The mathematical description of their behavior is: where P(x + 1) is the best solution finally output by the optimization algorithm, which is the average value of the optimal solution group positions; S6. Result prediction and evaluation. Combining the historical dehumidification amount, defrosting characteristics, and operating conditions of the dehumidifier, real-time and accurate prediction of the frosting situation of the inlet fins of the dehumidifier is carried out using a relatively small amount of data, and then the frosting situation of the inlet fins is evaluated to determine the best defrosting timing.
Citation Information
Patent Citations
Front frost preventing and melting method
CN104933322A
Defrosting processing method and device, defrosting equipment and storage medium
CN112361680A
Defrosting control parameter adjusting method and device, computer equipment and storage medium
CN115235045A