Video authentication methods, devices, and electronic equipment based on image processing
By dividing the video into overlapping video frame groups and using wavelet transform and motion compensation techniques to detect intra-frame and inter-frame forgery, the problem of low detection efficiency in existing video authentication methods is solved, and efficient and accurate video authentication is achieved.
Patent Information
- Application Number
- CN202411350604.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2044-09-25
AI Technical Summary
Existing video authentication methods suffer from low detection efficiency and high computational resource consumption when faced with video tampering techniques, making it difficult to effectively detect intra-frame and inter-frame forgery and affecting user experience.
A video authentication method based on image processing is adopted. The video to be authenticated is divided into overlapping video frame groups, the residual noise and similarity value in each overlapping video frame group are calculated, and wavelet transform and motion compensation techniques are used to detect intra-frame and inter-frame forgery.
It improves the detection efficiency of video authentication, reduces the amount of computation, and maintains high accuracy in intra-frame and inter-frame forgery detection, thereby enhancing the user experience.
Smart Images

Figure CN119603472B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and more specifically, to a video authentication method and apparatus, and an electronic device based on image processing. Background Technology
[0002] With the rapid iteration of network technology, network security has become an increasingly important topic. Video authentication, due to its intuitiveness and difficulty in forgery, has become an important means of identity verification in digital service platforms. For example, in the education field, with the rise of smart campuses, video authentication is widely used in the login process of campus platforms. In the financial field, video authentication has also gradually developed into one of the most important user identity authentication methods to ensure the authenticity and security of user identities and protect user property security.
[0003] However, with the development of artificial intelligence technology, especially the application of deep learning in image processing, video tampering techniques such as face swapping and video synthesis have become increasingly sophisticated, posing unprecedented challenges to traditional video authentication methods. Unauthorized users can exploit these techniques to forge authentication videos, making them appear remarkably similar to legitimate users, thereby bypassing security verification. Furthermore, traditional video authentication often relies on frame-by-frame face recognition or motion recognition. This method not only consumes significant computational resources and has low detection efficiency, but also experiences a significant reduction in system processing speed and response time when faced with a large number of concurrent login requests, impacting user experience.
[0004] There is currently no effective solution to the above problems. Summary of the Invention
[0005] This invention provides a video authentication method, apparatus, and electronic device based on image processing, to at least solve the technical problem in related technologies where video authentication requires frame-by-frame detection, resulting in low detection efficiency.
[0006] According to one aspect of the present invention, a video authentication method based on image processing is provided, comprising: acquiring an encoded video to be authenticated, and dividing the video to be authenticated into N overlapping video frame groups, wherein the video to be authenticated is encoded based on a double compression algorithm, and the overlapping video frame group represents that there are M repeated video frames between two adjacent video frame groups, where M and N are both positive integers; for each overlapping video frame group, calculating the residual noise of each P frame in the overlapping video frame group, and comparing the residual noise of each P frame in the overlapping video frame group with the error value corresponding to the P frame to obtain a first comparison result of the overlapping video frame group, wherein the P frame represents the forward pre-processing frame. The process involves several steps: First, a frame is tested, where the forward prediction frame represents a video frame containing the pixel differences between the current frame and the previous frame. Second, if the first comparison result indicates that the residual noise of all P-frames within the overlapping video frame group is less than or equal to the error value corresponding to the P-frame, it is determined that the overlapping video frame group does not contain intra-frame forgery. If none of the N overlapping video frame groups within the video to be authenticated contain intra-frame forgery, a similarity value is calculated between every two overlapping video frame groups within the video to be authenticated. Third, the similarity value between every two overlapping video frame groups within the video to be authenticated is compared with a similarity threshold to obtain a second comparison result. Finally, the authentication result of the video to be authenticated is determined based on the second comparison result.
[0007] Optionally, for each of the overlapping video frame groups, the step of calculating the residual noise of each P-frame within the overlapping video frame group includes: for each of the overlapping video frame groups, obtaining an I-frame in the overlapping video frame group, wherein the I-frame is a key frame in the video to be authenticated, and the key frame is a video frame containing complete image data; denoising the I-frame based on wavelet transform to obtain a denoised I-frame; calculating the difference data between the denoised I-frame and the I-frame before denoising to obtain the residual noise of the denoised I-frame; and calculating the residual noise of the P-frames adjacent to the I-frame based on the residual noise of the denoised I-frame.
[0008] Optionally, the step of denoising the I-frame based on wavelet transform to obtain a denoised I-frame includes: decomposing the I-frame to obtain grayscale images of the I-frame in the red RGB channel, green RGB channel, and blue RGB channel respectively; performing wavelet transform on the grayscale images of the red RGB channel, green RGB channel, and blue RGB channel of the I-frame respectively to obtain a set of frequency sub-bands corresponding to the I-frame, wherein the set of frequency sub-bands contains K frequency sub-bands of the I-frame, and the frequency sub-bands are the frequency components of the I-frame in the target direction under the target color channel; calculating the local variance of each frequency sub-band; denoising the frequency sub-band based on the local variance to obtain a denoised frequency sub-band, and calculating the wavelet coefficients of the denoised frequency sub-band; and performing inverse wavelet transform on the wavelet coefficients of all the denoised frequency sub-bands to obtain the denoised I-frame.
[0009] Optionally, the step of calculating the residual noise of the P-frame adjacent to the I-frame based on the residual noise of the denoised I-frame includes: for any P-frame, selecting an I-frame adjacent to the P-frame as a reference frame; for each region block in the P-frame, obtaining a target region block in the reference frame that matches the region block in the P-frame; obtaining the pixel difference between the region block in the P-frame and the target region block in the reference frame through motion compensation; calculating the residual noise of each region block in the P-frame based on the pixel difference between the region block and the target region block and the residual noise of the denoised reference frame on each target region block, thereby obtaining the residual noise of the P-frame.
[0010] Optionally, the step of calculating the similarity value of every two overlapping video frame groups within the video to be authenticated includes: for each overlapping video frame, combining two adjacent video frames in the overlapping video frame to obtain a video frame pair; calculating the noise association value of the video frame pair, and concatenating the noise association values of all video frame pairs in the overlapping video frame to obtain the noise vector of the overlapping video frame; and calculating the similarity value based on the noise vector of any two overlapping video frames in the video to be authenticated to obtain the similarity value of every two overlapping video frame groups within the video to be authenticated.
[0011] Optionally, after obtaining the first comparison result of the overlapping video frame group, the method further includes: determining that the overlapping video frame has intra-frame forgery if the first comparison result indicates that the residual noise of any P frame in the overlapping video frame group is greater than the error value; determining that the video to be authenticated is abnormal based on the overlapping video frame with intra-frame forgery, generating an authentication failure result for the abnormal video to be authenticated, and returning the authentication result to the user terminal.
[0012] Optionally, the step of determining the authentication result of the video to be authenticated based on the second comparison result includes: if the second comparison result indicates that the similarity value of any two overlapping video frame groups in the video to be authenticated is greater than a similarity threshold, determining that there is inter-frame forgery between the two overlapping video frame groups; determining that the video to be authenticated is abnormal based on the overlapping video frame groups with inter-frame forgery, generating an authentication failure result for the abnormal video to be authenticated, and returning the authentication result to the user terminal.
[0013] Optionally, the formula for calculating the error value is expressed as: in, A represents the error value corresponding to frame P. The value represents the percentage of error corresponding to frame P, S represents the change region block between frame P and adjacent video frames, K represents the Kth change region block, K represents the average residual noise within the Kth change region block, and I represents the average residual noise of frame P.
[0014] According to another aspect of the present invention, a video authentication device based on image processing is also provided, comprising: an acquisition unit, configured to acquire an encoded video to be authenticated and divide the video to be authenticated into N overlapping video frame groups, wherein the video to be authenticated is encoded based on a secondary compression algorithm, and the overlapping video frame group represents that there are M repeated video frames between two adjacent video frame groups, where M and N are both positive integers; and a first calculation unit, configured to calculate the residual noise of each P frame in each overlapping video frame group, and compare the residual noise of each P frame in the overlapping video frame group with the error value corresponding to the P frame to obtain a first comparison result of the overlapping video frame group, wherein the P frame represents a forward prediction frame. The forward prediction frame represents a video frame containing the pixel difference between the current frame and the previous frame; the determining unit is used to determine that there is no intra-frame forgery in the overlapping video frame group when the first comparison result indicates that the residual noise of all P frames in the overlapping video frame group is less than or equal to the error value corresponding to the P frame; the second calculation unit is used to calculate the similarity value of every two overlapping video frame groups in the video to be certified when there is no intra-frame forgery in the N overlapping video frame groups in the video to be certified; the comparison unit is used to compare the similarity value of every two overlapping video frame groups in the video to be certified with a similarity threshold to obtain a second comparison result, and determine the certification result of the video to be certified based on the second comparison result.
[0015] Optionally, the first calculation unit includes: a first acquisition module, configured to acquire an I-frame in each overlapping video frame group, wherein the I-frame is a key frame in the video to be authenticated, and the key frame is a video frame containing complete image data; a first denoising module, configured to denoise the I-frame based on wavelet transform to obtain a denoised I-frame; a first calculation module, configured to calculate the difference data between the denoised I-frame and the I-frame before denoising to obtain the residual noise of the denoised I-frame; and a second calculation module, configured to calculate the residual noise of the P-frame adjacent to the I-frame based on the residual noise of the denoised I-frame.
[0016] Optionally, the first denoising module further includes: a first decomposition submodule, used to decompose the I-frame to obtain grayscale images of the I-frame in the red RGB channel, green RGB channel, and blue RGB channel, respectively; a first transformation submodule, used to perform wavelet transform on the grayscale images of the red RGB channel, green RGB channel, and blue RGB channel of the I-frame, respectively, to obtain a set of frequency subbands corresponding to the I-frame, wherein the set of frequency subbands contains K frequency subbands of the I-frame, and the frequency subbands are the frequency components of the I-frame in the target direction under the target color channel; a first calculation submodule, used to calculate the local variance of each frequency subband; a first denoising submodule, used to perform denoising processing on the frequency subband based on the local variance to obtain denoised frequency subbands, and calculate the wavelet coefficients of the denoised frequency subbands; and a second transformation submodule, used to perform inverse wavelet transform on the wavelet coefficients of all the denoised frequency subbands to obtain the denoised I-frame.
[0017] Optionally, the first calculation module includes: a first selection submodule, used to select an I-frame adjacent to any P-frame as a reference frame; a first acquisition submodule, used to acquire a target region block in the reference frame that matches the region block in the P-frame for each region block in the P-frame; a second acquisition submodule, used to acquire the pixel difference between the region block in the P-frame and the target region block in the reference frame through motion compensation; and a second calculation submodule, used to calculate the residual noise of each region block in the P-frame based on the pixel difference between the region block and the target region block and the residual noise of the denoised reference frame on each target region block, thereby obtaining the residual noise of the P-frame.
[0018] Optionally, the second calculation unit includes: a first combination module, configured to combine two adjacent video frames in each overlapping video frame to obtain a video frame pair; a third calculation module, configured to calculate the noise association value of the video frame pair and concatenate the noise association values of all video frame pairs in the overlapping video frames to obtain the noise vector of the overlapping video frame; and a fourth calculation module, configured to calculate the similarity value based on the noise vector of any two overlapping video frames in the video to be authenticated, to obtain the similarity value of every two overlapping video frame groups in the video to be authenticated.
[0019] Optionally, the image processing-based video authentication device further includes: a first determining module, configured to determine that the overlapping video frame has intra-frame forgery when the first comparison result indicates that the residual noise of any P-frame in the overlapping video frame group is greater than the error value; and a first generating module, configured to determine that the video to be authenticated is abnormal based on the overlapping video frame with intra-frame forgery, generate an authentication failure result for the abnormal video to be authenticated, and return the authentication result to the user terminal.
[0020] Optionally, the determining unit includes: a second determining module, configured to determine that there is inter-frame forgery between two overlapping video frame groups when the second comparison result indicates that the similarity value of any two overlapping video frame groups in the video to be authenticated is greater than a similarity threshold; and a third determining module, configured to determine that the video to be authenticated is abnormal based on the overlapping video frame groups with inter-frame forgery, generate an authentication failure result for the abnormal video to be authenticated, and return the authentication result to the user terminal.
[0021] Optionally, the formula for calculating the error value is expressed as: in, A represents the error value corresponding to frame P, A represents the percentage of the error value corresponding to frame P, S represents the change region block between frame P and adjacent video frames, K represents the Kth change region block, K represents the average residual noise within the Kth change region block, and I represents the average residual noise of frame P.
[0022] According to another aspect of the present invention, an electronic device is also provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement any of the above-described image processing-based video authentication methods.
[0023] In this application, the following steps are taken: First, the encoded video to be authenticated is obtained and divided into N overlapping video frame groups. The video to be authenticated is encoded using a double compression algorithm. An overlapping video frame group represents two adjacent video frame groups containing M repeated video frames, where M and N are both positive integers. Then, for each overlapping video frame group, the residual noise of each P frame within the overlapping video frame group is calculated, and the residual noise of each P frame within the overlapping video frame group is compared with the error value corresponding to the P frame to obtain the first comparison result of the overlapping video frame group. Here, the P frame represents the forward prediction frame. The test frame represents a video frame containing the pixel differences between the current frame and the previous frame. If the first comparison result indicates that the residual noise of all P frames in the overlapping video frame group is less than or equal to the error value corresponding to the P frame, it is determined that there is no intra-frame forgery in the overlapping video frame group. If there is no intra-frame forgery in any of the N overlapping video frame groups in the video to be certified, the similarity value of every two overlapping video frame groups in the video to be certified is calculated. Finally, the similarity value of every two overlapping video frame groups in the video to be certified is compared with the similarity threshold to obtain the second comparison result. The certification result of the video to be certified is determined based on the second comparison result.
[0024] In this application, when authenticating a video, the video to be authenticated is divided into N overlapping video frame groups. These overlapping video frame groups are used as the detection objects. Residual noise in P frames within each group is calculated and compared with a preset error value, enabling precise detection of intra-frame tampering. Simultaneously, the similarity value between video frame groups is calculated and compared with a set similarity threshold, allowing detection of inter-frame tampering. This eliminates the need for frame-by-frame video inspection, effectively reducing computational load and improving detection efficiency while maintaining high accuracy in intra- and inter-frame forgery detection. This solves the technical problem in related technologies where video authentication requires frame-by-frame inspection, resulting in low detection efficiency. Attached Figure Description
[0025] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0026] Figure 1 This is a flowchart of an optional image processing-based video authentication method according to an embodiment of the present invention;
[0027] Figure 2 This is a schematic diagram of an optional overlapping video frame group according to an embodiment of the present invention;
[0028] Figure 3 This is a schematic diagram of an optional image processing-based video authentication device according to an embodiment of the present invention;
[0029] Figure 4 This is a hardware structure block diagram of an electronic device (or mobile device) using an image processing-based video authentication method according to an embodiment of the present invention. Detailed Implementation
[0030] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0031] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0032] It should be noted that the image processing-based video authentication method and apparatus in this application can be used in the field of image processing technology for security authentication of video based on image processing, and can also be used in any field other than the field of image processing technology for security authentication of video based on image processing. This application does not limit the application field of the image processing-based video authentication method and apparatus.
[0033] It should be noted that the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, and displayed data) involved in this application are information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of this data all comply with the relevant laws, regulations, and standards of the relevant regions, have taken necessary confidentiality measures, do not violate public order and good morals, and provide corresponding access points for users to choose to authorize or refuse. For example, this system has an interface with relevant users or organizations. Before obtaining relevant information, a request to obtain the information needs to be sent to the aforementioned user or organization through the interface, and the relevant information is obtained only after receiving consent from the aforementioned user or organization.
[0034] It should be noted that in this application, when collecting and analyzing customer information, users are provided with corresponding operation entry points to choose whether to agree to or reject the automated decision-making results; if the user chooses to reject, the process will proceed to the expert decision-making process.
[0035] The following embodiments of the present invention can be applied to various image processing-based video authentication systems / applications / devices. The present invention divides the video to be authenticated into multiple overlapping video frame groups. Taking these overlapping video frame groups as the research object, residual noise is calculated for the P-frames after secondary compression within each group. By comparing the residual noise and error values, intra-frame forgery detection is achieved. Simultaneously, similarity calculation is performed on two overlapping video frame groups, and inter-frame forgery detection is achieved by comparing the similarity values and similarity thresholds. This approach ensures high accuracy in authentication and recognition while achieving efficient detection and authentication.
[0036] The present invention will now be described in detail with reference to various embodiments.
[0037] Example 1
[0038] According to an embodiment of the present invention, an embodiment of a video authentication method based on image processing is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0039] Figure 1 This is a flowchart of an optional image processing-based video authentication method according to an embodiment of the present invention, such as... Figure 1 As shown, the method includes the following steps:
[0040] Step S101: Obtain the encoded video to be authenticated and divide the video to be authenticated into N overlapping video frame groups.
[0041] It should be noted that with the rapid iteration of network technology, network security has received increasing attention, and various security authentication methods have emerged. Video authentication, as a relatively difficult authentication method to forge, has gradually become the mainstream of current security authentication, especially for some fields with high security requirements, such as campus security platforms and financial service platforms. However, current video authentication also has the risk of forgery. For example, facial authentication videos can be forged by using AI face-swapping technology or synthesizing video frames, which can lead to network security vulnerabilities.
[0042] It should be noted that video forgery includes intra-frame forgery and inter-frame forgery. Intra-frame forgery involves tampering with, deleting, or adding content to video frames. Inter-frame forgery involves copying and pasting video frames to modify their positions or combining different video frames into a new video. When authenticating videos, both intra-frame and inter-frame forgery need to be detected and authenticated simultaneously.
[0043] It should be noted that, in order to avoid network security risks, the video to be authenticated needs to be accurately authenticated to ensure its authenticity. In order to avoid the problems of excessive detection time and low detection efficiency caused by frame-by-frame analysis, which affect the user experience, the embodiment of the present invention encodes the video to be authenticated based on a secondary compression algorithm and divides the encoded video into multiple overlapping video frame groups. Intra-frame and inter-frame forgery authentication is performed on the overlapping video frame groups, which can ensure the security of the video to be authenticated while authenticating quickly.
[0044] It should be noted that the video to be authenticated in this embodiment of the invention can be a video composed of GOP image groups obtained through secondary compression encoding. The user records the authentication video through a mobile terminal, and the authentication video is uploaded to the video authentication system for security authentication after encoding. During video encoding, video frames include three types: I-frames, B-frames, and P-frames. Compression algorithms are divided into two categories: intra-frame compression and inter-frame compression, where I-frames are generated by the former, and B and P-frames are generated by the latter. I-frames are fully encoded, displaying complete image information and serving as keyframes in the video. The image can be reconstructed directly by decoding their own data. P-frames represent forward prediction frames, which are video frames containing pixel differences between the current frame and the previous frame. P-frames retain the difference information between the current frame and the I-frames or P-frames preceding it. During decoding, the corresponding difference information is added to the previous video frame to obtain a complete image. P-frames refer to both the preceding and following video frames, and the accumulation of transmission errors will affect subsequent encoding. B-frames use the 1-frame or P-frame before and after them as a reference, encoding the difference information. Similarly, the difference information needs to be added during decoding to obtain the video image. When encoding video based on a secondary compression algorithm, a complete I-frame is first encoded from adjacent image sequences. If the differences between subsequent video frames are not significant, they are encoded only according to the difference information, thus obtaining an image sequence composed of I-frames and P-frames. This image sequence is called a GOP (Group of Pictures). When a frame has a significant difference compared to a previous frame, the previous GOP ends and the next GOP begins. Therefore, a video may be compressed into multiple GOPs for authentication.
[0045] Overlapping video frame groups represent two adjacent video frame groups that contain M repeated video frames. Figure 2 This is a schematic diagram of an optional overlapping video frame group according to an embodiment of the present invention, such as... Figure 2 As shown, when dividing the video to be authenticated, an appropriate sliding window is selected to divide the video into overlapping video frame groups of length L. For example, a sliding window of length L=3 is selected, and starting from the first frame, the sliding window of length 3 is moved one frame to the right, dividing the video into overlapping video frame groups. Figure 2 In the middle video frame group, video frame 1, video frame 2, and video frame 3 form SW1, which is the overlapping video frame group 1; video frame 2, video frame 3, and video frame 4 form SW2, which is the overlapping video frame group 2; and video frame 4, video frame 5, and video frame 6 form SW4, which is the overlapping video frame group 4. Adjacent overlapping video frame groups contain two identical video frames.
[0046] Step S102: For each overlapping video frame group, calculate the residual noise of each P frame in the overlapping video frame group, and compare the residual noise of each P frame in the overlapping video frame group with the error value corresponding to the P frame to obtain the first comparison result of the overlapping video frame group.
[0047] It's important to note that in video processing, residual noise refers to the signal remaining after removing the main image content from a video frame. This typically includes noise components that weren't removed during image processing or compression. Residual noise can be used to detect whether a video has been edited or tampered with, because video editing or tampering introduces anomalies into the noise characteristics of the image. By monitoring and analyzing the residual noise features, intra-frame forgery can be identified. Based on a secondary compression algorithm, the residual noise of a P-frame is estimated from the residual noise of the video frames adjacent to the P-frame. Therefore, by monitoring the residual noise of the P-frame, intra-frame forgery in the video to be authenticated can be quickly identified.
[0048] Optionally, for each overlapping video frame group, the step of calculating the residual noise of each P-frame within the overlapping video frame group includes: for each overlapping video frame group, obtaining an I-frame in the overlapping video frame group, wherein the I-frame is a key frame in the video to be authenticated, and the key frame is a video frame containing complete image data; denoising the I-frame based on wavelet transform to obtain a denoised I-frame; calculating the difference data between the denoised I-frame and the I-frame before denoising to obtain the residual noise of the denoised I-frame; and calculating the residual noise of the P-frames adjacent to the I-frame based on the residual noise of the denoised I-frame.
[0049] It should be noted that in the process of calculating the residual noise of video frames, the I-frames in each overlapping video frame group are first determined. The I-frames contain complete image data. The I-frames are denoised by wavelet transform, and the noise residue of the denoised I-frames is calculated. Finally, the P-frames adjacent to the I-frames are obtained based on the I-frames. The residual noise of the P-frames is calculated based on the residual noise of the I-frames and the difference information between the P-frames and the I-frames.
[0050] Optionally, the steps for denoising the I-frame based on wavelet transform to obtain the denoised I-frame include: decomposing the I-frame to obtain grayscale images of the I-frame in the red RGB channel, green RGB channel, and blue RGB channel respectively; performing wavelet transform on the grayscale images of the red RGB channel, green RGB channel, and blue RGB channel of the I-frame respectively to obtain a set of frequency sub-bands corresponding to the I-frame, wherein the set of frequency sub-bands contains K frequency sub-bands of the I-frame, and the frequency sub-bands are the frequency components of the I-frame in the target direction under the target color channel; calculating the local variance of each frequency sub-band; denoising the frequency sub-bands based on the local variance to obtain the denoised frequency sub-bands, and calculating the wavelet coefficients of the denoised frequency sub-bands; and performing inverse wavelet transform on the wavelet coefficients of all denoised frequency sub-bands to obtain the denoised I-frame.
[0051] It should be noted that the embodiments of the present invention denoise the video frames by means of local variance. The purpose of denoising is to remove noise caused by environmental factors and other factors. The noise remaining after denoising is called residual noise. During denoising, the video frame is first decomposed into three color channels: red, green, and blue, resulting in grayscale images for each channel. Wavelet transform is applied to the grayscale image of each color channel, yielding multiple frequency sub-bands in the horizontal, vertical, and diagonal directions. These frequency sub-bands help separate different frequency components of the image, decomposing image information into frequency information for more accurate image content analysis. The wavelet coefficients of each sub-band are used to calculate the local variance, a measure of the degree of variation in pixel values within a specific region. High local variance usually indicates more detail or noise. After calculating the local variance of each frequency sub-band, the wavelet coefficients of each sub-band can be processed using a Wiener filter. Wiener filtering is a statistical method aimed at minimizing the mean square error between the original signal and the estimated signal, thus achieving denoising. This process is repeated for each frequency sub-band, and the denoised wavelet coefficients of each sub-band are calculated and subjected to inverse wavelet transform to obtain the denoised video frame. Furthermore, different weights can be assigned to different color channels based on their characteristics. The residual noise in each channel and the channel weight values are used to evaluate the overall noise residue of the video frame.
[0052] Specifically, the formula for calculating local variance can be expressed as: Where, σ 2 (i,j) represents the local variance of the frequency sub-band, c 2 (i,j) represents the high-frequency components of the frequency sub-band, and K is a constant. It controls the degree of noise suppression.
[0053] The wavelet coefficients for denoising obtained from the Wiener filter are expressed as follows: Where P(i,j) are the denoised wavelet coefficients.
[0054] Optionally, the step of calculating the residual noise of the P-frame adjacent to the I-frame based on the residual noise of the denoised I-frame includes: for any P-frame, selecting the I-frame adjacent to the P-frame as a reference frame; for each region block in the P-frame, obtaining the target region block in the reference frame that matches the region block in the P-frame; obtaining the pixel difference between the region block in the P-frame and the target region block in the reference frame through motion compensation; calculating the residual noise of each region block in the P-frame based on the pixel difference between the region block and the target region block and the residual noise of the denoised reference frame on each target region block, thus obtaining the residual noise of the P-frame.
[0055] It should be noted that during video encoding, depending on the video frame type (specifically including I-frames and P-frames), only two compression algorithms (I-frames and P-frames) are used to compare whether intra-frame forgery occurs between consecutive video frames. Due to the characteristics of P-frames, when an I-frame precedes a P-frame, the P-frame retains the differences between itself and the preceding I-frames; that is, only some areas show noise changes. By calculating a threshold for the noise changes in this area, it can be determined whether intra-frame forgery has occurred. For the intra-frame detection process, based on the redundancy between adjacent frames in the video segment, motion compensation is performed after encoding to achieve inter-frame prediction. This characteristic allows the noise residue of a P-frame to be calculated from the noise residue of adjacent video frames. In this process, the region blocks of a video frame can be divided into various sizes, such as 16*16 pixels, 16*8 pixels, 8*16 pixels, 8*8 pixels, 8*4 pixels, 4*8 pixels, and 4*4 pixels. Motion compensation for the region blocks of a video frame is performed independently. All region blocks are obtained by predicting the same region of the reference frame. That is, after the I-frame, the P-frame only needs to save the encoding information of the changed region blocks. The noise of this encoding information is different from that of the encoding information of the same region in the I-frame.
[0056] Specifically, for any P-frame, an I-frame adjacent to the P-frame is selected as a reference frame. If there is no I-frame adjacent to the P-frame, the noise residue of the P-frame can be calculated based on the predicted noise residue of the P-frame adjacent to the P-frame. For each region block in the P-frame, a target region block matching the region block in the P-frame is obtained in the reference frame. The pixel difference between the region block in the P-frame and the target region block in the reference frame is obtained through motion compensation. Then, based on the pixel difference between the region block and the target region block and the residual noise of the denoised reference frame on each target region block, the residual noise of each region block in the P-frame is calculated, and finally the total residual noise of the P-frame is obtained.
[0057] Step S103: If the first comparison result indicates that the residual noise of all P frames in the overlapping video frame group is less than or equal to the error value corresponding to the P frame, it is determined that there is no intra-frame forgery in the overlapping video frame group.
[0058] It should be noted that by detecting residual noise in P-frames, intra-frame forgery can be identified. Video editing and tampering can introduce abnormal noise characteristics into the video. If the residual noise of the P-frame remains within a normal fluctuation range, it indicates that the video is normal and there is no intra-frame forgery. Conversely, if the residual noise is not within a normal fluctuation range, intra-frame forgery exists, preventing abnormal users from logging in and accessing the video.
[0059] Optionally, the formula for calculating the error value is expressed as follows: in, A represents the error value corresponding to frame P, A represents the percentage of the error value corresponding to frame P, S represents the change region block between frame P and adjacent video frames, K represents the Kth change region block, K represents the average residual noise within the Kth change region block, and I represents the average residual noise of frame P.
[0060] It should be noted that the error value can be calculated based on the residual noise of the P-frame and the difference between the P-frame and adjacent frames. The percentage of the error value corresponding to the P-frame is calculated based on the noise residue and difference data of the P-frame, specifically expressed as follows:
[0061]
[0062] in, This represents the percentage of error value corresponding to frame P, S represents the change region block between frame P and its adjacent video frames, and K represents the Kth change region block. denoted as the average residual noise within the Kth change region block, and I represents the average noise of the P-frame.
[0063] The noise residue of the P-frame should be within the error value. Within the range, if noise residue of P-frames is detected... If the frame is within the range of 1, it indicates that there is no forgery within the video frame; otherwise, it indicates that forgery has occurred within the video frame.
[0064] Optionally, after obtaining the first comparison result of the overlapping video frame group, the method further includes: if the first comparison result indicates that the residual noise of any P frame in the overlapping video frame group is greater than the error value, determining that the overlapping video frame has intra-frame forgery; determining that the video to be authenticated has an anomaly based on the overlapping video frame with intra-frame forgery, generating an authentication failure result for the video to be authenticated with an anomaly, and returning the authentication result to the user terminal.
[0065] It should be noted that if the residual noise of any P-frame within an overlapping video frame group is greater than the error value, the overlapping video frame is determined to have intra-frame forgery and is marked. At the same time, if any overlapping video frame group in the video to be authenticated has intra-frame forgery, it indicates that the video to be authenticated is abnormal, and an authentication failure result is returned to the user terminal, and the abnormal user terminal's login and access are rejected.
[0066] Step S104: If there is no intra-frame forgery in any of the N overlapping video frame groups in the video to be authenticated, calculate the similarity value between every two overlapping video frame groups in the video to be authenticated.
[0067] It should be noted that if none of the overlapping video frame groups in the video to be authenticated contain intra-frame forgery, it indicates that there is no anomaly within the video frame to be authenticated, and inter-frame forgery detection continues. Since adjacent frames in the video have temporal continuity, inter-frame forgery will change the correlation between adjacent video frames. The noise correlation value of adjacent video frames is calculated as the frame group feature. Each overlapping video frame group is used as the query segment, and the similarity value between any two overlapping video frame groups is calculated to perform a similarity check. If the similarity value exceeds the specified threshold, it indicates that the two overlapping video frame groups may be duplicate video segments copied and pasted, that is, there is inter-frame forgery.
[0068] Optionally, the step of calculating the similarity value of every two overlapping video frame groups within the video to be authenticated includes: for each overlapping video frame, combining two adjacent video frames in the overlapping video frame to obtain a video frame pair; calculating the noise association value of the video frame pair, and concatenating the noise association values of all video frame pairs in the overlapping video frame to obtain the noise vector of the overlapping video frame; calculating the similarity value based on the noise vector of any two overlapping video frames in the video to be authenticated to obtain the similarity value of every two overlapping video frame groups within the video to be authenticated.
[0069] First, adjacent video frames in the overlapping video frames are combined to obtain video frame pairs. The noise correlation value of the video frame pairs is then calculated. Specifically, the formula for calculating the noise correlation value is as follows:
[0070]
[0071] Where S is the noise correlation value, r represents the r-th video frame, and W r (x,y) is the residual noise value of video frame r at coordinates (x,y). It is the average value of the residual noise in video frame r.
[0072] Use e i To represent the correlation between video frame pairs within the i-th overlapping video frame group, the noise vector of the i-th overlapping video frame group can be obtained based on the calculation of the noise correlation value.
[0073] The similarity value between two overlapping video frame groups is calculated based on the noise vectors of any two overlapping video frames in the video to be authenticated. The formula for calculating the similarity value can be expressed as:
[0074]
[0075] Among them, u i and v i It is a noise vector and The i-th element, γ u and γ vIt is a noise vector and The mean.
[0076] Step S105: Compare the similarity value of every two overlapping video frame groups in the video to be certified with the similarity threshold to obtain the second comparison result, and determine the certification result of the video to be certified based on the second comparison result.
[0077] Optionally, the step of determining the authentication result of the video to be authenticated based on the second comparison result includes: if the similarity value of any two overlapping video frame groups in the video to be authenticated is greater than the similarity threshold as indicated by the second comparison result, determining that there is inter-frame forgery between the two overlapping video frame groups; determining that there is an anomaly in the video to be authenticated based on the overlapping video frame groups with inter-frame forgery, generating an authentication failure result for the video to be authenticated with an anomaly, and returning the authentication result to the user terminal.
[0078] It should be noted that after calculating the similarity value of any two overlapping video frame groups, the similarity value of every two overlapping video frame groups in the video to be authenticated is compared with a similarity threshold. If the similarity value of any two overlapping video frame groups in the video to be authenticated is greater than the similarity threshold, it is determined that there is inter-frame forgery in these two overlapping video frame groups, thus determining that the video to be authenticated is abnormal. An authentication failure result is returned to the user, and the login and access of the abnormal user are rejected. Conversely, if there are no similar overlapping video frame groups in the video to be authenticated, it indicates that the video to be authenticated is not abnormal, and an authentication success result is returned, and the login or access request of the user is approved.
[0079] In this embodiment, the following steps are performed: First, the encoded video to be authenticated is acquired and divided into N overlapping video frame groups. The video to be authenticated is encoded using a double compression algorithm. An overlapping video frame group means that there are M repeated video frames between two adjacent video frame groups, where M and N are both positive integers. Then, for each overlapping video frame group, the residual noise of each P frame in the overlapping video frame group is calculated, and the residual noise of each P frame in the overlapping video frame group is compared with the error value corresponding to the P frame to obtain the first comparison result of the overlapping video frame group. Here, the P frame represents the forward prediction frame. The test frame represents a video frame containing the pixel differences between the current frame and the previous frame. If the first comparison result indicates that the residual noise of all P frames in the overlapping video frame group is less than or equal to the error value corresponding to the P frame, it is determined that there is no intra-frame forgery in the overlapping video frame group. If there is no intra-frame forgery in any of the N overlapping video frame groups in the video to be certified, the similarity value of every two overlapping video frame groups in the video to be certified is calculated. Finally, the similarity value of every two overlapping video frame groups in the video to be certified is compared with the similarity threshold to obtain the second comparison result. The certification result of the video to be certified is determined based on the second comparison result.
[0080] In this embodiment, when authenticating a video, the video to be authenticated is divided into N overlapping video frame groups. These overlapping video frame groups are used as the detection objects. Residual noise in P frames within each group is calculated and compared with a preset error value, enabling precise detection of intra-frame tampering. Simultaneously, the similarity value between video frame groups is calculated and compared with a set similarity threshold, allowing detection of inter-frame tampering. This eliminates the need for frame-by-frame video inspection, effectively reducing computational load and improving detection efficiency while maintaining high accuracy in intra- and inter-frame forgery detection. This solves the technical problem in related technologies where video authentication requires frame-by-frame inspection, resulting in low detection efficiency.
[0081] The embodiments of the present invention will be described in more detail below with reference to specific examples.
[0082] Example 1:
[0083] During a user login process, an authentication video is obtained, which includes the user's head-shaking motion. The video device used to record the authentication video digitizes it (e.g., using common H.264 encoding). The main purpose of encoding is to reduce the size of the video data for easier storage and transmission. The authentication video is then tested using the aforementioned authentication method. The specific steps include:
[0084] Step 1: Based on the received encoded video, which can be in IP-...-P frame format, the encoded video is divided into several overlapping video frame groups; this division of video frame groups is used for detection between subsequent video frames.
[0085] Step 2: Noise extraction is performed on the I-frame of the video. Wavelet transform is used to extract noise features on each channel through the RGB color channels. Noise extraction is achieved through local variance calculation and Wiener filter denoising. The noise of the P-frame is synthesized based on the noise changes in its changing regions. In the secondary compression algorithm, the error value of the noise change in the regions between the I-frame and P-frame is calculated. Whether the noise change is within the error value is used to determine if forgery has occurred within the frame. Specifically: if in consecutive I-frames and P-frames, the I-frame is a frontal image of the user, while the P-frame is the image of the user shaking their head, and during the detection process, the deflection angle of the image of the user shaking their head is too large, then the error value during noise extraction will be too large (for example, if the video frame is divided into 0.0833s, the normal head-shaking deflection angle is 0-15°). In this case, it can be considered that intra-frame forgery has occurred.
[0086] Step 3: If no forgery occurs within a video frame, group several video frames together and merge their noise to calculate the similarity between video frame groups. This similarity is used to determine the connection between video frames. In consecutive video frames, the previous video frame is related to the current video frame and the next video frame. In this embodiment, three video frames are grouped together. Since the first video frame group has been detected as free of intra-frame forgery using a secondary compression algorithm, the first video frame group is used as the unit. Subsequent video frames are then detected in the form of video frame groups. Because adjacent frames in a video have temporal continuity, forgery operations between video frames will change the correlation between adjacent frames. The correlation of adjacent noise is extracted as a frame group feature representation. Each overlapping video frame group is used as a query segment, and the similarity value between overlapping video frame groups is calculated for similarity checks. If the similarity exceeds a specified threshold, the corresponding subgroup is selected as a candidate for a forgery group. The existence of forged video frames is determined by analyzing the feature continuity of adjacent frames. Specifically: In the aforementioned authentication video of the head-shaking motion, discontinuous motions appeared in frames P5 and P6. Therefore, the correlation between video frame group 5 and video frame group 6 would be significantly different, thus detecting that P6 is an inserted video frame.
[0087] Step 4: To determine the similarity between the obtained overlapping video frame groups, calculate the similarity between each group and all other groups, and combine these values to form an n*n dimensional correlation matrix C. Therefore, in each row of matrix C, maintain the similarity value between the frame group and other frame groups. After calculating the similarity values between all overlapping video frame groups, matrix C is further simplified to obtain the final matrix; if the similarity value is greater than a specified similarity threshold tha, then both related video frame groups are considered duplicate forgeries. This step detects another case of synthesized authentication videos, namely, video frame copying and pasting. Specifically: if the similarity of a video frame group before and after the authentication video is 1, it is determined to be a copy-paste of video frames. A similarity of 1 indicates that the video frames within the frame group are completely identical.
[0088] Example 2:
[0089] In the application scenario of a digital campus, a video authentication system is used to detect the security of the video to be authenticated. The video authentication system includes video equipment, a data center, and a testing center. The video equipment is equivalent to the user's login device, such as the camera of an electronic product like a mobile phone or computer, used to capture the authentication video. The data center can be composed of various campus platform login systems. It issues the instruction to capture the authentication video through instruction processing, and simultaneously receives the authentication video uploaded by the video equipment and transmits it to the testing center. The testing center is used to implement the above-mentioned digital campus platform security authentication method based on image processing. It detects the authenticity of the video by identifying fake videos. The detection content includes intra-frame detection and inter-frame detection. Intra-frame detection is mainly used to detect whether AI face swapping occurs, and inter-frame detection is used to detect whether video synthesis occurs.
[0090] When students, parents, or staff log in using image-based video authentication, the specific process is as follows:
[0091] Video Recording: After a user chooses to log in using video authentication, the data center will require the user to record a short video. This video may include requiring the user to say a specific password or perform a specific action.
[0092] Video Upload: The recorded video will be uploaded to the data center and transmitted to the testing center for processing.
[0093] Image processing: The detection center uses image processing techniques, including video compression algorithms, wavelet transform, noise extraction, and correlation calculation, to process the video.
[0094] Noise extraction: Perform wavelet transform on the video frames to extract noise information.
[0095] Secondary compression algorithm: In the secondary compression algorithm, since the noise of P-frames can be estimated from I-frames in the GOP image group, the error value between I-frames and P-frames is used to determine whether there is forgery between frames.
[0096] Correlation calculation: Calculate the similarity between groups of video frames to determine whether there is any composite data between video frames.
[0097] Login Permission: If the video passes the authenticity verification, the user will be authorized to log in to the campus platform to perform related operations; otherwise, the detection center will issue an alarm and restrict the login of the video device.
[0098] The entire authentication process uses image processing technology to ensure the authenticity of the video. The system checks for noise and correlation between video frames to determine the video's validity. This authentication process makes identity verification for students, parents, and staff using video login more secure and reliable, thereby ensuring the security of the campus platform.
[0099] The following is a detailed description with reference to another embodiment.
[0100] Example 2
[0101] The video authentication device based on image processing provided in this embodiment includes multiple implementation units, each of which corresponds to a specific implementation step in the above embodiment one. The specific implementation method and beneficial effects can be referred to the foregoing method embodiment, and will not be repeated here.
[0102] Figure 3 This is a schematic diagram of an optional image processing-based video authentication device according to an embodiment of the present invention, such as... Figure 3 As shown, the image processing-based video authentication device may include: an acquisition unit 31, a first calculation unit 32, a determination unit 33, a second calculation unit 34, and a comparison unit 35, wherein,
[0103] The acquisition unit 31 is used to acquire the encoded video to be authenticated and divide the video to be authenticated into N overlapping video frame groups. The video to be authenticated is encoded based on a secondary compression algorithm. The overlapping video frame group means that there are M repeated video frames between two adjacent video frame groups, where M and N are both positive integers.
[0104] The first calculation unit 32 is used to calculate the residual noise of each P frame in the overlapping video frame group for each overlapping video frame group, and compare the residual noise of each P frame in the overlapping video frame group with the error value corresponding to the P frame to obtain the first comparison result of the overlapping video frame group. Here, the P frame represents the forward prediction frame, and the forward prediction frame represents the video frame containing the pixel difference between the current frame and the previous frame.
[0105] The determining unit 33 is used to determine that there is no intra-frame forgery in the overlapping video frame group when the first comparison result indicates that the residual noise of all P frames in the overlapping video frame group is less than or equal to the error value corresponding to the P frame.
[0106] The second calculation unit 34 is used to calculate the similarity value of every two overlapping video frame groups in the video to be authenticated, provided that there is no intra-frame forgery in any of the N overlapping video frame groups in the video to be authenticated.
[0107] The comparison unit 35 is used to compare the similarity value of every two overlapping video frame groups in the video to be certified with the similarity threshold to obtain a second comparison result, and to determine the certification result of the video to be certified based on the second comparison result.
[0108] The aforementioned image processing-based video authentication device acquires the encoded video to be authenticated through the acquisition unit 31 and divides the video to be authenticated into N overlapping video frame groups. The video to be authenticated is encoded using a double compression algorithm. An overlapping video frame group represents two adjacent video frame groups containing M repeated video frames, where M and N are both positive integers. For each overlapping video frame group, the first calculation unit 32 calculates the residual noise of each P-frame within the overlapping video frame group and compares the residual noise of each P-frame with the error value corresponding to the P-frame to obtain the first comparison result of the overlapping video frame group. Here, the P-frame represents the forward prediction frame, and the forward prediction frame represents the packet... The video frame containing the pixel difference between the current frame and the previous frame; the determining unit 33 determines that there is no intra-frame forgery in the overlapping video frame group when the residual noise of all P frames in the first comparison result is less than or equal to the error value corresponding to the P frame; the second calculation unit 34 is used to calculate the similarity value of every two overlapping video frame groups in the video to be certified when there is no intra-frame forgery in the N overlapping video frame groups in the video to be certified; the comparison unit 35 is used to compare the similarity value of every two overlapping video frame groups in the video to be certified with a similarity threshold to obtain a second comparison result, and determine the certification result of the video to be certified based on the second comparison result.
[0109] In this embodiment, when authenticating a video, the video to be authenticated is divided into N overlapping video frame groups. These overlapping video frame groups are used as the detection objects. Residual noise in P frames within each group is calculated and compared with a preset error value, enabling precise detection of intra-frame tampering. Simultaneously, the similarity value between video frame groups is calculated and compared with a set similarity threshold, allowing detection of inter-frame tampering. This eliminates the need for frame-by-frame video inspection, effectively reducing computational load and improving detection efficiency while maintaining high accuracy in intra- and inter-frame forgery detection. This solves the technical problem in related technologies where video authentication requires frame-by-frame inspection, resulting in low detection efficiency.
[0110] Optionally, the first calculation unit 32 includes: a first acquisition module, configured to acquire I-frames in each overlapping video frame group, wherein the I-frame is a key frame in the video to be authenticated, and the key frame is a video frame containing complete image data; a first denoising module, configured to denoise the I-frame based on wavelet transform to obtain a denoised I-frame; a first calculation module, configured to calculate the difference data between the denoised I-frame and the I-frame before denoising to obtain the residual noise of the denoised I-frame; and a second calculation module, configured to calculate the residual noise of P-frames adjacent to the I-frame based on the residual noise of the denoised I-frame.
[0111] Optionally, the first denoising module further includes: a first decomposition submodule, used to decompose the I-frame to obtain grayscale images of the I-frame in the red RGB channel, green RGB channel, and blue RGB channel, respectively; a first transformation submodule, used to perform wavelet transform on the grayscale images of the red RGB channel, green RGB channel, and blue RGB channel of the I-frame, respectively, to obtain a set of frequency subbands corresponding to the I-frame, wherein the set of frequency subbands contains K frequency subbands of the I-frame, and the frequency subbands are the frequency components of the I-frame in the target direction under the target color channel; a first calculation submodule, used to calculate the local variance of each frequency subband; a first denoising submodule, used to perform denoising processing on the frequency subbands based on the local variance to obtain denoised frequency subbands, and calculate the wavelet coefficients of the denoised frequency subbands; and a second transformation submodule, used to perform inverse wavelet transform on the wavelet coefficients of all denoised frequency subbands to obtain the denoised I-frame.
[0112] Optionally, the first calculation module includes: a first selection submodule, used to select an I-frame adjacent to any P-frame as a reference frame; a first acquisition submodule, used to acquire a target region block in the reference frame that matches the region block in the P-frame for each region block in the P-frame; a second acquisition submodule, used to acquire the pixel difference between the region block in the P-frame and the target region block in the reference frame through motion compensation; and a second calculation submodule, used to calculate the residual noise of each region block in the P-frame based on the pixel difference between the region block and the target region block and the residual noise of the denoised reference frame on each target region block, thereby obtaining the residual noise of the P-frame.
[0113] Optionally, the second calculation unit 34 includes: a first combination module, used to combine two adjacent video frames in each overlapping video frame to obtain a video frame pair; a third calculation module, used to calculate the noise association value of the video frame pair and concatenate the noise association values of all video frame pairs in the overlapping video frames to obtain the noise vector of the overlapping video frame; and a fourth calculation module, used to calculate the similarity value based on the noise vector of any two overlapping video frames in the video to be authenticated, to obtain the similarity value of every two overlapping video frame groups in the video to be authenticated.
[0114] Optionally, the image processing-based video authentication device further includes: a first determining module, configured to determine that the overlapping video frame has intra-frame forgery when the first comparison result indicates that the residual noise of any P frame in the overlapping video frame group is greater than the error value; and a first generating module, configured to determine that the video to be authenticated is abnormal based on the overlapping video frame with intra-frame forgery, generate an authentication failure result for the video to be authenticated with the abnormality, and return the authentication result to the user terminal.
[0115] Optionally, the determining unit 33 includes: a second determining module, used to determine that there is inter-frame forgery between two overlapping video frame groups when the similarity value of any two overlapping video frame groups in the video to be authenticated is greater than the similarity threshold indicated by the second comparison result; and a third determining module, used to determine that there is an anomaly in the video to be authenticated based on the overlapping video frame groups with inter-frame forgery, generate an authentication failure result for the video to be authenticated with an anomaly, and return the authentication result to the user terminal.
[0116] Optionally, the formula for calculating the error value is expressed as follows: in, A represents the error value corresponding to frame P. This represents the percentage of error value corresponding to frame P, S represents the change region block between frame P and its adjacent video frames, and K represents the Kth change region block. denoted as the average residual noise within the Kth change region block, and I represents the average residual noise of the P-frame.
[0117] The aforementioned image processing-based video authentication device may also include a processor and a memory. The aforementioned acquisition unit 31, first calculation unit 32, determination unit 33, second calculation unit 34, comparison unit 35, etc., are all stored in the memory as program units, and the processor executes the aforementioned program units stored in the memory to realize the corresponding functions.
[0118] The aforementioned processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and video security authentication can be performed by adjusting kernel parameters.
[0119] The aforementioned memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash memory, and the memory includes at least one memory chip.
[0120] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored computer program, wherein, when the computer program is running, it controls the device where the computer-readable storage medium is located to execute any of the above-described image processing-based video authentication methods.
[0121] According to another aspect of the present invention, an electronic device is also provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement any of the above-described image processing-based video authentication methods.
[0122] According to another aspect of the present invention, a computer program product is also provided, the computer program product including a computer program, wherein the computer program, when executed by a processor, implements any of the above-described image processing-based video authentication methods.
[0123] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program with the following method steps: acquiring the encoded video to be authenticated, and dividing the video to be authenticated into N overlapping video frame groups, wherein the video to be authenticated is encoded based on a double compression algorithm, and the overlapping video frame group means that there are M repeated video frames between two adjacent video frame groups, where M and N are both positive integers; for each overlapping video frame group, calculating the residual noise of each P frame in the overlapping video frame group, and comparing the residual noise of each P frame in the overlapping video frame group with the error value corresponding to the P frame to obtain the first comparison result of the overlapping video frame group. Here, P-frames represent forward prediction frames, which are video frames containing the pixel differences between the current frame and the previous frame. If the first comparison result indicates that the residual noise of all P-frames within the overlapping video frame group is less than or equal to the error value corresponding to the P-frame, it is determined that there is no intra-frame forgery in the overlapping video frame group. If there is no intra-frame forgery in any of the N overlapping video frame groups in the video to be authenticated, the similarity value between every two overlapping video frame groups in the video to be authenticated is calculated. The similarity value between every two overlapping video frame groups in the video to be authenticated is compared with a similarity threshold to obtain a second comparison result. Based on the second comparison result, the authentication result of the video to be authenticated is determined.
[0124] This application also provides a computer program product, which, when executed on a data processing device, is further adapted to execute an initialization program having the following method steps: for each overlapping video frame group, the step of calculating the residual noise of each P-frame within the overlapping video frame group includes: for each overlapping video frame group, obtaining an I-frame in the overlapping video frame group, wherein the I-frame is a key frame in the video to be authenticated, and the key frame is a video frame containing complete image data; denoising the I-frame based on wavelet transform to obtain a denoised I-frame; calculating the difference data between the denoised I-frame and the I-frame before denoising to obtain the residual noise of the denoised I-frame; and calculating the residual noise of the P-frames adjacent to the I-frame based on the residual noise of the denoised I-frame.
[0125] This application also provides a computer program product, which, when executed on a data processing device, is also suitable for executing an initialization program with the following method steps: denoising an I-frame based on wavelet transform to obtain a denoised I-frame includes: decomposing the I-frame to obtain grayscale images of the I-frame in the red RGB channel, green RGB channel, and blue RGB channel respectively; performing wavelet transform on the grayscale images of the red RGB channel, green RGB channel, and blue RGB channel of the I-frame respectively to obtain a set of frequency sub-bands corresponding to the I-frame, wherein the set of frequency sub-bands contains K frequency sub-bands of the I-frame, and the frequency sub-bands are the frequency components of the I-frame in the target direction under the target color channel; calculating the local variance of each frequency sub-band; denoising the frequency sub-band based on the local variance to obtain the denoised frequency sub-band, and calculating the wavelet coefficients of the denoised frequency sub-band; and performing inverse wavelet transform on the wavelet coefficients of all denoised frequency sub-bands to obtain the denoised I-frame.
[0126] This application also provides a computer program product, which, when executed on a data processing device, is also suitable for executing a program that initializes the following steps: the step of calculating the residual noise of a P-frame adjacent to the I-frame based on the residual noise of the denoised I-frame includes: for any P-frame, selecting an I-frame adjacent to the P-frame as a reference frame; for each region block within the P-frame, obtaining a target region block in the reference frame that matches the region block within the P-frame; obtaining the pixel difference between the region block within the P-frame and the target region block in the reference frame through motion compensation; calculating the residual noise of each region block within the P-frame based on the pixel difference between the region block and the target region block and the residual noise of the denoised reference frame on each target region block, thereby obtaining the residual noise of the P-frame.
[0127] This application also provides a computer program product, which, when executed on a data processing device, is also suitable for executing an initialization program having the following method steps: the step of calculating the similarity value of every two overlapping video frame groups within the video to be authenticated includes: for each overlapping video frame, combining two adjacent video frames in the overlapping video frame to obtain a video frame pair; calculating the noise association value of the video frame pair, and concatenating the noise association values of all video frame pairs in the overlapping video frame to obtain a noise vector of the overlapping video frame; calculating a similarity value based on the noise vector of any two overlapping video frames in the video to be authenticated, to obtain the similarity value of every two overlapping video frame groups within the video to be authenticated.
[0128] This application also provides a computer program product, which, when executed on a data processing device, is further adapted to execute an initialization program having the following method steps: after obtaining a first comparison result of an overlapping video frame group, the program further includes: if the first comparison result indicates that the residual noise of any P-frame in the overlapping video frame group is greater than the error value, determining that the overlapping video frame has intra-frame forgery; determining that the video to be authenticated is abnormal based on the overlapping video frame with intra-frame forgery, generating an authentication failure result for the video to be authenticated with the abnormality, and returning the authentication result to the user terminal.
[0129] This application also provides a computer program product, which, when executed on a data processing device, is also suitable for executing an initialization program having the following method steps: the step of determining the authentication result of the video to be authenticated based on the second comparison result includes: if the second comparison result indicates that the similarity value of any two overlapping video frame groups within the video to be authenticated is greater than a similarity threshold, determining that there is inter-frame forgery between the two overlapping video frame groups; determining that there is an anomaly in the video to be authenticated based on the overlapping video frame groups with inter-frame forgery, generating an authentication failure result for the video to be authenticated with the anomaly, and returning the authentication result to the user terminal.
[0130] This application also provides a computer program product, which, when executed on a data processing device, is also suitable for executing a program with the following initialization method steps: the formula for calculating the error value is expressed as: in, A represents the error value corresponding to frame P. The value represents the percentage of error corresponding to frame P, S represents the change region block between frame P and adjacent video frames, K represents the Kth change region block, K represents the average residual noise within the Kth change region block, and I represents the average residual noise of frame P.
[0131] Figure 4 This is a hardware structure block diagram of an electronic device (or mobile device) according to an embodiment of the image processing-based video authentication method of the present invention. Figure 4 As shown, an electronic device may include one or more ( Figure 4 The processor 402 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and the memory 404 for storing data may also be included. In addition, it may include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a keyboard, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 4 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, the electronic device may also include components that are more... Figure 4 The more or fewer components shown, or having the same Figure 4 The different configurations shown.
[0132] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0133] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0134] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0135] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0136] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0137] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0138] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A video authentication method based on image processing, characterized in that, The method comprises the following steps: acquire an encoded video to be authenticated, and divide the video to be authenticated into N overlapping video frame groups, wherein the video to be authenticated is encoded based on a secondary compression algorithm, and the overlapping video frame groups represent that M repeated video frames are contained between adjacent two video frame groups, and M and N are positive integers; for each overlapping video frame group, calculate the residual noise of each P frame in the overlapping video frame group, and compare the residual noise of each P frame in the overlapping video frame group with the error value corresponding to the P frame to obtain a first comparison result of the overlapping video frame group, wherein the P frame represents a forward prediction frame, and the forward prediction frame represents a video frame containing the pixel difference between the current frame and the previous frame; in the case that the first comparison result indicates that the residual noise of all P frames in the overlapping video frame group is less than or equal to the error value corresponding to the P frame, it is determined that there is no intra-frame forgery in the overlapping video frame group; in the case that there is no intra-frame forgery in N overlapping video frame groups in the video to be authenticated, calculate the similarity value of each two overlapping video frame groups in the video to be authenticated; compare the similarity value of each two overlapping video frame groups in the video to be authenticated with a similarity threshold to obtain a second comparison result, and determine the authentication result of the video to be authenticated based on the second comparison result.
2. The video authentication method of claim 1, wherein, The step of calculating the residual noise of each P frame in the overlapping video frame group comprises: for each overlapping video frame group, acquire an I frame in the overlapping video frame group, wherein the I frame is a key frame in the video to be authenticated, and the key frame is a video frame containing complete image data; de-noise the I frame based on wavelet transform to obtain a de-noised I frame; calculate the difference data between the de-noised I frame and the I frame before de-noising to obtain the residual noise of the de-noised I frame; calculate the residual noise of the P frame adjacent to the I frame based on the residual noise of the de-noised I frame.
3. The video authentication method of claim 2, wherein, The step of de-noising the I frame based on wavelet transform to obtain a de-noised I frame comprises: decompose the I frame to obtain a gray image of the I frame in a red RGB channel, a green RGB channel and a blue RGB channel respectively; perform wavelet transform on the gray image of the I frame in the red RGB channel, the gray image of the I frame in the green RGB channel and the gray image of the I frame in the blue RGB channel respectively to obtain a frequency sub-band set corresponding to the I frame, wherein the frequency sub-band set contains K frequency sub-bands of the I frame, and the frequency sub-band is a frequency component of the I frame in a target direction under a target color channel; for each frequency sub-band, calculate the local variance of the frequency sub-band; perform de-noising processing on the frequency sub-band based on the local variance to obtain a de-noised frequency sub-band, and calculate the wavelet coefficient of the de-noised frequency sub-band; perform inverse wavelet transform on the wavelet coefficients of all de-noised frequency sub-bands to obtain a de-noised I frame.
4. The video authentication method of claim 2, wherein, The step of calculating the residual noise of the P frame adjacent to the I frame based on the residual noise of the de-noised I frame comprises: for any P frame, select an I frame adjacent to the P frame as a reference frame; For each region block in the P frame, a target region block matching the region block in the P frame is obtained in the reference frame; A pixel difference between the region block in the P frame and the target region block in the reference frame is obtained through motion compensation; Residual noise of each region block in the P frame is calculated based on the pixel difference between the region block and the target region block and residual noise of the reference frame after denoising on each target region block, to obtain residual noise of the P frame.
5. The video authentication method of claim 1, wherein, The step of calculating the similarity value of each two overlapping video frame groups in the video to be authenticated comprises: For each of the overlapping video frame groups, two adjacent video frames in the overlapping video frame group are combined to obtain a video frame pair; A noise correlation value of the video frame pair is calculated, and noise correlation values of all video frame pairs in the overlapping video frame group are spliced to obtain a noise vector of the overlapping video frame group; The similarity value is calculated based on the noise vector of any two overlapping video frame groups in the video to be authenticated, to obtain the similarity value of each two overlapping video frame groups in the video to be authenticated.
6. The video authentication method of claim 1, wherein, After obtaining the first comparison result of the overlapping video frame group, further comprising: In the case that the first comparison result indicates that the residual noise of any P frame in the overlapping video frame group is greater than the error value, it is determined that the overlapping video frame group has video frame intra-forgery; Based on the overlapping video frame group with video frame intra-forgery, it is determined that the video to be authenticated has an anomaly, an authentication failure authentication result is generated for the video to be authenticated with the anomaly, and the authentication result is returned to the user end.
7. The video authentication method of claim 1, wherein, The step of determining the authentication result of the video to be authenticated based on the second comparison result comprises: In the case that the second comparison result indicates that the similarity value of any two overlapping video frame groups in the video to be authenticated is greater than a similarity threshold value, it is determined that the two overlapping video frame groups have video frame inter-forgery; Based on the overlapping video frame group with video frame inter-forgery, it is determined that the video to be authenticated has an anomaly, an authentication failure authentication result is generated for the video to be authenticated with the anomaly, and the authentication result is returned to the user end.
8. An image processing based video authentication apparatus, characterized by, Comprise: An acquisition unit is configured to acquire an encoded video to be authenticated, and divide the video to be authenticated into N overlapping video frame groups, wherein the video to be authenticated is encoded based on a secondary compression algorithm, and the overlapping video frame group indicates that M repeated video frames are contained between adjacent two video frame groups, and M and N are both positive integers; A first calculation unit is configured to calculate residual noise of each P frame in each of the overlapping video frame groups, and compare the residual noise of each P frame in the overlapping video frame group with an error value corresponding to the P frame, to obtain a first comparison result of the overlapping video frame group, wherein the P frame indicates a forward prediction frame, and the forward prediction frame indicates a video frame containing pixel differences between a current frame and a previous frame; A determination unit is configured to determine that the overlapping video frame group does not have intra-forgery in the case that the first comparison result indicates that residual noise of all P frames in the overlapping video frame group is less than or equal to the error value corresponding to the P frame. a second calculation unit, configured to calculate a similarity value of each two of the overlapping video frame groups in the video to be authenticated in a case where there is no in-frame forgery in the N overlapping video frame groups in the video to be authenticated; a comparison unit, configured to compare the similarity value of each two of the overlapping video frame groups in the video to be authenticated with a similarity threshold to obtain a second comparison result, and determine an authentication result of the video to be authenticated based on the second comparison result.
9. An electronic device, comprising: one or more processors and a memory, the memory being configured to store one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the image processing-based video authentication method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Monitoring video traceability processing method and system, storage medium and video monitoring terminal
CN111553848A
Forgery video detection method and device and electronic equipment
CN117252796A