Watermark extraction method and device, computer equipment and storage medium
Through the dual-stage geometric attack resistance method and neural network technology, the digital watermark is extracted and processed, which solves the problem of low reliability in practical applications of traditional watermark technology, and realizes effective resistance to screen shooting attacks and accurate extraction of watermark information.
Patent Information
- Application Number
- CN202411413976.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-02-25
AI Technical Summary
Traditional digital watermarking technology is less reliable in practical applications, especially when facing screen shooting attacks.
The two-stage geometric attack resistance method is used to perform geometric deformation processing on the extracted document image, and the watermark signal enhancement network and the watermark signal extraction network are used to perform signal enhancement and watermark extraction processing.
It improves the robustness of the watermark extraction process, can accurately extract embedded watermark information when the image is severely disturbed, and enhances its resistance to attacks such as screen shooting.
Smart Images

Figure CN119516562A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of image digital watermark processing, and in particular to a watermark extraction method, device, computer equipment and storage medium. Background Art
[0002] The image processing process designed for screen shooting attacks includes digital-to-analog conversion, filtering, geometric transformation, illumination changes, etc. The process is complex and traditional digital watermarking technology is difficult to resist.
[0003] However, existing deep learning-based digital watermarking technology usually requires a computationally intensive embedding process and is not suitable for protecting large-scale PDF documents. Therefore, its reliability in practical applications is low. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a watermark extraction method, apparatus, computer equipment and storage medium to solve the problem of low reliability of traditional watermark extraction technology in practical applications.
[0005] In order to solve the above technical problems, the present application embodiment provides a watermark extraction method, which adopts the following technical solution:
[0006] Receiving a watermark extraction request sent by a user terminal and carrying a document image to be extracted;
[0007] Performing geometric deformation processing on the document image to be extracted according to a two-stage geometric attack defense method to obtain a geometrically deformed image;
[0008] Performing signal enhancement processing on the geometrically deformed image according to a watermark signal enhancement network to obtain a signal enhanced image;
[0009] Performing watermark extraction processing on the signal enhanced image according to a watermark signal extraction network to obtain target watermark data;
[0010] The target watermark data is output to the user terminal.
[0011] Furthermore, the step of performing geometric deformation processing on the document image to be extracted according to the two-stage geometric attack defense method to obtain a geometrically deformed image specifically includes the following steps:
[0012] Identify the PDF document area to be extracted from the document image according to the pre-trained image segmentation algorithm to obtain a quadrilateral mask;
[0013] Calculating a perspective transformation matrix of the quadrilateral mask;
[0014] A geometric transformation operation is performed on the document image to be extracted according to the inverse matrix of the perspective transformation matrix to obtain the geometrically deformed image.
[0015] Furthermore, the step of performing geometric deformation processing on the document image to be extracted according to the two-stage geometric attack defense method to obtain a geometrically deformed image specifically includes the following steps:
[0016] A geometric perturbation simulation operation is performed on the perturbation layer of the document image to be extracted to obtain the geometrically deformed image, wherein the geometric perturbation simulation operation includes a perspective distortion operation, a TPS distortion operation, and a color transformation operation.
[0017] Furthermore, the watermark signal enhancement network is based on the enhancement loss function L Enh To train:
[0018] L Enh =L(Enh(X),M)
[0019] Among them, L(,) represents a distance measurement paradigm, and L1 or L2 distance can be selected. M represents an image containing only the watermark signal, which is generated by M=Enc(1,m), where 1 is an image of the same size as X but with all pixel values as 255.
[0020] Furthermore, the watermark signal extraction network extracts the loss function L Dec To train:
[0021] L Dec =L′(Dec(X′),m)
[0022] Among them, L′(,) represents a distance measurement paradigm, and L1, L2, and cross entropy distance can be selected.
[0023] Furthermore, after the step of geometrically deforming the document image to be extracted according to the two-stage geometric attack defense method to obtain a geometrically deformed image, the following steps are also included:
[0024] Performing image segmentation processing on the geometrically deformed image to obtain a geometrically segmented image;
[0025] The step of performing signal enhancement processing on the geometrically deformed image according to the watermark signal enhancement network to obtain a signal enhanced image specifically comprises the following steps:
[0026] The geometric segmentation image is subjected to signal enhancement processing according to a watermark signal enhancement network to obtain a signal enhanced image.
[0027] In order to solve the above technical problems, the embodiment of the present application further provides a watermark extraction device, which adopts the following technical solution:
[0028] A request acquisition module, used for receiving a watermark extraction request sent by a user terminal and carrying a document image to be extracted;
[0029] A geometric deformation module, used for performing geometric deformation processing on the document image to be extracted according to a two-stage geometric attack defense method to obtain a geometrically deformed image;
[0030] A signal enhancement module, used for performing signal enhancement processing on the geometrically deformed image according to a watermark signal enhancement network to obtain a signal enhanced image;
[0031] A watermark extraction module, used to perform watermark extraction processing on the signal enhanced image according to a watermark signal extraction network to obtain target watermark data;
[0032] An output module is used to output the target watermark data to the user terminal.
[0033] Furthermore, the geometric deformation module includes:
[0034] The document region identification submodule is used to identify the PDF document region to be extracted according to the pre-trained image segmentation algorithm to obtain a quadrilateral mask;
[0035] A transformation matrix calculation submodule, used to calculate the perspective transformation matrix of the quadrilateral mask;
[0036] The geometric transformation submodule is used to perform a geometric transformation operation on the document image to be extracted according to the inverse matrix of the perspective transformation matrix to obtain the geometrically deformed image.
[0037] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0038] The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the watermark extraction method as described above when executing the computer-readable instructions.
[0039] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0040] The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps of the watermark extraction method described above are implemented.
[0041] The present application provides a watermark extraction method, including: receiving a watermark extraction request carrying a document image to be extracted from a user terminal; performing geometric deformation processing on the document image to be extracted according to a two-stage geometric attack resistance method to obtain a geometric deformation image; performing signal enhancement processing on the geometric deformation image according to a watermark signal enhancement network to obtain a signal enhanced image; performing watermark extraction processing on the signal enhanced image according to a watermark signal extraction network to obtain target watermark data; and outputting the target watermark data to the user terminal. Compared with the prior art, the present application adopts a two-stage geometric attack resistance method, which can accurately identify and correct the position and shape of the PDF document in the captured image, ensuring that the input image in the watermark extraction process meets the expected size and geometry; a watermark extraction system based on a neural network is designed, which improves the robustness to various attacks (such as screen shooting) by simulating various imaging disturbances (such as perspective distortion, defocus blur, color transformation, noise processing and JPEG compression). Even when the image is severely disturbed, the embedded watermark information can still be accurately extracted. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0043] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0044] Figure 2 It is a flow chart of the implementation of the watermark extraction method provided in the embodiment of the present application;
[0045] Figure 3 It is a schematic diagram of the structure of the watermark signal enhancement network and the watermark convolutional neural network provided in the embodiment of the present application;
[0046] Figure 4 It is a structural schematic diagram of a watermark extraction device provided in an embodiment of the present application;
[0047] Figure 5 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION
[0048] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0049] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0050] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0051] like Figure 1 As shown, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The terminal device 101 may be a laptop 1011, a tablet computer 1012 or a mobile phone 1013. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0052] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0053] The terminal device 101 can be any electronic device with a display screen and supporting web browsing. In addition to the laptop computer 1011, tablet computer 1012 or mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV), a laptop computer, a desktop computer, etc.
[0054] The server 103 may be a server that provides various services, such as a background server that provides support for a web page displayed on the terminal device 101 .
[0055] It should be noted that the watermark extraction method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the watermark extraction device is generally arranged in the server / terminal device.
[0056] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0057] Continue to refer Figure 2 , shows a flow chart of an embodiment of a watermark extraction method according to the present application. The watermark extraction method comprises: step S201, step S202, step S203, step S204 and step S205.
[0058] In step S201, a watermark extraction request carrying a document image to be extracted is received from a user terminal.
[0059] In the embodiments of the present application, the user terminal refers to a terminal device used to execute the image processing method for preventing document abuse provided by the present application. The user terminal can be a mobile terminal such as a mobile phone, a smart phone, a laptop computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a navigation device, etc., as well as a fixed terminal such as a digital TV, a desktop computer, etc. It should be understood that the examples of user terminals here are only for the convenience of understanding and are not used to limit the present application.
[0060] In the embodiment of the present application, the PDF document image to be extracted can be obtained after imaging disturbance such as screen shooting.
[0061] In step S202, the document image to be extracted is subjected to geometric deformation processing according to the two-stage geometric attack defense method to obtain a geometrically deformed image.
[0062] In the embodiment of the present application, the geometric deformation processing is mainly used to decompose the complex geometric attack introduced by screen shooting into large-scale global geometric deformation and small-scale local geometric deformation.
[0063] In step S203, signal enhancement processing is performed on the geometrically deformed image according to the watermark signal enhancement network to obtain a signal enhanced image.
[0064] In the embodiment of the present application, the watermark signal enhancement network X′=Enh(X) suppresses the original text and image signals in the PDF document and amplifies the watermark signal. It is composed of a series of convolutional networks. The structure of a watermark signal enhancement network is shown in the attached Figure 3 The optimization goal of the watermark signal enhancement network is to make the output of the network contain only the watermark signal. It is trained using the following loss function:
[0065] L Enh =L(Enh(X),M)
[0066] Among them, L(,) represents a distance measurement paradigm, and L1 or L2 distance can be selected. M represents an image containing only the watermark signal, which is generated by M=Enc(1,m), where 1 is an image of the same size as X but with all pixel values as 255.
[0067] In step S204, watermark extraction processing is performed on the signal enhanced image according to the watermark signal extraction network to obtain target watermark data.
[0068] In the embodiment of the present application, the printing data extraction network It consists of a series of convolutional layers and dense layers, and finally outputs the extracted secret message A watermark convolutional neural network structure design is shown in the attached Figure 3 The optimization goal of the watermark data extraction network is to make the watermark data output by the network the same as the original embedded watermark data. It is trained using the following loss function:
[0069] L Dec =L′(Dec(X′),m)
[0070] Among them, L′(,) represents a distance measurement paradigm, and L1, L2, and cross entropy distance can be selected.
[0071] In step S205, the target watermark data is output to the user terminal.
[0072] In an embodiment of the present application, a watermark extraction method is provided, including: receiving a watermark extraction request carrying a document image to be extracted from a user terminal; performing geometric deformation processing on the document image to be extracted according to a two-stage geometric attack resistance method to obtain a geometric deformed image; performing signal enhancement processing on the geometric deformed image according to a watermark signal enhancement network to obtain a signal enhanced image; performing watermark extraction processing on the signal enhanced image according to a watermark signal extraction network to obtain target watermark data; and outputting the target watermark data to the user terminal. Compared with the prior art, the present application adopts a two-stage geometric attack resistance method, which can accurately identify and correct the position and shape of the PDF document in the captured image, ensuring that the input image in the watermark extraction process meets the expected size and geometry; a watermark extraction system based on a neural network is designed, which improves the robustness to various attacks (such as screen shooting) by simulating various imaging disturbances (such as perspective distortion, defocus blur, color transformation, noise processing and JPEG compression). Even when the image is severely disturbed, the embedded watermark information can still be accurately extracted.
[0073] In some optional implementations of the embodiments of the present application, the step of performing geometric deformation processing on the document image to be extracted according to the two-stage geometric attack defense method to obtain a geometrically deformed image specifically includes the following steps:
[0074] Identify the PDF document area to be extracted from the document image according to the pre-trained image segmentation algorithm and obtain a quadrilateral mask;
[0075] Calculate the perspective transformation matrix of the quadrilateral mask;
[0076] The document image to be extracted is subjected to geometric transformation operation according to the inverse matrix of the perspective transformation matrix to obtain a geometrically deformed image.
[0077] In the embodiment of the present application, a PDF document is used for large-scale global geometric deformation.
[0078] Correction is done by area inspection and geometry correction, specifically:
[0079] 1) Region detection: Use the pre-trained image segmentation algorithm to identify and detect the PDF document area in the captured image and obtain the quadrilateral mask of the PDF document area.
[0080] 2) Deformation estimation: Fit the bounding box corresponding to the quadrilateral mask with four straight lines, calculate the homography using the four intersection points of the four straight lines, and estimate the perspective transformation matrix.
[0081] 3) Geometric correction: Use the inverse matrix of the estimated perspective transformation matrix to quasi-geometrically transform the document area back to a rectangle of the original document size.
[0082] In some optional implementations of the embodiments of the present application, the step of performing geometric deformation processing on the document image to be extracted according to the two-stage geometric attack defense method to obtain a geometrically deformed image specifically includes the following steps:
[0083] A geometric perturbation simulation operation is performed on the perturbation layer of the document image to be extracted to obtain a geometrically deformed image, wherein the geometric perturbation simulation operation includes a perspective distortion operation, a TPS distortion operation, and a color transformation operation.
[0084] In the embodiment of the present application, a disturbance layer is used to enhance the robustness of the watermark extraction network to small local geometric deformations. Specifically:
[0085] A method for enhancing the robustness of small local geometric deformations based on perturbation layers. It adds multiple geometric perturbation simulations based on general perturbation layers (such as JPEG compression, defocus blur, noise processing, etc.). It includes the following categories:
[0086] 1) Perspective distortion
[0087] A random homography is generated to simulate the effect of the camera not being precisely pointed at the coded image marker. To sample the homography, the positions of the four corners of the marker are uniformly randomly perturbed within a fixed range (up to ±20 pixels, or ±10%), and then the homography that maps the original corners to the new positions is solved. The original image is bilinearly sampled to create a perspective-warped image.
[0088] 2) TPS distortion
[0089] To simulate local geometric perturbations of complex parameters, we divide the image into patches and perform a random Thin-Plate-Spline (TPS) transformation on each patch, with the number of control points randomly selected in the range.
[0090] 3) Color change
[0091] Approximate the perturbations captured by the camera using a series of random affine color transformations (constant for the entire image). Hue shift: add a random color shift to each RGB channel uniformly sampled from [-0.1, 0.1], desaturate: randomly linearly interpolate between the full RGB image and its grayscale equivalent, adjust brightness and contrast: rescale the affine histogram of mx+b with m~U[0.5, 1.5] and b~U[-0.3, 0].
[0092] In some optional implementations of the embodiments of the present application, the perturbation layer of the above-mentioned geometric perturbation simulation can add other attack simulations, such as JPEG compression, noise processing, etc., to further enhance the robustness against various attacks.
[0093] In some optional implementations of the embodiments of the present application, after the step of performing geometric deformation processing on the document image to be extracted according to the two-stage geometric attack defense method to obtain a geometrically deformed image, the following steps are also included:
[0094] Performing image segmentation processing on the geometrically deformed image to obtain a geometrically segmented image;
[0095] The step of performing signal enhancement processing on the geometrically deformed image according to the watermark signal enhancement network to obtain a signal enhanced image specifically includes the following steps:
[0096] The signal enhancement processing is performed on the geometric segmentation image according to the watermark signal enhancement network to obtain a signal enhanced image.
[0097] In the embodiment of the present application, in order to reduce the pressure of network training, the solution divides the PDF document image into small images, and extracts the watermark for each small image in turn.
[0098] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0099] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0100] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0101] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0102] Further references Figure 4 , as a response to the above Figure 2 The present application provides an embodiment of a watermark extraction device, and the device embodiment is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0103] like Figure 4 As shown, the watermark extraction device 200 of the embodiment of the present application includes:
[0104] The request acquisition module 210 is used to receive a watermark extraction request sent by a user terminal and carrying a document image to be extracted;
[0105] A geometric deformation module 220, configured to perform geometric deformation processing on the document image to be extracted according to the two-stage geometric attack defense method to obtain a geometrically deformed image;
[0106] The signal enhancement module 230 is used to perform signal enhancement processing on the geometric deformation image according to the watermark signal enhancement network to obtain a signal enhanced image;
[0107] The watermark extraction module 240 is used to perform watermark extraction processing on the signal enhanced image according to the watermark signal extraction network to obtain target watermark data;
[0108] The output module 250 is used to output the target watermark data to the user terminal.
[0109] In an embodiment of the present application, a watermark extraction device 200 is provided, comprising: a request acquisition module 210, for receiving a watermark extraction request carrying a document image to be extracted sent by a user terminal; a geometric deformation module 220, for performing geometric deformation processing on the document image to be extracted according to a two-stage geometric attack resistance method to obtain a geometric deformed image; a signal enhancement module 230, for performing signal enhancement processing on the geometric deformed image according to a watermark signal enhancement network to obtain a signal enhanced image; a watermark extraction module 240, for performing watermark extraction processing on the signal enhanced image according to a watermark signal extraction network to obtain target watermark data; and an output module 250, for outputting the target watermark data to the user terminal. Compared with the prior art, the present application adopts a two-stage geometric attack resistance method, which can accurately identify and correct the position and shape of the PDF document in the captured image, ensuring that the input image in the watermark extraction process meets the expected size and geometric shape; a watermark extraction system based on a neural network is designed, which improves the robustness to various attacks (such as screen shooting) by simulating various imaging disturbances (such as perspective distortion, defocus blur, color transformation, noise processing and JPEG compression). This ensures that the embedded watermark information can be accurately extracted even when the image is severely disturbed.
[0110] In some optional implementations of the embodiments of the present application, the geometric deformation module includes:
[0111] The document region recognition submodule is used to identify the PDF document region of the document image to be extracted according to the pre-trained image segmentation algorithm and obtain a quadrilateral mask;
[0112] The transformation matrix calculation submodule is used to calculate the perspective transformation matrix of the quadrilateral mask;
[0113] The geometric transformation submodule is used to perform geometric transformation operations on the document image to be extracted according to the inverse matrix of the perspective transformation matrix to obtain a geometrically deformed image.
[0114] To solve the above technical problems, the present application also provides a computer device. Figure 5 , Figure 5 This is a basic structural block diagram of a computer device according to an embodiment of the present application.
[0115] The computer device 300 includes a memory 310, a processor 320, and a network interface 330 that are interconnected and communicated through a system bus. It should be noted that the figure only shows a computer device 300 having components 310-330, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.
[0116] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0117] The memory 310 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 310 can be an internal storage unit of the computer device 300, such as a hard disk or memory of the computer device 300. In other embodiments, the memory 310 can also be an external storage device of the computer device 300, such as a plug-in hard disk equipped on the computer device 300, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card, etc. Of course, the memory 310 can also include both the internal storage unit of the computer device 300 and its external storage device. In the embodiment of the present application, the memory 310 is generally used to store the operating system and various application software installed on the computer device 300, such as computer-readable instructions of the watermark extraction method, etc. In addition, the memory 310 can also be used to temporarily store various data that have been output or will be output.
[0118] The processor 320 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 320 is generally used to control the overall operation of the computer device 300. In the embodiment of the present application, the processor 320 is used to run the computer-readable instructions stored in the memory 310 or process data, such as computer-readable instructions for running the watermark extraction method.
[0119] The network interface 330 may include a wireless network interface or a wired network interface. The network interface 330 is generally used to establish a communication connection between the computer device 300 and other electronic devices.
[0120] The computer device provided by this application adopts a two-stage geometric attack defense method, which can accurately identify and correct the position and shape of the PDF document in the captured image, ensuring that the input image in the watermark extraction process meets the expected size and geometry; a neural network-based watermark extraction system is designed, which improves the robustness against various attacks (such as screen shooting) by simulating various imaging disturbances (such as perspective distortion, defocus blur, color transformation, noise processing and JPEG compression). Even when the image is severely disturbed, the embedded watermark information can still be accurately extracted.
[0121] The present application also provides another implementation, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the watermark extraction method as described above.
[0122] The computer-readable storage medium provided by the present application adopts a two-stage geometric attack defense method, which can accurately identify and correct the position and shape of the PDF document in the captured image, ensuring that the input image in the watermark extraction process meets the expected size and geometric shape; a neural network-based watermark extraction system is designed, which improves the robustness against various attacks (such as screen shooting) by simulating various imaging disturbances (such as perspective distortion, defocus blur, color transformation, noise processing and JPEG compression). Even when the image is severely disturbed, the embedded watermark information can still be accurately extracted.
[0123] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0124] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
Claims
1. A watermark extraction method, characterized in that: The steps include: Receiving a watermark extraction request sent by a user terminal and carrying a document image to be extracted; Performing geometric deformation processing on the document image to be extracted according to a two-stage geometric attack defense method to obtain a geometrically deformed image; Performing signal enhancement processing on the geometrically deformed image according to a watermark signal enhancement network to obtain a signal enhanced image; Performing watermark extraction processing on the signal enhanced image according to a watermark signal extraction network to obtain target watermark data; The target watermark data is output to the user terminal.
2. The watermark extraction method according to claim 1, characterized in that: The step of performing geometric deformation processing on the document image to be extracted according to the two-stage geometric attack defense method to obtain a geometrically deformed image specifically includes the following steps: Identify the PDF document area to be extracted from the document image according to the pre-trained image segmentation algorithm to obtain a quadrilateral mask; Calculating a perspective transformation matrix of the quadrilateral mask; A geometric transformation operation is performed on the document image to be extracted according to the inverse matrix of the perspective transformation matrix to obtain the geometrically deformed image.
3. The watermark extraction method according to claim 1, characterized in that: The step of performing geometric deformation processing on the document image to be extracted according to the two-stage geometric attack defense method to obtain a geometrically deformed image specifically includes the following steps: A geometric perturbation simulation operation is performed on the perturbation layer of the document image to be extracted to obtain the geometrically deformed image, wherein the geometric perturbation simulation operation includes a perspective distortion operation, a TPS distortion operation, and a color transformation operation.
4. The watermark extraction method according to claim 1, characterized in that: The watermark signal enhancement network is based on the enhancement loss function L Enh To train: L Enh =L(Enh(X),M) Among them, L(,) represents a distance measurement paradigm, and L1 or L2 distance can be selected. M represents an image containing only the watermark signal, which is generated by M=Enc(1,m), where 1 is an image of the same size as X but with all pixel values as 255.
5. The watermark extraction method according to claim 1, characterized in that: The watermark signal extraction network extracts the loss function L Dec To train: L Dec =L ′ (Dec(X′),m) Among them, L ′ (,) represents a distance measurement paradigm, and L1, L2, and cross entropy distance can be selected.
6. The watermark extraction method according to claim 1, characterized in that: After the step of geometrically deforming the document image to be extracted according to the two-stage geometric attack defense method to obtain a geometrically deformed image, the following steps are also included: Performing image segmentation processing on the geometrically deformed image to obtain a geometrically segmented image; The step of performing signal enhancement processing on the geometrically deformed image according to the watermark signal enhancement network to obtain a signal enhanced image specifically comprises the following steps: The geometric segmentation image is subjected to signal enhancement processing according to a watermark signal enhancement network to obtain a signal enhanced image.
7. A watermark extraction device, characterized in that: include: A request acquisition module, used for receiving a watermark extraction request sent by a user terminal and carrying a document image to be extracted; A geometric deformation module, used for performing geometric deformation processing on the document image to be extracted according to a two-stage geometric attack defense method to obtain a geometrically deformed image; A signal enhancement module, used for performing signal enhancement processing on the geometrically deformed image according to a watermark signal enhancement network to obtain a signal enhanced image; A watermark extraction module, used to perform watermark extraction processing on the signal enhanced image according to a watermark signal extraction network to obtain target watermark data; An output module is used to output the target watermark data to the user terminal.
8. The watermark extraction device according to claim 7, characterized in that: The geometric deformation module includes: The document region identification submodule is used to identify the PDF document region to be extracted according to the pre-trained image segmentation algorithm to obtain a quadrilateral mask; A transformation matrix calculation submodule, used to calculate the perspective transformation matrix of the quadrilateral mask; The geometric transformation submodule is used to perform a geometric transformation operation on the document image to be extracted according to the inverse matrix of the perspective transformation matrix to obtain the geometrically deformed image.
9. A computer device comprising a memory and a processor, characterized in that: The memory stores computer-readable instructions, and the processor implements the steps of the watermark extraction method according to any one of claims 1 to 6 when executing the computer-readable instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the watermark extraction method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Image digital copyright protection method and system based on frequency domain feature arrangement
CN112579985A
Text watermark image preprocessing method and device
CN115063279A
Multi-size image robust watermarking method and system based on attention mechanism
CN115809953A
Watermark processing model training method, watermark processing method, device and equipment
CN117934254A
Watermark detector, method therefor and memory medium
JP2006303935A