A medical image tampering detection and self-recovery method based on texture cross embedding
Through the method based on texture degree cross-embedding, the problem of insufficient robustness and efficiency in medical image tamper detection is solved, efficient tamper detection and self-recovery is achieved, and the security and diagnostic value of the image are enhanced.
Patent Information
- Application Number
- CN202211278309.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-19
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-10-19
AI Technical Summary
The existing medical image tamper detection algorithms are insufficient in terms of robustness and efficiency, making it difficult to accurately locate the tampered area and effectively recover it, and there is a risk of malicious tampering and privacy leakage in image secure transmission.
Using a method based on texture degree cross embedding, medical images are divided into ROI and RONI regions, and blocks are divided using texture complexity and feature extraction is performed. Combined with compression perception and cross embedding technology, detection bits are set in the ROI region, recovery information is hidden in the RONI region, copy-paste attacks are detected through gradient histogram and DCT transformation, and pixel-level and block-level double tampering detection and positioning are performed.
It realizes efficient tamper detection and self-recovery of medical images, improves robustness and security, can accurately locate tampering areas and effectively recover, and enhances the visual effect and diagnostic value of the image.
Smart Images

Figure CN115690014B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a medical image tampering detection and self-recovery method, and in particular to a medical image tampering detection and self-recovery method based on texture cross embedding. Background Art
[0002] While 5G networks offer superior network capabilities for telemedicine, the secure transmission of medical image data presents challenges such as malicious tampering, illegal copying, and privacy leaks. The use of maliciously tampered medical images can lead to a serious crisis of public trust. Therefore, research into medical image tampering detection (and medical image integrity verification) is imperative. While earlier tampering detection algorithms only determined whether an image had been tampered with, current tampering detection algorithms require not only precise localization of the tampered area but also approximate restoration.
[0003] Medical images are typically divided into regions of interest (ROIs) and regions of non-interest (RONIs). Osborne et al. first proposed processing the ROI and RONI regions separately, compressing the RONI region while maintaining image quality. Subsequently, several researchers proposed extracting ROI features and embedding them into the RONI region as a watermark.
[0004] Medical image tampering methods are diverse, and copy-and-paste manipulation is a common method. Fridrich et al. first defined copy-and-paste manipulation and proposed a detection algorithm based on block matching. Subsequently, several researchers proposed methods based on DWT and FWT transforms to describe image block features. However, block-based detection methods have low robustness.
[0005] Huang et al. used SIFT as a method for keypoint detection and feature description in medical images, and employed the BestBinFirst algorithm to find similar feature vectors and determine the locations of matching keypoints. Since then, numerous researchers have designed a series of algorithms based on SIFT and SURF. Compared with block-matching-based detection methods, keypoint matching-based methods avoid global search and improve robustness. However, these algorithms suffer from issues such as post-processing to mask tampering and low detection efficiency. Summary of the Invention
[0006] In order to solve the above problems existing in the prior art, the present invention proposes a medical image tampering detection and self-recovery method based on texture cross embedding.
[0007] The technical solution of the present invention is: a medical image tampering detection method based on texture cross embedding, which is carried out in the following steps:
[0008] Step 1. Divide the medical image into ROI region and RONI region;
[0009] Step 2. Calculate the texture complexity of the ROI region based on different features, and divide the ROI region into texture blocks and flat sliders based on the texture complexity. Use compressed sensing technology to extract different features in different blocks as recovery information.
[0010] Step 3. Set pixel-level and block-level detection bits in the ROI area;
[0011] Step 4. Hiding the restored information in the RONI region based on the reference matrix and cross embedding technology;
[0012] Step 5. Image copy and paste attack detection;
[0013] Step 6. Double tampering detection and positioning in the ROI area.
[0014] The step 1 is specifically as follows:
[0015] Step 1.1 Convert the medical image img_mark into grayscale image format img_origin;
[0016] Step 1.2: Identify the edge line position of the ROI area manually marked by the doctor, assign the edge line pixels to 1 in the binary matrix img_edge, and assign the remaining pixels to 0;
[0017] Step 1.3 Scan the matrix img_edge and fill the inner area of the edge with 1 to form the ROI area img_area, and the rest is the RONI area;
[0018] Step 1.4: Divide the ROI area img_area into 4×4 blocks and determine whether there are any pixel values 1 in the block. If so, change all the pixels in the block to 1; otherwise, do nothing.
[0019] Step 1.5 constructs auxiliary information aux_ROI_area, including the number of ROI areas area_num, and the coordinates of the upper left corner and lower right corner of each ROI area loc_LRs;
[0020] The step 2 is specifically as follows:
[0021] Step 2.1 Calculate the texture of the img_area sub-block in the ROI area:
[0022] Step 2.1.1 Calculate the sub-block energy value according to formula (1):
[0023]
[0024] Where g represents the gray-level co-occurrence matrix, d and θ are the distance and direction between two gray levels, and k represents the size of the sub-block;
[0025] Step 2.1.2 Calculate the sub-block entropy value according to formula (2):
[0026]
[0027] Step 2.1.3 calculates the sub-block contrast according to formula (3):
[0028]
[0029] Step 2.1.4 assigns different weights to the three eigenvalues of energy, entropy, and contrast of all sub-blocks through mean square error, and calculates the final eigenvalues J, H, and D;
[0030] Step 2.1.5 assigns weights w1, w2, and w3 to the three final eigenvalues and calculates the texture complexity f, where w1, w2, and w3 are determined by the global optimization algorithm:
[0031] f=w1×J+w2×H+w3×D (4)
[0032] Step 2.2: If the sub-block texture complexity f is greater than the threshold T_c, it is a texture block, otherwise it is a smooth block;
[0033] Step 2.3 generates a position map map_ROI_complexity, where 1 and 0 represent texture blocks and flat sliders respectively. Huffman coding is then used for compression, and 14 bits are used to store the compressed length. Finally, the length information and the entire auxiliary information are concatenated to form the auxiliary information aux_complexity.
[0034] Step 2.4: Divide each 4×4 sub-block of the ROI area into two non-intersecting parts using a checkerboard cross-section. and The first part is stored in positive order, and the second part is stored in reverse order;
[0035]
[0036] Step 2.5 takes out the first part stored in positive order and performs different types of compressed sensing based on the texture category of this block:
[0037] Step 2.5.1 For a texture block, calculate the average value ave of all pixels in the sub-block m , high average value h m and low average l m , as shown in formula (6-8), where x nis the number of pixels in the block that are above the average, P m is the pixel value;
[0038]
[0039]
[0040]
[0041] The high mean value h m The pixels with low average value are marked as 1. m The pixels are marked as 0, and the bitmap block_loc_map is generated. The bitmap and the binary high average value h m and binary low mean l m Combine and generate sub-block recovery information reduction_part_1;
[0042] Step 2.5.2: For the smooth block, use formula (6) to calculate the sub-block average value, convert it into binary, and construct the recovery information reduction_part_1;
[0043] Step 2.6 retrieves the second part stored in reverse order and performs compressed sensing as in steps 2.1-2.4 to determine the texture category of this block. Then, perform different compression operations on the texture block and the slider according to step 2.5.1 or 2.5.2, respectively, to generate binary reduction information reduction_part_2.
[0044] Step 2.7: Compress {reduction_part_1, reduction_part_2} using Huffman coding, and store the compressed length {reduction_part_1_length, reduction_part_2_length} in 20-bit binary format.
[0045] The step 3 is specifically as follows:
[0046] Step 3.1 Divide each 4×4 sub-block of the ROI area into two non-intersecting parts in a chessboard-like manner and
[0047] Step 3.2 Construct the first part of the check digit:
[0048] Step 3.2.1 First, use formula (9) to convert the pixel value P m Convert to binary form, for the first part of pixels in the sub-block, except for the last pixel, keep the first 7 bits unchanged and the last bit zero; for the last pixel, keep its first 6 bits unchanged and the last two bits zero;
[0049]
[0050] Step 3.2.2 Use formula (10) to determine the number of 0s and 1s in the first 7 bits of each pixel. If the number of 1s is large, the check bit is 1, otherwise it is 0, and the check bit P is set to 0. I Placed in the 8th bit of each pixel;
[0051]
[0052] Step 3.2.3 XOR the first 7 bits of each pixel except the last pixel to form the check bit B I , assigned to the 7th bit of the last pixel;
[0053] Step 3.3 Construct the second part of the check digit:
[0054] Step 3.3.1: For the second part of pixels in the sub-block, keep the first 7 bits of each pixel unchanged and set the last bit to zero.
[0055] Step 3.3.2: Convert the first seven digits of the first pixel into decimal, divide it by 128, and get a decimal between 0 and 1, retaining three decimal places to generate the first parameter para_1.
[0056] Step 3.3.3 Convert the first 7 bits of the other pixels into decimal and add them together to generate the second parameter para_2;
[0057] Step 3.3.4: Let Z0 = para_1, a = para_2, and use ICMIC mapping as shown in formula (11) to generate a random sequence;
[0058]
[0059] Step 3.3.5: Take the first four different values of the random sequence and sort them. Convert the sort index values 0-3 into 2-bit binary digits and concatenate them together to form an 8-bit block-level check bit, which is placed at the last bit of each pixel.
[0060] The step 4 is specifically as follows:
[0061] Step 4.1: Construct the embedding reference matrix C, as shown in formulas (12, 13), where i and j both belong to [0, 255]. Set the initial value C(0, 0) = 0. The constraint is that the values in each 3×3 block in the reference matrix C are non-repeated and range from 0 to 8.
[0062] C(i+1,j)=(C(i,j)+1)mod9 (12)
[0063] C(i,j+1)=(C(i,j)+3)mod9 (13)
[0064] Step 4.2: Divide the RONI region into 2×2 sub-blocks. The upper left and lower right of each sub-block form a pixel pair, and the lower left and upper right form another pixel pair.
[0065] Step 4.3 embeds the auxiliary information aux_ROI_area into the LSB of the 1st and 2nd rows of the image;
[0066] Step 4.4: The auxiliary information aux_complexity is combined with the recovery information reduction_part_1 as the first part of the information to be embedded in the forward order; reduction_part_2 is embedded as the second part of the information to be embedded in the reverse order;
[0067] Step 4.5: Convert every 3 bits of binary information to be embedded into 1 octal bit;
[0068] Step 4.6 Calculate the difference X between the sub-block pixel pairs using formula (14) d , X L and X R Two pixel values corresponding to pixel pairs respectively;
[0069] X d =X L -X R (14)
[0070] Step 4.7: Based on the relationship between the difference and the threshold, the reference matrix C is used to implement replacement embedding.
[0071] If X d If it is less than or equal to the threshold value T_dif, then proceed as follows (1)-(3):
[0072] (1) Overflow handling
[0073] If there is a pixel value of 0 or 255 in the pixel pair, set 0 to 1 and 255 to 254;
[0074] (2) Positioning
[0075] The pixel pair (X L ,X R ) corresponds to the reference matrix C and finds the corresponding point R t (X L ,X R );
[0076] (3) Embedding
[0077] R t (X L ,X R ) is the center point of the 3×3 matrix to find the location of the octal information b to be embedded, and find the corresponding coordinates (XL ′,X R ′), use formula (15) to convert the original pixel pair (X L ,X R ) is changed to (X L ′,X R ′), where M∈[-1,1], i, j represent position indexes;
[0078] (X L ′,X R ′)=(X L ±M i ,X R ±M j )if C(X L ±M i ,X R ±M j )==b (15)
[0079] If X d If it is greater than the threshold T_dif, then proceed as follows (1)-(4):
[0080] (1) Overflow handling
[0081] If there is a pixel value of 0 or 255 in the pixel pair, set the value of 0 to 2 and the value of 255 to 253;
[0082] (2) Positioning
[0083] The pixel pair (X L ,X R ) corresponds to the reference matrix C and finds the corresponding point R t (X L ,X R );
[0084] (3) Determine the embedding range
[0085] For the octal information b to be embedded, according to X d The sign of determines the embedding range:
[0086] If X d is positive, in (X L ,X R ) to (X L +2,X R -2) to find the location of b within the rectangular range;
[0087] If X d is negative, in (X L ,X R ) to (X L -2,X R +2) to find the location of b within the rectangular range;
[0088] (4) Embedding
[0089] According to formula (16), find the corresponding coordinates (X L ′,X R ′), the original pixel pair (X L ,X R ) is changed to (X L ′,X R ′), where U∈[0,2], V∈[-2,0], i, j represent position indices;
[0090]
[0091] The step 5 is specifically as follows
[0092] Step 5.1: Divide the entire image into 4×4 sub-blocks p and use formulas (17-20) to calculate the sub-block gradient magnitude and gradient direction:
[0093] p h =(p(i,j-1)-p(i,j+1))+(p(i+1,j)-p(i-1,j)) (17)
[0094] p o =(p(i-1,j-1)-p(i+1,j+1))+(p(i+1,j-1)-p(i-1,j+1)) (18)
[0095] grad size (f)=|p h |+|p o | (19)
[0096]
[0097] Step 5.2: Perform block scanning in a block overlapping manner with a scanning step size of 1;
[0098] Step 5.3: Divide the 4×4 sub-block into four 2×2 sub-units, calculate the gradient magnitude and gradient direction in each sub-unit, and represent them with a gradient histogram.
[0099] Step 5.4 Construct sub-block features
[0100] Connect the gradient histograms of the four sub-units to form the sub-block feature value 1; then perform DCT transformation on the 4×4 sub-block, and use the value of the first row and first column in the upper left corner of the coefficient matrix as the sub-block feature value 2. Combine the two features together to construct the sub-block feature character_all;
[0101] Step 5.5: Subtract the eigenvalues of all 4×4 blocks pairwise to get dif_valueij , where i≠j, as shown in formula (21):
[0102] dif_value ij =character_all i -character_all j (twenty one)
[0103] Step 5.6 Set the threshold mark_yy and the difference dif_value ij Compare with the threshold mark_yy and use formula (22) to determine whether it is a copy and paste tampering block. If dif_value ij If it is less than or equal to mark_yy, it means that the two blocks are the same, that is, the blocks are copied and pasted, and the detection result S ij Set to 1; otherwise, the detection result S ij Set to 0, indicating that the block is not copied and pasted;
[0104]
[0105] Step 5.7 Mark the copied and pasted blocks that belong to the ROI area: D i ={d i |i=1,2,…,n};
[0106] Step 5.8: Further locate the ROI area using the neighborhood method and copy and paste the tampered block:
[0107] For all sub-blocks in the ROI area, the number of tampered blocks in its 8-neighborhood is calculated. If it is greater than or equal to 5, this block is determined to be a tampered block, otherwise this block is a non-tampered block, as shown in formula (23), where N8(d i ) means d i The number of tampered blocks in the 8 fields;
[0108]
[0109] The step 6 is specifically as follows:
[0110] Step 6.1 extracts the ROI area auxiliary information aux_ROI_area from the LSBs of the first and second rows of the image, and determines the ROI area by the number of ROI areas area_num and the coordinates of the upper left corner and lower right corner of each ROI area loc_LRs;
[0111] Step 6.2: Divide each 4×4 sub-block of the ROI area into two non-intersecting parts in a chessboard-like manner according to formula (5). and The first part is stored in positive order, and the second part is stored in reverse order;
[0112] Step 6.3 First level tamper detection and positioning:
[0113] Step 6.3.1 Take the 7th bit of the last pixel in the first part of the sub-block in positive order to obtain the detection bit B I ;
[0114] Step 6.3.2 XOR the first 7 bits of the remaining pixels to obtain a detection bit B I ';
[0115] Step 6.3.3 Block-level detection: B I and B I 'Compare them, if they are different, the sub-block is considered to have been tampered with, otherwise, it is considered not to have been tampered with, thus achieving block-level tamper detection and positioning;
[0116] Step 6.3.4 Extract the last bit of each pixel as the detection bit P I ;
[0117] Step 6.3.5 Count the number of 1s and 0s in the first 7 bits of each pixel. If there are more 1s, detect the bit P. I ' is 1, otherwise it is 0;
[0118] Step 6.3.6: P I ′ and P I Compare and find out if they are different, then the pixel is considered to have been tampered with. Otherwise, it is considered not to have been tampered with, thus achieving pixel-level tampering detection and positioning.
[0119] Step 6.3.7 Generate a position map LP1 of the same size as the image ROI area, marking whether the pixel has been tampered with. If it is tampered, it is marked as 1, otherwise it is marked as 0;
[0120] Step 6.4 Second level of tamper detection and positioning:
[0121] Step 6.4.1 Take the 8th bit of all pixels in the second part of the sub-block in reverse order and splice them together to form W I ;
[0122] Step 6.4.2: Take the first 7 bits of the first pixel, convert them to decimal, and divide them by 128 to get a decimal between 0 and 1. Keep three decimal places to generate the first parameter para_1.
[0123] Step 6.4.3: Convert the first 7 bits of the other pixels into decimal and add them together to generate the second parameter para_2.
[0124] Step 6.4.4: Let Z0 = para_1, a = para_2, and generate a random sequence using ICMIC mapping as shown in formula (11);
[0125] Step 6.4.5: Take the first 4 different values of the random sequence and sort them. Convert the sort index values 0-3 into 2-bit binary and splice them together to form an 8-bit block-level check bit W. I ';
[0126] Step 6.4.6 Determine W I ′ and W I If they are the same, generate a position map LP2 of the same size as the image ROI area, mark whether the pixel has been tampered with, and mark it as 1 if it is tampered with, otherwise mark it as 0;
[0127] Step 6.5: Merge the position maps LP1 and LP2 into LP. If LP1 or LP2 is marked as tampered, the pixel is considered tampered and set to 1. Otherwise, it is considered not tampered and set to 0, as shown in formula (24).
[0128]
[0129] Step 6.6 Use the directional sub-band to further determine the tampered block
[0130] For each sub-block, four directional bands are defined, namely (S, SW, W), (W, NW, N), (N, NE, E), (E, SE, S), where S represents the block located in the south of the block, W represents the block located in the west of the block, SW represents the block located in the southwest of the block, and so on; if all four directional bands of a block are tampered, then the block is considered to be a tampered block, otherwise it is considered to be a non-tampered block, as shown in formula (25), where N4(d i ) means d i The number of tampered items in the four direction bands;
[0131]
[0132] A tampering recovery method corresponding to the above-mentioned medical image tampering detection method based on texture cross embedding is performed according to the following steps:
[0133] Step 7.1: Construct the embedding reference matrix C, as shown in formulas (12, 13), where i and j are both in the range [0, 255]. Set the initial value C(0, 0) = 0. The constraint is that the values in each 3×3 block in the reference matrix C are unique and range from 0 to 8.
[0134] Step 7.2: Divide the RONI region into 2×2 sub-blocks. For each sub-block, the upper left and lower right constitute a pixel pair, and the lower left and upper right constitute another pixel pair.
[0135] Step 7.3 Based on the pixel pair (X L ,X R ) According to the coordinate method, it corresponds to the reference matrix C and extracts the corresponding value R t (XL ,X R ), get secret information;
[0136] Step 7.4: Take the first 5 extracted information, convert it into decimal, and calculate the length of the compressed position map;
[0137] Step 7.5 continues to extract the compressed position map of the same length from the back, decompress it, and form a texture classification position map;
[0138] Step 7.6 extracts the first part of the secret information in positive order and extracts the second part in reverse order;
[0139] Step 7.7: Determine the compressed sensing classification based on the position map identifier. Texture blocks are represented by 24 bits, and smooth blocks are represented by 8 bits. If it is a texture block, split the 24 bits into 8+8+8, where the first 8 bits represent the high average value, the second 8 bits represent the low average value, and the third 8 bits represent the value distribution position map in the corresponding block.
[0140] In step 7.8, for texture blocks, replace 1 in the position map with a high average value and replace 0 with a low average value, and finally form a restored block; for smooth blocks, directly convert 8 bits to decimal to replace the first part of pixels in the block to complete image restoration.
[0141] The present invention determines the embedding method based on different pixel relationships, so that the embedded information can adapt to the content of the medical image. For larger pixel differences, larger information is embedded, and for smaller pixel differences, smaller information is embedded. While improving the embedding capacity, the contrast of the medical image can also be enhanced, achieving a better visual effect, which plays a certain role in doctors diagnosing the disease. The present invention proposes three detection methods at the block level and pixel level, so that the image can be accurately located to the tampered area after being disturbed by any attack. Not only does it use the gradient histogram and DCT transform to detect whether the entire image has a copy and paste attack, but it also locates the tampered block in the ROI area based on pixel-level and block-level detection and extracts recovery information to restore the tampered image. It has the advantages of strong tamper detection ability, good self-recovery effect, high security, good invisibility and strong robustness. BRIEF DESCRIPTION OF THE DRAWINGS
[0142] Figure 1 This is an overall flow chart of an embodiment of the present invention. Figure 1 (a) is the embedded flow chart, Figure 1 (b) is the detection and recovery flow chart.
[0143] Figure 2 This is the ROI area information diagram of an embodiment of the present invention. Figure 2 (a) is the edge line diagram of the ROI area manually marked by the doctor. Figure 2 (b) (c) are schematic diagrams of ROI auxiliary information.
[0144] Figure 3 Schematic diagram of the division of texture blocks and smooth blocks according to an embodiment of the present invention.
[0145] Figure 4 It is a schematic diagram of chessboard-style cross segmentation according to an embodiment of the present invention.
[0146] Figure 5 This is a flow chart of compressed sensing according to an embodiment of the present invention.
[0147] Figure 6 This is a flow chart of constructing a check digit according to an embodiment of the present invention.
[0148] Figure 7 It is a reference matrix diagram of an embodiment of the present invention.
[0149] Figure 8 It is a schematic diagram of embedding an embodiment of the present invention.
[0150] Figure 9 1 is a histogram of a watermarked image and an original image according to an embodiment of the present invention.
[0151] Figure 10 Schematic diagram of block overlapping scanning in an embodiment of the present invention.
[0152] Figure 11 This is a diagram showing the results of resisting copy and paste attacks according to an embodiment of the present invention. DETAILED DESCRIPTION
[0153] The present invention is a medical image tampering detection and self-recovery method based on texture cross embedding. Figure 1 As shown, Figure 1 (a) is the embedded flow chart, Figure 1 (b) is a flow chart of the test, which is carried out in the following steps:
[0154] Step 1. Divide the medical image into ROI region and RONI region:
[0155] Step 1.1 Convert the medical image img_mark into grayscale image format img_origin;
[0156] Step 1.2 identifies the edge line position of the ROI area manually marked by the doctor, such as Figure 2 As shown in (a), edge line pixels are assigned 1 in the binary matrix img_edge, and the rest of the pixels are assigned 0;
[0157] Step 1.3 Scan the matrix img_edge and fill the inner area of the edge with 1 to form the ROI area img_area, and the rest is the RONI area;
[0158] Step 1.4: Divide the ROI area img_area into 4×4 blocks and determine whether there are any pixel values 1 in the block. If so, change all the pixels in the block to 1; otherwise, do nothing.
[0159] Step 1.5 constructs auxiliary information aux_ROI_area, including the number of ROI areas area_num, the coordinates of the upper left corner and lower right corner of each ROI area loc_LRs, such as Figure 2 (b)
[0160] Table 1 shows the ROI / RONI region division results and embeddability rates of medical images.
[0161] Table 1
[0162]
[0163]
[0164] Step 2. Calculate the texture complexity in the ROI region based on different features, and divide the ROI region into texture blocks and flat sliders based on the texture complexity. Use compressed sensing technology to extract different features in different blocks as recovery information:
[0165] Step 2.1 Calculate the texture of the img_area sub-block in the ROI area:
[0166] Step 2.1.1 Calculate the sub-block energy value according to formula (1):
[0167]
[0168] Where g represents the gray-level co-occurrence matrix, d and θ are the distance and direction between two gray levels, and k represents the size of the sub-block;
[0169] Step 2.1.2 Calculate the sub-block entropy value according to formula (2):
[0170]
[0171] Step 2.1.3 calculates the sub-block contrast according to formula (3):
[0172]
[0173] Step 2.1.4 assigns different weights to the three eigenvalues of energy, entropy, and contrast of all sub-blocks through mean square error, and calculates the final eigenvalues J, H, and D;
[0174] For example, the calculation steps of the final eigenvalue J are as follows:
[0175]
[0176]
[0177]
[0178] The MSE m is the sub-block mean square error, is the sub-block weight, k num is the number of sub-blocks;
[0179] Step 2.1.5 assigns weights w1, w2, and w3 to the three final eigenvalues and calculates the texture complexity f, where w1, w2, and w3 are determined by the global optimization algorithm:
[0180] f=w1×J+w2×H+w3×D (4)
[0181] Step 2.2 If the sub-block texture complexity f is greater than the threshold T_c, it is a texture block, otherwise it is a smooth block, T_c = 0.7, such as Figure 3 As shown;
[0182] Step 2.3 generates the position map map_ROI_complexity, where 1 and 0 represent texture blocks and flat sliders respectively. Huffman coding is then used for compression, and 14 bits are used to store the compressed length. Finally, the length information and the entire auxiliary information are concatenated to form the auxiliary information aux_complexity, as shown in the following example: Figure 2 (c);
[0183] Step 2.4: Divide each 4×4 sub-block of the ROI area into two non-intersecting parts using a checkerboard cross-section. and like Figure 4 As shown, the first part is stored in positive order, and the second part is stored in reverse order;
[0184]
[0185] Step 2.5 takes out the first part of the positive order storage and performs different types of compressed sensing according to the texture category of this block, such as Figure 5 As shown:
[0186] Step 2.5.1 For a texture block, calculate the average value ave of all pixels in the sub-block m , high average value h m and low average l m , as shown in formula (6-8), where x n is the number of pixels in the block that are above the average, P m is the pixel value;
[0187]
[0188]
[0189]
[0190] The high mean value h m The pixels with low average value are marked as 1. m The pixels are marked as 0, and the bitmap block_loc_map is generated. The bitmap and the binary high average value h m and binary low mean l m Combine and generate sub-block recovery information reduction_part_1;
[0191] Step 2.5.2: For the smooth block, use formula (6) to calculate the sub-block average value, convert it into binary, and construct the recovery information reduction_part_1;
[0192] Step 2.6 retrieves the second part stored in reverse order and performs compressed sensing as in steps 2.1-2.4 to determine the texture category of this block. Then, perform different compression operations on the texture block and the slider according to step 2.5.1 or 2.5.2, and finally generate binary reduction information reduction_part_2.
[0193] Step 2.7: Compress {reduction_part_1, reduction_part_2} using Huffman coding, and store the compressed length {reduction_part_1_length, reduction_part_2_length} in 20-bit binary format.
[0194] Step 3. Set pixel-level and block-level detection bits in the ROI area;
[0195] Step 3.1 is the same as step 2.4. Divide each 4×4 sub-block of the ROI area into two non-intersecting parts in a chessboard-like manner. and
[0196] Step 3.2 constructs the first part of the check digit, such as Figure 6 (a) shows:
[0197] Step 3.2.1 First, use formula (9) to convert the pixel value P m Convert to binary form, for the first part of pixels in the sub-block, except for the last pixel, keep the first 7 bits unchanged and the last bit zero; for the last pixel, keep its first 6 bits unchanged and the last two bits zero;
[0198]
[0199] Step 3.2.2 Use formula (10) to determine the number of 0s and 1s in the first 7 bits of each pixel. If the number of 1s is large, the check bit is 1, otherwise it is 0, and the check bit P is set to 0. I Placed in the 8th bit of each pixel;
[0200]
[0201] Step 3.2.3 XOR the first 7 bits of each pixel except the last pixel to form the check bit B I , assigned to the 7th bit of the last pixel;
[0202] Step 3.3 constructs the second part of the check digit, such as Figure 6 (b) shows:
[0203] Step 3.3.1: For the second part of pixels in the sub-block, keep the first 7 bits of each pixel unchanged and set the last bit to zero.
[0204] Step 3.3.2: Convert the first seven digits of the first pixel into decimal, divide it by 128, and get a decimal between 0 and 1, retaining three decimal places to generate the first parameter para_1.
[0205] Step 3.3.3 Convert the first 7 bits of the other pixels into decimal and add them together to generate the second parameter para_2;
[0206] Step 3.3.4: Let Z0 = para_1, a = para_2, and use ICMIC mapping as shown in formula (11) to generate a random sequence;
[0207]
[0208] Step 3.3.5: Take the first four different values of the random sequence and sort them. Convert the sort index values 0-3 into 2-bit binary digits and concatenate them together to form an 8-bit block-level check bit, which is placed at the last bit of each pixel.
[0209] Step 4. Hiding the restored information in the RONI region based on the reference matrix and cross embedding technology;
[0210] Step 4.1: Construct the embedding reference matrix C, as shown in formula (12, 13), where i and j both belong to [0, 255], set the initial value C(0, 0) = 0, and the constraint is that the values in each 3×3 block in the reference matrix C are not repeated and are 0-8, as shown in Figure 7 As shown;
[0211] C(i+1,j)=(C(i,j)+1)mod9 (12)
[0212] C(i,j+1)=(C(i,j)+3)mod9 (13)
[0213] Step 4.2: Divide the RONI region into 2×2 sub-blocks. The upper left and lower right of each sub-block form a pixel pair, and the lower left and upper right form another pixel pair.
[0214] Step 4.3 embeds the auxiliary information aux_ROI_area into the LSB of the 1st and 2nd rows of the image;
[0215] Step 4.4: The auxiliary information aux_complexity is combined with the recovery information reduction_part_1 as the first part of the information to be embedded in the positive order (i.e., from left to right, from top to bottom); reduction_part_2 is embedded as the second part of the information to be embedded in the reverse order (i.e., from right to left, from bottom to top);
[0216] Step 4.5: Convert every 3 bits of binary information to be embedded into 1 octal bit;
[0217] Step 4.6 Calculate the difference X between the sub-block pixel pairs using formula (14) d , X L and X R Two pixel values corresponding to pixel pairs respectively;
[0218] X d =X L -X R (14)
[0219] Step 4.7: Based on the relationship between the difference and the threshold, the reference matrix C is used to implement replacement embedding.
[0220] If X d If it is less than or equal to the threshold value T_dif, then proceed as follows (1)-(3):
[0221] (1) Overflow handling
[0222] If there is a pixel value of 0 or 255 in the pixel pair, set 0 to 1 and 255 to 254;
[0223] (2) Positioning
[0224] The pixel pair (X L ,X R ) corresponds to the reference matrix C and finds the corresponding point R t (X L ,X R );
[0225] (3) Embedding
[0226] R t (X L ,X R) Search for the position of the octal information b to be embedded within the 3×3 matrix centered at [the center point], and find the corresponding coordinates (X L ′, X R ′). Use formula (15) to modify the original pixel pair (X L , X R ) to (X L ′, X R ′), where M ∈ [-1, 1], and i, j represent position indices;
[0227] (X L ′, X R ′) = (X L ± M i , X R ± M j ) if C(X L ± M i , X R ± M j ) == b (15)
[0228] Suppose there is a pixel pair (4, 4), the secret information bit is 1, and the threshold T_dif is set to 3; judge X d = 4 - 4 = 0 < T_dif, find the coordinate of the position where the secret information bit is located (5, 5), and modify the original pixel pair (4, 4) to the stego pixel pair (5, 5), as shown in Figure 8 (a);
[0229] If X d is greater than the threshold T_dif, then proceed as follows (1)-(4):
[0230] (1) Overflow handling
[0231] If there is a pixel value of 0 or 255 in the pixel pair, set the 0 value to 2 and the 255 value to 253;
[0232] (2) Positioning
[0233] Map the pixel pair (X L , X R ) to the reference matrix C and find the corresponding point R t (X L , X R );
[0234] (3) Determine the embedding range
[0235] For the octal b of the information to be embedded, determine the embedding range according to the sign of X d :
[0236] If X d is positive, within (X L , XR ) to (X L +2,X R -2) to find the location of b within the rectangular range;
[0237] If X d is negative, in (X L ,X R ) to (X L -2,X R +2) to find the location of b within the rectangular range;
[0238] (4) Embedding
[0239] According to formula (16), find the corresponding coordinates (X L ′,X R ′), the original pixel pair (X L ,X R ) is changed to (X L ′,X R ′), where U∈[0,2], V∈[-2,0], i, j represent position indices, such as Figure 8 (b)
[0240]
[0241] The histogram comparison between the watermarked image and the original image is as follows Figure 9 As shown; Figure 9 In the figure, (a1-n1) represents the histogram of the original image, and (a2-n2) represents the histogram of the encrypted image.
[0242] The PSNR, SSIM and NCC values of the watermarked image and the original image are shown in Table 2.
[0243] Table 2
[0244]
[0245] Step 5. Image copy-paste attack detection:
[0246] The step 5 is specifically as follows
[0247] Step 5.1: To resist the copy-paste attack, not limited to the ROI area, the entire image is divided into 4×4 sub-blocks p, and the sub-block gradient size and gradient direction are calculated using formulas (17-20):
[0248] p h =(p(i,j-1)-p(i,j+1))+(p(i+1,j)-p(i-1,j)) (17)
[0249] p o=(p(i-1,j-1)-p(i+1,j+1))+(p(i+1,j-1)-p(i-1,j+1)) (18)
[0250] grad size (f)=|p h |+|p o | (19)
[0251]
[0252] Step 5.2 performs block scanning in a block overlapping manner with a scanning step size of 1, such as Figure 10 As shown;
[0253] Step 5.3: Divide the 4×4 sub-block into four 2×2 sub-units, calculate the gradient magnitude and gradient direction in each sub-unit, and represent them with a gradient histogram.
[0254] Step 5.4 Construct sub-block features
[0255] Connect the gradient histograms of the four sub-units to form the sub-block feature value 1; then perform DCT transformation on the 4×4 sub-block, and use the value of the first row and first column in the upper left corner of the coefficient matrix as the sub-block feature value 2. Combine the two features together to construct the sub-block feature character_all;
[0256] Step 5.5: Subtract the eigenvalues of all 4×4 blocks pairwise to get dif_value ij , where i≠j, as shown in formula (21):
[0257] dif_value ij =character_all i -character_all j (twenty one)
[0258] Step 5.6 Set the threshold mark_yy and the difference dif_value ij Compare with the threshold mark_yy and use formula (22) to determine whether it is a copy and paste tampering block. If dif_value ij If it is less than or equal to mark_yy, it means that the two blocks are the same, that is, the blocks are copied and pasted, and the detection result S ij Set to 1; otherwise, the detection result S ij Set to 0, indicating that the block is not copied and pasted;
[0259]
[0260] Step 5.7 Mark the copied and pasted blocks that belong to the ROI area: D i={d i |i=1,2,…,n};
[0261] Step 5.8: Further locate the ROI area using the neighborhood method and copy and paste the tampered block:
[0262] For all sub-blocks in the ROI area, the number of tampered blocks in its 8-neighborhood is calculated. If it is greater than or equal to 5, this block is determined to be a tampered block, otherwise this block is a non-tampered block, as shown in formula (23), where N8(d i ) means d i The number of tampered blocks in the 8 fields;
[0263]
[0264] Figure 11 The results of anti-copy and paste attack are given. Figure 11 In the figure, (a, e, i) represent the three original images, (b, f, j) represent the images after the copy-paste attack, (c, g, k) represent the images with the tampered areas identified, and (d, h, i) represent the restored images.
[0265] Step 6. Double tamper detection and positioning in the ROI area:
[0266] Step 6.1 extracts the ROI area auxiliary information aux_ROI_area from the LSBs of the first and second rows of the image, and determines the ROI area by the number of ROI areas area_num and the coordinates of the upper left corner and lower right corner of each ROI area loc_LRs;
[0267] Step 6.2: Divide each 4×4 sub-block of the ROI area into two non-intersecting parts in a chessboard-like manner according to formula (5). and The first part is stored in positive order, and the second part is stored in reverse order;
[0268] Step 6.3 First level tamper detection and positioning:
[0269] Step 6.3.1 Take the 7th bit of the last pixel in the first part of the sub-block in positive order to obtain the detection bit B I ;
[0270] Step 6.3.2 XOR the first 7 bits of the remaining pixels to obtain a detection bit B I ';
[0271] Step 6.3.3 Block-level detection: B I and B I 'Compare them, if they are different, the sub-block is considered to have been tampered with, otherwise, it is considered not to have been tampered with, thus achieving block-level tamper detection and positioning;
[0272] Step 6.3.4 Extract the last bit of each pixel as the detection bit P I ;
[0273] Step 6.3.5 Count the number of 1s and 0s in the first 7 bits of each pixel. If there are more 1s, detect the bit P. I ' is 1, otherwise it is 0;
[0274] Step 6.3.6: P I ′ and P I Compare and find out if they are different, then the pixel is considered to have been tampered with. Otherwise, it is considered not to have been tampered with, thus achieving pixel-level tampering detection and positioning.
[0275] Step 6.3.7 Generate a position map LP1 of the same size as the image ROI area, marking whether the pixel has been tampered with. If it is tampered, it is marked as 1, otherwise it is marked as 0;
[0276] Step 6.4 Second level of tamper detection and positioning:
[0277] Step 6.4.1 Take the 8th bit of all pixels in the second part of the sub-block in reverse order and splice them together to form W I ;
[0278] Step 6.4.2: Take the first 7 bits of the first pixel, convert them to decimal, and divide them by 128 to get a decimal between 0 and 1. Keep three decimal places to generate the first parameter para_1.
[0279] Step 6.4.3: Convert the first 7 bits of the other pixels into decimal and add them together to generate the second parameter para_2.
[0280] Step 6.4.4: Let Z0 = para_1, a = para_2, and generate a random sequence using ICMIC mapping as shown in formula (11);
[0281] Step 6.4.5: Take the first 4 different values of the random sequence and sort them. Convert the sort index values 0-3 into 2-bit binary and splice them together to form an 8-bit block-level check bit W. I ';
[0282] Step 6.4.6 Determine W I ′ and W I If they are the same, generate a position map LP2 of the same size as the image ROI area, mark whether the pixel has been tampered with, and mark it as 1 if it is tampered with, otherwise mark it as 0;
[0283] Step 6.5: Merge the position maps LP1 and LP2 into LP. If LP1 or LP2 is marked as tampered, the pixel is considered tampered and set to 1. Otherwise, it is considered not tampered and set to 0, as shown in formula (24).
[0284]
[0285] Step 6.6 Use the directional sub-band to further determine the tampered block
[0286] For each sub-block, four directional bands are defined, namely S, SW, W; W, NW, N; N, NE, E; E, SE, S; where S represents the block located in the south of the block, W represents the block located in the west of the block, SW represents the block located in the southwest of the block, and so on; if all four directional bands of a block are tampered, then the block is considered to be a tampered block, otherwise it is considered to be a non-tampered block, as shown in formula (25), where N4(d i ) means d i The number of tampered items in the four direction bands;
[0287]
[0288] The present invention corresponds to the tampering recovery method of the medical image tampering detection method based on texture cross embedding, as shown in FIG. Figure 1 (b), proceed as follows:
[0289] Step 7.1: Construct the embedding reference matrix C, as shown in formulas (12, 13), where i and j are both in the range [0, 255]. Set the initial value C(0, 0) = 0. The constraint is that the values in each 3×3 block in the reference matrix C are unique and range from 0 to 8.
[0290] Step 7.2: Divide the RONI region into 2×2 sub-blocks. For each sub-block, the upper left and lower right constitute a pixel pair, and the lower left and upper right constitute another pixel pair.
[0291] Step 7.3 Based on the pixel pair (X L ,X R ) According to the coordinate method, it corresponds to the reference matrix C and extracts the corresponding value R t (X L ,X R ), get secret information;
[0292] Step 7.4: Take the first 5 extracted information, convert it into decimal, and calculate the length of the compressed position map;
[0293] Step 7.5 continues to extract the compressed position map of the same length from the back, decompress it, and form a texture classification position map;
[0294] Step 7.6 extracts the first part of the secret information in positive order and extracts the second part in reverse order;
[0295] Step 7.7: Determine the compressed sensing classification based on the position map identifier. Texture blocks are represented by 24 bits, and smooth blocks are represented by 8 bits. If it is a texture block, split the 24 bits into 8+8+8, where the first 8 bits represent the high average value, the second 8 bits represent the low average value, and the third 8 bits represent the value distribution position map in the corresponding block.
[0296] In step 7.8, for texture blocks, replace 1 in the position map with a high average value and replace 0 with a low average value, and finally form a restored block; for smooth blocks, directly convert 8 bits to decimal to replace the first part of pixels in the block to complete image restoration.
[0297] The comparison data of the restored image and the original image are shown in Table 3; the comparison with other literature is shown in Table 4.
[0298] Table 3
[0299]
[0300] Table 4
[0301]
[0302] [1]Geetha R,Geetha S. Embedding electronic patient information inclinical images: an improved and efficient reversible data hiding technique[J].Multimedia Tools and Applications, 2020,79(8).
[0303] [2]Geetha,R.,Geetha,S.(2018).Improved Reversible Data Embedding inMedical Images Using I-IWT and Pairwise Pixel Difference Expansion.In:Bhattacharyya,P.,Sastry,H.,Marriboyina,V.,Sharma,R.(eds)Smart and InnovativeTrends in Next Generation Computing Technologies.NGCT 2017.Communications inComputer and Information Science,vol 828.Springer,Singapore.https: / / doi.org / 10.1007 / 978-981-10-8660-1_45.
[0304] [3]Yang Y,Zhang W M,Liang,D,et al.A ROI-based high capacityreversible data hiding scheme with contrast enhancement for medical images[J].Multimedia tools and applications,2018,77(14):18043-18065.DOI:10.1007 / s11042-017-4444-0。
Claims
1. A medical image tampering detection method based on texture cross embedding, characterized by Follow the steps below: Step 1. Divide the medical image into ROI region and RONI region; Step 2. Calculate the texture complexity of the ROI region based on different features, and divide the ROI region into texture blocks and flat sliders based on the texture complexity. Use compressed sensing technology to extract different features in different blocks as recovery information. Step 2.1 Calculate the texture complexity of the ROI area sub-block: Step 2.2: If the sub-block texture complexity is greater than the threshold, it is a texture block; otherwise, it is a smooth block. Step 2.3 generates a position map, using 1 and 0 to represent texture blocks and flat sliders respectively, and then uses Huffman coding to compress it, using 14 binary bits to store the compressed length. Finally, the length information and the entire auxiliary information are concatenated to form the auxiliary information aux_complexity; Step 2.4: Divide each 4×4 sub-block of the ROI area into two non-intersecting parts using a checkerboard cross-section. and The first part is stored in positive order, and the second part is stored in reverse order; Step 2.5 takes the first part and performs different types of compressed sensing based on the texture category of this block to generate sub-block recovery information reduction_part_1: Step 2.6 takes out the second part and performs compressed sensing in the same way as steps 2.1-2.4 to determine the texture category of this block. Then, different compression operations are performed on the texture block and the flat slider respectively, and finally binary reduction information reduction_part_2 is generated. Step 3. Set pixel-level and block-level detection bits in the ROI area; Step 3.1 Divide each 4×4 sub-block of the ROI area into two non-intersecting parts in a chessboard-like manner and Step 3.2 Construct the first part of the check digit: Step 3.2.1 First, use formula (9) to convert the pixel value P m Convert to binary form, for the first part of pixels in the sub-block, except for the last pixel, keep the first 7 bits unchanged and the last bit zero; for the last pixel, keep its first 6 bits unchanged and the last two bits zero; Step 3.2.2 Use formula (10) to determine the number of 0s and 1s in the first 7 bits of each pixel. If the number of 1s is large, the check bit is 1, otherwise it is 0, and the check bit P is set to 0. I Placed in the 8th bit of each pixel; Step 3.2.3 XOR the first 7 bits of each pixel except the last pixel to form the check bit B I , assigned to the 7th bit of the last pixel; Step 3.3 Construct the second part of the check digit: Step 3.3.1: For the second part of pixels in the sub-block, keep the first 7 bits of each pixel unchanged and set the last bit to zero. Step 3.3.2 Convert the first seven digits of the first pixel into decimal, divide it by 128, and get a decimal between 0 and 1, retaining three decimal places to generate the first parameter para_1; Step 3.3.3 Convert the first 7 bits of the other pixels into decimal and add them together to generate the second parameter para_2; Step 3.3.4: Let Z0 = para_1, a = para_2, and use ICMIC mapping as shown in formula (11) to generate a random sequence; Step 3.3.5: Take the first four different values of the random sequence and sort them. Convert the sort index values 0-3 into 2-bit binary digits and concatenate them together to form an 8-bit block-level check bit, which is placed at the last bit of each pixel. Step 4. Hiding the restored information in the RONI region based on the reference matrix and cross embedding technology; Step 5. Image copy and paste attack detection; Step 6. Double tampering detection and positioning in the ROI area.
2. The medical image tampering detection method based on texture cross embedding according to claim 1 is characterized by: The step 1 is specifically as follows: Step 1.1 Convert the medical image img_mark into grayscale image format img_origin; Step 1.2: Identify the edge line position of the ROI area manually marked by the doctor, assign the edge line pixels to 1 in the binary matrix img_edge, and assign the remaining pixels to 0; Step 1.3 Scan the matrix img_edge and fill the inner area of the edge with 1 to form the ROI area img_area, and the rest is the RONI area; Step 1.4: Divide the ROI area img_area into 4×4 blocks and determine whether there are any pixel values 1 in the block. If so, change all the pixels in the block to 1; otherwise, do nothing. Step 1.5 constructs auxiliary information aux_ROI_area, including the number of ROI areas area_num, and the coordinates of the upper left corner and lower right corner of each ROI area loc_LRs; The step 4 is specifically as follows: Step 4.1: Construct the embedding reference matrix C, as shown in formulas (12, 13), where i and j both belong to [0, 255]. Set the initial value C(0, 0) = 0. The constraint is that the values in each 3×3 block in the reference matrix C are non-repeated and range from 0 to 8. C(i+1,j)=(C(i,j)+1)mod 9 (12) C(i,j+1)=(C(i,j)+3)mod 9 (13) Step 4.2: Divide the RONI region into 2×2 sub-blocks. The upper left and lower right of each sub-block form a pixel pair, and the lower left and upper right form another pixel pair. Step 4.3 embeds the auxiliary information aux_ROI_area into the LSB of the 1st and 2nd rows of the image; Step 4.4: The auxiliary information aux_complexity is combined with the recovery information reduction_part_1 as the first part of the information to be embedded in the forward order; reduction_part_2 is embedded as the second part of the information to be embedded in the reverse order; Step 4.5: Convert every 3 bits of binary information to be embedded into 1 octal bit; Step 4.6 Calculate the difference X between the sub-block pixel pairs using formula (14) d , X L and X R Two pixel values corresponding to pixel pairs respectively; X d =X L -X R (14) Step 4.7: Based on the relationship between the difference and the threshold, the reference matrix C is used to implement replacement embedding. If X d If it is less than or equal to the threshold value T_dif, then proceed as follows (1)-(3): (1) Overflow handling If there is a pixel value of 0 or 255 in the pixel pair, set 0 to 1 and 255 to 254; (2) Positioning The pixel pair (X L ,X R ) corresponds to the reference matrix C and finds the corresponding point R t (X L ,X R ); (3) Embedding R t (X L ,X R ) is the center point of the 3×3 matrix to find the location of the octal information b to be embedded, and find the corresponding coordinates (X L ′,X R ′), use formula (15) to convert the original pixel pair (X L ,X R ) is changed to (X L ′,X R ′), where M∈[-1,1], i, j represent position indexes; (X L ′,X R ′)=(X L ±M i ,X R ±M j ) if C(X L ±M i ,X R ±M j )==b (15) If X d If it is greater than the threshold value T_dif, then proceed as follows (1)-(4): (1) Overflow handling If there is a pixel value of 0 or 255 in the pixel pair, set the value of 0 to 2 and the value of 255 to 253; (2) Positioning The pixel pair (X L ,X R ) corresponds to the reference matrix C and finds the corresponding point R t (X L ,X R ); (3) Determine the embedding range For the octal information b to be embedded, according to X d The sign of determines the embedding range: If X d is positive, in (X L ,X R ) to (X L +2,X R -2) to find the location of b within the rectangular range; If X d is negative, in (X L ,X R ) to (X L -2,X R +2) to find the location of b within the rectangular range; (4) Embedding According to formula (16), find the corresponding coordinates (X L ′,X R ′), the original pixel pair (X L ,X R ) is changed to (X L ′,X R ′), where U∈[0,2], V∈[-2,0], i, j represent position indices; The step 5 is specifically as follows Step 5.1: Divide the entire image into 4×4 sub-blocks p and use formulas (17-20) to calculate the sub-block gradient magnitude and gradient direction: p h =(p(i,j-1)-p(i,j+1))+(p(i+1,j)-p(i-1,j)) (17) p o =(p(i-1,j-1)-p(i+1,j+1))+(p(i+1,j-1)-p(i-1,j+1)) (18) grad size (f)=|p h |+|p o | (19) Step 5.2: Perform block scanning in a block overlapping manner with a scanning step size of 1; Step 5.3: Divide the 4×4 sub-block into four 2×2 sub-units, calculate the gradient magnitude and gradient direction in each sub-unit, and represent them with a gradient histogram. Step 5.4 Construct sub-block features Connect the gradient histograms of the four sub-units to form the sub-block feature value 1; then perform DCT transformation on the 4×4 sub-block, and use the value of the first row and first column in the upper left corner of the coefficient matrix as the sub-block feature value 2. Combine the two features together to construct the sub-block feature character_all; Step 5.5: Subtract the eigenvalues of all 4×4 blocks pairwise to get dif_value ij , where i≠j, as shown in formula (21): dif_value ij =character_all i -character_all j (21) Step 5.6 Set the threshold mark_yy and the difference dif_value ij Compare with the threshold mark_yy and use formula (22) to determine whether it is a copy and paste tampering block. If dif_value ij If it is less than or equal to mark_yy, it means that the two blocks are the same, that is, the blocks are copied and pasted, and the detection result S ij Set to 1; otherwise, the detection result S ij Set to 0, indicating that the block is not copied and pasted; Step 5.7 Mark the copied and pasted blocks that belong to the ROI area: D i ={d i |i=1,2,…,n}; Step 5.8: Further locate the ROI area using the neighborhood method and copy and paste the tampered block: For all sub-blocks in the ROI area, the number of tampered blocks in its 8-neighborhood is calculated. If it is greater than or equal to 5, this block is determined to be a tampered block, otherwise this block is a non-tampered block, as shown in formula (23), where N8(d i ) means d i The number of tampered blocks in the 8 fields; The step 6 is specifically as follows: Step 6.1 extracts the ROI area auxiliary information aux_ROI_area from the LSBs of the first and second rows of the image, and determines the ROI area by the number of ROI areas area_num and the coordinates of the upper left corner and lower right corner of each ROI area loc_LRs; Step 6.2: Divide each 4×4 sub-block of the ROI area into two non-intersecting parts in a chessboard-like manner according to formula (5). and The first part is stored in positive order, and the second part is stored in reverse order; Step 6.3 First level tamper detection and positioning: Step 6.3.1 Take the 7th bit of the last pixel in the first part of the sub-block in positive order to obtain the detection bit B I ; Step 6.3.2 XOR the first 7 bits of the remaining pixels to obtain a detection bit B I '; Step 6.3.3 Block-level detection: B I and B I 'Compare them, if they are different, the sub-block is considered to have been tampered with, otherwise, it is considered not to have been tampered with, thus achieving block-level tamper detection and positioning; Step 6.3.4 Extract the last bit of each pixel as the detection bit P I ; Step 6.3.5 Count the number of 1s and 0s in the first 7 bits of each pixel. If there are more 1s, detect the bit P. I ' is 1, otherwise it is 0; Step 6.3.6: P I ′ and P I Compare and find out if they are different, then the pixel is considered to have been tampered with. Otherwise, it is considered not to have been tampered with, thus achieving pixel-level tampering detection and positioning. Step 6.3.7 Generate a position map LP1 of the same size as the image ROI area, marking whether the pixel has been tampered with. If it is tampered, it is marked as 1, otherwise it is marked as 0; Step 6.4 Second level of tamper detection and positioning: Step 6.4.1 Take the 8th bit of all pixels in the second part of the sub-block in reverse order and splice them together to form W I ; Step 6.4.2: Take the first 7 bits of the first pixel, convert them to decimal, and divide them by 128 to get a decimal between 0 and 1. Keep three decimal places to generate the first parameter para_1. Step 6.4.3: Convert the first 7 bits of the other pixels into decimal and add them together to generate the second parameter para_2. Step 6.4.4: Let Z0 = para_1, a = para_2, and generate a random sequence using ICMIC mapping as shown in formula (11); Step 6.4.5: Take the first 4 different values of the random sequence and sort them. Convert the sort index values 0-3 into 2-bit binary and splice them together to form an 8-bit block-level check bit W. I '; Step 6.4.6 Determine W I ′ and W I If they are the same, generate a position map LP2 of the same size as the image ROI area, mark whether the pixel has been tampered with, and mark it as 1 if it is tampered with, otherwise mark it as 0; Step 6.5: Merge the position maps LP1 and LP2 into LP. If LP1 or LP2 is marked as tampered, the pixel is considered tampered and set to 1. Otherwise, it is considered not tampered and set to 0, as shown in formula (24). Step 6.6 Use the directional sub-band to further determine the tampered block For each sub-block, four directional bands are defined, namely (S, SW, W), (W, NW, N), (N, NE, E), (E, SE, S), where S represents the block located in the south of the block, W represents the block located in the west of the block, SW represents the block located in the southwest of the block, and so on; if all four directional bands of a block are tampered, then the block is considered to be a tampered block, otherwise it is considered to be a non-tampered block, as shown in formula (25), where N4(d i ) means d i The number of tampered items in the four direction bands; 3. A tampering recovery method corresponding to the medical image tampering detection method based on texture cross embedding according to claim 2, characterized in that Follow these steps: Step 7.1: Construct the embedding reference matrix C, as shown in formulas (12, 13), where i and j are both in the range [0, 255]. Set the initial value C(0, 0) = 0. The constraint is that the values in each 3×3 block in the reference matrix C are unique and range from 0 to 8. Step 7.2: Divide the RONI region into 2×2 sub-blocks. For each sub-block, the upper left and lower right constitute a pixel pair, and the lower left and upper right constitute another pixel pair. Step 7.3 Based on the pixel pair (X L ,X R ) According to the coordinate method, it corresponds to the reference matrix C and extracts the corresponding value R t (X L ,X R ), get secret information; Step 7.4: Take the first 5 extracted information, convert it into decimal, and calculate the length of the compressed position map; Step 7.5 continues to extract the compressed position map of the same length from the back, decompress it, and form a texture classification position map; Step 7.6 extracts the first part of the secret information in positive order and extracts the second part in reverse order; Step 7.7: Determine the compressed sensing classification based on the position map identifier. Texture blocks are represented by 24 bits, and smooth blocks are represented by 8 bits. If it is a texture block, split the 24 bits into 8+8+8, where the first 8 bits represent the high average value, the second 8 bits represent the low average value, and the third 8 bits represent the value distribution position map in the corresponding block. In step 7.8, for texture blocks, replace 1 in the position map with a high average value and replace 0 with a low average value, and finally form a restored block; for smooth blocks, directly convert 8 bits to decimal to replace the first part of pixels in the block to complete image restoration.
Citation Information
Patent Citations
Digital image authentication method based on super-pixels
CN104778651A
Robust watermarking method based on ROI and IWT medical image tampering authentication and recovery
CN112085016A