Household appliance fault diagnosis method based on hyperplane guided resampling method
By employing a hyperplane-guided resampling method and a self-attention network, the problem of data imbalance in the fault diagnosis of household appliances is solved, achieving higher diagnostic accuracy and overall performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HARBIN INST OF TECH
- Filing Date
- 2024-06-14
- Publication Date
- 2026-07-31
AI Technical Summary
In existing methods for diagnosing household appliance faults, data imbalance leads to a high misjudgment rate, and traditional resampling methods cannot effectively expand the distribution of fault samples and retain useful information.
A hyperplane-guided resampling method is adopted to downsample healthy samples through unsupervised clustering, and new fault samples are generated in the feature space using a self-attention network and a linear support vector machine. The model is then trained using a deep self-attention network to construct a fault diagnosis model.
It improves the accuracy of fault diagnosis for household appliances, reduces the noise risk of synthetic samples, enhances the expansion of the fault sample area, and improves the overall diagnostic performance.
Smart Images

Figure CN118885930B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of household appliance fault diagnosis technology. Background Technology
[0002] Household appliances are necessities for modern families, playing a vital role in reducing housework and improving living standards. However, operating in harsh environments such as humidity, dust, and cooking fumes for extended periods severely impacts their stability, inevitably leading to component fatigue, corrosion, and performance degradation. Failure to detect and address early malfunctions can result in anything from increased power consumption and shortened lifespan to serious issues like short circuits and even fires. Therefore, exploring early and accurate methods for diagnosing household appliance malfunctions is crucial for extending equipment lifespan, saving on operating costs, and ensuring home safety.
[0003] Fault diagnosis methods for household appliances can be broadly categorized into two types: model-driven methods and data-driven methods. Model-driven methods require the construction of an accurate physical analytical model, offering good interpretability. However, the presence of numerous uncertainties in the operating environment makes the modeling process extremely difficult, resulting in unsatisfactory diagnostic accuracy, which limits the widespread application of this type of method. Conversely, data-driven methods, especially deep learning methods, can automatically extract identifiable deep-level features from historical monitoring data, thereby inferring the health status of household appliances, avoiding the complex modeling process. Therefore, in recent years, the application of deep learning methods in household appliance fault diagnosis has attracted increasing attention from researchers.
[0004] Directly using deep learning for fault diagnosis of home appliances will face the challenge of data imbalance. To date, data resampling methods remain a common approach to address this challenge. These typically employ downsampling (removing healthy samples to approximate the number of faulty samples), oversampling (synthesizing faulty samples to approximate the number of healthy samples), or hybrid resampling (a compromise between the two, removing healthy samples and synthesizing faulty samples to approximate the number of healthy and faulty samples) to rebalance the data distribution. Further, downsampling methods can be categorized into random downsampling and heuristic downsampling. Random downsampling randomly removes a certain number of healthy samples from the training set. These randomly removed samples may contain a lot of potentially useful information, negatively impacting the diagnostic performance of the classification model. To retain more useful information, many heuristic downsampling methods have been proposed. These methods typically consider the data distribution and remove healthy samples according to certain criteria. Similarly, oversampling methods can also be categorized into random oversampling and heuristic oversampling. Random oversampling randomly copies a certain number of original minority class samples and adds them to the training set. Randomly replicated samples lack diversity, which can lead to overly specific classification boundaries learned by classification models, resulting in overfitting. To mitigate this problem, numerous heuristic oversampling methods have been proposed, which guide the synthesis of more diverse fault samples according to certain criteria.
[0005] However, compared to traditional downsampling methods, hybrid resampling methods can reduce the loss of information in healthy samples; compared to traditional oversampling methods, they can reduce the risk of synthesizing noisy samples. Therefore, this application considers using a hybrid resampling method to balance the dataset. It is worth noting that hybrid resampling methods typically employ the concise and efficient SMOTE method to synthesize faulty samples. Specifically, assuming z is a faulty sample, If z is a k-nearest neighbor of z, then the formula for calculating the composite sample is: In the formula, the interpolation factor α is randomly selected from the uniform distribution U(0,1). Since 0 < α < 1, SMOTE's inward linear interpolation strategy can only synthesize fault samples within the distribution. However, while synthesizing fault samples within the distribution increases the number of fault samples, it does not expand the area occupied by the fault samples outward according to their own distribution characteristics. Therefore, its role in estimating the decision hyperplane is limited, resulting in a still relatively high misclassification rate for fault samples. Thus, it is necessary to develop a new data resampling method that can both increase the number of fault samples and expand the area occupied by the fault samples outward according to their own distribution characteristics, and combine it with deep neural networks to jointly address the challenges faced in diagnosing faults in household appliances. Summary of the Invention
[0006] This invention aims to address the problem of high misjudgment rates caused by data imbalance in existing fault diagnosis methods for household appliances. It provides a fault diagnosis method for household appliances based on a hyperplane guided resampling method.
[0007] The fault diagnosis method for household appliances based on the hyperplane guided resampling method of the present invention includes:
[0008] Step 1: Obtain historical monitoring data of household appliances, perform preprocessing, and obtain a training set, which includes fault samples and healthy samples;
[0009] Step 2: Use unsupervised clustering to divide the healthy samples into different clusters, and then use the samples at the center of all clusters as the healthy samples in the downsampled training set.
[0010] Hyperplane guidance is used to oversample the downsampled fault samples in the training set to synthesize new fault samples;
[0011] The newly synthesized fault samples are added to the downsampled training set to form a balanced training set;
[0012] Step 3: Establish a deep self-attention network and train the deep self-attention network using a balanced training set. After training, obtain the fault diagnosis model.
[0013] Step 4: Use the real-time monitoring data of the household appliances as input to the fault diagnosis model to obtain the fault diagnosis results of the household appliances.
[0014] Furthermore, in this invention, the process of synthesizing new fault samples in step two is as follows:
[0015] Step 2: 1. Establish a self-attention-based encoder-decoder network. Use a reconstruction loss function and a three-center loss function to train the self-attention-based encoder-decoder network on the downsampled training set to obtain a mapping network. The mapping network includes an encoder network and a decoder network.
[0016] Step 22: Use the encoding network in the mapping network to map the downsampled training set to the inter-class separation feature space to obtain the spatially mapped training set;
[0017] Steps 2 and 3: In the feature space where classes are separated, a linear support vector machine is used to learn the spatial mapping and then train the initial classification hyperplane between healthy and faulty samples in the training set.
[0018] An attention module is established, utilizing m random fault samples from the spatially mapped training set and the k-nearest neighbor fault samples of these m fault samples, employing a loss function... The attention module is trained under the guidance of the initial classification hyperplane;
[0019] The loss function
[0020]
[0021] In the formula, w and b are the weight vector and bias of the initial decision hyperplane, respectively, and z... i Let Z be the i-th sample in the spatially mapped training set Z. new For the synthesized fault samples, card(·) is the number of elements in the set; ||·||2 represents the 2-norm of the matrix;
[0022] Step 24: Randomly select m fault samples and the k-nearest neighbor fault samples of the m fault samples from the spatially mapped training set as input to the trained attention module to synthesize new fault samples in the feature space, where m is the difference in the number of healthy samples and fault samples in the downsampled training data.
[0023] Step 25: Map the new fault samples in the feature space back into the original space using the decoding network in the mapping network to obtain the final new fault samples.
[0024] Furthermore, in this invention, in step two-one, the reconstruction loss function is:
[0025]
[0026] In the formula, x i For X U The i-th element, X U The training set after downsampling. For x i The reconstruction of x, |·| represents the number of elements in the set, ||·||2 represents the 2-norm of the matrix, and β∈[0,1) is a hyperparameter, usually set to 0.999. If x i If it is a healthy sample, then n i =M; if x i If it is a fault sample, then n i =A, where AA represents the number of faulty samples and M represents the number of healthy samples in the training set after downsampling.
[0027] Furthermore, in this invention, the three-center loss function is expressed as:
[0028]
[0029] In the formula, z i It is the i-th element in Z, and d is a hyperparameter, which is usually set to 2. In addition, if z iIf it is a healthy normal sample, then c i It is the center of healthy samples, and It is the center of the fault sample; if z i If it is a fault sample, then c i It is the center of the fault sample, and It is the center of the health sample; in summary, this application combines and If we train the encoder-decoder network together, then the complete loss function can be expressed as:
[0030] Furthermore, in steps two and three, the process of training the attention module under the guidance of the initial classification hyperplane is as follows:
[0031] From the spatially mapped training set, randomly select m fault samples and the k-nearest neighbor fault samples of the m fault samples. Each fault sample and its k-nearest neighbor fault samples are processed by a dimension reduction linear layer, a dimension increase linear layer and an output linear layer in sequence to obtain an scalable interpolation factor.
[0032] The scalable interpolation factor is multiplied by the difference between the input fault sample and its k-nearest neighbor fault sample, and then the product is added to the input fault sample to synthesize a new fault sample.
[0033] Using loss function Calculate the distance from the newly synthesized sample to the initial classification hyperplane, and train the attention module using backpropagation.
[0034] Furthermore, in this invention, each fault sample and its k-nearest neighbor fault samples are processed sequentially by a dimension reduction linear layer, a dimension increase linear layer, and an output linear layer to obtain an scalable interpolation factor;
[0035] Through the formula:
[0036]
[0037] The calculation yields the following formula: This represents the ReLU activation function, and W1, W2, and W3 represent the parameter matrices of the dimension-reduced linear layer, the dimension-upgraded linear layer, and the output linear layer, respectively. It is worth noting that... The value range of is (-1, 2), when When the values belong to (-1, 0) and (1, 2), interpolate to synthesize fault samples; when When the value is (0, 1), interpolate to synthesize fault samples.
[0038] Furthermore, in this invention, the formula for synthesizing fault samples is as follows:
[0039] Furthermore, in this invention, in step three, the deep self-attention network includes an input encoding layer, a Transformer encoding layer, and a linear output layer;
[0040] The input data is encoded by the input encoding layer and then added to the position encoding signal to obtain the encoded data. The encoded data is then mapped by the Transformer encoding layer to obtain the temporal features. The temporal features are then linearly transformed by the linear output layer and then calculated by the Softmax function to obtain the output data.
[0041] The Transformer coding layer includes a multi-head attention mechanism module, two residual layer normalization modules, and a fully connected feedforward layer;
[0042] The multi-head attention mechanism module includes multiple self-attention sub-modules. These sub-modules linearly map the encoded data to different subspaces to obtain three self-attention matrices. The output information of each attention sub-module is then calculated using the Softmax function based on these self-attention matrices. Finally, the output data of all attention sub-modules are merged to obtain the temporal features of the multi-head attention mechanism.
[0043] The temporal features of the multi-head attention mechanism are input into a residual and layer normalization module. The residual and layer normalization module adds the temporal features of the received signal after layer normalization to the encoded data to obtain the sum data, and outputs the sum data to the fully connected feedforward layer.
[0044] The fully connected feedforward layer performs a linear transformation on the received sum data, and then outputs the linearly transformed data to another residual & layer normalization module. The other residual & layer normalization module adds the linearly transformed data to the sum data to obtain the time series characteristics.
[0045] Furthermore, in this invention, the fully connected feedforward layer includes two linear transformation processes, and the calculation formula for each linear transformation process is as follows:
[0046] FFN(H)=[(H·W F1 +b F1 )φ(1.702×(H·W F1 +b F1 ))]·W F2 +b F2
[0047] In the formula, W F1 and W F2 Represents a linear transformation; b F1 and b F2 φ(·) represents the bias; φ(·) represents the cumulative distribution function of the logistic distribution.
[0048] Furthermore, in this invention, the three self-attention matrices are:
[0049]
[0050] In the formula, It is the linear mapping matrix of the i-th self-attention submodule.
[0051] Furthermore, in this invention, the output information of the attention submodule is as follows:
[0052]
[0053] In the formula, d i Representation matrix Q i The dimension, H i This refers to the information obtained by the i-th self-attention submodule.
[0054] Furthermore, in this invention, the temporal characteristics of the multi-head attention mechanism are as follows:
[0055] H = concat(H1, H2, ..., H) h W c
[0056] In the formula, h is the number of self-attention submodules, and W c It is the parameter matrix of the linear mapping. Furthermore, H, after a series of subsequent operations, yields the output z of the Transformer coding layer.
[0057] The method described in this invention has a significant improvement in comprehensive diagnostic performance. On the one hand, compared with traditional cluster-based downsampling methods, the downsampling method in the developed method can retain more health information and reduce information loss. On the other hand, the hyperplane-guided resampling method not only reduces the probability of the synthesized sample falling into the danger zone, but also extends the area occupied by the fault sample. This invention can further improve the accuracy of fault diagnosis of household appliances under unbalanced conditions. Attached Figure Description
[0058] Figure 1 This is a flowchart of the method described in this invention;
[0059] Figure 2 A comparison chart of the distribution of fault samples during the training and testing phases of existing direct training methods, SMOTE training methods, and the method described in this invention;
[0060] Figure 3 The flowchart shows the hyperplane-guided resampling method.
[0061] Figure 4 This is a schematic diagram of the attention module used to learn the interpolation factor;
[0062] Figure 5 This is a schematic diagram of a synthesized sample using a hyperplane-guided oversampling method.
[0063] Figure 6 This is a schematic diagram of a synthesized sample using the SMOTE-based oversampling method.
[0064] Figure 7 This is a schematic diagram of the structure of a self-attention-based encoder-decoder network. Detailed Implementation
[0065] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of the present invention can be combined with each other.
[0066] Specific implementation method one: Refer to Figures 1 to 7 The figure illustrates this embodiment in detail. The household appliance fault diagnosis method based on the hyperplane guided resampling method described in this embodiment includes:
[0067] Step 1: Obtain historical monitoring data of household appliances, perform preprocessing, and obtain a training set, which includes fault samples and healthy samples;
[0068] Step 2: Use unsupervised clustering to divide the healthy samples into different clusters, and then use the samples at the center of all clusters as the healthy samples in the downsampled training set.
[0069] Hyperplane guidance is used to oversample the downsampled fault samples in the training set to synthesize new fault samples;
[0070] The newly synthesized fault samples are added to the downsampled training set to form a balanced training set;
[0071] Step 3: Establish a deep self-attention network and train the deep self-attention network using a balanced training set. After training, obtain the fault diagnosis model.
[0072] Step 4: Use the real-time monitoring data of the household appliances as input to the fault diagnosis model to obtain the fault diagnosis results of the household appliances.
[0073] In this invention, step three, after obtaining the fault diagnosis model, also includes testing the fault diagnosis model using a test set different from the training set, and analyzing the tested data. The analysis shows that the diagnostic accuracy of the fault diagnosis model described in this invention is significantly better than existing diagnostic methods. This invention uses an unsupervised clustering algorithm (K-Means) to divide the clusters of relatively optimal healthy samples in the training set.
[0074] Furthermore, in this invention, the process of synthesizing new fault samples in step two is as follows:
[0075] Step 2: 1. Establish a self-attention-based encoder-decoder network. Use a reconstruction loss function and a three-center loss function to train the self-attention-based encoder-decoder network on the downsampled training set to obtain a mapping network. The mapping network includes an encoder network and a decoder network.
[0076] Step 22: Use the encoding network in the mapping network to map the downsampled training set to the inter-class separation feature space to obtain the spatially mapped training set;
[0077] Steps 2 and 3: In the feature space where classes are separated, a linear support vector machine is used to learn the spatial mapping and then train the initial classification hyperplane between healthy and faulty samples in the training set.
[0078] An attention module is established, utilizing n random fault samples from the spatially mapped training set and their k-nearest neighbor fault samples, and employing a loss function. The attention module is trained under the guidance of the initial classification hyperplane;
[0079] The loss function
[0080]
[0081] In the formula, w and b are the weight vector and bias of the initial decision hyperplane, respectively, and z... i Let Z be the i-th sample in the spatially mapped training set Z. new For the synthesized fault samples, card(·) is the number of elements in the set; ||·||2 represents the 2-norm of the matrix;
[0082] Step 24: Randomly select m fault samples and their -nearest neighbor fault samples from the spatially mapped training set as input to the trained attention module to synthesize new fault samples in the feature space, where m is the difference in the number of healthy samples and fault samples in the downsampled training data.
[0083] When the number of faulty samples is less than the difference between healthy samples and faulty samples, the faulty samples are randomly selected repeatedly.
[0084] Step 25: Map the new fault samples in the feature space back into the original space using the decoding network in the mapping network to obtain the final new fault samples.
[0085] Furthermore, in this invention, in step two-one, the reconstruction loss function is:
[0086]
[0087] In the formula, x i For X U The i-th element, X U The training set after downsampling. For x i The reconstruction of x, |·| represents the number of elements in the set, ||·||2 represents the 2-norm of the matrix, β∈[0,1) is a hyperparameter, usually set to 0.999; if x i If it is a healthy sample, then n i =M; if x i If it is a fault sample, then n i =A, where A represents the number of faulty samples and M represents the number of healthy samples in the training set after downsampling.
[0088] Furthermore, in this invention, the three-center loss function is expressed as:
[0089]
[0090] In the formula, z i It is the i-th element in Z, and d is a hyperparameter, usually set to 2. Additionally, if z... i If it is a healthy normal sample, then c i It is the center of healthy samples, and It is the center of the fault sample; if z i If it is a fault sample, then c i It is the center of the fault sample, and It is the center of the health sample; in summary, this application combines and If we train the encoder-decoder network together, then the complete loss function can be expressed as:
[0091] Furthermore, in steps two and three, the process of training the attention module under the guidance of the initial classification hyperplane is as follows:
[0092] From the spatially mapped training set, randomly select m fault samples and the k-nearest neighbor fault samples of the m fault samples. Each fault sample and its k-nearest neighbor fault samples are processed by a dimension reduction linear layer, a dimension increase linear layer and an output linear layer in sequence to obtain an scalable interpolation factor.
[0093] The scalable interpolation factor is multiplied by the difference between the input fault sample and its k-nearest neighbor fault sample, and then the product is added to the input fault sample to synthesize a new fault sample.
[0094] Using loss function Calculate the distance from the newly synthesized sample to the initial classification hyperplane, and train the attention module using backpropagation.
[0095] Furthermore, in this invention, the loss function
[0096]
[0097] In the formula, w and b are the weight vector and bias of the initial decision hyperplane, respectively, obtained by solving using a standard linear support vector machine on the training set Z after spatial mapping. The L... DS z is the average distance between the synthesized fault sample and the hyperplane. i Let z be the i-th sample in the spatially mapped training set Z. new These are synthesized fault samples.
[0098] Furthermore, in this invention, each fault sample and its k-nearest neighbor fault samples are processed sequentially by a dimension reduction linear layer, a dimension increase linear layer, and an output linear layer to obtain an scalable interpolation factor;
[0099] Through the formula:
[0100]
[0101]
[0102] The calculation yields the following formula: This represents the ReLU activation function, and W1, W2, and W3 represent the parameter matrices of the dimension-reduced linear layer, the dimension-upgraded linear layer, and the output linear layer, respectively. It is worth noting that... The value range of is (-1, 2), when When the values belong to (-1, 0) and (1, 2), interpolate to synthesize fault samples; when When the value is (0, 1), interpolate to synthesize fault samples.
[0103] Furthermore, in this invention, the formula for synthesizing fault samples is:
[0104] This represents the fault sample that is the nearest neighbor of the fault sample z.
[0105] To address the imbalance problem under inter-class aliasing conditions, this invention constructs a novel hyperplane-guided resampling method, which, together with a clustering-based downsampling method, balances the training set. The fault diagnosis and detection process for household appliances using this method is attached. Figure 3 As shown, it mainly includes four steps, and the specific fault diagnosis process is as follows:
[0106] Step 1: Data preprocessing, which involves dividing the monitoring data obtained from the household appliance status sensors into training datasets and test datasets;
[0107] Step 2: Data downsampling based on clustering. Healthy samples are divided into different clusters by using an unsupervised clustering method, and then the set of cluster centers is used to replace the healthy samples. The purpose is to reduce the difference in the number of healthy samples and faulty samples to a certain extent.
[0108] Step 3: Data resampling based on hyperplane guidance. A linearly separable feature space is obtained by using an unsupervised representation learning method. Then, an initial decision hyperplane is learned in the feature space. Under the guidance of the initial decision hyperplane, an oversampling method is used to synthesize fault samples. The purpose is to reduce the risk of synthesizing noisy samples and extend the region occupied by fault samples.
[0109] Step 4: Fault classification based on self-attention network. A decision boundary is learned by using a deep self-attention network, and then the state label (healthy or faulty) of the test sample is inferred. The purpose is to establish an accurate mapping relationship between performance monitoring data and labels.
[0110] like Figure 1 The distribution of samples in the training and testing phases of the direct method, the distribution of samples in the training and testing phases after SMOTE, and the comparative distribution of samples in the training and testing phases after the method proposed in this invention are shown in the schematic diagram. The method of this invention is significantly superior to existing methods.
[0111] In step 1, the monitoring data obtained from the household appliance sensors is divided into a training dataset and a test dataset; the training dataset is used to train the model, while the test dataset is used to comprehensively evaluate the method of this application.
[0112] In step 2, cluster-based data downsampling includes the following steps:
[0113] Step 2-1: In this application, the set consisting of healthy samples from the training set is denoted as X. n ={x1, x2, ..., x N In the formula, N represents the number of healthy samples. Furthermore, the set of faulty samples in the training set is denoted as... In the formula, A represents the number of faulty samples. An unsupervised clustering algorithm (K-Means) is used to calculate the relatively optimal cluster partitioning for healthy samples, and the set formed by the cluster centers is denoted as... In the formula This represents the cluster center of the j-th cluster under this partition.
[0114] Step 2-2: Use the cluster center set C * Replace the set X of healthy samples n That is, using the cluster center of the j-th cluster. Instead of the data for the entire cluster, this reduces the numerical difference between healthy and faulty samples to some extent. It's worth noting that in relatively optimal cluster partitioning, the cluster center can represent the data in the entire cluster better than other data within the cluster.
[0115] Steps 2-3: Cluster center set C * With the fault sample set X a The downsampled dataset X U =C * ∪X a In the downsampled dataset, healthy samples still outnumber faulty samples (i.e., M>A). Compared to traditional downsampling methods, more useful information can be preserved.
[0116] In step 3, the hyperplane-guided data resampling includes the following steps:
[0117] Step 3-1: To reduce the aliasing between faulty samples and healthy data, this application employs a self-attention-based encoder-decoder network (as shown in the attached diagram). Figure 7 (As shown) a feature mapping that maps the original data to a feature space where different types of samples are far apart. In this scenario, most oversampling methods synthesize samples that are likely to fall into a safe region, thus reducing the risk of synthesizing noisy samples. In other words, the trained encoding network is used to downsample the training set X. U This is mapped to a feature space that separates classes, i.e., Z = Encoder(X). U ).
[0118] The optimization objectives of self-attention-based encoder-decoder networks are twofold: first, the feature representations should retain important information from the input data; second, the feature representations of different data types should be more linearly separable. Therefore, this application considers two loss functions: reconstruction loss and three-center loss, each with its unique contribution. These will be described in detail below.
[0119] To ensure that the learned feature representations retain important information from the input data (i.e., data after cluster downsampling and before oversampling), this application uses the class equilibrium 2-norm as the reconstruction loss, which can be expressed as:
[0120]
[0121] In the formula, x i It is X U The i-th element in, and It is x i The reconstruction representation. |·| represents the number of elements in the set, and ||·||2 represents the 2-norm of the matrix. β∈[0,1) is a hyperparameter, typically set to 0.999. Furthermore, if x i If it is a healthy sample, then n i =M; if x i If it is a fault sample, then n i =A.
[0122] Meanwhile, to ensure that the feature representations of different types of data are far apart, this application adopts a three-center loss to guide the learning of feature representations, which can be expressed as:
[0123]
[0124] In the formula, z i It is the i-th element in Z. d is a hyperparameter, typically set to 2. Furthermore, if z i If it is a healthy sample, then c i It is the center of healthy samples, and It is the center of the fault sample; if z i If it is a fault sample, then c i It is the center of the fault sample, and It is the center of the healthy sample. In summary, this application combines... and If we train the encoder-decoder network together, then the complete loss function can be expressed as:
[0125] Step 3-2: To guide the generation of data to be close to the nearest neighbor region of the initial decision hyperplane, this application specifically designs an attention module to learn an extended interpolation factor. During the learning process, this interpolation factor can dynamically adjust the generation position of the samples, gradually bringing them closer to the initial decision hyperplane, thereby more realistically simulating the possible distribution area of faulty samples, which is beneficial for estimating the decision hyperplane.
[0126] The synthesis process of fault samples in the hyperplane guided resampling method can be summarized as follows: First, the fault sample z∈Z is combined with randomly selected neighboring fault samples. splicing to form a sample pair Second, the attention module uses sample pairs The input is the interpolation factor, and the output is the interpolation factor. It can be represented as
[0127]
[0128] In the formula, W1, W2, and W3 represent the ReLU activation function, and W1, W2, and W3 represent the parameter matrices of the dimension-reduced linear layer, the dimension-upgraded linear layer, and the output linear layer, respectively, as shown in the appendix. Figure 4 As shown. It is worth noting that, The value range of is (-1, 2), when When the values belong to (-1, 0) and (1, 2), interpolate to synthesize fault samples; when When the value belongs to (0, 1), interpolate to synthesize fault samples, as shown in the attached figure. Figure 5 As shown. Compared to SMOTE (as attached) Figure 6 As shown in the figure, the method of this application can not only balance the quantitative difference between faulty samples and healthy samples, but also extend the region occupied by faulty samples outward according to the distribution characteristics of faulty samples. Third, the formula for synthesizing faulty samples is as follows: Finally, repeat the above steps until a balanced training set is obtained.
[0129] The optimization objective of the hyperplane-guided resampling method is to make the generated data location as close as possible to the initial decision hyperplane. Therefore, this application designs a novel loss function. It can be represented as:
[0130]
[0131] In the formula, w and b are the weight vector and bias of the initial decision hyperplane, which are obtained by solving the standard linear support vector machine on the feature set Z.
[0132] Step 3-3: Use the trained decoding network to enhance the set Z new Mapping back to the original space, i.e. then, Compared with the downsampled training set X U Together they form a balanced training set.
[0133] In step 4, a balanced training set X is used under the guidance of cross-entropy loss. BA fault classification model based on a self-attention network is trained, and then the trained classification model is used to infer whether a household appliance has malfunctioned. The self-attention network can model long-range, multi-level dependencies in multi-dimensional time series, demonstrating remarkable potential in the field of multi-dimensional time series analysis. The self-attention network consists of multiple Transformer encoding layers (including one multi-head attention mechanism, two residual connections, two layer normalizations, and one fully connected feedforward layer) and one linear output layer (with a softmax activation function). The computational steps of its key component, the multi-head attention mechanism, are described in detail below:
[0134] First, the encoded input data X is mapped to different subspaces through linear mapping, resulting in three self-attention matrices Q. i K i V i , can be represented as
[0135]
[0136] In the formula, It is the linear mapping matrix of the i-th self-attention submodule.
[0137] Second, calculate the information H obtained by the i-th self-attention submodule. i , can be represented as
[0138]
[0139] In the formula, d i Representation matrix Q i Dimensions.
[0140] Third, by merging the information extracted from all self-attention sub-modules, the temporal features acquired by the multi-head attention mechanism are obtained, which can be represented as:
[0141] H = concat(H1, H2, ..., H) h W c
[0142] In the formula, h is the number of self-attention submodules, and W c It is the parameter matrix of the linear mapping. Furthermore, H undergoes a series of subsequent operations to obtain the output Z of the Transformer coding layer.
[0143] The data used in this application comes from washing machines of a household appliance company. Based on repair reports, performance monitoring data for 110 cycles of washing machines were collected between 2021 and 2022, including active energy count, active power, reactive power, apparent power, frequency, power factor, voltage, and current. The failure date for each washing machine is recorded in detail in the repair report. Furthermore, a sample was constructed using the sliding window method (window size 8×100, step size 100), resulting in 2646 samples, including 2271 healthy samples and 375 faulty samples. To more stably demonstrate the effectiveness of the method in this application, a five-fold cross-validation dataset was used, and the specific distribution is shown in Table 1.
[0144] Table 1 Summary of the washing machine dataset
[0145]
[0146] To verify the effectiveness of the method presented in this application, it is compared with one baseline method and eight popular resampling methods. The comparison methods considered are summarized below:
[0147] (1) The baseline method does not use any resampling method to balance the training set, that is, it trains the classifier directly on the imbalanced training set.
[0148] (2) Resampling methods are used to balance the training set, and then the classifier is trained on the balanced training set. The eight resampling methods can be divided into two main types: oversampling methods and hybrid resampling methods. Data augmentation methods include SMOTE, Borderline Over-sampling (BOS), Safe Level SMOTE (SL-SMOTE), and K-Means SMOTE (KM-SMOTE). In addition, hybrid resampling methods include SMOTE+Tomek links (SMOTE-TL), SMOTE+Edited Nearest Neighbor Rule (SMOTE-ENN), SMOTE+Iterative-Partitioning Filter (SMOTE-IPF), and Versatile Improved SMOTE+RoughSets (VIS-RST).
[0149] This application uses Recall of Faulty Samples (ROA) to evaluate the ability of the considered method to diagnose faulty samples, Recall of Healthy Samples (RON) to evaluate the ability of the considered method to diagnose healthy samples, and Class Mean Accuracy (CAA) to evaluate the overall diagnostic ability of the considered method. These metrics can be expressed as:
[0150] ROA=N11 / (N 11 +N 12 )
[0151] RON=N 22 / (N 21 +N 22 )
[0152] CAA = (ROA + RON) / 2
[0153] In the formula, N 11 N 12 N 21 and N 22 The specific meanings are summarized in Table 2.
[0154] Table 2 Summary of the Confusion Matrix
[0155]
[0156] Furthermore, the above indicators do not favor healthy samples, meaning that the effectiveness of the considered methods can still be evaluated even under conditions of imbalanced test sets.
[0157] The selection of key hyperparameters affects the quality of synthesized samples, thus impacting the effectiveness of feature learning and fault classification. Recommendations from classic references in this application determine the key hyperparameters for our method. First, the number of cluster centers in cluster-based downsampling is set to 600. Second, the encoder consists of two Transformer coding layers, and the number of attention heads N in the multi-head attention mechanism within the Transformer coding layers is [not specified]. head Set to 4, feature dimension d model The value is set to 128. Third, the decoder also consists of two Transformer coding layers, and the parameter settings in the Transformer coding layers are the same as those in the encoder. Fourth, the hyperparameters related to the hyperplane-guided resampling method are the compression ratio r and the dimension d of the dimensionality reduction linear layer. dr The dimension d of the linear layer of the higher dimension di The values were set to 16, 160, and 2560 respectively. Finally, the key hyperparameter N of the classifier phase based on the self-attention network was determined. layer N head and d model The values are set to 2, 4, and 128 respectively. Furthermore, the optimizer Adam is used to optimize the weight parameters of the neural network, with a learning rate of 0.0002, first momentum β1 = 0.5, second momentum β2 = 0.999, and a batch size of 128.
[0158] Tables 3 and 4 show the ROA and RON of the considered methods. First, ROA can be used to compare the ability of different methods to diagnose faulty samples. It can be seen that for faulty samples, the diagnostic ability of the proposed method repeatedly outperformed the baseline method and several comparative resampling methods in the 50% experiment. Specifically, the average ROA of the proposed method is 88.35%, representing a 19.98% improvement in accuracy compared to the baseline method. Second, RON can be used to compare the ability of different methods to diagnose healthy samples. It can be seen that for healthy samples, the diagnostic ability of the proposed method is inferior to the baseline method, but it surpasses eight comparative methods. Specifically, the average RON of the proposed method is 93.32%, representing a 4.6% decrease in accuracy compared to the baseline method, which ranks first in RON. Finally, compared to the comparative methods, the proposed method significantly narrows the gap between ROA and RON, indicating that the proposed method can effectively alleviate the problem caused by data imbalance. Overall, the method proposed in this application is the most suitable among the considered methods.
[0159] Table 3 shows the ROA (%) for the methods considered.
[0160]
[0161] Table 4 shows the RON (%) for the methods considered.
[0162]
[0163] Table 5 shows the CAA for the considered methods, and the following conclusions can be drawn:
[0164] (1) When CAA is used as the evaluation metric, all the resampling methods considered (except VIS-RST) outperform the baseline method. It can be seen that a suitable resampling method can improve the diagnostic performance of the classification model on imbalanced datasets.
[0165] (2) When CAA is used as the evaluation index, SMOTE-TL, SMOTE-ENN, and SMOTE-IPF are superior to the SMOTE method. All three belong to the hybrid resampling method (i.e., SMOTE + downsampling method), which shows that the hybrid resampling method is more advantageous than the oversampling method alone.
[0166] (3) Compared with all the comparative methods considered, the method proposed in this application achieved the best diagnostic results in terms of CAA. That is, the method has the best comprehensive diagnostic capability. Specifically, compared with the mixed resampling methods SMOTE-TL, SMOTE-ENN, SMOTE-IPF and VIS-RST, it improved the CAA by 1.13%, 2.15%, 2.48% and 12.24%, respectively. This also verifies the effectiveness of the method in this application.
[0167] Table 5 shows the CAA (%) of the methods considered.
[0168]
[0169] Tables 6-8 show the CAA, ROA, and RON of the proposed method under different numbers of cluster centers. For the average CAA, ROA, and RON, the proposed method produces the best diagnostic capability when the number of cluster centers is 500, 320, and 580, respectively. Overall, as the number of cluster centers increases, the diagnostic capability of the proposed method for healthy samples gradually increases, while the diagnostic function for faulty samples gradually decreases. When the number of cluster centers is 500, the proposed method produces the best comprehensive diagnostic capability. Therefore, an appropriate number of cluster centers has a significant impact on the performance of the proposed method. Furthermore, when the number of cluster centers is 300, the proposed method degenerates into a cluster-based downsampling method, and the comprehensive diagnostic effect is generally worse than that of the proposed method (number of cluster centers ≥ 480), further demonstrating the effectiveness of the proposed method.
[0170] Table 6. CAA (%) of the proposed method under different numbers of cluster centers
[0171]
[0172] Table 7. ROA (%) of the proposed method under different numbers of cluster centers.
[0173]
[0174]
[0175] Table 8. RON (%) of the proposed method under different numbers of cluster centers.
[0176]
[0177] To address the imbalance problem under inter-class aliasing conditions, this application proposes a novel hyperplane-guided resampling method, which, together with a clustering-based downsampling method, balances the training set. The main process is as follows: First, a clustering algorithm is used to group healthy samples into different clusters, and then the cluster centers and faulty samples constitute the downsampled training set. Second, an encoding network is used to map the downsampled training set into an inter-class separated feature space. Third, a hyperplane-guided resampling method is used to synthesize high-quality faulty samples. Fourth, a decoding network is used to map the generated samples back into the original space, and together with the downsampled training set, forms a balanced training set. Finally, the classification model is trained on the balanced training set, and the trained classification model is used to diagnose whether household appliances are faulty. In comparative experiments, compared with hybrid resampling methods SMOTE-TL, SMOTE-ENN, SMOTE-IPF, and VIS-RST, the method in this application shows a significant improvement in overall diagnostic performance. Specifically, compared with hybrid resampling methods SMOTE-TL, SMOTE-ENN, SMOTE-IPF, and VIS-RST, this method improves CAA by 1.13%, 2.15%, 2.48%, and 12.24%, respectively. This is because, on the one hand, compared with traditional clustering-based downsampling methods, the downsampling method in this developed method retains more health information and reduces information loss; on the other hand, the hyperplane-guided resampling method reduces the probability of synthetic samples falling into dangerous areas and extends the area occupied by faulty samples. Finally, the method proposed in this application is not only applicable to household appliance fault diagnosis tasks but also to pattern recognition tasks that require balancing the quantitative differences between different categories.
[0178] While the invention has been described herein with reference to specific embodiments, it should be understood that these embodiments are merely examples of the principles and applications of the invention. Therefore, it should be understood that many modifications can be made to the exemplary embodiments, and other arrangements can be designed without departing from the spirit and scope of the invention as defined by the appended claims. It should be understood that different dependent claims and features described herein can be combined in ways different from those described in the original claims. It is also understood that features described in conjunction with individual embodiments can be used in other described embodiments.
Claims
1. A home appliance fault diagnosis method based on a hyperplane-guided resampling method, characterized by, include: Step 1: Obtain historical monitoring data of household appliances, perform preprocessing, and obtain a training set, which includes fault samples and healthy samples; Step 2: Use unsupervised clustering to divide the healthy samples into different clusters, and then use the samples at the center of all clusters as the healthy samples in the downsampled training set. Using hyperplane guidance, fault samples in the downsampled training set are oversampled to synthesize new fault samples; The newly synthesized fault samples are added to the downsampled training set to form a balanced training set; Step 3: Establish a deep self-attention network and train the deep self-attention network using a balanced training set. After training, obtain the fault diagnosis model. Step 4: Use the real-time monitoring data of the household appliances as input to the fault diagnosis model to obtain the fault diagnosis results of the household appliances; In step two, the process of synthesizing new fault samples is as follows: Step 2:
1. Establish a self-attention-based encoder-decoder network. Use a reconstruction loss function and a three-center loss function to train the self-attention-based encoder-decoder network on the downsampled training set to obtain a mapping network. The mapping network includes an encoder network and a decoder network. Step 22: Use the encoding network in the mapping network to map the downsampled training set to the inter-class separation feature space to obtain the spatially mapped training set; Steps 2 and 3: In the feature space where classes are separated, a linear support vector machine is used to learn the spatial mapping and then train the initial classification hyperplane between healthy and faulty samples in the training set. An attention module is established, utilizing m random fault samples from the spatially mapped training set and the values of these m fault samples. -Nearest neighbor fault samples, using the loss function The attention module is trained under the guidance of the initial classification hyperplane, where m is the difference in the number of healthy samples and faulty samples in the downsampled training data. The loss function : In the formula, and Let z be the weight vector and bias of the initial decision hyperplane. i Let Z be the i-th sample in the spatially mapped training set Z. new For the synthesized fault samples, card(·) is the number of elements in the set; Represents the 2-norm of a matrix; Step 24: Randomly select m fault samples and their k-nearest neighbor fault samples from the spatially mapped training set as input to the trained attention module to synthesize new fault samples in the feature space. Step 25: Map the new fault samples in the feature space back into the original space using the decoding network in the mapping network to obtain the final new fault samples.
2. The household appliance fault diagnosis method based on the hyperplane-guided resampling method according to claim 1, characterized in that, In step 21, the reconstruction loss function is: In the formula, for The first in One element, The training set after downsampling. for The reconstruction Represents the 2-norm of a matrix. It's a hyperparameter, if If it is a healthy sample, then ;if If it is a fault sample, then A represents the number of faulty samples in the downsampled training set, and M represents the number of healthy samples in the downsampled training set. 3.The household appliance fault diagnosis method based on the hyperplane-guided resampling method of claim 2, characterized in that, In step 2.1, the three-center loss function is expressed as: In the formula, z i Let i be the i-th sample in the spatially mapped training set Z. It is a hyperparameter, if If it is a healthy sample, then It is the center of the healthy samples in the downsampled training set, and It is the center of the fault samples in the downsampled training set; if If it is a fault sample, then It is the center of the fault samples in the downsampled training set, and It is the center of the healthy samples in the downsampled training set.
4. The method for diagnosing household appliance faults based on the hyperplane guided resampling method according to claim 3, characterized in that, In steps two and three, the process of training the attention module under the guidance of the initial classification hyperplane is as follows: From the spatially mapped training set, randomly select m fault samples and the k-nearest neighbor fault samples of the m fault samples. Each fault sample and its k-nearest neighbor fault samples are processed by a dimension reduction linear layer, a dimension increase linear layer and an output linear layer in sequence to obtain an scalable interpolation factor. The scalable interpolation factor is multiplied by the difference between the input fault sample and its k-nearest neighbor fault sample, and then the product is added to the input fault sample to synthesize a new fault sample. Adopting a loss function , the distance of the newly synthesized fault sample to the initial classification hyperplane is calculated, and the attention module is trained using the back propagation method.
5. The household appliance fault diagnosis method based on the hyperplane-guided resampling method according to claim 4, characterized in that, Each fault sample and its k-nearest neighbor fault samples are processed sequentially by a dimension reduction linear layer, a dimension increase linear layer, and an output linear layer to obtain an scalable interpolation factor. Through the formula: The calculation yields the following formula: Represents the ReLU activation function, and These represent the parameter matrices for the dimension-reducing linear layer, the dimension-upgrading linear layer, and the output linear layer, respectively. The value range of is (-1, 2), when When the range is (-1, 0) and (1, 2), interpolate to synthesize fault samples; when... When the value is (0, 1), interpolate to synthesize fault samples. 6.The household appliance fault diagnosis method based on the hyperplane-guided resampling method of claim 5, characterized in that, In step three, the deep self-attention network includes a self-attention encoding network and a self-attention decoding network; Self-attention coding networks consist of: an input coding layer, a Transformer coding layer, a linear layer, and a Softmax function layer; A self-attention decoding network consists of a Transformer encoding layer and a linear output layer; The input data is encoded by the input encoding layer and then added to the position encoding signal to obtain the encoded data. The encoded data is mapped by two consecutive Transformer encoding layers to obtain the temporal features. The temporal features are then linearly transformed by the linear layer and then calculated by the Softmax function layer to obtain the higher-level temporal features. The high-level temporal features are then encoded by two consecutive Transformer encoding layers and then obtained by a linear output layer, and output by a deep self-attention network. The Transformer coding layer includes a multi-head attention mechanism module, two residual layer normalization modules, and a fully connected feedforward layer; The multi-head attention mechanism module includes multiple self-attention sub-modules. These sub-modules linearly map the encoded data to different subspaces to obtain three self-attention matrices. The output information of each attention sub-module is then calculated using the Softmax function based on these self-attention matrices. Finally, the output data of all attention sub-modules are merged to obtain the temporal features of the multi-head attention mechanism. The temporal features of the multi-head attention mechanism are input to a residual-layer normalization module. The residual-layer normalization module adds the temporal features of the received signal after layer normalization to the encoded data to obtain the sum data, and outputs the sum data to a fully connected feedforward layer. The fully connected feedforward layer performs a linear transformation on the received sum data, and outputs the linearly transformed data to another residual-layer normalization module. The other residual-layer normalization module adds the linearly transformed data to the sum data to obtain the higher-level temporal features. 7.The household appliance fault diagnosis method based on the hyperplane-guided resampling method of claim 6, characterized in that, The fully connected feedforward layer includes two linear transformation processes, and the calculation formula for each linear transformation process is as follows: In the formula, and Represents a linear transformation; and Indicates bias; Let H represent the cumulative distribution function of the logistic distribution, and let H represent the temporal characteristics of the multi-head attention mechanism. 8.The household appliance fault diagnosis method based on the hyperplane-guided resampling method of claim 7, characterized in that, Output information of the attention submodule: In the formula, Representation matrix Dimensions The information obtained by the i-th self-attention submodule Encoded input data is obtained through linear mapping. Mapping to different subspaces yields three types of self-attention matrices. one of the. 9.The household appliance fault diagnosis method based on the hyperplane-guided resampling method of claim 8, characterized in that, The temporal characteristics of multi-head attention mechanisms are as follows: In the formula, h It is the number of self-attention submodules. It is the parameter matrix of the linear mapping.