Two-stage air conditioning system fault diagnosis method and system based on improved deep residual network

By improving the two-stage fault diagnosis method that combines deep residual networks with long-tail learning and attention mechanisms, the problem of fault diagnosis in HVAC systems under high imbalance data is solved, and high-accuracy fault detection and location are achieved.

CN121144930BActive Publication Date: 2026-06-26UNIV OF SCI & TECH BEIJING

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
UNIV OF SCI & TECH BEIJING
Filing Date
2025-08-26
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing fault diagnosis methods for HVAC systems struggle to effectively learn minority fault characteristics in highly unbalanced and complex data scenarios, resulting in low diagnostic accuracy. Traditional deep learning models also lack effective processing capabilities.

Method used

An improved deep residual network is adopted, which combines long-tail learning and attention mechanism. By constructing a one-dimensional deep residual neural network, the data is processed in stages: the first stage distinguishes between normal and abnormal classes, and the second stage distinguishes between specific fault classes. The attention mechanism and long-tail learning module are used to improve the sensitivity and diagnostic accuracy of minority fault features.

Benefits of technology

In scenarios with extremely unbalanced data, it enables rapid detection and accurate location of faults in HVAC systems, with a fault diagnosis accuracy rate exceeding 97%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121144930B_ABST
    Figure CN121144930B_ABST
Patent Text Reader

Abstract

The application discloses a two-stage air conditioner system fault diagnosis method and system based on an improved deep residual network, and relates to the technical field of air conditioners. The method is as follows: collecting historical operation data of heating, ventilation and air conditioning system equipment and components, obtaining normal class samples and fault class samples; after pre-processing the samples, setting labels for each sample according to the categories, obtaining normal class samples and multi-class fault samples; constructing a deep residual network model integrating long-tail learning and an attention mechanism, inputting the normal class samples and the multi-class fault samples for training, outputting the prediction value of the data category label and determining the predicted fault type, thereby obtaining a trained heating, ventilation and air conditioning system fault diagnosis model; obtaining actual operation data and inputting the actual operation data into the trained heating, ventilation and air conditioning system fault diagnosis model for two-stage fault diagnosis, thereby outputting the fault type. The application realizes rapid detection and accurate positioning of heating, ventilation and air conditioning system faults in a high imbalance data scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of air conditioning technology, specifically to a two-stage air conditioning system fault diagnosis method and system based on an improved deep residual network. Background Technology

[0002] Heating, ventilation, and air conditioning systems are used to control the thermal and humidity environment and air quality inside a building. As a major energy-consuming system in a building, it is prone to various malfunctions during long-term operation due to factors such as human control and operating environment, which increases maintenance costs and wastes energy.

[0003] In recent years, with the development of artificial intelligence technology, various data-driven fault diagnosis methods have been applied to the field of HVAC systems, such as principal component analysis, decision trees, and support vector machines based on machine learning, and long short-term memory neural networks, convolutional neural networks, and recurrent neural networks based on deep learning. These data-driven diagnostic methods mainly rely on sufficient and balanced training samples. However, HVAC systems are usually in normal operation and it is difficult to conduct fault experiments, making it difficult to obtain fault data. The amount of fault data is far less than that of normal data, resulting in data imbalance. Most existing HVAC system fault diagnosis methods expand the number of fault samples through data generation. However, these methods are mainly for small sample experimental data, with a small amount of basic data, low data complexity, and low imbalance rate. In such scenarios, the data generation model can often easily learn the data distribution and improve diagnostic performance. However, for real-world systems with large data scales, complex distributions, and extremely high imbalance rates, the quality and applicability of the generated data face challenges.

[0004] If data generation is not relied upon, the model's architecture itself needs to be able to learn the characteristics of a minority of fault classes and maintain a high fault diagnosis accuracy when faced with highly complex and imbalanced data. Traditional machine learning architectures are simple and have limited ability to learn fault features. Deep learning can learn and fuse feature information layer by layer, significantly improving diagnostic performance. However, existing deep learning methods applied to HVAC systems are mostly shallow model combinations, lacking deep models that can independently and effectively handle highly imbalanced and complex data. Summary of the Invention

[0005] To address the aforementioned technical challenges, this invention proposes a two-stage fault diagnosis method and system for air conditioning systems based on an improved deep residual network. The method integrates long-tail learning and attention-based deep residual neural networks to perform two-stage classification of imbalanced data: the first stage distinguishes between normal and abnormal data, while the second stage distinguishes specific faults within the abnormal data. This multi-pronged approach, combining and mutually reinforcing these methods, enables rapid detection and accurate localization of faults in HVAC systems under highly imbalanced data scenarios.

[0006] According to a first aspect of the present invention, a two-stage air conditioning system fault diagnosis method based on an improved deep residual network is provided. The method is used for fault diagnosis of HVAC systems under high data imbalance scenarios, and includes the following steps:

[0007] S1, Data Acquisition Steps: Collect historical operating data of HVAC system equipment and components, and obtain normal and fault samples;

[0008] S2, Data processing steps: Label each normal sample and fault sample according to its category to obtain labeled normal samples and multiple fault samples;

[0009] S3, Model building steps: Construct a deep residual network model that integrates long-tail learning and attention mechanism as a fault diagnosis model for HVAC system. Input the normal class samples and multiple fault samples for training, output the predicted value of data category label and determine the predicted fault type, thereby obtaining the trained HVAC system fault diagnosis model.

[0010] S4, Actual output steps: Obtain actual operating data and input it into the trained HVAC system fault diagnosis model for two-stage fault diagnosis, thereby outputting the fault type.

[0011] Further, in step S1, the imbalance ratio between the normal sample and the faulty sample is 1:1, 3:1, 5:1, 10:1, 20:1, 40:1, 100:1, or 200:1. Further, in the high imbalance data scenario, the imbalance ratio between the normal sample and the faulty sample is above 40:1. Preferably, in the high imbalance data scenario, the imbalance ratio between the normal sample and the faulty sample is 40:1, 100:1, or 200:1. More preferably, in the high imbalance data scenario, the imbalance ratio between the normal and faulty samples is 200:1.

[0012] Furthermore, in S2, each of the multiple types of fault samples contains multiple severity levels of fault states.

[0013] Furthermore, in step S2, before the labeling operation is performed on the normal samples and the fault samples, preprocessing operations are required, including: data cleaning, steady-state screening, data partitioning, and normalization.

[0014] Furthermore, S3 specifically includes:

[0015] S31: The fault diagnosis model of the HVAC system extracts shallow features by performing one-dimensional convolution operation through the initial convolutional layer, and performs preliminary downsampling through the max pooling layer to retain significant features;

[0016] Furthermore, the kernel size of the initial convolutional layer is 1×7.

[0017] Furthermore, in S31, the one-dimensional convolution operation is specifically as follows:

[0018]

[0019] in, This represents the value in the j-th column of the output feature map of the h-th convolutional kernel in the l-th convolutional layer; This represents the weight value of the nth column in the kth channel of the h-th convolutional kernel (corresponding to the output feature map) in the l-th layer; This represents the value of the m-th column in the k-th channel of the (l-1)-th convolutional layer, where m = (j-1)*t + np, t is the stride, p is the padding number, and * represents the convolution operation; b l,h δ represents the bias of the h-th convolutional kernel in the l-th layer; N is the size of the convolutional kernel; K is the number of output channels of the (l-1)-th convolutional layer; and δ is the activation function, usually the ReLU function.

[0020] Furthermore, in S31, the max pooling uses the maximum value of each pooling window in the previous layer. One-dimensional max pooling can be specifically represented as follows:

[0021]

[0022] Average pooling uses the average value of each pooling window in the previous layer. One-dimensional average pooling is represented as follows:

[0023]

[0024] in, This represents the pooling value in the j-th column of the k-th channel of the l-th pooling layer; This represents the value of the m-th column in the k-th channel of the (l-1)-th layer, where m = (j-1)*t + n, t is the sliding step size, n is the column position index of the pooling window, and G represents the width of the pooling window.

[0025] S32: Input the salient features into the residual layer and recalibrate the salient features through the attention mechanism to strengthen the feature patterns of the multiple fault samples as minority class samples, so that the model can capture the key feature information of the normal class samples and the multiple fault samples at the same time.

[0026] Here, in S32, the attention mechanism follows the residual layer. The residual layer's role is to extract data features, and the attention mechanism recalibrates these features. This method not only targets minority classes but actually processes data from all classes uniformly, its core being to improve feature extraction capabilities. However, the model's goal is to minimize the overall classification loss (classifying as correctly as possible). Therefore, the attention mechanism helps the model adjust the weights of "important features for accurate classification." From this perspective, since the number of fault classes is relatively small, these features might be masked by the large number of normal class features, while the attention mechanism can focus on these salient features that can distinguish fault modes.

[0027] Furthermore, in S32, the residual layer is constructed by 8 basic residual blocks, each residual block contains two convolutional layers, and each convolutional layer uses a 1×3 size convolutional kernel.

[0028] Furthermore, in S32, the residual block consists of a convolutional layer, batch normalization, ReLU activation function, and skip connections;

[0029] The residual block is defined as follows:

[0030] y=F(x,{W i})+x (4)

[0031] Where x represents the input, F(x,{W i}) represents the residual mapping learned by the model, W i Let F represent the weights of the i-th convolutional layer. The residual mapping function, F = W2δ(W1x), is obtained by learning through two convolutional layers of the residual block.

[0032] Furthermore, in S32, the attention mechanism includes an SE channel attention mechanism and a spatial attention mechanism based on the CBAM architecture:

[0033] The SE channel attention mechanism and the spatial attention mechanism based on the CBAM architecture are sequentially connected after the residual layer and before the global pooling layer.

[0034] Furthermore, the SE channel attention mechanism comprises two main operations: compression and activation.

[0035] The compression operation uses global average pooling to compress the global information of each channel of the input feature map into a single descriptive value, so as to facilitate the subsequent learning of the dependencies between channels, as shown below:

[0036]

[0037] Among them, z k It is the channel value output after k-channel global pooling. is the value of the j-th column of the k-channel of the input feature map, where J is the spatial length of the k-channel;

[0038] The activation operation learns the correlation between different channels through two fully connected layers, and uses the sigmoid function to limit the output value to the range [0,1], representing the importance of each channel, i.e., the weight assigned to each channel, as follows:

[0039] r=σ(w2(δ(w1z+b1))+b2) (6)

[0040] Where r is the output weight vector, z is the input channel vector, w1 and w2 are the weight matrices of the first and second fully connected layers, b1 and b2 are the biases, δ is the ReLU activation function, and σ is the sigmoid function.

[0041] Finally, the weight vector is multiplied channel by channel with the original input feature map to perform feature recalibration, thereby enhancing important channel features.

[0042] Furthermore, the CBAM architecture includes two modules: a channel attention mechanism and a spatial attention mechanism.

[0043] Here, the SE attention mechanism has been used to implement the channel attention function in this scheme; considering that the CBAM architecture includes both channel and spatial attention modules, in order to avoid parameter redundancy and improve computational efficiency, only its spatial attention module is introduced.

[0044] The spatial attention module simultaneously employs channel average pooling and channel max pooling to compress the corresponding positions of each channel in the input feature map into a single descriptive value, so as to facilitate subsequent learning of spatial dimension dependencies.

[0045] The two output vectors are concatenated along the channel dimension, the correlation between spatial dimensions is learned through a one-dimensional convolutional layer, and the output value is limited to the range [0,1] by the sigmoid function, which represents the importance of each spatial location, i.e., the spatial weight.

[0046] Finally, feature recalibration is performed to enhance spatial discriminative features.

[0047] S33: Perform global average pooling, and then use a fully connected layer to map the key feature information of the learned normal class samples and multiple fault samples to the classification space. Adjust the classification weights through long-tail learning to compensate for the small number of fault samples in the minority class due to the small number of samples, so that the classification decision boundary moves towards the normal class and reduces the false alarms.

[0048] Furthermore, in S33, the fully connected layer is a multi-output perceptron network, where each neuron establishes a full connection with all outputs of the previous layer (usually the outputs of convolutional or pooling layers after flattening). Classification decisions are achieved by learning the global correlations between features, specifically expressed as follows:

[0049]

[0050] in, This represents the value of the a-th neuron in the l-th fully connected layer. This represents the value of the d-th neuron in the (l-1)-th fully connected layer. This represents the weight between the d-th and a-th neurons in the (l-1)-th and l-th fully connected layers; δ represents the bias of the a-th neuron in layer l; D is the number of neurons in the (l-1)-th fully connected layer; and δ is the activation function.

[0051] S34: Use the SoftMax function to convert the output of the fully connected layer into a probability distribution of fault categories, and determine the category with the highest probability as the predicted fault category, as shown in the following formula:

[0052]

[0053] Among them, v c Represents the raw score of the last fully connected layer; c is the fault category label; It is the fraction v c Perform exponential operations.

[0054] Furthermore, in S33, the long-tail learning employs learnable weight scaling (LWS).

[0055] Furthermore, the LWS is located after the fully connected layer and before the SoftMax function.

[0056] Furthermore, the LWS explicitly adjusts the classifier weights by introducing a learnable scaling factor, specifically expressed as follows:

[0057]

[0058] in, It is the score after scaling adjustment for the c-th category, sc It is the learnable scaling factor for the c-th category. is the weight vector of the c-th category, and f is the feature vector extracted by the network.

[0059] Furthermore, the final predicted fault type is represented as follows:

[0060]

[0061] Furthermore, in step S4, a preprocessing operation is required before the actual running data is input into the model. This preprocessing operation is the same as the preprocessing operation in step S2.

[0062] Furthermore, in the preprocessing operation:

[0063] The data cleaning is used to remove abnormal and invalid samples from the data;

[0064] The steady-state filtering is used to remove non-steady-state data from the dataset;

[0065] The data partitioning involves dividing the dataset into training, validation, and test sets according to different proportions.

[0066] The normalization is used to reduce the impact of different dimensions and orders of magnitude on model diagnosis.

[0067] Furthermore, the normalization is Z-score normalization, as shown in the following formula:

[0068]

[0069] In the formula, z i,g It is the result of normalizing the i-th data of the g-th feature in the training set, x i,g It is the i-th data of the g-th feature, μ g It is the mean of the g-th feature, σ g It is the variance of the g-th feature.

[0070] Furthermore, in S4, the two-stage fault diagnosis specifically includes:

[0071] The diagnostic model in the first stage is a binary classification model. The input is all actual operating data, and the output after training is normal class samples and fault class samples.

[0072] The second-stage diagnostic model is a multi-classification model. The input is the fault class samples output by the first-stage model, and the specific fault category is output by the trained HVAC system fault diagnosis model.

[0073] Furthermore, when the imbalance ratio between the normal and faulty samples is 200:1, the fault diagnosis accuracy of the method exceeds 97%.

[0074] Furthermore, when the imbalance ratio of the normal and faulty samples is 40:1, the fault diagnosis accuracy of the method exceeds 99%.

[0075] According to a second aspect of the present invention, a two-stage air conditioning system fault diagnosis system based on an improved deep residual network is provided, the system operating according to the method described in any of the above aspects, wherein the system includes:

[0076] The data acquisition unit is used to collect historical operating data of HVAC system equipment and components, and to acquire normal and fault samples.

[0077] The data processing unit is used to assign labels to each sample according to its category, including the normal samples and the fault samples, to obtain normal samples and multiple fault samples.

[0078] The model building unit is used to build a deep residual network model that integrates long-tail learning and attention mechanisms as a fault diagnosis model for HVAC systems. It is trained by inputting the normal class samples and multiple fault samples, outputting the predicted value of the data category label and determining the predicted fault type, thereby obtaining the trained HVAC system fault diagnosis model.

[0079] The actual output unit is used to acquire actual operating data and input it into the trained HVAC system fault diagnosis model for two-stage fault diagnosis, thereby outputting the fault type.

[0080] In summary, the beneficial technical effects of the present invention are as follows:

[0081] 1) The one-dimensional deep residual neural network model proposed in this invention, which integrates long-tail learning and attention, prioritizes building a deep network through residual block structures to learn deeper, more complex, and more discriminative features from samples, thereby uncovering subtle feature information of minority class faults. The attention mechanism is used to recalibrate the channel and spatial dimensions of the feature map, thus refining and amplifying the massive features extracted by the residual layer, significantly enhancing the model's sensitivity and representation ability for key features of minority class faults. The long-tail learning module uses scaling vectors to weight the original classifier, amplifying the influence of fault class weights, causing the decision boundary to shift towards the normal class, reducing the fault false negative rate. The residual layer provides the basic feature extraction framework, the attention machine acts as a feature optimizer to strengthen feature responses highly correlated with faults and suppress irrelevant information, and long-tail learning acts as the final decision optimizer, systematically correcting the decision boundary to ensure the ability to identify minority class faults.

[0082] 2) The two-stage fault diagnosis method proposed in this invention effectively solves the problem of unbalanced training data in fault diagnosis of HVAC systems from another perspective. It achieves accurate differentiation of fault categories through staged fault diagnosis and can still maintain a high accuracy rate in extreme unbalanced data scenarios. Attached Figure Description

[0083] Figure 1 A flowchart of a two-stage HVAC fault diagnosis method based on a fusion of long-tail learning and attention deep residual network according to the present invention is shown.

[0084] Figure 2 This diagram illustrates the design of a deep residual neural network residual block according to the technical solution of the present invention.

[0085] Figure 3 A schematic diagram showing the imbalance training diagnosis result of a single deep residual neural network according to the technical solution of the present invention is provided.

[0086] Figure 4 This diagram illustrates the two-stage training and diagnostic results of an integrated long-tail learning and attention-based deep residual neural network according to the present invention. Detailed Implementation

[0087] The technical solutions of the embodiments of this application will be clearly and thoroughly described below with reference to the accompanying drawings. The described embodiments are merely some embodiments of this application.

[0088] This invention proposes a two-stage air conditioning system fault diagnosis method and system based on an improved deep residual network. The method performs two-stage HVAC fault diagnosis by integrating a long-tail learning-based attention deep residual network. The method constructs a one-dimensional deep residual neural network and introduces an attention mechanism and a long-tail learning module to perform two-stage classification of imbalanced data: the first stage distinguishes between normal and abnormal data, and the second stage distinguishes specific faults in the abnormal data, thereby achieving rapid detection and accurate location of HVAC system faults in high imbalanced data scenarios.

[0089] Specifically, the technical solution of the present invention provides a two-stage air conditioning system fault diagnosis method and system based on an improved deep residual network, which includes the following steps:

[0090] (1) Collect historical operating data of HVAC system equipment and components, and obtain normal and fault samples.

[0091] (2) The normal and faulty samples are preprocessed sequentially, including data cleaning, steady-state screening, data partitioning, and normalization, and each sample is labeled according to its category. Among them, data cleaning is used to remove abnormal and invalid samples from the data; steady-state screening is used to remove non-steady-state data from the dataset; data partitioning is to divide the dataset into training set, validation set and test set according to different proportions; normalization is used to reduce the impact of different units and orders of magnitude on the model diagnosis.

[0092] (3) A deep residual neural network model integrating long-tail learning and attention is constructed as a fault diagnosis model for HVAC systems. During model training, normal class samples and multiple fault samples after processing historical HVAC operation data are input, and the output is the predicted value of the data category label. During model diagnosis, samples after processing actual HVAC operation data are input, and the specific fault type is output.

[0093] ①The model first extracts shallow features through an initial convolutional layer and then performs preliminary downsampling through a max pooling layer to retain salient features.

[0094] Unlike two-dimensional images, HVAC system data is typically one-dimensional time-series data, with each time point containing multiple sensor data (feature parameters). Therefore, the convolution operation uses one-dimensional convolution, specifically represented as follows:

[0095]

[0096] in, This represents the value in the j-th column of the output feature map of the h-th convolutional kernel in the l-th convolutional layer; This represents the weight value of the nth column in the kth channel of the h-th convolutional kernel in layer l; This represents the value of the m-th column in the k-th channel of the (l-1)-th convolutional layer, where m = (j-1)*t + np, t is the stride, p is the padding number, and * represents the convolution operation; b l,h δ represents the bias of the h-th convolutional kernel in the l-th layer; N is the size of the convolutional kernel; K is the number of output channels of the (l-1)-th convolutional layer; and δ is the activation function, usually the ReLU function.

[0097] The initial convolutional layer uses a large kernel and a sliding stride to quickly reduce the sequence length and extract preliminary local features. This allows for the capture of short-term coupling relationships between multiple feature parameters, such as the coordinated changes between temperature and pressure at a given moment, thus providing an initial indication of abnormal fluctuations in fault conditions.

[0098] Max pooling uses the maximum value of each pooling window in the previous layer. The pooling operation also uses one-dimensional pooling, which can be represented as follows:

[0099]

[0100] Average pooling uses the average value of each pooling window in the previous layer. One-dimensional average pooling can be represented as follows:

[0101]

[0102] in, This represents the pooling value in the j-th column of the k-th channel of the l-th pooling layer; This represents the value of the m-th column in the k-th channel of the (l-1)-th layer, where m = (j-1)*t + n, t is the sliding step size, n is the position index of the pooling window, and G represents the width of the pooling window.

[0103] Pooling layers, lacking weights and biases for learning, reduce the resolution of feature maps through downsampling operations, further compressing sequence lengths and retaining the most salient features. This highlights parameters with large amplitude variations in abnormal fluctuations, which are highly correlated with faults.

[0104] ② The model deepens the network through residual layers to improve feature extraction capabilities and enhances sensitivity to minority class features by using attention mechanisms.

[0105] The residual block consists of convolutional layers, batch normalization, activation functions, and skip connections. The output of the residual block is defined as follows:

[0106] y=F(x,{W i})+x (4)

[0107] Where x represents the input, F(x,{W i}) represents the residual mapping learned by the model. W i Let F represent the weights of the i-th convolutional layer. The residual mapping function, obtained through two convolutional layers of the residual block, is F = W2δ(W1x).

[0108] The learning objective of residual networks is no longer the original mapping, but to directly learn its residual function. The residual block structure makes it easier for the network to learn the identity mapping, ensuring that the model performance does not degrade with the increase of layers, thereby building a deep model and enabling the network to extract features at a deeper level. This allows the network to capture parameters closely related to the fault, integrate channel dimension and spatial dimension information, identify global fault modes, and analyze the fault state from the perspective of the system.

[0109] Based on the deep model, an SE channel attention mechanism and a spatial attention mechanism based on the CBAM architecture are further introduced and connected after the residual layer of the one-dimensional deep residual neural network to improve the model's ability to perceive key information and suppress the influence of redundant or unimportant information.

[0110] The SE channel attention mechanism comprises two main operations: compression and activation. The compression operation uses global average pooling to compress the global information of each channel of the input feature map into a single descriptive value, facilitating subsequent learning of channel dependencies. This can be represented as follows:

[0111]

[0112] Among them, z k It is the channel value output after k-channel global pooling. It is the value of the j-th column of the k-channel of the input feature map, where J is the spatial length of the k-channel.

[0113] The "incentive" operation learns the correlation between different channels through two fully connected layers, and uses the sigmoid function to limit the output value to the range [0,1], representing the importance of each channel, i.e., the weight assigned to each channel, as follows:

[0114] r=σ(w2(δ(w1z+b1))+b2) (6)

[0115] Where r is the output weight vector, z is the input channel vector, w1 and w2 are the weight matrices of the first and second fully connected layers, b1 and b2 are the biases, δ is the ReLU activation function, and σ is the sigmoid function.

[0116] Finally, the weight vector is multiplied channel by channel with the original input feature map to perform feature recalibration, thereby enhancing important channel features.

[0117] ②The CBAM architecture comprises two modules: channel attention and spatial attention. This scheme already employs the SE attention mechanism to implement channel attention; considering that the CBAM architecture includes both channel and spatial attention modules, to avoid parameter redundancy and reduce computation, only the spatial attention module is introduced. The spatial attention module uses both channel average pooling and channel max pooling to compress the corresponding positions of each channel in the input feature map into single descriptive values, facilitating subsequent learning of spatial dimensional dependencies. Then, the two output vectors are concatenated along the channel dimensions, and a one-dimensional convolutional layer is used to learn the correlation between spatial dimensions. The sigmoid function is used to constrain the output values ​​to the range [0,1], representing the importance of each spatial location, i.e., the spatial weight. Finally, feature recalibration is performed to enhance important spatial features.

[0118] The deep residual neural network described above utilizes a residual block structure to make deep networks easier to train. Compared to shallow networks, deep networks perform more nonlinear transformations and feature combinations, thereby learning deeper, more complex, and more discriminative features from the samples. Compared to traditional convolutional networks, the residual block structure itself has a greater advantage in learning minority class fault patterns: the introduction of skip connections makes information transfer between upper and lower layers smoother during forward and backward propagation. Even if minority class fault samples provide only a small amount of information, this information can still be passed to deeper layers of the network through the residual block structure to update weight parameters. Furthermore, an attention mechanism is introduced to recalibrate channel dimension weights and spatial dimension weights, and to adaptively select and refine high-level features extracted from the residual layer. This allows the model to focus more on the specific feature values ​​that best indicate the fault, making the deep model more sensitive to fault states. This helps the model discover and learn key feature information of minority class fault samples in a large number of normal class samples, effectively reducing the bias of deep models in highly imbalanced data scenarios and further improving the model's fault diagnosis accuracy.

[0119] ③ Then, global average pooling is used to reduce model complexity and improve model generalization ability. A fully connected layer is then used to map the learned high-level features to the classification space. In addition, the classification weights are adjusted using a long-tail learning module.

[0120] A fully connected layer is a type of multi-output perceptron network where each neuron is fully connected to all outputs of the previous layer (usually the outputs of convolutional or pooling layers after flattening). It achieves classification decisions by learning global correlations between features, and can be specifically represented as follows:

[0121]

[0122] in, This represents the value of the a-th neuron in the l-th fully connected layer. This represents the value of the c-th neuron in the (l-1)-th fully connected layer. This represents the weight between the c-th and a-th neurons in the (l-1)-th and l-th fully connected layers; δ represents the bias of the a-th neuron in layer l; D is the number of neurons in the (l-1)-th fully connected layer; and δ is the activation function.

[0123] Based on the attention mechanism deep residual network, a long-tail learning module (LWS) is introduced. LWS explicitly adjusts the classifier weights by introducing a learnable scaling vector, as shown in the following equation:

[0124]

[0125] in, It is the score after scaling adjustment for the c-th category, s c It is the learnable scaling factor for the c-th category. is the weight vector of the c-th category, and f is the feature vector extracted by the network.

[0126] The LWS long-tail learning module effectively addresses the "classification bias" problem in deep networks trained on highly imbalanced data (long-tail data). Because the tail category has fewer samples, the model's learning of these categories is insufficient, leading to a bias in classification weights towards the head category. LWS uses a learned scaling vector to weight the original classifier, reducing the influence of normal class weights and amplifying the influence of fault class weights, thus shifting the decision boundary towards the normal class and reducing the false negative rate. Specifically, in highly imbalanced data scenarios, the model will accept misclassifying normal classes as fault classes to a certain extent, but more strictly rejects false negatives, thereby improving the fault class recognition rate. After the attention mechanism significantly enhances the weights of key feature channels and spatial locations in minority class fault samples, this scaling factor further improves the model's decision-making performance. The attention mechanism and long-tail learning form a positive feedback loop. The long-tail learning module increases the requirement for correct classification of the minority class at the classification layer and feeds this back to the attention mechanism module, which then dynamically adjusts the key feature weights using this feedback, thereby improving the classification decision-making performance of the long-tail learning module.

[0127] ④ Finally, the SoftMax function is used to convert the output of the fully connected layer into a probability distribution of fault categories, and the category with the highest probability is determined as the fault category, which can be expressed as follows:

[0128]

[0129] Among them, v c represents the original score of the last fully connected layer; c is the fault category label.

[0130] After adjusting the classification weights through long-tail learning, the final predicted category representation transformed by the Softmax function is as follows:

[0131]

[0132] (4) Using the deep residual network framework described in (3), two-stage fault diagnosis models are established to realize two-stage fault diagnosis of HVAC systems.

[0133] ① The diagnostic model in the first stage is a binary classification model. The input is all training samples, and the output is only the normal class and the abnormal class (fault class). The model in this stage mainly learns the feature differences between the normal class and the abnormal class. By capturing the common features of various fault samples that deviate from the normal, it can perceive abnormal states and distinguish between normal and any fault mode.

[0134] ② The second-stage diagnostic model is a multi-classification model. The input is the samples that the first-stage model classifies as "faults," and the output is the specific fault category. This stage model mainly learns the feature differences between fault classes, and achieves the distinction between fault categories by capturing the internal differences of various fault samples.

[0135] Example

[0136] A two-stage HVAC fault diagnosis method based on a fusion of long-tail learning and attention-based deep residual networks is proposed. By constructing a one-dimensional deep residual neural network and introducing an attention mechanism, the method performs two-stage classification of imbalanced data: the first stage distinguishes between normal and abnormal data, and the second stage distinguishes specific faults in the abnormal data, thereby enabling rapid detection and accurate location of HVAC system faults in high-imbalanced data scenarios.

[0137] like Figure 1 As shown, the specific steps include:

[0138] A two-stage fault diagnosis method for HVAC systems, integrating one-dimensional long-tail learning and attention-based deep residual neural networks, is as follows:

[0139] (1) Data sets of HVAC system operation were collected, utilizing fault test data of HVAC system chiller units from Research Project 1043 of the American Society of Heating, Refrigerating and Air-Conditioning Engineers (ASHRAE). The fault test was conducted on a centrifugal chiller unit with a cooling capacity of 90 tons. Through human intervention, normal operation and 7 typical faults were simulated. Each fault included 4 severity levels, totaling 28 fault operation states, as detailed in Table 1. Each set of experimental data included 64 typical characteristic parameters of HVAC systems, such as evaporator inlet water temperature (TEI), outlet water temperature (TEO), evaporation temperature (TRE), condenser inlet water temperature (TCI), outlet water temperature (TCO), condensation temperature (TRC), oil supply temperature (TO_feed), oil supply pressure (PO_feed), compressor power (kW), coefficient of performance (COP), and refrigerant subcooling (TRC_sub).

[0140] Table 1. Description of HVAC Experimental Faults

[0141]

[0142] (2) Normal and faulty samples were preprocessed sequentially, including data cleaning, steady-state screening, data partitioning, and normalization, and each sample was labeled according to its category. Data cleaning was used to remove abnormal and invalid samples. Steady-state screening was performed by calculating the geometrically weighted mean and variance of three parameters: evaporator inlet water temperature (TWEI), evaporator outlet water temperature (TWEO), and condenser inlet water temperature (TWCI). During data partitioning, the steady-state-screened data was divided into multiple imbalanced datasets at different ratios, with the imbalance ratio of the training set ranging from 1:1 to 200:1, simulating the gradual imbalance process, as shown in Table 2. The validation and test sets for each partition ratio maintained a balance between the number of normal data and single-class fault data. Z-score normalization was used to normalize each dataset.

[0143] Table 2. Division of Imbalanced Training Samples in HVAC Experiments

[0144]

[0145] (3) Construct a deep residual neural network model as a fault diagnosis model for HVAC systems. Use the normal class samples and multiple fault samples after data preprocessing as the model input, and output the predicted value of the data category label.

[0146] ① The model first extracts shallow features through an initial convolutional layer and then performs preliminary downsampling through a max pooling layer to retain salient features. The kernel size of the initial convolutional layer is 1×7.

[0147] ② Subsequently, residual blocks are used to deepen the network and improve feature extraction capabilities. The residual layer is constructed from 8 basic residual blocks, each containing two convolutional layers, each using a 1×3 kernel. The SE channel attention mechanism and a spatial attention mechanism based on the CBAM architecture are used to recalibrate the channel and spatial dimension weights, improving the model's ability to perceive key information and suppressing the influence of redundant or unimportant information.

[0148] ③ Global average pooling is used to reduce model complexity and improve model generalization ability. Then, a fully connected layer is used to map the learned high-level features to the classification space. The LWS long-tail learning module is used to weight the original classifier, reducing the influence of the normal class weights and amplifying the influence of the fault class weights, so that the decision boundary shifts towards the normal class and reduces the fault false detection rate.

[0149] ④ Finally, the SoftMax function is used to convert the output of the fully connected layer into a probability distribution of fault categories, and the category with the highest probability is determined as the fault category.

[0150] (4) Using the deep residual network framework described in (3), two-stage fault diagnosis models are established to realize two-stage fault diagnosis of HVAC systems.

[0151] The Z-score normalization formula mentioned in (2) is as follows:

[0152]

[0153] In the formula, z i,g It is the result of normalizing the i-th data of the g-th feature in the training set, x i,g It is the i-th data of the g-th feature, μ g It is the mean of the g-th feature, σ g It is the variance of the g-th feature.

[0154] The activation functions used in the convolutional layers are all ReLU functions.

[0155] The preprocessed data includes normal data and seven types of fault data. Each fault type contains four severity levels, totaling 28 fault states. The data is highly complex and can fully simulate the actual system operation. During training, the model learns the feature information of the normal operation state and the 28 fault operation states, and accurately distinguishes the specific data categories during the diagnostic process.

[0156] Among them, the residual block mentioned in (3) consists of a convolutional layer, batch normalization, ReLU activation function and skip connections, and the specific structure is as follows: Figure 2 As shown.

[0157] Among them, the two-stage fault diagnosis method described in (4) first uses a binary classification model to distinguish between normal and abnormal classes, and then uses a multi-classification model to classify the samples that were determined to be "faulty" in the first stage model into specific fault categories. All models use the one-dimensional deep residual neural network described in (3).

[0158] In this embodiment, the two-stage fault diagnosis process of a one-dimensional deep residual neural network that integrates long-tail learning and attention is as follows:

[0159] The experimental data from the HVAC system underwent four preprocessing steps: data cleaning, steady-state data screening, data partitioning, and data normalization. The processed data was then input into a one-dimensional deep residual neural network integrating long-tail learning and attention mechanisms. Key features were extracted in the residual layer, the core component of the deep residual neural network. The attention mechanism enhanced the model's ability to perceive key information of minority class fault samples. The fully connected layer then learned the global correlation between features, and the long-tail learning module adjusted the classification decision boundary to further enhance the classification ability for minority class faults. Finally, the SoftMax function was used to convert the data into fault category probabilities for classification. The classification process consisted of two stages: the first stage used a binary classification model constructed with the residual network to distinguish between normal and abnormal samples; the second stage used a multi-class classification model constructed with the residual network to distinguish the specific category of the fault sample. Thus, the one-dimensional deep residual neural network integrating long-tail learning and attention completed the feature learning process for HVAC system faults in a highly imbalanced data scenario and constructed a two-stage HVAC system fault diagnosis model. After new HVAC system experimental data is input and preprocessed, the constructed two-stage HVAC system fault diagnosis model will directly learn the feature information of the input data and classify the new data for faults, thereby realizing system fault diagnosis.

[0160] The results show that when the imbalance ratio of the training samples is as high as 200:1, the fault diagnosis accuracy of the single deep residual neural network model exceeds 90%; when the imbalance ratio is 100:1, the proposed one-dimensional deep residual neural network model achieves a fault diagnosis accuracy exceeding 95%; and when the imbalance ratio is 40:1, the diagnosis accuracy exceeds 98%. The confusion matrix results are as follows: Figure 3 As shown.

[0161] The proposed one-dimensional residual neural network model (Resnet-Att-Lt) integrating long-tail learning and attention is compared with a single deep residual neural network (Resnet) and some common models, as shown in Table 4. The results show that under various imbalanced data scenarios, the fault diagnosis model based on the one-dimensional residual neural network has a significant advantage in diagnostic accuracy, outperforming other models. Furthermore, the proposed one-dimensional residual neural network model integrating long-tail learning and attention significantly outperforms the single deep residual neural network model in highly imbalanced data scenarios.

[0162] Table 4. Comparison of diagnostic results between deep residual neural networks and other models.

[0163]

[0164] When using a one-dimensional deep residual neural network that integrates long-tail learning and attention for two-stage fault diagnosis, the accuracy can reach over 97% for highly imbalanced data scenarios (200:1); the diagnostic accuracy exceeds 98% when the imbalance ratio is 100:1, and exceeds 99% when the imbalance ratio is 40:1. The confusion matrix results are as follows: Figure 4 As shown.

[0165] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0166] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0167] Through the above description of the embodiments, those skilled in the art can clearly understand that the above implementation methods can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0168] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.

Claims

1. A two-stage fault diagnosis method for air conditioning systems based on improved deep residual networks, characterized in that, The method is used for fault diagnosis of HVAC systems under high data imbalance scenarios, and the method includes the following steps: S1, Data Acquisition Steps: Collect historical operating data of HVAC system equipment and components, and obtain normal and fault samples; S2, Data processing steps: Label each normal sample and fault sample according to its category to obtain labeled normal samples and multiple fault samples; S3, Model building steps: Construct a deep residual network model that integrates long-tail learning and attention mechanism as a fault diagnosis model for HVAC system. Input the normal class samples and multiple fault samples for training, output the predicted value of data category label and determine the predicted fault type, thereby obtaining the trained HVAC system fault diagnosis model. S4, Actual output steps: Obtain actual operating data and input it into the trained HVAC system fault diagnosis model for two-stage fault diagnosis, thereby outputting the fault type; Specifically, S3 includes: S31: The fault diagnosis model of the HVAC system extracts shallow features by performing one-dimensional convolution operation through the initial convolutional layer, and performs preliminary downsampling through the max pooling layer to retain significant features; S32: Input the salient features into the residual layer and recalibrate the salient features through the attention mechanism to strengthen the feature patterns of the multiple fault samples as minority class samples, so that the model can capture the key feature information of the normal class samples and the multiple fault samples at the same time. S33: Perform global average pooling, and then use a fully connected layer to map the key feature information of the learned normal class samples and multiple fault samples to the classification space. Adjust the classification weights through long-tail learning to compensate for the small number of fault samples in the minority class due to the small number of samples, so that the classification decision boundary moves towards the normal class and reduces the false alarms. S34: Use the SoftMax function to convert the output of the fully connected layer into a probability distribution of fault categories, and determine the category with the highest probability as the predicted fault category; Specifically, in S4, the two-stage fault diagnosis includes: The diagnostic model in the first stage is a binary classification model. The input is all actual operating data, and the output after training is normal class samples and fault class samples. The second-stage diagnostic model is a multi-classification model. The input is the fault class samples output by the first-stage model, and the specific fault category is output by the trained HVAC system fault diagnosis model.

2. The two-stage air conditioning system fault diagnosis method according to claim 1, characterized in that, In step S2, before the labeling operation is performed on the normal and faulty samples, preprocessing operations are required, including: data cleaning, steady-state screening, data partitioning, and normalization.

3. The two-stage air conditioning system fault diagnosis method according to claim 1, characterized in that: In step S31, the kernel size of the initial convolutional layer is 1×7; In S32, the residual layer is constructed by 8 basic residual blocks, each residual block contains two convolutional layers, and each convolutional layer uses a 1×3 convolutional kernel.

4. The two-stage air conditioning system fault diagnosis method according to claim 1, characterized in that, In S32, the attention mechanism includes an SE channel attention mechanism and a spatial attention mechanism based on the CBAM architecture: The SE channel attention mechanism and the spatial attention mechanism based on the CBAM architecture are sequentially connected after the residual layer and before the global pooling layer.

5. The two-stage air conditioning system fault diagnosis method according to claim 1, characterized in that, In S33, the long-tail learning employs a learnable weight scaling module; The learnable weight scaling module is located after the fully connected layer and before the SoftMax function.

6. The two-stage air conditioning system fault diagnosis method according to claim 1, characterized in that, In S1, under the high imbalance data scenario, the imbalance ratio between the normal class samples and the faulty class samples is above 40:

1.

7. The two-stage air conditioning system fault diagnosis method according to claim 6, characterized in that, When the imbalance ratio of normal to faulty samples is 200:1, the fault diagnosis accuracy of the method exceeds 97%; when the imbalance ratio of normal to faulty samples is 40:1, the fault diagnosis accuracy of the method exceeds 99%.

8. A two-stage air conditioning system fault diagnosis system based on an improved deep residual network, said system operating according to the method according to any one of claims 1 to 7, wherein, The system includes: The data acquisition unit is used to collect historical operating data of HVAC system equipment and components, and to acquire normal and fault samples. The data processing unit is used to assign labels to each sample according to its category, including the normal samples and the fault samples, to obtain normal samples and multiple fault samples. The model building unit is used to build a deep residual network model that integrates long-tail learning and attention mechanisms as a fault diagnosis model for HVAC systems. It is trained by inputting the normal class samples and multiple fault samples, outputting the predicted value of the data category label and determining the predicted fault type, thereby obtaining the trained HVAC system fault diagnosis model. The actual output unit is used to acquire actual operating data and input it into the trained HVAC system fault diagnosis model for two-stage fault diagnosis, thereby outputting the fault type.