Network model training method based on client sample entropy perception and federal transfer learning
By adopting client sample entropy awareness and federated transfer learning methods in industrial equipment fault diagnosis, the cross-device data differences and client data privacy protection are solved, and more accurate and stable fault diagnosis and knowledge transmission are achieved.
Patent Information
- Application Number
- CN202411192991.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-08-28
AI Technical Summary
The prior art has problems of diagnostic performance degradation and parameter deviation caused by data differences across equipment in industrial equipment fault diagnosis, especially under the challenges of multi-source domain adaptation and customer data privacy protection, making it difficult to effectively transfer knowledge and model updates.
Using a network model training method based on client sample entropy awareness and federated transfer learning, the sample complexity entropy calculation and weighted update are performed between the central server and multiple source clients, and the global model parameters are optimized in combination with manual experience to ensure diagnostic knowledge. accurate transmission and generalization ability.
It enhances the ability to represent equipment failure characteristics, avoids disaster forgetting, improves diagnostic performance, and realizes effective knowledge migration and stable model updates without directly accessing client data.
Smart Images

Figure CN119250130A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer deep learning and cross-device fault diagnosis, and in particular to a network model training method based on client sample entropy perception and federated transfer learning. Background Art
[0002] With the continuous development of digital industry, data-driven deep learning neural networks have gradually replaced 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 been developed at an unprecedented speed and are widely used in automotive automation, intelligent manufacturing, aerospace and other fields. It is worth noting that as the scope expands, diagnostic methods that rely on independent and identically distributed (iid) data collected in laboratories have exposed their fragility. This situation stems from the scarcity of data and the low failure rate in industrial environments. Users often use relevant data in the laboratory for analysis and training. Unfortunately, this practice generates a large number of different data samples, misleading the training trajectory of the network, resulting in a decrease in diagnostic performance.
[0003] To address the above problems, transfer learning (TL) provides a feasible approach to solve the cross-domain diagnosis challenge. TL attempts to reduce the impact on the network by narrowing the distance between samples in different distributions, and sharing the diagnostic knowledge obtained from labeled source domain samples to the unknown target domain. Recently, Ma et al. introduced a meta-learning method containing multi-scale dilated convolutions and related modules to address 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. designed domain generalization networks from two directions, causal and physical drivers, and class- and domain-based dual prototype losses, respectively, to learn domain-invariant features, and proved the effectiveness of the strategy. Although the TL strategy can effectively enable the trained network to produce satisfactory diagnostic results, the enhanced domain adaptation performance still cannot get rid of the data dependence on highly similar devices.
[0004] Considering that diagnostic knowledge from a single source domain usually cannot provide sufficient and highly similar diagnostic insights for the target task, it leads to 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 promote the transfer of knowledge across multiple domains. Liu et al. proposed a deep multi-source adversarial difference matching adaptive network to dynamically align feature distributions between different domains. Yu et al. proposed a domain attribute feature transfer network to obtain more reliable target diagnosis results by extracting transferable latent features from multi-source data. Many scholars have also proposed effective solutions to the problem of multi-source domain adaptation from different perspectives. However, the current research on multi-source domain adaptation is relatively limited, and aligning the distributions of all domains at the same time 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 relevance to 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 the source domain to the target domain without directly accessing client data, showing great potential. Li et al. proposed an adaptive prediction alignment scheme on the target client to achieve 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 distributions. Wang et al. and Zhou et al. studied global model updating and knowledge sharing methods from multiple perspectives. In summary, FL shows good results in equipment fault diagnosis. However, there are still some challenges in practical applications, which need further research.
[0006] Although the difference in sample complexity between source customers will directly lead to parameter deviation and negative transfer of diagnostic knowledge, this problem has rarely been addressed in related research. Once the global model has parameter drift, its transfer performance and generalization ability cannot be guaranteed. Therefore, it is necessary to study the impact of training sample complexity entropy on the network in cross-machine industrial scenarios. Summary of the invention
[0008] In view of the problems and shortcomings in the prior art, the purpose of the present invention 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 invention, the technical solution adopted by the present invention is as follows:
[0010] A first aspect of the present invention provides a network model training method based on client sample entropy perception and federated transfer learning, comprising the following steps:
[0011] S1: The network model to be trained is loaded on the central server and multiple source clients respectively, wherein the network model loaded on the central server is recorded as the global model, and the network model loaded on the source client is recorded as the local model; samples for local model training are collected, and the collected samples are divided into a training sample set and a verification sample set;
[0012] S2: Input the training sample set 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 updated preset value or preset performance, and obtain the trained local model; use the verification sample set to perform task verification on the trained local model of each source client, and calculate the performance coefficient (task verification diagnostic accuracy) of the trained local model for task verification;
[0013] Among them, 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 local model after training the i-th source client, K is the number of source clients, Verify the task accuracy of the local model trained for the i-th source client;
[0016] S3: Upload the network parameters of the trained local model in each source client 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 samples of each source client. According to the performance coefficient and the artificial experience coefficient of the trained local model of each source client, the network parameters of the trained local model from each source client are weightedly calculated to obtain the global model network parameters, and the global model network parameters are used to update the global model.
[0017] S4: Download the updated global model to each source client, use the verification sample set to perform task verification on the updated global model downloaded to each source client, optimize the network parameters of the updated trained local model according to the verification loss of the updated global model in each source client during the task verification process, and obtain the updated trained local model; at the same time, construct the update loss of the global model according to the verification loss of the updated global model in each source client during the task verification process, and use the update loss of the global model to optimize the network parameters of the updated global model in the central server, so that the update loss of the global model is minimized and no longer decreases, and obtain the updated global model;
[0018] S5: Download the updated global model obtained in step S4 to each source client, use the verification sample set to perform task verification on the updated global model downloaded to each source client, and after the task verification is completed, update 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: Repeat the above steps S2-S5 until the global model reaches the updated preset value or preset performance, and the global model training is completed.
[0020] According to the above-mentioned model training method, preferably, in step S3, the network parameters of the local model after training from each source client are weightedly calculated to obtain the calculation formula of the global model network parameters:
[0021]
[0022] In the formula, θ global are global model network parameters, is the local model network parameter after training for the i-th source client, a i is the artificial experience coefficient of the i-th source client, α i is the performance coefficient of the local model after training the i-th source client, 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] In the formula, 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, and s is the potential pattern class , P(·) is the frequency function, and K is the number of source clients.
[0026] According to the above-mentioned 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 during the task verification process is as follows:
[0027]
[0028] λ=1 / h i
[0029] Where, L Ci is the validation loss of the updated global model in the i-th source client, K is the number of source clients, θglobal are global model network parameters, is the network parameter of the local model after training in the i-th source client, x i represents the verification sample, λ is the complexity coefficient, h i is the entropy coefficient of the complexity entropy of the i-th source client sample;
[0030] The update loss of the global model is calculated as follows:
[0031]
[0032] Where, 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, and a i is the artificial experience coefficient of the i-th source client.
[0033] According to the above-mentioned model training method, preferably, in step S5, the calculation formula for updating 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:
[0034] θ c ' lient =λ·(A global / A)·θ global +(1-λ)·(A local / A)·θ client
[0035] A=(1-λ)·A local +λ·A global
[0036] λ=1 / h i
[0037] In the formula, A local is the task verification accuracy of the updated trained local model, A global is the task verification accuracy for updating the global model, θ client represents the updated trained local model network parameters in the source client, θ global represents updating the global model network parameters, λ is the complexity coefficient, h i is the entropy coefficient of the complexity entropy of the i-th source client sample, θ′ client The updated local model parameters in the source client.
[0038] According to the above-mentioned model training method, preferably, the network model is an equipment health status detection model, and the equipment health status detection model is composed of a feature extractor and a multi-classifier. The feature extractor is used to extract features from sample data input into the network model, and the multi-classifier is used to process the features extracted by the feature extractor to obtain a predicted health status classification of the equipment, and the multi-classifier includes two classifiers with the same structure.
[0039] According to the above-mentioned model training method, preferably, in step S2, the specific operation of inputting the training sample set into the local model of each source client to train the local model and update the local model until the local model reaches the updated preset value or preset performance is:
[0040] S201: input the training samples in the training sample set into the local model, use the feature extractor to extract features from the training samples, then use a multi-classifier to process the features extracted by the feature extractor to obtain the predicted health status of the equipment corresponding to the training samples, and construct a loss function L1 based on the predicted health status and the actual health status of the equipment based on the domain difference loss and the classification loss of the classifier, and adjust the network parameters of the local model based on the loss function L1 using the back propagation algorithm, 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:
[0041]
[0042] L classity =∑p(y pre )log(1 / p(y real ))
[0043]
[0044] In the formula, p(y pre ) represents the probability set of the equipment predicted health status classification corresponding to the training samples output by the classifier, p(y real ) represents the set of real health status classifications of the equipment corresponding to the training samples, Π(p1,p2) is the set of all joint distributions between distributions p1 and p2, E represents the expectation, x and y represent samples in the two distributions, (x,y)~γ represents the joint distribution requirement that x and y obey γ, δ1 is the training hyperparameter, and L classity1 represents the classification loss given by the first classifier, L classity2 represents the classification loss given by the second classifier, * represents the product operation, represents the minimization of the parameters of the feature extractor, classifier 1 and classifier 2, L domain Represents domain difference loss;
[0045] S202: inputting the training samples in the training sample set into the local model, extracting features from the training samples using the feature extractor, and then inputting the features extracted by the feature extractor into two classifiers of the multi-classifier to obtain two predicted health states of the training samples, constructing a loss function L2 based on the classification loss of the two classifiers and the difference loss of the outputs, and adjusting the network parameters of the multi-classifier in the local model using the back propagation algorithm according to the loss function L2, so that the loss function L1 is in a stable state and does not decrease any more, wherein the network parameters of the feature extractor are frozen while adjusting the network parameters of the multi-classifier in the local model;
[0046] Among them, the calculation formula of the classifier's difference loss and loss function L2 is as follows:
[0047]
[0048] Where δ2 is the training hyperparameter; M is the number of equipment health status categories; P 1m ,P 2m They represent the probability that the first classifier and the second classifier classify the health status of the sample device 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, L ClassDis is the classifier difference loss;
[0049] S203: inputting the training samples in the training sample set into the local model, extracting features from the training samples using the feature extractor, and then inputting the features extracted by the feature extractor into two classifiers of the multi-classifier to obtain two predicted health states of the training samples, constructing a loss function L3 based on the domain difference loss and the difference loss of the classifier outputs, and adjusting the network parameters of the feature extractor in the local model using the back propagation algorithm according to the loss function L3, so that the loss function L3 is in a stable state and does not decrease any more, wherein the network parameters of the multi-classifier are frozen while adjusting the network parameters of the feature extractor in the local model;
[0050] Among them, the calculation formula of the loss function L3 is as follows:
[0051]
[0052] Where δ3 and δ4 are training hyperparameters, L ClassDis is the classifier difference loss, L domain represents domain difference loss;
[0053] S204: Repeat the above steps S201-S203 until the local model reaches the updated preset value or preset performance.
[0054] According to the above-mentioned 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 fully connected layer, and a second fully connected layer connected in sequence; the network structure of the first adversarial residual block, the second adversarial residual block, the third adversarial residual block, and the fourth adversarial residual block is the same; the multi-classifier includes two classifiers with the same structure, and the classifier is composed of a first fully connected layer, a second fully connected layer and a Softmax activation function layer connected in sequence.
[0055] According to the above-mentioned model training method, preferably, the first adversarial residual block includes 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 all composed of a convolutional layer, a normalization layer and a ReLU activation function layer connected in sequence; the operation of the first adversarial residual block to extract features on the input sample data is as follows: the sample data input to the first adversarial residual block is first subjected to feature extraction by the first residual layer to obtain the first sample feature; the first sample feature is processed by the shunting coefficient α and then input into the second residual layer and the third residual layer for feature extraction to obtain the second sample feature and the third sample feature; the second sample feature and the third sample feature are respectively processed by the balancing coefficient β and the first sample feature processed by the shunting coefficient α, and the input sample data of the first adversarial residual block are subjected to feature addition processing and then output. The operation of the first adversarial residual block to extract features on the input sample data
[0056] According to the above-mentioned model training method, preferably, after completing the global model training in step S6, the trained global model needs to be deployed to the target client for task verification.
[0057] A second aspect of the present invention 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 as described in the first aspect when executing the computer program.
[0058] The third aspect of the present invention provides a computer-readable storage medium, on which a computer program is stored, and it is characterized in that when the computer program is executed by a processor, the network model training method described in the first aspect above is implemented.
[0059] Compared with the prior art, the technical effects achieved by the present invention are as follows:
[0060] (1) In the present invention, each source client not only trains a local model according to the diagnostic task, but also calculates the task scenario, taking into account the impact of the complexity of each source client's training samples on the network, and introduces the concept of sample complexity entropy to design a federated transmission strategy to adapt to the impact of different client sample complexities on the global model, thereby enhancing the extractor's ability to capture generalized fault feature representations; at the same time, the central server no longer relies solely on a single indicator to update the parameters of the global model, but introduces artificial experience based on the differences between different clients, constructs an adaptive client evaluation mechanism, and combines artificial experience to update and optimize global parameters, guide the global model update iteration, and improves the local model update strategy to retain diagnostic knowledge and avoid disaster 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 present invention introduces an adversarial residual block structure, which autonomously perceives the contribution of the network structure to feature learning, coordinates structural parameters, and improves diagnostic performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 It is a flow chart of a network model training method based on client sample entropy perception and federated transfer learning of the present invention;
[0063] Figure 2 It is a structural schematic diagram of the equipment health status detection model of the present invention;
[0064] Figure 3 A schematic diagram of the network structure of a feature extractor in the device health status detection model of the present invention;
[0065] Figure 4 Schematic diagram of the structure of the adversarial residual block in the feature extractor of the present invention. DETAILED DESCRIPTION
[0066] The following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0067] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, components and / or combinations thereof.
[0068] In order to enable those skilled in the art to more clearly understand the technical solution of the present invention, the technical solution of the present invention will be described in detail below in conjunction with specific embodiments.
[0069] Embodiment 1:
[0070] A network model training method based on client sample entropy perception and federated transfer learning (such as Figure 1 As shown), comprising the following steps:
[0071] S1: The network model to be trained is installed in a central server and multiple source clients respectively, wherein the network model installed in the central server is recorded as a global model, and the network model installed in the source client is recorded as a local model; samples are collected for local model training, and the collected samples are divided into a training sample set and a verification sample set.
[0072] S2: Input the training sample set 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 updated preset value or preset performance, and obtain the trained local model; use the verification sample set to perform task verification on the trained local model of each source client, and calculate the performance coefficient (task verification diagnostic accuracy) of the trained local model for task verification;
[0073] Among them, the calculation formula of the performance coefficient of the trained local model for task verification is shown in Formula 1:
[0074]
[0075] In the formula, α i is the performance coefficient of the local model after training the i-th source client, K is the number of source clients, Task verification accuracy of the local model trained for the i-th source client.
[0076] S3: Upload the network parameters of the trained local model in each source client 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 samples of each source client. According to the performance coefficient and the artificial experience coefficient of the trained local model of each source client, the network parameters of the trained local model from each source client are weightedly calculated to obtain the global model network parameters, and the global model network parameters are used to update the global model.
[0077] Among them, the network parameters of the local model after training from each source client are weighted and calculated to obtain the calculation formula of the global model network parameters as shown in Formula 2:
[0078]
[0079] In the formula, θ global are global model network parameters, is the local model network parameter after training for the i-th source client, a i is the artificial experience coefficient of the i-th source client, α i is the performance coefficient of the local model after training the i-th source client, and K is the number of source clients;
[0080] The calculation formula of the complexity entropy of the training sample of each source client is as follows:
[0081]
[0082] In the formula, 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, and s is the potential pattern class , 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 the verification sample set to perform task verification on the updated global model downloaded to each source client, optimize the network parameters of the updated trained local model according to the verification loss of the updated global model in each source client during the task verification process, and obtain the updated trained local model; at the same time, construct the update loss of the global model according to the verification loss of the updated global model in each source client during the task verification process, and use the update loss of the global model to optimize the network parameters of the updated global model in the central server, so that the update loss of the global model is minimized and no longer decreases, and obtain the updated global model;
[0084] Among them, 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 during the task verification process is shown in the following formula 5:
[0085]
[0086] λ=1 / h i Formula 6
[0087] Where, L Ci is the validation loss of the updated global model in the i-th source client, K is the number of source clients, θ global are global model network parameters, is the network parameter of the local model after training in the i-th source client, x i represents the verification sample, λ is the complexity coefficient, h iis the entropy coefficient of the complexity entropy of the i-th source client sample;
[0088] The calculation formula of the update loss of the global model is as follows:
[0089]
[0090] Where, 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, and a i is the artificial experience coefficient of the i-th source client.
[0091] S5: Download the updated global model obtained in step S4 to each source client, use the verification sample set to perform task verification on the updated global model downloaded to each source client, and after the task verification is completed, update 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;
[0092] The calculation formula for updating 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] In the formula, A local is the task verification accuracy of the updated trained local model, A global is the task verification accuracy for updating the global model, θ client represents the updated trained local model network parameters in the source client, θ global represents updating the global model network parameters, λ is the complexity coefficient, h i is the entropy coefficient of the complexity entropy of the i-th source client sample, θ c ' lient The updated local model parameters in the source client.
[0095] S6: Repeat the above steps S2-S5 until the global model reaches the updated preset value or preset performance, and the global model training is completed. After the global model training is completed, the trained global model needs to be deployed to the target client for task verification.
[0096] 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 installed in the central server and multiple source clients respectively, the training of the network model can be achieved according to the training method described in the above steps S1-S6.
[0097] As one implementation method, the network model is a device health status detection model, and the device health status detection model (such as Figure 2 The network model is composed of a feature extractor and a multi-classifier. The feature extractor is used to extract features from the sample data input into the network model. The multi-classifier is used to process the features extracted by the feature extractor to obtain the predicted health status classification of the equipment. The multi-classifier includes two classifiers with the same structure. 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 fully connected layer, and a second fully connected 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 with the same structure, and the classifier is composed of a first fully connected layer, a second fully connected layer, and a Softmax activation function layer connected in sequence. The first adversarial residual block (as shown in Figure 4 As shown) includes a first residual layer, a second residual layer and a third residual layer. The first residual layer, the second residual layer and the third residual layer have the same structure, and are 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 to extract features from the input sample data is as follows: the sample data of the first adversarial residual block is first subjected to feature extraction by the first residual layer to obtain the first sample feature; the first sample feature is processed by the shunt coefficient α and then respectively input into the second residual layer and the third residual layer for feature extraction to obtain the second sample feature and the third sample feature; the second sample feature and the third sample feature are respectively processed by the balance coefficient β and the first sample feature processed by the shunt coefficient α, and the sample data of the first adversarial residual block are subjected to feature addition processing and then output. Furthermore, the equipment health status detection model is an equipment health status detection model for detecting the health status of a bearing, and the training samples used for training the model include the vibration signal of the bearing and the corresponding health status of the bearing.
[0098] In the above step S2, the specific operation of inputting the training sample set into the local model of each source client to train the local model and update the local model until the local model reaches the updated preset value or preset performance is:
[0099] S201: input the training samples in the training sample set into the local model, use the feature extractor to extract features from the training samples, then use a multi-classifier to process the features extracted by the feature extractor to obtain the predicted health status of the equipment corresponding to the training samples, and construct a loss function L1 based on the predicted health status and the actual health status of the equipment based on the domain difference loss and the classification loss of the classifier, and adjust the network parameters of the local model based on the loss function L1 using the back propagation algorithm, 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:
[0100]
[0101] L classity =∑p(y pre )log(1 / p(y real ))
[0102]
[0103] In the formula, p(y pre ) represents the probability set of the equipment predicted health status classification corresponding to the training samples output by the classifier, p(y real ) represents the set of real health status classifications of the equipment corresponding to the training samples, Π(p1,p2) is the set of all joint distributions between distributions p1 and p2, E represents the expectation, x and y represent samples in the two distributions, (x,y)~γ represents the joint distribution requirement that x and y obey γ, δ1 is the training hyperparameter, and L classity1 represents the classification loss given by the first classifier, L classity2 represents the classification loss given by the second classifier, * represents the product operation, represents the minimization of the parameters of the feature extractor, classifier 1 and classifier 2, L domain represents the domain difference loss.
[0104] S202: inputting the training samples in the training sample set into the local model, extracting features from the training samples using the feature extractor, and then inputting the features extracted by the feature extractor into two classifiers of the multi-classifier to obtain two predicted health states of the training samples, constructing a loss function L2 based on the classification loss of the two classifiers and the difference loss of the outputs, and adjusting the network parameters of the multi-classifier in the local model using the back propagation algorithm according to the loss function L2, so that the loss function L1 is in a stable state and does not decrease any more, wherein the network parameters of the feature extractor are frozen while adjusting the network parameters of the multi-classifier in the local model;
[0105] Among them, the calculation formula of the classifier's difference loss and loss function L2 is as follows:
[0106]
[0107] Where δ2 is the training hyperparameter; M is the number of equipment health status categories; P 1m ,P 2m They represent the probability that the first classifier and the second classifier classify the health status of the sample device 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, L ClassDis is the classifier difference loss.
[0108] S203: inputting the training samples in the training sample set into the local model, extracting features from the training samples using the feature extractor, and then inputting the features extracted by the feature extractor into two classifiers of the multi-classifier to obtain two predicted health states of the training samples, constructing a loss function L3 based on the domain difference loss and the difference loss of the classifier outputs, and adjusting the network parameters of the feature extractor in the local model using the back propagation algorithm according to the loss function L3, so that the loss function L3 is in a stable state and does not decrease any more, wherein the network parameters of the multi-classifier are frozen while adjusting the network parameters of the feature extractor in the local model;
[0109] Among them, the calculation formula of the loss function L3 is as follows:
[0110]
[0111] Where δ3 and δ4 are training hyperparameters, L ClassDis is the classifier difference loss, L domain represents domain difference loss;
[0112] S204: Repeat the above steps S201-S203 until the local model reaches the updated preset value or preset performance.
[0113] In the above step S3, the specific measurement process of the complexity entropy perception of the training sample of each source client is as follows:
[0114] For the original samples 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 class c is introduced, the y(i) mapping is adjusted to an integer between [1, c] by rounding. The specific formula is shown in Equation 9 below:
[0115]
[0116] In formula 9, round represents the rounding function, c is the set introduction class parameter, r(i) is the unrounded function, z(i) is the rounding function, and y(i) represents the input. After rounding the mapping, a new sequence Z is obtained.c ={z(i),i=1,2,...,N}.
[0117] Then, the sequence Zc is reconstructed into multiple subsequences As shown in formula 10:
[0118]
[0119] In formula (10), l is the embedding dimension. c is the set introduction class parameter, N is the length of the entire sequence, and τ is the delay. When it is set to 1, most of the effective information can be retained. Therefore, this study sets the value of τ to 1.
[0120] After the above processing, the corresponding non-rounded subsequences with the same diffusion pattern in each subsequence are identified, and the mean value of each element in the non-rounded subsequence is calculated according to formula 11.
[0121]
[0122] In formula 11, is the mean mode The i-th element under .
[0123] Based on the concept of quadratic partitioning, the unrounded elements are compared with the calculated average value under the same fault category. Each element is re-partitioned according to the criteria shown in Equation 12:
[0124]
[0125] In formula 12, is the mean mode The i-th element under , r(i) is the unrounded function.
[0126] Therefore, in the above formula 3, is the frequency corresponding to each mode, and its expression is shown in formula 13:
[0127]
[0128] In formula 13, is the number of dispersion modes, is the frequency corresponding to each mode, τ is the delay, l is the embedding dimension, and N is the length of the entire sequence.
[0129] Furthermore, the normalized expression of the above formula 3 is shown in formula 14:
[0130]
[0131] In formula 13, H i is the sample complexity entropy of the i-th client, is the normalized sample complexity entropy, l is the embedding dimension, and c is the set introduction class parameter.
[0132] Embodiment 2:
[0133] An electronic device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the network model training method as described in Example 1 when executing the computer program.
[0134] Embodiment 3:
[0135] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the network model training method as described in Example 1.
[0136] Finally, it should be noted that the above embodiments are only preferred embodiments of the present invention, and are not intended to limit the present invention in other forms. Any technician familiar with the profession may use the above technical content as inspiration to make changes or modifications. This is an equivalent embodiment of equivalent changes. However, any simple modification, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the technical concept of the present invention still fall within the scope of protection of the claims of the present invention.
Claims
1. A network model training method based on client sample entropy perception and federated transfer learning, characterized in that: The following steps are involved: S1: The network model to be trained is loaded on the central server and multiple source clients respectively, wherein the network model loaded on the central server is recorded as the global model, and the network model loaded on the source client is recorded as the local model; samples for local model training are collected, and the collected samples are divided into a training sample set and a verification sample set; S2: Input the training sample set 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 updated preset value or preset performance, and obtain the trained local model; use the verification sample set to perform task verification on the trained local model of each source client, and calculate the performance coefficient of the trained local model for task verification; Among them, 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 after training the i-th source client, K is the number of source clients, Verify the task accuracy of the local model trained for the i-th source client; S3: Upload the network parameters of the trained local model in each source client 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 samples of each source client. According to the performance coefficient and the artificial experience coefficient of the trained local model of each source client, the network parameters of the trained local model from each source client are weightedly calculated to obtain the global model network parameters, and the global model network parameters are used to update the global model. S4: Download the updated global model to each source client, use the verification sample set to perform task verification on the updated global model downloaded to each source client, optimize the network parameters of the updated trained local model according to the verification loss of the updated global model in each source client during the task verification process, and obtain the updated trained local model; at the same time, construct the update loss of the global model according to the verification loss of the updated global model in each source client during the task verification process, and use the update loss of the global model to optimize the network parameters of the updated global model in the central server, so that the update loss of the global model is minimized and no longer decreases, and obtain the updated global model; S5: Download the updated global model obtained in step S4 to each source client, use the verification sample set to perform task verification on the updated global model downloaded to each source client, and after the task verification is completed, update 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; S6: Repeat the above steps S2-S5 until the global model reaches the updated preset value or preset performance, and the global model training is completed.
2. The model training method according to claim 1, characterized in that: In step S3, the network parameters of the local model trained from each source client are weighted and calculated to obtain the global model network parameters: In the formula, θ global are global model network parameters, is the local model network parameter after training for the i-th source client, a i is the artificial experience coefficient of the i-th source client, α i is the performance coefficient of the local model after training the i-th source client, 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: In the formula, 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, and s is the potential pattern class , P(·) is the frequency function, and K is the number of source clients.
3. The model training method according to claim 2, characterized in that: 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 during the task verification process is as follows: Where, L Ci is the validation loss of the updated global model in the i-th source client, K is the number of source clients, θ global are global model network parameters, is the network parameter of the local model after training in the i-th source client, x i represents the verification sample, λ is the complexity coefficient, h i is the entropy coefficient of the complexity entropy of the i-th source client sample; the calculation formula for the update loss of the global model is as follows: Where, 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, and a i is the artificial experience coefficient of the i-th source client.
4. The model training method according to claim 3, characterized in that: In step S5, the calculation formula for updating 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: i c ′ lient =λ·(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 verification accuracy of the updated trained local model, A global is the task verification accuracy for updating the global model, θ client represents the updated trained local model network parameters in the source client, θ global represents updating the global model network parameters, λ is the complexity coefficient, h i is the entropy coefficient of the complexity entropy of the i-th source client sample, θ c ' lient The updated local model parameters in the source client.
5. The model training method according to any one of claims 1 to 4, characterized in that: The network model is a device health status detection model, which consists of a feature extractor and a multi-classifier. The feature extractor is used to extract features from sample data input into the network model, and the multi-classifier is used to process the features extracted by the feature extractor to obtain a predicted health status classification of the device. The multi-classifier includes two classifiers with the same structure.
6. The model training method according to claim 5, characterized in that: In step S2, the training sample set is input into the local model of each source client to train the local model and update the local model until the local model reaches the updated preset value or preset performance. The specific operation is: S201: inputting the training samples in the training sample set into the local model, extracting features from the training samples using the feature extractor, and then using a multi-classifier to process the features extracted by the feature extractor to obtain the predicted health status of the equipment corresponding to the training samples, constructing a loss function L1 based on the predicted health status and the actual health status of the equipment based on the domain difference loss and the classification loss of the classifier, and adjusting the network parameters of the local model using the back propagation algorithm according to the loss function L1, so that the loss function L1 is in a stable state and does not decrease any more; Among them, the calculation formulas of domain difference loss, classification loss of classifier, and loss function L1 are as follows: L classity =Σp(y pre )log(1 / p(y real )) In the formula, p(y pre ) represents the probability set of the equipment predicted health status classification corresponding to the training samples output by the classifier, p(y real ) represents the set of real health status classifications of the equipment corresponding to the training samples, Π(p1,p2) is the set of all joint distributions between distributions p1 and p2, E represents the expectation, x and y represent samples in the two distributions, (x,y)~γ represents the joint distribution requirement that x and y obey γ, δ1 is the training hyperparameter, and L classity1 represents the classification loss given by the first classifier, L classity2 represents the classification loss given by the second classifier, * represents the product operation, represents the minimization of the parameters of the feature extractor, classifier 1 and classifier 2, L domain Represents domain difference loss; S202: inputting the training samples in the training sample set into the local model, extracting features from the training samples using the feature extractor, and then inputting the features extracted by the feature extractor into two classifiers of the multi-classifier to obtain two predicted health states of the training samples, constructing a loss function L2 based on the classification loss of the two classifiers and the difference loss of the outputs, and adjusting the network parameters of the multi-classifier in the local model using the back propagation algorithm according to the loss function L2, so that the loss function L1 is in a stable state and does not decrease any more, wherein the network parameters of the feature extractor are frozen while adjusting the network parameters of the multi-classifier in the local model; Among them, the calculation formula of the classifier's difference loss and loss function L2 is as follows: Where δ2 is the training hyperparameter; M is the number of equipment health status categories; P 1m ,P 2m They represent the probability that the first classifier and the second classifier classify the health status of the sample device 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, L ClassDis is the classifier difference loss; S203: inputting the training samples in the training sample set into the local model, extracting features from the training samples using the feature extractor, and then inputting the features extracted by the feature extractor into two classifiers of the multi-classifier to obtain two predicted health states of the training samples, constructing a loss function L3 based on the domain difference loss and the difference loss of the classifier outputs, and adjusting the network parameters of the feature extractor in the local model using the back propagation algorithm according to the loss function L3, so that the loss function L3 is in a stable state and does not decrease any more, wherein the network parameters of the multi-classifier are frozen while adjusting the network parameters of the feature extractor in the local model; Among them, 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 Represents domain difference loss; S204: Repeat the above steps S201-S203 until the local model reaches the updated preset value or preset performance.
7. The model training method according to claim 6, characterized in that: 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 fully connected layer, and a second fully connected layer, which are connected in sequence; the network structure of the first adversarial residual block, the second adversarial residual block, the third adversarial residual block, and the fourth adversarial residual block is the same; the multi-classifier includes two classifiers with the same structure, and the classifier is composed of a first fully connected layer, a second fully connected layer and a Softmax activation function layer, which are connected in sequence.
8. The model training method according to claim 7, characterized in that: The first adversarial residual block includes a first residual layer, a second residual layer and a third residual layer. The first residual layer, the second residual layer and the third residual layer have the same structure, and are all composed of a convolutional layer, a normalization layer and a ReLU activation function layer connected in sequence; the operation of the first adversarial residual block to extract features on the input sample data is as follows: the sample data of the input to the first adversarial residual block is first subjected to feature extraction by the first residual layer to obtain a first sample feature; the first sample feature is processed by a shunting coefficient α and then respectively input into the second residual layer and the third residual layer for feature extraction to obtain a second sample feature and a third sample feature; the second sample feature and the third sample feature are respectively processed by a balancing coefficient β and the first sample feature processed by the shunting coefficient α and the input sample data of the first adversarial residual block are subjected to feature addition processing and then output.
9. An electronic device, comprising a memory and a processor, characterized in that: The memory stores a computer program, and when the processor executes the computer program, it implements the network model training method as described in any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the network model training method as described in any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Federal learning participant weight calculation method based on information entropy
CN114398634A
Federal learning method and device based on client classification and information entropy
CN114723071A
Federal learning global model training method based on active learning and model compression
CN114943345A
Energy pile green low-carbon building design method based on machine learning
CN115935477A
Intelligent fault diagnosis method based on data privacy protection
CN117591877A
