Personalized federated learning model ownership protection method based on robust watermarking
By adopting robust watermarking technology in personalized federated learning, distinguishing public and private ownership, and detecting malicious clients, the problem of watermark capacity and malicious behavior is solved, and multi-client ownership protection and malicious detection of personalized models are achieved. , ensuring the intellectual property security of the model.
Patent Information
- Application Number
- CN202410669652.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-28
- Publication Date
- 2024-09-20
AI Technical Summary
In personalized federated learning, existing methods have difficulty distinguishing public and private ownership, have limited watermark capacity, and lack a solution for detecting forged watermarks inserted by malicious clients, resulting in poor model ownership protection.
Using a method based on robust watermarking, the server generates a presentation layer watermark for each client and assigns an embedding position. The client locally generates a personalized layer watermark. Through the watermark decoupling embedding and detection mechanism, the server detects and identifies malicious clients, ensuring Correctness and scalability of watermarks.
It achieves effective ownership protection for multiple client personalized models, enhances the scalability and detection accuracy of watermarks, can identify and exclude malicious clients, and ensures the intellectual property security of the model.
Smart Images

Figure CN118674062A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of federated learning, and in particular to a personalized federated learning model ownership protection method based on robust watermark. Background Art
[0002] Artificial intelligence models have become important assets for many companies due to their powerful capabilities and high training costs. However, these models face serious risks of intellectual property infringement. Previous studies have revealed that models may be illegally leaked during distribution and use, or even stolen through model imitation attacks. Therefore, ensuring model ownership has become an urgent task.
[0003] Existing schemes introduce model watermarking technology to confirm the ownership of models and track model leakage. Specifically, they use feature-based or backdoor-based methods to embed identifiable or unique watermarks in the model. When ownership disputes occur, the model owner can prove ownership by extracting the watermark in the model. Initial attempts focused on protecting ownership in traditional machine learning scenarios. Recently, with the rise of federated learning (FL), considerable attention has been paid to protecting model ownership in distributed machine learning scenarios. As a privacy-preserving machine learning method, federated learning can perform collaborative training of models without sharing customer data. However, since the process of federated learning requires the participation of a large number of clients, it has higher requirements for the capacity of watermarks. At the same time, federated learning allows clients participating in training to access the model, which makes it face a higher risk of model leakage. In order to protect the intellectual property rights of federated learning models, researchers have proposed some federated learning model ownership verification schemes.
[0004] Recently, researchers have paid more and more attention to personalized federated learning (PFL) as a solution to the performance degradation problem of traditional FL in heterogeneous data scenarios. Different from traditional FL, PFL not only uses the collective knowledge of distributed clients to train a shared global model, but also allows clients to customize personalized models according to their specific data distribution. Therefore, PFL shows superior model training performance under non-independent and identically distributed (Non-IID) data.
[0005] However, protecting the ownership of personalized models in PFL faces the following challenges:
[0006] 1. First, ensuring a clear division between public and private ownership in model watermarks is crucial to protecting personalized model ownership. However, existing methods indiscriminately embed watermarks for all clients in the same location, making it difficult to distinguish between public and private ownership.
[0007] 2. Second, existing embedding methods also limit the watermark capacity. If these length limits are exceeded, watermark conflicts may occur, resulting in low detection rates and difficulty in determining model copyright. The complex ownership situation in PFL requires embedding more information in the model, but this is constrained by the limited watermark capacity.
[0008] 3. Third, there may be malicious clients that do not follow the watermark embedding protocol. Instead, they will insert forged watermarks. There is currently no solution in PFL to address this behavior. Summary of the invention
[0009] The technical problem to be solved by the present invention is: in response to the technical problems existing in the prior art, the present invention provides a personalized federated learning model ownership protection method which is not limited by the number of clients embedded with watermarks, each client can protect its own personalized model, and the server can detect malicious clients.
[0010] In order to solve the above technical problems, the technical solution proposed in the present invention is: a personalized federated learning model ownership protection method based on robust watermark, comprising the following steps:
[0011] S1, the server generates a watermark of the representation layer for each client and assigns the location where the watermark is embedded according to the number of clients participating in the training;
[0012] S2, the server sends the corresponding presentation layer watermark and embedded area to the client;
[0013] S3, the client generates its own personalized layer watermark locally.
[0014] S4: At the beginning of each round of training, the server extracts a certain proportion of clients to participate in the training and sends the representation layer parameters to the clients.
[0015] S5: After receiving the representation layer parameters, the client forms a complete model with the personalization layer locally and starts training. Watermark decoupling and embedding are performed during training.
[0016] S6: After the client completes local training, it uploads the presentation layer parameters to the server.
[0017] S7: The server detects the presentation layer parameters uploaded by the client.
[0018] S8, the server aggregates normal client parameters to obtain the next round of representation layer parameters, and determines whether the global model meets the preset conditions. If yes, the learning process ends; otherwise, jumps to step S4 for the next round of training.
[0019] Furthermore, the presentation layer watermark generation method in step S1 includes: the server generates a public watermark and a public watermark embedding area, and divides the watermark and the embedding area into slices according to the number of clients, and distributes them to different clients.
[0020] Furthermore, the method of generating the personalized layer watermark in step S3 includes: the client generates a binary string that can represent its own identity information as the personalized layer watermark; and simultaneously selects a parameter area of the personalized layer as the watermark embedding area.
[0021] Furthermore, the watermark decoupling embedding method in step S5 includes: the client first uses the local data set to perform model training, trains multiple rounds to find the most suitable personalized layer parameters for itself, and embeds its own client watermark in the personalized layer; the client uses the trained personalized layer parameters and uses the local data again to optimize the shared presentation layer parameters, and embeds the presentation layer watermark sent by the server in the specified position;
[0022] Furthermore, the method for detecting the presentation layer parameters in step S7 includes: the server detects the uploaded model parameters through the stored presentation layer watermark and records the watermark detection rate; in the initial stage, there is not enough malicious client information, and the server uses the watermark detection rate distribution of normal clients for detection. If the watermark detection rate of the client is within the normal distribution range of the detection rate of the normal client, it is judged as a normal client, otherwise it is a malicious client; after detecting enough malicious clients, the server performs detection based on the watermark detection rate distribution of the malicious client and the detection rate distribution of the normal client. If the watermark detection rate of the client is within the distribution range of the malicious client, it is judged as a malicious client, otherwise it is a normal client;
[0023] Furthermore, after the server aggregates the normal client presentation layer parameters in step S8, it also includes marking the detected malicious clients, and prohibiting them from participating in the next round of training in step S4.
[0024] Furthermore, in step S5, watermark embedding is performed by adding a bias term about the watermark embedding loss into the loss function.
[0025] Furthermore, in step S8, the presentation layer parameters of the normal clients are aggregated by adopting a weighted average method to obtain the presentation layer parameters of the next round.
[0026] Furthermore, in step S3 and / or step S5, the personalized layer watermark generation and embedding method can be combined with any existing deep learning model feature watermark method.
[0027] Compared with the prior art, the advantages of the present invention are:
[0028] 1. This invention is the first robust model ownership protection framework for personalized federated learning. Compared with the FL model ownership protection scheme that only protects the public models of a few clients, this invention can protect the personalized model ownership of more clients.
[0029] 2. The present invention decouples the watermark embedding of the personalized model into the personalization layer embedding and the presentation layer embedding. In addition, the present invention introduces the watermark slice embedding operation in the presentation layer, which can effectively solve the watermark interference problem in FL. This strategy greatly enhances the scalability and enables more clients to embed multiple watermarks.
[0030] 3. This paper designs a tampered watermark detection mechanism, which uses the data distribution characteristics of watermark slices of clients with the same embedding frequency. This mechanism can accurately detect and identify malicious clients and ensure the correctness of the watermark. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 It is a schematic diagram of a flow chart of a specific embodiment of the present invention.
[0032] Figure 4 The figure compares the impact of the specific embodiment of the present invention and the existing solution (FedIPR) on the accuracy of the original task.
[0033] Figure 2 It is a schematic diagram of watermark capacity and reliability of a specific embodiment of the present invention.
[0034] Figure 3 This is a diagram showing the robustness test results of a specific embodiment of the present invention under pruning and fine-tuning attacks.
[0035] Figure 5 The robustness test results of the specific embodiment of the present invention under malicious client tampering attacks. DETAILED DESCRIPTION
[0036] The present invention is further described below in conjunction with the accompanying drawings and specific preferred embodiments, but the protection scope of the present invention is not limited thereby.
[0037] like Figure 1 As shown, the personalized federated learning model ownership protection framework based on robust watermark in this embodiment includes a client and a server. The client is responsible for training and watermark embedding on the local data set using the model sent by the server, and the server is responsible for aggregating the model and detecting the embedding effect of the representation layer watermark.
[0038] In this embodiment, the client needs to complete two tasks. One is the main task: the model needs to achieve the goal of personalized federated learning. In this embodiment, we use the representation learning method for training, where is the representation layer parameter learned by all clients. are the personalization layer parameters learned independently by each client i. They are the parameter spaces of the representation layer and the personalization layer respectively. The goals of personalized federated learning are:
[0039]
[0040] where f i (h i ,r) is the expected risk function, all clients need to learn the representation layer parameter m together r , while independently learning its own private personalization layer parameters
[0041] The other is the watermark embedding task: given a r and The model m is composed of a vector b∈{0,1} of length l. l Embedded into one or more layers of model parameters. Following previous work, we add a loss function regularization term to embed the watermark and use the Hamming distance To measure the effectiveness of watermark embedding. Where b is the target watermark, is the extracted watermark.
[0042] In the federated learning model ownership protection framework based on robust watermarking in this embodiment, in the initialization step, the server generates a public watermark b S , divide it into different watermark shards according to the number of clients The server will embed the watermark fragment Embed location Embedding Matrix And initialize the model m 0 Sent privately to the corresponding client i.
[0043] The client generates personal privacy watermark information Θ=(b i ,θ i ,E i ), where b i is the watermark to be embedded, θ i is the embedding position of the watermark, E i is the embedding matrix. For example, client i sets θ i ={c1,c2}, indicating that watermark b i Will be embedded into the first and second convolutional layers c1, c2. i will be divided into and In this embodiment, the calculation method is shown in formula (2):
[0044]
[0045] Where l represents the watermark b i The length of j represents the length of b i The serial number of each watermark bit, symbol || defines the parameter quantity of the corresponding layer.
[0046] Client i generates the embedding matrix in It follows a normal distribution Size The matrix of .
[0047] In this embodiment, a watermark embedding phase is also included. Assume that the sampling rate is p, the total number of clients is n, and pn clients are sampled in each round to participate in the training. For each selected client i, first perform ξ times of local update and watermark embedding in the personalized layer. In the tth round, let ∈ = 1, 2, …, ξ, client i uses the loss function defined in formula (3) to calculate the personalized layer of the model to update.
[0048]
[0049] in is the loss function of the main task, is The loss function for embedding private watermark in . The calculation method of is defined in formula (4).
[0050]
[0051] where BCE(·) is the binary cross entropy function, yes After conversion, a one-dimensional vector is obtained.
[0052] The training and watermark embedding process of the entire personalization layer can be expressed by formula (5):
[0053]
[0054] where GRD(·) is a gradient descent method, such as stochastic gradient update. λ represents the learning rate.
[0055] After the personalization layer training is completed, client i obtains the current optimal personalization layer parameters and uses them to train the presentation layer. Perform training and watermark embedding. At this stage, the training loss function of client i is shown in formula (6):
[0056]
[0057] in Indicates from The extracted watermark fragments and target watermark fragments The loss caused by the inconsistency is calculated as follows:
[0058]
[0059] What is different from before is that Only represents middle The training and embedding method of the entire representation layer can be defined in formula (8):
[0060]
[0061] When the entire model training is completed, each sampled client only sends to the server.
[0062] In this embodiment, a malicious client detection step is also included. The server first records each round of upload The detection rate and embedding times of watermark fragments in . In order to avoid the influence of sampling, for each The server searches for watermark fragment detection rate records with the same number of embedding times. The server then follows the steps below to perform malicious client detection:
[0063] 1. In the early stages of training, not enough malicious clients (num m <β), watermark fragment detection rate acc i The calculation method is shown in formula (9), and formula (10) should be satisfied:
[0064]
[0065] where μ n and σ n yes The mean and standard deviation of num n yes The size of The confidence level C n In practice, C n It can be determined according to the actual situation. If the tolerance for malicious clients is high, C n Set larger so that most clients are not considered malicious early in training.
[0066] 2. When the number of malicious clients detected by the server is sufficient to determine the malicious client (num m <β), watermark fragment detection rate acc iFormula (11) should be satisfied to ensure that the characteristics of malicious clients are not matched.
[0067]
[0068] where μ m and σ m is the mean and standard deviation of the accuracy of the detected malicious clients. The confidence level C m Determine the critical value. m Represents the acceptance limit for honest clients. Setting it to a relatively small value can ensure that most clients meet the upper limit requirement of the distribution of watermark detection rate on malicious clients.
[0069] After all selected clients are detected, the server will record the watermark shard detection accuracy of the malicious client, and then aggregate the weight information uploaded by the honest client. As shown in formula (12), Indicates the client number for sampling.
[0070]
[0071] This process is repeated until the model meets the established requirements.
[0072] In this embodiment, the technical solution is verified by simulation experiments, and PyTorch is used for model training. In the simulation experiment, the system consists of 1 aggregation server and 100 client devices, and is set to select 10 clients for training in each round of training. In each round of training, each client iterates the personalization layer 10 times and the representation layer 1 time on its own training data set. In this embodiment, a CNN model consisting of two convolutional layers and three linear layers is selected and tested on CIFAR10, MNIST, and FMNIST data sets. The data sets are all set to be non-independent and identically distributed, where K(x) means that data with x different labels are assigned to each client, and Dir(β) means that data distribution is constructed for each client according to the Dilitret distribution. The parameter β represents the degree of Non-IID, and the smaller the value of β, the higher the degree of Non-IID. This technical solution (Our) is compared with the existing federated learning model ownership protection scheme FedIPR. Figure 4 It can be seen that under various settings, this technical solution has higher accuracy than FedIPR's model, and with the watermark embedding, the maximum accuracy change is only 8.85% (Gap). Figure 2 It can be seen that the detection rate of each client for its own personalized watermark in this technical solution is always kept near 1, and the false detection rate of other client watermarks is kept at the initial level of 0.5, which proves that this technical solution has strong reliability.
[0073] In this simulation experiment, the robustness of this technical solution to various attacks is also tested. Figure 3 It can be seen that under different degrees of pruning and fine-tuning attacks, the accuracy of the model's main tasks will be affected to a certain extent, but the watermark detection rate remains at a high level, with the lowest still above 0.75. This proves that this technical solution is highly robust to attacks such as pruning and fine-tuning.
[0074] In this simulation experiment, a certain ratio (f m ) of the malicious client, and the presentation layer watermark sent by the server is increased by a certain proportion (f t ) to simulate watermark tampering attacks. Figure 5 It can be seen that under this technical solution, the server's detection rate of malicious clients is d t It always remains above 0.9, and the watermark detection rate w of normal clients under this detection mechanism is n and the watermark detection rate w of malicious clients m The gap between The lowest score is still 8.77, which proves that this technical solution has a good defense effect against tampering attacks by malicious clients.
[0075] The above is only a preferred embodiment of the present invention, and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment, it is not intended to limit the present invention. Therefore, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the content of the technical solution of the present invention shall fall within the protection scope of the technical solution of the present invention.
Claims
1. A personalized federated learning model ownership protection method based on robust watermarking. The characteristics are: include: S1, the server generates a watermark of the representation layer for each client and assigns the location where the watermark is embedded according to the number of clients participating in the training; S2, the server sends the corresponding presentation layer watermark and embedded area to the client; S3, the client generates its own personalized layer watermark locally. S4: At the beginning of each round of training, the server extracts a certain proportion of clients to participate in the training and sends the representation layer parameters to the clients. S5: After receiving the representation layer parameters, the client forms a complete model with the personalization layer locally and starts training. Watermark decoupling and embedding are performed during training. S6: After the client completes local training, it uploads the presentation layer parameters to the server. S7: The server detects the presentation layer parameters uploaded by the client. S8, the server aggregates normal client parameters to obtain the next round of representation layer parameters, and determines whether the global model meets the preset conditions. If yes, the learning process ends; otherwise, jumps to step S4 for the next round of training.
2. The personalized federated learning model ownership protection method based on robust watermark according to claim 1 is characterized in that: The method of generating the presentation layer watermark in step S1 includes: the server generates a public watermark and a public watermark embedding area, and divides the watermark and the embedding area into slices according to the number of clients, and distributes them to different clients.
3. The personalized federated learning model ownership protection method based on robust watermark according to claim 2 is characterized in that: The method of generating the personalized layer watermark in step S3 includes: the client generates a binary string that can represent its own identity information as the personalized layer watermark; and simultaneously selects a parameter area of the personalized layer as the watermark embedding area.
4. The personalized federated learning model ownership protection method based on robust watermark according to claim 3 is characterized in that: The watermark decoupling embedding method described in step S5 includes: the client first uses the local data set to perform model training, trains for multiple rounds to find the personalized layer parameters that best suit it, and embeds its own client watermark in the personalized layer; the client uses the trained personalized layer parameters and uses local data again to optimize the shared presentation layer parameters, and embeds the presentation layer watermark sent by the server in the specified location.
5. The personalized federated learning model ownership protection method based on robust watermark according to claim 4 is characterized in that: The method of detecting the presentation layer parameters in step S7 includes: the server detects the uploaded model parameters through the stored presentation layer watermark and records the watermark detection rate; in the initial stage, there is not enough malicious client information, and the server uses the watermark detection rate distribution of normal clients for detection. If the watermark detection rate of the client is within the normal distribution range of the detection rate of the normal client, it is judged as a normal client, otherwise it is a malicious client; after detecting enough malicious clients, the server performs detection based on the watermark detection rate distribution of the malicious client and the detection rate distribution of the normal client. If the watermark detection rate of the client is within the distribution range of the malicious client, it is judged as a malicious client, otherwise it is a normal client.
6. The personalized federated learning model ownership protection method based on robust watermark according to claim 5 is characterized in that: After the server aggregates the normal client presentation layer parameters in step S8, it also includes marking the detected malicious client and prohibiting it from participating in the next round of training in step S4.
7. The personalized federated learning model ownership protection method based on robust watermark according to claim 4 is characterized in that: In step S5, watermark embedding is performed by adding a bias term about the watermark embedding loss into the loss function.
8. The personalized federated learning model ownership protection method based on robust watermark according to any one of claims 1 to 7, characterized in that: In step S8, the presentation layer parameters of the normal clients are aggregated by adopting a weighted average method to obtain the presentation layer parameters of the next round.
9. The personalized federated learning model ownership protection method based on robust watermark according to any one of claims 1 to 7, characterized in that: In step S3 and / or step S5, the personalized layer watermark generation and embedding method can be combined with any existing deep learning model feature watermark method.
Citation Information
Cited By
Watermark-based model protection method and device, equipment, medium and program product
CN121093318A
Watermark-based model protection method, apparatus, device, medium, and program product
CN121093318B
