A network model training method based on client sample entropy perception and federated transfer learning

By employing a network model training method based on client-side sample entropy perception and federated transfer learning, the problems of data scarcity and parameter drift in cross-device fault diagnosis are addressed. Global model parameters are optimized through sample complexity entropy, and an adversarial residual block structure is introduced, thereby improving the diagnostic performance and adaptability of device health status detection.

CN119250130BActive Publication Date: 2025-12-09SHANGHAI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411192991.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2025-12-09
Estimated Expiration
2044-08-28

AI Technical Summary

Technical Problem

In cross-device fault diagnosis, existing technologies struggle to effectively address the performance degradation caused by data scarcity and low fault rates, and also suffer from parameter drift and negative transfer of diagnostic knowledge in multi-source domain adaptation and federated learning.

Method used

We employ a network model training method based on client sample entropy awareness and federated transfer learning. By calculating the sample complexity entropy of each source client, we optimize the global model parameters by combining human empirical coefficients and validation loss. We also introduce an adversarial residual block structure to enhance feature extraction capabilities and coordinate network structure parameters.

Benefits of technology

It improves the diagnostic performance of equipment health status detection, enhances the feature learning contribution against residual block structures, coordinates structural parameters, improves the local model update strategy, avoids catastrophe forgetting, and improves the adaptability and diagnostic accuracy of the global model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119250130B_ABST
    Figure CN119250130B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of computer deep learning, and discloses a network model training method based on client sample entropy sensing and federal migration learning. The method is that a network model to be trained is respectively carried in a central server and a plurality of source clients, a local model carried in the source clients is trained by using training samples, and a trained local model is obtained; a global model carried in the central server updates global model network parameters according to received local network model parameters; then the updated global model is downloaded into each source client, the updated global model downloaded into each source client is verified by using a verification sample set, and global model network parameters are optimized according to verification loss, and an updated global model is obtained; the updated global model is downloaded into each source client, the updated global model downloaded into each source client is verified by using the verification sample set, and after task verification is completed, network parameters of the updated trained local model are updated according to task verification performance of the updated trained local model and the updated global model in each source client; the above steps are repeated until the global model reaches an updated preset value or a preset performance, and global model training is completed.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer deep learning and cross-device fault diagnosis, and particularly relates to a network model training method based on client sample entropy sensing and federated transfer learning. SUMMARY

[0002] With the continuous development of digital industry, data-driven deep learning neural networks gradually replace traditional signal analysis methods and become the main means of mechanical equipment health monitoring, mainly because deep learning methods not only save industrial time, but also reduce the skill requirements for operators. A large number of data processing methods have developed at an unprecedented speed and are widely used in the fields of automobile automation, intelligent manufacturing, aerospace, etc. It is worth noting that with the expansion of the scope, the diagnosis method relying on the independent and identically distributed (i.i.d) data collected in the laboratory has exposed its vulnerability. This situation is due to the scarcity of data and low failure rate in industrial environments. Users often use relevant data in the laboratory for analysis and training. Unfortunately, this approach has produced a large number of different data samples, misleading the network training trajectory, and thus leading to a decline in diagnostic performance.

[0003] In order to solve the above problems, transfer learning (TL) provides a feasible method to solve the cross-domain diagnosis challenge. TL attempts to reduce the influence on the network by narrowing the sample distance between different distributions, and shares the diagnostic knowledge obtained from the labeled source domain samples to the unknown target domain. Recently, Ma et al. introduced a meta-learning method containing multi-scale extended convolution and related modules to solve the cross-domain fault diagnosis challenge. In addition, Qian et al. proposed a joint distribution alignment criterion to enhance the transfer of diagnostic knowledge between different machines. Zhu et al. and Jia et al. respectively designed a domain generalization network from the perspectives of causality and physical driving factors and class and domain based dual prototype loss to learn domain invariant features, and proved the effectiveness of the strategy. Although the TL strategy can effectively make the trained network produce satisfactory diagnostic results, the enhanced domain adaptive performance still cannot get rid of the dependence on the data of highly similar devices.

[0004] Considering that diagnostic knowledge from a single source domain cannot provide sufficient and highly similar diagnostic insights for the target task, resulting in unsatisfactory results. In industrial production, multi-source domain data distribution is often collected in various scenarios of different equipment to make up for the limitations of single domain knowledge. Gao et al. designed an information maximization strategy and an enhanced self-training mechanism to facilitate knowledge transfer across multiple domains. Liu et al. proposed a deep multi-source adversarial difference matching adaptive network to dynamically align the feature distribution between different domains. Yu et al. proposed a domain attribute feature transfer network to extract transferable latent features in multi-source data and obtain more reliable target diagnostic results. Many scholars have also proposed effective solutions to the multi-source domain adaptation problem from different angles. However, the current research on multi-source domain adaptation is relatively limited, and aligning the distribution of all domains is a major challenge.

[0005] In real industrial environments, in addition to the differences in data from multiple sources, access to customer data is strictly controlled due to its direct relationship with the company's core competitiveness. On this basis, federated learning (FL) is proposed as a new solution strategy to protect customer data privacy. Compared with multi-source domain adaptation, FL can achieve knowledge transfer from source domains to target domains without direct access to client data, showing great potential. Li et al. proposed an adaptive prediction alignment scheme on the target client, realizing knowledge communication between models. Guo et al. proposed a federated transfer learning strategy based on auxiliary classifiers, which completes the knowledge transfer of the global model by generating class client probability distribution. Wang et al. and Zhou et al. studied global model updating and knowledge sharing methods from multiple angles. In summary, FL shows good results in equipment fault diagnosis. However, there are still some challenges in practical applications that need further research.

[0006] Although the difference in sample complexity between source clients will directly lead to parameter bias and negative transfer of diagnostic knowledge, this problem is rarely addressed in related research. Once the global model experiences parameter drift, its transmission performance and generalization ability cannot be guaranteed. Therefore, it is necessary to study the influence of training sample complexity entropy on the network under cross-machine industrial scenarios. SUMMARY

[0008] In view of the problems and deficiencies in the prior art, the purpose of the present application is to provide a network model training method based on client sample entropy perception and federated transfer learning.

[0009] To achieve the purpose of the application, the technical scheme adopted by the present application is as follows:

[0010] The first aspect of the application provides a network model training method based on client sample entropy perception and federal transfer learning, comprising the following steps:

[0011] S1: the network model to be trained is mounted on a central server and a plurality of source clients respectively, wherein the network model mounted on the central server is recorded as a global model, and the network model mounted on the source client is recorded as a local model; samples for training the local model are collected, and the collected samples are divided into a training sample set and a verification sample set;

[0012] S2: the training sample set is input into the local model of each source client to train the local model, update the network parameters of the local model, until the local model reaches the preset value or the preset performance, and obtain the trained local model; the verification sample set is used to verify the trained local model of each source client, and the performance coefficient (task verification diagnosis accuracy) of the trained local model for task verification is calculated;

[0013] Wherein, the calculation formula of the performance coefficient of the trained local model for task verification is as follows:

[0014]

[0015] In the formula, α i is the performance coefficient of the trained local model of the i-th source client, K is the number of source clients, is the task verification accuracy of the trained local model of the i-th source client;

[0016] S3: the network parameters of the trained local model in each source client are uploaded to the global model, the global model receives the network parameters of the trained local model from each source client and calculates the complexity entropy of the training sample of each source client, and according to the performance coefficient of the trained local model of each source client and the artificial experience coefficient, the network parameters of the trained local model from each source client are weighted to obtain the network parameters of the global model, and the network parameters of the global model are used to update the global model;

[0017] S4: the updated global model is downloaded to each source client, the verification sample set is used to verify the updated global model downloaded to each source client, the network parameters of the trained local model are optimized and updated according to the verification loss of the updated global model in each source client in the task verification process, and the updated trained local model is obtained; meanwhile, the update loss of the global model is constructed according to the verification loss of the updated global model in each source client in the task verification process, and the network parameters of the updated global model in the central server are optimized by using the update loss of the global model, so that the update loss of the global model reaches the minimum and no longer decreases, and the updated global model is obtained;

[0018] S5: downloading the updated global model obtained in step S4 to each source client, performing task verification on the updated global model downloaded to each source client using a verification sample set, and after the task verification is completed, updating the network parameters of the updated trained local model according to the task verification performance of the updated trained local model and the updated global model in each source client;

[0019] S6: repeating the above steps S2-S5 until the global model reaches an updated preset value or a preset performance, and completing the global model training.

[0020] According to the above model training method, preferably, in step S3, the calculation formula of the global model network parameters obtained by weighting calculation of the network parameters of the trained local model from each source client is:

[0021]

[0022] wherein θ global is the global model network parameter, is the network parameter of the i th source client trained local model, a i is the artificial experience coefficient of the i th source client, a i is the performance coefficient of the i th source client trained local model, and K is the number of source clients.

[0023] According to the above model training method, preferably, in step S3, the calculation formula of the complexity entropy of the training sample of each source client is as follows:

[0024]

[0025] wherein H i is the complexity entropy of the i th source client sample, h i is the entropy coefficient of the complexity entropy of the i th source client sample, s is the number of potential pattern classes, P(·) is the frequency function, and K is the number of source clients.

[0026] According to the above model training method, preferably, in step S4, the formula for updating the network parameters of the trained local model according to the verification loss of the updated global model in each source client in the task verification process is as follows:

[0027]

[0028] λ = 1 / h i

[0029] wherein L Ci is the verification loss of the updated global model in the i th source client, K is the number of source clients, and θ​global θi is the network parameter of the updated local model in the i-th source client, θ is the network parameter of the global model, λ is a complexity coefficient, and h is a sample complexity entropy of the i-th source client. θi is the network parameter of the updated local model in the i-th source client, θ is the network parameter of the global model, λ is a complexity coefficient, and h is a sample complexity entropy of the i-th source client. i λ is a complexity coefficient, and h is a sample complexity entropy of the i-th source client. i λ is a complexity coefficient, and h is a sample complexity entropy of the i-th source client.

[0030] The calculation formula of the update loss of the global model is as follows:

[0031]

[0032] L is the update loss of the global model, L is the validation loss of the updated global model in the i-th source client, K is the number of source clients, and a is an artificial experience coefficient of the i-th source client. Update L is the update loss of the global model, L is the validation loss of the updated global model in the i-th source client, K is the number of source clients, and a is an artificial experience coefficient of the i-th source client. Ci L is the update loss of the global model, L is the validation loss of the updated global model in the i-th source client, K is the number of source clients, and a is an artificial experience coefficient of the i-th source client. i L is the update loss of the global model, L is the validation loss of the updated global model in the i-th source client, K is the number of source clients, and a is an artificial experience coefficient of the i-th source client.

[0033] According to the model training method, preferably, in step S5, the calculation formula of the network parameter of the updated trained local model according to the performance of the updated trained local model and the updated global model in each source client is as follows:

[0034] θ′ client = λ · (A global / A) · θ global +(1-λ)·(A local / A)·θ client

[0035] A = (1-λ)·A local +λ·A global

[0036] λ = 1 / h i

[0037] A is the task validation accuracy of the updated trained local model, A is the task validation accuracy of the updated global model, θ represents the network parameter of the updated trained local model in the source client, θ represents the network parameter of the updated global model, λ is a complexity coefficient, and h is a sample complexity entropy of the i-th source client. local A is the task validation accuracy of the updated trained local model, A is the task validation accuracy of the updated global model, θ represents the network parameter of the updated trained local model in the source client, θ represents the network parameter of the updated global model, λ is a complexity coefficient, and h is a sample complexity entropy of the i-th source client. global A is the task validation accuracy of the updated trained local model, A is the task validation accuracy of the updated global model, θ represents the network parameter of the updated trained local model in the source client, θ represents the network parameter of the updated global model, λ is a complexity coefficient, and h is a sample complexity entropy of the i-th source client. client A is the task validation accuracy of the updated trained local model, A is the task validation accuracy of the updated global model, θ represents the network parameter of the updated trained local model in the source client, θ represents the network parameter of the updated global model, λ is a complexity coefficient, and h is a sample complexity entropy of the i-th source client. global A is the task validation accuracy of the updated trained local model, A is the task validation accuracy of the updated global model, θ represents the network parameter of the updated trained local model in the source client, θ represents the network parameter of the updated global model, λ is a complexity coefficient, and h is a sample complexity entropy of the i-th source client. i A is the task validation accuracy of the updated trained local model, A is the task validation accuracy of the updated global model, θ represents the network parameter of the updated trained local model in the source client, θ represents the network parameter of the updated global model, λ is a complexity coefficient, and h is a sample complexity entropy of the i-th source client. client A is the task validation accuracy of the updated trained local model, A is the task validation accuracy of the updated global model, θ represents the network parameter of the updated trained local model in the source client, θ represents the network parameter of the updated global model, λ is a complexity coefficient, and h is a sample complexity entropy of the i-th source client.

[0038] According to the model training method, preferably, the network model is a device health state detection model, the device health state detection model is composed of a feature extractor and a multi-classifier, the feature extractor is used for feature extraction on sample data input into the network model, the multi-classifier is used for processing features extracted by the feature extractor to obtain a predicted health state classification of the device, and the multi-classifier includes two classifiers with the same structure.

[0039] According to the model training method, preferably, in step S2, the training sample set is input into the local model of each source client to train the local model, and the local model is updated until the local model reaches a preset update value or a preset performance.

[0040] S201: input a training sample in the training sample set into the local model, perform feature extraction on the training sample by using the feature extractor, then perform processing on features extracted by the feature extractor by using the multi-classifier to obtain a predicted health state of the device corresponding to the training sample, construct a loss function L1 based on a domain difference loss and a classification loss of the classifier according to the predicted health state and the real health state of the device, and adjust network parameters of the local model by using a back propagation algorithm according to the loss function L1, so that the loss function L1 is in a stable state and no longer decreases; wherein, the domain difference loss, the classification loss of the classifier, and the loss function L1 are calculated according to the following formulas:

[0041]

[0042] L classity =∑ p (y pre )log(1 / p(y real ))

[0043]

[0044] In the formula, p(y pre ) represents a probability set of a predicted health state classification of the device corresponding to the training sample output by the classifier, p(y real ) represents a set of real health state classifications of the device corresponding to the training sample, Π(p1, p2) is a set of all joint distributions between distributions p1 and p2, E represents expectation, x and y represent samples in two distributions, (x, y) ~ γ represents a joint distribution requirement that x and y conform to γ, δ1 is a training hyperparameter, L classity1 represents a classification loss given by the first classifier, L classity2 represents a classification loss given by the second classifier, * represents a multiplication operation, represents minimization of parameters of the feature extractor, the classifier 1 and the classifier 2, L domain represents the domain difference loss.

[0045] S202: input a training sample in the training sample set into the local model, perform feature extraction on the training sample by using the feature extractor, then input the features extracted by the feature extractor into two classifiers of the multi-classifier to obtain two predicted health states of the training sample, construct a loss function L2 based on the classification loss of the two classifiers and the difference loss output by the two classifiers, adjust the network parameters of the multi-classifier in the local model according to the loss function L2 by using the back propagation algorithm, so that the loss function L1 is in a stable state and no longer decreases, wherein the network parameters of the feature extractor are frozen while the network parameters of the multi-classifier in the local model are adjusted;

[0046] The calculation formula of the difference loss of the classifier and the loss function L2 is as follows:

[0047]

[0048] In the formula, δ2 is a training hyperparameter; M is the number of device health state categories; P 1m ,P 2m respectively represent the probability that the first classifier and the second classifier classify the sample device health state as category m, L classity1 represents the classification loss given by the first classifier, L classity2 represents the classification loss given by the second classifier, and L ClassDis is the difference loss of the classifier.

[0049] S203: input a training sample in the training sample set into the local model, perform feature extraction on the training sample by using the feature extractor, then input the features extracted by the feature extractor into two classifiers of the multi-classifier to obtain two predicted health states of the training sample, construct a loss function L3 based on the domain difference loss and the difference loss output by the classifiers, adjust the network parameters of the feature extractor in the local model according to the loss function L3 by using the back propagation algorithm, so that the loss function L3 is in a stable state and no longer decreases, wherein the network parameters of the multi-classifier are frozen while the network parameters of the feature extractor in the local model are adjusted;

[0050] The calculation formula of the loss function L3 is as follows:

[0051]

[0052] In the formula, δ3 and δ4 are training hyperparameters, L ClassDis is the difference loss of the classifier, and L domain represents the domain difference loss.

[0053] S204: repeat the above steps S201-S203 until the local model reaches an updated preset value or a preset performance.

[0054] According to the model training method, preferably, the feature extractor is composed of a first adversarial residual block, a first average pooling layer, a second adversarial residual block, a second average pooling layer, a third adversarial residual block, a third average pooling layer, a fourth adversarial residual block, a fourth average pooling layer, a feature flattening layer, a first full connection layer, and a second full connection layer connected in sequence; the first adversarial residual block, the second adversarial residual block, the third adversarial residual block, and the fourth adversarial residual block have the same network structure; the multi-classifier comprises two classifiers with the same structure, and each classifier is composed of a first full connection layer, a second full connection layer, and a Softmax activation function layer connected in sequence.

[0055] According to the model training method, preferably, the first adversarial residual block comprises a first residual layer, a second residual layer, and a third residual layer, and the first residual layer, the second residual layer, and the third residual layer have the same structure and are each composed of a convolution layer, a normalization layer, and a ReLU activation function layer connected in sequence; the operation of the first adversarial residual block for feature extraction on input sample data is that: the sample data input to the first adversarial residual block is first subjected to feature extraction by the first residual layer to obtain first sample features; the first sample features are subjected to feature extraction by the second residual layer and the third residual layer after being processed by a shunt coefficient alpha to obtain second sample features and third sample features; and the second sample features and the third sample features are subjected to feature addition and processing with the first sample features processed by the shunt coefficient alpha and the sample data input to the first adversarial residual block after being processed by a balancing coefficient beta, and then output.

[0056] According to the model training method, preferably, after the global model training is completed in step S6, the trained global model needs to be deployed on a target client for task verification.

[0057] The second aspect of the present application provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the network model training method according to the first aspect when executing the computer program.

[0058] The third aspect of the present application provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the network model training method according to the first aspect.

[0059] Compared with the prior art, the present application has the following technical effects:

[0060] (1) The application not only trains a local model according to a diagnostic task for each source client, but also calculates the influence of the complexity of each source client training sample on the network in the task scene, and introduces the concept of sample complexity entropy to design a federal transmission strategy to adapt to the influence of different client sample complexity on the global model, thereby enhancing the ability of the extractor to capture generalized fault feature representation. At the same time, the central server no longer relies on a single indicator to update the parameters of the global model, but introduces artificial experience according to the differences between different clients, constructs an adaptive client evaluation mechanism, and combines artificial experience to update and optimize global parameters, guides global model update iteration, and improves the local model update strategy to retain diagnostic knowledge and avoid catastrophic forgetting. In addition, the updated global model is not directly applied to the target client, but is first downloaded to each source client for local task verification and subsequent network optimization, and the global model is downloaded to the target client for task verification until the training is completed or the required diagnostic performance is achieved.

[0061] (2) The feature extractor of the application introduces an adversarial residual block structure, which autonomously perceives the contribution of the network structure to feature learning, coordinates the structure parameters, and improves the diagnostic performance. BRIEF DESCRIPTION OF DRAWINGS

[0062] Figure 1 The flowchart of the network model training method based on client sample entropy perception and federal transfer learning of the application is shown in the figure;

[0063] Figure 2 The structure diagram of the equipment health state detection model of the application is shown in the figure;

[0064] Figure 3 The network structure diagram of the feature extractor in the equipment health state detection model of the application is shown in the figure;

[0065] Figure 4 The structure diagram of the adversarial residual block in the feature extractor of the application is shown in the figure. DETAILED DESCRIPTION

[0066] The following detailed description is exemplary and is intended to provide further explanation of the application. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the application belongs.

[0067] It should be noted that the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit the exemplary embodiments according to the application. As used herein, the singular form is intended to include the plural form unless the context clearly indicates otherwise, and furthermore, it should be understood that when the terms "comprise" and / or "include" are used in the specification, they refer to the presence of a feature, step, operation, component and / or combination thereof.

[0068] In order for those skilled in the art to more clearly understand the technical solutions of the present application, the technical solutions of the present application will be described in detail below with specific embodiments.

[0069] Embodiment 1:

[0070] A network model training method based on client sample entropy perception and federal transfer learning (as shown in Figure 1 The method comprises the following steps:

[0071] S1: The network model to be trained is mounted on a central server and a plurality of source clients respectively, wherein the network model mounted on the central server is denoted as a global model, and the network model mounted on the source clients is denoted as a local model; samples for training the local model are collected, and the collected samples are divided into a training sample set and a verification sample set.

[0072] S2: The training sample set is input into the local model of each source client to train the local model, update the network parameters of the local model, until the local model reaches a preset value or a preset performance, to obtain a trained local model; the verification sample set is used to verify the trained local model of each source client, and a performance coefficient (task verification diagnosis accuracy) of the trained local model for task verification is calculated;

[0073] The performance coefficient of the trained local model for task verification is calculated according to the following formula 1:

[0074]

[0075] In the formula, α i is the performance coefficient of the trained local model of the i th source client, K is the number of source clients, is the task verification accuracy of the trained local model of the i th source client.

[0076] S3: The network parameters of the trained local model in each source client are uploaded to the global model, the global model receives the network parameters of the trained local model from each source client and calculates the complexity entropy of the training sample of each source client, and according to the performance coefficient of the trained local model of each source client and an artificial experience coefficient, the network parameters of the trained local model from each source client are weighted to obtain the network parameters of the global model, and the global model is updated using the network parameters of the global model;

[0077] The network parameters of the trained local model from each source client are weighted to obtain the network parameters of the global model according to the following formula 2:

[0078]

[0079] In the formula, θ global These are the global model network parameters. Let a be the local model network parameters trained on the i-th source client. i Let α be the human experience coefficient for the i-th source client. i Let K be the performance coefficient of the local model after training on the i-th source client, and K be the number of source clients.

[0080] The formulas for calculating the complexity entropy of the training samples for each source client are as follows: Equations 3 and 4:

[0081]

[0082] In the formula, H i Let h be the complexity entropy of the i-th source client sample. i Let be the entropy coefficient of the complexity entropy of the i-th source client sample, and s be the latent pattern class. The number of P(·) is the frequency function, and K is the number of source clients.

[0083] S4: Download the updated global model to each source client. Use a validation sample set to perform task validation on the updated global model downloaded to each source client. Optimize the network parameters of the local model after updating the training based on the validation loss of the updated global model in each source client during the task validation process, thus obtaining the updated local model. Simultaneously, construct the update loss of the global model based on the validation loss of the updated global model in each source client during the task validation process. Use the update loss of the global model to optimize the network parameters of the updated global model in the central server, minimizing the update loss of the global model and preventing it from decreasing further, thus obtaining the updated global model.

[0084] The formula for updating the network parameters of the trained local model based on the validation loss of the updated global model in each source client during the task validation process is shown in Equation 5 below:

[0085]

[0086] λ = 1 / h i Formula 6

[0087] In the formula, L Ci Let θ be the validation loss of the updated global model in the i-th source client, where K is the number of source clients, and θ is the value of θ. global These are the global model network parameters. Let x be the network parameters of the local model trained in the i-th source client. i Let λ represent the validation sample, h be the complexity coefficient, and λ be the complexity coefficient. iis the entropy coefficient of the sample complexity entropy of the ith source client;

[0088] The calculation formula of the update loss of the global model is as follows:

[0089]

[0090] In the formula, L Update is the update loss of the global model, L Ci is the validation loss of the updated global model in the ith source client, K is the number of source clients, a i is the artificial experience coefficient of the ith source client.

[0091] S5: downloading the updated global model obtained in step S4 to each source client, performing task validation on the updated global model downloaded to each source client using the validation sample set, and after the task validation is completed, updating the network parameters of the updated trained local model according to the task validation performance of the updated trained local model and the updated global model in each source client;

[0092] The calculation formula of the network parameters of the updated trained local model according to the performance of the updated trained local model and the updated global model in each source client is as follows:

[0093]

[0094] λ = 1 / h i

[0095] In the formula, A local is the task validation accuracy of the updated trained local model, A global is the task validation accuracy of the updated global model, θ client represents the network parameters of the updated trained local model in the source client, θ global represents the network parameters of the updated global model, λ is the complexity coefficient, h i is the entropy coefficient of the sample complexity entropy of the ith source client, θ' client is the updated local model parameter in the source client.

[0096] S6: repeating the above steps S2-S5 until the global model reaches the update preset value or the preset performance, and completing the global model training. After the global model training is completed, the trained global model needs to be deployed to the target client for task validation.

[0097] In the above step S1, the network model to be trained can be any model that needs to be trained, as long as the model is mounted in the central server and the plurality of source clients according to the training method described in the above steps S1-S6. The training of the network model can be realized.

[0098] As one of the embodiments, the network model is a device health state detection model, which (as shown in Figure 2 is composed of a feature extractor for feature extraction of sample data input into the network model and a multi-classifier for processing features extracted by the feature extractor to obtain a predicted health state classification of the device, the multi-classifier including two classifiers of the same structure. Wherein, the feature extractor (as shown in Figure 3 is composed of a first adversarial residual block, a first average pooling layer, a second adversarial residual block, a second average pooling layer, a third adversarial residual block, a third average pooling layer, a fourth adversarial residual block, a fourth average pooling layer, a feature flattening layer, a first full connection layer, and a second full connection layer connected in sequence; the first adversarial residual block, the second adversarial residual block, the third adversarial residual block, and the fourth adversarial residual block have the same network structure; the multi-classifier includes two classifiers of the same structure, and each classifier is composed of a first full connection layer, a second full connection layer, and a Softmax activation function layer connected in sequence. The first adversarial residual block (as shown in Figure 4 includes a first residual layer, a second residual layer, and a third residual layer, which have the same structure and are each composed of a convolutional layer, a normalization layer, and a ReLU activation function layer connected in sequence; the first adversarial residual block performs feature extraction on input sample data as follows: the sample data input into the first adversarial residual block is first subjected to feature extraction by the first residual layer to obtain first sample features; the first sample features are processed by a shunt coefficient a and then input into the second residual layer and the third residual layer for feature extraction to obtain second sample features and third sample features, which are processed by a balancing coefficient β and then subjected to feature addition with the first sample features processed by the shunt coefficient a and the sample data input into the first adversarial residual block, and then output. Further, the device health state detection model is a device health state detection model for detecting the health state of a bearing, and the training sample for training the model includes a vibration signal of the bearing and a health state corresponding to the bearing.

[0099] In the step S2, the training sample set is input into the local model of each source client to train the local model, update the local model, until the local model reaches a preset update value or a preset performance.

[0100] S201: input a training sample in the training sample set into the local model, perform feature extraction on the training sample by using the feature extractor, then process the features extracted by the feature extractor by using the multi-classifier to obtain a predicted health state of the equipment corresponding to the training sample, construct a loss function L1 based on the domain difference loss and the classification loss of the classifier according to the predicted health state of the equipment and the real health state, and adjust the network parameters of the local model by using the back propagation algorithm according to the loss function L1, so that the loss function L1 is in a stable state and no longer decreases; wherein, the calculation formulas of the domain difference loss, the classification loss of the classifier and the loss function L1 are as follows:

[0101]

[0102] L classity =∑p(y pre )log(1 / p(y real ))

[0103]

[0104] In the formula, p(y pre ) represents a probability set of the predicted health state classification of the equipment corresponding to the training sample output by the classifier, p(y real ) represents a set of the real health state classification of the equipment corresponding to the training sample, Π(p1, p2) is a set of all joint distributions between the distributions p1 and p2, E represents expectation, x and y represent samples in two distributions, (x, y) ~ γ represents a joint distribution requirement that x and y conform to γ, δ1 is a training hyperparameter, L classity1 represents the classification loss given by the first classifier, L classity2 represents the classification loss given by the second classifier, * represents a multiplication operation, represents the minimization of the parameters of the feature extractor, the classifier 1 and the classifier 2, L domain represents the domain difference loss.

[0105] S202: input a training sample in the training sample set into the local model, perform feature extraction on the training sample by using the feature extractor, then input the features extracted by the feature extractor into two classifiers of the multi-classifier to obtain two predicted health states of the training sample, construct a loss function L2 based on the classification loss of the two classifiers and the difference loss of the output, and adjust the network parameters of the multi-classifier in the local model by using the back propagation algorithm according to the loss function L2, so that the loss function L1 is in a stable state and no longer decreases, wherein the network parameters of the feature extractor are frozen while the network parameters of the multi-classifier in the local model are adjusted;

[0106] In the formula, the calculation formulas of the difference loss of the classifier and the loss function L2 are as follows:

[0107]

[0108] where δ2 is a training hyper-parameter; M is the number of device health state categories; P 1m ,P 2m respectively represent the probability of the first classifier and the second classifier classifying the sample device health state into category m, L classity1 represents the classification loss given by the first classifier, L classity2 represents the classification loss given by the second classifier, L ClassDis is the classifier difference loss.

[0109] S203: input the training sample in the training sample set into the local model, extract features of the training sample by using the feature extractor, then input the features extracted by the feature extractor into two classifiers of the multi-classifier to obtain two predicted health states of the training sample, construct a loss function L3 based on the domain difference loss and the difference loss output by the classifier, and adjust the network parameters of the feature extractor in the local model by using a back propagation algorithm according to the loss function L3, so that the loss function L3 is in a stable state and no longer decreases, wherein the network parameters of the multi-classifier are frozen while the network parameters of the feature extractor in the local model are adjusted;

[0110] where the calculation formula of the loss function L3 is as follows:

[0111]

[0112] where δ3 and δ4 are training hyper-parameters, L ClassDis is the classifier difference loss, L domain represents the domain difference loss;

[0113] S204: repeat the above steps S201-S203 until the local model reaches an updated preset value or a preset performance.

[0114] In the above step S3, the specificity measurement process of the complexity entropy perception of the training sample of each source client is as follows:

[0115] For the original sample of the source client, we first use the normal cumulative distribution function and normalization to map the original sequence to the range of 0 to 1. Then, assuming that the class c is introduced, the y(i) is adjusted to an integer between [1, c] by rounding, and the specific formula is shown in the following formula 9:

[0116]

[0117] In formula 9, round represents a rounding function, c is a set introduction class parameter, r(i) is an unrounded function, z(i) is a rounding function, and y(i) represents an input. After rounding the mapping, a new sequence Z is obtainedc = {z(i), i = 1, 2,..., N}.

[0118] Subsequently, the sequence Zc is reconstructed into a plurality of sub-sequences As shown in equation 10:

[0119]

[0120] In equation 10, l is the embedding dimension. c is the introduced class parameter set, N represents the length of the entire sequence; τ is the delay, when set to 1, most of the effective information can be retained. Therefore, the value of τ is set to 1 in this study.

[0121] After the above processing, the corresponding non-rounded sub-sequences with the same dispersion pattern in each sub-sequence are identified, and the mean value of each element in the non-rounded sub-sequence is calculated according to equation 11.

[0122]

[0123] In equation 11, is the mean value pattern under the i-th element.

[0124] According to the concept of secondary division, the non-rounded elements are compared with the calculated mean value under the same fault category. Each element is re-divided according to the standard shown in equation 12:

[0125]

[0126] In equation 12, is the mean value pattern under the i-th element, r(i) is the non-rounded function.

[0127] Therefore, in the above equation 3, is the frequency corresponding to each pattern, and its expression is shown in equation 13:

[0128]

[0129] In equation 13, is the number of dispersion patterns, is the frequency corresponding to each pattern, τ is the delay, l is the embedding dimension, and N represents the length of the entire sequence.

[0130] Further, the normalization expression of the above equation 3 is shown in equation 14:

[0131]

[0132] In equation 13, H i is the sample complexity entropy of the i-th client, wherein H is the normalized sample complexity entropy, l is the embedding dimension, and c is the introduced class parameter.

[0133] Embodiment 2

[0134] An electronic device, comprising a memory and a processor, the memory stores a computer program, and the processor implements the network model training method as described in Embodiment 1 when executing the computer program.

[0135] Embodiment 3

[0136] A computer readable storage medium, the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the network model training method as described in Embodiment 1.

[0137] Finally, it should be noted that: the above embodiments are only the preferred embodiments of the present application, not other forms of limitations of the present application, any skilled in the art may use the above technical content as inspiration to change or modify. The equivalent embodiments of such equivalent changes. However, any simple modification, equivalent change and modification made according to the technical essence of the present application without departing from the technical concept of the present application, still belongs to the protection scope of the claims of the present application.

Claims

1. A network model training method based on client sample entropy perception and federated transfer learning, characterized in that, The method comprises the following steps: S1: the network model to be trained is respectively carried in the central server and the plurality of source clients, wherein the network model carried in the central server is recorded as a global model, and the network model carried in the source client is recorded as a local model; samples for training the local model are collected, and the collected samples are divided into a training sample set and a verification sample set; S2: the training sample set is input into the local model of each source client to train the local model, the network parameters of the local model are updated, until the local model reaches a preset update value or a preset performance, to obtain a trained local model; the verification sample set is used to verify the trained local model of each source client, and a performance coefficient of the trained local model for task verification is calculated; Wherein, the calculation formula of the performance coefficient of the trained local model for task verification is as follows: In the formula, α i is the performance coefficient of the local model trained by the i th source client, K is the number of source clients, is the task verification accuracy of the local model trained by the i th source client. S3: the network parameters of the trained local model in each source client are uploaded to the global model, the global model receives the network parameters of the trained local model from each source client and calculates the complexity entropy of the training sample of each source client, and the network parameters of the trained local model from each source client are weighted and calculated according to the performance coefficient of the trained local model of each source client and the artificial experience coefficient to obtain the network parameters of the global model, and the network parameters of the global model are used to update the global model; S4: the updated global model is downloaded to each source client, the verification sample set is used to verify the updated global model downloaded to each source client, the network parameters of the trained local model are optimized according to the verification loss of the updated global model in each source client in the task verification process, to obtain an updated trained local model; meanwhile, the update loss of the global model is constructed according to the verification loss of the updated global model in each source client in the task verification process, and the network parameters of the updated global model in the central server are optimized by using the update loss of the global model, so that the update loss of the global model reaches the minimum and no longer decreases, to obtain an updated global model; S5: the updated global model obtained in step S4 is downloaded to each source client, the verification sample set is used to verify the updated global model downloaded to each source client, and after the task verification is completed, the network parameters of the updated trained local model are updated according to the task verification performance of the updated trained local model and the updated global model in each source client; S6: the steps S2-S5 are repeated until the global model reaches the preset update value or the preset performance, and the global model training is completed; In step S3, the calculation formula of the network parameters of the global model obtained by weighting and calculating the network parameters of the trained local model from each source client is as follows: In the formula, θ global is a global model network parameter, is the local model network parameter of the i th source client after training, a i is the artificial experience coefficient of the i th source client, α i is the performance coefficient of the i th source client after training, and K is the number of source clients. In step S3, the calculation formula of the complexity entropy of the training sample of each source client is as follows: where H i is the complexity entropy of the i-th source client sample, h i is the entropy coefficient of the i-th source client sample complexity entropy, s is the number of potential pattern classes P(·) is the frequency function, and K is the number of source clients. In step S4, the formula for optimizing the network parameters of the updated trained local model according to the verification loss of the updated global model in each source client in the task verification process is as follows: λ = 1 / h i In the formula, L Ci is the validation loss of the updated global model in the ith source client, K is the number of source clients, θ global is the network parameter of the global model, is the network parameter of the local model after training in the ith source client, x i represents the validation sample, λ is the complexity coefficient, h i is the entropy coefficient of the sample complexity entropy of the ith source client; the calculation formula of the update loss of the global model is as follows: In the formula, L Update is the update loss of the global model, L Ci is the validation loss of the updated global model in the i-th source client, K is the number of source clients, a i is the artificial experience coefficient of the i-th source client.

2. The model training method of claim 1, wherein, In step S5, the calculation formula of the network parameters of the updated trained local model is updated according to the task verification performance of the updated global model. θ' client = λ · (A global / A) · θ global + (1 - λ) · (A local / A) · θ client A = (1 - λ) · A local + λ · A global λ = 1 / h i In the formula, A local is the task validation accuracy of the updated trained local model, A global is the task validation accuracy of the updated global model, θ client represents the network parameters of the updated trained local model in the source client, θ global represents the network parameters of the updated global model, λ is a complexity coefficient, h i is the entropy coefficient of the i-th source client sample complexity entropy, θ' client is the updated local model parameter in the source client. 3.The model training method of claim 1 or 2, wherein, The network model is a device health state detection model, the device health state detection model is composed of a feature extractor and a multi-classifier, the feature extractor is used for feature extraction of sample data input into the network model, and the multi-classifier is used for processing the features extracted by the feature extractor to obtain a predicted health state classification of the device, and the multi-classifier includes two classifiers with the same structure.

4. The model training method of claim 3, wherein, In step S2, the training sample set is input into the local model of each source client to train the local model, and the network parameters of the local model are updated until the local model reaches the update preset value or the preset performance. S201: input the training sample in the training sample set into the local model, use the feature extractor to extract features of the training sample, then use the multi-classifier to process the features extracted by the feature extractor to obtain a predicted health state of the device corresponding to the training sample, and based on the domain difference loss and the classification loss of the classifier, a loss function L1 is constructed according to the predicted health state and the real health state of the device, and the network parameters of the local model are adjusted by using the back propagation algorithm according to the loss function L1, so that the loss function L1 is in a stable state and no longer decreases; wherein, the calculation formulas of the domain difference loss, the classification loss of the classifier and the loss function L1 are as follows: L classity =∑p(y pre )log(1 / p(y real )) where p(y pre ) represents the set of probabilities that the classifier outputs the health state classification of the device corresponding to the training sample, p(y real ) represents the set of probabilities that the true health state classification of the device corresponding to the training sample, Π(p1,p2) is the set of all joint distributions between distributions p1 and p2, E represents the expectation, x and y represent the samples in the two distributions, (x,y) ~ γ represents the joint distribution requirement that x and y obey γ, δ1 is a training hyperparameter, L classity1 represents the classification loss given by the first classifier, L classity2 represents the classification loss given by the second classifier, * represents the multiplication operation, represents the minimization of the parameters of the feature extractor, the first classifier and the second classifier, L domain represents the domain difference loss; S202: input the training sample in the training sample set into the local model, use the feature extractor to extract features of the training sample, then input the features extracted by the feature extractor into the two classifiers of the multi-classifier to obtain two predicted health states of the training sample, and based on the classification loss of the two classifiers and the difference loss of the output, a loss function L2 is constructed, and the network parameters of the multi-classifier in the local model are adjusted by using the back propagation algorithm according to the loss function L2, so that the loss function L2 is in a stable state and no longer decreases, wherein the network parameters of the feature extractor are frozen while adjusting the network parameters of the multi-classifier in the local model; Wherein, the calculation formulas of the difference loss of the classifier and the loss function L2 are as follows: wherein, δ2 is a training hyper-parameter; M is the number of device health status categories; P 1m 2m respectively represent the probability of the first classifier and the second classifier classifying the sample device health status into category m, L classity1 represents the classification loss given by the first classifier, L classity2 represents the classification loss given by the second classifier, L ClassDis is the classifier difference loss;​ S203: input the training sample in the training sample set into the local model, use the feature extractor to extract features of the training sample, then input the features extracted by the feature extractor into the two classifiers of the multi-classifier to obtain two predicted health states of the training sample, and based on the domain difference loss and the difference loss of the output of the classifier, a loss function L3 is constructed, and the network parameters of the feature extractor in the local model are adjusted by using the back propagation algorithm according to the loss function L3, so that the loss function L3 is in a stable state and no longer decreases, wherein the network parameters of the multi-classifier are frozen while adjusting the network parameters of the feature extractor in the local model; Wherein, the calculation formula of the loss function L3 is as follows: where δ3 and δ4 are training hyperparameters, L ClassDis is the classifier difference loss, L domain denotes the domain difference loss; S204: repeat the above steps S201-S203 until the local model reaches the update preset value or the preset performance.

5. The model training method of claim 4, wherein, The feature extractor is composed of a first adversarial residual block, a first average pooling layer, a second adversarial residual block, a second average pooling layer, a third adversarial residual block, a third average pooling layer, a fourth adversarial residual block, a fourth average pooling layer, a feature flattening layer, a first full connection layer, and a second full connection layer connected in sequence; the first adversarial residual block, the second adversarial residual block, the third adversarial residual block, and the fourth adversarial residual block have the same network structure; the multi-classifier comprises two classifiers with the same structure, and each classifier is composed of a first full connection layer, a second full connection layer, and a Softmax activation function layer connected in sequence.

6. The model training method of claim 5, wherein, The first adversarial residual block comprises a first residual layer, a second residual layer, and a third residual layer, and the first residual layer, the second residual layer, and the third residual layer have the same structure and are each composed of a convolution layer, a normalization layer, and a ReLU activation function layer connected in sequence; the operation of the first adversarial residual block for feature extraction of input sample data is as follows: the sample data input into the first adversarial residual block is first subjected to feature extraction by the first residual layer to obtain first sample features; the first sample features are subjected to feature extraction by the second residual layer and the third residual layer after being processed by a shunt coefficient a, to obtain second sample features and third sample features; and the second sample features and the third sample features are subjected to feature addition and processing with the first sample features processed by the shunt coefficient a and the sample data input into the first adversarial residual block after being processed by a balancing coefficient β, and are then output.

7. An electronic device comprising a memory and a processor, characterized in that The memory stores a computer program, and the processor implements the network model training method according to any one of claims 1-6 when executing the computer program.

8. A computer-readable storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to implement the network model training method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Federal learning method and device based on client classification and information entropy

    CN114723071A

  • Intelligent logistics trolley data sharing and privacy protection method based on alliance chain

    CN118433191A