Reversible model watermark generation method, device, equipment and medium
By processing the watermark data to be generated by the deep neural network model that has completed model training, the watermarks are generated and filtered, which avoids the decrease in model accuracy and the extension of training time caused by watermark embedding, realizes the separation of watermarks and model training processes, and solves the problem of The impact of watermark generation on DNN performance in existing technologies.
Patent Information
- Application Number
- CN202410961375.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-07-17
AI Technical Summary
In the process of generating reversible model watermarks, existing techniques can lead to reduced accuracy and longer training times for deep neural network (DNN) models, especially in applications requiring extremely high accuracy, due to watermark embedding that modifies the model. Due to weight or structure.
By using the deep neural network model that has completed model training, the watermark data to be generated is processed to generate the first target matrix, and the target position is updated according to the model owner key to generate the second target matrix, thereby obtaining the watermark input and predicting the watermark label. , filter out effective target watermarks that meet the preset correspondence relationships, avoid participating in the model training process, and thus not change the model weight or structure.
It is possible to generate a reversible model watermark while avoiding model accuracy decline and training time extension. The watermark declaration process is separated from the training process, and the cost is 0. The watermark can be updated as the model is updated, without interfering with the integrity of the training.
Smart Images

Figure CN118504607B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a reversible model watermark generation method, device, equipment and medium. Background Art
[0002] A reversible model is a deep neural network model (DNN) with a special architecture. Deep neural network watermarking is an emerging technology for protecting the intellectual property rights of deep neural networks. Especially in reversible models, it embeds unique marks or patterns into the weights or structures of DNNs to authenticate and prove the ownership and authenticity of DNNs. The basic principle of DNN watermarking is to use the weight offset or structural adjustment that exists in the training process to embed specific information. Watermarking can be achieved by adding a regularization term to the loss function to encode the required information.
[0003] However, embedding watermarks may have a slight impact on the performance of DNNs: (1) Embedding watermarks may cause a slight decrease in the overall accuracy of DNNs. This is because the watermark modifies the weights or structure, thereby slightly deviating from the original trained model parameters. Especially for applications that require extremely high accuracy, such as medical diagnosis or self-driving cars, any subtle impact needs to be paid attention to; (2) The introduction of watermarks may affect the speed and effect of model training convergence. The watermark embedding process may require additional iterations or adjustments to ensure convergence, which will increase the training time.
[0004] In summary, how to complete the generation of reversible model watermarks while avoiding the situation where the model accuracy is reduced and the training time is prolonged due to changes in the model weights or structure is a problem to be solved in this field. Summary of the invention
[0005] In view of this, the purpose of the present invention is to provide a reversible model watermark generation method, device, equipment and medium, which can complete the reversible model watermark generation while avoiding the situation where the model accuracy is reduced and the training time is long due to the change of model weight or structure. The specific scheme is as follows:
[0006] In a first aspect, the present application discloses a reversible model watermark generation method, comprising:
[0007] Using a reversible model to process each watermark data to be generated under the current label to obtain a first target matrix; wherein the reversible model is a deep neural network model that has completed model training;
[0008] Determine a target position in the first target matrix according to the first target matrix and the owner key of the reversible model, and update a value at the target position to a preset value to obtain a second target matrix;
[0009] Inputting the second target matrix after dimension increase into the reversible model to obtain a watermark input, and using the reversible model to obtain a predicted watermark label corresponding to the watermark input, and determining the watermark input and the corresponding predicted watermark label as the target watermark under the current label;
[0010] A valid target watermark under the current label is selected from the target watermark under the current label; wherein the predicted watermark label of the valid target watermark satisfies a preset corresponding relationship with the current label.
[0011] Optionally, the using of the reversible model to process each to-be-generated watermark data under the current label to obtain a first target matrix includes:
[0012] Collecting a plurality of watermark data to be generated under the current label, and filtering out a current data group from the plurality of watermark data to be generated based on a preset number;
[0013] The watermark data to be generated in the current data group are processed by using a reversible model to obtain first target matrices respectively corresponding to the watermark data to be generated in the current data group.
[0014] Optionally, the using a reversible model to process the watermark data to be generated in the current data group to obtain first target matrices respectively corresponding to the watermark data to be generated in the current data group includes:
[0015] Processing the watermark data to be generated in the current data group by using a reversible model to obtain first initial matrices respectively corresponding to the watermark data to be generated in the current data group;
[0016] Performing dimensionality reduction processing on each of the first initial matrices to obtain each dimensionality-reduced matrix;
[0017] The average values of the elements at the corresponding positions in the matrix after dimensionality reduction are obtained, and the first target matrix is obtained according to the average values.
[0018] Optionally, performing dimensionality reduction processing on each of the first initial matrices to obtain each dimensionality-reduced matrix includes:
[0019] Performing dimensionality reduction processing on each of the first initial matrices according to the shape of the feature graph of the convolutional layer in the reversible model to obtain each dimensionality-reduced matrix;
[0020] Accordingly, the step of inputting the second target matrix after dimension upgrade into the reversible model includes:
[0021] The second target matrix is dimensionally upgraded according to the shape of the feature map of the convolutional layer in the reversible model, and the second target matrix after dimension upgrade is input into the reversible model.
[0022] Optionally, determining a target position in the first target matrix according to the first target matrix and the owner key of the reversible model, and updating a value at the target position to a preset value to obtain a second target matrix includes:
[0023] Determine a position table according to the first target matrix and the owner key of the reversible model; wherein the position table includes each target position in the first target matrix;
[0024] The value at the target position is updated to 0 to obtain a second target matrix.
[0025] Optionally, after filtering out a valid target watermark under the current tag from the target watermarks under the current tag, the method further includes:
[0026] Determine the generation speed of the effective target watermark under the current label, and judge whether the generation speed belongs to a preset speed range;
[0027] If the generation speed belongs to the preset speed range, retaining the current label;
[0028] If the generation speed does not belong to the preset speed range, the current label is removed.
[0029] Optionally, the determining a generation speed of the effective target watermark under the current tag includes:
[0030] The generation speed of the valid target watermark under the current tag is determined according to the number of the target watermarks under the current tag and the number of the valid target watermarks.
[0031] In a second aspect, the present application discloses a reversible model watermark generation device, comprising:
[0032] A first matrix acquisition module is used to process each watermark data to be generated under the current label using a reversible model to obtain a first target matrix; wherein the reversible model is a deep neural network model that has completed model training;
[0033] A second matrix acquisition module, used to determine a target position in the first target matrix according to the first target matrix and the owner key of the reversible model, and update the value at the target position to a preset value to obtain a second target matrix;
[0034] a target watermark acquisition module, configured to input the second target matrix after dimension upgrade into the reversible model to obtain a watermark input, and use the reversible model to obtain a predicted watermark label corresponding to the watermark input, and determine the watermark input and the corresponding predicted watermark label as the target watermark under the current label;
[0035] The effective watermark acquisition module is used to filter out the effective target watermark under the current label from the target watermark under the current label; wherein the predicted watermark label of the effective target watermark satisfies a preset corresponding relationship with the current label.
[0036] In a third aspect, the present application discloses an electronic device, including:
[0037] Memory, used to store computer programs;
[0038] The processor is used to execute the computer program to implement the steps of the aforementioned disclosed reversible model watermark generation method.
[0039] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned disclosed reversible model watermark generation method are implemented.
[0040] The beneficial effects of the present application are as follows: the present application uses a reversible model to process each watermark data to be generated under the current label to obtain a first target matrix; wherein the reversible model is a deep neural network model that has completed model training; the target position in the first target matrix is determined according to the first target matrix and the owner key of the reversible model, and the value at the target position is updated to a preset value to obtain a second target matrix; the second target matrix after dimensionality increase is input into the reversible model to obtain a watermark input, and the reversible model is used to obtain a predicted watermark label corresponding to the watermark input, and the watermark input and its corresponding predicted watermark label are determined as the target watermark under the current label; the valid target watermark under the current label is screened out from the target watermark under the current label; wherein the predicted watermark label of the valid target watermark satisfies a preset corresponding relationship with the current label. It can be seen that the reversible model in the present application is a deep neural network model that has completed model training. The reversible model is used to process each watermark data to be generated under the current label to obtain the statistics of the middle layer, that is, the first target matrix. The target position in the first target matrix is determined according to the first target matrix and the owner key of the reversible model, and the value at the target position is updated to a preset value to obtain a second target matrix, which is then processed by the reversible model to obtain the watermark input and the corresponding predicted watermark label, and then obtain the effective target watermark under the current label. In other words, the model watermark generation in the present application does not need to participate in the training process of the reversible model. In other words, the present application will not change the weight or structure of the model because of the need to complete the model watermark generation. In this way, any decrease in accuracy during training is effectively avoided. This also means that the cost of the watermark in the model training stage is 0, and the watermark declaration process is separated from the training process, so that the watermark can be easily updated as the model is updated without interfering with the integrity of the training, and the reversible model training time will not be extended. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0042] Figure 1 A flow chart of a reversible model watermark generation method disclosed in this application;
[0043] Figure 2 A schematic diagram of generating a specific reversible model watermark disclosed in this application;
[0044] Figure 3This is a schematic diagram of the structure of a reversible model watermark generation device disclosed in this application;
[0045] Figure 4 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0047] A reversible model is a deep neural network model with a special architecture. Deep neural network watermarking is an emerging technology for protecting the intellectual property rights of deep neural networks. Especially in reversible models, it embeds unique marks or patterns into the weights or structures of DNNs, thereby authenticating and proving the ownership and authenticity of DNNs. The basic principle of DNN watermarking is to use the weight offset or structural adjustment that exists in the training process to embed specific information. Watermarking can be achieved by adding a regularization term to the loss function to encode the required information.
[0048] However, embedding watermarks may have a slight impact on the performance of DNNs: (1) Embedding watermarks may cause a slight decrease in the overall accuracy of DNNs. This is because the watermark modifies the weights or structure, thereby slightly deviating from the original trained model parameters. Especially for applications that require extremely high accuracy, such as medical diagnosis or self-driving cars, any subtle impact needs to be paid attention to; (2) The introduction of watermarks may affect the speed and effect of model training convergence. The watermark embedding process may require additional iterations or adjustments to ensure convergence, which will increase the training time.
[0049] To this end, the present application provides a reversible model watermark generation scheme, which completes the reversible model watermark generation while avoiding the situation where the model accuracy is reduced and the training time is prolonged due to changes in the model weights or structure.
[0050] See also Figure 1 As shown, the embodiment of the present application discloses a reversible model watermark generation method, comprising:
[0051] Step S11: using a reversible model to process each watermark data to be generated under the current label to obtain a first target matrix; wherein the reversible model is a deep neural network model that has completed model training.
[0052] The reversible model is a special DNN architecture. Traditional machine learning models will cause information loss due to operations such as nonlinear activation layers and pooling layers, making the model irreversible. For example, during the forward propagation of the neural network, the input data is mapped to a low-dimensional representation through a series of nonlinear operations (such as activation functions), making it impossible to completely restore the same input during reverse propagation. In contrast, the core idea of the reversible model is that both the forward and reverse propagation processes of the network are reversible. The reversible model can be represented as a function f, which maps the input x to the output y=f(x). Its key property is that there is an inverse function f -1 , so that x=f -1 (y). It should be noted that the reversible model in this embodiment is a deep neural network model that has completed model training. That is to say, the reversible model watermark generation in this embodiment does not participate in the training process of the reversible model, so it will not change the model weight or structure at all, and will not have any negative impact on its model training, effectively avoiding any decline in accuracy during training. This also means that the cost of the watermark in the model training stage is 0, and the watermark declaration process is separated from the training process, so that the watermark can be easily updated as the model is updated without interfering with the integrity of the training, and the reversible model training time will not be extended as a result.
[0053] In this embodiment, the method of using a reversible model to process each watermark data to be generated under the current label to obtain a first target matrix includes: collecting multiple watermark data to be generated under the current label, and filtering out a current data group from the multiple watermark data to be generated based on a preset number; and using a reversible model to process the watermark data to be generated in the current data group to obtain a first target matrix corresponding to each of the watermark data to be generated in the current data group. Collecting the current label (label n ), for example, collecting N watermark data to be generated {X1, X2, ...X m , …, X N}, based on a preset number, the current data group is selected from a plurality of watermark data to be generated. For example, the preset number is 2, that is, every 2 watermark data to be generated is 1 data group. For example, the watermark data to be generated in the current data group is {X m , X m+1}, using the reversible model to generate the watermark data {X m , X m+1} to obtain the watermark data to be generated in the current data group {X m , X m+1} corresponds to the first target matrix Z'.
[0054] In this embodiment, the method of processing the watermark data to be generated in the current data group using a reversible model to obtain first target matrices respectively corresponding to the watermark data to be generated in the current data group includes: processing the watermark data to be generated in the current data group using a reversible model to obtain first initial matrices respectively corresponding to the watermark data to be generated in the current data group; performing dimensionality reduction processing on each of the first initial matrices to obtain each reduced-dimensional matrix; obtaining the average value of each element at a corresponding position in each of the reduced-dimensional matrices, and obtaining the first target matrix according to each of the average values. m , X m+1} to obtain the watermark data X to be generated in the current data group m The corresponding first initial matrix Z m , and the watermark data X to be generated in the current data group m+1 The corresponding first initial matrix Z m+1 ; For the first initial matrix Z m , the first initial matrix Z m+1 Perform dimensionality reduction to obtain the reduced-dimensional matrix Z m DR , matrix Z after dimension reduction m+1 DR , get the reduced dimension matrix Z m DR , matrix Z after dimension reduction m+1 DR The average values of the elements at the corresponding positions in the matrix are calculated, and the first target matrix Z' is obtained according to the average values. For example, the matrix Z after dimensionality reduction is m DR The element at position (1, 1) is 1, and the matrix Z after dimensionality reduction m+1 DR The element at position (1, 1) is 3, so the element at position (1, 1) of the first target matrix Z' is 2.
[0055] In this embodiment, the dimensionality reduction processing of each of the first initial matrices to obtain each reduced-dimensional matrix includes: dimensionality reduction processing of each of the first initial matrices according to the shape of the feature map of the convolution layer in the reversible model to obtain each reduced-dimensional matrix. In order to ensure that security issues are avoided, during the entire process, the only information that needs to be known about the victim model (i.e., the reversible model) is the shape of the feature map output by the final convolution layer, and the dimensionality reduction processing of each of the first initial matrices is performed according to the shape of the feature map of the convolution layer in the reversible model.
[0056] Step S12: determining the target position in the first target matrix according to the first target matrix and the owner key of the reversible model, and updating the value at the target position to a preset value to obtain a second target matrix.
[0057] In this embodiment, the target positions in the first target matrix are determined according to the first target matrix and the owner key of the reversible model, and the values at the target positions are updated to preset values to obtain the second target matrix, including: determining a position table according to the first target matrix and the owner key of the reversible model; wherein the position table contains each target position in the first target matrix; and updating the values at the target positions to 0 to obtain the second target matrix. A position table is determined according to the owner key key of the reversible model and the first target matrix Z', wherein the position table contains each position that needs to be adjusted in the first target matrix, i.e., each target position in the first target matrix, and the values at the target positions are updated to 0 to obtain the second target matrix Z''. For example, if each target position in the position table is (1, 3) and (3, 4), then the elements at the positions (1, 3) and (3, 4) are adjusted to 0 to obtain the second target matrix Z''.
[0058] Step S13: input the second target matrix after dimensionality increase into the reversible model to obtain a watermark input, and use the reversible model to obtain a predicted watermark label corresponding to the watermark input, and determine the watermark input and its corresponding predicted watermark label as the target watermark under the current label.
[0059] In this embodiment, the inputting of the second target matrix after dimension upgrade into the reversible model includes: performing dimension upgrade processing on the second target matrix according to the shape of the feature graph of the convolution layer in the reversible model, and inputting the second target matrix after dimension upgrade into the reversible model. Performing dimension upgrade processing on the second target matrix Z'' according to the shape of the feature graph of the convolution layer in the reversible model, and then inputting the second target matrix Z'' into the reversible model, and the reversible model outputs a watermark input, wherein the watermark input refers to specific input data that triggers the neural network to produce a specific response.
[0060] The watermark input is then input into the reversible model. After the reversible model processes the watermark input, it will output the predicted watermark label corresponding to the watermark input. For example, the watermark input WI m Input to the reversible model to obtain the same m The corresponding Y Wm , the watermark input and its corresponding predicted watermark label are determined as the current label (label n ) under the mth target watermark {WI m , Y Wm}.
[0061] Step S14: Filter out a valid target watermark under the current label from the target watermarks under the current label; wherein the predicted watermark label of the valid target watermark satisfies a preset corresponding relationship with the current label.
[0062] If the predicted watermark label Y in the target watermark Wm With the current label (label n ) is not a corresponding relationship, for example, the current label (label n ) is "dog", and the predicted watermark label Y in the target watermark Wm " is "cat", then the predicted watermark label Y in the target watermark is determined Wm With the current label (label n ) is not a corresponding relationship, then the target watermark is not the current label (label n ) of the effective target watermark, the target watermark can be removed; if the current label (label n ) is "dog", and the predicted watermark label Y in the target watermark Wm " is "dog", then the predicted watermark label Y in the target watermark is determined Wm With the current label (label n ) is a corresponding relationship, then the target watermark is the current label (label n ) of the target watermark; that is, the valid target watermark under the current label is screened out according to whether the predicted watermark label of the target watermark under the current label satisfies the preset corresponding relationship with the current label.
[0063] In this embodiment, after filtering out the valid target watermark under the current label from the target watermark under the current label, the method further includes: determining the generation speed of the valid target watermark under the current label, and judging whether the generation speed belongs to a preset speed interval; if the generation speed belongs to the preset speed interval, retaining the current label; if the generation speed does not belong to the preset speed interval, removing the current label. Figure 2 A specific reversible model watermark generation schematic diagram is shown. It should be noted that if the generation speed of the effective target watermark under the current label is too fast, the watermark success rate will be relatively low, indicating that there is a problem with the current label. If the generation speed of the effective target watermark under the current label is too slow, it also indicates that there is a problem with the current label. Therefore, the user sets a preset speed range, and the current label is retained only when the generation speed belongs to the preset speed range.
[0064] In this embodiment, the determining the generation speed of the effective target watermark under the current tag includes: determining the generation speed of the effective target watermark under the current tag according to the number of the target watermarks under the current tag and the number of the effective target watermarks. The generation speed of the effective target watermark under the current tag is equal to the number of effective target watermarks under the current tag / the number of target watermarks. It is also possible to determine the number of effective target watermarks when the number of target watermarks is 100, so as to determine the generation speed of the effective target watermark.
[0065] The beneficial effects of the present application are as follows: the present application uses a reversible model to process each watermark data to be generated under the current label to obtain a first target matrix; wherein the reversible model is a deep neural network model that has completed model training; the target position in the first target matrix is determined according to the first target matrix and the owner key of the reversible model, and the value at the target position is updated to a preset value to obtain a second target matrix; the second target matrix after dimensionality increase is input into the reversible model to obtain a watermark input, and the reversible model is used to obtain a predicted watermark label corresponding to the watermark input, and the watermark input and its corresponding predicted watermark label are determined as the target watermark under the current label; the valid target watermark under the current label is screened out from the target watermark under the current label; wherein the predicted watermark label of the valid target watermark satisfies a preset corresponding relationship with the current label. It can be seen that the reversible model in the present application is a deep neural network model that has completed model training. The reversible model is used to process each watermark data to be generated under the current label to obtain the statistics of the middle layer, that is, the first target matrix. The target position in the first target matrix is determined according to the first target matrix and the owner key of the reversible model, and the value at the target position is updated to a preset value to obtain a second target matrix, which is then processed by the reversible model to obtain the watermark input and the corresponding predicted watermark label, and then obtain the effective target watermark under the current label. In other words, the model watermark generation in the present application does not need to participate in the training process of the reversible model. In other words, the present application will not change the weight or structure of the model because of the need to complete the model watermark generation. In this way, any decrease in accuracy during training is effectively avoided. This also means that the cost of the watermark in the model training stage is 0, and the watermark declaration process is separated from the training process, so that the watermark can be easily updated as the model is updated without interfering with the integrity of the training, and the reversible model training time will not be extended.
[0066] The reversible model watermark generation of this application is evaluated in terms of the number of queries required for the model owner to claim ownership and the number of queries required for the attacker to claim ownership. Since each watermark test is an independent Bernoulli test, when the number of queries n is large enough (usually n>30), it should conform to the central limit theorem (CLT) of the normal distribution. Therefore, the T test can be used to measure the relationship between the number of watermarks required to claim ownership and the corresponding false alarm rate. Setting the highest false alarm rate in the experiment to the random probability as a conservative upper bound and setting the confidence level to 95%, it can be verified that ownership of the model can be claimed with 95% confidence after a small number of queries on the stolen copy; at the same time, it can also be verified that when the attacker uses the watermark to overwrite, the attacker cannot claim ownership of the stolen model through a limited number of queries. In other words, this application can resist model theft attacks and watermark overwriting.
[0067] See also Figure 3 As shown, the embodiment of the present application discloses a reversible model watermark generation device, including:
[0068] The first matrix acquisition module 11 is used to process each watermark data to be generated under the current label using a reversible model to obtain a first target matrix; wherein the reversible model is a deep neural network model that has completed model training;
[0069] A second matrix acquisition module 12 is used to determine a target position in the first target matrix according to the first target matrix and the owner key of the reversible model, and update the value at the target position to a preset value to obtain a second target matrix;
[0070] A target watermark acquisition module 13 is used to input the second target matrix after dimension increase into the reversible model to obtain a watermark input, and use the reversible model to obtain a predicted watermark label corresponding to the watermark input, and determine the watermark input and the corresponding predicted watermark label as the target watermark under the current label;
[0071] The effective watermark acquisition module 14 is used to filter out the effective target watermark under the current label from the target watermarks under the current label; wherein the predicted watermark label of the effective target watermark satisfies a preset corresponding relationship with the current label.
[0072] The beneficial effects of the present application are as follows: the present application uses a reversible model to process each watermark data to be generated under the current label to obtain a first target matrix; wherein the reversible model is a deep neural network model that has completed model training; the target position in the first target matrix is determined according to the first target matrix and the owner key of the reversible model, and the value at the target position is updated to a preset value to obtain a second target matrix; the second target matrix after dimensionality increase is input into the reversible model to obtain a watermark input, and the reversible model is used to obtain a predicted watermark label corresponding to the watermark input, and the watermark input and its corresponding predicted watermark label are determined as the target watermark under the current label; the valid target watermark under the current label is screened out from the target watermark under the current label; wherein the predicted watermark label of the valid target watermark satisfies a preset corresponding relationship with the current label. It can be seen that the reversible model in the present application is a deep neural network model that has completed model training. The reversible model is used to process each watermark data to be generated under the current label to obtain the statistics of the middle layer, that is, the first target matrix. The target position in the first target matrix is determined according to the first target matrix and the owner key of the reversible model, and the value at the target position is updated to a preset value to obtain a second target matrix, which is then processed by the reversible model to obtain the watermark input and the corresponding predicted watermark label, and then obtain the effective target watermark under the current label. In other words, the model watermark generation in the present application does not need to participate in the training process of the reversible model. In other words, the present application will not change the weight or structure of the model because of the need to complete the model watermark generation. In this way, any decrease in accuracy during training is effectively avoided. This also means that the cost of the watermark in the model training stage is 0, and the watermark declaration process is separated from the training process, so that the watermark can be easily updated as the model is updated without interfering with the integrity of the training, and the reversible model training time will not be extended.
[0073] Furthermore, an embodiment of the present application also provides an electronic device. Figure 4 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
[0074] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Specifically, it may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the reversible model watermark generation method performed by the electronic device disclosed in any of the aforementioned embodiments.
[0075] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0076] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0077] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 221, a computer program 222 and data 223, etc. The storage method can be temporary storage or permanent storage.
[0078] Among them, the operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device to realize the operation and processing of the massive data 223 in the memory 22 by the processor 21, which can be Windows, Unix, Linux, etc. In addition to including a computer program that can be used to complete the reversible model watermark generation method performed by the electronic device disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks. In addition to data received by the electronic device and transmitted from an external device, the data 223 can also include data collected by its own input and output interface 25.
[0079] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned disclosed reversible model watermark generation method is implemented. For the specific steps of the method, reference may be made to the corresponding contents disclosed in the aforementioned embodiments, and no further description will be given here.
[0080] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0081] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application. The steps of the method or algorithm described in conjunction with the embodiments disclosed herein can be implemented directly with hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in a random access memory (RAM), memory, read-only memory (ROM), electrically programmable EPROM (Erasable Programmable Read Only Memory), electrically erasable programmable EEPROM (Electrically Erasable Programmable read only memory), register, hard disk, removable disk, CD-ROM (Compact Disc Read-Only Memory), or any other form of storage medium known in the technical field.
[0082] Finally, 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. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0083] The above is a detailed introduction to a reversible model watermark generation method, device, equipment and medium provided by the present invention. This article uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A reversible model watermark generation method, characterized in that: include: Using a reversible model to process each watermark data to be generated under the current label to obtain a first target matrix; wherein the reversible model is a deep neural network model that has completed model training; Determine a target position in the first target matrix according to the first target matrix and the owner key of the reversible model, and update a value at the target position to a preset value to obtain a second target matrix; Inputting the second target matrix after dimension increase into the reversible model to obtain a watermark input, and using the reversible model to obtain a predicted watermark label corresponding to the watermark input, and determining the watermark input and the corresponding predicted watermark label as the target watermark under the current label; Filter out a valid target watermark under the current label from the target watermark under the current label; wherein the predicted watermark label of the valid target watermark satisfies a preset corresponding relationship with the current label; The method of using the reversible model to process each watermark data to be generated under the current label to obtain a first target matrix includes: Collect multiple watermark data to be generated under the current label, and select a current data group from the multiple watermark data to be generated based on a preset number; process the watermark data to be generated in the current data group using a reversible model to obtain a first target matrix corresponding to the watermark data to be generated in the current data group; The using a reversible model to process the watermark data to be generated in the current data group to obtain first target matrices respectively corresponding to the watermark data to be generated in the current data group includes: The watermark data to be generated in the current data group are processed by using a reversible model to obtain first initial matrices corresponding to the watermark data to be generated in the current data group; dimensionality reduction processing is performed on each of the first initial matrices to obtain each reduced-dimensional matrix; an average value of each element at a corresponding position in each of the reduced-dimensional matrices is obtained, and a first target matrix is obtained according to each of the average values; The performing dimensionality reduction processing on each of the first initial matrices to obtain each dimensionality-reduced matrix includes: Performing dimensionality reduction processing on each of the first initial matrices according to the shape of the feature graph of the convolutional layer in the reversible model to obtain each dimensionality-reduced matrix; Accordingly, the step of inputting the second target matrix after dimension upgrade into the reversible model includes: Performing dimension-upgrading processing on the second target matrix according to the shape of the feature map of the convolution layer in the reversible model, and inputting the dimension-upgraded second target matrix into the reversible model; The step of determining a target position in the first target matrix according to the first target matrix and the owner key of the reversible model, and updating a value at the target position to a preset value to obtain a second target matrix includes: Determine a position table according to the first target matrix and the owner key of the reversible model; wherein the position table includes each target position in the first target matrix; and update the value at the target position to 0 to obtain a second target matrix.
2. The reversible model watermark generation method according to claim 1, characterized in that: After filtering out the valid target watermark under the current tag from the target watermark under the current tag, the method further includes: Determine the generation speed of the effective target watermark under the current label, and judge whether the generation speed belongs to a preset speed range; If the generation speed belongs to the preset speed range, retaining the current label; If the generation speed does not belong to the preset speed range, the current label is removed.
3. The reversible model watermark generation method according to claim 2, characterized in that: The determining the generation speed of the effective target watermark under the current label includes: The generation speed of the valid target watermark under the current tag is determined according to the number of the target watermarks under the current tag and the number of the valid target watermarks.
4. A reversible model watermark generation device, characterized in that: include: A first matrix acquisition module is used to process each watermark data to be generated under the current label using a reversible model to obtain a first target matrix; wherein the reversible model is a deep neural network model that has completed model training; A second matrix acquisition module, used to determine a target position in the first target matrix according to the first target matrix and the owner key of the reversible model, and update the value at the target position to a preset value to obtain a second target matrix; a target watermark acquisition module, configured to input the second target matrix after dimension upgrade into the reversible model to obtain a watermark input, and use the reversible model to obtain a predicted watermark label corresponding to the watermark input, and determine the watermark input and the corresponding predicted watermark label as the target watermark under the current label; An effective watermark acquisition module, used to filter out an effective target watermark under the current label from the target watermark under the current label; wherein the predicted watermark label of the effective target watermark satisfies a preset corresponding relationship with the current label; Wherein, the first matrix acquisition module is specifically used for: Collect multiple watermark data to be generated under the current label, and select a current data group from the multiple watermark data to be generated based on a preset number; process the watermark data to be generated in the current data group using a reversible model to obtain a first target matrix corresponding to the watermark data to be generated in the current data group; The reversible model watermark generating device is specifically used for: The watermark data to be generated in the current data group are processed by using a reversible model to obtain first initial matrices corresponding to the watermark data to be generated in the current data group; dimensionality reduction processing is performed on each of the first initial matrices to obtain each reduced-dimensional matrix; an average value of each element at a corresponding position in each of the reduced-dimensional matrices is obtained, and a first target matrix is obtained according to each of the average values; The reversible model watermark generating device is specifically used for: Performing dimensionality reduction processing on each of the first initial matrices according to the shape of the feature graph of the convolutional layer in the reversible model to obtain each dimensionality-reduced matrix; The target watermark acquisition module is specifically used for: Performing dimension-upgrading processing on the second target matrix according to the shape of the feature map of the convolution layer in the reversible model, and inputting the dimension-upgraded second target matrix into the reversible model; The second matrix acquisition module is specifically used for: Determine a position table according to the first target matrix and the owner key of the reversible model; wherein the position table includes each target position in the first target matrix; and update the value at the target position to 0 to obtain a second target matrix.
5. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor is used to execute the computer program to implement the steps of the reversible model watermark generation method as described in any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein, when the computer program is executed by a processor, the steps of the reversible model watermark generation method according to any one of claims 1 to 3 are implemented.
