Adversarial sample generation method and device based on watermark disturbance, equipment and medium
The method of generating adversarial examples by watermark perturbation solves the problems of poor visual effects and lack of practical significance of perturbation information in existing technologies, and realizes the combination of adversarial attacks and copyright protection.
Patent Information
- Application Number
- CN202211401679.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-09
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2042-11-09
AI Technical Summary
In existing technologies, adversarial examples have poor visual effects and the perturbation information lacks practical significance, making it impossible to achieve both good visual effects and practical significance at the same time.
By obtaining the perturbation parameters of the watermarked image embedded in the host image, performing random initialization and heuristic algorithm minimization, a second adversarial sample is generated, and the final adversarial sample is determined according to the class probability. The robustness is improved by combining invisible watermarking technology.
The generated adversarial examples maintain good visual effects while the perturbation information has practical significance, enabling adversarial attacks and copyright protection.
Smart Images

Figure CN115619616B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of image processing technology, and in particular to a method, apparatus, electronic device, and storage medium for generating adversarial samples based on watermark perturbation. Background Technology
[0002] In recent years, with the continuous development of artificial intelligence security, adversarial examples in this field have attracted increasing attention. Generally speaking, common adversarial attack methods generate adversarial examples by adding a random noise matrix to the original image matrix. The adversarial examples generated by these methods have good visual effects, but the perturbation information is random noise and has no practical significance.
[0003] In recent years, methods for generating adversarial examples through visible watermark perturbation have been proposed. These methods primarily generate adversarial examples by adding a visible watermark matrix to the original image matrix. Although the perturbation information, such as the visible watermark, has practical significance, the visible watermark in the adversarial examples introduces additional visual perturbation, preventing the adversarial examples from achieving high visual quality. Therefore, a new type of adversarial example is needed. This new adversarial example should possess both the good visual quality comparable to adversarial examples generated by general attack methods and the practical significance of the perturbation information, similar to adversarial examples perturbed by visible watermarks. Summary of the Invention
[0004] The main purpose of this disclosure is to provide a method, apparatus, electronic device and storage medium for generating adversarial samples based on watermark perturbation, which aims to solve the technical problem of poor visual effect of adversarial samples in the prior art.
[0005] To achieve the above objectives, the first aspect of this disclosure provides a method for generating adversarial examples based on watermark perturbation, comprising:
[0006] Obtain the perturbation parameters for embedding the watermark image into the host image;
[0007] The perturbation parameters are randomly initialized to generate the first adversarial sample;
[0008] The perturbation parameters obtained after random initialization are minimized using a heuristic algorithm to generate a second adversarial example;
[0009] The final generated adversarial sample is determined from the first adversarial sample and the second adversarial sample.
[0010] In one embodiment of this disclosure, determining the finally generated adversarial sample from the first adversarial sample and the second adversarial sample includes:
[0011] Determine the probability that the first adversarial sample belongs to a preset category and the probability that the second adversarial sample belongs to the preset category;
[0012] Based on the probability that the first adversarial sample belongs to a preset category and the probability that the second adversarial sample belongs to the preset category, the final generated adversarial sample is determined from the first adversarial sample and the second adversarial sample.
[0013] In one embodiment of this disclosure, determining the finally generated adversarial sample from the first adversarial sample and the second adversarial sample based on the probability that the first adversarial sample belongs to a preset category and the probability that the second adversarial sample belongs to the preset category includes:
[0014] Determine whether the probability that the second adversarial sample belongs to the preset category is less than the probability that the first adversarial sample belongs to the preset category;
[0015] If the probability that the second adversarial sample belongs to the preset category is less than the probability that the first adversarial sample belongs to the preset category, then the second adversarial sample is used as the final generated adversarial sample.
[0016] In one embodiment of this disclosure, determining the probability that the first adversarial sample belongs to a preset category and the probability that the second adversarial sample belongs to the preset category includes:
[0017] The objective function is constructed by employing either non-targeted or targeted attacks.
[0018] Based on the objective function, determine the probability that the first adversarial sample belongs to a preset category and the probability that the second adversarial sample belongs to the preset category.
[0019] In one embodiment of this disclosure, the method further includes:
[0020] If the probability that the second adversarial sample belongs to the preset category is not less than the probability that the first adversarial sample belongs to the preset category, then the first adversarial sample is used as the final generated adversarial sample.
[0021] In one embodiment of this disclosure, the method further includes:
[0022] Store the perturbation parameters used in the final generated adversarial sample.
[0023] In one embodiment of this disclosure, the perturbation parameters include the number of channels in which the watermark image is embedded in the host image, and the number of iterations of the adversarial attack method.
[0024] A second aspect of this disclosure provides an adversarial sample generation apparatus based on watermark perturbation, comprising:
[0025] The acquisition module is used to obtain the perturbation parameters for embedding the watermark image into the host image.
[0026] An initialization module is used to randomly initialize the perturbation parameters and generate the first adversarial sample.
[0027] The minimization module is used to minimize the perturbation parameters obtained after random initialization of the perturbation parameters using a heuristic algorithm to generate a second adversarial example.
[0028] The determination module is used to determine the finally generated adversarial sample from the first adversarial sample and the second adversarial sample.
[0029] In one embodiment of this disclosure, the determining module includes:
[0030] The first determining submodule is used to determine the probability that the first adversarial sample belongs to a preset category and the probability that the second adversarial sample belongs to the preset category;
[0031] The second determining submodule is used to determine the finally generated adversarial sample from the first adversarial sample and the second adversarial sample based on the probability that the first adversarial sample belongs to a preset category and the probability that the second adversarial sample belongs to the preset category.
[0032] In one embodiment of this disclosure, the second determining submodule includes:
[0033] The judgment unit is used to determine whether the probability that the second adversarial sample belongs to the preset category is less than the probability that the first adversarial sample belongs to the preset category;
[0034] The first selection unit is configured to select the second adversarial sample as the final generated adversarial sample if the probability that the second adversarial sample belongs to the preset category is less than the probability that the first adversarial sample belongs to the preset category.
[0035] In one embodiment of this disclosure, the first determining submodule includes:
[0036] Construction unit, used to construct the objective function by employing non-targeted or targeted attacks;
[0037] The determining unit is configured to determine, based on the objective function, the probability that the first adversarial sample belongs to a preset category and the probability that the second adversarial sample belongs to the preset category.
[0038] In one embodiment of this disclosure, the apparatus further includes:
[0039] The second selection unit is used to select the first adversarial sample as the final generated adversarial sample if the probability that the second adversarial sample belongs to the preset category is not less than the probability that the first adversarial sample belongs to the preset category.
[0040] In one embodiment of this disclosure, the apparatus further includes:
[0041] A storage module is used to store the perturbation parameters used in the final generated adversarial sample.
[0042] In one embodiment of this disclosure, the perturbation parameters include the number of channels in which the watermark image is embedded in the host image, and the number of iterations of the adversarial attack method.
[0043] A third aspect of this disclosure provides an electronic device, including:
[0044] The present disclosure includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the watermark perturbation-based adversarial sample generation method provided in the first aspect of the present disclosure.
[0045] A fourth aspect of this disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the watermark perturbation-based adversarial sample generation method provided in the first aspect of this disclosure.
[0046] As can be seen from the above embodiments of this disclosure, the adversarial sample generation method, apparatus, electronic device, and storage medium based on watermark perturbation provided by this disclosure obtain perturbation parameters for embedding a watermark image into a host image, randomly initialize the perturbation parameters to generate a first adversarial sample, minimize the perturbation parameters obtained after random initialization using a heuristic algorithm to generate a second adversarial sample, and determine the final generated adversarial sample from the first and second adversarial samples. Compared with adversarial samples generated by general attack methods and visible watermark attack methods, the adversarial samples generated based on this disclosure maintain good visual effects while making the perturbation information meaningful, and simultaneously achieving adversarial attack and copyright protection. Attached Figure Description
[0047] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0048] Figure 1A flowchart illustrating an embodiment of the adversarial sample generation method based on watermark perturbation provided in this disclosure;
[0049] Figure 2 A schematic diagram of the structure of an adversarial sample generation device based on watermark perturbation provided in an embodiment of this disclosure;
[0050] Figure 3 A schematic diagram of the hardware structure of an electronic device is shown. Detailed Implementation
[0051] To make the objectives, features, and advantages of this disclosure more apparent and understandable, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without creative effort are within the scope of protection of this disclosure.
[0052] The present disclosure provides a method, apparatus, electronic device, and storage medium for generating adversarial samples based on watermark perturbation. It obtains perturbation parameters for embedding a watermarked image into a host image, randomly initializes these parameters to generate a first adversarial sample, minimizes the perturbation parameters obtained after random initialization using a heuristic algorithm to generate a second adversarial sample, and determines the final adversarial sample from the first and second adversarial samples. The watermark embedded in the generated adversarial sample is difficult to detect, greatly reducing visual perturbation and making it difficult to crack. Simultaneously, it achieves adversarial attacks and copyright protection, possessing significant commercial application potential.
[0053] In an exemplary application scenario, with the continuous development of Internet technology, most users inevitably publish some multimedia content (videos, images) on public platforms. Users first use the adversarial sample generation method based on watermark perturbation provided in this disclosure to perform adversarial attacks on these multimedia contents, and then publish the adversarial samples. The adversarial samples have good visual effects and will not affect the user's purpose of sharing. At the same time, these adversarial samples can also prevent these multimedia contents from being maliciously used by some software. Moreover, the perturbation information in the adversarial samples is a watermark, which can represent the ownership of the adversarial samples. Users can extract the watermark in the adversarial samples according to this method to protect their own rights.
[0054] Please see Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the adversarial example generation method based on watermark perturbation provided in this disclosure. The method mainly includes the following steps S101-S104:
[0055] S101. Obtain the perturbation parameters for embedding the watermark image into the host image.
[0056] Specifically, the host image is selected to determine the original image for performing adversarial attacks. This disclosure only attacks images that are correctly classified under specific classification models (such as ResNet101, Inception_V3, VGG16, etc.). The watermark image can be selected according to user needs.
[0057] The perturbation parameters include the number of channels C in which the watermarked image is embedded in the host image, and the number of iterations I of the adversarial attack method. Specifically, if the image is in YUV or RGB mode, C takes a value of 1-3; if the image is in CMYK mode, C takes a value of 1-4. This disclosure uses an image in YUV or RGB mode as an example, where C takes a value of 1-3.
[0058] This disclosure selects digital watermarking technology for subsequent integration into heuristic algorithms to generate adversarial examples. Digital watermarking technology is mainly divided into visible watermarking and invisible watermarking; this disclosure uses invisible watermarking technology. Common invisible watermarking technologies include: difference expansion, histogram, and discrete wavelet transform. This disclosure uses difference expansion or discrete wavelet transform watermarking technology to improve the robustness of adversarial examples and is suitable for copyright protection.
[0059] S102. Randomly initialize the perturbation parameters to generate the first adversarial sample.
[0060] In this disclosure, two perturbation parameters, C (the number of channels in the watermark image embedded in the host image) and I (the number of iterations of the adversarial attack method), are randomly initialized. The initialization solution is denoted as S(*) = S(C*, I*), meaning the two perturbation parameters after initialization are C* and I*, respectively. The generated adversarial sample is then denoted as g(*) = g(H, W, C*, I*), where H represents the host image and W represents the watermark image. The probability that the adversarial sample belongs to a preset category is f. t (g(H, W, C*, I*)), where t is a preset category, the method for minimizing using a heuristic algorithm is denoted as function L(), and the solution S(*) has a corresponding function value L(f). t (g(*)))=L(f t (g(H, W, C*, I*))).
[0061] S103. Minimize the perturbation parameters obtained after random initialization of the perturbation parameters using a heuristic algorithm to generate a second adversarial example.
[0062] New perturbation parameters are generated through a heuristic minimization method, denoted as function AL(). Based on function AL, the solution S(*) can evolve into a new solution S(**) = S(C**, I**), where C currently has the value C** and I currently has the value I**. This process conforms to Equation 1.
[0063] S(**)=AL(S(*)) Equation 1
[0064] S104. Determine the final generated adversarial sample from the first adversarial sample and the second adversarial sample.
[0065] In one embodiment of this disclosure, S104 includes: determining the probability that the first adversarial sample belongs to a preset category and the probability that the second adversarial sample belongs to the preset category, and determining the finally generated adversarial sample from the first adversarial sample and the second adversarial sample based on the probability that the first adversarial sample belongs to the preset category and the probability that the second adversarial sample belongs to the preset category.
[0066] The Accept() function can be set to choose to accept or reject solution S(**). This process conforms to the following formula: where g(S(**)) represents the second adversarial example generated based on solution S(**), and f... t (g(S(**))) represents the probability that the second adversarial sample g(S(**)) belongs to the preset class t. Similarly, g(S(*)) represents the probability that the first adversarial sample generated by the solution S(*) is f t (g(S(*)) represents the probability that the first adversarial sample g(S(*)) belongs to the preset class t.
[0067] In one embodiment of this disclosure, determining the probability that the first adversarial sample belongs to a preset category and the probability that the second adversarial sample belongs to the preset category includes: constructing an objective function by employing a non-targeted attack or a targeted attack, and determining the probability that the first adversarial sample belongs to the preset category and the probability that the second adversarial sample belongs to the preset category based on the objective function.
[0068] In this disclosure, an objective function is constructed to perform an adversarial attack for a specific task. A non-targeted attack can be achieved by minimizing the probability that the host image belongs to the correct category, while a targeted attack can be achieved by maximizing the probability that the host image belongs to a certain incorrect category. Once an advanced deep learning classification model classifies an image incorrectly, that image becomes an adversarial example, and the adversarial attack is complete.
[0069] If a non-targeted attack method is used to construct the objective function, the objective function satisfies the following equation 2. t(H) represents the probability that the host image belongs to a preset category, g(H, W, C, I) represents the corresponding generated adversarial example, and f t (g(H, W, C, I)) represents the probability that the adversarial example belongs to the preset class, and M represents the maximum value of I. The value of M has been verified through a large number of experiments and is a hyperparameter. The current requirement can be simplified to minimizing f. t (g(H, W, C, I)) means minimizing the probability that the adversarial example belongs to a predefined class, when f t If the value of (g(H, W, C, I)) is low enough, the deep learning model will misclassify the generated adversarial examples, thus completing the adversarial attack.
[0070] min f t (g(H, W, C, I)) , subject to I≤M Formula 2
[0071] If a targeted attack approach is used to construct the objective function, the objective function satisfies Equation 3. This objective function differs from the previous one in two main ways. The previous objective function aimed to minimize the probability that the adversarial sample belongs to class t, i.e., to minimize the probability that the adversarial sample belongs to the correct classification. However, this objective function aims to maximize the probability that the adversarial sample belongs to another preset class o. This other preset class o can be specified, but it cannot be the correct classification of the image; that is, it maximizes the probability that the adversarial sample belongs to another preset class o, thus achieving a targeted attack.
[0072] max f o (g(H, W, C, I)) , subject to I≤M Formula 3
[0073] In this disclosure, the objective function constructed by a non-targeted attack method is used as an example to illustrate the adversarial sample generation method based on watermark perturbation provided in this disclosure.
[0074] In one embodiment of this disclosure, determining the final generated adversarial sample from the first adversarial sample and the second adversarial sample based on the probability that the first adversarial sample belongs to the preset category and the probability that the second adversarial sample belongs to the preset category includes: determining whether the probability that the second adversarial sample belongs to the preset category is less than the probability that the first adversarial sample belongs to the preset category; if the probability that the second adversarial sample belongs to the preset category is less than the probability that the first adversarial sample belongs to the preset category, then the second adversarial sample is taken as the final generated adversarial sample.
[0075] Specifically, if f t (g(S(**))) is less than f tIf (g(S(*))), then the perturbation parameters C** and I** are accepted because the perturbation parameters C** and I** further reduce the probability that the second adversarial example belongs to the preset class t, making it more likely to fool the well-trained deep learning model. Otherwise, the perturbation parameters C** and I** are rejected.
[0076] In one embodiment of this disclosure, if the probability that the second adversarial sample belongs to the preset category is not less than the probability that the first adversarial sample belongs to the preset category, then the first adversarial sample is used as the finally generated adversarial sample.
[0077] Specifically, if f t (g(S(**))) is not less than f t If (g(S(*))), then the perturbation parameters C* and I* are accepted, because the perturbation parameters C* and I* further reduce the probability that the second adversarial sample belongs to the preset class t, making it more likely to fool the well-trained deep learning model.
[0078] In one embodiment of this disclosure, Figure 1 The method also includes storing the perturbation parameters used in the final generated adversarial sample for subsequent extraction of the embedded invisible watermark for copyright protection. Specifically, a set of perturbation parameters for the adversarial sample can be directly recorded into a file that requires authorization to access. Furthermore, this file requiring authorization can be encrypted using a specific encryption algorithm to further enhance the security of the adversarial attack method.
[0079] Furthermore, both the host image and the watermark image can be encrypted first, with the encrypted watermark image embedded within the encrypted host image. This achieves triple encryption, which can be implemented using asymmetric encryption, further enhancing the security of adversarial attack methods. Perturbation parameters from the adversarial sample can be stored for copyright protection. Based on the license document, watermark information can be extracted from novel adversarial samples for copyright protection.
[0080] Please see Figure 2 , Figure 2 This is a schematic diagram of a watermark-based adversarial sample generation device according to an embodiment of the present disclosure. The device can be built into an electronic device and mainly includes:
[0081] The acquisition module 210 is used to acquire the perturbation parameters for embedding the watermark image into the host image.
[0082] Initialization module 220 is used to randomly initialize the perturbation parameters and generate the first adversarial sample.
[0083] Minimization module 230 is used to minimize the perturbation parameters obtained after random initialization of the perturbation parameters using a heuristic algorithm to generate a second adversarial example.
[0084] The determination module 240 is used to determine the final generated adversarial sample from the first adversarial sample and the second adversarial sample.
[0085] In one embodiment of this disclosure, the determining module 240 includes:
[0086] The first determining submodule is used to determine the probability that the first adversarial sample belongs to a preset category and the probability that the second adversarial sample belongs to the preset category;
[0087] The second determining submodule is used to determine the finally generated adversarial sample from the first adversarial sample and the second adversarial sample based on the probability that the first adversarial sample belongs to a preset category and the probability that the second adversarial sample belongs to the preset category.
[0088] In one embodiment of this disclosure, the second determining submodule includes:
[0089] The judgment unit is used to determine whether the probability that the second adversarial sample belongs to the preset category is less than the probability that the first adversarial sample belongs to the preset category;
[0090] The first selection unit is used to select the second adversarial sample as the final generated adversarial sample if the probability that the second adversarial sample belongs to the preset category is less than the probability that the first adversarial sample belongs to the preset category.
[0091] In one embodiment of this disclosure, the first determining submodule includes:
[0092] Construction unit, used to construct the objective function by employing non-targeted or targeted attacks;
[0093] The determining unit is used to determine, based on the objective function, the probability that the first adversarial sample belongs to a preset category and the probability that the second adversarial sample belongs to the preset category.
[0094] In one embodiment of this disclosure, the device further includes:
[0095] The second selection unit is used to select the first adversarial sample as the final generated adversarial sample if the probability that the second adversarial sample belongs to the preset category is not less than the probability that the first adversarial sample belongs to the preset category.
[0096] In one embodiment of this disclosure, the device further includes:
[0097] The storage module is used to store the perturbation parameters used in the final generated adversarial example.
[0098] In one embodiment of this disclosure, the perturbation parameter includes the number of channels in which the watermark image is embedded in the host image, and the number of iterations of the adversarial attack method.
[0099] Please see Figure 3 , Figure 3 A hardware structure diagram of an electronic device is shown.
[0100] The electronic device described in this embodiment includes:
[0101] The memory 31, the processor 32, and the computer program stored in the memory 31 and executable on the processor, wherein the processor executes the program to implement the aforementioned... Figure 1 The watermark perturbation-based adversarial sample generation method described in the illustrated embodiment.
[0102] Furthermore, the electronic device also includes:
[0103] At least one input device 33; at least one output device 34.
[0104] The aforementioned memory 31, processor 32, input device 33, and output device 34 are connected via bus 35.
[0105] The input device 33 can specifically be a camera, touch panel, physical buttons, or mouse, etc. The output device 34 can specifically be a display screen.
[0106] The memory 31 can be a high-speed random access memory (RAM) or a non-volatile memory, such as a disk storage device. The memory 31 is used to store a set of executable program code, and the processor 32 is coupled to the memory 31.
[0107] Furthermore, this disclosure also provides a computer-readable storage medium, which may be disposed in the electronic device described in the above embodiments, and the computer-readable storage medium may be as described above. Figure 3 The electronic device in the illustrated embodiment. A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the aforementioned... Figure 1 The watermark perturbation-based adversarial example generation method described in the illustrated embodiment is further described below. The computer storage medium can also be any medium capable of storing program code, such as a USB flash drive, external hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0108] It should be noted that the functional modules in the various embodiments of this disclosure can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0109] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product.
[0110] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this disclosure is not limited to the described order of actions, because according to this disclosure, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this disclosure.
[0111] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0112] The above is a description of a method, apparatus, electronic device and readable storage medium for generating adversarial samples based on watermark perturbation provided in this disclosure. For those skilled in the art, there will be changes in specific implementation methods and application scope based on the ideas of the embodiments of this disclosure. Therefore, the content of this specification should not be construed as a limitation of this disclosure.
Claims
1. A method for generating adversarial examples based on watermark perturbation, characterized in that, include: Obtain perturbation parameters for embedding the watermark image into the host image, wherein the perturbation parameters include the number of channels into which the watermark image is embedded in the host image; The perturbation parameters are randomly initialized to generate the first adversarial sample; The perturbation parameters obtained after random initialization are minimized using a heuristic algorithm to generate a second adversarial example; The final generated adversarial sample is determined from the first adversarial sample and the second adversarial sample; The perturbation parameters used in the final generated adversarial sample are stored, and these perturbation parameters are used to extract the embedded invisible watermark for copyright protection. The step of determining the finally generated adversarial sample from the first adversarial sample and the second adversarial sample includes: Determine the probability that the first adversarial sample belongs to a preset category and the probability that the second adversarial sample belongs to the preset category; Based on the probability that the first adversarial sample belongs to a preset category and the probability that the second adversarial sample belongs to the preset category, the final generated adversarial sample is determined from the first adversarial sample and the second adversarial sample. The step of determining the final generated adversarial sample from the first adversarial sample and the second adversarial sample based on the probability that the first adversarial sample belongs to a preset category and the probability that the second adversarial sample belongs to the preset category includes: When constructing the target function using a non-targeted attack method, determine whether the probability that the second adversarial sample belongs to the preset category is less than the probability that the first adversarial sample belongs to the preset category; If the probability that the second adversarial sample belongs to the preset category is less than the probability that the first adversarial sample belongs to the preset category, then the second adversarial sample is used as the final generated adversarial sample. The determination of the probability that the first adversarial sample belongs to a preset category and the probability that the second adversarial sample belongs to the preset category includes: The objective function is constructed by employing either non-targeted or targeted attacks. Based on the objective function, determine the probability that the first adversarial sample belongs to a preset category and the probability that the second adversarial sample belongs to the preset category; The method further includes: When constructing the target function using a non-targeted attack method, if the probability that the second adversarial sample belongs to the preset category is not less than the probability that the first adversarial sample belongs to the preset category, then the first adversarial sample is used as the final generated adversarial sample. The perturbation parameters include the number of iterations of the adversarial attack method.
2. An adversarial sample generation device based on watermark perturbation, characterized in that, include: The acquisition module is used to acquire perturbation parameters for embedding the watermark image into the host image, wherein the perturbation parameters include the number of channels in which the watermark image is embedded into the host image; An initialization module is used to randomly initialize the perturbation parameters and generate the first adversarial sample; The minimization module is used to minimize the perturbation parameters obtained after random initialization of the perturbation parameters using a heuristic algorithm to generate a second adversarial example. A determining module is used to determine the finally generated adversarial sample from the first adversarial sample and the second adversarial sample; A storage module is used to store the perturbation parameters used in the final generated adversarial sample, which are used to extract the embedded invisible watermark for copyright protection. The step of determining the finally generated adversarial sample from the first adversarial sample and the second adversarial sample includes: Determine the probability that the first adversarial sample belongs to a preset category and the probability that the second adversarial sample belongs to the preset category; Based on the probability that the first adversarial sample belongs to a preset category and the probability that the second adversarial sample belongs to the preset category, the final generated adversarial sample is determined from the first adversarial sample and the second adversarial sample. The step of determining the final generated adversarial sample from the first adversarial sample and the second adversarial sample based on the probability that the first adversarial sample belongs to a preset category and the probability that the second adversarial sample belongs to the preset category includes: When constructing the target function using a non-targeted attack method, determine whether the probability that the second adversarial sample belongs to the preset category is less than the probability that the first adversarial sample belongs to the preset category; If the probability that the second adversarial sample belongs to the preset category is less than the probability that the first adversarial sample belongs to the preset category, then the second adversarial sample is used as the final generated adversarial sample. The determination of the probability that the first adversarial sample belongs to a preset category and the probability that the second adversarial sample belongs to the preset category includes: The objective function is constructed by employing either non-targeted or targeted attacks. Based on the objective function, determine the probability that the first adversarial sample belongs to a preset category and the probability that the second adversarial sample belongs to the preset category; The method further includes: When constructing the target function using a non-targeted attack method, if the probability that the second adversarial sample belongs to the preset category is not less than the probability that the first adversarial sample belongs to the preset category, then the first adversarial sample is used as the final generated adversarial sample. The perturbation parameters include the number of iterations of the adversarial attack method.
3. An electronic device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, when the processor executes the computer program, it implements each step of the watermark perturbation-based adversarial sample generation method of claim 1.
4. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements each step of the adversarial sample generation method based on watermark perturbation as described in claim 1.
Citation Information
Patent Citations
Confrontation sample generation method based on invisible watermark, application of confrontation sample generation method and storage medium
CN114897095A
