A method, system and device for copyright protection of federated learning based on activation graph
By embedding the activation map of the watermark to the model in the federated learning environment and using detectors and extractors to identify the malicious model, the problem of model leakage risk in federated learning is solved, and effective traceability and security improvement of malicious clients are achieved.
Patent Information
- Application Number
- CN202410942884.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-07-15
AI Technical Summary
In a federated learning environment, the risk of model leakage exists, and existing watermarking technology can only verify model ownership and cannot trace back to potential leakers, resulting in security threats.
By building and pre-training the detector, a Gaussian noise trigger set of different intensities is generated, the watermark information is embedded into the activation diagram of the model, the malicious model is identified using the projection model and the watermark extractor, and the key and projection secret are extracted through feature Key traceability malicious clients.
Effectively identify and filter malicious models, prevent model attacks, enhance system defense capabilities, optimize watermark concealment and model performance, track malicious clients that steal models, and improve security.
Smart Images

Figure CN118468250B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence privacy protection technology, and specifically to an activation graph-based federated learning copyright protection method, system and device. Background Art
[0002] Federated learning, as a distributed learning framework for protecting user data privacy, has been widely used in fields such as bank loans, medical image analysis, and object detection. Its main advantage is that it allows model training without sharing original data, thereby promoting cooperation between different organizations and entities, improving the comprehensiveness and robustness of the model, and effectively protecting user privacy. However, training an efficient deep neural network (DNN) model is a costly process that requires a large amount of data and extensive computing resources. Federated learning also faces the risk of model leakage, that is, malicious clients may compromise the security of the system, posing a serious threat to privacy protection functions and results.
[0003] In the context of federated learning, model stealing attacks are a serious security threat that may lead to infringement of model ownership. To address this problem, watermarking technology has been proposed as an effective solution. Watermarking technology allows researchers to embed an imperceptible mark in the model, so that the original ownership of the model can be verified when it is illegally copied and used. This technology is usually divided into two categories: client-side watermarking and server-side watermarking. Client-side watermarking refers to embedding watermarks during client training, while server-side watermarking refers to adding watermarks by the central server after model aggregation. Although watermarking technology plays an important role in ensuring model ownership, in the context of federated learning, simply verifying model ownership cannot fully meet security requirements, because federated learning involves multiple collaborators training a shared model together, which may introduce the risk of model leakage, and any of the participants may become a potential source of leakage. Therefore, in addition to verifying model ownership, there is an urgent need for a mechanism to trace back potential model leakers. To this end, we propose a copyright protection method, system, and device for federated learning based on activation graphs. Summary of the invention
[0004] In a first aspect, the present invention aims to provide a method, system and device for copyright protection of federated learning based on activation graph to solve the problems raised in the above-mentioned background technology.
[0005] To achieve the above object, the present invention provides the following technical solution: a method for copyright protection of federated learning based on activation graph, which specifically includes the following steps:
[0006] S1. Build a detector and pre-train the detector;
[0007] S2. Define a normal distribution for each client The latent space and a constraint , in order to generate Gaussian noise trigger sets of different intensities, the trigger sets are input into the model to obtain the activation map of a certain layer, and the projection model is constructed at the same time , the watermark information is seamlessly embedded into the activation map of the corresponding layer of the client model, and the model containing the watermark information is recorded as the watermark model , the model that does not contain watermark information is recorded as the non-watermark model;
[0008] S3. Save the projection model parameters of each round, distribute the watermark model to each client, and each client uses local data to train the watermark model. After the training is completed, the client uploads the updated watermark model to the server;
[0009] S4. Use the trained detector to comprehensively detect each updated watermark model, identify and filter out watermark models containing malicious modifications or potential risks;
[0010] S5. After confirming the security of each watermark model, the server uses a federated learning algorithm to aggregate each updated watermark model, generates a global model by calculating the weighted average of each watermark model parameter, and repeats the above steps S2-S5 to repeatedly train the global model until it meets the accuracy requirements;
[0011] S6. After the global model training is completed, save it as the client normal distribution The potential space and constraints , parameters of the projection model, which are used to trace malicious clients later;
[0012] S7. In the face of suspicious models, the client's normal distribution saved by the server and constraints Parameters, Projection Model Extract the watermark of the suspicious model , and matches it with the other client watermarks one by one. If the matching rate is greater than the preset threshold, the corresponding client is regarded as a malicious client that leaks the model.
[0013] Furthermore, the detector is pre-trained, including the following steps:
[0014] (1) From a normal distribution defined for each client The server inputs the client's trigger set samples into the normal model and the malicious model to obtain the corresponding activation map, and then uses The activation maps were normalized and evaluated using mean squared error as follows:
[0015]
[0016]
[0017] Where N is the number of clients. and They represent the activation map and normalized activation map sent by the nth client in the tth round, respectively. represents the normalized activation map uploaded by the nth client in round t, is the mean square error of the nth client in the tth round, is the mean square error;
[0018] (2) We choose to use the stochastic gradient descent algorithm to adjust the network weight parameters to optimize the detector model. We set the learning rate of the algorithm to 0.01 and conduct 100 training cycles. During the training process, the detector will learn to recognize the subtle differences between the activation maps produced by different models, thereby being able to effectively distinguish the outputs of normal models from various malicious models.
[0019] Furthermore, watermarks are embedded in multiple client models. Embedded into the target model's secret choice Layer, as follows:
[0020] Watermark regularization term is defined as:
[0021]
[0022] In the formula, is the projection model, is the watermark extractor, yes The watermarked version of It is a random watermark. is the watermark of the nth client, is the watermark distance metric, TS is the trigger set sample from the latent space, is the secret extraction key;
[0023] Global Embedding Loss as follows:
[0024]
[0025] In the formula, is the original target model loss term, is the watermark regularization term, Is to adjust the original target model loss term and watermark regularization term The trade-off between is the feature of the training set, is the label of the training set;
[0026] The parameters of are updated accordingly according to the following regularization term to maintain the accuracy of the original target model and minimize the projection and watermark of the activation map The distance between
[0027]
[0028] In the formula, Represents the watermark model The model parameter weights, is the original target model loss term, are the characteristics of the training set, is the label of the training set, is the projection model, Is to adjust the original target model loss term and watermark regularization term The trade-off between is the watermark distance metric, is the watermark extractor, TS is the trigger set sample from the latent space, is the secret extraction key, is the watermark of the nth client, yes The watermarked version of
[0029] Parameters Update according to the following regularization term:
[0030]
[0031] In the formula, Is to adjust the original target model loss term and watermark regularization term The trade-off between is the watermark distance metric, is the projection model, is the watermark extractor, is the watermark model, TS is the trigger set sample from the latent space, is the secret extraction key, is an irrelevant projection model, It is Client watermark, It is a random watermark. It is a projection model Related parameters of
[0032] Furthermore, the projection model The watermark model The activation map is mapped to the watermark , maps the activation map of the non-watermarked model to a random watermark ,Will arrive The projection of the trigger set activation map and arrive The projection of the trigger set activation map is associated with and Shared functions in updates , used to implement the parameters and , so that the projection of the activation map is close to , without affecting the classification accuracy of the model, and for It is the only one.
[0033] Furthermore, the trained detector is used to perform a comprehensive test on each updated watermark model. The specific steps are as follows:
[0034] (1) Input the trigger set samples into the client uploaded model to obtain the activation map of the corresponding layer;
[0035] (2) The detector compares the activation map before the previous round with the activation map obtained in this round to obtain the value ;
[0036] (3) The obtained value With dynamic threshold Compare, greater than the dynamic threshold Value The corresponding watermark model is the watermark model of malicious modification or potential risk.
[0037] Furthermore, each updated watermark model is aggregated, and a global model is generated by calculating the weighted average of the parameters of each watermark model. The specific steps are as follows:
[0038] (1) The server will With dynamic threshold For comparison, the value Not greater than the dynamic threshold , then the corresponding watermark model is applied to the aggregation process of federated learning, as follows:
[0039]
[0040] In the formula, For federated learning The threshold of the wheel, is the mean square error of the nth client in the tth round, where N represents the number of clients;
[0041] (2) The server aggregates the models of benign clients as follows:
[0042] .
[0043] In the formula, represents the global model of round t, represents the model of the nth client in the tth round, where N represents the number of clients;
[0044] Furthermore, watermark The extraction is as follows:
[0045]
[0046] In the formula, For suspicious watermark models, Extract the key for the feature, is the projection key, is the potential space, is the watermark extracted from the client model, TS is the trigger set sample from the latent space, CE is the cross entropy function, is the mean, is the watermark extractor, The projection model.
[0047] Furthermore, the tracing of the malicious client that leaked the model includes the following specific steps:
[0048] (1) The server will generate a trigger set sample using the specific parameters saved for the relevant client, which includes a client-specific normal distribution and constraints The generated trigger set samples are input into the suspected malicious model, and the corresponding activation map is generated through the model's reaction, and the corresponding activation map is input into the projection model Extract watermark ;
[0049] (2) Extract the watermark The watermark set predefined by the server for each client Matching is performed. If the matching rate is greater than the preset threshold, the corresponding client is regarded as a malicious client that leaks the model. Specifically:
[0050] .
[0051] In the formula, Matches characters one by one. It is Client watermark, is the watermark extracted from the client model, is a pre-set threshold, is the matching rate;
[0052] According to a second aspect of the present invention, the present invention provides a federated learning copyright protection system based on an activation graph, comprising:
[0053] A pre-training module, used to build and pre-train a detector;
[0054] Watermark embedding module, used to define a normal distribution for each client The latent space and a constraint , in order to generate Gaussian noise trigger sets of different intensities, the trigger sets are input into the model to obtain the activation map of a certain layer, and the projection model is constructed at the same time , the watermark information is seamlessly embedded into the activation map of the corresponding layer of the client model, and the model containing the watermark information is recorded as the watermark model , the model that does not contain watermark information is recorded as the non-watermark model;
[0055] The watermark model training module is used to save the projection model parameters of each round and distribute the watermark model to each client. Each client uses local data to train the watermark model. After the training is completed, the client uploads the updated watermark model to the server.
[0056] The detection module is used to use the trained detector to comprehensively detect each updated watermark model, identify and filter out watermark models containing malicious modifications or potential risks;
[0057] Aggregation module, used for, after confirming the security of each watermark model, the server uses the federated learning algorithm to aggregate each updated watermark model, generates a global model by calculating the weighted average of each watermark model parameter, and repeats the above operation to repeatedly train the global model until it meets the accuracy requirements;
[0058] The data saving module is used to save the data as the client normal distribution after the global model training is completed. The potential space and constraints , parameters of the projection model, which are used to trace malicious clients later;
[0059] Malicious client tracing module, used to obtain the normal distribution of the client saved by the server and constraints Parameters, Projection Model Extract the watermark of the suspicious model , and matches it with the other client watermarks one by one. If the matching rate is greater than the preset threshold, the corresponding client is regarded as a malicious client that leaks the model.
[0060] According to a third aspect of the present invention, the present invention provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the memory stores a computer program capable of running on the processor, and when the processor loads and executes the computer program, the activation graph-based federated learning copyright protection method is adopted.
[0061] The present invention has at least the following beneficial effects:
[0062] 1. This invention embeds the watermark directly into the activation map of the model instead of the traditional weight matrix. The advantage of this is that the watermark embedding process can be more finely controlled, thereby minimizing the impact on model performance. To achieve this goal, the server adopts a generative adversarial network (GAN) strategy to optimize the watermark embedding process through adversarial training to ensure the concealment of the watermark and its impact on the activation map as small as possible.
[0063] 2. In order to prevent malicious clients from destroying the effect of model aggregation or removing watermarks by modifying the model, the present invention provides a well-trained detector that can effectively identify and filter out models containing malicious behaviors. This detection mechanism greatly enhances the system's defense capabilities against various model attacks, including model parameter attacks (PA), adversarial sample attacks (FTA), model output attacks (OA), weight quantization attacks (WKA) and parameter injection attacks (PIA).
[0064] 3. The server of the present invention assigns a set of unique parameters, including mean, standard deviation and noise constraints, to each participating client, thereby generating a specific noise image. Watermarks can be effectively inserted in each round or several rounds of federated learning model update process. Each client model is embedded with a unique watermark. By comparing the watermarks in different models, malicious clients that steal models can be effectively identified and tracked. This copyright protection technology based on activation graphs not only optimizes the concealment of watermarks and the overall performance of the system, but also enhances the practicality and security of the model in real-world applications.
[0065] 4. The present invention also introduces the concepts of feature extraction keys and projection keys, which are used to extract watermarks in the model during the verification phase. By comparing the distance between the extracted watermark and the predefined client target watermark, the ownership of the model can be effectively verified and the malicious client that potentially leaked the model can be tracked down.
[0066] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1A schematic diagram of generating trigger set samples in the present invention;
[0068] Figure 2 A schematic diagram of the detector pre-training in the present invention;
[0069] Figure 3 A schematic diagram of watermark embedding on the server side in the present invention;
[0070] Figure 4 A schematic diagram of secure aggregation of the federated learning model in the present invention;
[0071] Figure 5 A flowchart of tracing back malicious clients in the present invention;
[0072] Figure 6 This is the overall framework diagram of the copyright protection of federated learning in the present invention. DETAILED DESCRIPTION
[0073] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0074] Embodiment 1:
[0075] See also Figure 1-6 The present invention provides a technical solution: a method for copyright protection of federated learning based on activation graph, which specifically includes the following steps:
[0076] S1. Build a detector and pre-train the detector as follows:
[0077] (1) From a normal distribution defined for each client The server inputs the client's trigger set samples into the normal model and the malicious model to obtain the corresponding activation map, and then uses The activation maps were normalized and evaluated using the mean squared error (MSE) as follows:
[0078]
[0079]
[0080] In the formula, and They represent the activation map and normalized activation map sent by the nth client in the tth round, respectively. represents the normalized activation map uploaded by the nth client in round t, is the mean square error of the tth round of the nth client, and MSE is the mean square error;
[0081] (2) We choose to use the stochastic gradient descent (SGD) algorithm to adjust the network weight parameters to optimize the detector model. We set the learning rate of the algorithm to 0.01 and conduct 100 training cycles (epochs). During the training process, the detector will learn to recognize the subtle differences between the activation maps produced by different models, so that it can effectively distinguish the outputs of normal models from various malicious models.
[0082] like Figure 2 As shown, the following further explanation is needed for the pre-training detector process:
[0083] The trigger set samples are input into the normal model and different malicious models. Each model generates a series of activation maps based on the input samples. These activation maps are actually the output of the network at each layer and can be regarded as the internal representation of the input data by the network. These activation maps are labeled according to the properties of the source model. That is, the activation map obtained from the normal model is marked as "normal", while the activation map obtained from the malicious model is marked with the specific label corresponding to the malicious model. The detector analyzes the activation map of the corresponding model and identifies the distribution anomaly caused by malicious operations.
[0084] S2. Define a normal distribution for each client The latent space and a constraint , in order to generate Gaussian noise trigger sets of different intensities, the trigger sets are input into the model to obtain the activation map of a certain layer, and the projection model is constructed at the same time , seamlessly embed the watermark information into the activation map of the corresponding layer of the client model, and project the model Used to distinguish models containing watermark information (watermark model ) and the model without watermark information (non-watermark model);
[0085] According to the technical solution of this embodiment, the server Embedded into the target model's secret choice Watermark regularization term in the layer is defined as:
[0086]
[0087] In the formula, is the projection model, is the watermark extractor, yes The watermarked version of It is a random watermark. is the watermark of the nth client, is the watermark distance metric, TS is the trigger set sample from the latent space, is the secret extraction key;
[0088] Global Embedding Loss as follows:
[0089]
[0090] In the formula, is the original target model loss term, is the watermark regularization term, Is to adjust the original target model loss term and watermark regularization term The trade-off between are the characteristics of the training set, is the label of the training set;
[0091] The parameters of are updated accordingly according to the following regularization term to maintain the accuracy of the original target model and minimize the projection and watermark of the activation map The distance between
[0092]
[0093] In the formula, Represents the watermark model The model parameter weights, is the original target model loss term, are the characteristics of the training set, is the label of the training set, is the projection model, Is to adjust the original target model loss term and watermark regularization term The trade-off between is the watermark distance metric, is the watermark extractor, TS is the trigger set sample from the latent space, is the secret extraction key, is the watermark of the nth client, yes The watermarked version of
[0094] Parameters Update according to the following regularization term:
[0095]
[0096] In the formula, Is to adjust the original target model loss term and watermark regularization term The trade-off between is the watermark distance metric, is the projection model, is the watermark extractor, is the watermark model, TS is the trigger set sample from the latent space, is the secret extraction key, is an irrelevant projection model, It is Client watermark, It is a random watermark. It is a projection model Related parameters of
[0097] Furthermore, the projection model The watermark model The activation map is mapped to the watermark , maps the activation map of the non-watermarked model to a random watermark ,Will arrive The projection of the trigger set activation map and arrive The projection of the trigger set activation map is associated with and Shared functions in updates , used to implement the parameters and , so that the projection of the activation map is close to , without affecting the classification accuracy of the model, and for is unique, during training and The parameters of are trained together with the embedding process to achieve fast convergence;
[0098] Furthermore, the following Figure 1 and Figure 6 Detailed description of generating trigger set samples:
[0099] The server sets a latent space for each client independently, whose characteristics follow a normal distribution ,in represents the mean, Represents the standard deviation and sets a constraint , so that the noise intensity generated by each client is different. This setting enables each client to infinitely sample images from its own latent space, thus forming a trigger set sample;
[0100] S3. Save the projection model parameters of each round, distribute the watermark model to each client, and each client uses local data to train the watermark model. After the training is completed, the client uploads the updated watermark model to the server, as follows:
[0101] (1) The client receives the global model from the server , using local dataset for training.
[0102] (2) After training, the client will use the locally trained model Re-upload the server;
[0103] S4. Use the trained detector to perform comprehensive detection on each updated watermark model to identify and filter out watermark models containing malicious modifications or potential risks, as follows:
[0104] (1) Input the trigger set samples into the client uploaded model to obtain the activation map of the corresponding layer;
[0105] (2) The detector compares the activation map before the previous round with the activation map obtained in this round to obtain the value ;
[0106] (3) The obtained value With dynamic threshold Compare, greater than the dynamic threshold Value The corresponding watermark model is the watermark model with malicious modification or potential risk;
[0107] S5. After confirming the security of each watermark model, the server uses the FedAvg algorithm (federated average algorithm) to aggregate each updated watermark model, generates a global model by calculating the weighted average of each watermark model parameter, and repeats steps S2-S5 to train the global model until it meets the accuracy requirements;
[0108] Aggregate each updated watermark model and generate a global model by calculating the weighted average of each watermark model parameter , the specific steps are as follows:
[0109] (1) The server will With dynamic threshold Compare, if the value Greater than dynamic threshold , then it does not participate in the aggregation of federated learning, otherwise it participates in the aggregation. The aggregation process is as follows:
[0110]
[0111] In the formula, For federated learning The threshold of the wheel, is the mean square error of the nth client in the tth round,
[0112] N is for Client Overview
[0113] (2) The server aggregates the models of benign clients as follows:
[0114]
[0115] In the formula, represents the global model of round t, represents the model of the nth client in the tth round, where N represents the number of clients;
[0116] The following is combined with Figure 3 , attached Figure 4 and attached Figure 6 A detailed description of server-side watermark embedding and federated learning security aggregation:
[0117] In order to perform the image classification task, this embodiment uses the ResNet-18 model as the global model in the federated learning environment and uses the CIFAR-10 dataset as the training set D of the client. train CIFAR-10 is a widely used dataset containing 60,000 color images, of which the training set consists of 50,000 images and the test set includes 10,000 images. Each category contains 5,000 and 1,000 images in the training set and test set respectively. These images are distributed in ten categories to ensure the diversity and representativeness of the data.
[0118] The ResNet-18 model is a deep convolutional neural network with 18 layers, including convolutional layers, batch normalization layers, ReLU activation functions, and feature-enhanced residual blocks. In order to extract effective feature representations, we choose to extract activation maps in the penultimate convolutional layer of the model. These activation maps provide key visual information and are suitable for subsequent learning and classification tasks;
[0119] During the training process, the batch size is set to 256 and the initial learning rate is set to 0.1. In order to optimize the training process and adapt to the learning needs of different stages, this example uses the CosineAnnealing function to dynamically adjust the learning rate. This method can gradually reduce the learning rate according to the progress of the training cycle, thereby helping the model to converge stably in the later stage of training, improving the learning efficiency and the generalization ability of the model. This strategy can effectively improve the performance of the model for image classification tasks, especially when dealing with highly nonlinear and complex data structures;
[0120] S6. After the global model training is completed, save it as the client normal distribution The potential space and constraints , parameters of the projection model, which are used to trace malicious clients later;
[0121] S7. In the face of suspicious models, the client's normal distribution saved by the server and constraints Parameters, Projection Model Extract the watermark of the suspicious model , and match it with the other client watermarks one by one. If the matching rate is greater than the preset threshold, the corresponding client is regarded as a malicious client that leaks the model;
[0122] To trace back the malicious client that leaked the model, the specific steps are as follows:
[0123] (1) The server will generate a trigger set sample using the specific parameters saved for this client, which include a client-specific normal distribution and constraints The generated trigger set samples are input into the suspected malicious model, and the corresponding activation map is generated through the model's reaction, and the corresponding activation map is input into the projection model Extract watermark ;
[0124] (2) Extract the watermark The watermark set predefined by the server for each client Matching is performed. If the matching rate is greater than the preset threshold, the corresponding client is regarded as a malicious client that leaks the model. Specifically:
[0125] .
[0126] In the formula, Matches characters one by one. It is Client watermark, is the watermark extracted from the client model, is a pre-set threshold, is the matching rate;
[0127] Furthermore, watermark The extraction is as follows:
[0128]
[0129] In the formula, For suspicious watermark models, Extract the key for the feature, is the projection key, is the potential space, is the watermark extracted from the client model, TS is the trigger set sample from the latent space, CE is the cross entropy function, is the mean, is the watermark extractor, The projection model.
[0130] In summary, the technical solution of the present invention is that the server first assigns a set of unique parameters to each client and generates a special watermark trigger set sample based on these parameters, and then defines a dedicated projection function, which is designed as a deep neural network, which maps the activation map of the watermark model to a watermark, and maps the activation map of the non-watermark model to a random watermark. The present invention also introduces the concepts of feature extraction keys and projection keys, which are used to extract the watermark in the model during the verification phase. By comparing the distance between the extracted watermark and the predefined client target watermark, the ownership of the model can be effectively verified, and the malicious client that potentially leaks the model can be tracked;
[0131] The present invention not only significantly improves the robustness of the model against common attack methods such as fine-tuning, pruning and model coverage attacks, but also effectively reduces the storage complexity in the detection process. Through this method, the security protection capability of the federated learning system can be enhanced without affecting the performance of the model, ensuring the security of data and intellectual property rights.
[0132] Embodiment 2:
[0133] The present invention provides a federated learning copyright protection system based on an activation graph, comprising:
[0134] A pre-training module, used to build and pre-train a detector;
[0135] Watermark embedding module, used to define a normal distribution for each client The latent space and a constraint , in order to generate Gaussian noise trigger sets of different intensities, the trigger sets are input into the model to obtain the activation map of a certain layer, and the projection model is constructed at the same time , the watermark information is seamlessly embedded into the activation map of the corresponding layer of the client model, and the model containing the watermark information is recorded as the watermark model , the model that does not contain watermark information is recorded as the non-watermark model;
[0136] The watermark model training module is used to save the projection model parameters of each round and distribute the watermark model to each client. Each client uses local data to train the watermark model. After the training is completed, the client uploads the updated watermark model to the server.
[0137] The detection module is used to use the trained detector to comprehensively detect each updated watermark model, identify and filter out watermark models containing malicious modifications or potential risks;
[0138] Aggregation module, used for, after confirming the security of each watermark model, the server uses FedAvg algorithm to aggregate each updated watermark model, generates a global model by calculating the weighted average of each watermark model parameter, and repeats the above operation to repeatedly train the global model until it meets the accuracy requirements;
[0139] The data saving module is used to save the data as the client normal distribution after the global model training is completed. The potential space and constraints , parameters of the projection model, which are used to trace malicious clients later;
[0140] Malicious client tracing module, used to obtain the normal distribution of the client saved by the server and constraints Parameters, Projection Model Extract the watermark of the suspicious model , and matches it with the other client watermarks one by one. If the matching rate is greater than the preset threshold, the corresponding client is regarded as a malicious client that leaks the model.
[0141] Specifically, the above-mentioned pre-training module, watermark embedding module, watermark model training module, detection module, aggregation module, data storage module and malicious client tracing module can be embedded in a computer processing system, and the computer calls the above-mentioned modules to complete the task of equivalent modeling according to the above-mentioned method for federated learning copyright protection based on activation map; the above-mentioned pre-training module, watermark embedding module, watermark model training module, detection module, aggregation module, data storage module and malicious client tracing module can perform operations according to the specific steps given in the above-mentioned method for federated learning copyright protection based on activation map.
[0142] It should be noted that it should be understood that the division of the various modules of the above system is only the division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated, and these modules can all be implemented in the form of software calling through processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software calling through processing elements, and some modules can be implemented in the form of hardware. For example, the pre-training module can be a separately established processing element, or it can be integrated in a chip of the above-mentioned device. In addition, it can also be stored in the memory of the above-mentioned device in the form of program code, and called and executed by a processing element of the above-mentioned device. The function of the above signal processing module, and the implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by the hardware integrated logic circuit in the processor element or the instruction in the form of software.
[0143] For example, the above modules can be configured as one or more integrated circuits for implementing the above methods, such as: one or more specific integrated circuits (Application Specific Integrated Circuit, referred to as ASIC), or, one or more microprocessors (Digital Singnal Processor, referred to as DSP), or, one or more field programmable gate arrays (Field Programmable Gate Array, referred to as FPGA), etc. For another example, when a certain module above is implemented in the form of a processing element scheduling program code, the processing element can be a general-purpose processor, such as a central processing unit (Central Processing Unit, referred to as CPU) or other processors that can call program codes. For another example, these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0144] Embodiment three:
[0145] The present invention provides a terminal device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor. The memory stores a computer program capable of running on the processor, and when the processor loads and executes the computer program, the activation graph-based federated learning copyright protection method is adopted.
[0146] It should be noted that the terminal device can be a computer device such as a desktop computer, a laptop computer or a cloud server, and the terminal device includes but is not limited to a processor and a memory. For example, the terminal device can also include input and output devices, network access devices and buses.
[0147] Furthermore, the processor may adopt a central processing module (CPU). Of course, according to actual usage, other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. may also be adopted. The general-purpose processor may adopt a microprocessor or any conventional processor, etc., and this application does not impose any restrictions on this.
[0148] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0149] For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances. When an element is referred to as being "assembled on", "installed on", "fixed on" or "set on" another element, it can be directly on the other element or there can also be a centered element. When an element is considered to be "connected" to another element, it can be directly connected to the other element or there may be a centered element at the same time. The terms "vertical", "horizontal", "up", "down", "left", "right" and similar expressions used herein are only for illustrative purposes and are not intended to be the only implementation method.
[0150] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
[0151] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
Claims
1. A copyright protection method for federated learning based on activation graph, characterized in that: The specific steps include: S1. Build a detector and pre-train the detector; S2. Define a normal distribution for each client The latent space and a constraint , in order to generate Gaussian noise trigger sets of different intensities, the trigger sets are input into the model to obtain the activation map of a certain layer, and the projection model is constructed at the same time , the watermark information is seamlessly embedded into the activation map of the corresponding layer of the client model, and the model containing the watermark information is recorded as the watermark model , the model that does not contain watermark information is recorded as the non-watermark model; S3. Save the projection model parameters of each round, distribute the watermark model to each client, and each client uses local data to train the watermark model. After the training is completed, the client uploads the updated watermark model to the server; S4. Use the trained detector to comprehensively detect each updated watermark model, identify and filter out watermark models containing malicious modifications or potential risks; S5. After confirming the security of each watermark model, the server uses a federated learning algorithm to aggregate each updated watermark model, generates a global model by calculating the weighted average of each watermark model parameter, and repeats the above steps S2-S5 to repeatedly train the global model until it meets the accuracy requirements; S6. After the global model training is completed, save it as the client normal distribution The potential space and constraints , parameters of the projection model, which are used to trace malicious clients later; S7. Normal distribution of all clients saved by the server in the face of suspicious models and constraints Parameters, Projection Model Extract the watermark of the suspicious model , and match them with the client watermarks one by one. If the matching rate is greater than the preset threshold, the corresponding client is regarded as a malicious client that leaks the model; Embed watermarks into multiple client models respectively. Embedded into the target model's secret choice Layer, as follows: Watermark regularization term is defined as: In the formula, is the projection model, is the watermark extractor, yes The watermarked version of It is a random watermark. is the watermark of the nth client, is the watermark distance metric, TS is the trigger set sample from the latent space, is the secret extraction key; Global Embedding Loss as follows: In the formula, is the original target model loss term, is the watermark regularization term, is to adjust the original target model loss term and watermark regularization term The trade-off between is the feature of the training set, is the label of the training set; The parameters of are updated accordingly according to the following regularization term to maintain the accuracy of the original target model and minimize the projection and watermark of the activation map The distance between In the formula, Represents the watermark model The model parameter weights, is the original target model loss term, is the feature of the training set, is the label of the training set, is the projection model, is to adjust the original target model loss term and watermark regularization term The trade-off between is the watermark distance metric, is the watermark extractor, TS is the trigger set sample from the latent space, is the secret extraction key, is the watermark of the nth client, yes The watermarked version of Parameters Update according to the following regularization term: In the formula, is to adjust the original target model loss term and watermark regularization term The trade-off between is the watermark distance metric, is the projection model, is the watermark extractor, is the watermark model, TS is the trigger set sample from the latent space, is the secret extraction key, is an irrelevant projection model, It is Client watermark, It is a random watermark. It is a projection model Related parameters: Aggregate each updated watermark model and generate a global model by calculating the weighted average of each watermark model parameter , the specific steps are as follows: (1) The server will With dynamic threshold For comparison, the value Not greater than the dynamic threshold , then the corresponding watermark model is applied to the aggregation process of federated learning, as follows: In the formula, For federated learning The threshold of the wheel, is the mean square error of the nth client in the tth round, where N represents the number of clients; (2) The server aggregates the models of benign clients as follows: In the formula, represents the global model of round t, represents the model of the nth client in the tth round, where N represents the number of clients; The specific steps of tracing back the malicious client of the leaked model are as follows: (1) The server will generate trigger set samples using the parameters saved for the relevant client, which include the client-specific normal distribution and constraints The generated trigger set samples are input into the suspected malicious model, and the corresponding activation map is generated through the model's reaction, and the corresponding activation map is input into the projection model Extract watermark ; (2) Extract the watermark The watermark set predefined by the server for each client Matching is performed. If the matching rate is greater than the preset threshold, the corresponding client is regarded as a malicious client that leaks the model. Specifically: In the formula, Matches characters one by one. It is Client watermark, is the watermark extracted from the client model, is a pre-set threshold, is the matching rate.
2. The method for copyright protection of federated learning based on activation graph according to claim 1, characterized in that: The pre-training of the detector comprises the following steps: (1) From a normal distribution defined for each client The server inputs the client's trigger set samples into the normal model and the malicious model to obtain the corresponding activation map, and then uses The activation maps were normalized and evaluated using mean squared error as follows: In the formula, and They represent the activation map and normalized activation map of the nth client before sending in the tth round, respectively. represents the normalized activation map uploaded by the nth client in round t, is the mean square error of the nth client in the tth round, is the mean square error; (2) We choose to use the stochastic gradient descent algorithm to adjust the network weight parameters to optimize the detector model. We set the learning rate of the algorithm to 0.01 and conduct 100 training cycles. During the training process, the detector will learn to recognize the subtle differences between the activation maps produced by different models, thereby being able to effectively distinguish the outputs of normal models from various malicious models.
3. The method for copyright protection of federated learning based on activation graph according to claim 2, characterized in that: The projection model The watermark model The activation map is mapped to the watermark , maps the activation map of the non-watermarked model to a random watermark ,Will arrive The projection of the trigger set activation map and arrive The projection of the trigger set activation map is associated with and Shared functions in updates , used to implement the parameters and , so that the projection of the activation map is close to , without affecting the classification accuracy of the model, and for It is unique.
4. The method for copyright protection of federated learning based on activation graph according to claim 3, characterized in that: Use the trained detector to conduct a comprehensive test on each updated watermark model. The specific steps are as follows: (1) Input the trigger set samples into the client uploaded model to obtain the activation map of the corresponding layer; (2) The detector compares the activation map before the previous round with the activation map obtained in this round to obtain the value ; (3) The obtained value With dynamic threshold Compare, greater than the dynamic threshold Value The corresponding watermark model is a watermark model that has been maliciously modified or has potential risks.
5. The method for copyright protection of federated learning based on activation graph according to claim 4, characterized in that: The watermark The extraction is as follows: In the formula, For suspicious watermark models, Extract the key for the feature, is the projection key, is the potential space, is the watermark extracted from the client model, TS is the trigger set sample from the latent space, CE is the cross entropy function, is the mean, is the watermark extractor, The projection model.
6. A system for protecting copyright of federated learning based on activation graph, used to implement a method for protecting copyright of federated learning based on activation graph as claimed in any one of claims 1 to 5, characterized in that: include: A pre-training module, used to build and pre-train a detector; Watermark embedding module, used to define a normal distribution for each client The latent space and a constraint , in order to generate Gaussian noise trigger sets of different intensities, the trigger sets are input into the model to obtain the activation map of a certain layer, and the projection model is constructed at the same time , the watermark information is seamlessly embedded into the activation map of the corresponding layer of the client model, and the model containing the watermark information is recorded as the watermark model , the model that does not contain watermark information is recorded as the non-watermark model; The watermark model training module is used to save the projection model parameters of each round and distribute the watermark model to each client. Each client uses local data to train the watermark model. After the training is completed, the client uploads the updated watermark model to the server. The detection module is used to use the trained detector to comprehensively detect each updated watermark model, identify and filter out watermark models containing malicious modifications or potential risks; Aggregation module, which is used to aggregate the updated watermark models by the server using the federated learning algorithm after confirming the security of each watermark model, generate a global model by calculating the weighted average of the parameters of each watermark model, and repeatedly train the global model until it meets the accuracy requirements; The data saving module is used to save the data as the client normal distribution after the global model training is completed. The potential space and constraints , parameters of the projection model, which are used to trace malicious clients later; Malicious client tracing module, used to obtain the normal distribution of the client saved by the server and constraints Parameters, Projection Model Extract the watermark of the suspicious model , and matches it with the other client watermarks one by one. If the matching rate is greater than the preset threshold, the corresponding client is regarded as a malicious client that leaks the model.
7. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that: The memory stores a computer program that can be run on a processor. When the processor loads and executes the computer program, the activation graph-based federated learning copyright protection method described in any one of claims 1 to 5 is adopted.
Citation Information
Patent Citations
Federal learning-oriented robust traceable copyright protection method and system
CN116881872A
Federal learning image classification method and system oriented to class imbalance
CN116994054A
Federal learning watermark model-based security verification method and related components
CN117609744A
Adaptive electronic design
TW200926033A
System and method for DNN-based cyber-security using federated learning-based generative adversarial network
US20230308465A1
