Method and device for quickly identifying video watermarks

Through the training and preprocessing technology of the video watermark recognition model, the problem of long video watermark recognition time in the existing technology is solved, and a method of quickly identifying video watermarks is realized. The running speed is fast and the recognition of video watermarks can be quickly completed.

CN114463155BActive Publication Date: 2024-10-29GUANGZHOU JIANHE NETWORK TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210002944.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-04
Publication Date
2024-10-29
Estimated Expiration
2042-01-04

AI Technical Summary

Technical Problem

The existing video watermark recognition technology in the market takes a long time to identify video watermarks and cannot quickly identify video watermarks.

Method used

Through the training and preprocessing technology of the video watermark recognition model, including using the coco data set for model training, image screenshots, flipping, scaling, and color gamut changing operations, and using adaptive anchor frame calculations and deep model neural networks for feature extraction and Recognition, combined with black edge filling and normalization processing, quickly identifies video watermarks.

Benefits of technology

A method of quickly identifying video watermarks has been implemented. It runs quickly, can quickly complete the identification of video watermarks, and reduces the identification time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114463155B_ABST
    Figure CN114463155B_ABST
Patent Text Reader

Abstract

The present invention relates to a method for quickly identifying video watermarks, comprising the following steps: training a video watermark recognition model to obtain a video watermark recognition model; obtaining a target video, taking a screenshot of the target video to obtain a target image as a first image; preprocessing the first image to obtain a second image; inputting the second image into the video watermark recognition model, and outputting the recognized watermark. The present invention pre-establishes a video watermark recognition model, and pre-processes the input image to speed up the recognition speed, and finally completes the recognition of the video watermark. The method used in the present invention has a fast running speed and can quickly recognize the video watermark.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a method and a device for quickly identifying a video watermark. Background Art

[0002] The so-called digital watermark is to add certain digital information to data multimedia (such as images, sounds, video signals, etc.) to achieve functions such as file authenticity identification and copyright protection. The embedded watermark information is hidden in the host file and does not affect the visibility and integrity of the original file.

[0003] The digital watermarking process is to embed certain information that can prove copyright ownership or track infringement into the protected digital object (such as still images, videos, audio, etc.). It can be the author's serial number, company logo, meaningful text, etc.

[0004] After a video watermark is applied, it is often necessary to perform intelligent recognition on it later. The video watermark recognition technology on the current market often takes a long time to recognize and cannot quickly recognize the video watermark. Summary of the invention

[0005] The purpose of the present invention is to solve at least one of the deficiencies of the prior art and to provide a method and device for quickly identifying video watermarks.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions:

[0007] Specifically, a method for quickly identifying video watermarks is proposed, including the following:

[0008] Training a video watermark recognition model to obtain a video watermark recognition model;

[0009] Obtain a target video, and take a screenshot of the target video to obtain a target image as the first image;

[0010] Preprocessing the first picture to obtain a second picture;

[0011] The second image is input into the video watermark recognition model, and the recognized watermark is output.

[0012] Further, specifically, the training of the video watermark recognition model includes the following:

[0013] In the model training stage, the coco dataset is used as the basic data training set.

[0014] Randomly read four pictures from the coco dataset each time;

[0015] Perform flip, zoom, and color gamut changes on the four images respectively;

[0016] After the operation is completed, place the obtained pictures in four directions: the first picture is placed on the upper left, the second picture is placed on the lower left, the third picture is placed on the lower right, and the fourth picture is placed on the upper right;

[0017] Use the matrix method to capture the fixed areas of the four pictures, and then splice them together to form a new picture;

[0018] Through adaptive anchor frame calculation, the training network outputs a predicted frame based on the initial anchor frame, calculates the intersection of the predicted frame and the real frame, calculates the difference between the two, and then reversely updates and iterates the network parameters to obtain the final watermark real frame coordinates.

[0019] Further, specifically, the preprocessing operation includes the following:

[0020] For the first picture, assuming that the length and width of the first picture are l and w, normalization processing is performed to uniformly scale the picture to be detected to a standard size of l1*w1 for prediction;

[0021] When scaling, the length and width of the scaled image are divided by the length and width of the original image to obtain two scaling factors, namely l / l1 and w / w1, and the smaller scaling factor of the two scaling factors is selected as the final scaling factor;

[0022] Multiply the length and width of the original image by the final scaling factor to get the length and width after scaling, which are l*min[l / l1, w / w1] and w*min[l / l1, w / w1] respectively;

[0023] Calculate the actual height h that needs to be filled.

[0024] h=|l*min[l / l1,w / w1]-w*min[l / l1,w / w1|,

[0025] By calling np.mod in numpy to take the remainder, h is processed to obtain a first pixel value, and half of the first pixel value is used as the value to be filled at both ends of the image height.

[0026] Further, specifically, the structure of the video watermark recognition model includes the following:

[0027] The structure of the watermark deep model neural network takes the original 608*608*3 image as input into the Focus structure, uses a slicing operation, first converts it into a 304*304*12 feature map, and then undergoes a convolution operation with 32 convolution kernels, and finally becomes a 304*304*32 feature map. The backbone network for extracting and identifying image features is transformed from multiple single cores to multiple single cores connected with different small cores to reduce the dimension of image features.

[0028] Further, specifically, the target image obtained by taking a screenshot of the target video includes the following:

[0029] The target video is extracted before, during and after extraction to obtain 5 pictures of different time frames as target pictures, and the specification of the target picture is 720×1280.

[0030] The present invention also provides a device for quickly identifying video watermarks, comprising:

[0031] A video watermark model building module is used to train a video watermark recognition model to obtain a video watermark recognition model;

[0032] Obtain a target video, and take a screenshot of the target video to obtain a target image as the first image;

[0033] A preprocessing module, used for preprocessing the first image to obtain a second image;

[0034] The watermark recognition module is used to input the second image into the video watermark recognition model and output the recognized watermark.

[0035] Further, specifically, the preprocessing module includes:

[0036] A normalization module is used to perform normalization processing on the first image and uniformly scale the image to be detected to a standard size of 416*416 for prediction;

[0037] The black edge filling module is used to fill the black edge of the first image after normalization processing to obtain a second image.

[0038] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for quickly identifying a video watermark as described in any one of the above items are implemented.

[0039] The beneficial effects of the present invention are:

[0040] The present invention proposes a method for quickly identifying video watermarks. By pre-establishing a video watermark recognition model and pre-processing an input image to speed up the recognition speed, the recognition of the video watermark is finally completed. The method adopted by the present invention has a fast running speed and can quickly recognize the video watermark. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The above and other features of the present disclosure will become more apparent by describing in detail the embodiments shown in the accompanying drawings. The same reference numerals in the accompanying drawings of the present disclosure represent the same or similar elements. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure. For those skilled in the art, other accompanying drawings can be obtained based on these accompanying drawings without creative work. In the accompanying drawings:

[0042] Figure 1 Shown is a flow chart of a method for quickly identifying video watermarks according to the present invention;

[0043] Figure 2 The first working principle diagram of the first embodiment of the method for quickly identifying video watermarks of the present invention is shown;

[0044] Figure 3 The figure shows a second working principle diagram of the first embodiment of the method for quickly identifying video watermarks of the present invention;

[0045] Figure 4 It is a third working principle diagram of the first embodiment of the method for quickly identifying video watermarks of the present invention. DETAILED DESCRIPTION

[0046] The following will be combined with the embodiments and drawings to clearly and completely describe the concept, specific structure and technical effects of the present invention, so as to fully understand the purpose, scheme and effect of the present invention. It should be noted that the embodiments in this application and the features in the embodiments can be combined with each other without conflict. The same reference numerals used throughout the drawings indicate the same or similar parts.

[0047] Reference Figure 1 , Embodiment 1, the present invention proposes a method for quickly identifying a video watermark, comprising the following:

[0048] Step 110: training a video watermark recognition model to obtain a video watermark recognition model;

[0049] Step 120: Obtain a target video, and take a screenshot of the target video to obtain a target image as the first image;

[0050] Step 130: preprocess the first image to obtain a second image;

[0051] Step 140: input the second image into the video watermark recognition model, and output the recognized watermark.

[0052] Specifically, when this embodiment is implemented, the average size of each short video is also 3M, and five pictures (720x1280) of different time frames are extracted from the front, middle and back of each video for analysis, and daily video articles account for 20% of the total daily articles.

[0053] There are 100,000 articles every day, of which video articles account for about 20,000. It takes about 20,000 × 5 pictures = 100,000 pictures to be analyzed. Each video recognizes pictures in an average of 0.05 seconds per picture.

[0054] 100000×0.05 seconds=5000 seconds=1.3 hours are enough to complete the watermark recognition.

[0055] As a preferred embodiment of the present invention, specifically, the training of the video watermark recognition model includes the following:

[0056] In the model training stage, the coco dataset is used as the basic data training set.

[0057] Randomly read four pictures from the coco dataset each time;

[0058] Perform flip, zoom, and color gamut changes on the four images respectively;

[0059] After the operation is completed, place the obtained pictures in four directions: the first picture is placed on the upper left, the second picture is placed on the lower left, the third picture is placed on the lower right, and the fourth picture is placed on the upper right;

[0060] Use the matrix method to capture the fixed areas of the four pictures, and then splice them together to form a new picture;

[0061] After completing the arrangement of the four pictures, we use the matrix method to cut out the fixed areas of the four pictures, and then splice them together to form a new picture, which contains a series of contents such as frames.

[0062] As shown in the figure above, we can see that there are obvious edges when we stitch the four pictures together. The horizontal and vertical lines are the dividing lines. This dividing line is pre-set by us. In the code, min_offset_x and min_offset_y are used to select the dividing line.

[0063] After stitching, we get a new picture. We can see that the picture in the upper left corner of the stitched picture is less than the original picture, because it is covered by the picture on its right during stitching. It is also very likely that the frame of another picture will be covered during stitching. These problems will be dealt with in the final frame processing: when the frame of the picture (or the picture itself) exceeds the edge between the two pictures (that is, the dividing line we set), we need to process the part of the frame or the part of the picture that exceeds the dividing line) and perform edge processing.

[0064] Through adaptive anchor frame calculation, the training network outputs a predicted frame based on the initial anchor frame, calculates the intersection of the predicted frame and the real frame, calculates the difference between the two, and then reversely updates and iterates the network parameters to obtain the final watermark real frame coordinates.

[0065] In this preferred implementation, i.e., the first embodiment, specifically, the adaptive anchor frame calculation includes the following:

[0066] Predefined bounding boxes are a set of preset bounding boxes. During training, labels are constructed based on the offset of the actual bounding box position relative to the preset bounding box to train samples. This is equivalent to first "framing" the target roughly at the possible position with the preset bounding box, and then making adjustments based on these preset bounding boxes.

[0067] An Anchor Box can be defined by: the aspect ratio of the border and the area (scale) of the border, which is equivalent to a series of preset border generation rules. According to the Anchor Box, a series of borders can be generated at any position in the image. Our preset Anchor box uses the point of the Feature Map extracted by the model as the center position to generate the border, so an Anchor box does not need to specify the center position. We define three sets of aspect ratios ratio = [0.5, 1, 2] and three scales scale = [8, 16, 32], which can be combined into 9 different shapes and sizes of borders. In other words, ratio defines the aspect ratio, and scale is the area of ​​the border.

[0068] The generation of the Anchor Box is centered on the point on the Feature Map generated by the neural network (the coordinates mapped back to the original image). The neural network downsamples the input image by 16 times, that is, a point on the Feature Map corresponds to a 16×16 square area (receptive field) on the input image. According to the predefined Anchor, a point on the Feature Map can be used as the center to generate 9 different shapes and sizes of borders on the original image, such as Figure 2 :

[0069] According to the receptive field of the model, a point on a Feature Map corresponds to a 16×1616×16 square area of ​​the original image. If only the border of this area is used for target positioning, the accuracy will undoubtedly be very poor, or even the target cannot be "framed" at all. After adding Anchor, a point on a Feature Map can generate 9 frames of different shapes and sizes, so the probability of "framing" the target will be very high, which greatly improves the recall rate of the inspection; and by adjusting these borders through the subsequent network, the accuracy can also be greatly improved.

[0070] The Feature Map generated by our Anchor Box is obtained by downsampling the original image 16 times. In this way, different aspect ratios actually stretch the 16×16 area into different shapes, such as Figure 3 :

[0071] That is to say, the center point and area are the same, but the shape has changed.

[0072] The borders generated by different ratios have the same area and size. The three different areas (scales) are actually enlarging or reducing the above 16×1616×16 area.

[0073] 128×128 is 16×16 magnified 8 times; 256×256 is 16 times magnified; 512×512 is 32 times magnified. Figure 4 :

[0074] Border calculation:

[0075] ratio×h 2 =s

[0076] As a preferred embodiment of the present invention, specifically, the pretreatment operation includes the following:

[0077] For the first picture, assuming that the length and width of the first picture are l and w, normalization processing is performed to uniformly scale the picture to be detected to a standard size of l1*w1 for prediction;

[0078] When scaling, the length and width of the scaled image are divided by the length and width of the original image to obtain two scaling factors, namely l / l1 and w / w1, and the smaller scaling factor of the two scaling factors is selected as the final scaling factor;

[0079] Multiply the length and width of the original image by the final scaling factor to get the length and width after scaling, which are l*min[l / l1, w / w1] and w*min[l / l1, w / w1] respectively;

[0080] Calculate the actual height h that needs to be filled.

[0081] h=|l*min[l / l1,w / w1]-w*min[l / l1,w / w1|,

[0082] By calling np.mod in numpy to take the remainder, h is processed to obtain a first pixel value, and half of the first pixel value is used as the value to be filled at both ends of the image height.

[0083] In this preferred embodiment, the watermark deep model neural network uniformly scales the original image to a standard size of 416*416 for prediction, greatly reducing network operations, and automatically calculates the black borders that need to be filled at both ends of the image height, and then sends it to the detection network. When using model reasoning, this greatly improves the speed of target detection and reasoning.

[0084] As a preferred embodiment of the present invention, specifically, the structure of the video watermark recognition model includes the following:

[0085] The structure of the watermark deep model neural network takes the original 608*608*3 image as input into the Focus structure, uses a slicing operation, first converts it into a 304*304*12 feature map, and then undergoes a convolution operation with 32 convolution kernels, and finally becomes a 304*304*32 feature map. The backbone network for extracting and identifying image features is transformed from multiple single cores to multiple single cores connected with different small cores to reduce the dimension of image features.

[0086] In this preferred embodiment, the above network structure is used to compress feature information, making the recognition network result wider and deeper. The training parameter volume is reduced from 854M to 358M, and the calculation amount of one layer of network is explosively reduced, which can not only speed up the learning and training speeds, but also recognize watermarks with smaller areas.

[0087] As a preferred embodiment of the present invention, specifically, the target image obtained by taking a screenshot of the target video includes the following:

[0088] The target video is extracted before, during and after extraction to obtain 5 pictures of different time frames as target pictures, and the specification of the target picture is 720×1280.

[0089] The present invention also provides a device for quickly identifying video watermarks, comprising:

[0090] A video watermark model building module is used to train a video watermark recognition model to obtain a video watermark recognition model;

[0091] Obtain a target video, and take a screenshot of the target video to obtain a target image as the first image;

[0092] A preprocessing module, used for preprocessing the first image to obtain a second image;

[0093] The watermark recognition module is used to input the second image into the video watermark recognition model and output the recognized watermark.

[0094] As a preferred embodiment of the present invention, specifically, the preprocessing module includes:

[0095] A normalization module is used to normalize the first image and uniformly scale the image to be detected to a standard size of 416*416 for prediction;

[0096] The black edge filling module is used to fill the black edge of the first image after normalization processing to obtain a second image.

[0097] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for quickly identifying a video watermark as described in any one of the above items are implemented.

[0098] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment.

[0099] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of software functional modules.

[0100] If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or system that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content included in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0101] Although the description of the present invention has been quite detailed and specifically describes several described embodiments, it is not intended to be limited to any of these details or embodiments or any particular embodiment, but should be regarded as providing a broad possible interpretation of these claims in view of the prior art by reference to the appended claims, thereby effectively covering the intended scope of the present invention. In addition, the above description of the present invention is based on the embodiments foreseeable by the inventor, and its purpose is to provide a useful description, and those non-substantial changes to the present invention that have not yet been foreseen may still represent equivalent changes to the present invention.

[0102] The above is only a preferred embodiment of the present invention. The present invention is not limited to the above implementation. As long as the technical effect of the present invention is achieved by the same means, it should belong to the protection scope of the present invention. Within the protection scope of the present invention, its technical scheme and / or implementation method can have various modifications and changes.

Claims

1. A method for quickly identifying video watermarks, characterized in that: Includes the following: Training a video watermark recognition model to obtain a video watermark recognition model; Obtain a target video, and take a screenshot of the target video to obtain a target image as the first image; Preprocessing the first picture to obtain a second picture; Inputting the second image into the video watermark recognition model, and outputting the recognized watermark; Specifically, the preprocessing operation includes the following: For the first image, assuming that the length and width of the first image are l and w, normalization processing is performed to uniformly scale the image to be detected to a standard size. Make predictions; When scaling, the length and width of the scaled image are divided by the length and width of the original image to obtain two scaling factors: and , select the smaller scaling factor of the two scaling factors as the final scaling factor; Multiply the length and width of the original image by the final scaling factor to get the length and width after scaling, which are , ; Calculate the actual height h that needs to be filled. , By calling np.mod in numpy to take the remainder, h is processed to obtain a first pixel value, and half of the first pixel value is used as the value to be filled at both ends of the image height.

2. The method for quickly identifying video watermarks according to claim 1, characterized in that: Specifically, the training of the video watermark recognition model includes the following: In the model training stage, the coco dataset is used as the basic data training set. Randomly read four pictures from the coco dataset each time; Perform flip, zoom, and color gamut changes on the four images respectively; After the operation is completed, place the obtained pictures in four directions: the first picture is placed on the upper left, the second picture is placed on the lower left, the third picture is placed on the lower right, and the fourth picture is placed on the upper right; Use the matrix method to capture the fixed areas of the four pictures, and then splice them together to form a new picture; Through adaptive anchor frame calculation, the training network outputs a predicted frame based on the initial anchor frame, calculates the intersection of the predicted frame and the real frame, calculates the difference between the two, and then reversely updates and iterates the network parameters to obtain the final watermark real frame coordinates.

3. The method for quickly identifying video watermarks according to claim 1, characterized in that: Specifically, the structure of the video watermark recognition model includes the following: The structure of the watermark deep model neural network takes the original 608*608*3 image as input into the Focus structure, uses a slicing operation, first converts it into a 304*304*12 feature map, and then undergoes a convolution operation with 32 convolution kernels, and finally becomes a 304*304*32 feature map. The backbone network for extracting and identifying image features is transformed from multiple single cores to multiple single cores connected with different small cores to reduce the dimension of image features.

4. The method for quickly identifying video watermarks according to claim 1, characterized in that: Specifically, the target images obtained by taking screenshots of the target video include the following: The target video is extracted before, during and after extraction to obtain 5 pictures of different time frames as target pictures, and the specification of the target picture is 720×1280.

5. A device for quickly identifying video watermarks, characterized in that: The method for quickly identifying video watermarks according to claim 1 is applied, comprising: A video watermark model building module is used to train a video watermark recognition model to obtain a video watermark recognition model; Obtain a target video, and take a screenshot of the target video to obtain a target image as the first image; A preprocessing module, used for preprocessing the first image to obtain a second image; The watermark recognition module is used to input the second image into the video watermark recognition model and output the recognized watermark.

6. The device for quickly identifying video watermarks according to claim 5, characterized in that: Specifically, the preprocessing module includes: A normalization module is used to normalize the first image and uniformly scale the image to be detected to a standard size of 416*416 for prediction; The black edge filling module is used to fill the black edge of the first image after normalization processing to obtain a second image.

7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Digital image watermarking method based on visual perception characteristics

    CN102024249A

  • Video watermark identification method, device and equipment and storage medium

    CN109598231A