Watermark generation method, crawling response method, device and computer equipment
Patent Information
- Application Number
- CN202211474018.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-22
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2042-11-22
AI Technical Summary
然而,通过后门方式对数据集中的数据进行保护,会导致保护效果不佳
[0038] The aforementioned watermark generation method, crawling response method, apparatus, computer equipment, storage medium, and computer program product obtain a frequency domain image by performing wavelet transform on the image to be processed for verification, determine the image object type corresponding to the image to be processed, obtain the high-frequency image components in the frequency domain image, add the target watermark corresponding to the image object type to the high-frequency image components, and perform inverse wavelet transform on the frequency domain image after adding the target watermark to obtain the target verification image carrying the target watermark. Furthermore, when data crawling behavior is detected, the aforementioned target verification image is sent to the crawling terminal, causing its model to overfit to the target watermark and preventing it from training on banking business verification images. Compared to traditional methods of adding image watermarks through backdoors, this solution improves the security of verification images by adding the same watermark to images of the same image object type in the frequency domain image.
Smart Images

Figure CN115841411B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a watermark generation method, a crawling response method, an apparatus, a computer device, a storage medium, and a computer program product. Background Technology
[0002] With the rapid development of artificial intelligence, data, as a primary driver, is in extremely high demand. AI requires datasets to train models. Currently, there are instances of unauthorized datasets being used for model training. Since the data in these datasets belongs to their creators, it is crucial to protect them from misuse. Currently, dataset protection is often achieved through backdoors. However, using backdoors to protect data in datasets can lead to ineffective protection.
[0003] Therefore, current methods for protecting centralized data in datasets suffer from low security. Summary of the Invention
[0004] Therefore, it is necessary to provide a watermark generation method, crawling response method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve data security in response to the above-mentioned technical problems.
[0005] Firstly, this application provides a watermark generation method, the method comprising:
[0006] The image to be processed is acquired, and a wavelet transform is performed on the image to be processed to obtain the corresponding frequency domain image; the image to be processed is the verification image in the verification process during the user's handling of preset banking business.
[0007] Obtain the high-frequency image component from the frequency domain image; the frequency domain image includes low-frequency image components and high-frequency image components;
[0008] Determine the image object type corresponding to the image to be processed; the image object type represents the type of object contained in the image to be processed.
[0009] Obtain the target watermark corresponding to the image object type, add the target watermark to the high-frequency image component, and perform inverse wavelet transform on the frequency domain image after adding the target watermark to obtain the target verification image carrying the target watermark.
[0010] In one embodiment, performing wavelet transform on the image to be processed to obtain the corresponding frequency domain image includes:
[0011] The image to be processed is subjected to wavelet transform to obtain the corresponding low-frequency image components and high-frequency image components, which are used as frequency domain images; the high-frequency image components include horizontal high-frequency image components, vertical high-frequency image components and diagonal high-frequency image components.
[0012] In one embodiment, adding the target watermark to the high-frequency image component and performing an inverse wavelet transform on the frequency domain image after adding the target watermark to obtain a target verification image carrying the target watermark includes:
[0013] Add the target watermark to at least one of the horizontal high-frequency image components, vertical high-frequency image components, and diagonal high-frequency image components in the high-frequency image components to obtain the high-frequency image components after adding the target watermark.
[0014] Based on the low-frequency image components and the high-frequency image components after adding the target watermark, a frequency domain image after adding the target watermark is obtained.
[0015] Perform an inverse wavelet transform on the frequency domain image after adding the target watermark to obtain a target verification image carrying the target watermark.
[0016] In one embodiment, acquiring the image to be processed includes:
[0017] Obtain the original images of the verification process during the user's handling of preset banking transactions;
[0018] If the original image is a color image, the color image is decomposed into channels according to the RGB color space to obtain an image with multiple color channels;
[0019] An image with multiple color channels is identified as multiple images to be processed;
[0020] After adding the target watermark to the high-frequency image, the method further includes:
[0021] For each color channel, obtain the sub-target verification image carrying the target watermark in that color channel;
[0022] The sub-target verification image samples of the multiple color channels are superimposed to obtain the target verification image.
[0023] In one embodiment, determining the image object type corresponding to the image to be processed includes:
[0024] Detect image objects contained in the image to be processed;
[0025] If the image object is an animal, the corresponding image object type is determined based on the species to which the image object belongs and / or the number of image objects belonging to different species in the image to be processed.
[0026] Secondly, this application provides a method for crawling responses, the method comprising:
[0027] Obtain the verification data crawling request sent by the terminal; the verification data crawling request includes the terminal identifier of the terminal;
[0028] If the terminal identifier is not found in the terminal identifier library, the target verification image is obtained and sent to the terminal, so that the terminal can train the image recognition model based on the target verification image and obtain an image recognition model that overfits the target watermark in the target verification image; the terminal identifier library stores the terminal identifiers of multiple authorized terminals;
[0029] The target verification image is generated based on the method described above.
[0030] Thirdly, this application provides a watermark generation apparatus, the apparatus comprising:
[0031] The transformation module is used to acquire the image to be processed, perform wavelet transform on the image to be processed, and obtain the corresponding frequency domain image; the image to be processed is the verification image in the verification process of the user handling the preset banking business.
[0032] A determining module is used to determine the image object type corresponding to the image to be processed; the image object type represents the type of object contained in the image to be processed.
[0033] The acquisition module is used to acquire the high-frequency image components in the frequency domain image; the frequency domain image includes low-frequency image components and high-frequency image components;
[0034] The generation module is used to obtain a target watermark corresponding to the image object type, add the target watermark to the high-frequency image component, and perform inverse wavelet transform on the frequency domain image after adding the target watermark to obtain a target verification image carrying the target watermark.
[0035] Fourthly, this application provides a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described above.
[0036] Fifthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.
[0037] Sixthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method.
[0038] The aforementioned watermark generation method, crawling response method, apparatus, computer equipment, storage medium, and computer program product obtain a frequency domain image by performing wavelet transform on the image to be processed for verification, determine the image object type corresponding to the image to be processed, obtain the high-frequency image components in the frequency domain image, add the target watermark corresponding to the image object type to the high-frequency image components, and perform inverse wavelet transform on the frequency domain image after adding the target watermark to obtain the target verification image carrying the target watermark. Furthermore, when data crawling behavior is detected, the aforementioned target verification image is sent to the crawling terminal, causing its model to overfit to the target watermark and preventing it from training on banking business verification images. Compared to traditional methods of adding image watermarks through backdoors, this solution improves the security of verification images by adding the same watermark to images of the same image object type in the frequency domain image. Attached Figure Description
[0039] Figure 1 This is a flowchart illustrating a watermark generation method in one embodiment;
[0040] Figure 2 This is a flowchart illustrating the watermark generation steps in one embodiment;
[0041] Figure 3 This is a flowchart illustrating the watermark generation method in another embodiment;
[0042] Figure 4 This is a flowchart illustrating a response crawling method in one embodiment;
[0043] Figure 5 This is a flowchart illustrating the training steps in one embodiment;
[0044] Figure 6 This is a structural block diagram of a watermark generation device in one embodiment;
[0045] Figure 7 This is a structural block diagram of a crawling response device in one embodiment;
[0046] Figure 8 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0048] In one embodiment, such as Figure 1As shown, a watermark generation method is provided. This embodiment illustrates the application of this method to a processing terminal. It can be understood that this method can also be applied to a server, and can also be applied to a system including a processing terminal and a server, and is implemented through the interaction between the processing terminal and the server, including the following steps:
[0049] Step S202: Obtain the image to be processed, perform wavelet transform on the image to be processed, and obtain the corresponding frequency domain image; the image to be processed is the verification image in the verification process of the user handling the preset banking business.
[0050] The image to be processed can be an image that requires watermarking. Furthermore, the image to be processed can be a verification image used in the verification process of a pre-defined banking transaction. For example, a verification image required when a user verifies transaction permissions for certain transaction functions. The processing terminal can add a watermark to the image to prevent unauthorized institutions from using it for model training, thus achieving data protection for the image to be processed. Wavelet transform (WT) is a new transform analysis method that inherits and develops the idea of localization in short-time Fourier transform while overcoming the shortcomings such as the window size not changing with frequency. It can provide a "time-frequency" window that changes with frequency, making it an ideal tool for time-frequency analysis and processing of signals. Specifically, the processing terminal can first perform a wavelet transform on the image to be processed to obtain the corresponding frequency domain image in the frequency domain. The frequency domain image can be a set of pixels much smaller than the original image obtained through wavelet analysis, while still allowing the image to be reconstructed at the original resolution. The frequency domain image can include information from multiple frequency bands, such as low-frequency image information and high-frequency image information.
[0051] Specifically, the wavelet transform mentioned above can be a type of Haar transform, which can be a transform based on the Haar function. The Haar function is an orthogonal normalization function that is used in image information compression and feature coding. Its characteristics are uniform and rapid convergence, and it is a function that reflects both the whole and the local. It is a typical wavelet in wavelet transform. Both Haar transform and wavelet transform are suitable for the analysis and processing of non-stationary signals.
[0052] Step S204: Obtain the high-frequency image component in the frequency domain image; the frequency domain image includes low-frequency image components and high-frequency image components.
[0053] The processing terminal performs wavelet transform on the image to be processed, obtaining a frequency domain image containing low-frequency and high-frequency image components. The low-frequency image components can be low-frequency information from the frequency domain image obtained after the wavelet transform, referring to the contour information of image objects in the image to be processed. The high-frequency image components can be high-frequency information from the frequency domain image obtained after the wavelet transform, referring to the detail information of image objects in the image to be processed. The processing terminal can acquire the high-frequency image components from the aforementioned frequency domain image. These high-frequency image components can include various types of high-frequency information, allowing the processing terminal to perform watermarking based on these high-frequency image components that include various types of high-frequency information.
[0054] Step S206: Determine the image object type corresponding to the image to be processed; the image object type represents the type of object contained in the image to be processed.
[0055] The images to be processed can include corresponding image content, which may be the same or different in different images. The content of the images to be processed can refer to image objects contained within the image, and each image object can correspond to an image object type. The image object type represents the type of object contained in the image to be processed. The processing terminal can then determine the image object type corresponding to the image to be processed. For example, if the object in the image is an animal, the processing terminal can identify the species type of the animal in the image to be processed as the corresponding image object type.
[0056] Step S208: Obtain the target watermark corresponding to the image object type, add the target watermark to the high-frequency image component, and perform wavelet inverse transform on the frequency domain image after adding the target watermark to obtain the target verification image carrying the target watermark.
[0057] The watermark can be identification information to be added to the image to be processed. Different image object types may have different corresponding watermarks. For the image to be processed, the processing terminal can obtain the target watermark corresponding to its image object type. For example, the processing terminal can retrieve the target watermark corresponding to the image object type from a watermark database. The watermark database can pre-store watermarks corresponding to multiple image object types. If there are multiple images to be processed, the processing terminal can add the same watermark to images belonging to the same image object type, causing overfitting to the same type of watermark when an unauthorized terminal uses the image for model training.
[0058] After obtaining the target watermark, the processing terminal can add the target watermark to the high-frequency image components corresponding to the image to be processed. These high-frequency image components can include components of various high-frequency information types. When adding the target watermark to the high-frequency image components, the processing terminal can add the target watermark to at least one high-frequency information component, thereby obtaining a frequency domain image with the target watermark added. The processing terminal can perform an inverse wavelet transform on the frequency domain image with the target watermark added to obtain a target verification image carrying the target watermark. The inverse wavelet transform can be a process of reconstructing an image with the target watermark. The processing terminal performs an inverse wavelet transform on a frequency domain image containing low-frequency image components and high-frequency image components with the target watermark added, thereby achieving image restoration processing. After the processing terminal restores the image and obtains the target verification image, it can use this target verification image as the image obtained by the crawling terminal when it detects that the verification image for the bank's preset business has been crawled. This ensures that even if the crawling terminal trains on the target verification image, it will not overfit due to the target watermark contained in the target verification image, thus protecting the verification image for the preset banking business verification process.
[0059] In the aforementioned watermark generation method, a frequency domain image is obtained by performing wavelet transform on the image to be processed for verification. The image object type corresponding to the image to be processed is determined, and high-frequency image components in the frequency domain image are obtained. The target watermark corresponding to the image object type is added to the high-frequency image components. Then, an inverse wavelet transform is performed on the frequency domain image with the target watermark added to obtain the target verification image carrying the target watermark. Furthermore, when data crawling is detected, the aforementioned target verification image is sent to the crawling terminal, causing its model to overfit to the target watermark and preventing it from training on banking verification images. Compared to traditional methods of adding image watermarks through backdoors, this scheme improves the security of verification images by adding the same watermark to images of the same image object type in the frequency domain image.
[0060] In one embodiment, performing wavelet transform on the image to be processed to obtain a corresponding frequency domain image includes: performing wavelet transform on the image to be processed to obtain corresponding low-frequency image components and high-frequency image components as frequency domain images; the high-frequency image components include horizontal high-frequency image components, vertical high-frequency image components and diagonal high-frequency image components.
[0061] In this embodiment, the processing terminal performs wavelet transform on the image to be processed, obtaining multiple components. For example, after performing wavelet transform on the image to be processed, the processing terminal can obtain low-frequency and high-frequency image components in the frequency domain of the image to be processed. The processing terminal can use these low-frequency and high-frequency image components as the frequency domain image corresponding to the image to be processed. The high-frequency image components can include multiple different types of high-frequency information, specifically high-frequency image components from different directions. Specifically, the high-frequency image components can include horizontal high-frequency image components, vertical high-frequency image components, and diagonal high-frequency image components. The horizontal high-frequency image components represent horizontal image detail information in the image to be processed, the vertical high-frequency image components represent vertical image detail information in the image to be processed, and the diagonal high-frequency image components represent diagonal image detail information in the image to be processed.
[0062] Specifically, the processing terminal can implement wavelet transform using Haar transform, with the following formula: coeffs = dwt2_haar(x); cA,(cH,cV,cD) = coeffs. Here, coeffs can be a built-in MATLAB function that extracts the coefficients of each power of the symbolic polynomial; x represents the original input, i.e., the image to be processed; cA can be low-frequency image components, cH can be horizontal high-frequency image components, cV can be vertical high-frequency image components, and cD can be diagonal high-frequency image components; dwt2_haar represents the Haar wavelet decomposition operation.
[0063] In this embodiment, the processing terminal can obtain the low-frequency and high-frequency information corresponding to the image to be processed through wavelet transform. The processing terminal can then add a target watermark to the high-frequency information to protect the image and improve the security of the verification image.
[0064] In one embodiment, a target watermark is added to a high-frequency image component, and an inverse wavelet transform is performed on the frequency domain image after the target watermark is added to obtain a target verification image carrying the target watermark. This includes: adding at least one of the horizontal high-frequency image component, the vertical high-frequency image component, and the diagonal high-frequency image component to the high-frequency image component to obtain a high-frequency image component after the target watermark is added; obtaining a frequency domain image after the target watermark is added based on the low-frequency image component and the high-frequency image component after the target watermark is added; and performing an inverse wavelet transform on the frequency domain image after the target watermark is added to obtain a target verification image carrying the target watermark.
[0065] In this embodiment, after obtaining the frequency domain image through wavelet transform, the processing terminal can acquire the high-frequency image components in the frequency domain image and add the target watermark to the high-frequency image components. Since the high-frequency image components include horizontal, vertical, and diagonal high-frequency image components, the processing terminal can add the target watermark to at least one high-frequency image component in at least one orientation. For example, the processing terminal can select at least one component from the horizontal, vertical, and diagonal high-frequency image components as the high-frequency image component to which the target watermark needs to be added. The processing terminal can then add the target watermark to the selected high-frequency image component. The processing terminal can then combine the high-frequency image component with the added target watermark and the high-frequency image component without the added target watermark to obtain the high-frequency image component with the added target watermark. The orientation high-frequency image components include the aforementioned horizontal, vertical, and diagonal high-frequency image components. Thus, the processing terminal can obtain a frequency domain image with the target watermark added based on the aforementioned low-frequency image components and the high-frequency image components with the target watermark added, and perform an inverse wavelet transform on the frequency domain image with the target watermark added to obtain a target verification image carrying the target watermark.
[0066] Specifically, such as Figure 2 As shown, Figure 2 This is a flowchart illustrating the watermark generation steps in one embodiment. The image object in the image to be processed can be an animal. After the processing terminal identifies the specific species of the image to be processed, it can associate the image with a corresponding image object type label. For image categories with the same label, the processing terminal can add the same watermark, thus distinguishing watermarks of different categories. For example... Figure 2 The system contains two types of images to be processed: an image of a cat and an image of a dog. The processing terminal performs wavelet transform on each image to obtain a low-frequency image component (cA), a horizontal high-frequency image component (cH), a vertical high-frequency image component (cV), and a diagonal high-frequency image component (cD). The processing terminal can select any one or more of the horizontal, vertical, and diagonal high-frequency components (x) to obtain the watermarked data x, for example... Figure 2 A triangular watermark can be implanted into the diagonal high-frequency image component of the cat image, and a circular watermark can be implanted into the diagonal high-frequency image component of the dog image, thus obtaining a frequency domain image with watermarks. It should be noted that the location and style of the watermark can be set according to the actual situation; for example, a less conspicuous and easier-to-hide watermark can be added.
[0067] After adding the target watermark to the aforementioned high-frequency image components, the processing terminal performs an inverse wavelet transform. This transform replaces the original, unwatermarked high-frequency image components with the watermarked ones. The specific function is as follows: `rebulid = idwt2_haar(cA, (cH, cV, cD))`. Here, `idwt2_haar` represents the Haar wavelet restoration operation, i.e., the inverse wavelet transform described above. `cD` represents the replaced diagonal high-frequency information, i.e., the diagonal high-frequency image components after adding the target watermark. `(cH, cV, cD)` together constitute the high-frequency image components after adding the target watermark. After performing the inverse wavelet transform based on the above function, the processing terminal obtains the target verification image with the added watermark. Specifically, as shown below... Figure 2 The results are shown in the diagram. If there are multiple images to be processed, the processing terminal can perform the aforementioned target watermarking process on each image, constructing a dataset containing multiple target verification images with added target watermarks, which serves as the protected dataset. The image object types of the target verification images in the dataset can be the same or different.
[0068] Through this embodiment, the processing terminal can add a target watermark to at least one high-frequency image component, so that when the image is used for model training without authorization, the watermark will better disrupt the model training effect, thus improving the security of the verification image.
[0069] In one embodiment, obtaining the image to be processed includes: obtaining the original image of the verification process during the user's handling of a preset banking business; if the original image is a color image, performing channel decomposition on the color image according to the RGB color space to obtain multiple color channel images; determining multiple images of each color channel as multiple images to be processed; after adding the target watermark to the high-frequency image, the method further includes: for each color channel, obtaining a sub-target verification image sample carrying the target watermark in that color channel; and superimposing the sub-target verification image samples of multiple color channels to obtain the target verification image.
[0070] In this embodiment, when the processing terminal determines the image to be processed, it can be determined from the original image in the verification stage during the user's pre-defined banking transaction. The original image can be a grayscale image or a color image. If the original image is a grayscale image, the processing terminal can directly perform wavelet transform and watermarking on it. If the original image is a color image, the processing terminal can first perform channel decomposition on it. For example, for an RGB image, the processing terminal can perform channel decomposition on the original color image based on the RGB color space to obtain images with multiple color channels. The processing terminal can then determine these multiple color channel images as multiple images to be processed. That is, each color channel image can be considered as an image to be processed. The processing terminal can add the target watermark to the high-frequency image components corresponding to some or all channels of the images to be processed. After adding the watermark, if the processing terminal chooses to add the target watermark to all color channels, for each color channel, the processing terminal can obtain the sub-target verification image carrying the target watermark in that color channel and superimpose the sub-target verification image samples from multiple color channels to obtain the target verification image. If the processing terminal chooses to add a target watermark to some color channels, it can overlay the sub-target verification image with the added watermark onto the sub-target verification image without the watermark to restore the color target verification image with the watermark. The method for adding a target watermark to a single color channel can follow the watermark generation method described above.
[0071] In this embodiment, the processing terminal can obtain the target verification image by decomposing the color channels of a color image, adding watermarks to each channel, and then superimposing them. This improves the security of the verification image.
[0072] In one embodiment, determining the image object type corresponding to the image to be processed includes: detecting image objects contained in the image to be processed; if the image object is an animal, determining the corresponding image object type based on the species to which the image object belongs and / or the number of image objects belonging to different species in the image to be processed.
[0073] In this embodiment, after acquiring the image to be processed, the processing terminal can determine the type of image objects contained in the image, and thus determine the image object type of the image to be processed. The processing terminal can detect the image objects contained in the image to be processed. For example, if the image object is an animal, the processing terminal can determine the image object type corresponding to the image to be processed based on at least one of the following criteria: the species to which the image object belongs in the image, and the number of image objects belonging to different species in the image to be processed.
[0074] The terminal can determine different image object types based on the species and quantity of the species in the image to be processed. For example, in some embodiments, the image objects in the image to be processed can be animals. The terminal can then detect the species corresponding to the animals contained in the image to be processed. If the terminal detects that the number of species in the image to be processed is one, the terminal can determine the image object type as the first image object type corresponding to that species. If the terminal detects that the number of species in the image to be processed is greater than one, the terminal can further detect whether the various species in the image to be processed are the same species. If so, the terminal can determine the image object type as the first image object type corresponding to these same species; if not, the terminal can determine the image object type as the second image object type corresponding to the combination of species in the image to be processed. That is, when there are multiple animals in the image to be processed, and these animals are the same species, the terminal can determine the image object type in the image to be the same as the type of a single animal corresponding to that species in the image to be processed. When the multiple animals in the image to be processed are not the same species, the terminal can determine the second image object type corresponding to the combination of these species. The first image object type and the second image object type can be different.
[0075] Specifically, if the processing terminal detects a cat as an image object in an image to be processed, it can determine that the image object type of the image to be processed is the first type; if the processing terminal detects a dog as an image object in an image to be processed, it can determine that the image object type of the image to be processed is the second type; if the processing terminal detects two dogs as image objects in an image to be processed, it can determine that the image object type of the image to be processed is the second type, that is, when an image contains image objects of the same species, regardless of the number, it can be regarded as one image object type; if the processing terminal detects a cat and a dog as image objects in an image to be processed, it can determine that the image object type of the image to be processed is the third type, that is, when an image contains multiple image objects of different species, they can be determined as different types according to the combination of species. Here, the first, second, and third types all represent different image object types. It should be noted that the processing terminal can also identify other types of image objects, such as the type of object.
[0076] Through this embodiment, the processing terminal can detect the image object type of the image to be processed, thereby adding the same watermark to images of the same type, which improves the security of the verification image.
[0077] In one embodiment, such as Figure 3 As shown, Figure 3This is a flowchart illustrating a watermark generation method in another embodiment. It includes the following steps: The processing terminal acquires the original image to be protected as the image to be processed; the processing terminal performs wavelet decomposition on the image to be processed to obtain high-frequency and low-frequency image components. The processing terminal can embed a target watermark corresponding to the image object type of the image to be processed into the high-frequency information, such as at least one component of the high-frequency image components. Based on the high-frequency and low-frequency image components after adding the target watermark, the processing terminal performs inverse wavelet transform to obtain a restored target verification image carrying the target watermark. The processing terminal can also embed different watermarks into the images to be processed of different image object types in the entire dataset according to the image object type, forming a protected dataset. The processing terminal can also simulate the training process based on this protected training set to confirm that the model may overfit due to the presence of the watermark, causing training failure.
[0078] Through the above embodiments, the processing terminal transforms the original image from the spatial domain to the frequency domain using wavelet transform; it hides the watermark within the high-frequency wavelet information, which is easy to establish a shortcut for; it performs inverse wavelet transform to generate the protected image; and it adds the same watermark to images with the same label, ultimately protecting the entire dataset. Furthermore, the processing terminal can hide the watermark in difficult-to-detect high-frequency information and establish a learning shortcut to achieve a false training effect for the model, thereby protecting the dataset and improving the security of the verification images.
[0079] In one embodiment, such as Figure 4 As shown, a method for crawling responses is provided. This embodiment illustrates the application of this method to a processing terminal. It is understood that this method can also be applied to a server, and can also be applied to a system including a processing terminal and a server, and is implemented through the interaction between the processing terminal and the server, including the following steps:
[0080] Step S302: Obtain the verification data crawling request sent by the terminal; the verification data crawling request includes the terminal identifier of the terminal.
[0081] The terminal can be a device that wants to crawl verification images from a pre-defined banking transaction verification process. When the processing terminal detects a verification data crawling request, it can determine that a device wants to crawl the aforementioned verification images. At this point, the processing terminal needs to check whether the terminal allows the crawling. If the verification data crawling request includes the terminal's identifier, the processing terminal can check the terminal identifier to determine whether it is an authorized terminal.
[0082] Step S304: If there is no terminal identifier in the terminal identifier library, the target verification image is obtained and sent to the terminal so that the terminal can train the image recognition model based on the target verification image and obtain an image recognition model that overfits the target watermark in the target verification image; the terminal identifier library stores the terminal identifiers of multiple authorized terminals; wherein, the target verification image is generated based on the method described above.
[0083] The terminal identifier library can pre-store the terminal identifiers of multiple authorized terminals. The processing terminal can query the terminal identifier library based on the terminal identifiers of these terminals. If no terminal identifier is found in the terminal identifier library, the processing terminal can obtain the target verification image and send it as a dataset to the terminal. This allows the terminal to train a training image recognition model based on the target verification image, resulting in an image recognition model that is overfitted to the target watermark in the target verification image. The target verification image containing the target watermark can be generated based on the watermark generation method described above.
[0084] Specifically, such as Figure 5 As shown, Figure 5 This is a flowchart illustrating the training steps in one embodiment. If the terminal receives the target verification image carrying the target watermark, it can train on multiple target verification images. As the training cycle increases, the model will overfit to the watermark in high-frequency information, resulting in good performance in the training environment, but poor performance in the actual recognition process because the verification images in the actual test do not have watermarks. Figure 5 As shown, the terminal can train an overfitted network model on the target verification image. During the testing phase, because the verification image has no watermark, this overfitted network model incorrectly identifies objects in the image, for example... Figure 5 During the testing phase, the terminal's probability of identifying a dog as a cat was 0.55, and the probability of identifying a dog was 0.45, leading to recognition errors. This necessitates the protection of the verification image.
[0085] In the aforementioned crawling response method, when data crawling behavior is detected, the target verification image is sent to the crawling terminal, causing its model to overfit to the target watermark and preventing it from training on the banking business verification image. Compared to the traditional method of adding image watermarks through backdoors, this solution improves the security of verification images by adding the same watermark to images of the same image object type in the frequency domain image.
[0086] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0087] Based on the same inventive concept, this application also provides a watermark generation apparatus for implementing the watermark generation method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more watermark generation apparatus embodiments provided below can be found in the limitations of the watermark generation method described above, and will not be repeated here.
[0088] In one embodiment, such as Figure 6 As shown, a watermark generation device is provided, including: a transformation module 500, a determination module 502, an acquisition module 504, and a generation module 506, wherein:
[0089] The transformation module 500 is used to acquire the image to be processed and perform wavelet transform on the image to be processed to obtain the corresponding frequency domain image; the image to be processed is the verification image in the verification process of the user handling the preset banking business.
[0090] The determination module 502 is used to determine the image object type corresponding to the image to be processed; the image object type represents the type of object contained in the image to be processed.
[0091] The acquisition module 504 is used to acquire the high-frequency image components in the frequency domain image; the frequency domain image includes low-frequency image components and high-frequency image components.
[0092] The generation module 504 is used to obtain the target watermark corresponding to the image object type, add the target watermark to the high-frequency image component, and perform wavelet inverse transform on the frequency domain image after adding the target watermark to obtain the target verification image carrying the target watermark.
[0093] In one embodiment, the transformation module 500 is specifically used to perform wavelet transform on the image to be processed to obtain the corresponding low-frequency image components and high-frequency image components as a frequency domain image; the high-frequency image components include horizontal high-frequency image components, vertical high-frequency image components and diagonal high-frequency image components.
[0094] In one embodiment, the generation module 504 is specifically used to add the target watermark to at least one of the horizontal high-frequency image components, vertical high-frequency image components, and diagonal high-frequency image components in the high-frequency image components to obtain the high-frequency image components after adding the target watermark; based on the low-frequency image components and the high-frequency image components after adding the target watermark, obtain the frequency domain image after adding the target watermark; and perform an inverse wavelet transform on the frequency domain image after adding the target watermark to obtain the target verification image carrying the target watermark.
[0095] In one embodiment, the transformation module 500 is specifically used to acquire the original image of the verification process during the user's handling of a preset banking business; if the original image is a color image, the color image is decomposed into multiple color channels according to the RGB color space to obtain images with multiple color channels; the images with multiple color channels are determined as multiple images to be processed.
[0096] In one embodiment, the above apparatus further includes: an overlay module, configured to acquire, for each color channel, a sub-target verification image carrying the target watermark in that color channel; and to overlay the sub-target verification image samples of multiple color channels to obtain a target verification image.
[0097] In one embodiment, the determination module 502 is specifically used to detect image objects contained in the image to be processed; if the image object is an animal, the corresponding image object type is determined according to the species to which the image object belongs and / or the number of image objects belonging to different species in the image to be processed.
[0098] In one embodiment, the determining module 502 is specifically used to detect the species corresponding to the animals contained in the image to be processed; if the number of species in the image to be processed is one, determine the image object type as the first image object type corresponding to the species; if the number of species in the image to be processed is greater than one, detect whether the various species in the image to be processed are the same species; if yes, determine the image object type as the first image object type corresponding to the species; if no, determine the image object type as the second image object type corresponding to the combination of species in the image to be processed.
[0099] In one embodiment, such as Figure 7 As shown, a crawling response device is provided, including: a request module 600 and a response module 602, wherein:
[0100] The request module 600 is used to obtain the verification data crawling request sent by the terminal; the verification data crawling request includes the terminal identifier of the terminal.
[0101] The response module 602 is used to acquire the target verification image and send it to the terminal if the terminal identifier does not exist in the terminal identifier library, so that the terminal can train the image recognition model to be trained based on the target verification image and obtain the image recognition model that overfits the target watermark in the target verification image; the terminal identifier library stores the terminal identifiers of multiple authorized terminals; wherein, the target verification image is generated based on the above method.
[0102] Each module in the aforementioned watermark generation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0103] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 8 As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements a watermark generation method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink display screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device casing, or an external keyboard, touchpad, or mouse.
[0104] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0105] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the watermark generation method described above.
[0106] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the watermark generation method described above.
[0107] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the watermark generation method described above.
[0108] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0109] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0110] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0111] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for generating a watermark, characterized in that, The method includes: The image to be processed is acquired, and wavelet transform is performed on the image to be processed to obtain the corresponding frequency domain image; the image to be processed is the verification image in the verification process of the user handling the preset banking business. Obtain the high-frequency image component from the frequency domain image; the frequency domain image includes low-frequency image components and high-frequency image components; Determine the image object type corresponding to the image to be processed; the image object type represents the type of object contained in the image to be processed. Obtain the target watermark corresponding to the image object type, add the target watermark to the high-frequency image component, and perform inverse wavelet transform on the frequency domain image after adding the target watermark to obtain the target verification image carrying the target watermark; wherein, the same watermark is added to the images to be processed with the same image object type. The process of acquiring the image to be processed includes: Obtain the original images of the verification process during the user's handling of preset banking transactions; If the original image is a color image, the color image is decomposed into channels according to the RGB color space to obtain an image with multiple color channels; An image with multiple color channels is identified as multiple images to be processed; After adding the target watermark to the high-frequency image, the method further includes: For each color channel, obtain the sub-target verification image carrying the target watermark in that color channel; The sub-target verification image samples of the multiple color channels are superimposed to obtain the target verification image; Determining the image object type corresponding to the image to be processed includes: Detect image objects contained in the image to be processed; If the image object is an animal, detect the species corresponding to the animal contained in the image to be processed; If the number of species in the image to be processed is one, the image object type is determined to be the first image object type corresponding to the species; If the number of species in the image to be processed is greater than one, it is detected whether the species in the image to be processed are the same species; if yes, the image object type is determined to be the first image object type corresponding to the species; if no, the image object type is determined to be the second image object type corresponding to the combination of species in the image to be processed.
2. The method according to claim 1, characterized in that, The step of performing wavelet transform on the image to be processed to obtain the corresponding frequency domain image includes: The image to be processed is subjected to wavelet transform to obtain the corresponding low-frequency image components and high-frequency image components, which are used as frequency domain images; the high-frequency image components include horizontal high-frequency image components, vertical high-frequency image components and diagonal high-frequency image components.
3. The method according to claim 2, characterized in that, The process of adding the target watermark to the high-frequency image component, and performing an inverse wavelet transform on the frequency domain image after adding the target watermark to obtain a target verification image carrying the target watermark, includes: Add the target watermark to at least one of the horizontal high-frequency image components, vertical high-frequency image components, and diagonal high-frequency image components in the high-frequency image components to obtain the high-frequency image components after adding the target watermark. Based on the low-frequency image components and the high-frequency image components after adding the target watermark, a frequency domain image after adding the target watermark is obtained. Perform an inverse wavelet transform on the frequency domain image after adding the target watermark to obtain a target verification image carrying the target watermark.
4. A crawling response method, characterized in that, The method includes: Obtain the verification data crawling request sent by the terminal; the verification data crawling request includes the terminal identifier of the terminal; If the terminal identifier is not found in the terminal identifier library, the target verification image is obtained and sent to the terminal, so that the terminal can train the image recognition model based on the target verification image and obtain an image recognition model that overfits the target watermark in the target verification image; the terminal identifier library stores the terminal identifiers of multiple authorized terminals; The target verification image is generated based on the method described in any one of claims 1 to 3.
5. A watermark generation device, characterized in that, The device includes: The transformation module is used to acquire the image to be processed, perform wavelet transform on the image to be processed, and obtain the corresponding frequency domain image; the image to be processed is the verification image in the verification process of the user handling the preset banking business. A determining module is used to determine the image object type corresponding to the image to be processed; the image object type represents the type of object contained in the image to be processed. The acquisition module is used to acquire the high-frequency image components in the frequency domain image; the frequency domain image includes low-frequency image components and high-frequency image components; The generation module is used to obtain a target watermark corresponding to the image object type, add the target watermark to the high-frequency image component, and perform inverse wavelet transform on the frequency domain image after adding the target watermark to obtain a target verification image carrying the target watermark; wherein, the same watermark is added to the images to be processed with the same image object type. The transformation module is specifically used to acquire the original image of the verification process during the user's handling of a preset banking transaction; If the original image is a color image, the color image is decomposed into channels according to the RGB color space to obtain an image with multiple color channels; An image with multiple color channels is identified as multiple images to be processed; The overlay module is used to acquire, for each color channel, a sub-target verification image carrying the target watermark in that color channel; The sub-target verification image samples of the multiple color channels are superimposed to obtain the target verification image; The determining module is specifically used to detect image objects contained in the image to be processed; If the image object is an animal, detect the species corresponding to the animal contained in the image to be processed; If the number of species in the image to be processed is one, the image object type is determined to be the first image object type corresponding to the species; If the number of species in the image to be processed is greater than one, it is detected whether the species in the image to be processed are the same species; if yes, the image object type is determined to be the first image object type corresponding to the species; if no, the image object type is determined to be the second image object type corresponding to the combination of species in the image to be processed.
6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.
8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Invisible watermark image construction and classification methods, invisible watermark backdoor attack model construction and classification methods and system
CN113034332A
DWT-based digital watermarking method and system, electronic equipment and storage medium
CN114493969A