Construction method and application of fault detection model for HVAC system
By embedding the context attention module on the Transformer model, combining joint data augmentation and collaborative pre-training task lines, the problems of shortage of marked data and isolated features in HVAC fault detection are solved, and efficient and accurate fault detection effects are achieved.
Patent Information
- Application Number
- CN202411680479.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-11-22
AI Technical Summary
The existing technology is limited by the shortage of labeled data in HVAC fault detection. Supervised learning methods require a large amount of labeled data. Transfer learning and semi-supervised learning vary greatly between different operating systems, resulting in poor detection results. Self-supervised learning methods There are limitations of instance-level feature isolation and single pretext task in HVAC systems.
Using a self-supervised representation learning method based on Transformer model, a backbone encoder is built by embedding the context attention module on the self-attention module, and a joint data augmentation strategy and a collaborative pre-training task line (comparing similarity matching and data reconstruction) , to extract contextual representations and discriminant features in HVAC operating data.
It improves the efficiency and quality of HVAC fault detection, can accurately detect HVAC faults under limited labeling data, and enhances the model's characterization and extraction capabilities.
Smart Images

Figure CN119202751B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of fault detection, and in particular to a method for constructing a fault detection model for a HVAC system and its application. Background Art
[0002] HVAC is a component of a building, including heating, ventilation, and air conditioning. Correspondingly, the HVAC system refers to the system responsible for heating, ventilation, and air conditioning in the building. It can provide heat to the interior of the building to keep the indoor temperature at a suitable level; it can also realize the exchange of indoor and outdoor air to maintain the quality of indoor air and good comfort; it can also control indoor temperature, humidity, cleanliness, air flow rate and other parameters to meet the requirements of human comfort and certain specific environments. The widespread installation of building monitoring systems has enabled a large amount of building operation data to be collected, bringing prospects for intelligent building operation management methods. Among them, data-driven fault diagnosis methods have also been applied in HVAC systems, thereby achieving the effect of quickly and accurately detecting HVAC system faults through data analysis.
[0003] The current mainstream fault detection model is to establish a mapping relationship between monitoring variables (such as flow, temperature, and pressure) and operating conditions (such as normal or faulty) through supervised learning algorithms. However, the application of this supervised learning method is limited by the need for sufficient labeled data. However, labeling is labor-intensive and requires extensive domain knowledge, resulting in a shortage of labeled data for such supervised learning models.
[0004] In order to solve the problem of insufficient labeled data, transfer learning or semi-supervised learning methods can be used. Transfer learning is based on obtaining labeled data from the operating data of similar buildings. However, different operating systems have significant differences in their respective usage scenarios, which leads to poor fault detection results of the model obtained by transfer learning. Semi-supervised learning uses unlabeled data to improve the performance of model fault detection under limited labeled data, but the performance of these methods still depends to a large extent on the quantity and quality of the initial labeled data. When the initial labeled data is extremely limited and not representative enough, misleading pseudo-labels may be generated, which still leads to poor final fault detection results.
[0005] Compared with the above methods, self-supervised learning is more suitable for fault detection scenarios with less labeled data. Self-supervised learning generates proxy labels from the data itself by formulating pretext tasks, and designs pre-trained models on this basis to extract meaningful data representations for downstream classification tasks, which can release the potential of a large amount of unlabeled data. However, the operating data of the HVAC system is tabular data, and the values in the tabular data may be independent or correlated, which leads to many defects in the self-supervised learning method in the fault detection model of the HVAC system:
[0006] 1) Current self-supervised learning methods treat input samples as individual entities and focus only on instance-level features. For example, when analyzing the operating data of a HVAC system, it may only consider the features of a certain monitoring point at a certain moment (such as the temperature sensor data of a certain room), without considering the association between the data of this monitoring point and other related monitoring points (such as the temperature and humidity of other rooms on the same floor, or the ventilation volume of the room, etc.), that is, ignoring the contextual information related to different samples. This way of viewing samples in isolation may make it impossible to fully and accurately grasp the operating status of the HVAC system, thereby affecting the accuracy of fault detection.
[0007] 2) Current self-supervised learning methods only focus on one specific pretext task for representation learning. For example, they may only focus on the data reconstruction task and extract features by learning the relationship between the original data and the damaged data. However, the HVAC system is a complex system whose operating data contains a variety of information. Relying on only one task for learning ignores the potential benefits of the interaction between multiple pretext tasks. For example, the comparative similarity matching task can mine features from the perspective of similarities and differences between different samples. If this task is not combined, the model may not be able to fully learn the key features that can distinguish between normal and faulty states, thereby limiting the model's representation extraction capabilities and ultimately affecting the effectiveness of fault detection. Summary of the invention
[0008] The embodiment of the present application provides a method for constructing a fault detection model for a HVAC system and its application, builds a self-supervised representation learning model based on Transformer, and optimizes the model architecture to improve the efficiency and quality of fault detection for the HVAC system.
[0009] In a first aspect, an embodiment of the present application provides a method for constructing a fault detection model for a HVAC system, comprising the following steps:
[0010] Obtain unlabeled and labeled data of HVAC systems;
[0011] Construct a backbone encoder and build a pre-training framework based on the backbone encoder, wherein the backbone encoder is a Transformer model with an added contextual attention module, wherein the pre-training framework includes a data augmentation unit, a comparative similarity matching pre-training task line, and a data reconstruction pre-training task line, and the comparative similarity matching pre-training task line and the data reconstruction pre-training task line collaboratively share the backbone encoder;
[0012] The unlabeled data is input into the pre-training framework for self-supervised learning until the optimization target is met to obtain a backbone encoder with optimized parameters, wherein the original data of the unlabeled data is input into the data enhancement module for data enhancement to obtain enhanced data, the enhanced data and the original data are input into the contrast similarity matching pre-training task line to calculate the contrast similarity loss, the enhanced data and the original data are input into the data reconstruction pre-training task line to calculate the data reconstruction loss, and the minimum value of the weighted sum of the data reconstruction loss and the contrast similarity loss is taken as the optimization target;
[0013] A fault detection architecture is constructed based on a backbone encoder with optimized parameters, and the labeled data is input into the fault detection architecture for supervised learning until the training conditions are met to obtain a fault detection model for the HVAC system, wherein the fault detection architecture is connected with a multi-layer perceptron on top of the backbone encoder with optimized parameters.
[0014] In a second aspect, an embodiment of the present application provides a fault detection method for a HVAC system, comprising the following steps: inputting operating data of HVAC data into a fault detection model for the HVAC system to obtain a fault category.
[0015] The main contributions and innovations of the present invention are as follows:
[0016] The backbone encoder of the fault detection model proposed in the embodiment of the present application embeds a contextual attention module on the self-attention module, so that the fault detection model can mine the contextual representations between the input HVAC system operation data. In addition, the training process of the fault detection model adopts a self-supervised learning method. In the self-supervised pre-training process of the backbone encoder, a joint data enhancement strategy is designed to improve the diversity of input data and promote the p pre-training task to learn a wider range of representations from unlabeled data. At the same time, two collaborative pre-training task lines are formulated, namely, comparative similarity matching and data reconstruction, to extract discriminative representations from unlabeled data. Finally, the backbone encoder can use the diagnostically useful representations learned from unlabeled data for the fault detection scenario of the HVAC system.
[0017] In other words, this scheme provides a backbone encoder based on the improved Transformer model, which can extract contextual information related to different samples from the unlabeled data of the HVAC system; this scheme provides a pre-training task for the backbone encoder, and designs a joint data enhancement strategy to improve the diversity of the input unlabeled data, thereby promoting the two pre-training task lines of the pre-training framework to learn a wider range of representations from unlabeled data, and the pre-training framework of this scheme includes a comparison similarity matching pre-training task line and a data reconstruction pre-training task line, which can extract function knowledge from different angles to enhance the discrimination ability of the backbone encoder; the fault detection model constructed based on the backbone encoder in this scheme has been verified by experimental data and can accurately detect faults of the HVAC system based on limited labeled data.
[0018] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0020] Figure 1 It is a process diagram of a method for constructing a fault detection model for a HVAC system according to an embodiment of the present application.
[0021] Figure 2 It is a schematic diagram of the structure of the backbone encoder according to the present application.
[0022] Figure 3 It is a comparison chart of the accuracy improvement (INC) of the fault detection model relative to other variants.
[0023] Figure 4 It is a comparison of the F1 score of the fault detection model relative to other variants (INC).
[0024] Figure 5 It is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0025] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0026] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0027] Embodiment 1
[0028] This solution provides a fault detection model specifically for HVAC systems. This fault detection model solves the problem of insufficient labeled data for HVAC system operation data through self-supervised learning. The Transformer basic framework is modified to obtain a backbone encoder by embedding a contextual attention module on the basis of the self-attention module to ensure the extraction of contextual representations of unlabeled data. Two self-supervised pre-training tasks are formulated to collaboratively encourage the backbone encoder to learn more discriminative representations from unlabeled data.
[0029] Specifically, the method for constructing a fault detection model for a HVAC system provided in this solution includes the following steps:
[0030] Obtain unlabeled and labeled data of HVAC systems;
[0031] Construct a backbone encoder and build a pre-training framework based on the backbone encoder, wherein the backbone encoder is a Transformer model with an added contextual attention module, wherein the pre-training framework includes a data augmentation unit, a comparative similarity matching pre-training task line, and a data reconstruction pre-training task line, and the comparative similarity matching pre-training task line and the data reconstruction pre-training task line collaboratively share the backbone encoder;
[0032] The unlabeled data is input into the pre-training framework for self-supervised learning until the optimization target is met to obtain a backbone encoder with optimized parameters, wherein the original data of the unlabeled data is input into the data enhancement module for data enhancement to obtain enhanced data, the enhanced data and the original data are input into the contrast similarity matching pre-training task line to calculate the contrast similarity loss, the enhanced data and the original data are input into the data reconstruction pre-training task line to calculate the data reconstruction loss, and the minimum value of the weighted sum of the data reconstruction loss and the contrast similarity loss is taken as the optimization target;
[0033] A fault detection architecture is constructed based on a backbone encoder with optimized parameters, and the labeled data is input into the fault detection architecture for supervised learning until the training conditions are met to obtain a fault detection model for the HVAC system, wherein the fault detection architecture is connected with a multi-layer perceptron on top of the backbone encoder with optimized parameters.
[0034] The method for constructing a fault detection model for a HVAC system provided in this solution adopts a self-supervised learning method to learn the unlabeled data of the HVAC system to obtain a backbone encoder with optimized parameters. The backbone encoder with optimized parameters can fully extract discriminative features that are beneficial for fault detection from large-scale unlabeled data, and then a fault detection architecture is constructed based on the backbone encoder with optimized parameters combined with a multi-layer perceptron. A small amount of labeled data is used to fine-tune the backbone encoder with optimized parameters to obtain a fault detection model that can accurately detect faults in the HVAC system.
[0035] It should be noted that the labeled data and unlabeled data of the HVAC system are operating data in a tabular form. Exemplarily, the operating data of the HVAC system may include a basic information column, a monitoring information column, an operating status column, an environmental parameter column or an energy consumption column. The basic information column records the serial number of the HVAC system component and the data collection time, the monitoring information column records the temperature, pressure, flow and humidity, the operating status column records the equipment operating status and valve opening, the environmental parameter column records the outdoor temperature, outdoor humidity and other data, and the energy consumption column records the power consumption, gas consumption and other data.
[0036] In some embodiments, the annotated data of the HVAC system is operation data annotated with a fault category of the HVAC system.
[0037] Since the labeled data and unlabeled data of the HVAC system are in tabular form, this scheme specifically adopts a backbone encoder based on the improved Transformer model. This is because the Transformer model is different from other models in that it can effectively analyze tabular data. Specifically, the Transformer model can regard the tabular data of each sample as a sequence and explore the internal correlation between different variables through the inherent self-attention mechanism. In order to optimize the contextual representation performance of the backbone encoder for the labeled data and unlabeled data of the HVAC system, and to overcome the problem that traditional self-supervised learning methods only focus on instance-level features and ignore contextual information, the backbone encoder of this scheme adds a contextual attention module on the basis of the basic Transformer model.
[0038] About the backbone encoder of this solution:
[0039] Specifically, Figure 2 As shown, Figure 2 It is a schematic diagram of the structure of the backbone encoder of this scheme. The backbone encoder of this scheme integrates self-attention modules and context modules to capture the contextual representation information between different samples. The backbone encoder of this scheme includes multiple layers of encoding layers connected in sequence, each encoding layer includes self-attention modules and context attention modules connected in sequence, wherein the self-attention module is composed of multi-head self-attention layer, position-by-position feedforward layer, layer normalization and residual connection, wherein the context attention module is composed of multi-head context attention layer, position-by-position feedforward layer, layer normalization and residual connection. The external data is input into the backbone encoder for feature embedding and then input into the multi-layer encoding layer. The self-attention module in the backbone encoder is used to learn the individual representation of the tabular data, and the self-attention mechanism and residual connection are used to improve the accuracy and interpretability of downstream tasks. The context attention module uses the context attention mechanism to focus on the corresponding features of similar samples.
[0040] Specifically, the self-attention module in each encoding layer of the present scheme includes a multi-head self-attention layer, layer normalization, a position-by-position feedforward layer, and layer normalization connected in sequence, and residual connections are used in the multi-head self-attention layer and the position-by-position feedforward layer.
[0041] The self-attention module of this scheme plays a key role in each encoding layer. Its structural design is designed to effectively process tabular data and lay the foundation for subsequent feature extraction and representation learning. The multi-head self-attention layer in the self-attention module has h heads. The multi-head mechanism allows the backbone encoder to simultaneously focus on the input data from different representation subspaces, thereby capturing richer feature information. Each head independently calculates the attention score and concatenates and linearly transforms the calculated results, integrating information from multiple perspectives and enhancing the model's ability to understand complex relationships in tabular data; layer normalization normalizes the features of each sample in each layer, so that the model can converge more stably during training and avoid gradient vanishing or exploding problems caused by changes in data distribution; the role of the position-by-position feedforward layer is to further nonlinearly transform the features processed by the self-attention of the multi-head self-attention layer to enhance the expression ability; in addition, the residual connection directly adds the input data to the output of the submodule, so that the model can easily learn the identity mapping, which helps to alleviate the gradient vanishing problem.
[0042] In some embodiments, the position-by-position feed-forward layer is composed of two feed-forward layers activated by a GELU activation function. The GELU activation function is a smooth and nonlinear function that can better handle zero values in input data and provide smoother gradients than traditional activation functions (such as ReLU), which is beneficial to model optimization.
[0043] The context module in each encoding layer of this scheme includes a multi-head context attention layer, layer normalization, a position-by-position feedforward layer and layer normalization connected in sequence, and residual connections are used in the multi-head context attention layer and the position-by-position feedforward layer.
[0044] It should be noted that the multi-head contextual attention layer is different from the multi-head self-attention layer. The multi-head contextual attention promotes the interaction between all features of different samples. That is, the attention calculation is performed on the features of all samples in a given batch, rather than on the features of a single sample. Figure 3 As shown, Figure 3It is the calculation logic of the multi-head contextual attention layer. After the raw data of multiple samples of the same batch input to the backbone encoder are processed by the self-attention mechanism in the self-attention module, all the features of each sample are embedded and connected in the multi-head contextual attention layer. In this way, the representation learned from a given sample can be improved by checking other samples. When a feature in a sample is missing or damaged, the multi-head contextual attention layer enables the backbone encoder to refer to the corresponding features of similar samples in the batch. Specifically, all the features of each sample are converted into corresponding embedding vectors and then added to obtain the embedding vector of the current sample. The embedding vector is multiplied by three learnable weight matrices W to obtain the query matrix, key matrix and value matrix. The embedding connection between different samples is obtained to obtain the output result of the multi-head contextual attention layer.
[0045] In some specific embodiments, the backbone encoder contains two encoding layers, the number of heads of the self-attention module and the context attention module in each encoding layer is set to 8, and the feedforward layers of the self-attention module and the context attention module are configured as 16 - 128 - 64 - 16 and (16×n)-(16×n×8)-(16×n×4)-(16×n), respectively, where represents the number of features of the original data.
[0046] The specific calculation process of the backbone encoder is as follows:
[0047] Assumptions Represents a dataset of unlabeled data with M samples, where the number of feature variables of each sample is n, and i represents the number of each sample.
[0048] First, each sample is converted into an embedding vector through the embedding layer, and then the embedding vector is input into the self-attention module to extract individual representation features. , i represents the number of each sample; then, the context attention module takes the individual representation features of all samples Takes as input and outputs a context representation ,i still represents the number of each sample, and the calculation process is as follows:
[0049] ;
[0050] Where MSA() represents the multi-head self-attention mechanism, MCA() represents the multi-head contextual attention mechanism, E() represents the embedding layer, LN() represents layer normalization, FF1 represents the position-by-position feedforward layer in the self-attention module, and FF2 represents the position-by-position feedforward layer in the self-attention module. represents each sample, and b represents the number of all samples in the data set.
[0051] About the data enhancement module of this solution:
[0052] In order to avoid excessive data enhancement introducing excessive pre-training task intensity, and to avoid excessive data enhancement weakening the pre-training task intensity, the data enhancement module of this solution adopts a joint data enhancement strategy to enhance the unlabeled data to obtain enhanced data.
[0053] Specifically, the data enhancement module of this scheme uses CutMix and Mixup for joint data enhancement at the same time, which can expand the original data of unlabeled data from different angles, bringing challenging and effective pre-training tasks to the pre-training of the proposed backbone encoder. CutMix mainly changes the structure of the original data, while Mixup focuses on combining the features of the embedding vectors of the original data. The combination of the two can learn the features and patterns of the data from multiple perspectives and improve the generalization ability and robustness of the model. Through this joint data enhancement strategy, more diverse training data can be generated to be exposed to more different situations during the training process, so as to better learn the operating laws and fault characteristics of the HVAC system, which helps to improve the accuracy and reliability of the model in practical applications and more accurately detect HVAC system faults.
[0054] Correspondingly, the data enhancement module uses CutMix to enhance the original data of the unlabeled data to obtain CutMix version data, and uses Mixup to enhance the embedded vector of the CutMix version data to obtain enhanced data. Specifically, for each sample in the unlabeled data, the data enhancement module uses CutMix and uses a random sample in the unlabeled data to enhance the current sample to obtain CutMix version data, and uses Mixup to enhance the current sample with the CutMix version data and the CutMix version data of another random sample in the unlabeled data to obtain enhanced data.
[0055] For each sample in the unlabeled data, the data enhancement formula of the data enhancement module is as follows:
[0056] ;
[0057] in is the original data of each sample, and is a random sample in the current unlabeled data, and M represents the same sample A mask matrix of 0 to 1 with the same dimension as , used to specify the noise injection position, represents the dot product, E() represents the embedding vector, express CutMix version, Indicates the sample CutMix version data, It is to enhance the data. It should be noted that the value of M is drawn from the binomial distribution with probability , It is the parameter of mixup.
[0058] In some specific embodiments, is 0.2, is 0.3.
[0059] For the tabular operating data of the HVAC system, the data enhancement method of CutMix is equivalent to randomly selecting a part of the data rows or columns, extracting them from one sample and combining them with the corresponding part of another sample, which can increase the diversity of the original input data. In the HVAC system, different operating states and parameter combinations may correspond to different fault conditions. The CutMix version of the data enhanced by CutMix allows the model to learn more different combinations and improve the model's adaptability to various complex situations. For example, some intermediate state data between normal operating state and fault state may be generated to help the model better understand the evolution of the fault. Mixup's data enhancement method generates new samples by linearly combining two samples. In the fault detection scenario of the HVAC system, this helps the model better understand the transition and change between different operating states. For example, when the system gradually changes from a normal state to a fault state, the embedded data enhanced by Mixup allows the model to learn the characteristics of this continuous change and improve the model's ability to detect early faults.
[0060] About the comparative similarity matching pre-training task line:
[0061] The contrastive similarity matching pre-training task line constructed in this scheme uses contrastive loss to extract domain-invariant representation information from unlabeled data. For each sample of unlabeled data, the enhanced data obtained by enhancing the original data of the current sample through the data enhancement module constitutes a positive sample pair with the original data of the current sample. The enhanced data obtained by enhancing other samples through the data enhancement module constitutes a negative sample pair with the original data of the current sample. The pre-training goal of the contrastive similarity matching pre-training task line is to maximize the similarity between positive sample pairs and minimize the similarity between negative sample pairs.
[0062] Specifically, Figure 1 As shown, the comparative similarity matching pre-training task line of this scheme includes an original coding mapping branch, an enhanced coding mapping branch and a comparison space, wherein the original coding mapping branch and the enhanced mapping branch have the same structure, both containing backbone encoders and mapping modules with the same parameters, the original coding mapping branch is used to input the original data of each sample of unlabeled data, and the enhanced mapping branch is used to input the enhanced data corresponding to the current sample.
[0063] Correspondingly, the original data of each sample of the unlabeled data is input into the backbone encoder of the original encoding mapping branch to extract the original encoding features, and the original encoding features are mapped to the comparison space through the mapping module; the enhanced data corresponding to the current sample is input into the enhanced encoding mapping branch to extract the mapping encoding features, and the mapping encoding features are mapped to the comparison space through the mapping module, and the comparison similarity loss of the positive sample pair and the negative sample pair of the current sample is calculated in the comparison space. As mentioned above, the positive sample pair is a data pair consisting of the enhanced data obtained by enhancing the original data of the current sample through the data enhancement module and the original data of the current sample, and the negative sample pair is a data pair consisting of the enhanced data obtained by enhancing the original data of other samples through the data enhancement module and the original data of the current sample.
[0064] It should be noted that the original data and enhanced data of each sample are input into the original coding mapping branch and the enhanced coding mapping branch in the form of embedded vectors.
[0065] In some embodiments, Info-NCE is used in the comparison space to evaluate the similarity between the positive sample pair and the negative sample pair of the current sample.
[0066] In some embodiments, the calculation formula for the alignment similarity loss is:
[0067] ;
[0068] ;
[0069] ;
[0070] ;
[0071] in represents the comparison similarity loss, N represents the number of unlabeled data, Represents the embedding vector of the original data of the current sample, is the embedding vector of the augmented data of the current sample, is the embedding vector of the augmented data of other samples, is the backbone encoder in the original encoding mapping branch, To enhance the backbone encoder in the code mapping branch, Represents the original encoding features of the current sample, Represents the mapping encoding features of the current sample, Represents the mapping encoding features of other samples, represents the optimization parameters of the backbone encoder, exp() is the exponential function, is the temperature parameter, g1() represents the mapping module in the original encoding-mapping branch, g2() represents the mapping module in the enhanced encoding-mapping branch, Represents the optimization parameter that minimizes the alignment similarity loss.
[0072] In some embodiments, the temperature parameter is set to 0.99, and g1() and g2() are set to (16×n)-(16×n×2)-(16×n / 4).
[0073] About the data reconstruction pre-training task line:
[0074] The data reconstruction pre-training task line and the comparison similarity matching pre-training task line of this scheme share the backbone encoder and extract the potential representation information through the point-by-point generation technology.
[0075] Specifically, Figure 1 As shown, the data reconstruction pre-training task line of this scheme shares the backbone encoder of the enhancement mapping branch of the contrast similarity matching pre-training task line, and a decoder is connected after the backbone encoder of the enhancement mapping branch. The decoder reconstructs the damaged samples by minimizing the mean square error between the original data of the unlabeled data and the corresponding enhanced data.
[0076] Correspondingly, the enhanced data of each sample of the unlabeled data is input into the enhanced coding mapping branch to extract the mapping coding features, and the original data of each sample and the corresponding mapping coding features are input into the decoder to calculate the data reconstruction loss.
[0077] In some embodiments, the data reconstruction loss is:
[0078] ;
[0079] in represents the data reconstruction loss, N represents the number of unlabeled data, Represents the original data of the current sample, Represents the mapping encoding features of the current sample, Represents a decoder, represents the optimization parameters of the backbone encoder, Represents the optimization parameter that minimizes the data reconstruction loss.
[0080] This scheme collaborates with the data reconstruction pre-training task line and the comparative similarity matching pre-training task line to learn more discriminative information from the unlabeled data of the HVAC system. The comparative similarity matching regards each tabular data as an independent individual and learns domain-invariant representations by identifying similarities and differences. The data reconstruction extracts more abstract representations by learning the intrinsic structure and patterns of the unlabeled data.
[0081] The total loss function of the pre-training framework of this scheme is the weighted sum of data reconstruction loss and comparative similarity loss, and the optimization goal is set to optimize the minimum value of the weighted sum of data reconstruction loss and comparative similarity loss. The total loss function is as follows:
[0082] ;
[0083] Where L is the total loss function of the pre-training framework, To compare the similarity loss, is the data reconstruction loss, The weight factor for data reconstruction loss.
[0084] In some embodiments, the weight factor Set to 10.
[0085] About the fault detection architecture:
[0086] The backbone encoder obtained after self-supervised learning through the pre-training framework can well mine useful features from unlabeled data. Therefore, the fault detection architecture constructed based on this backbone encoder can complete the fault detection of the HVAC system with high quality with a small amount of labeled data.
[0087] Specifically, the fault detection architecture of this solution includes a backbone encoder for optimizing parameters and a multi-layer perceptron connected to the top of the backbone encoder. The labeled data is input into the fault detection architecture for supervised learning until the training conditions are met to obtain a fault detection model for the HVAC system. Specifically, each labeled data is input into the backbone encoder of the fault detection architecture to extract the hidden representation, and the hidden representation is input into the multi-layer perceptron to generate the corresponding prediction label, where the prediction label is represented by the probability distribution of the category label.
[0088] In some embodiments, the training condition of the fault detection architecture is to train until the loss function value is minimized.
[0089] In some embodiments, the loss function of the fault detection architecture is a cross entropy loss, which is calculated as follows:
[0090] ;
[0091] in Indicates the number of labeled data, i is the number of each labeled data, is the true label corresponding to the i-th labeled data, is the predicted label corresponding to the i-th labeled data, and log() is the logarithmic function.
[0092] In some embodiments, the multi-layer perception layer consists of a single hidden layer activated by ReLU.
[0093] In some specific embodiments, two layers of multilayer perceptrons are set as classifiers of the fault detection architecture, and the architecture thereof is 16-1000-C, where C represents the total number of label categories.
[0094] Embodiment 2
[0095] Based on the same concept, the present application also proposes a fault detection model for a HVAC system, which is constructed according to the method for constructing a fault detection model for a HVAC system described in the first embodiment above.
[0096] This scheme provides a fault detection case of HVAC system to verify the effectiveness of the proposed fault detection model. The data set of the case is randomly divided into 65%, 20% and 15% for model training, testing and verification, respectively. The training data set is further divided into unlabeled data set and labeled data set, where the former is much larger than the latter. The learning rate in the pre-training stage and fine-tuning stage is set to 0.03 and 0.0005, respectively. The batch size of unlabeled data and labeled data is 64 and 5, respectively. The proposed fault detection model is optimized by the stochastic gradient descent (SGD) optimizer for 80 and 500 rounds for pre-training and detection tasks, respectively. Each experiment is repeated 10 times with 10 different random seeds, and the average results are reported.
[0097] Case 1:
[0098] The proposed fault detection model is first validated on a chiller dataset provided by the American Society of Heating, Refrigerating and Air-Conditioning Engineers (ASHRAE) RP-1043 project. In this project, a 90-ton (316-kW) centrifugal chiller was used to collect operating data under different chiller conditions. The operating data are shown in Table 1. Seven major faults with different severity levels were manually introduced during the experiment. After data preprocessing, there are 3,000 samples for each chiller condition in this study, and each sample contains 61 features.
[0099] Table 1 Operation data table of case 1
[0100] Fault Status abbreviation Experimental methods Sample size normal RP0 none 3000 Refrigerant leak Refrigerant leak RP1 Discharge 10% to 40% of refrigerant 3000 Excessive refrigerant RP2 Overcharge with 10% to 40% refrigerant 3000 Excessive oil RP3 Add 14% to 68% oil 3000 Condenser fouling RP4 Blockage of 12% to 45% of pipes 3000 Evaporator water flow reduction RP5 Reduce water flow by 10% to 40% 3000 Condenser water flow reduction RP6 Reduce water flow by 10% to 40% 3000 There are non-condensable gases in the refrigerant RP7 Add 1% to 5% nitrogen 3000
[0101] In the proposed fault detection model (TSTSS), theoretically, two pre-training task lines, contrastive similarity matching and data reconstruction, are constructed to synergistically learn more discriminative representations from unlabeled data. To confirm this, comparative experiments are conducted to examine the importance of utilizing both pre-training task lines simultaneously instead of using only one of them. Accordingly, two variants are obtained by modifying the original fault detection framework: only the contrastive similarity matching pre-training task line (CS) and only the data reconstruction pre-training task line (RE). The fault detection (FD) performance of different frameworks is compared by evaluating the quality of the representations mined by the pre-trained backbone encoder of each framework. The encoder of each framework is pre-trained using all the unlabeled training data. Subsequently, the pre-trained encoder is used to process different amounts of labeled data (5, 10, 20, 30, 40 and 50 samples per class), and the fault detection performance is evaluated on the test dataset. The comparison results of the improvement (INC) of the fault detection model over other variants are shown in Figure 2. Figure 3 As shown in Figure 2, the comparison of the F1 score of the fault detection model relative to other variants (INC) is shown in Figure 2. Figure 4 As shown, INC over CS represents the variant corresponding to only CS, and INC over RE represents the variant corresponding to only RE.
[0102] from Figure 3 and Figure 4 It can be seen that the proposed fault detection model achieves the best fault detection performance in all cases. Its performance advantage over other variants is more significant when the available labeled data is extremely limited. As the number of labeled samples increases, the performance improvement gradually decreases. For example, when there are only 5 labeled samples per class, TSSRL achieves an F1 score of 90.58%, which is 35.26% and 22.27% higher than RE and CS, respectively. When there are 50 labeled samples per class, TSSRL achieves an F1 score of 96.97%, and the improvement over RE and CS gradually decreases to 12.51% and 3.98%. A similar improvement trend can be obtained in terms of accuracy indicators. TSSRL achieves the highest improvement of 30.30% and 20.33% when there are 5 labeled data per class, and drops to 11.46% and 3.10% when there are 50 labeled data per class. The comparison results in Figure 4 show that the two collaborative pre-training task lines enable the backbone encoder to capture more features that are beneficial to diagnosis.
[0103] Embodiment 3
[0104] Based on the same concept, the present application also proposes an application method for a fault detection model for a HVAC system. Correspondingly, the present application provides a fault detection method for a HVAC system, comprising the following steps:
[0105] The operation data of the HVAC data is input into the fault detection model for the HVAC system in the second embodiment to obtain the fault category.
[0106] Embodiment 4
[0107] This embodiment also provides an electronic device, referring to Figure 5 , including a memory 404 and a processor 402, wherein the memory 404 stores a computer program, and the processor 402 is configured to run the computer program to execute the steps in any of the above-mentioned embodiments of the method for constructing a fault detection model for a HVAC system and the method for applying the method.
[0108] Specifically, the processor 402 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0109] The memory 404 may include a large-capacity memory 404 for data or instructions. By way of example and not limitation, the memory 404 may be used to store or cache various data files that need to be processed and / or used for communication, as well as possible computer program instructions executed by the processor 402.
[0110] The processor 402 reads and executes the computer program instructions stored in the memory 404 to implement any one of the methods for constructing and applying the fault detection model for the HVAC system in the above embodiments.
[0111] Optionally, the electronic device may further include a transmission device 406 and an input / output device 408 , wherein the transmission device 406 is connected to the processor 402 , and the input / output device 408 is connected to the processor 402 .
[0112] The transmission device 406 may be used to receive or send data via a network. Specific examples of the above network may include a wired or wireless network provided by a communication provider of the electronic device.
[0113] The input / output device 408 is used to input or output information. In this embodiment, the input information may be the operation data of the HVAC system, and the output information may be the predicted fault category.
[0114] Optionally, in this embodiment, the processor 402 may be configured to perform the following steps through a computer program:
[0115] Obtain unlabeled and labeled data of HVAC systems;
[0116] Construct a backbone encoder and build a pre-training framework based on the backbone encoder, wherein the backbone encoder is a Transformer model with a contextual attention module added, wherein the pre-training framework includes a data augmentation unit, a comparative similarity matching pre-training task line, and a data reconstruction pre-training task line, and the comparative similarity matching pre-training task line and the data reconstruction pre-training task line collaboratively share the backbone encoder;
[0117] The unlabeled data is input into the pre-training framework for self-supervised learning until the optimization target is met to obtain a backbone encoder with optimized parameters, wherein the original data of the unlabeled data is input into the data enhancement module for data enhancement to obtain enhanced data, the enhanced data and the original data are input into the contrast similarity matching pre-training task line to calculate the contrast similarity loss, the enhanced data and the original data are input into the data reconstruction pre-training task line to calculate the data reconstruction loss, and the minimum value of the weighted sum of the data reconstruction loss and the contrast similarity loss is taken as the optimization target;
[0118] A fault detection architecture is constructed based on a backbone encoder with optimized parameters, and the labeled data is input into the fault detection architecture for supervised learning until the training conditions are met to obtain a fault detection model for the HVAC system, wherein the fault detection architecture is connected with a multi-layer perceptron on top of the backbone encoder with optimized parameters.
[0119] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0120] In general, various embodiments may be implemented in hardware or dedicated circuits, software, logic, or any combination thereof. Some aspects of the invention may be implemented in hardware, while other aspects may be implemented in firmware or software that may be executed by a controller, microprocessor, or other computing device, but the invention is not limited thereto. Although various aspects of the invention may be shown and described as block diagrams, flow charts, or using some other graphical representation, it should be understood that, as non-limiting examples, the boxes, devices, systems, techniques, or methods described herein may be implemented in hardware, software, firmware, dedicated circuits or logic, general-purpose hardware or controllers or other computing devices, or some combination thereof.
[0121] Embodiments of the present invention can be implemented by computer software, which is executable by a data processor of a mobile device, such as in a processor entity, or implemented by hardware, or implemented by a combination of software and hardware. Computer software or programs (also referred to as program products) including software routines, applets and / or macros can be stored in any device readable data storage medium, and they include program instructions for performing specific tasks. Computer program products can include one or more computer executable components configured to perform embodiments when the program is running. One or more computer executable components can be at least one software code or a part thereof. In addition, at this point, it should be noted that any box of the logic flow in the figure can represent a program step, or interconnected logic circuits, boxes and functions, or a combination of program steps and logic circuits, boxes and functions. Software can be stored in physical media such as memory chips or storage blocks implemented in processors, magnetic media such as hard disks or floppy disks, and optical media such as, for example, DVDs and data variants thereof, CDs. Physical media are non-transient media.
[0122] Those skilled in the art should understand that the technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0123] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for constructing a fault detection model for a HVAC system, characterized in that: The following steps are involved: Obtain unlabeled and labeled data of HVAC systems; Construct a backbone encoder and build a pre-training framework based on the backbone encoder, wherein the backbone encoder is a Transformer model with an added contextual attention module, wherein the pre-training framework includes a data augmentation unit, a comparative similarity matching pre-training task line, and a data reconstruction pre-training task line, and the comparative similarity matching pre-training task line and the data reconstruction pre-training task line collaboratively share the backbone encoder; The unlabeled data is input into the pre-training framework for self-supervised learning until the optimization target is met to obtain a backbone encoder with optimized parameters, wherein the original data of the unlabeled data is input into the data enhancement module for data enhancement to obtain enhanced data, the enhanced data and the original data are input into the contrast similarity matching pre-training task line to calculate the contrast similarity loss, the enhanced data and the original data are input into the data reconstruction pre-training task line to calculate the data reconstruction loss, and the minimum value of the weighted sum of the data reconstruction loss and the contrast similarity loss is taken as the optimization target; A fault detection architecture is constructed based on a backbone encoder with optimized parameters, and the labeled data is input into the fault detection architecture for supervised learning until the training conditions are met to obtain a fault detection model for the HVAC system, wherein the fault detection architecture is connected with a multi-layer perceptron on top of the backbone encoder with optimized parameters.
2. The method for constructing a fault detection model for a HVAC system according to claim 1, characterized in that: The backbone encoder includes multiple layers of encoding layers connected in sequence, each encoding layer includes a self-attention module and a context attention module connected in sequence, wherein the self-attention module is composed of a multi-head self-attention layer, a position-by-position feedforward layer, layer normalization and a residual connection, and the context attention module is composed of a multi-head context attention layer, a position-by-position feedforward layer, layer normalization and a residual connection.
3. The method for constructing a fault detection model for a HVAC system according to claim 2, characterized in that: The original data of multiple samples of unlabeled data input to the backbone encoder are processed by the self-attention mechanism in the self-attention module, and all the features of each sample are embedded and connected in the multi-head context attention layer.
4. The method for constructing a fault detection model for a HVAC system according to claim 1, characterized in that: The data enhancement module uses CutMix to perform data enhancement on the original data of unlabeled data to obtain CutMix version data, and uses Mixup to perform data enhancement on the embedded vector of CutMix version data to obtain enhanced data.
5. The method for constructing a fault detection model for a HVAC system according to claim 4, characterized in that: For each sample in the unlabeled data, the data enhancement formula of the data enhancement module is as follows: ; in is the original data of each sample, and is a random sample in the current unlabeled data, and M represents the same sample A mask matrix of 0 to 1 with the same dimension as , used to specify the noise injection position, represents the dot product, E() represents the embedding vector, express CutMix version, Indicates the sample CutMix version data, To augment the data, the values of M are drawn from a binomial distribution with probability , It is the parameter of mixup.
6. The method for constructing a fault detection model for a HVAC system according to claim 1, characterized in that: The comparative similarity matching pre-training task line includes an original coding mapping branch, an enhanced coding mapping branch and a comparison space, wherein the original coding mapping branch and the enhanced mapping branch have the same structure, both containing backbone encoders and mapping modules with the same parameters, the original coding mapping branch is used to input the original data of each sample of unlabeled data, and the enhanced mapping branch is used to input the enhanced data corresponding to the current sample, the original data of each sample of the unlabeled data is input into the backbone encoder of the original coding mapping branch to extract the original coding features, and the original coding features are mapped to the comparison space through the mapping module; the enhanced data corresponding to the current sample is input into the enhanced coding mapping branch to extract the mapped coding features, and the mapped coding features are mapped to the comparison space through the mapping module, and the comparative similarity loss of the positive sample pair and the negative sample pair of the current sample is calculated in the comparison space.
7. The method for constructing a fault detection model for a HVAC system according to claim 6, characterized in that: The positive sample pair is a data pair consisting of the enhanced data obtained by enhancing the original data of the current sample through the data enhancement module and the original data of the current sample, and the negative sample pair is a data pair consisting of the enhanced data obtained by enhancing the original data of other samples through the data enhancement module and the original data of the current sample.
8. The method for constructing a fault detection model for a HVAC system according to claim 6, characterized in that: The data reconstruction pre-training task line shares the backbone encoder of the enhanced mapping branch of the contrast similarity matching pre-training task line, and a decoder is connected after the backbone encoder of the enhanced mapping branch. The enhanced data of each sample of the unlabeled data is input into the enhanced coding mapping branch to extract the mapping coding features, and the original data of each sample and the corresponding mapping coding features are input into the decoder to calculate the data reconstruction loss.
9. The method for constructing a fault detection model for a HVAC system according to claim 1, characterized in that: The labeled data and unlabeled data of the HVAC system are operating data in tabular form. The labeled data of the HVAC system are operating data labeled with the fault categories of the HVAC system. The loss function of the fault detection architecture is the cross entropy loss.
10. A fault detection method for a HVAC system, characterized in that: The following steps are involved: The operating data of the HVAC data is input into a fault detection model for the HVAC system to obtain a fault category, wherein the fault detection model for the HVAC system is constructed according to the method for constructing a fault detection model for the HVAC system according to any one of claims 1 to 9.
Citation Information
Patent Citations
Generalized image classification method and device based on comparative learning and invariant causality
CN116994026A
Method for detecting unknown fault of rolling bearing guided by coupling of global and local features
CN117786507A