A mechanical fault diagnosis method and system based on federal domain generalization

By employing a global denoising diffusion probability model and bidirectional knowledge distillation technology, the triple heterogeneity problem in mechanical fault diagnosis is solved, enabling efficient and accurate cross-domain fault diagnosis, which is applicable to complex industrial environments.

CN121094060BActive Publication Date: 2026-02-13XIAN UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511620683.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-07
Publication Date
2026-02-13
Estimated Expiration
2045-11-07

AI Technical Summary

Technical Problem

Existing technologies suffer from triple heterogeneity in mechanical fault diagnosis, including statistical heterogeneity, feature space heterogeneity, and model heterogeneity, which makes federated domain generalization methods unable to effectively generalize and diagnose in real industrial environments.

Method used

Synthetic data is generated using a global denoising diffusion probability model. The data is projected onto a unified semantic space using a heterogeneous feature extractor. Local and global models are trained using bidirectional knowledge distillation technology to ensure mutual learning within the unified feature space. Finally, the model parameters are aggregated for fault diagnosis.

Benefits of technology

It systematically solves the triple heterogeneity problem, improves the efficiency and accuracy of cross-domain fault diagnosis, protects data privacy, adapts to the needs of complex industrial applications, and demonstrates consistent effectiveness and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121094060B_ABST
    Figure CN121094060B_ABST
Patent Text Reader

Abstract

The application discloses a mechanical fault diagnosis method and system based on federal field generalization, relates to the technical field of fault diagnosis, and comprises the following steps: collecting real data; training a global denoising diffusion probability model; synthesizing the global denoising diffusion probability model to obtain synthetic data; mixing the synthetic data and the real data to form balanced data; inputting the balanced data into a local model and a global model; extracting features by using a heterogeneous feature extractor in the global model to form fixed-length feature vectors; training the local model and the global model based on bidirectional knowledge distillation technology by using local features and the feature vectors; aggregating parameters of the local model to reestablish the global model; and inputting to-be-diagnosed data into the global model to obtain a fault diagnosis result. The application solves the three heterogeneity problems in 3H-FDG in a systematic way through step-by-step optimization of data, features and models, protects data privacy, and ensures the efficiency of cross-domain fault diagnosis.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of fault diagnosis, and particularly relates to a method for solving a triple heterogeneity problem in a mechanical fault diagnosis process by using federated domain generalization technology. BACKGROUND

[0002] Data-based mechanical fault diagnosis (MFD) is a cornerstone for improving system reliability and production efficiency in modern industrial automation. Ideally, a diagnostic model trained on data from multiple working conditions (i.e., source domains) should be able to be directly deployed to a new working condition (i.e., an unseen target domain) without local data or retraining. Federated domain generalization (FDG) emerges as an ideal paradigm to realize this vision, which enables multiple distributed source clients to jointly train a model with extensive generalization capability while protecting data privacy.

[0003] However, the application of FDG in real industrial environments faces a serious systematic challenge, known as triple heterogeneity (3H). This challenge is derived from three different but intertwined heterogeneity effects, namely:

[0004] 1. Statistical heterogeneity: The data between clients (including source clients and target clients) is usually non-identically distributed (Non-IID), and there are significant differences in working conditions and fault label distribution. This heterogeneity leads to inconsistency in local optimization objectives, ultimately weakening the convergence and generalization ability of the global model.

[0005] 2. Feature space heterogeneity: This is probably the most fundamental and often overlooked challenge, which is derived from the use of different sensors, signal processing techniques or data acquisition protocols by clients. Therefore, the feature dimensions, physical meanings and statistical properties of their local data are usually incompatible. This heterogeneity is particularly destructive because it undermines the basis of most knowledge transfer mechanisms. Without this basis, effective comparison and aggregation cannot be performed.

[0006] 3. Model heterogeneity: The differences between clients in computing power, storage capacity and technical preferences make it infeasible to assume a uniform model architecture. This diversity of architecture makes the classic federated learning algorithm (FL) that relies on model parameter aggregation ineffective. Therefore, the focus of research has shifted to model-agnostic knowledge transfer methods, such as knowledge distillation.

[0007] 3H-FDG challenge is not in the existence of these problems alone, but in their interweaving and compounded effects. Such effects lead to systematic impasses. For example, knowledge distillation of model heterogeneity is ineffective without a common feature space, while data augmentation for statistical heterogeneity can amplify local bias without a globally consistent learning objective. Although some previous work, such as FedMAKE (a learning framework based on federated model-agnostic knowledge integration), has addressed the problem of dual-heterogeneity scenarios (such as statistical and model heterogeneity) in generalized federated learning, the compounded 3H-FDG problem remains unsolved. SUMMARY

[0008] Embodiments of the present application provide a mechanical fault diagnosis method and system based on federated domain generalization, to solve the problem of triple heterogeneity in mechanical fault diagnosis in the prior art.

[0009] In one aspect, the embodiments of the present application provide a mechanical fault diagnosis method based on federated domain generalization, comprising:

[0010] broadcasting the global model to each source client, and initializing the local model in the source domain according to the parameters in the global model by the source client;

[0011] collecting real data by the source client;

[0012] training a global denoising diffusion probability model using the real data, and synthesizing the synthetic data using the trained global denoising diffusion probability model by each source client, and mixing the synthetic data and the real data to form balanced data;

[0013] inputting the balanced data into the local model and the global model, the global model comprising a feature extractor and a classifier, the feature extractor in the global model being a heterogeneous feature extractor obtained by combining a spatial pyramid pooling layer in a convolutional neural network architecture, the local model outputting local features, the global model extracting features from the balanced data in different dimensions using the heterogeneous feature extractor to form a fixed-length feature vector, and the feature vector serving as a unified semantic space;

[0014] training the local model and the global model using the local features and the feature vector based on a bidirectional knowledge distillation technology to update the parameters of the local model and the global model, and driving the training process by minimizing the comprehensive loss of the local model and the global model, the comprehensive loss combining a classification loss and a distillation loss;

[0015] after all the local models are trained, aggregating the parameters of all the local models, and re-establishing the global model according to the aggregated parameters;

[0016] Obtain the to-be-diagnosed data, input the to-be-diagnosed data into the re-established global model, and obtain the fault diagnosis result.

[0017] In another aspect, the embodiments of the present application also provide a mechanical fault diagnosis system based on federal domain generalization, comprising:

[0018] The cloud server is configured to broadcast the global model to each source client.

[0019] The source client is configured to initialize the local model in the source domain according to the parameters in the global model, collect real data, train the global denoising diffusion probability model using the real data, and synthesize the synthesized data using the trained global denoising diffusion probability model, and mix the synthesized data and the real data to form balanced data.

[0020] The global model comprises a feature extractor and a classifier, the feature extractor in the global model adopts a heterogeneous feature extractor, the heterogeneous feature extractor is obtained by combining a spatial pyramid pooling layer in a convolutional neural network architecture, the local model outputs local features, the global model extracts features from balanced data in different dimensions using the heterogeneous feature extractor to form a fixed-length feature vector, and the feature vector serves as a unified semantic space.

[0021] The source client and the cloud server train the local model and the global model using the local features and the feature vector based on a bidirectional knowledge distillation technology to update the parameters of the local model and the global model, and the training process is driven by minimizing the comprehensive loss of the local model and the global model, and the comprehensive loss combines a classification loss and a distillation loss.

[0022] The cloud server aggregates the parameters of all the local models after the training of all the local models is completed, and re-establishes the global model according to the aggregated parameters.

[0023] The cloud server is further configured to obtain to-be-diagnosed data, input the to-be-diagnosed data into the re-established global model, and obtain a fault diagnosis result.

[0024] In another aspect, the embodiments of the present application also provide a computer storage medium, which stores a plurality of computer instructions for causing a computer to execute the above method.

[0025] In another aspect, the embodiments of the present application also provide an electronic device, which comprises a memory and a processor, the memory stores a computer program executable by the processor, and the processor implements the above method when executing the computer program.

[0026] The mechanical fault diagnosis method and system based on federal domain generalization in the present application have the following advantages:

[0027] 1. Systematic solution to 3H-FDG problem: This method systematically solves the triple heterogeneity problem (statistical heterogeneity, feature space heterogeneity, and model heterogeneity) in 3H-FDG through step-by-step optimization at data, feature, and model levels, while protecting data privacy and ensuring the efficiency of cross-domain fault diagnosis.

[0028] 2. Multi-stage strategy to improve robustness: At the data level, use global denoising diffusion probability model (DDPM) to generate high-fidelity synthetic samples to alleviate the class imbalance and bias of the data; at the feature space level, unify the data from different source clients by projecting them into a unified semantic space through the heterogeneous feature extractor (HFE), ensuring that the features of different source clients can be effectively aligned; at the model level, consensus, use the bidirectional knowledge distillation (Bi-KD) mechanism to enable the global model and the local model to learn from each other in the shared feature space, further improving the generalization ability and stability.

[0029] 3. Efficient knowledge transfer mechanism: Through the de-biased data and unified feature space, the effectiveness of knowledge transfer is ensured, avoiding the accumulation of bias between models, so that the cross-domain fault diagnosis task can perform well in different source and target domains.

[0030] 4. Effectiveness in practical applications: Through experiments on a physical test platform, the FedTriCon method proposed in this application shows consistent effectiveness in simulation and real-world environments, verifying its applicability in real industrial environments.

[0031] 5. Flexibility and scalability: Although only two source clients are used in the experiment, the framework of this method can be extended to more source clients, adapting to more complex industrial application requirements. BRIEF DESCRIPTION OF DRAWINGS

[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiment or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.

[0033] Figure 1 A flowchart of a mechanical fault diagnosis method based on federated domain generalization is provided for the embodiments of the present application.

[0034] Figure 2 The results of visualizing the feature embedding of the target domain data in the FedTriCon method and the FedGMA method in task T2 on the CWRU dataset provided by the embodiments of the present application are shown in the result schematic diagram.

[0035] Figure 3 A schematic diagram of the results of the ablation experiment provided by the embodiment of the present application on the Gearbox dataset and the CWRU dataset.

[0036] Figure 4 A schematic diagram of the results of the experiment provided by the embodiment of the present application on the CWRU dataset with different combinations of hyperparameters.

[0037] Figure 5 A schematic diagram of the 3H-FDG problem deployed by K8s in the real world provided by the embodiment of the present application. DETAILED DESCRIPTION

[0038] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.

[0039] Figure 1 A flowchart of a mechanical fault diagnosis method based on federated domain generalization provided by the embodiment of the present application. Before describing the method of the present application, the assumptions on which the method of the present application is based are introduced as follows:

[0040] Assumption 1: The FDG framework includes a cloud server and multiple source clients. They collaboratively train a global model to be able to generalize to unseen target domains. During training, only the labeled data of the source client is accessible, and the data of the target client is completely invisible.

[0041] Assumption 2: The difference in working conditions between the two clients (including the source client and the target client) leads to statistical heterogeneity, which manifests as domain shift and label shift.

[0042] Assumption 3: The clients use different sensor types or signal processing techniques, so they have different feature spaces and feature dimensions.

[0043] Assumption 4: Due to differences in computing resources or local performance requirements, the clients and the cloud server use different model architectures.

[0044] Assumption 5: In order to ensure data privacy protection, all local data of the clients are strictly isolated during the training process.

[0045] Based on the above assumptions, the embodiment of the present application provides a mechanical fault diagnosis method based on federated domain generalization, which includes:

[0046] S100, broadcast the global model to each source client, and the source client initializes the local model in the source domain according to the parameters in the global model.

[0047] Exemplarily, the global model is composed of multiple layers of convolutional layers, max-pooling layers and fully connected layers, and contains a feature extractor and a classifier. The feature extractor in the global model is a heterogeneous feature extractor obtained by combining a spatial pyramid pooling (SPP) layer in a convolutional neural network (CNN) architecture, including convolutional layers and pooling layers. The classifier includes a fully connected layer and a classification activation function, and is used to output the final classification result. The local model in the source client 1 contains two layers of convolutional layers, wherein the first layer of convolutional layers has a convolution kernel size of 3x3, a number of convolution kernels of 64, and an output size of 32. The activation function uses ReLU. The classifier part is a fully connected layer containing 128 neurons, and the output generates the final prediction through a classification activation function. The local model in the source client 2 is similar to that in the source client 1, except that in the feature extraction part, the number of convolution kernels is increased to 128 and the output size is increased to 64, and the rest of the structure remains the same. After establishing the feature extractor and the classifier of the global model, the parameters of the feature extractor and the classifier in the global model can be broadcast to each source client through a local area network. After receiving the parameters, the source client assigns the parameters to the feature extractor and the classifier in its local model. At this time, all source clients have established their own local models.

[0048] S110, collecting real data by the source client.

[0049] Exemplarily, a plurality of sensors are deployed in the source client, such as acceleration sensors for detecting mechanical vibration. After collecting real data of the mechanical equipment by the sensors, the real data is temporarily stored in the memory.

[0050] S120, training a global denoising diffusion probability model using the real data, and each source client synthesizes synthetic data using the trained global denoising diffusion probability model, and mixes the synthetic data and the real data to form balanced data.

[0051] Exemplarily, like a general federated learning framework, the method of the present application is deployed on a plurality of clients and a cloud server. Each client represents a domain, wherein the clients include source clients and target clients. The source clients can collect data and perform fault diagnosis based on the global model, while the target clients can only collect data. Since the current global model is not suitable for the target clients, the target clients cannot perform fault diagnosis based on the data collected by the target clients at the moment. Both the source clients and the target clients have local data, wherein the local data collected by the source clients is referred to as source samples, and the local data collected by the target clients is referred to as target samples.

[0052] In particular, let denote the number of source clients. denote the set of samples in the k-th source client, where and are the feature and health label of the j-th sample in the set of samples, respectively, is the number of samples in the set of samples. The feature space of (e.g., = {vibrational signals}), has dimension , and denote the model deployed in the k-th source client and the cloud server, i.e., the local model and the global model, respectively.

[0053] Let denote the set of samples in the unseen target client T, where is the number of samples in the set of samples in the target client T, and are the feature and health label of the j’-th sample in the set of samples, respectively.

[0054] For any source client and target client T, the 3H-FDG problem can be summarized as follows:

[0055]

[0056] where, denote, and denote the feature condition distribution of source client , and target client T, , and denote the prior distribution of source client , and target client T label, , and denote the feature space of source client , and target client T, , and denote the dimension of input features of each client, and and denote the local model of source client and source client , denote the global model.

[0057] This application aims to construct a global model. This aims to mitigate the negative impact of 3H-FDG by leveraging multiple decentralized source data to minimize target risk. The target can be represented as:

[0058]

[0059] in, For global model The optimal parameters, These are the learnable parameters of the current global model. In the sample distribution Let the expectation be given for all sample pairs (x, y). The feature vector of the input sample, The true label corresponding to the sample. This is the global model's predicted output for the input sample x.

[0060] The goal of this application is to establish a framework that can systematically and sequentially decompose the different challenges brought about by different heterogeneities, and unfold them in turn during the local training phase of each client to ensure a solid foundation for knowledge exchange. Then, the framework is aggregated to establish a data-feature-consensus pipeline that allows knowledge to be transferred on a solid and unbiased basis.

[0061] Statistical heterogeneity, particularly severe class imbalance, can lead to local models becoming biased towards the majority class. This not only impairs their ability to diagnose rare faults but also contaminates the knowledge they contribute to the global model. Inspired by diffusion models, this application deploys a Global Denoising Diffusion Probability Model (DDPM), which each source client uses to synthesize high-fidelity synthetic samples to augment their underrepresented fault classes, thereby effectively rebalancing their local datasets. This rebalancing is a crucial prerequisite, providing a statistically uniform basis for subsequent stages, ensuring that subsequent operations are performed on less biased and more representative data.

[0062] In the embodiments of this application, the synthesis of synthetic data using the trained global denoising diffusion probability model includes a forward process and a backward process. The forward process introduces Gaussian noise into the clear signal step by step based on a pre-set variance scheduling. The backward process is used to train a prediction model that minimizes the objective function. The prediction model is used to iteratively apply denoising steps from pure noise to generate synthetic data.

[0063] Specifically, the forward process goes through After one time step:

[0064]

[0065] where, is the noise sample at the t-th time step, is the original clean signal, denotes the clean sample is generated by forward diffusion with the conditional distribution, is a Gaussian distribution, denotes the fidelity ratio at the t-th step, is the cumulative fidelity ratio from the 1-st step to the t-th step, is a variance schedule, is the fidelity ratio at the s-th step, I is the identity matrix, which makes it possible to directly sample from any noise state .

[0066] The backward process aims to learn a predictive model by minimizing the objective function to predict the noise added at each time step t, i.e.:

[0067]

[0068] where, is the training objective function, denotes taking the expectation over the joint distribution of the time step t, the clean sample and the noise term , t is the diffusion time step, is the real Gaussian noise term added to the sample, is the predicted noise of the model, is the Euclidean norm of a vector.

[0069] After training, the predictive model generates a new sample by starting from pure noise and iteratively applying the denoising step, i.e.:

[0070]

[0071] where, is the sample after the denoising step, z is a random Gaussian noise term, is the fidelity coefficient at the current time step.

[0072] With the help of the trained global denoising diffusion probability model, synthetic data is generated, and a certain proportion of real data is mixed to form balanced data, so as to solve the problem of statistical heterogeneity.

[0073] S130, input the balance data into the local model and the global model, the global model includes a feature extractor and a classifier, the feature extractor in the global model adopts a heterogeneous feature extractor (HFE), the heterogeneous feature extractor is obtained by combining a spatial pyramid pooling (SPP) layer in a convolutional neural network (CNN) architecture, the local model outputs local features, the global model extracts features from the balance data of different dimensions by using the heterogeneous feature extractor, forms a fixed-length feature vector, and the feature vector is used as a unified semantic space.

[0074] By way of example, the design of the convolutional neural network and the spatial pyramid pooling layer makes the heterogeneous feature extractor capable of receiving data of different dimensions from different clients and projecting the data into a fixed-length feature vector. The feature vector is used as a unified semantic space, which provides a common representation basis for all models. All subsequent operations, including classification and distillation, are performed in this shared semantic space.

[0075] Further, the spatial pyramid pooling layer is used to calculate the size of the stride and the convolution kernel of the convolutional neural network, the size of the stride is determined according to the size of the input data and the fixed size of the output data, and the size of the convolution kernel is determined according to the size of the input data, the size of the output data and the size of the stride.

[0076] Specifically, the present application dynamically calculates the size of the convolution kernel and the stride by using the SPP layer, so as to ensure that the output is of a fixed size regardless of the input dimension, i.e.

[0077]

[0078]

[0079] wherein stride is the size of the stride, kernel is the size of the convolution kernel, H in is the size of the input data, H out is the size of the output data, is the floor function.

[0080] S140, based on the bidirectional knowledge distillation technology, the local features and the feature vector are used to train the local model and the global model, so as to update the parameters of the local model and the global model, and the training process is driven by minimizing the comprehensive loss of the local model and the global model, and the comprehensive loss combines the classification loss and the distillation loss.

[0081] Exemplarily, since clients have heterogeneous model architectures, parameter averaging is generally not directly possible. Moreover, knowledge distillation can be ineffective or even harmful when applied to biased data or across misaligned feature spaces. After solving the problems of statistical heterogeneity and feature space heterogeneity in the above steps, the problem of model heterogeneity also needs to be solved. In the last local training step, the present application adopts bidirectional knowledge distillation (Bi-KD) to promote consensus between the local models of the source clients and the global model of the cloud server. Since all models are now operating in balanced data and uniform feature spaces, this mutual learning process is both stable and efficient.

[0082] Further, the classification loss is represented as:

[0083]

[0084] wherein, is the classification loss, is the classification loss coefficient, is the true label, is the local feature output by the local model, is the and cross-entropy loss between, is the feature vector output by the global model, is the and KL divergence between;

[0085] The distillation loss is represented as:

[0086]

[0087] wherein, is the distillation loss, is the distillation loss coefficient, is the and cross-entropy loss between, is the and KL divergence between.

[0088] Since the local model in the source domain contains a feature extractor and a classifier, these two modules will be trained separately during the training process, and the global model also contains a feature extractor and a classifier, these two modules will also be trained separately during the training process.

[0089] ​In the process of training the local model and the global model, the classification loss and the distillation loss of the local model and the global model are calculated, and the sum of the classification loss and the distillation loss is the comprehensive loss, and the process is driven by minimizing the comprehensive loss of each model, and the comprehensive loss is represented as:

[0090]

[0091] is the KL divergence, which is defined as follows:

[0092]

[0093] wherein, is the distillation loss based on the KL divergence, p is the probability distribution output by the global model, q is the probability distribution output by the local model, p(m) is the predicted probability of class m output by the global model, and q(m) is the predicted probability of class m output by the local model.

[0094] This Bi-KD mechanism enables the global model to absorb the expertise of the local model, while the local model also gains the generalization insights of the global model, and finally a robust consensus is established based on the previous stage of work.

[0095] Further, when updating the parameters of the local model and the global model, the corresponding gradients are first calculated according to the losses of the local model and the global model, and then the parameters of the local model and the global model are updated based on the gradients.

[0096] Specifically, in each training process, the gradients corresponding to the losses of the local model and the global model are as follows.

[0097] The parameters of the local model corresponding to the gradients are:

[0098]

[0099] wherein, is the set of learnable parameters of the model.

[0100] The parameters of the global model corresponding to the gradients are:

[0101]

[0102] The updated parameters of the model are:

[0103]

[0104]

[0105] wherein, and are parameters of the local model and the global model respectively, is a learning rate.

[0106] S150, after all the local models are trained, the parameters of all the local models are aggregated, and the global model is re-established according to the aggregated parameters.

[0107] Exemplarily, the aggregated parameters are expressed as:

[0108]

[0109] wherein, is the aggregated parameter, is an aggregation function, and K is the number of source clients, is the parameter of the local model in the kth source client obtained through bidirectional knowledge distillation update in the training process, and is expressed as:

[0110]

[0111] wherein, is a local update function of the source client, which is used for local training or knowledge distillation on the kth client based on the current global parameter and the denoising diffusion probability model , so as to obtain the updated local model parameter . is the trained global denoising diffusion probability model.

[0112] Further, after one local training is completed, all the trained source clients upload the updated model parameters in the bidirectional knowledge distillation to the cloud server, and the cloud server aggregates the parameters, that is, new aggregated parameters are obtained after each training is completed. After obtaining the new aggregated parameters, the cloud server stops iteration, establishes the global model according to the current aggregated parameters, and prepares to start fault detection on the to-be-diagnosed data with the global model.

[0113] S160, obtaining the to-be-diagnosed data, inputting the to-be-diagnosed data into the re-established global model to obtain the fault diagnosis result.

[0114] Exemplarily, the to-be-diagnosed data includes a time-domain vibration signal, and the vibration signal is converted into a frequency-domain signal by using fast Fourier transform and then input into the re-established global model.

[0115] The embodiment of the application also provides a mechanical fault diagnosis system based on federal domain generalization, which comprises:

[0116] The cloud server is configured to extract a target sample feature of a target sample in a target domain, determine a pseudo marginal vector of the target sample according to the target sample feature, so as to represent a boundary distribution of the target sample in a feature space, determine a source class weight and a target sample weight of the target domain based on the pseudo marginal vector, and calculate the target sample weight according to each source class weight, wherein the source class weight is used to represent the similarity between the target sample and each source domain category, and the target sample weight is used to represent the contribution degree of the target sample in a global parameter aggregation process; the cloud server is further configured to broadcast a global model to each source client;

[0117] The source client is configured to initialize a local model in a source domain according to a parameter in the global model, collect real data, train a global denoising diffusion probability model by using the real data, and synthesize the global denoising diffusion probability model to obtain synthesized data, and mix the synthesized data and the real data to form balanced data.

[0118] The global model comprises a feature extractor and a classifier, the feature extractor in the global model adopts a heterogeneous feature extractor, the heterogeneous feature extractor is obtained by combining a spatial pyramid pooling layer in a convolutional neural network architecture, the local model outputs local features, the global model extracts features from the balanced data in different dimensions by using the heterogeneous feature extractor, to form a fixed-length feature vector, and the feature vector is used as a unified semantic space.

[0119] The source client and the cloud server train the local model and the global model by using the local features and the feature vector based on a bidirectional knowledge distillation technology, to update the parameters of the local model and the global model, and the training process is driven by minimizing a comprehensive loss of the local model and the global model, and the comprehensive loss combines a classification loss and a distillation loss.

[0120] The cloud server aggregates the parameters of all the local models after the training of all the local models is completed, and reestablishes the global model according to the aggregated parameters.

[0121] The cloud server is further configured to obtain to-be-diagnosed data, input the to-be-diagnosed data into the reestablished global model, and obtain a fault diagnosis result.

[0122] Embodiments of the present application also provide a computer storage medium, which stores a plurality of computer instructions for causing a computer to execute the method described above.

[0123] Embodiments of the present application also provide an electronic device, which comprises a memory and a processor, the memory stores a computer program executable by the processor, and the processor implements the method described above when executing the computer program.

[0124] The following experiments are conducted on Gearbox (Southeast University’s dataset) and CWRU (Case Western Reserve University’s dataset).

[0125] To validate the effectiveness, the performance of the proposed method is compared with ten FDG methods, including one baseline method and nine state-of-the-art FDG methods, in resolving the triple heterogeneity in federated domain generalization for mechanical fault diagnosis.

[0126] Implementation details

[0127] Scenario construction: To ensure the fairness of the effectiveness comparison of the proposed method across different datasets, a uniform experimental setup is established for the Gearbox and CWRU datasets. A standard FDG scenario is configured, including two source clients, one target client, and one cloud server. Although the CWRU and Gearbox datasets originally have different numbers of local domains, a consistent strategy is adopted to create the target domain for both. Since Gearbox only has two local domains, the target domain is created by reserving a portion of data from one of the domains. Specifically, the data of one domain is split into 80% training set (as source client) and 20% test set (as target domain). To maintain consistency, CWRU also adopts the same approach. This setup is effective because the global model has no access to the data distribution of the target domain at all, thus ensuring a fair evaluation of its generalization ability. Although two source clients are configured, the framework of the present application is scalable to scenarios with more source clients.

[0128] Statistical heterogeneity: Statistical heterogeneity is introduced through two layers. First, data from different domains are assigned to different clients, thus naturally producing domain shifts. Second, to simulate severe class imbalance (i.e., label shift), Dirichlet distribution (Dir(a = 0.5)) is further used to resample the data of each source client. This process generates a highly skewed non-IID label distribution, in which certain fault types become extremely rare for a particular client.

[0129] Feature space heterogeneity: The available channels are partitioned to create non-overlapping or partially overlapping feature spaces for each client. For example, one source client can only have access to the vibration data (1 channel) at the drive end, while another client can have fan end data (2 channels), and the target domain needs to use data from both.

[0130] Model heterogeneity: Different neural network architectures are assigned to each client and the cloud server. For example, source client 1 uses a shallow CNN, source client 2 uses a deeper variant, and the cloud server uses the architecture proposed in the present application, which includes an SPP layer. The specific structure parameters of all models are shown in Table 1.

[0131] Table 1: Detailed structure parameters of all models

[0132] (a) Source Client 1 model

[0133]

[0134] (b) Source Client 2 model

[0135]

[0136] (c) Cloud Server model

[0137]

[0138] Evaluation details

[0139] To ensure a fair comparison, the HFE proposed in this paper was added to all ten comparison methods. This modification enables them to handle inputs of variable dimensions and attribute performance differences to their core knowledge transfer and generalization mechanisms. All experiments were implemented using PyTorch and conducted on an NVIDIA GeForce RTX 4090 GPU. The experiments reported the average accuracy and standard deviation of five independent runs. The detailed hyperparameter settings for all methods are shown in Table 2.

[0140] Table 2: Experimental parameters

[0141]

[0142] Experimental results of diagnostic accuracy

[0143] In the experiment, the proposed mechanical fault diagnosis method for resolving the triple heterogeneity in federated domain generalization through semantic consensus and the compared methods were compared in accuracy under the same setting, and visual analysis was conducted.

[0144] Number of source domains: The number of source domains can be multiple, and the number of source domains in this case is 2. In Table 3, the detailed information of the task on the Gearbox dataset and the test results of the proposed algorithm and the other 10 algorithms are shown.

[0145] Table 3: Detailed information of Gearbox dataset and test results

[0146] (a) Task details on the Gearbox dataset

[0147]

[0148] (b) Test accuracy on the Gearbox dataset

[0149]

[0150] In Table 3, FedAvg is a federated average algorithm, FedAM is a momentum-based federated average algorithm, DACS is a distributed adaptive cluster sampling algorithm, FADGN is a federated adversarial domain generalization network, FDDG is a federated domain distillation and generalization algorithm, FedDGGA is a federated domain generalization algorithm based on graph attention, FedIIR is a federated iterative information retrieval algorithm, FedGMA is a federated gradient matching algorithm, FedGM is a federated gradient matching algorithm, and FedDGFD is a federated domain generalization algorithm based on feature distillation.

[0151] As shown in Table 3, the mechanical fault diagnosis method for solving the triple heterogeneity in federated domain generalization through semantic consensus performs continuously and significantly better than all comparative methods in each task, especially in tasks T2 and T4, the accuracy of FedTriCon exceeds 70%, which is 20%-30% higher than the second best method (such as FedDGFD or FedAvg), and even 50% higher than the weaker method, which indicates that the FedTriCon of the present application has strong adaptability and diagnostic ability in the face of serious 3H-FDG scenarios, while most existing methods (such as FedDGGA, FedGMA) often perform unstable or even cannot converge to a meaningful solution in such a complex and heterogeneous environment. The robustness of FedTriCon highlights its effectiveness in solving triple heterogeneity (rather than isolated processing).

[0152] In Table 4, the detailed information of the tasks on the CWRU dataset and the test results of the method of the present application and other 10 algorithms are shown.

[0153] Table 4: Detailed information and test results of CWRU dataset

[0154] (a) Task details on CWRU dataset

[0155]

[0156] (b) Test accuracy on CWRU dataset

[0157]

[0158] As shown in Table 4, the mechanical fault diagnosis method that solves the triple heterogeneity in federated domain generalization through semantic consensus outperforms all comparative methods, with an accuracy of 78.99%, 82.82%, and 76.25% in tasks T1, T2, and T3, respectively. These results significantly surpass some strong-performing SOTA (state-of-the-art) methods (such as FDDG and FedDGFD), indicating that these methods still cannot effectively cope with the complex challenges brought by the superposition of triple heterogeneity. These results further verify the proposed data enhancement (Diffusion Model), feature alignment (HFE), and bidirectional knowledge distillation (Bi-KD).

[0159] Visualization analysis: To qualitatively evaluate the learned feature representations, t-SNE was used to visualize the feature embeddings of the target domain data. As shown in Figure 2 , in Figure 2 , (a) represents the visualization results of the feature embeddings of the target domain data by the FedTriCon method in task T2 on the CWRU dataset, while (b) represents the visualization results of the feature embeddings of the target domain data by the FedGMA method in task T2 on the CWRU dataset. In the T2 task of the CWRU dataset, FedTriCon learned features with high discriminability, resulting in clear and separated cluster structures of different fault categories in the graph, which is in sharp contrast to the SOTA method FedGMA—FedGMA's feature space is chaotic and severely mixed between classes, explaining its poor classification performance. This visualization result provides intuitive evidence for the unified and semantically explicit feature space constructed by FedTriCon.

[0160] Analysis of each module through ablation experiments: To verify the independent contribution and synergistic effect of the three core modules (DM, HFE, Bi-KD) in FedTriCon, comprehensive ablation experiments were conducted. By selectively removing or combining these three modules, seven model variants were constructed and tested on the Gearbox and CWRU datasets, with the results shown in Figure 3 , in Figure 3 , (a) represents the results of the ablation experiment on the Gearbox dataset, while (b) represents the results of the ablation experiment on the CWRU dataset. The following key conclusions were drawn from the analysis:

[0161] 1. HFE is a fundamental prerequisite: HFE (heterogeneous feature extractor) is proven to be the cornerstone of the entire framework. By itself, it can bring significant performance improvement on the complex Gearbox dataset. More importantly, other modules are almost unable to work properly without HFE. For example, the combination of Bi-KD and DM can only achieve an accuracy of 48.24% on the T1 task of the Gearbox dataset without HFE, indicating that knowledge transfer and data augmentation are difficult to play a role without a unified feature space as a prerequisite. This highlights that solving feature space heterogeneity is the first step and a necessary condition for cross-client collaboration.

[0162] 2. DM effectively alleviates statistical heterogeneity: When used in combination with HFE, the DM (diffusion model) module can stably improve performance. For example, in the T2 task of the Gearbox dataset, the combination of HFE+DM achieved an accuracy of 69.92%, showing that alleviating class imbalance through high-quality data synthesis is an effective strategy. However, this improvement does not hold in all scenarios. On the CWRU dataset, the combination of HFE+DM performs worse (e.g., only 41.58% on the T1 task). A possible explanation is that when lacking distillation mechanisms to regularize models, models may overfit to the features of synthetic data, especially in cases where the original domain shift is small. This indicates that there is a complex nonlinear interaction between modules.

[0163] 3. Bi-KD is a double-edged sword: Experimental results show that Bi-KD (bidirectional knowledge distillation) is a powerful but conditional mechanism. When used alone, it performs worse than the baseline model on both datasets, which is an important finding: if Bi-KD is forced to be executed without addressing data and feature heterogeneity, it may even reinforce bias, even reaching a consensus between misaligned feature representations, leading to performance degradation. However, after adding Bi-KD to the entire framework, its role becomes crucial. For example, removing Bi-KD from the complete model (i.e., comparing HFE+DM with the complete FedTriCon), the accuracy on the T2 task of Gearbox drops from 79.06% to 69.92%, indicating that Bi-KD plays a key role in building a robust model consensus.

[0164] 4. Significant synergistic effect of three modules: Although each individual module or two-module combination can bring certain performance improvement, they are usually unstable and even have negative effects on each other in some scenarios. Only when the three modules are fully coordinated, can FedTriCon stably achieve optimal performance on all tasks and datasets. For example, in the T1 task of Gearbox, the accuracy of the complete model is 72.67%, which is more than 11% higher than the best two-module combination HFE+DM (61.44%); in the T1 task of CWRU, FedTriCon reaches 87.81%, which also has a significant improvement compared to Bi-KD+DM (80.07%). This fully illustrates the importance and necessity of the synergy of the three.

[0165] Analysis of hyperparameters: The experiment also studies the sensitivity of FedTriCon to the key hyperparameters a and b, which are used to balance the loss of local models and global models in the bidirectional distillation process. On the T1 task of the CWRU dataset, five different combinations of hyperparameters are evaluated. As shown in Figure 4 , the model performs stably under different hyperparameter values, but the performance reaches the peak at a = 0.5, b = 0.5. This indicates that when the specialization of local models and the generalization ability of global models are balanced during learning, knowledge exchange is most effective. This finding also verifies the rationality of the default hyperparameter selection, indicating that the balanced loss weight in bidirectional distillation is crucial to achieving optimal performance.

[0166] Deploying 3H-FDG in the real world: To verify the actual applicability and bridge the gap between simulation and real deployment, a physical FDG test platform is built. As shown in Figure 5 , the test platform consists of a cloud server and three edge devices distributed in different geographic regions, simulating a real FDG scenario. An FDG implementation based on Kubernetes (K8s) is adopted, referring to the work of Parra-Ullauri et al., and deployed on the above test platform. The K8s can control the deployment and life cycle management of the FDG pipeline, while ensuring network isolation and privacy protection through packet encryption, providing good security in a cloud-native environment. To build the FDG pipeline, the Flower framework is used and deployed in the K8s cluster. The configuration of 3H-FDG is consistent with the simulation experiment described above.

[0167] Although the preferred embodiments of the present application have been described, those skilled in the art can make additional changes and modifications to these embodiments once they understand the basic inventive concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0168] Obviously, many modifications and variations of the present application are possible in light of the above teachings. It is, therefore, to be understood that within the scope of the appended claims and their equivalents, the application can be practiced otherwise than as specifically described.

Claims

1. A mechanical fault diagnosis method based on federated domain generalization, characterized in that, include: The global model is broadcast to each source client, and the source client initializes the local model in the source domain according to the parameters in the global model; Real data is collected by the source client; A global denoising diffusion probability model is trained using real data. Each source client generates synthetic data based on the trained global denoising diffusion probability model, and the synthetic data is mixed with real data to form balanced data. Balanced data is input into local and global models for feature extraction and classification. The feature extractor of the global model adopts a heterogeneous feature extractor that combines spatial pyramid pooling layers in a convolutional neural network. The global model uses the heterogeneous feature extractor to extract features from the balanced data of different dimensions to form a feature vector of fixed length. The feature vector serves as a unified semantic space. The local and global models are jointly trained based on bidirectional knowledge distillation technology. The parameters are updated by minimizing the comprehensive loss function, which includes classification loss and distillation loss. After all local models have been trained, the parameters of each local model are aggregated and the global model is rebuilt. The system acquires the data to be diagnosed and inputs it into the global model, then outputs the mechanical fault diagnosis results.

2. The mechanical fault diagnosis method based on federated domain generalization according to claim 1, characterized in that, The synthesized data is generated by the global denoising diffusion probability model through forward denoising and reverse denoising processes. The spatial pyramid pooling layer is used to extract feature information at different scales to enhance the generalization ability of the model. When updating the parameters of the local model and the global model, the gradient is calculated and the model parameters are updated based on the gradient.

3. A mechanical fault diagnosis system applying the method according to any one of claims 1-2, characterized in that, include: The cloud server is used to broadcast the global model to each source client and update the global model with the aggregated parameters; The source client is used to initialize local models, collect real data, train global denoising diffusion probability models, generate synthetic data, and train models. The cloud server and the source client achieve feature sharing and model updates through bidirectional knowledge distillation, thereby improving the generalization performance of the model.

4. A computer storage medium, characterized in that, The computer storage medium stores a plurality of computer instructions, which are used to cause the computer to perform the method described in any one of claims 1-2.

5. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program executable by the processor, the processor executing the computer program to implement the method according to any one of claims 1-2.

Citation Information

Patent Citations

  • Mechanical fault diagnosis method and system based on federal domain generalization

    CN114818996A

  • Industrial big data driven longitudinal federal migration anomaly detection method and system

    CN118940003A