Reversible image authentication method and system based on prediction error expansion

By adopting the two-layer embedding method of prediction error expansion in image authentication, using two methods of difference expansion and prediction error histogram translation, almost all blocks are independently embedded, which solves the problem of low information loss and detection accuracy in the prior art, and achieves higher tamper detection accuracy and reversible recovery capabilities.

CN114565500BActive Publication Date: 2025-03-14SUN YAT SEN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210201010.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-02
Publication Date
2025-03-14
Estimated Expiration
2042-03-02

AI Technical Summary

Technical Problem

The existing reversible image authentication methods have problems such as loss of information and low detection accuracy when embedding authentication information, especially when the number of non-embedible blocks is large.

Method used

The two-layer embedding method based on prediction error expansion is adopted. Through two reversible embedding methods, the difference value expansion and prediction error histogram translation are used to embed almost all blocks independently to ensure that more authentication information is embedded under the same block size.

Benefits of technology

It improves the initial accuracy of tamper detection, ensures that each block can independently achieve authentication and reversible recovery, and reduces information loss and space occupation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114565500B_ABST
    Figure CN114565500B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image information security, and is a reversible image authentication method and system based on prediction error expansion, comprising the steps of: dividing an image into a number of non-overlapping image blocks, dividing pixels in the blocks into a gray set and a white set; calculating an authentication code for each block; respectively calculating the prediction errors of the gray set and the white set pixels in all blocks, and defining the blocks as differential blocks or translation blocks according to the embedding capacity; embedding the authentication code in the differential block by using the difference expansion method; embedding the authentication code in the translation block by using the prediction error histogram translation method; extracting the embedded authentication code from each block in turn and restoring the block according to the inverse operation of the embedding method, comparing the extracted authentication code with the regenerated authentication code, and judging whether the image has been tampered with. The present invention adopts two different reversible embedding methods, and can independently perform reversible authentication on almost all blocks, embed more authentication information under the same block size, and can achieve a higher tampering detection accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image information security, and in particular to a reversible image authentication method based on prediction error expansion. Background Art

[0002] With the rapid development of the Internet and multimedia technology, a large number of digital images are stored and transmitted on the Internet. At the same time, there are more and more image processing software. Criminals can easily tamper with digital images using these software tools. How to effectively authenticate the originality and integrity of images is an urgent problem to be solved.

[0003] In order to achieve the protection of specific images, fragile watermark is a common image authentication method. By embedding a fragile watermark in the image to be protected in advance, and then extracting the embedded fragile watermark from the image during authentication to detect tampering. Most common fragile watermark methods use lossy information embedding methods, which will destroy certain visual and auditory characteristics of the original carrier while embedding information, resulting in the loss of information of the original carrier image. Reversible image authentication is the application of reversible information hiding technology to the field of fragile authentication. Compared with ordinary fragile watermarks, it can not only realize image authentication, but also restore the original carrier image without distortion. It is of great significance in some application scenarios with strict requirements on image quality, such as medicine, justice, military and other fields. Most of the existing reversible image authentication methods are based on block segmentation. Although they can effectively authenticate images, they still have several shortcomings: first, the authentication information is embedded in a lossy manner for non-embeddable blocks, and its original information needs to be stored in embeddable blocks to achieve reversible recovery. When the number of non-embeddable blocks is large, this part of information will take up a large space; second, the redundancy of the image is not fully utilized, and less authentication information is embedded in the block, resulting in a low initial detection accuracy. Summary of the invention

[0004] The present invention provides a reversible image authentication method and system based on prediction error expansion. Compared with the existing reversible image authentication technology, the present invention adopts two different reversible embedding methods on the one hand, and can independently perform reversible authentication on almost all blocks; on the other hand, the two-layer embedding method can ensure that more authentication information is embedded under the same block size, which can achieve a higher tampering detection accuracy.

[0005] The method of the present invention is implemented by the following technical solution: a reversible image authentication method based on prediction error expansion, comprising the following steps:

[0006] S1, dividing the image into a number of non-overlapping image blocks, each of which has the same size, and dividing the pixels in the image blocks into a gray set and a white set according to a checkerboard pattern, wherein the image blocks of the gray set and the image blocks of the white set are arranged alternately;

[0007] S2, calculating the authentication code of each image block according to the hash function;

[0008] S3, calculating the prediction errors of all image block pixels in the gray set, and defining the image blocks as difference blocks or translation blocks according to the embedding capacity;

[0009] S4. For the difference block, the authentication code is embedded in the difference expansion method; for the pixels that generate overflow, their position information and overflow amount are sequentially saved in binary form in the dynamic array S = {s1, s2, ..., s n}; repeat this step until all image blocks in the set are processed;

[0010] S5, for the translation block, the authentication code is embedded by using the prediction error histogram translation method; for the translation block with capacity V<3, only the authentication code is embedded; for the translation block with capacity V≥3, in addition to embedding V-1 bit authentication code, 1 bit is taken out from the dynamic array S in step S4 in turn for embedding; this step is repeated until all image blocks in the set are processed;

[0011] S6, calculating the prediction errors of all image block pixels in the white set, defining the image blocks as differential blocks or translation blocks according to the embedding capacity; and executing steps S4-S5 until all image blocks complete the two-layer embedding operation;

[0012] S7. In the authentication stage, according to the inverse operation of the embedding method, the embedded authentication code is extracted from each image block in turn and the image block is restored. The extracted authentication code is compared with the regenerated authentication code. If they are the same, the image is judged to be a real image. If they are different, the image is judged to be tampered with.

[0013] The system of the present invention adopts the following technical solutions to achieve: a reversible image authentication system based on prediction error expansion, including the following modules:

[0014] A division module is used to divide the image into a number of non-overlapping image blocks, each of which has the same size, and divide the pixels in the image blocks into a gray set and a white set according to a checkerboard pattern, wherein the image blocks of the gray set and the image blocks of the white set are arranged alternately;

[0015] An authentication code calculation module, used for calculating an authentication code of each image block according to a hash function;

[0016] The gray set classification module calculates the prediction errors of all image block pixels in the gray set and defines the image blocks as difference blocks or translation blocks according to the embedding capacity;

[0017] The white set classification module calculates the prediction errors of all image block pixels in the white set and defines the image blocks as difference blocks or translation blocks according to the embedding capacity;

[0018] The authentication code embedding module is used to embed the authentication code into the difference block and translation block in the white set or gray set, so that all image blocks complete the two-layer embedding operation; for the difference block, the authentication code is embedded in the difference expansion method; for the overflow pixel, its position information and overflow amount are sequentially saved in the dynamic array S = {s1, s2, ..., s n}; for the translation block, the authentication code is embedded by using the prediction error histogram translation method; for the translation block with capacity V<3, only the authentication code is embedded; for the translation block with capacity V≥3, in addition to embedding the V-1 bit authentication code, 1 bit will be taken out from the above dynamic array S in turn for embedding;

[0019] The authentication module is used to extract the embedded authentication code from each image block in turn and restore the image block according to the inverse operation of the embedding method, and compare the extracted authentication code with the regenerated authentication code. If they are the same, the image is judged to be a real image; if they are different, the image is judged to be tampered with.

[0020] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0021] 1. The present invention adopts the prediction error expansion method to embed the authentication code. Specifically, two different reversible embedding methods, namely difference expansion and prediction error histogram shift, are used to embed the authentication code. The reversible embedding method is adopted for all blocks, which can ensure that each block can independently realize authentication and reversible recovery without relying on the space provided by other blocks.

[0022] 2. The present invention makes full use of the redundancy of the image. Through a two-layer embedding method, all pixels in the block can be used for embedding, which can ensure that at least 2 bits of authentication code are embedded in each block, effectively improving the initial accuracy of tampering detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 It is a flow chart of authentication code embedding and watermark image generation in the reversible image authentication method based on prediction error expansion of the present invention;

[0024] Figure 2 It is an example diagram of the division of gray sets and white sets in blocks of the reversible image authentication method based on prediction error expansion of the present invention;

[0025] Figure 3 1 is an example diagram of an authentication code embedded in a differential block of a reversible image authentication method based on prediction error expansion of the present invention, wherein (a) is an original differential block, (b) is an original prediction error, (c) is an embedded prediction error, and (d) is an embedded differential block;

[0026] Figure 41 is an example diagram of an authentication code embedded in a translation block of a reversible image authentication method based on prediction error expansion of the present invention, wherein (a) is an original translation block, (b) is an original prediction error, (c) is an embedded prediction error, and (d) is an embedded translation block;

[0027] Figure 5 It is a flow chart of authentication code extraction and image authentication in the reversible image authentication method based on prediction error expansion of the present invention;

[0028] Figure 6 This is a graph of experimental results of tampering detection of a tampered Lean grayscale image using the reversible image authentication method based on prediction error expansion of the present invention. DETAILED DESCRIPTION

[0029] The present invention is further described in detail below in conjunction with embodiments and drawings, but the embodiments of the present invention are not limited thereto.

[0030] Example 1

[0031] like Figure 1 As shown, the specific steps of embedding the authentication code in the reversible image authentication method based on prediction error expansion in this embodiment are as follows:

[0032] S1. Divide the image into several non-overlapping image blocks of size 4×4, and each image block has the same size, such as Figure 2 As shown, the pixels in the image block are divided into a gray set and a white set according to a chessboard, and the image blocks of the gray set and the image blocks of the white set are arranged alternately; so that the authentication code is embedded in two layers, wherein the gray set and the white set are embedded in one layer respectively;

[0033] In this embodiment, in order to avoid underflow or overflow in the translation process of subsequent operations, step S1 preprocesses the image before embedding, and the specific methods are as follows: 1) Scan the image, if the current pixel is 0, 1, 254 or 255, modify it to 2, 3, 252 and 253 respectively, and mark it as 1 in the preprocessing location table LM (LocationMap), indicating that these values ​​are obtained by modification; 2) If the current pixel is 2, 3, 252 or 253, it is marked as 0 in LM, indicating that these values ​​are not obtained by modification; 3) After scanning the image, compress LM; 4) embed LM into the translation block.

[0034] S2, calculating the authentication code of each image block according to the hash function;

[0035] S3, calculating the prediction errors of all image block pixels in the gray set, and defining the image block as a difference block or a translation block according to the embedding capacity. In this embodiment, if the current image block does not contain -1 or 0, it is a difference block, otherwise it is a translation block;

[0036] S4. For the difference block, a special difference expansion method is used to embed the authentication code; for the pixels that generate overflow, their position information and overflow amount are sequentially saved in binary form in the dynamic array S = {s1, s2, ..., s n}; repeat this step until all image blocks in the set are processed; finally, the pre-processing positioning table LM in step S1 is also sequentially saved in the dynamic array S, and in step S5, the dynamic array S is embedded into the partially specified translation block;

[0037] S5. For the translation block, the authentication code is embedded by using the prediction error histogram translation method. For the translation block with capacity V<3, only the authentication code is embedded; for the translation block with capacity V≥3, in addition to embedding the V-1 bit authentication code, 1 bit is taken out from the dynamic array S of step S4 in turn for embedding. By saving the information in the dynamic array S, the overflow pixel and the pre-processed pixel can be reversibly restored; repeat this step until all the image blocks in the set are processed;

[0038] In this embodiment, in order to solve the problem of overflow of pixels when the differential block is embedded by differential expansion in step S4, the overflow points and overflow information are processed. The specific method is as follows: 1) The horizontal and vertical coordinates (i, j) of the pixel point where the overflow occurs and the absolute value of the overflow amount |value| are sequentially saved as a binary sequence (i, j, |value|)2 in the dynamic array S = {s1, s2, ..., s n}; 2) modify the pixel values ​​less than 0 to 0, and modify the pixel values ​​greater than 255 to 255; 3) in step S5, the dynamic array S is embedded in the translation block to ensure that the information can be extracted to restore the overflowed pixels.

[0039] S6. Calculate the prediction error of all image block pixels in the white set, and define the image block as a differential block or a translation block according to whether the prediction error value contains -1 or 0. If it does not contain -1 or 0, it is a differential block, otherwise it is a translation block; and execute steps S4-S5 until the two-layer embedding operation is completed on all image blocks.

[0040] S7. In the authentication stage, according to the inverse operation of the embedding method, the embedded authentication code is extracted from each image block in turn and the image block is restored. The extracted authentication code is compared with the regenerated authentication code. If they are different, it means that the image has been tampered with. The tampered image block is marked and thinned. If they are the same, it means that the image is a real image. For the initial tampered mark, the mark is processed by the dilation and erosion operations in morphology before and after the thinning operation.

[0041] Specifically, if Figure 3As shown, taking the gray set in the specific differential block as an example, the specific steps of embedding the authentication code in the special difference expansion method adopted in step S4 are as follows:

[0042] S41, the prediction error sequence {e1, e2, ...e n-1 ,e n} Sort in ascending order where the subscript σ i (0≤i≤n) is the prediction error In the initial forecast error sequence {e1,e2,...e n-1 ,e n}. The sorting method is stable sorting, that is, when e i =e j (0≤j≤n) and i, there is σ i <σ j ; Figure 3 The sorted sequence in (b) is {-10,-9,-4,-3,-2,3,7};

[0043] S42, select the direction of difference expansion according to the distribution of pixel values ​​in another set (such as the white set), embed the authentication code, and obtain a new prediction error sequence of {e′1, e′2, …, e′ n-1 ,e′ n Specifically, the number of white pixels in the image block of the other set whose grayscale values ​​are in the closed interval [0,7] and the closed interval [248,255] are counted, which are recorded as A1 and A2 respectively. If A1≤A2, it means that there may be more pixel grayscale values ​​close to 255 in the other set, then the prediction error value is selected. Expand downward, that is, the corresponding modified pixel value is reduced, thereby avoiding upward overflow; on the contrary, if A1>A2, it means that there may be more pixel gray values ​​close to 0 in the other set, then choose to reduce the prediction error value Expand upward, that is, the corresponding modified pixel value increases, thereby avoiding overflow.

[0044] The current set is a gray set, and the other set is a white set; or the current set is a white set, and the other set is a gray set.

[0045] In this embodiment, since the white pixels {216, 253, 197, 251, 213, 251, 192, 226} have 3 pixel grayscale values ​​in the interval [248, 255] and 0 pixel grayscale value in the interval [0, 7], downward expansion is used to perform difference expansion.

[0046] Assuming that the authentication code of the current differential block is AC = {1}, the authentication code is embedded using the minimum prediction error according to the downward expansion rule, where h represents , H is the expanded value of h, b∈{0,1} represents the 1-bit authentication code to be embedded, for The calculation rules for the expanded value are as follows:

[0047]

[0048] H=2h+b

[0049]

[0050] In addition, the upward expansion rule uses the maximum prediction error to embed the authentication code, where h represents , H is the expanded value of h, b∈{0,1} represents the 1-bit authentication code to be embedded, for The calculation rules for the expanded value are as follows:

[0051]

[0052] H=2h+b

[0053]

[0054] S43, after steps S41 and S42, a new prediction error sequence is obtained: {e′1, e′2, …, e′ n-1 ,e′ n}, in order to avoid confusing the difference block with the translation block during the extraction process, the prediction error value e′ of the new prediction error sequence needs to be i (0≤i≤n) performs translation operation to obtain the translation prediction error value e″ i (0≤i≤n), then according to e″ i The predicted value of the corresponding pixel Calculate the gray pixel value P′ after embedding the authentication information (i.e., the authentication code) i (0≤i≤n), the calculation rules are as follows:

[0055]

[0056]

[0057] Finally, the differential block after embedding the authentication code is obtained as follows Figure 3 As shown in (d) in .

[0058] like Figure 4As shown, taking the gray set in the specific translation block as an example, the specific steps of the prediction error histogram translation method adopted in step S5 are as follows:

[0059] S51, using the prediction error sequence {e1, e2, ...e n-1 ,e n} Construct a prediction error histogram. In this embodiment, the two peak positions of the prediction error histogram used for translation are PK1=-1 and PK2=0 respectively. According to the two peak heights, the capacity V of the current set image block is calculated. It is easy to know that Figure 4 The image block capacity V in step S4 is 4; assuming that the authentication code AC of the image block is {1,1,0}, and assuming that the dynamic array S generated in step S4 is {s1,s2,…,s n} is 1, and the authentication code AC = {1,1,0} is concatenated with it to obtain the embedded sequence L = {1,1,0,1};

[0060] S52, sequentially access the prediction error sequence {e1, e2, ...e n-1 ,e n The prediction error e in i (0≤i≤n) and perform embedding operation according to the following formula to obtain the modified prediction error e′ i , where PK1 and PK2 are the two peak positions used for translation embedding as described above, and b∈{0,1} represents the 1-bit information taken out from the embedding sequence L in sequence:

[0061]

[0062] That is, after embedding the information, the original prediction error value {-1,0,2,-8,1,0,-1,6} is changed to {-2,1,3,-9,2,0,-2,7}.

[0063] S53, calculate the modified pixel value P′ according to the following formula i ,in is the prediction error e′ i (0≤i≤n) The predicted value of the corresponding pixel:

[0064]

[0065] Finally, the translation block after embedding the authentication code is obtained as follows Figure 4 As shown in (d) in .

[0066] like Figure 5 As shown, in step S7 of this embodiment, in the authentication phase, the authentication code is extracted and the image is authenticated and restored according to the inverse operation of the embedding method. The main steps are as follows:

[0067] S71. Extraction of authentication codes and image restoration in a reversible image authentication method based on prediction error expansion: by dividing the image into non-overlapping image blocks, dividing the pixels in the image blocks into a white set and a gray set, and using the inverse operation of the embedding method to extract the authentication code embedded in each image block from the white set and the gray set in turn, and restoring the corresponding image block during the extraction process.

[0068] S72. Tampering detection and tampering location in the reversible image authentication method based on prediction error expansion: compare the authentication code extracted from each image block with the authentication code regenerated for each image block. When the two are inconsistent, mark the tampered area. If the authentication codes of all image blocks are consistent, the image is a real image and the image authentication is completed.

[0069] like Figure 6 As shown, the reversible image authentication method based on prediction error expansion in this embodiment can effectively protect the image under various attacks and can perform accurate tampering detection and positioning.

[0070] Example 2

[0071] Based on the same inventive concept as in Example 1, this embodiment provides a reversible image authentication system based on prediction error expansion, including the following modules:

[0072] A division module is used to divide the image into a number of non-overlapping image blocks, each of which has the same size, and divide the pixels in the image blocks into a gray set and a white set according to a checkerboard pattern, wherein the image blocks of the gray set and the image blocks of the white set are arranged alternately;

[0073] An authentication code calculation module, used for calculating an authentication code of each image block according to a hash function;

[0074] The gray set classification module calculates the prediction errors of all image block pixels in the gray set and defines the image blocks as difference blocks or translation blocks according to the embedding capacity;

[0075] The white set classification module calculates the prediction errors of all image block pixels in the white set and defines the image blocks as difference blocks or translation blocks according to the embedding capacity;

[0076] The authentication code embedding module is used to embed the authentication code into the difference block and translation block in the white set or gray set, so that all image blocks complete the two-layer embedding operation; for the difference block, the authentication code is embedded in the difference expansion method; for the overflow pixel, its position information and overflow amount are sequentially saved in the dynamic array S = {s1, s2, ..., s n}; for the translation block, the authentication code is embedded in the prediction error histogram translation method; for the translation block with capacity V<3, only the authentication code is embedded; for the translation block with capacity V≥3, in addition to embedding V-1 bit authentication code, 1 bit will be taken out from the above dynamic array S in turn for embedding;

[0077] The authentication module is used to extract the embedded authentication code from each image block in turn and restore the image block according to the inverse operation of the embedding method, and compare the extracted authentication code with the regenerated authentication code. If they are the same, the image is judged to be a real image; if they are different, the image is judged to be tampered with.

[0078] The modules of this embodiment are respectively used to implement the corresponding steps of Embodiment 1, and the detailed process has been described in Embodiment 1 and will not be repeated here.

[0079] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.

Claims

1. A reversible image authentication method based on prediction error expansion, characterized in that: The following steps are involved: S1, dividing the image into a number of non-overlapping image blocks, each of which has the same size, and dividing the pixels in the image blocks into a gray set and a white set according to a checkerboard pattern, wherein the image blocks of the gray set and the image blocks of the white set are arranged alternately; S2, calculating the authentication code of each image block according to the hash function; S3, calculating the prediction errors of all image block pixels in the gray set, and defining the image blocks as difference blocks or translation blocks according to the embedding capacity; S4. For the difference block, the authentication code is embedded in the difference expansion method; for the pixels that generate overflow, their position information and overflow amount are sequentially saved in binary form in the dynamic array S = {s1, s2, ..., s n }; repeat this step until all image blocks in the set are processed; S5, for the translation block, the authentication code is embedded by using the prediction error histogram translation method; for the translation block with capacity V<3, only the authentication code is embedded; for the translation block with capacity V≥3, in addition to embedding the V-1 bit authentication code, 1 bit is taken out from the dynamic array S of step S4 in turn for embedding; Repeat this step until all image blocks in the set are processed; S6, calculating the prediction errors of all image block pixels in the white set, defining the image blocks as differential blocks or translation blocks according to the embedding capacity; and executing steps S4-S5 until all image blocks complete the two-layer embedding operation; S7, in the authentication stage, according to the inverse operation of the embedding method, the embedded authentication code is extracted from each image block in turn and the image block is restored, and the extracted authentication code is compared with the regenerated authentication code. If they are the same, the image is judged to be a real image, and if they are different, the image is judged to be tampered with; In step S4, the authentication code is embedded in a difference expansion manner, including the following steps: S41, the prediction error sequence {e1, e2, ...e n-1 , e n } Sort in ascending order where the subscript σ i is the prediction error In the initial forecast error sequence {e1, e2, ...e n-1 , e n }, where 0≤i≤n; S42, select the direction of difference expansion according to the distribution of pixel values ​​in another set, and embed the authentication code; count the number of white pixels in the image block of the other set whose grayscale values ​​are in the closed interval [0, 7] and the closed interval [248, 255], and record them as A1 and A2 respectively. If A1≤A2, the prediction error value Expand downward; conversely, if A1>A2, the prediction error value Expand upward; get a new prediction error sequence of {e′1, e′2, ..., e′ n-1 , e′ n }; S43, performing a translation operation on the prediction error value e′i of the new prediction error sequence to obtain a translated prediction error value e″ i , then according to e″ i The predicted value of the corresponding pixel Calculate the gray pixel value P′ after embedding the authentication code i ; In step S5, the prediction error histogram is shifted to embed the authentication code, which includes the following steps: S51, using the prediction error sequence {e1, e2, ...e n-1 , e n } Construct a prediction error histogram, and count the capacity V of the current set image block according to the two peaks PK1 and PK2 used for translation embedding, and generate a dynamic array S = {s1, s2, ..., s n }, take out 1 bit in sequence and concatenate it with the authentication code to obtain the embedded sequence L; where 0≤i≤n; S52, sequentially access the prediction error sequence {e1, e2, ...e n-1 , e n The prediction error e in i And the modified prediction error e′ is obtained by embedding according to the following formula: i , where b∈{0,1} represents the 1-bit information taken out from the embedded sequence L in sequence: S53, calculate the modified pixel value P′ according to the following formula i ,in is the prediction error e′ i The predicted value of the corresponding pixel: Finally, the translation block with the authentication code embedded is obtained.

2. The reversible image authentication method based on prediction error expansion according to claim 1, characterized in that: Step S7 performs the inverse operation of the embedding method in the authentication phase to extract the authentication code and perform image authentication and recovery. The steps are as follows: S71, dividing the image into non-overlapping image blocks, dividing the pixels in the image blocks into a white set and a gray set, extracting the authentication code embedded in each image block from the white set and the gray set in turn by using the inverse operation of the embedding method, and restoring the corresponding image block in the extraction process; S72, comparing the authentication code extracted from each image block with the authentication code regenerated from each image block. When the two are inconsistent, the tampered area is marked. If the authentication codes of all image blocks are consistent, the image is a real image, and the image authentication is completed.

3. The reversible image authentication method based on prediction error expansion according to claim 1, characterized in that: Step S1 also includes image preprocessing: 1) Scan the image. If the current pixel is 0, 1, 254 or 255, modify it to 2, 3, 252 and 253 respectively, and mark it as 1 in the preprocessing positioning table LM; 2) If the current pixel is 2, 3, 252 or 253, it is marked as 0 in LM; 3) After scanning the image, compress the LM; 4) Embed the LM into the translation block.

4. A reversible image authentication system based on prediction error expansion, characterized in that: Includes the following modules: A division module is used to divide the image into a number of non-overlapping image blocks, each of which has the same size, and divide the pixels in the image blocks into a gray set and a white set according to a checkerboard pattern, wherein the image blocks of the gray set and the image blocks of the white set are arranged alternately; An authentication code calculation module, used for calculating an authentication code of each image block according to a hash function; The gray set classification module calculates the prediction errors of all image block pixels in the gray set and defines the image blocks as difference blocks or translation blocks according to the embedding capacity; The white set classification module calculates the prediction errors of all image block pixels in the white set and defines the image blocks as difference blocks or translation blocks according to the embedding capacity; The authentication code embedding module is used to embed the authentication code into the difference block and the translation block in the white set or the gray set, so that all image blocks complete the two-layer embedding operation; for the difference block, the authentication code is embedded in the difference expansion method; for the overflowed pixels, their position information and overflow amount are sequentially saved in the form of binary in the dynamic array S = {s1, s2, ..., s n }; for the translation block, the authentication code is embedded by using the prediction error histogram translation method; for the translation block with capacity V<3, only the authentication code is embedded; for the translation block with capacity V≥3, in addition to embedding the V-1 bit authentication code, 1 bit will be taken out from the above dynamic array S in turn for embedding; The authentication module is used to extract the embedded authentication code from each image block in turn and restore the image block according to the inverse operation of the embedding method, and compare the extracted authentication code with the regenerated authentication code. If they are the same, the image is judged to be a real image, and if they are not the same, the image is judged to be tampered with; The authentication code is embedded in the module. The steps for embedding the authentication code in the differential expansion method are as follows: 1) The prediction error sequence {e1, e2, ...e n-1 , e n } Sort in ascending order where the subscript σ i is the prediction error In the initial forecast error sequence {e1, e2, ...e n-1 , e n }, where 0≤i≤n; 2) Select the direction of difference expansion according to the distribution of pixel values ​​in the other set to embed the authentication code; count the number of white pixels in the image block of the other set whose grayscale values ​​are in the closed interval [0, 7] and the closed interval [248, 255], and record them as A1 and A2 respectively. If A1≤A2, the prediction error value Expand downward; on the contrary, if A1>A2, the prediction error value Expand upward; get a new prediction error sequence of {e′1, e′2, ..., e′ n-1 , e′ n }; 3) The prediction error value e′ of the new prediction error sequence i Perform translation operation to obtain the translation prediction error value e″ i , then according to e″ i The predicted value of the corresponding pixel Calculate the gray pixel value P′ after embedding the authentication code i ; In the authentication code embedding module, the steps of embedding the authentication code by prediction error histogram translation are as follows: 1) Using the prediction error sequence {e1, e2, ...e n-1 , e n } Construct a prediction error histogram, and count the capacity V of the current set image block according to the two peaks PK1 and PK2 used for translation embedding, and generate a dynamic array S = {s1, s2, ..., s n }, take out 1 bit in sequence and concatenate it with the authentication code to obtain the embedded sequence L; where 0≤i≤n; 2) Access the prediction error sequence {e1, e2, ...e n-1 , e n The prediction error e in i And the modified prediction error e′ is obtained by embedding according to the following formula: i , where b∈{0,1} represents the 1-bit information taken out from the embedded sequence L in sequence: 3) Calculate the modified pixel value P according to the following formula: i ′ ,in is the prediction error e i ′ The predicted value of the corresponding pixel: Finally, the translation block with the authentication code embedded is obtained.

5. The reversible image authentication system based on prediction error expansion according to claim 4, characterized in that: In the authentication phase, the authentication module extracts the authentication code and performs image authentication and recovery according to the inverse operation of the embedding method. The steps are as follows: The image is divided into non-overlapping image blocks, and the pixels in the image blocks are divided into a white set and a gray set. The authentication code embedded in each image block is extracted from the white set and the gray set in turn by using the inverse operation of the embedding method, and the corresponding image block is restored during the extraction process. The authentication code extracted from each image block is compared with the authentication code regenerated for each image block. When the two are inconsistent, the tampered area is marked. If the authentication codes of all image blocks are consistent, the image is a real image and the image authentication is completed.

Citation Information

Patent Citations

  • High-fidelity reversible information hiding method and device based on prediction error value sorting

    CN111898136A

  • Reversible data hiding method and system based on prediction errors

    CN112333348A