Privacy detection method and system based on similarity alignment federated learning

By adopting the similarity alignment federated learning method in the Internet of Things system, filtering and correcting the model parameters of abnormal devices, the problem of abnormal data affecting the global model accuracy is solved, and the effectiveness of IoT privacy detection is improved.

CN118917385AActive Publication Date: 2024-11-08HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411088106.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-11-08
Estimated Expiration
2044-08-08

AI Technical Summary

Technical Problem

In an IoT system based on federated learning, the abnormal data provided by an abnormal IoT device will cause the global model detection accuracy to deteriorate, affecting the privacy detection effect.

Method used

Using a similarity-aligned federated learning method, by receiving the model parameters uploaded by each IoT device, determining the first global model parameters and the second global model parameters, grouping and screening the suspected poisoning devices, determining the target poisoning devices, and using other devices Model parameters correct the global model and update the local model to improve detection accuracy.

Benefits of technology

Effectively screen out poisoning devices to avoid their negative impact on the global model, improve the accuracy of the Internet of Things privacy detection model, and ensure the quality of the global model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118917385A_ABST
    Figure CN118917385A_ABST
Patent Text Reader

Abstract

The invention provides a privacy detection method and system based on similarity alignment federated learning. According to the method, the Internet of Things equipment which may be poisoned is preliminarily screened through the model parameters locally trained by the Internet of Things equipment, and the target Internet of Things equipment which is really poisoned is further determined by using the model parameters uploaded by the screened Internet of Things equipment which may be poisoned. According to the technical scheme of the invention, federated learning is continuously carried out on the non-poisoned Internet of Things devices except the poisoned target Internet of Things device to train the global model, so that the influence of the poisoned target Internet of Things device on the training of the global model is avoided, and the precision of the finally trained global model, such as an Internet of Things privacy detection model, is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet of Things technology, and in particular to a privacy detection method and system based on similarity-aligned federated learning. Background Art

[0002] In the current privacy detection method based on federated learning, there are multiple IoT devices and a server for managing the IoT devices. The server sends the initial model to each IoT device, and each IoT device uses the initial model as a local model, and trains the local model according to local data to obtain the parameters of the trained model, and then uploads the parameters of the trained model to the server, so that the server aggregates the parameters of the trained models uploaded by each IoT device to obtain a new global model, and sends the global model parameters to each IoT device to update the local model, and returns to the step of training the local model according to the local data to obtain the parameters of the trained model, until the end condition of federated learning is met.

[0003] However, once an abnormal IoT device provides abnormal local data, the abnormal IoT device will train the local model according to the abnormal local data to obtain abnormal model parameters and upload them to the server, causing the server to aggregate the abnormal model parameters to obtain a new global model, resulting in poor detection accuracy of the global model. Summary of the invention

[0004] In view of this, the present application provides a privacy detection method and system based on similarity alignment federated learning to improve the detection accuracy of the Internet of Things privacy detection model.

[0005] The technical solutions provided by this application are as follows: According to an embodiment of the first aspect of the present application, a privacy detection method based on similarity alignment federated learning is proposed. The method is applied to a server, and the method includes: Determine the first global model parameter according to the model parameters uploaded by each IoT device; the model parameters uploaded by any IoT device are the parameters of the trained model obtained by the IoT device after training the local model based on the local training data, and the local training data of any IoT device is obtained through at least two network layers, and the at least two network layers are decoupled network layers in the neural network model; Based on the first similarity between the model parameters uploaded by each IoT device and the first global model parameters, grouping each IoT device into a suspected poisoning group and a normal group; determining the second global model parameters using the model parameters uploaded by each IoT device in the suspected poisoning group; Determine a target IoT device based on the model parameters uploaded by each IoT device in the group of IoT devices suspected of being poisoned, the first global model parameters, and the second global model parameters; the target IoT device is a poisoned IoT device; Model correction parameters are determined using model parameters uploaded by other IoT devices except the target IoT device, and the model correction parameters are sent to each IoT device. When the model correction parameters meet the set federated learning termination conditions, each IoT device is instructed to update the local model based on the model correction parameters to obtain a target privacy detection model; the target privacy detection model is used to detect IoT privacy data; when the model correction parameters do not meet the set federated learning termination conditions, each IoT device is instructed to update the local model based on the model correction parameters and train the updated local model based on local training data to upload the parameters of the trained model to the server.

[0006] Optionally, determining the first global model parameter according to the received model parameters uploaded by each IoT device includes: Obtaining the first global model parameter by weighted averaging the model parameters uploaded by each IoT device; The method of determining the second global model parameter by using the model parameters uploaded by each IoT device in the group of IoT devices suspected of being poisoned includes: The second global model parameter is obtained by weighted averaging the model parameters uploaded by each IoT device in the IoT device suspected poisoning group.

[0007] Optionally, grouping each IoT device to obtain a suspected poisoning group and a normal group based on the first similarity between the model parameter uploaded by each IoT device and the first global model parameter includes: If the first similarity is less than a first threshold, it is determined that the IoT device that uploaded the model parameters belongs to the IoT device suspected poisoning group; If the first similarity is greater than or equal to a first threshold, it is determined that the IoT device that uploaded the model parameters belongs to the normal group of IoT devices.

[0008] Optionally, determining the target IoT device based on the model parameters uploaded by each IoT device in the IoT device suspected poisoning group, the first global model parameters, and the second global model parameters includes: For each IoT device in the suspected poisoning group, determine a first similarity between the model parameters uploaded by the IoT device and the first global model parameters, and determine a second similarity between the model parameters uploaded by the IoT device and the second global privacy model; perform specified operation processing on the first similarity and the second similarity to obtain an operation result, and determine whether the IoT device is a target IoT device based on the operation result.

[0009] Optionally, the performing a specified operation on the first similarity and the second similarity includes: normalizing the first similarity and the second similarity; Determining whether the IoT device is the target IoT device based on the calculation result includes: if the normalization processing result is a first value, determining that the IoT device that uploads the model parameters is the target IoT device; if the normalization processing result is not the first value, determining that the IoT device that uploads the model parameters is not the target IoT device.

[0010] Optionally, the normalizing the first similarity and the second similarity includes: An addition operation is performed on the first similarity and the second similarity to obtain a normalized processing result.

[0011] Optionally, the at least two network layers include: A decoupled feature extractor, a first classifier, and a second classifier in the neural network model; The first classifier and the second classifier are configured with different loss functions; The local training data is obtained by following the steps below: The preset original data is first input into the decoupled feature extractor to obtain data features, and the data features are input into the first classifier to obtain a first classification result, and then the first classification result is input into the second classifier to obtain; or, The existing local training data is first input into the decoupled feature extractor to obtain data features, and the data features are input into the first classifier to obtain a first classification result, and then the first classification result is input into the second classifier to obtain.

[0012] Optionally, the loss function configured for the first classifier is a cross entropy loss function adjusted based on mini-batch logit, and the loss function configured for the second classifier is a cross entropy loss function.

[0013] According to an embodiment of the second aspect of the present application, a privacy detection system based on similarity alignment federated learning is proposed, and the system includes: A server, used to execute the method described in the first aspect; Multiple IoT devices, wherein any IoT device is used to obtain parameters of a trained model after training a local model based on local training data, and upload the parameters of the trained model to the server.

[0014] Optionally, any IoT device is used to, upon receiving the initial model sent by the server, use the initial model as the local model and execute the step of training the local model based on the local training data to obtain the parameters of the trained model; When any IoT device receives the model correction parameters and the training end indication sent by the server, it updates the local model based on the model correction parameters to obtain the target privacy detection model; When any IoT device receives the model correction parameters and training continuation indication sent by the server, it updates the local model based on the model correction parameters and trains the updated local model based on the local training data to upload the parameters of the trained model to the server.

[0015] It can be seen from the above technical scheme that the present application first performs a preliminary screening of the IoT devices that may be poisoned by using the model parameters trained locally on each IoT device, and further uses the model parameters uploaded by the screened IoT devices that may be poisoned to determine the target IoT devices that are truly poisoned, and continues to perform federated learning on the non-poisoned IoT devices except the poisoned target IoT devices to train the global model, thereby avoiding the impact of the poisoned target IoT devices on the training of the global model and improving the accuracy of the finally trained global model, such as the IoT privacy detection model. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0017] Figure 1 A flowchart of a privacy detection method based on similarity-aligned federated learning provided in an embodiment of the present application; Figure 2 A schematic diagram of the overall process of federated learning provided in the embodiment of the present application; Figure 3 A schematic diagram of a privacy detection system based on similarity alignment federated learning provided in an embodiment of the present application; Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application; Figure 5 A structural diagram of a privacy detection device based on similarity-aligned federated learning provided in an embodiment of the present application. DETAILED DESCRIPTION

[0018] In order to enable those skilled in the art to better understand the technical solutions provided by the embodiments of the present application and to make the above-mentioned purposes, features and advantages of the embodiments of the present application more obvious and understandable, the technical solutions in the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings.

[0019] Please refer to Figure 1 , Figure 1 A flowchart of a privacy detection method based on similarity-aligned federated learning provided in an embodiment of the present application.

[0020] In this embodiment, the privacy detection method based on similarity alignment federated learning can be applied to the server.

[0021] As an embodiment, the server can be a management device in the Internet of Things for managing multiple Internet of Things devices, such as a central server or a cloud platform, etc. The Internet of Things devices can include smart home devices, sensor devices, intelligent robots, etc., and this application does not limit this.

[0022] like Figure 1 As shown, the method may include the following steps: Step 101: determine a first global model parameter according to the model parameters received and uploaded by each IoT device.

[0023] In this embodiment, the IoT devices managed by the server perform model training in a federated learning manner. As an embodiment, each time the IoT device completes a training locally, the model parameters trained locally are uploaded to the server. Exemplarily, the model parameters here may include one or more of the weight matrix and bias vector (used to represent the learning results of the model on the training data of the IoT device) of the IoT device, model status, training rounds, identifier of the IoT device, model version or synchronization status, etc.

[0024] As an embodiment, local training of an IoT device refers to the training of a local model by the IoT device based on local training data. Initially, the local model of the IoT device is sent from the above-mentioned server to the IoT device, or is downloaded from the IoT device to a specified location, and this application does not limit this.

[0025] As an embodiment, the local training data of the IoT device is obtained through at least two network layers, and the at least two network layers are decoupled network layers in the neural network model. Optionally, the at least two decoupled network layers in the neural network model may include: a decoupled feature extractor in the neural network model and a first classifier and a second classifier.

[0026] In this embodiment, the feature extractor is used to perform feature extraction on the local data of the IoT device to extract representative data features in the local data, retain important feature information, and reduce computational complexity.

[0027] In this embodiment, the first classifier can be used to process non-independent and identically distributed (Non-IID: Non-Independent and Identically Distributed) data included in the local data of the Internet of Things device, and the second classifier can be used to process independent and identically distributed (IID: Independent and Identically Distributed) data included in the local data of the Internet of Things device.

[0028] As an embodiment, the first classifier and the second classifier are configured with different loss functions. For example, the loss function configured for the first classifier may be a cross entropy loss function based on mini-batch logit adjustment, and the loss function configured for the second classifier may be a cross entropy loss function.

[0029] For Non-IID data, there may be correlation between samples, and the data distribution may be uneven and the categories may be unbalanced. It is difficult to adjust the loss of sample data of different types and distributions through the traditional global loss function. This embodiment uses a small batch logit-adjusted cross entropy loss function to process Non-IID data. It can more flexibly adjust the loss according to sample data of different types and distributions, thereby adapting to the non-independent and identically distributed characteristics of the data. The small batch loss function can reflect the loss of sample data of more different distributions, and can more effectively control the generalization ability of the model.

[0030] For IID data, since the samples are independent and do not affect each other, in this case, the ordinary cross entropy loss function can effectively measure the difference between the prediction and the true label without additional adjustment.

[0031] In this embodiment, the local data of the IoT device is processed by the feature extractor, the first classifier, and the second classifier to obtain training data, which can make the distribution of training data in the IoT device more balanced, thereby making the overall data distribution between the IoT devices more consistent, reducing the heterogeneity of the distribution of training data between the IoT devices, and enhancing the convergence of the global model aggregated by the final server. In other words, inputting local data into at least two decoupled network layers in the neural network model to obtain more evenly distributed training data, and further training the local model with the training data, can reduce the problem of reduced accuracy caused by heterogeneity of data distribution.

[0032] As an embodiment, the local training data of the IoT device can remain unchanged. For example, it can be obtained by inputting the original data into the at least two network layers mentioned above during the first local training, that is, the preset original data is first input into the decoupled feature extractor to obtain data features, and the data features are input into the first classifier to obtain the first classification result, and then the first classification result is input into the second classifier to obtain.

[0033] As an embodiment, the local training data of the IoT device can also change dynamically. During the first local training, the current local training data can be input into the above-mentioned at least two network layers to obtain data features, and during subsequent local training, the existing local training data can be first input into the decoupled feature extractor to obtain data features, and the data features can be input into the first classifier to obtain the first classification result, and then the first classification result can be input into the second classifier to obtain.

[0034] Based on the above description, each IoT device will upload the trained model parameters to the above server after training the local model using local training data each time. Finally, the model parameters uploaded by each IoT device received by the server in the above step 101 are realized. As for how the server determines the first global model parameters using the model parameters uploaded by each IoT device received, an example description is given below.

[0035] In this embodiment, after receiving the model parameters uploaded by each IoT device, the server may determine the first global model parameter according to the model parameters uploaded by each IoT device.

[0036] As an embodiment, the model parameters uploaded by each IoT device may be weighted averaged to obtain the first global model parameter.

[0037] As an embodiment, the method for determining the first global model parameter based on the parameter model uploaded by each IoT device may also include: sorting the received model parameters according to weights, and selecting the model parameter corresponding to the median of the weight as the first global model parameter.

[0038] As an embodiment, the method for determining the first global model parameters based on the parameter models uploaded by each IoT device may also include: sorting the received model parameters according to weights, removing a certain proportion of the lowest values ​​and the highest values, and taking the average value of the remaining parts as the first global model parameters, etc. This application does not impose any restrictions on this.

[0039] As an embodiment, the weight of the model parameters uploaded by each IoT device can be determined based on the amount of local training data of the IoT device. For example, the IoT device with a larger amount of local training data has a higher corresponding weight, and the IoT device with a smaller amount of local training data has a lower corresponding weight. This application does not impose any restrictions on this.

[0040] At this point, the description of step 101 ends, and step 102 is executed next.

[0041] Step 102: based on the first similarity between the model parameters uploaded by each IoT device and the first global model parameters, group each IoT device into a suspected poisoning group and a normal group; and determine the second global model parameters using the model parameters uploaded by each IoT device in the suspected poisoning group.

[0042] In this embodiment, after the server determines the first global model parameter through step 101, it can perform preliminary screening on the model parameters uploaded by each IoT device based on the first similarity between the model parameters uploaded by each IoT device and the first global model parameter, determine the IoT devices that may be poisoned, and classify them into the group of IoT devices suspected of being poisoned.

[0043] As an implementable manner, if the first similarity is less than a first threshold, it is determined that the IoT device that uploaded the model parameter belongs to a group of IoT devices suspected of being poisoned; If the first similarity is greater than or equal to the first threshold, it is determined that the IoT device that uploaded the model parameters belongs to the normal group of IoT devices.

[0044] In this embodiment, the proportion of poisoned IoT devices in all IoT devices is very small. In other words, only a very small number of IoT devices are poisoned IoT devices, and the first similarity between the model parameters uploaded by the poisoned IoT devices and the first global model parameters should be relatively low.

[0045] As an embodiment, the first similarity can be the cosine similarity between the model parameters uploaded by each IoT device and the first global model parameter, or the difference between the uploaded model parameters and the first global model parameter can be used as the first similarity, or the ratio between the uploaded model parameters and the first global model parameter can be used as the first similarity, and the present application does not impose any restrictions on this.

[0046] As an embodiment, taking the first similarity as cosine similarity as an example, a first threshold value may be pre-specified, and the IoT devices corresponding to the model parameters whose cosine similarity is less than the first threshold value are determined as IoT devices in the suspected poisoned group of IoT devices. Since the cosine similarity value is in the range of [-1,1], and the proportion of poisoned IoT devices in all IoT devices is very small, the cosine similarity value of the poisoned IoT devices will be significantly lower than the cosine similarity of normal IoT devices. For example, the first threshold value may be defined as 0, that is, the IoT devices corresponding to the model parameters whose cosine similarity is less than 0 are determined as IoT devices in the suspected poisoned group of IoT devices, and the IoT devices corresponding to the model parameters whose cosine similarity is greater than or equal to 0 are determined as IoT devices in the normal group of IoT devices.

[0047] After completing the grouping of each IoT device, the IoT devices included in the IoT device suspected of being poisoned group are the IoT devices that are initially screened out as possibly poisoned. However, the poisoned IoT devices determined only through preliminary screening are not accurate, and there may be a situation where normal IoT devices are mistakenly classified into the IoT device suspected of being poisoned group.

[0048] Based on this, the embodiment of the present application can further screen the IoT devices in the group of IoT devices suspected of being poisoned.

[0049] First, the second global model parameters can be determined using the model parameters uploaded by each IoT device in the IoT device suspected poisoning group.

[0050] As an embodiment, the model parameters uploaded by each IoT device in the group of IoT devices suspected of being poisoned may be weighted averaged to obtain the second global model parameters.

[0051] In this embodiment, the process of determining the second global model parameters using the model parameters uploaded by each IoT device in the suspected poisoning group of IoT devices is similar to the process of determining the first global model parameters according to the model parameters uploaded by each IoT device in step 101. The only difference is that the model parameters uploaded by each IoT device in the suspected poisoning group of IoT devices are aggregated instead of aggregating the model parameters uploaded by all IoT devices. The specific method has been described in step 101 and will not be repeated here.

[0052] At this point, the description of step 102 ends, and step 103 is executed next.

[0053] Step 103: determine the target IoT device based on the model parameters uploaded by each IoT device in the group of IoT devices suspected of being poisoned, the first global model parameters, and the second global model parameters.

[0054] In this embodiment, after the first global model parameter and the second global model parameter are determined through step 102, the truly poisoned IoT devices, i.e., the target IoT devices, can be further screened out from the IoT devices included in the suspected poisoned IoT device group based on the model parameters uploaded by each IoT device in the suspected poisoned IoT device group, the first global model parameter, and the second global model parameter.

[0055] As an implementable method, for each IoT device in the suspected poisoning group, a first similarity between the model parameters uploaded by the IoT device and the first global model parameters is determined, and a second similarity between the model parameters uploaded by the IoT device and the second global privacy model is determined; a specified operation is performed on the first similarity and the second similarity to obtain an operation result, and whether the IoT device is a target IoT device is determined based on the operation result.

[0056] In this embodiment, for the model parameters uploaded by each IoT device in the suspected poisoning group of IoT devices, the first similarity with the first global model and the second similarity with the second global model are calculated respectively, wherein the first similarity has been calculated in step 102, and the calculation method of the second similarity can be the same as the calculation method of the first similarity, for example, the first similarity and the second similarity are both cosine similarity. Since the calculation method of the first similarity has been described in step 102, the calculation method of the second similarity will not be repeated here.

[0057] It should be noted that, since the truly poisoned IoT devices (target IoT devices) account for a very small proportion of all IoT devices, even in the group of IoT devices suspected of being poisoned, the truly poisoned IoT devices account for a small proportion, and most of them are IoT devices that are misclassified as IoT devices in the group of IoT devices suspected of being poisoned. Taking the example that both the first similarity and the second similarity are cosine similarity, the larger the second similarity corresponding to the model parameters uploaded by each IoT device included in the group of IoT devices suspected of being poisoned (the closer to 1), the more similar the IoT device is to the second global model parameter, and the more likely the IoT device is to be a normal IoT device that is misclassified as a group of IoT devices suspected of being poisoned.

[0058] After determining the first similarity and the second similarity corresponding to the model parameters uploaded by each IoT device in the suspected poisoning group of IoT devices, a specified operation can be performed on the first similarity and the second similarity to obtain an operation result, and whether the IoT device is a target IoT device can be determined based on the operation result.

[0059] As an embodiment, the designated operation processing may be a normalization processing; if the normalization processing result is a first value, it is determined that the IoT device that uploaded the model parameters is a target IoT device; if the normalization processing result is not the first value, it is determined that the IoT device that uploaded the model parameters is not a target IoT device.

[0060] As an embodiment, the specified operation processing may be, in addition to normalization processing, subtraction processing, calculation of the difference between the absolute values ​​of the two, etc., and the present application does not impose any limitation on this.

[0061] As an embodiment, a specific method for performing normalization processing may be to perform an addition operation on the first similarity and the second similarity to obtain a normalization processing result.

[0062] Exemplarily, a specific method for normalization processing may also be a method of performing weighted averaging, linear combination, or nonlinear combination on the first similarity and the second similarity, and the present application does not limit this.

[0063] The following describes a method for determining a target IoT device through a specific embodiment.

[0064] As an embodiment, the first similarity corresponding to the model parameters uploaded by the IoT devices included in the IoT device suspected poisoning group is recorded as:

[0065] in, Indicates the first similarity corresponding to the model parameters uploaded by the nth IoT device included in the group of suspected poisoned IoT devices, It represents a set of first similarities corresponding to model parameters uploaded by each IoT device included in the IoT device suspected of being poisoned group, where the first similarity is cosine similarity.

[0066] The second similarity corresponding to the model parameters uploaded by the IoT devices included in the IoT device suspected poisoning group is recorded as:

[0067] in, Indicates the second similarity corresponding to the model parameters uploaded by the nth IoT device included in the group of suspected poisoned IoT devices, It represents a set of second similarities corresponding to the model parameters uploaded by each IoT device included in the IoT device suspected of being poisoned group, where the second similarity is cosine similarity.

[0068] The similarity values ​​corresponding to the first similarity set and the second similarity set are normalized. The specific method of the normalization process is to perform an addition operation on the first similarity and the second similarity to obtain a normalization result:

[0069] in, represents the result of normalized operation. represents a set of first similarities corresponding to model parameters uploaded by each IoT device included in the IoT device suspected poisoning group, It represents a set of second similarities corresponding to the model parameters uploaded by each IoT device included in the group of IoT devices suspected of being poisoned.

[0070] In this embodiment, the normalization method is to add the first similarity and the second similarity corresponding to the same IoT device in the suspected poisoning group of IoT devices. If the sum of the first similarity and the second similarity is less than a threshold value of 0, the normalization result corresponding to the IoT device is determined to be 0 (first value), and the IoT device that uploaded the model parameters is determined to be the target IoT device; if the sum of the first similarity and the second similarity is greater than or equal to the threshold value of 0, the normalization result corresponding to the IoT device is determined to be 1 (second value), and the IoT device that uploaded the model parameters is determined to be a normal IoT device.

[0071] At this point, the target IoT device is determined from the IoT devices in the group of IoT devices suspected of being poisoned. The description of step 103 ends, and step 104 is performed next.

[0072] Step 104, using the model parameters uploaded by other IoT devices except the target IoT device to determine the model correction parameters, the model correction parameters are sent to each IoT device, and when the model correction parameters meet the set federated learning end conditions, each IoT device is instructed to update the local model based on the model correction parameters to obtain the target privacy detection model; the target privacy detection model is used to detect IoT privacy data; when the model correction parameters do not meet the set federated learning end conditions, each IoT device is instructed to update the local model based on the model correction parameters and train the updated local model based on the local training data to upload the parameters of the trained model to the server.

[0073] In this embodiment, after the target IoT device is determined through step 103, the model parameters uploaded by the target IoT device can be discarded, and the global model can be aggregated according to the model parameters uploaded by IoT devices other than the target IoT device to obtain the model correction parameters.

[0074] It is easy to understand that after discarding the model parameters uploaded by the target IoT device, the model correction parameters obtained by aggregating the model parameters uploaded by other IoT devices avoid the influence of abnormal data in the poisoned IoT device and improve the detection accuracy of the IoT privacy detection model.

[0075] Furthermore, after obtaining the model correction parameters, the server will send the model correction parameters to each IoT device and instruct each IoT device to end training or continue training.

[0076] If the server detects that the model correction parameters have met the end conditions of federated learning, it will simultaneously send a training end indication to each IoT device, so that each IoT device updates the local model based on the model correction parameters to obtain the target privacy detection model, that is, to obtain the final trained model and end the training process.

[0077] If the server detects that the model correction parameters do not meet the end conditions of federated learning, it will simultaneously send training continuation instructions to each IoT device, so that each IoT device updates the local model based on the model correction parameters, and returns to train the updated local model based on the local training data to upload the trained model parameters to the server, that is, to perform the next round of training steps until the obtained model correction parameters meet the end conditions of federated learning.

[0078] In this embodiment, the termination condition of federated learning may be that a preset accuracy or performance index is achieved, the parameter change of the local model is small enough, the set maximum number of training rounds or iterations is reached, etc. This application does not impose any restrictions on this.

[0079] This concludes Figure 1 Description of the flowchart of the privacy detection method based on similarity alignment federated learning.

[0080] The present application first performs a preliminary screening of the IoT devices that may be poisoned by using the model parameters trained locally on each IoT device, and then further uses the model parameters uploaded by the screened IoT devices that may be poisoned to determine the target IoT devices that are truly poisoned, and then continues to perform federated learning on the non-poisoned IoT devices except the poisoned target IoT devices to train the global model, thereby avoiding the impact of the poisoned target IoT devices on the training of the global model and improving the accuracy of the finally trained global model, such as the IoT privacy detection model.

[0081] At the same time, the embodiment of the present application inputs the local data of each IoT device into at least two decoupled network layers in the neural network model to obtain more evenly distributed training data, and further trains the local model with the training data, which can reduce the problem of decreased accuracy caused by data distribution heterogeneity.

[0082] Combine the following Figure 2 The overall process of the federated learning process in this embodiment is briefly introduced through a specific example.

[0083] Please refer to Figure 2 , Figure 2A schematic diagram of the overall flow of the federated learning process provided in the embodiment of the present application.

[0084] like Figure 2 As shown in the figure, the overall process of federated learning includes: In the initialization phase, a privacy leakage detection model is initialized on the server side, recorded as the initial model, and the initial model is sent to each IoT device.

[0085] After receiving the initial model, the IoT device uses the initial model as the local model, trains the local model according to the local training data of the IoT device to obtain the parameters of the trained model, and uploads the model parameters to the server. The local training data is obtained by sequentially inputting the local original data into the neural network model to decouple a feature extractor, a first classifier, and a second classifier. The first classifier uses a cross entropy loss function based on mini-batch logit adjustment, and the second classifier uses a cross entropy loss function.

[0086] Furthermore, the server determines the poisoned target IoT device based on the model parameters uploaded by each IoT device.

[0087] Specifically, when receiving the model parameters uploaded by each IoT device, the server performs weighted averaging on the model parameters uploaded by each IoT device to obtain a first global model parameter, and determines a first cosine similarity between the model parameter uploaded by each IoT device and the first global model parameter.

[0088] The IoT devices are grouped according to the relationship between the first cosine similarity and the first threshold value, and a group of IoT devices suspected of being poisoned and a group of IoT devices that are normal are determined.

[0089] A second global model parameter is obtained by weighted averaging the model parameters uploaded by each IoT device in the IoT device suspected poisoning group, and a second cosine similarity between the model parameter uploaded by each IoT device in the IoT device suspected poisoning group and the second global model parameter is determined.

[0090] For the model parameters uploaded by each IoT device in the IoT device suspected of being poisoned group, the first cosine similarity and the second cosine similarity corresponding to the model parameters are normalized to obtain a normalized result, and the IoT device corresponding to the model parameter whose normalized result is a first value is determined as the target IoT device.

[0091] This concludes the process of determining the target IoT device.

[0092] If it is determined that the target IoT device exists, the model parameters uploaded by the target IoT device are removed. If it is determined that the target IoT device does not exist, or the model parameters uploaded by the target IoT device have been removed, the server performs weighted averaging on the model parameters uploaded by IoT devices other than the target IoT device to obtain the model correction parameters.

[0093] If it is determined that the model correction parameters meet the end conditions of federated learning, the server will send the model correction parameters to each IoT device and instruct each IoT device to update the local model according to the model correction parameters to obtain the target privacy detection model.

[0094] If it is determined that the model correction parameters do not meet the end conditions of federated learning, the server will send the model correction parameters to each IoT device, and instruct each IoT device to update the local model according to the model correction parameters and return to the step of the IoT device training the local model according to the training data to obtain the model parameters until the model correction parameters meet the end conditions of federated learning.

[0095] This ends the Figure 2 Description of the overall flow chart of the federated learning process.

[0096] Please refer to Figure 3 , Figure 3 Schematic diagram of a privacy detection system based on similarity-aligned federated learning provided in an embodiment of the present application.

[0097] like Figure 3 As shown in the figure, the privacy detection system based on similarity alignment federated learning includes: The server is used to execute Figure 1 The method shown; Multiple IoT devices, wherein any IoT device is used to train a local model based on local training data to obtain parameters of the trained model, and upload the parameters of the trained model to a server.

[0098] In this embodiment, the server manages n IoT devices, namely IoT device 1 to IoT device n. When any IoT device receives the initial model sent by the server, it uses the initial model as the local model and executes the steps of training the local model based on the local training data to obtain the parameters of the trained model.

[0099] When any IoT device receives the model correction parameters and the training end indication sent by the server, it updates the local model based on the model correction parameters to obtain the target privacy detection model; When any IoT device receives the model correction parameters and training continuation indication sent by the server, it updates the local model based on the model correction parameters and trains the updated local model based on the local training data to upload the parameters of the trained model to the server.

[0100] Since the roles of the server and IoT devices included in the privacy detection system based on similarity alignment federated learning have been described in detail above, they will not be repeated here.

[0101] This concludes Figure 3 Description of the privacy detection system based on similarity-aligned federated learning in.

[0102] Please refer to Figure 4 , Figure 4 It is a schematic structural diagram of an electronic device proposed in an embodiment of the present application. At the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and of course may also include hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a terminal interaction device at the logical level. Of course, in addition to the software implementation method, this application does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0103] Please refer to Figure 5 , Figure 5 is a structural diagram of a privacy detection device based on similarity alignment federated learning proposed in an embodiment of the present application, and the device is applied to the server. Figure 5 As shown, the privacy detection device based on similarity alignment federated learning may include a first determination unit 501, a grouping unit 502, a second determination unit 503 and a correction unit 504. Specifically, the device includes: The first determination unit 501 is used to determine the first global model parameters according to the model parameters uploaded by each IoT device; the model parameters uploaded by any IoT device are the parameters of the trained model obtained by the IoT device after training the local model based on the local training data, and the local training data of any IoT device is obtained through at least two network layers, and the at least two network layers are decoupled network layers in the neural network model; The grouping unit 502 is used to group the IoT devices into a suspected poisoning group and a normal group based on the first similarity between the model parameters uploaded by the IoT devices and the first global model parameters; and determine the second global model parameters using the model parameters uploaded by the IoT devices in the suspected poisoning group; The second determining unit 503 is used to determine the target IoT device based on the model parameters uploaded by each IoT device in the group of IoT devices suspected of being poisoned, the first global model parameters, and the second global model parameters; the target IoT device is a poisoned IoT device; The correction unit 504 is used to determine the model correction parameters using the model parameters uploaded by other IoT devices except the target IoT device, send the model correction parameters to each IoT device, and instruct each IoT device to update the local model based on the model correction parameters to obtain the target privacy detection model when the model correction parameters meet the set federated learning termination conditions; the target privacy detection model is used to detect IoT privacy data; when the model correction parameters do not meet the set federated learning termination conditions, instruct each IoT device to update the local model based on the model correction parameters and train the updated local model based on the local training data to upload the parameters of the trained model to the server.

[0104] Optionally, the first determining unit 501 is specifically configured to: The model parameters uploaded by each IoT device are weighted averaged to obtain a first global model parameter; The grouping unit 502 is specifically used for: The model parameters uploaded by each IoT device in the IoT device suspected poisoning group are weighted averaged to obtain the second global model parameters.

[0105] Optionally, the grouping unit 502 is specifically configured to: If the first similarity is less than the first threshold, it is determined that the IoT device that uploaded the model parameters belongs to the group of IoT devices suspected of being poisoned; If the first similarity is greater than or equal to the first threshold, it is determined that the IoT device that uploaded the model parameters belongs to the normal group of IoT devices.

[0106] Optionally, the second determining unit 503 is specifically configured to: For each IoT device in the suspected poisoning group, determine the first similarity between the model parameters uploaded by the IoT device and the first global model parameters, and determine the second similarity between the model parameters uploaded by the IoT device and the second global privacy model; perform specified operation processing on the first similarity and the second similarity to obtain an operation result, and determine whether the IoT device is the target IoT device based on the operation result.

[0107] Optionally, the second determining unit 503 is specifically configured to: normalize the first similarity and the second similarity; Determining whether the IoT device is the target IoT device based on the calculation result includes: if the normalization processing result is a first value, determining that the IoT device that uploads the model parameters is the target IoT device; if the normalization processing result is not the first value, determining that the IoT device that uploads the model parameters is not the target IoT device.

[0108] Optionally, the second determining unit 503 is specifically configured to: An addition operation is performed on the first similarity and the second similarity to obtain a normalized processing result.

[0109] Optionally, at least two network layers include: The decoupled feature extractor, the first classifier and the second classifier in the neural network model; The first classifier and the second classifier are configured with different loss functions; The local training data is obtained through the following steps: The preset original data is first input into the decoupled feature extractor to obtain data features, and the data features are input into the first classifier to obtain a first classification result, and then the first classification result is input into the second classifier to obtain; or, The existing local training data is first input into the decoupled feature extractor to obtain data features, and the data features are input into the first classifier to obtain a first classification result, and then the first classification result is input into the second classifier to obtain.

[0110] Optionally, the loss function configured for the first classifier is a cross entropy loss function adjusted based on mini-batch logit, and the loss function configured for the second classifier is a cross entropy loss function.

[0111] So far, completed Figure 5 Description of the privacy detection device based on similarity alignment federated learning.

[0112] Correspondingly, in this embodiment, the embodiment of the present application also provides a computer-readable storage medium, on which a number of computer instructions are stored. When the computer instructions are executed, the method disclosed in the above example of the present application can be implemented.

[0113] Exemplarily, the computer-readable storage medium may be any electronic, magnetic, optical or other physical storage device that may contain or store information, such as executable instructions, data, etc. For example, the computer-readable storage medium may be: RAM (Radom Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state drive, any type of storage disk (such as optical disk, DVD, etc.), or similar storage medium, or a combination thereof.

[0114] The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the scope of protection of the present application.

Claims

1. A privacy detection method based on similarity alignment federated learning, It is characterized in that The method is applied to the server, and the method comprises: Determine the first global model parameter according to the model parameters uploaded by each IoT device; the model parameters uploaded by any IoT device are the parameters of the trained model obtained by the IoT device after training the local model based on the local training data, and the local training data of any IoT device is obtained through at least two network layers, and the at least two network layers are decoupled network layers in the neural network model; Based on the first similarity between the model parameters uploaded by each IoT device and the first global model parameters, grouping each IoT device into a suspected poisoning group and a normal group; determining the second global model parameters using the model parameters uploaded by each IoT device in the suspected poisoning group; Determine a target IoT device based on the model parameters uploaded by each IoT device in the group of IoT devices suspected of being poisoned, the first global model parameters, and the second global model parameters; the target IoT device is a poisoned IoT device; Model correction parameters are determined using model parameters uploaded by other IoT devices except the target IoT device, and the model correction parameters are sent to each IoT device. When the model correction parameters meet the set federated learning termination conditions, each IoT device is instructed to update the local model based on the model correction parameters to obtain a target privacy detection model; the target privacy detection model is used to detect IoT privacy data; when the model correction parameters do not meet the set federated learning termination conditions, each IoT device is instructed to update the local model based on the model correction parameters and train the updated local model based on local training data to upload the parameters of the trained model to the server.

2. The method according to claim 1, It is characterized in that The step of determining the first global model parameter according to the received model parameters uploaded by each IoT device includes: Obtaining the first global model parameter by weighted averaging the model parameters uploaded by each IoT device; The method of determining the second global model parameter by using the model parameters uploaded by each IoT device in the group of IoT devices suspected of being poisoned includes: The second global model parameter is obtained by weighted averaging the model parameters uploaded by each IoT device in the IoT device suspected poisoning group.

3. The method according to claim 1, It is characterized in that The step of grouping each IoT device to obtain a suspected poisoning group and a normal group based on the first similarity between the model parameter uploaded by each IoT device and the first global model parameter includes: If the first similarity is less than a first threshold, it is determined that the IoT device that uploaded the model parameters belongs to the IoT device suspected poisoning group; If the first similarity is greater than or equal to a first threshold, it is determined that the IoT device that uploaded the model parameters belongs to the normal group of IoT devices.

4. The method according to claim 1, It is characterized in that The determining the target IoT device based on the model parameters uploaded by each IoT device in the IoT device suspected poisoning group, the first global model parameters, and the second global model parameters includes: For each IoT device in the suspected poisoning group, determine a first similarity between the model parameters uploaded by the IoT device and the first global model parameters, and determine a second similarity between the model parameters uploaded by the IoT device and the second global privacy model; perform specified operation processing on the first similarity and the second similarity to obtain an operation result, and determine whether the IoT device is a target IoT device based on the operation result.

5. The method according to claim 4, It is characterized in that The performing the designated operation processing on the first similarity and the second similarity includes: normalizing the first similarity and the second similarity; Determining whether the IoT device is the target IoT device based on the calculation result includes: if the normalization processing result is a first value, determining that the IoT device that uploads the model parameters is the target IoT device; if the normalization processing result is not the first value, determining that the IoT device that uploads the model parameters is not the target IoT device.

6. The method according to claim 5, It is characterized in that The normalizing the first similarity and the second similarity comprises: An addition operation is performed on the first similarity and the second similarity to obtain a normalized processing result.

7. The method according to claim 1, It is characterized in that The at least two network layers include: A decoupled feature extractor, a first classifier, and a second classifier in the neural network model; The first classifier and the second classifier are configured with different loss functions; The local training data is obtained by following the steps below: The preset original data is first input into the decoupled feature extractor to obtain data features, and the data features are input into the first classifier to obtain a first classification result, and then the first classification result is input into the second classifier to obtain; or, The existing local training data is first input into the decoupled feature extractor to obtain data features, and the data features are input into the first classifier to obtain a first classification result, and then the first classification result is input into the second classifier to obtain.

8. The method according to claim 7, It is characterized in that The loss function configured for the first classifier is a cross entropy loss function adjusted based on a small batch of logits, and the loss function configured for the second classifier is a cross entropy loss function.

9. A privacy detection system based on similarity alignment federated learning, It is characterized in that The system includes: A server, configured to execute the method according to any one of claims 1 to 8; Multiple IoT devices, wherein any IoT device is used to obtain parameters of a trained model after training a local model based on local training data, and upload the parameters of the trained model to the server.

10. The system according to claim 9, It is characterized in that Any IoT device is used to, upon receiving the initial model sent by the server, use the initial model as the local model and execute the step of training the local model based on the local training data to obtain the parameters of the trained model; When any IoT device receives the model correction parameters and the training end indication sent by the server, it updates the local model based on the model correction parameters to obtain the target privacy detection model; When any IoT device receives the model correction parameters and training continuation indication sent by the server, it updates the local model based on the model correction parameters and trains the updated local model based on the local training data to upload the parameters of the trained model to the server.

Citation Information

Patent Citations

  • Federation learning poisoning attack detection method, device and equipment

    CN112528281A

  • Clue language automatic recognition model training method and device, storage medium and equipment

    CN114445909A

  • Federal learning security aggregation method and system for distributed load prediction

    CN117010483A

  • Poison attack detection and punishment method and system based on deep reinforcement learning

    CN117972700A

  • Procedure and control arrangement for the combined training of a vehicle fleet

    DE102021126378A1