CN111953993A - Watermark extracting and adding method and device, electronic equipment and storage medium - Google Patents

Watermark extracting and adding method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111953993A
CN111953993A CN202010866687.2A CN202010866687A CN111953993A CN 111953993 A CN111953993 A CN 111953993A CN 202010866687 A CN202010866687 A CN 202010866687A CN 111953993 A CN111953993 A CN 111953993A
Authority
CN
China
Prior art keywords
watermark
code stream
video code
model
output result
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010866687.2A
Other languages
Chinese (zh)
Inventor
马兆远
李康
朱善伟
韩德伟
殷小雷
郝亚东
董利健
杨勖
梁冬雪
徐建
毕东柱
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bmi Beijing Intelligent System Co ltd
Original Assignee
Bmi Beijing Intelligent System Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bmi Beijing Intelligent System Co ltd filed Critical Bmi Beijing Intelligent System Co ltd
Priority to CN202010866687.2A priority Critical patent/CN111953993A/en
Publication of CN111953993A publication Critical patent/CN111953993A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/46Embedding additional information in the video signal during the compression process
    • H04N19/467Embedding additional information in the video signal during the compression process characterised by the embedded information being invisible, e.g. watermarking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting

Abstract

The application provides a watermark extracting and adding method, a watermark extracting and adding device, an electronic device and a storage medium, wherein the method comprises the following steps: acquiring a watermark and a video code stream, wherein the video code stream is a compressed video code stream and the watermark is to be added; inputting the watermark and the video code stream into a pre-trained watermark adding model to obtain a video code stream added with the watermark and compressed, and directly adding the watermark to the compressed video code stream by using the watermark adding model to obtain the video code stream added with the watermark and compressed.

Description

Watermark extracting and adding method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of video processing technologies, and in particular, to a method and an apparatus for extracting and adding a watermark, an electronic device, and a storage medium.
Background
At present, various short video websites and apps are more and more popular. But video websites often lack comprehensive and effective auditing means for uploaded video content. The situation that video is copied and released again without authorization on a video website is frequently seen, the problems of network video content supervision and the like are increasingly highlighted, and therefore copyright protection and traceability of video content become problems which need to be solved urgently. Video watermarking technology is one of the methods to solve this problem, however, the amount of video information is huge, and therefore, in order to save the storage space required for storing the video information, the video information is usually stored in a compressed form.
The existing video watermark adding technology firstly decapsulates a compressed video to obtain a compressed video code stream, then decompresses the compressed video code stream, adds a watermark to a video frame obtained after decompression, then recompresses the video frame added with the watermark to obtain a watermarked and compressed video code stream, and finally encapsulates the video code stream into a video file or a data stream convenient for network transmission.
Disclosure of Invention
In view of this, an object of the embodiments of the present application is to provide a method, an apparatus, an electronic device, and a storage medium for extracting and adding a watermark, so as to avoid operations of decompressing and compressing a video during the process of adding a watermark, thereby improving the efficiency of adding a watermark.
In a first aspect, an embodiment of the present application provides a watermarking method, where the method includes: acquiring a watermark and a video code stream, wherein the video code stream is a compressed video code stream and the watermark is to be added; and inputting the watermark and the video code stream into a pre-trained watermark adding model to obtain the video code stream which is added with the watermark and is compressed.
In the implementation process, the watermark is directly added to the compressed video code stream by using the watermark adding model to obtain the video code stream which is added with the watermark and is compressed, and the compressed video code stream does not need to be decompressed and compressed in the process, so that the watermark adding efficiency is improved.
Based on the first aspect, in a possible design, before the watermark and the video code stream are input into a pre-trained watermark adding model to obtain a video code stream to which the watermark is added and which is compressed, the method further includes: establishing an original watermark adding model; obtaining a model training sample, wherein the model training sample comprises a watermark sample and a video code stream sample, and the video code stream sample is a non-watermark compressed video code stream; inputting the model training sample into the original watermark adding model to obtain a model output result; determining a first loss value of an error between the model output result and a preset standard model output result, wherein the video content of the standard model output result corresponds to the content of the video code stream sample, and the watermark sample is compressed and added; and updating the original watermark adding model when the first loss value is determined to be larger than a preset threshold value until a new loss value determined by the updated watermark adding model is smaller than or equal to the preset threshold value, so as to obtain a trained watermark adding model.
In the implementation process, inputting a watermark sample and a video code stream sample into the original watermark adding model to obtain a model output result; the video code stream sample is a non-watermark compressed video code stream; and when determining that a first loss value of an error between the model output result and a preset standard model output result is greater than a preset threshold value, updating the original watermark adding model, wherein the video content of the standard model output result corresponds to the content of the video code stream sample, and the watermark sample is compressed and added until a new loss value determined by using the updated watermark adding model is less than or equal to the preset threshold value, so that the trained watermark adding model can accurately add the watermark to be added to the compressed video code stream without video compression and decompression operations.
In a possible design based on the first aspect, the obtaining a watermark includes: acquiring an initial watermark; and scrambling the initial watermark to obtain the watermark.
In the implementation process, the initial watermark is scrambled, so that the attack resistance of the video code stream added with the watermark can be further improved.
In a second aspect, an embodiment of the present application provides a watermark extraction method, where the method includes: acquiring a video code stream which is added with a watermark and is compressed; and inputting the video code stream into a watermark extraction model trained in advance to obtain the watermark.
In the implementation process, the watermark is directly extracted from the video code stream added with the watermark and compressed by using the watermark extraction model, and the compressed video code stream does not need to be decompressed and compressed in the process, so that the watermark extraction efficiency is improved.
Based on the first aspect, in a possible design, before the video code stream is input into a pre-trained watermark extraction model to obtain a watermark output result, the method further includes: establishing an original watermark extraction model; acquiring a video code stream sample, wherein the video code stream sample is a video code stream which is added with a watermark and is compressed; inputting the video code stream sample into the original watermark extraction model to obtain a watermark output result; determining a second loss value of an error between the watermark output result and a preset standard watermark output result; and updating the original watermark extraction model when the second loss value is determined to be larger than a preset threshold value until a new loss value determined by the updated watermark extraction model is smaller than or equal to the preset threshold value, so as to obtain a trained watermark extraction model.
In the implementation process, the video code stream sample is input into the original watermark extraction model to obtain a watermark output result; the video code stream sample is a video code stream which is added with a watermark and is compressed; and when determining that a second loss value of an error between the watermark output result and a preset standard watermark output result is greater than a preset threshold value, updating the original watermark extraction model until a new loss value determined by using the updated watermark extraction model is less than or equal to the preset threshold value to obtain a trained watermark extraction model, and then ensuring that the trained watermark extraction model can accurately extract the watermark from the video code stream added with the watermark and compressed without video compression and decompression operations.
In a possible design based on the first aspect, before the determining the second loss value of the error between the watermark output result and the preset standard watermark output result, the method further includes: acquiring an original watermark; and scrambling the original watermark to obtain the standard watermark output result.
In order to ensure the watermark extraction accuracy of the trained watermark extraction model under the condition that the watermark output by the watermark extraction model is the scrambled watermark, in the implementation process, the original watermark needs to be scrambled to obtain a standard watermark output result so as to ensure that the standard watermark output result is unified with the watermark output result output by the watermark extraction model, and further ensure the watermark extraction accuracy of the trained watermark extraction model.
In a third aspect, an embodiment of the present application provides a watermarking apparatus, where the apparatus includes: the first acquisition unit is used for acquiring a watermark and a video code stream, wherein the video code stream is a compressed video code stream and is to be added with the watermark; and the watermark adding unit is used for inputting the watermark and the video code stream into a pre-trained watermark adding model to obtain the video code stream which is added with the watermark and is compressed.
In a possible design based on the third aspect, the apparatus further includes: the watermark adding model training unit is used for establishing an original watermark adding model; obtaining a model training sample, wherein the model training sample comprises a watermark sample and a video code stream sample, and the video code stream sample is a non-watermark compressed video code stream; inputting the model training sample into the original watermark adding model to obtain a model output result; determining a first loss value of an error between the model output result and a preset standard model output result, wherein the video content of the standard model output result corresponds to the content of the video code stream sample, and the watermark sample is compressed and added; and updating the original watermark adding model when the first loss value is determined to be larger than a preset threshold value until a new loss value determined by the updated watermark adding model is smaller than or equal to the preset threshold value, so as to obtain a trained watermark adding model.
Based on the third aspect, in a possible design, the first obtaining unit is specifically configured to obtain an initial watermark; and scrambling the initial watermark to obtain the watermark.
In a fourth aspect, an embodiment of the present application provides a watermark extraction apparatus, where the apparatus includes: the second acquisition unit is used for acquiring the video code stream which is added with the watermark and compressed; and the watermark extraction unit is used for inputting the video code stream into a watermark extraction model trained in advance to obtain the watermark.
In a possible design based on the fourth aspect, the apparatus further includes: the watermark extraction model training unit is used for establishing an original watermark extraction model; acquiring a video code stream sample, wherein the video code stream sample is a video code stream which is added with a watermark and is compressed; inputting the video code stream sample into the original watermark extraction model to obtain a watermark output result; determining a second loss value of an error between the watermark output result and a preset standard watermark output result; and updating the original watermark extraction model when the second loss value is determined to be larger than a preset threshold value until a new loss value determined by the updated watermark extraction model is smaller than or equal to the preset threshold value, so as to obtain a trained watermark extraction model.
In a possible design based on the fourth aspect, the apparatus further includes: a third obtaining unit, configured to obtain an original watermark; and scrambling the original watermark to obtain the standard watermark output result.
In a fifth aspect, an embodiment of the present application provides an electronic device, including a processor and a memory connected to the processor, where a computer program is stored in the memory, and when the computer program is executed by the processor, the electronic device is caused to perform the method of the first aspect.
In a sixth aspect, an embodiment of the present application provides a storage medium, where a computer program is stored, and when the computer program runs on a computer, the computer is caused to execute the method of the first aspect.
Additional features and advantages of the present application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the embodiments of the present application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic flowchart of a watermarking method according to an embodiment of the present application.
Fig. 2 is a schematic flowchart of a watermark extraction method according to an embodiment of the present application.
Fig. 3 is a schematic structural diagram of a watermarking apparatus according to an embodiment of the present application.
Fig. 4 is a schematic structural diagram of a watermark extraction apparatus according to an embodiment of the present application.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Icon: 300-watermark adding means; 310-a first obtaining unit; 320-watermark adding unit; 400-watermark extraction means; 410-a second obtaining unit; 420-watermark extraction unit; 500-an electronic device; 501, a processor; 502-a memory; 503 — a communication interface.
Detailed Description
The technical solution in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Referring to fig. 1, fig. 1 is a flowchart of a watermarking method according to an embodiment of the present application, and the flowchart shown in fig. 1 will be described in detail below, where the method includes the steps of: s11 and S12.
S11: and acquiring the watermark and a video code stream, wherein the video code stream is a compressed video code stream and the watermark is to be added.
S12: and inputting the watermark and the video code stream into a pre-trained watermark adding model to obtain the video code stream which is added with the watermark and is compressed.
The above method is described in detail below.
S11: and acquiring the watermark and a video code stream, wherein the video code stream is a compressed video code stream and the watermark is to be added.
In a specific implementation process, S11 may be implemented in the following manner, to obtain a video file, and decapsulate the video file to obtain the video code stream and the audio code stream; and the video code stream is a compressed video code stream and the watermark is to be added.
As an implementation manner, a video stream is obtained, and the video stream is decapsulated to obtain the video code stream and the audio code stream.
As an implementation, the decapsulated video stream is directly obtained from a third party.
As an embodiment, the acquiring the watermark includes: a1 and a 2.
A1: an initial watermark is obtained.
The initial watermark may be a picture, or may be character information, etc.
In this embodiment, the initial watermark is a hidden watermark, and in other embodiments, the initial watermark may also be a clear watermark. Compared with the plain watermark, the hidden watermark is invisible to the naked eye, so that the hidden watermark is not easy to be removed by an infringer, and the hidden watermark does not cover the video content, so that the video watching experience of a user is not influenced.
After the initial watermark is acquired, step a2 is performed.
A2: and scrambling the initial watermark to obtain the watermark.
The specific implementation of scrambling the initial watermark is well known in the art, and therefore, will not be described herein again.
As an embodiment, the watermark acquired in S11 may also be the initial watermark in step a 1.
After the watermark and the video code stream are acquired, step S12 is executed.
S12: and inputting the watermark and the video code stream into a pre-trained watermark adding model to obtain the video code stream which is added with the watermark and is compressed.
As an embodiment, before S12, the method further includes: b1, B2, B3, B4 and B5.
B1: and establishing an original watermark adding model.
In this embodiment, the original watermark adding model is a convolutional neural network model, and in other embodiments, the original watermark adding model may also be a cyclic neural network model, or a combination of the convolutional neural network model and the cyclic neural network model.
B2: obtaining a model training sample, wherein the model training sample comprises a watermark sample and a video code stream sample, and the video code stream sample is a video code stream which is free of watermark and is compressed.
Wherein the watermark samples may comprise pictures and/or characters.
The number of the watermark samples may be multiple, or one or two, and the number of the video stream samples may be multiple, or one or two.
The specific implementation of the step B2 of obtaining the watermark sample and the video stream sample may refer to the step S11, and therefore, the details are not repeated herein.
B3: and inputting the model training sample into the original watermark adding model to obtain a model output result.
It should be noted that, in step B3, only one watermark sample and one video stream sample in the model training samples are input into the original watermark extraction model at a time, so as to obtain a model output result, which is understood to be a compressed video stream added with a watermark.
B4: and determining a first loss value of the error between the model output result and a preset standard model output result, wherein the video content of the standard model output result corresponds to the content of the video code stream sample, and the watermark sample is compressed and added.
In practical implementation, B4 may be implemented by determining a first loss value of the error of the model output result from a predetermined standard model output result according to a predetermined loss function.
The standard model output result is a video code stream which is obtained by adding a watermark by using a watermark adding technology mentioned in the background technology and is compressed.
It can be understood that, after the output result of the standard model is decompressed and the watermark sample is extracted from the decompressed result, the content of the video code stream obtained after the compression is the same as the content of the video code stream sample.
It is noted that the standard model output results corresponding to different watermark samples are different, and the standard model output results corresponding to different video code stream samples are different.
B5: and updating the original watermark adding model when the first loss value is determined to be larger than a preset threshold value until a new loss value determined by the updated watermark adding model is smaller than or equal to the preset threshold value, so as to obtain a trained watermark adding model.
When the first loss value is determined to be larger than a preset threshold value, updating the original watermark adding model by using a gradient descent back propagation algorithm to obtain an updated watermark adding model, and then inputting any one watermark sample and video code stream sample in the model training samples into the updated watermark adding model to obtain a new model output result; and determining a new loss value of the error between the new model output result and a preset standard model output result, and determining the updated watermark adding model as a trained watermark adding model when determining that the new loss value is less than or equal to the preset threshold value.
The preset threshold is set according to actual requirements, the smaller the preset threshold is, the higher the watermarking accuracy of the trained watermarking model is, but the complexity required by model training is relatively higher.
Referring to fig. 2, fig. 2 is a flowchart of a watermark extraction method according to an embodiment of the present application, and the flowchart shown in fig. 2 will be described in detail below, where the method includes the steps of: s21 and S22.
S21: and acquiring the video code stream which is added with the watermark and compressed.
S22: and inputting the video code stream into a pre-trained watermark extraction model to obtain a watermark output result.
The above method is described in detail below.
S21: and acquiring the video code stream which is added with the watermark and compressed.
The video code stream in S21 may be the watermarked and compressed video code stream acquired by using the background technology, or the video code stream acquired by using a pre-trained watermark adding model.
After the watermarked and compressed video code stream is acquired, step S22 is executed.
S22: and inputting the video code stream into a watermark extraction model trained in advance to obtain the watermark.
As an embodiment, before S22, the method further includes: c1, C2, C3, C4 and C5.
C1: and establishing an original watermark extraction model.
In this embodiment, the original watermark extraction model is a convolutional neural network model, and in other embodiments, the original watermark extraction model may also be a cyclic neural network model, or a combination of the convolutional neural network model and the cyclic neural network model.
C2: and acquiring a video code stream sample, wherein the video code stream sample is a video code stream which is added with a watermark and is compressed.
In this embodiment, the video code stream sample in C2 is a watermarked compressed video code stream obtained by using a background technology, and in other embodiments, the video code stream in C2 may also be a video code stream obtained by using a pre-trained watermark adding model.
And the number of the video code stream samples is at least one.
C3: and inputting the video code stream sample into the original watermark extraction model to obtain a watermark output result.
In C3, a video stream sample is input to the original extraction model each time, and a watermark output result is obtained.
C4: and determining a second loss value of the error between the watermark output result and a preset standard watermark output result.
In practical implementation, C4 may be implemented as follows, and determines a second loss value of the error between the watermark output result and the preset standard watermark output result according to a predetermined loss function.
And the preset standard watermark output result is the same as the watermark in the video code stream which is added with the watermark and is compressed.
C5: and updating the original watermark extraction model when the second loss value is determined to be larger than a preset threshold value until a new loss value determined by the updated watermark extraction model is smaller than or equal to the preset threshold value, so as to obtain a trained watermark extraction model.
When the second loss value is determined to be larger than a preset threshold value, updating the original watermark extraction model by using a gradient descent back propagation algorithm to obtain an updated watermark extraction model, and then inputting any video code stream sample into the updated watermark extraction model to obtain a new watermark output result; and determining a new loss value of the error between the new watermark output result and a preset standard watermark output result, and determining the updated watermark extraction model as a trained watermark extraction model when determining that the new loss value is less than or equal to the preset threshold value.
As an embodiment, before C4, the method further comprises the steps of: d1 and D2.
D1: the original watermark is obtained.
D2: and scrambling the original watermark to obtain the standard watermark output result.
For the specific embodiments of D1 and D2, please refer to a1 and a2, which are not described herein.
Wherein, the standard watermark output result in C4 may be the original watermark in D1.
Referring to fig. 3, fig. 3 is a block diagram of a watermarking apparatus 300 according to an embodiment of the present disclosure. The block diagram of fig. 3 will be explained, and the apparatus shown comprises:
the first obtaining unit 310 is configured to obtain a watermark and a video code stream, where the video code stream is a compressed video code stream and is to be added with the watermark.
And a watermark adding unit 320, which inputs the watermark and the video code stream into a pre-trained watermark adding model to obtain a compressed video code stream added with the watermark.
As an embodiment, the apparatus further comprises: the watermark adding model training unit is used for establishing an original watermark adding model; obtaining a model training sample, wherein the model training sample comprises a watermark sample and a video code stream sample, and the video code stream sample is a non-watermark compressed video code stream; inputting the model training sample into the original watermark adding model to obtain a model output result; determining a first loss value of an error between the model output result and a preset standard model output result, wherein the video content of the standard model output result corresponds to the content of the video code stream sample, and the watermark sample is compressed and added; and updating the original watermark adding model when the first loss value is determined to be larger than a preset threshold value until a new loss value determined by the updated watermark adding model is smaller than or equal to the preset threshold value, so as to obtain a trained watermark adding model.
In an embodiment, the first obtaining unit 310 is specifically configured to obtain an initial watermark; and scrambling the initial watermark to obtain the watermark.
For the process of implementing each function by each functional unit in this embodiment, please refer to the content described in the embodiment shown in fig. 1, which is not described herein again.
Referring to fig. 4, fig. 4 is a block diagram of a watermarking apparatus 400 according to an embodiment of the present disclosure. The block diagram of fig. 4 will be explained, and the apparatus shown comprises:
a second obtaining unit 410, configured to obtain the watermarked compressed video stream.
And a watermark extracting unit 420, configured to input the video code stream into a pre-trained watermark extracting model to obtain the watermark.
As an embodiment, the apparatus further comprises: the watermark extraction model training unit is used for establishing an original watermark extraction model; acquiring a video code stream sample, wherein the video code stream sample is a video code stream which is added with a watermark and is compressed; inputting the video code stream sample into the original watermark extraction model to obtain a watermark output result; determining a second loss value of an error between the watermark output result and a preset standard watermark output result; and updating the original watermark extraction model when the second loss value is determined to be larger than a preset threshold value until a new loss value determined by the updated watermark extraction model is smaller than or equal to the preset threshold value, so as to obtain a trained watermark extraction model.
As an embodiment, the apparatus further comprises: a third obtaining unit, configured to obtain an original watermark; and scrambling the original watermark to obtain the standard watermark output result.
Please refer to the content described in the embodiment shown in fig. 2 for the process of implementing each function of each functional unit in this embodiment, which is not described herein again.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an electronic device 500 according to an embodiment of the present disclosure, where the electronic device 500 may be a site server in the above embodiment, and the electronic device 500 may be a Personal Computer (PC), a tablet computer, a smart phone, a Personal Digital Assistant (PDA), or the like.
The electronic device 500 may include: memory 502, processor 501, communication interface 503, and a communication bus for enabling connection communication of these components.
The Memory 502 is used for storing various data such as a computer program instruction corresponding to the watermark extracting and adding method and device provided by the embodiment of the present application, where the Memory 502 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like.
The processor 501 is configured to read and run computer program instructions corresponding to the watermark extracting and adding methods and apparatuses stored in the memory, so as to obtain a watermark and a video code stream, where the video code stream is a compressed video code stream to which the watermark is to be added; and inputting the watermark and the video code stream into a pre-trained watermark adding model to obtain the video code stream which is added with the watermark and is compressed.
The processor 501 may be an integrated circuit chip having signal processing capability. The Processor 501 may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
A communication interface 503 for receiving or transmitting data.
In addition, a storage medium is provided in an embodiment of the present application, and a computer program is stored in the storage medium, and when the computer program runs on a computer, the computer is caused to execute the method provided in any embodiment of the present application.
In summary, the watermark extracting and adding method, the watermark extracting and adding device, the electronic device and the storage medium provided in the embodiments of the present application directly add the watermark to the compressed video code stream by using the watermark adding model, so as to obtain the video code stream to which the watermark is added and which is compressed.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based devices that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

Claims (10)

1. A watermarking method, the method comprising:
acquiring a watermark and a video code stream, wherein the video code stream is a compressed video code stream and the watermark is to be added;
and inputting the watermark and the video code stream into a pre-trained watermark adding model to obtain the video code stream which is added with the watermark and is compressed.
2. The method of claim 1, wherein before the inputting the watermark and the video stream into a pre-trained watermark adding model to obtain a compressed video stream to which the watermark has been added, the method further comprises:
establishing an original watermark adding model;
obtaining a model training sample, wherein the model training sample comprises a watermark sample and a video code stream sample, and the video code stream sample is a non-watermark compressed video code stream;
inputting the model training sample into the original watermark adding model to obtain a model output result;
determining a first loss value of an error between the model output result and a preset standard model output result, wherein the video content of the standard model output result corresponds to the content of the video code stream sample, and the watermark sample is compressed and added;
and updating the original watermark adding model when the first loss value is determined to be larger than a preset threshold value until a new loss value determined by the updated watermark adding model is smaller than or equal to the preset threshold value, so as to obtain a trained watermark adding model.
3. The method of claim 1, wherein the obtaining the watermark comprises:
acquiring an initial watermark;
and scrambling the initial watermark to obtain the watermark.
4. A method of watermark extraction, the method comprising:
acquiring a video code stream which is added with a watermark and is compressed;
and inputting the video code stream into a watermark extraction model trained in advance to obtain the watermark.
5. The method of claim 4, wherein before inputting the video bitstream into a pre-trained watermark extraction model to obtain a watermark output result, the method further comprises:
establishing an original watermark extraction model;
acquiring a video code stream sample, wherein the video code stream sample is a video code stream which is added with a watermark and is compressed;
inputting the video code stream sample into the original watermark extraction model to obtain a watermark output result;
determining a second loss value of an error between the watermark output result and a preset standard watermark output result;
and updating the original watermark extraction model when the second loss value is determined to be larger than a preset threshold value until a new loss value determined by the updated watermark extraction model is smaller than or equal to the preset threshold value, so as to obtain a trained watermark extraction model.
6. The method according to claim 5, wherein before the determining the second loss value of the error between the watermark output result and the preset standard watermark output result, the method further comprises:
acquiring an original watermark;
and scrambling the original watermark to obtain the standard watermark output result.
7. A watermarking apparatus, characterized in that the apparatus comprises:
the first acquisition unit is used for acquiring a watermark and a video code stream, wherein the video code stream is a compressed video code stream and is to be added with the watermark;
and the watermark adding unit is used for inputting the watermark and the video code stream into a pre-trained watermark adding model to obtain the video code stream which is added with the watermark and is compressed.
8. An apparatus for extracting a watermark, the apparatus comprising:
the second acquisition unit is used for acquiring the video code stream which is added with the watermark and compressed;
and the watermark extraction unit is used for inputting the video code stream into a watermark extraction model trained in advance to obtain the watermark.
9. An electronic device comprising a memory and a processor, the memory having stored therein computer program instructions that, when read and executed by the processor, perform the method of any of claims 1-6.
10. A storage medium having stored thereon computer program instructions which, when read and executed by a computer, perform the method of any one of claims 1-6.
CN202010866687.2A 2020-08-25 2020-08-25 Watermark extracting and adding method and device, electronic equipment and storage medium Pending CN111953993A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010866687.2A CN111953993A (en) 2020-08-25 2020-08-25 Watermark extracting and adding method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010866687.2A CN111953993A (en) 2020-08-25 2020-08-25 Watermark extracting and adding method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111953993A true CN111953993A (en) 2020-11-17

Family

ID=73366632

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010866687.2A Pending CN111953993A (en) 2020-08-25 2020-08-25 Watermark extracting and adding method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111953993A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023246403A1 (en) * 2022-06-23 2023-12-28 北京火山引擎科技有限公司 Model training method, watermark restoration method, and related device

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010019618A1 (en) * 1995-05-08 2001-09-06 Digimarc Corporation Watermarking methods and media
US20030174863A1 (en) * 1998-04-16 2003-09-18 Brundage Trent J. Steganographically encoding specular surfaces
CN101252683A (en) * 2008-04-02 2008-08-27 中山大学 Multifunctional watermark video camera
CN102547254A (en) * 2010-11-26 2012-07-04 中国科学院声学研究所 Method and system for digital video image copyright protection based on watermarks and encryption
CN104361548A (en) * 2014-10-28 2015-02-18 河南师范大学 BP neural network digital image compression based image watermark embedding and extracting method
CN110211016A (en) * 2018-02-28 2019-09-06 佛山科学技术学院 A kind of watermark embedding method based on convolution feature
CN111491170A (en) * 2019-01-26 2020-08-04 华为技术有限公司 Method for embedding watermark and watermark embedding device
CN111523094A (en) * 2020-03-25 2020-08-11 平安科技(深圳)有限公司 Deep learning model watermark embedding method and device, electronic equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010019618A1 (en) * 1995-05-08 2001-09-06 Digimarc Corporation Watermarking methods and media
US20030174863A1 (en) * 1998-04-16 2003-09-18 Brundage Trent J. Steganographically encoding specular surfaces
CN101252683A (en) * 2008-04-02 2008-08-27 中山大学 Multifunctional watermark video camera
CN102547254A (en) * 2010-11-26 2012-07-04 中国科学院声学研究所 Method and system for digital video image copyright protection based on watermarks and encryption
CN104361548A (en) * 2014-10-28 2015-02-18 河南师范大学 BP neural network digital image compression based image watermark embedding and extracting method
CN110211016A (en) * 2018-02-28 2019-09-06 佛山科学技术学院 A kind of watermark embedding method based on convolution feature
CN111491170A (en) * 2019-01-26 2020-08-04 华为技术有限公司 Method for embedding watermark and watermark embedding device
CN111523094A (en) * 2020-03-25 2020-08-11 平安科技(深圳)有限公司 Deep learning model watermark embedding method and device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李文娜: "数字图像压缩编码及水印算法的研究", 《中国博士学位论文全文数据库》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023246403A1 (en) * 2022-06-23 2023-12-28 北京火山引擎科技有限公司 Model training method, watermark restoration method, and related device

Similar Documents

Publication Publication Date Title
CN108495185B (en) Video title generation method and device
CN109756746B (en) Video auditing method, device, server and storage medium
US20170277703A1 (en) Method for Displaying Webpage and Server
CN111681291A (en) Image processing method, device, equipment and computer readable storage medium
CN107295352B (en) Video compression method, device, equipment and storage medium
CN112507167A (en) Method and device for identifying video collection, electronic equipment and storage medium
CN111241496B (en) Method and device for determining small program feature vector and electronic equipment
CN115004181A (en) Webpage detection method and device, electronic equipment and storage medium
US11800199B2 (en) Video playing method and apparatus
CN105095253A (en) Webpage display method and webpage display device
CN111953993A (en) Watermark extracting and adding method and device, electronic equipment and storage medium
CN110188782B (en) Image similarity determining method and device, electronic equipment and readable storage medium
CN113918949A (en) Recognition method of fraud APP based on multi-mode fusion
CN107423204B (en) Processing method and device for operation log of application program and terminal
CN113535263A (en) Dynamic library calling method and device, computer equipment and storage medium
CN113705300A (en) Method, device and equipment for acquiring phonetic-to-text training corpus and storage medium
CN111708680A (en) Error reporting information analysis method and device, electronic equipment and storage medium
KR101833220B1 (en) Deobfuscation assessing apparatus of application code and method of assessing deobfuscation of application code using the same
EP3985989A1 (en) Detection of modification of an item of content
CN115203674A (en) Automatic login method, system, device and storage medium for application program
CN110929767B (en) Font processing method, system, device and medium
CN115730104A (en) Live broadcast room processing method, device, equipment and medium
CN112347982A (en) Video-based unsupervised difficult case data mining method, device, medium and equipment
CN113538288A (en) Network anomaly detection method and device and computer readable storage medium
CN108519962B (en) Font display method and apparatus applied to android system, and terminal device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20201117

RJ01 Rejection of invention patent application after publication