Client demand-oriented industrial Internet of Things personalized federal learning method
By adopting a personalized federated learning method in the industrial Internet of Things, using orthogonal constraint loss function and feature vector update mechanism, the data islands and weight skew problems in the industrial Internet of Things are solved, and the personalized performance and data utilization rate of the model are improved. , ensuring data security.
Patent Information
- Application Number
- CN202411292524.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2024-12-20
AI Technical Summary
Due to the lack of a safe and effective data sharing mechanism in the existing industrial Internet of Things, industrial data silos have low data utilization, and large differences in data distribution between the federal learning model between clients, resulting in a skewed weight, which cannot adapt to personalized needs.
Using the industrial Internet of Things personalized federated learning method for client needs, by building a local model including a shared layer and a personalized layer, the client locally trains the shared layer based on the orthogonal constraint loss function and updates it on the basis of the feature vector. Personalize layer parameters to realize personalized adjustment and aggregation of models.
It alleviates the problem of weight skew, improves the model's personalized classification capabilities and data utilization, and ensures data privacy security and model generalization capabilities.
Smart Images

Figure CN119168090A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of industrial Internet of Things and relates to a personalized federated learning method of industrial Internet of Things oriented to client needs. Background Art
[0002] With the rapid development of industrial Internet of Things technology, more and more industrial equipment and sensors are able to collect and generate data. However, while the industrial Internet is developing rapidly, it is also facing many challenges. Due to the lack of a safe and effective data sharing mechanism, the large-scale industrial data generated by the existing massive industrial Internet devices is often enjoyed by the data holders alone, forming data islands, making it difficult to fully utilize the data, resulting in low data utilization; in the process of data sharing, there are problems such as illegal data transactions, data leakage, data misuse, and data abuse, which lead to user privacy leakage.
[0003] As an emerging machine learning paradigm, federated learning provides a new solution to the above challenges. It uses a federated learning framework to collaboratively train a unified global model without exchanging or sharing their industrial data. It not only ensures the privacy and security of industrial data, but also can utilize a large amount of industrial data from different sources, thereby improving the generalization ability and accuracy of the model.
[0004] However, there are still many challenges in achieving effective federated learning: 1) Although federated learning obtains a unified global model, different clients often have very different personalized needs, resulting in the global model being unable to adapt to all clients; 2) The data distribution differences between clients are too large, and the aggregation of the federated learning model often produces serious weight skew; therefore, the present invention considers the personalized needs of the client and adopts an industrial Internet of Things personalized federated learning method oriented to the client's needs. Summary of the invention
[0005] In order to solve the above-mentioned problems in the prior art, the present invention adopts an industrial Internet of Things personalized federated learning method oriented to client needs, including:
[0006] S1. Build a personalized federated learning system including N clients and one server, where the server is equipped with an initial model after parameter initialization;
[0007] S2. The server sends a unified initial model to each client as the local model of each client. The local model includes: a shared layer and a personalized layer; is the initial parameter of the shared layer of client i, are the initial parameters of the personalization layer of client i;
[0008] S3. Freeze the parameters of the personalized layer. The clients use orthogonal constraint loss to perform local training on their shared layers based on their local industrial data to obtain the parameters of the client shared layer after training. t is the local training round of the local model;
[0009] S4, each client uploads the trained parameters of its own shared layer to the server for average aggregation, and sends the aggregated parameters to the client, and each client updates the parameters of its own shared layer according to the aggregated parameters;
[0010] S5. Set the strategy switching communication round τ. If t<τ, return to step S3; otherwise, the clients perform local training on their respective shared layers and personalized layers based on their respective local industrial data to obtain local models trained by each client.
[0011] Local training of shared layers involves:
[0012] S31. The clients input their local industrial data into their respective shared layers to obtain feature vectors. Where i represents the client serial number, and k represents the index of industrial data;
[0013] S32, the client according to their own feature vector Calculate the loss function value, update the parameters of each shared layer according to the loss function value, and obtain the parameters of the client shared layer after the tth round of training
[0014] The loss function is L g,i =L CIOC,i +L CE,i , L CIOC,i is the feature vector The local orthogonality constraint loss, L CE,i is the feature vector The cross entropy loss.
[0015] Local orthogonality constraint loss L CIOC,i =λL Push,i +L Pull,i Among them, L Push,i is the loss of pushing the feature vector space of different categories apart, L Pull,i To tighten the loss of feature vector space of the same category, λ is a measure of L Push,i Hyperparameters of importance.
[0016] Among them, B is the index set of local industrial data, are the labels of the local industrial data with indices m, s, and n in client i, and CS represents the calculation of cosine similarity.
[0017] The client performs local training on its shared layer and personalized layer based on its local industrial data, including:
[0018] S51, setting a total training round T, the clients input their local industrial data into their respective shared layers to obtain feature vectors;
[0019] S52, the client calculates the local class prototype vector according to the respective feature vectors, and updates the parameters of the respective personalized layers according to the local class prototype vectors; the client calculates the loss function value according to the respective feature vectors, and updates the parameters of the respective shared layers according to the loss function value;
[0020] S53. If the local training round of the local model is less than the total training round T, return to step S51; otherwise, complete the training of the local model to obtain the local model trained by each client.
[0021] The client calculates the local class prototype vector based on its own feature vector include:
[0022]
[0023]
[0024] Among them, c represents the local industrial data category, C i is the local industrial data category set of client i, |C i | is the number of local industrial data categories of client i, is the local class prototype of the c-th type of local industrial data, is the number of local industrial data of type c in client i, is the label of the local industrial data with index k in client i, is the feature vector of local industrial data with index k output by the shared layer of client i, n i Indicates the amount of local industrial data in client i.
[0025] Updating the parameters of the respective personalization layers according to the local class prototype vector includes:
[0026]
[0027] Among them, v is a fixed constant, ρ (v) is the smoothing parameter, is the local class prototype vector when the local training round is t.
[0028] Smoothing parameter
[0029] The shared layers include: convolutional layer, pooling layer, normalization layer and activation layer, and the personalized layers include: fully connected layer and activation layer.
[0030] Beneficial effects:
[0031] 1. The present invention takes into account the personalized needs of the client and utilizes the orthogonal characteristics of the feature space vector to construct a local orthogonal constraint loss function of the feature vector output by the client's shared layer to train the shared layer, thereby alleviating the weight skew generated during federated learning aggregation; 2. The present invention takes into account the personalized needs of the client and applies the client's local industrial data information to guide the personalized layer of the corresponding client, thereby improving the personalized classification capabilities of each client. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 An industrial Internet of Things personalized federated learning method oriented to client needs is provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0033] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0034] like Figure 1 As shown, the present invention adopts an industrial Internet of Things personalized federated learning method oriented to client needs, including:
[0035] S1. Construct a personalized federated learning system including N clients and one server, wherein the server is provided with an initial model after parameter initialization; the client may be a sensor, smart device, etc. of the industrial Internet of Things;
[0036] S2. The server sends a unified initial model to each client as the local model of each client. In order to meet the personalized needs of the client, the local model is decoupled into a shared layer and a personalized layer; represents the initial parameters of the i-th client, is the initial parameter of the shared layer of client i, is the initial parameter of the personalization layer of client i, R C×d is the parameter space, C represents the number of industrial data categories, and d represents the output dimension of the shared layer feature vector;
[0037] S3. Freeze the parameters of the personalized layer. The client uses orthogonal constraint loss to perform the tth round of local training on its shared layer based on its own personalized needs and its local industrial data, and obtains the parameters of the client shared layer after the tth round of training. t is the training round of the local model;
[0038] S4. Each client trains its own shared layer parameters Upload to the server for average aggregation, and send the aggregated parameters to the client. Each client updates the parameters of its own shared layer according to the aggregated parameters, and obtains the final parameters of the shared layer of each client in the tth round.
[0039] S5. Set the strategy switching communication round τ. If t<τ, return to step S3; otherwise, the clients locally train their shared layers and personalized layers based on their local industrial data according to their own personalized needs to obtain local models trained by each client.
[0040] Furthermore, the client uses orthogonal constraint loss to perform local training on its own shared layers based on local industrial data according to its own personalized needs, including:
[0041] S31. The clients input their local industrial data into their respective shared layers to obtain feature vectors. Where i represents the client serial number, and k represents the index of industrial data;
[0042] S32, the client according to their own feature vector Calculate the loss function value and update the parameters of each shared layer according to the loss function value Get the parameters of the client's shared layer after the tth round of training
[0043] The loss function is L g,i =L CIOC,i +L CE,i , the parameter update process is: L CIOC,i is the feature vector The local orthogonality constraint loss, L CE,i is the feature vector The cross entropy loss, η t-1 Represents the learning rate during the t-1th round of local training.
[0044] Cross Entropy Loss Among them, n i is the data size of client i, is the label of the k-th data of client i, is the feature vector of the kth data of client i, c represents the local industrial data category, and w c is the weight of category c, w j is the weight of category j, |C i | is the number of local industrial data categories of client i.
[0045] Local orthogonality constraint loss L CIOC,i =λL Push,i =+L Pull,i Among them, L Push,i is the loss of pushing the feature vector space of different categories apart, L Pull,i To tighten the loss of feature vector space of the same category, λ is a measure of L Push,i Hyperparameters of importance.
[0046] Among them, B is the index set of local industrial data, are the labels of the local industrial data with indices m, s, and n in client i, and CS represents the calculation of cosine similarity.
[0047] The client-local orthogonal constraint loss function utilizes the orthogonal characteristics of feature space vectors to alleviate the weight skew between different clients.
[0048] Furthermore, the client performs local training on its own shared layer and personalized layer based on its own local industrial data according to its own personalized needs. The specific steps include:
[0049] S51, setting a total training round T, the clients input their local industrial data into their respective shared layers to obtain feature vectors;
[0050] S52, the client calculates the local class prototype vector according to the respective feature vectors, and updates the parameters of the respective personalized layers according to the local class prototype vectors; the client calculates the loss function value according to the respective feature vectors, and updates the parameters of the respective shared layers according to the loss function value;
[0051] S53. If the local training round of the local model is less than the total training round T, return to and repeat step S51; otherwise, complete the training of the local model to obtain the local model trained by each client.
[0052] The client calculates the local class prototype vector based on its own feature vector include:
[0053]
[0054]
[0055] Among them, C iis the local industrial data category set of client i, is the local class prototype of the c-th type of local industrial data, is the number of local industrial data of category c in client i, is the label of the local industrial data with index k in client i, is the feature vector of the kth local industrial data output by the shared layer of client i, n i Indicates the amount of local industrial data in client i.
[0056] Updating the parameters of the client's personalization layer according to the local class prototype vector includes:
[0057]
[0058]
[0059]
[0060] Among them, t is the current training round of the local model, v is a fixed constant, generally 0.9, ρ (v) is the smoothing parameter, is the local class prototype vector when the local training round is t.
[0061] The process of updating the parameters of the respective shared layers according to the loss function value is consistent with step S32.
[0062] The shared layers include: 4 convolutional layers, 2 pooling layers, 4 normalization layers and 4 activation layers. The convolution kernels of the convolutional layers are 7, 5, 3, and 3 respectively, and the number of output neurons are 4096, 2048, 2048, and 2048 respectively. The personalized layers include: 3 fully connected layers and 2 activation layers. The number of hidden neurons in the 3 fully connected layers is 1024, 256, and 10 respectively.
[0063] In one embodiment, the industrial data can be the vibration signal of the gearbox of each client's key mechanical component; first, a parallel gearbox gear / bearing experiment is performed on the DDS experimental platform to collect vibration signals. The collected vibration signals are divided into horizontal and vertical directions. The data sampling frequency is 25.6kHz, and a total of 10 states are sampled. The duration of each sampling is 56.25s, and 2500 vibration data are collected each time; the above collected data are divided into different clients according to the Dirichlet distribution to simulate the actual environment.
[0064] Table 1 Dataset description
[0065]
[0066]
[0067] In order to compare and analyze the effectiveness of the method of the present invention, in one embodiment, a comparative analysis is performed with the use of federated average learning (FedAvg) as the limit method, and three indicators for personalized federated learning are used to evaluate the quality of the model: global balanced accuracy (GBA), personalized balanced accuracy (PBA) and personalized distributed embedding accuracy (PDA):
[0068]
[0069]
[0070]
[0071] Among them, y x represents the label of the xth sample, represents the fault prediction result of the local model of the i-th client for the x-th sample, N x is the total number of test set samples, P i (y x ) represents the probability distribution of the fault category of the i-th client; the experimental comparison results are shown in Table 2.
[0072] Table 2 Comparison of different personalized federated learning gearbox fault diagnosis indicators
[0073]
[0074]
[0075] As can be seen from Table 2, in the experimental results, the method proposed in the present invention is significantly better than the baseline method, which proves that the present invention can better improve the personalized fault diagnosis performance for different clients when the client label distribution is severely skewed.
[0076] The above embodiments further illustrate the purpose, technical solutions and advantages of the present invention in detail. It should be understood that the above embodiments are only preferred implementation modes of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made to the present invention within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A personalized federated learning method for industrial Internet of Things oriented to client needs, characterized in that: include: S1. Build a personalized federated learning system including N clients and one server, where the server is equipped with an initial model after parameter initialization; S2. The server sends a unified initial model to each client as the local model of each client. The local model includes: a shared layer and a personalized layer; is the initial parameter of the shared layer of client i, are the initial parameters of the personalization layer of client i; S3. Freeze the parameters of the personalized layer. The clients use orthogonal constraint loss to perform local training on their shared layers based on their local industrial data to obtain the parameters of the client shared layer after training. t is the local training round of the local model; S4, each client uploads the trained parameters of its own shared layer to the server for average aggregation, and sends the aggregated parameters to the client, and each client updates the parameters of its own shared layer according to the aggregated parameters; S5. Set the strategy switching communication round τ. If t<τ, return to step S3; otherwise, the clients perform local training on their respective shared layers and personalized layers based on their respective local industrial data to obtain local models trained by each client.
2. According to claim 1, a personalized federated learning method for industrial Internet of Things oriented to client needs is characterized in that: Local training of shared layers involves: S31. The clients input their local industrial data into their respective shared layers to obtain feature vectors. Where i represents the client serial number, and k represents the index of industrial data; S32, the client according to their own feature vector Calculate the loss function value, update the parameters of each shared layer according to the loss function value, and obtain the parameters of the client shared layer after the tth round of training 3. According to claim 2, a personalized federated learning method for industrial Internet of Things oriented to client needs is characterized in that: The loss function is L g,i =L CIOC,i +L CE,i , L CIOC,i is the feature vector The local orthogonality constraint loss, L CE,i is the feature vector The cross entropy loss.
4. According to claim 3, a personalized federated learning method for industrial Internet of Things oriented to client needs is characterized in that: Local orthogonality constraint loss L CIOC,i =λL Push,i +L Pull,i Among them, L Push,i is the loss of pushing the feature vector space of different categories apart, L Pull,i To tighten the loss of feature vector space of the same category, λ is a measure of L Push,i Hyperparameters of importance.
5. According to claim 4, a personalized federated learning method for industrial Internet of Things oriented to client needs is characterized in that: Among them, B is the index set of local industrial data, are the labels of the local industrial data with indices m, s, and n in client i, and CS represents the calculation of cosine similarity.
6. According to claim 1, a personalized federated learning method for industrial Internet of Things oriented to client needs is characterized in that: The client performs local training on its shared layer and personalized layer based on its local industrial data, including: S51, setting a total training round T, the clients input their local industrial data into their respective shared layers to obtain feature vectors; S52, the client calculates the local class prototype vector according to the respective feature vectors, and updates the parameters of the respective personalized layers according to the local class prototype vectors; the client calculates the loss function value according to the respective feature vectors, and updates the parameters of the respective shared layers according to the loss function value; S53. If the local training round of the local model is less than the total training round T, return to step S51; otherwise, complete the training of the local model to obtain the local model trained by each client.
7. The personalized federated learning method for industrial Internet of Things oriented to client needs according to claim 6 is characterized in that: The client calculates the local class prototype vector based on its own feature vector include: Among them, c represents the local industrial data category, C i is the local industrial data category set of client i, |C i | is the number of local industrial data categories of client i, is the local class prototype of the c-th type of local industrial data, is the number of local industrial data of type c in client i, is the label of the local industrial data with index k in client i, is the feature vector of local industrial data with index k output by the shared layer of client i, n i Indicates the amount of local industrial data in client i.
8. The personalized federated learning method for industrial Internet of Things oriented to client needs according to claim 6 is characterized in that: Updating the parameters of the respective personalization layers according to the local class prototype vector includes: Among them, v is a fixed constant, ρ (v) is the smoothing parameter, is the local class prototype vector when the local training round is t.
9. The personalized federated learning method for industrial Internet of Things oriented to client needs according to claim 8 is characterized in that: Smoothing parameter 10. The method of personalized federated learning of industrial Internet of Things oriented to client needs according to claim 1, characterized in that: The shared layers include: convolutional layer, pooling layer, normalization layer and activation layer, and the personalized layers include: fully connected layer and activation layer.
Citation Information
Cited By
Personalized federated learning method for asynchronous optimization and prototype perception reasoning of classifier
CN120687850A
Financial fraud detection model training method, system and device, medium and equipment
CN121052831A
