An improved color image tampering detection and self-recovery method
By introducing the SparseViT algorithm, dynamic diagonal mapping and improved tent chaos mapping, combined with hash authentication and three-layer authentication mechanism, the watermark embedding and detection and recovery of color images is optimized, and the problems of insufficient robustness, concealment, security and efficiency in the existing technology are solved, and high-quality tamper detection and recovery are achieved.
Patent Information
- Application Number
- CN202510622324.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-15
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2045-05-15
AI Technical Summary
The existing watermarking technology is insufficient in robustness, concealment, security and processing efficiency in color image processing, and detection accuracy and recovery quality need to be improved, especially in the face of complex attacks and large-scale data.
The SparseViT algorithm, dynamic diagonal mapping and improved tent chaos mapping technology are adopted, combined with hash authentication features and three-layer authentication mechanisms, and the watermark embedding and detection recovery process is optimized through the embedding position selection and block pixel-level recovery mechanism based on the human eye vision system.
It improves the robustness and security of watermark images, enhances the accuracy and recovery quality of tamper detection, reduces the complexity of algorithms, reduces the phenomenon of false detection, and improves processing efficiency.
Smart Images

Figure CN120125416B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to an improved color image tampering detection and self-recovery method. Background Art
[0002] With the rapid development of digital image processing technology, images face the risk of tampering during transmission, storage, and sharing, which can cause serious economic and social problems in industries such as industry, healthcare, and justice. To address this challenge, digital watermarking technology has emerged, which verifies the integrity and authenticity of images by embedding invisible watermark information in them. However, existing watermarking technologies still have shortcomings in terms of watermark image quality, tamper detection accuracy, and content recovery quality, especially in color image processing. In addition, with the development of AI technology, technologies for automatically identifying and removing watermarks are constantly emerging, placing higher demands on the watermark's anti-attack resistance.
[0003] The existing technologies are as follows:
[0004] Color Image Tampering Detection and Self-Recovery Based on Fragile Watermarks: This scheme proposes a color image tampering detection and self-recovery method based on fragile watermarks. The watermark information is embedded by combining block-based regular labeling and pixel-based continuous labeling, improving the quality of the watermarked image. This method also develops a feature-extraction-based diagonal block tampering detection scheme combined with three-layer authentication to resist tampering attacks of various shapes and sizes. Furthermore, a block-pixel-level recovery mechanism and a smoothing inpainting algorithm are designed to achieve high-quality restoration of tampered images. Experimental results demonstrate that this scheme has superior performance in tampering detection and image self-recovery.
[0005] Image tampering detection based on SparseViT: SparseViT is a visual Transformer model based on a sparse self-attention mechanism. Through its sparse computational model, it enables the model to adaptively extract non-semantic features for image tampering detection. This model not only avoids manual feature extraction but also significantly reduces computational effort, achieving state-of-the-art performance on multiple datasets. Furthermore, the model introduces a learnable multi-scale feature fusion mechanism, further improving its generalization capabilities.
[0006] Deep learning-based watermarking methods; Deep learning watermarking algorithms are emerging digital watermarking methods based on deep learning technology, differing from traditional digital watermarking methods. Traditional methods rely on signal processing, information theory, and cryptography, using hand-crafted algorithms to embed and extract watermarks. In contrast, deep learning watermarking algorithms utilize deep learning models such as neural networks to process watermark information. Existing deep learning-based watermarking solutions primarily use the END framework, which consists of three components: an encoder, a noise layer, and a decoder.
[0007] Disadvantages of existing technology
[0008] (1) Lack of robustness: Existing watermarking technology is easily destroyed when facing various attacks (such as image compression, rotation, scaling, etc.), making it impossible to detect or extract the watermark, thereby reducing the reliability and effectiveness of the watermark.
[0009] (2) Insufficient concealment: While existing watermarking technologies can protect the original data, the concealment of the watermark is not strong enough, and there is a certain risk of leakage, which makes it easy to be discovered.
[0010] (3) Insufficient security: Existing watermarking technology is easily detected and modified by attackers, such as by adding noise or performing operations such as cutting, scaling, and rotating, which may cause the watermark to be forged or tampered with.
[0011] (4) Low processing efficiency: Many digital watermarking algorithms require complex encryption and decryption processes to protect the security of the watermark, which increases the complexity of the algorithm and increases the cost of hardware and software.
[0012] (5) False detection problem: Some digital watermarking algorithms may cause false detection, that is, images or texts without watermarks are mistakenly marked as having watermarks, which may lead to unnecessary disputes and controversies. Summary of the Invention
[0013] The technical problem to be solved by the present invention is to provide an improved color image tampering detection and self-recovery method, which aims to solve the many shortcomings of existing watermark technology in color image processing, and at the same time cope with the new challenges brought about by the diversification of digital media content and the complexity of network environment. Specifically, the present invention is committed to solving the following technical problems: First, the performance of existing watermark technology in color image tampering detection and recovery is insufficient. Especially in practical application scenarios such as smart cities, the demand for tampering detection and recovery of color images is increasing, while traditional watermark technology mainly focuses on grayscale images and cannot effectively process color images; second, the problem of watermark image quality degradation. The existing technology may have a great impact on the image quality after embedding the watermark, especially in color images. The present invention selects the area with the least visual impact to embed the watermark through an embedding position selection method based on the human visual system (HVS), thereby minimizing the impact on image quality while ensuring the robustness of the watermark; third, the accuracy of tampering detection is insufficient. The existing technology has limited detection accuracy when facing complex attacks and large-scale data. The present invention introduces S The parseViT algorithm, dynamic diagonal mapping, and improved tent chaotic mapping technologies generate more robust and discriminative watermark information, and combine feature extraction with a three-layer authentication mechanism to significantly improve the accuracy of tampering detection. Fourth, the problem of high-quality restoration of tampered areas. Existing technologies have deficiencies in restoration quality, especially in color images. The present invention combines a block-pixel-level restoration mechanism with an improved SmoothingInpainting algorithm to dynamically adjust restoration parameters and optimize restoration effects, achieving efficient and high-quality restoration of tampered areas. Fifth, the security and anti-attack capabilities of watermarks are relatively weak. Existing technologies are vulnerable to various attacks and threats. The present invention enhances the randomness and unpredictability of watermarks through dynamic diagonal mapping and improved tent chaotic mapping, further improving the security and robustness of watermarks. In addition, with the development of AI technology, technologies for automatic identification and removal of watermarks continue to emerge, which places higher demands on the anti-attack capabilities of watermarks. The present invention improves the anti-attack capabilities of watermarks by introducing advanced algorithms and technologies to meet these new challenges.
[0014] The present invention adopts the following technical solutions to achieve the invention objectives:
[0015] An improved color image tampering detection and self-recovery method, characterized by comprising the following steps:
[0016] S1: watermark generation;
[0017] S11: initial step;
[0018] S12: Authentication watermark generation: A hash authentication feature algorithm is used to establish feature dependencies between blocks to construct authentication bits;
[0019] S13: Summary image generation: Use the SparseViT algorithm to generate three minimum values; use the dynamic diagonal mapping algorithm to scramble and rearrange these three chaotic sequences to improve recovery quality and enhance security;
[0020] S2: watermark embedding;
[0021] S3: tamper detection;
[0022] S4: Self-recovery.
[0023] As a further limitation of this technical solution, the specific steps of S11 are:
[0024] The size is Color image Divide into multiple independent non-overlapping blocks , the size of each block is , for each divided block , we need to extract the three color component images in the RGB color space and record them as: 、 and .
[0025] As a further limitation of this technical solution, the specific steps of S12 are:
[0026] S121: three color component images 、 and Divide into multiple non-overlapping blocks ;
[0027] S122: Extract the most significant bit according to formula (1):
[0028] (1);
[0029] in: Indicates that the front of each pixel value is extracted Most significant bit;
[0030] Indicates rounding down;
[0031] S123: Use the hash function to calculate the block feature and extract the first four bits of the hash value as the self-block feature authentication bit ;
[0032] S124: Use the dynamic diagonal mapping algorithm as shown in formula (2) to locate the mapping block and extract the last 4 bits of the hash value as the feature authentication bits of the mapping block ;
[0033] (2);
[0034] in: represents the dynamic diagonal mapping algorithm;
[0035] S125: Reconstruct the self-block feature authentication bit according to formula (3) and the feature authentication bits of the mapping block To get non-overlapping blocks Authentication bits:
[0036] (3);
[0037] in: Represents a splicing operation.
[0038] As a further limitation of this technical solution, the specific steps of S13 are:
[0039] S131: Use SparseViT algorithm to process the red component image Perform feature extraction and generate recovery watermark ;
[0040] S132: Green component image and the blue component image Divide into non-overlapping blocks , use formula (4) to calculate the average intensity value of each block :
[0041] (4);
[0042] S133: From the average intensity value Extract the most significant bit as the block recovery bit , as shown in formula (5):
[0043] (5);
[0044] Where: d represents the number of MSB bits extracted;
[0045] S134: Restore all generated blocks to their original positions According to formula (6), the restored watermark is obtained and :
[0046] (6);
[0047] Among them: Recovery watermark and Respectively represent the images corresponding to the color components and Recovery watermark;
[0048] is the color component image and No. x Rank y The block recovery bit of the column;
[0049] Represents a character concatenation or vector concatenation operation, which is used to sequentially connect multiple recovery bits to form a complete watermark;
[0050] S135: In order to improve security and recovery rate, an improved diagonal tent chaotic mapping algorithm is used to shuffle and rearrange the watermark recovery 、 and To generate the corresponding recovery watermark 、 and Three copies of .
[0051] As a further limitation of this technical solution, the specific steps of S2 are:
[0052] S21: Mark position selection;
[0053] S211: Authentication data The mark position is ;
[0054] S212: Recovering Data The mark position is ;
[0055] S213: Recovering Data and The mark position is ;
[0056] S22: Embedding strategy;
[0057] S221: Recovering Data Embed 1-LSB;
[0058] S222: Recovering Data and Embedded into 2-LSB;
[0059] S223: Authentication data Data is embedded into 2-LSB or 3-LSB according to the embedding position;
[0060] S23: Generate a temporary watermark image;
[0061] S231: Finally generate a temporary watermark image ;
[0062] S232: The key length is determined by the block size, which is Bit;
[0063] S24: watermark payload;
[0064] The watermark payload is ;
[0065] S25: bit adjustment method;
[0066] In order to improve the quality of the image after embedding the watermark, the bit adjustment method is adopted. The specific adjustment rules are shown in formula (7):
[0067] (7);
[0068] in: is the original pixel;
[0069] Temporary watermark pixels The original pixel Difference;
[0070] is the final watermark pixel;
[0071] S26: Embedding position selection based on the human visual system.
[0072] As a further limitation of this technical solution, the specific steps of S3 are:
[0073] Received color image Divided into multiple independent non-overlapping blocks , the size of each block is ,at the same time, Respectively represent the color components of the received image in the RGB color space;
[0074] S31: Authentication bit calculation: For each block, the hash authentication feature algorithm calculates the authentication bit ;
[0075] S32: Extract watermark information: Extract 2-LSB or 3-LSB watermark information from the marked self-block pixels and generate the extracted authentication bit ;
[0076] S33: Authentication bit comparison: Compare and calculate the authentication bit and the extracted authentication bits , to determine non-overlapping blocks Whether it has been tampered with, calculate the authentication bit and the extracted authentication bits If equal, then the non-overlapping blocks It is considered that it has not been tampered with; otherwise, further judgment is required;
[0077] S34: Self-block feature comparison: Calculate authentication bit and the extracted authentication bits Not equal, compare the self-block feature authentication bit, if the self-block feature authentication bit and the extracted authentication bit If they are different, the block is considered to have been tampered with;
[0078] S35: Mapping block check: In order to find out the real reason for the difference in authentication information, check whether the mapping block has been tampered with; use the hash authentication feature algorithm to generate the mapping block authentication bit , and extract the hidden authentication information to generate , if the two match, the mapping block is considered not to have been tampered with, otherwise, it is considered a non-overlapping block been tampered with;
[0079] S36: Initial tamper detection results: After traversing all blocks, the initial tamper detection results of the three channels are obtained from the block feature authentication bit 、 and .
[0080] As a further limitation of this technical solution, the specific steps of S4 are:
[0081] S41: R channel self-recovery;
[0082] S411: Tamper detection results Divide into sizes Blocks, by reverse disrupting the tampering detection results Use keyG to obtain reverse tamper detection results ,According to the proposed mechanism, the tampering detection results Perform block-level first-level recovery and obtain recovery information ;
[0083] S412: Based on tampering detection results and recovery information , the next step is restored at the pixel level; pixel Reverse tampering detection results If it is marked as tampered, the bit is restored It is from Mapped pixels The embedded diagonal mapping is extracted from the recovered bits Otherwise, restore the is embedded in the red component image The self-recovery position ;
[0084] S413: Reconstruct and recover data using formulas (9) and (10):
[0085] (9);
[0086] (10);
[0087] in: yes Reconstruction recovery data;
[0088] Use SparseViT algorithm to Decode and obtain the corresponding decoded image ;
[0089] S42: G channel and B channel self-recovery;
[0090] S421: Block-level tampering detection results Use keyG and keyB to reverse scramble and get and ;
[0091] S422: Based on block-level diagonal mapping, the tamper detection results Reverse the order to obtain ;
[0092] S423: According to the reverse arrangement , reverse tampering detection results and , perform initial information reconstruction;
[0093] S424: The area affected by the tampering overlap problem is reconstructed using a smooth repair algorithm;
[0094] S425: Finally, we can obtain the following equation (11):
[0095] (11);
[0096] in: is the restored image obtained previously;
[0097] Represents the dot product operation;
[0098] Represents the restored image.
[0099] Compared with existing technologies, the advantages and positive effects of this invention include: Improved watermark image quality: This invention uses an embedding location selection method based on the human visual system (HVS) to embed watermark information in areas with minimal visual impact, thereby ensuring watermark robustness while minimizing the impact on image quality. In contrast, existing technologies can significantly affect image quality after watermark embedding, especially in color images. Improved tamper detection accuracy: This invention introduces technologies such as the SparseViT algorithm, dynamic diagonal mapping, and an improved tent chaotic mapping to generate more robust and discriminative watermark information. Combined with feature extraction and a three-layer authentication mechanism, this significantly improves tamper detection accuracy. In contrast, existing technologies have limited detection accuracy when facing complex attacks and large-scale data. Improved restoration quality of tampered areas: This invention uses a block-level pixel restoration mechanism combined with an improved Smoothing Inpainting algorithm to dynamically adjust restoration parameters and optimize restoration results, achieving efficient and high-quality restoration of tampered areas. In contrast, existing technologies have shortcomings in restoration quality, especially in color images. Enhanced watermark security and attack resistance: This invention enhances the randomness and unpredictability of the watermark through dynamic diagonal mapping and improved tent chaotic mapping, further improving the watermark's security and robustness. In comparison, existing technologies are vulnerable to various attacks and threats, resulting in weaker watermark security and attack resistance. Higher processing efficiency: This invention reduces algorithm complexity through rational algorithm design and parameter adjustment, improves the efficiency of watermark embedding and extraction, and reduces hardware and software costs. In contrast, existing technologies require complex encryption and decryption processes, increasing algorithm complexity and cost. Fewer false detections: This invention improves the accuracy of tamper detection, reduces false detections, and ensures the reliability of watermark detection through feature extraction and a three-layer authentication mechanism. In contrast, existing technologies may result in false detections, where images or text without a watermark are mistakenly marked as having a watermark, which can lead to unnecessary disputes and controversies. This invention offers significant advantages and application prospects in terms of watermark image quality, tamper detection accuracy, tampered area recovery quality, watermark security and attack resistance, processing efficiency, and false detection reduction. BRIEF DESCRIPTION OF THE DRAWINGS
[0100] Figure 1 A roadmap for the watermark generation and embedding process of the present invention.
[0101] Figure 2 A schematic diagram of authentication bit generation according to the present invention. DETAILED DESCRIPTION
[0102] A specific embodiment of the present invention is described in detail below with reference to the accompanying drawings, but it should be understood that the protection scope of the present invention is not limited by the specific embodiment.
[0103] The purpose of this invention is to provide an improved color image tampering detection and self-recovery method based on SparseViT and dynamic diagonal mapping. By introducing the SparseViT algorithm, dynamic diagonal mapping, improved tent chaotic mapping, and HVS-based embedding position selection, the robustness, concealment, and security of the watermark are significantly improved, while optimizing processing efficiency and reducing false detection problems. Specifically, the present invention aims to:
[0104] (1) Improve the robustness of the watermark: By introducing the SparseViT algorithm and dynamic diagonal mapping, the watermark's resistance to various attacks is enhanced, ensuring that the watermark can still be accurately detected and extracted after the image has been compressed, rotated, scaled, and other operations.
[0105] (2) Enhance the concealment of the watermark: Through the HVS-based embedding position selection method, the watermark is embedded in the area with the least visual impact, thereby minimizing the impact on image quality while ensuring the robustness of the watermark.
[0106] (3) Improve the security of watermarks: Through the improved tent chaotic mapping, the randomness and unpredictability of watermarks are enhanced, further improving the security and anti-attack capabilities of watermarks.
[0107] (4) Optimize processing efficiency: Through reasonable algorithm design and parameter adjustment, reduce the complexity of the algorithm, improve the efficiency of watermark embedding and extraction, and reduce the cost of hardware and software.
[0108] (5) Reduce false detection problems: Through feature extraction and three-layer authentication mechanism, the accuracy of tampering detection is improved, false detection is reduced, and the reliability of watermark detection is ensured.
[0109] The present invention comprises the following steps:
[0110] Data processing:
[0111] This paper relies on the CoMoFoD database, the Industrial Scene Database, and the USC-SIPI Image Database. The CoMoFoD database is a commonly used database for copy-move forgery detection, containing original images, forged images, and color masks. This database is used to evaluate the restoration performance of the proposed method under various texture challenges. The Industrial Scene Database, collected by the team, contains 50 images of various industrial scenes. These images are used to test the effectiveness and robustness of the proposed method in real-world industrial scenarios. The USC-SIPI Image Database is a standard image database primarily used for image processing and compression research. Images in this database are used to compare with existing work to verify the superiority of the proposed method.
[0112] S1: Watermark generation.
[0113] S11: Initial step.
[0114] The specific steps of S11 are:
[0115] The size is Color image Divide into multiple independent non-overlapping blocks , the size of each block is , for each divided block , we need to extract the three color component images in the RGB color space and record them as: 、 and .
[0116] S12: Authentication watermark generation: Hash authentication feature (HAF) algorithm is used to establish feature dependencies between blocks to construct authentication bits. In order to cope with various image summaries, HAF algorithm is used to generate authentication watermarks. 、 and Corresponding authentication watermark 、 and The specific steps of S12 are:
[0117] S121: three color component images 、 and Divide into multiple non-overlapping blocks ;
[0118] S122: Extract the most significant bit (MSB) from it according to formula (1):
[0119] (1);
[0120] in: Indicates that the front of each pixel value is extracted The most significant bit is 5;
[0121] Indicates rounding down;
[0122] S123: Block features are considered one of the key features of block authentication. Block features are calculated using a hash function, and the first four bits of the hash value are extracted as the self-block (self-block refers to the independent, non-overlapping blocks into which the image is divided. These blocks are used to generate authentication information and recovery information and are a basic unit in the method.) feature authentication bits ,like Figure 2 The authentication bit generates the two 16-square grid squares above.
[0123] S124: In order to destroy the separation of blocks and the robustness of watermark, the dynamic diagonal mapping algorithm is used as formula (2) to locate the mapping block, and the last 4 bits of the hash value are extracted as the feature authentication bits of the mapping block. ,like Figure 2 The authentication bit is generated as shown in the process of the two 16-square squares below;
[0124] (2);
[0125] in: represents a dynamic diagonal mapping algorithm, which is used to map image blocks to diagonal positions to enhance the security and recovery quality of watermarks. Specifically, Mapping a block to another position using the diagonal mapping rule disrupts the order of the blocks;
[0126] S125: Reconstruct the self-block feature authentication bit according to formula (3) and the feature authentication bits of the mapping block To get non-overlapping blocks The authentication bit of the whole authentication bit generation process is as follows Figure 2 As shown:
[0127] (3);
[0128] in: Represents a concatenation operation, for example is 1000, is 0110, then is 10000110.
[0129] S13: Summary image generation: The SparseViT algorithm is used to generate three minimum values; the dynamic diagonal mapping algorithm is used to scramble and rearrange these three chaotic sequences respectively to improve the recovery quality and enhance security.
[0130] Application of the SparseViT algorithm: The SparseViT algorithm is used instead of the traditional SPIHT algorithm to generate watermark information. The SparseViT algorithm uses a sparse attention mechanism and a visual Transformer architecture to more efficiently extract image features and generate more robust and discriminative watermark information.
[0131] Dynamic diagonal mapping: Traditional diagonal mapping is replaced by dynamic diagonal mapping. Dynamic diagonal mapping adjusts the mapping parameters in real time based on the image content and watermark information, making the distribution of watermark information in the image more random and unpredictable, thereby improving the security and anti-attack capabilities of the watermark.
[0132] Improved Tent Chaos Mapping: The improved Tent Chaos Mapping replaces the traditional chaos mapping algorithm. The improved Tent Chaos Mapping enhances the complexity and randomness of the chaotic system by introducing an adaptive parameter adjustment mechanism, further improving the security and robustness of the watermark.
[0133] The proposed algorithm for creating three tampered regions is used to recover the tampered regions.
[0134] HAF (Hash Authentication Feature), IDLCM (Improved Diagonal Tent Chaotic Map), SVG (Sparse Vision Transformer Averaging Algorithm based on sparse Vision Transformer).
[0135] The specific steps of S13 are:
[0136] S131: Use SparseViT algorithm to process the red component image Perform feature extraction and generate recovery watermark SparseViT adaptively extracts non-semantic features of images through a sparse self-attention mechanism. These features are sensitive to image tampering while reducing computational complexity. The introduction of the SparseViT algorithm can improve the efficiency and robustness of the watermark generation process, especially when processing high-resolution images.
[0137] S132: Green component image and the blue component image Divide into non-overlapping blocks , use formula (4) to calculate the average intensity value of each block :
[0138] (4);
[0139] S133: From the average intensity value Extract the most significant bit (MSB) as the block recovery bit , as shown in formula (5):
[0140] (5);
[0141] Where: d represents the number of MSB bits extracted, which is 6;
[0142] S134: Restore all generated blocks to their original positions According to formula (6), the restored watermark is obtained and :
[0143] (6);
[0144] Among them: Recovery watermark and Respectively represent the images corresponding to the color components and Recovery watermark;
[0145] is the color component image and No. x Rank y The block recovery bit of the column;
[0146] Represents a character concatenation or vector concatenation operation, which is used to connect multiple recovery bits in a certain order to form a complete watermark;
[0147] S135: To improve security and recovery rate, an improved diagonal tent chaotic map (IDLCM) algorithm is used to shuffle and rearrange the watermark. 、 and To generate the corresponding recovery watermark 、 and Three copies of .
[0148] Embed block-level dynamic diagonal mapping recovery bit;
[0149] Restore block-level dynamic diagonal mapping and (Generated by dynamic diagonal mapping algorithm and and The associated recovery bits) are embedded into the red component image In, it means to restore the watermark and Dynamic diagonal mapping restores information;
[0150] Embed block-level improved tent chaos map recovery bit;
[0151] Restore the block-level improved tent chaos map and Embedded into color component images separately and In the example, it represents the recovery watermark arranged by keyG and keyB respectively. and The improved chaos map restores information.
[0152] S2: Watermark embedding: the authentication bit is changed to be combined with the recovery bit. The watermark embedding adopts the combination of block-based regular marking and pixel-based continuous marking and applies the human visual system (HVS) to complete the watermark embedding.
[0153] The specific steps of S2 are:
[0154] Based on authentication data and restore data ,The watermark embedding process describes in detail the procedures of embedding watermark information and ,bit adjustment.,In order to minimize the damage to the watermark image, block-based ,regular marking and pixel-based continuous marking are proposed.
[0155] S21: Mark position selection;
[0156] S211: Authentication data The mark position is ;
[0157] S212: Recovering Data The mark position is ;
[0158] S213: Recovering Data and The mark position is ;
[0159] S22: Embedding strategy;
[0160] S221: Recovering Data Embed 1-LSB (Least Significant Bit);
[0161] S222: Recovering Data and Embedded into 2-LSB;
[0162] S223: Authentication data Data is embedded into 2-LSB or 3-LSB according to the embedding position; if data is available in 2-LSB of the embedding position, the authentication data Embedded into 3-LSB;
[0163] Block-based and pixel-based embedding: This method uses a combination of block-based regularized labeling and pixel-based continuous labeling to embed watermark information into specific locations in the image. By properly adjusting the embedding strength and location, efficient watermark embedding and optimized image quality are achieved.
[0164] S23: Generate a temporary watermark image;
[0165] S231: Finally generate a temporary watermark image ;
[0166] S232: The key length is determined by the block size, which is Bit;
[0167] S24: watermark payload;
[0168] The watermark payload is ,To ensure the quality of the watermarked image, a larger block size is a better choice;
[0169] S25: bit adjustment method;
[0170] In order to improve the quality of the image after embedding the watermark, the bit adjustment method is adopted. The specific adjustment rules are shown in formula (7):
[0171] (7);
[0172] in: is the original pixel;
[0173] Temporary watermark pixels The original pixel Difference;
[0174] is the final watermark pixel;
[0175] S26: Embedding location selection based on the human visual system (HVS); After the bit adjustment, the embedding location selection method based on the human visual system (HVS) is used to further optimize the watermark embedding location. The HVS method takes advantage of the fact that the human eye is insensitive to areas of high brightness and strong contrast changes in the image. It selects to embed watermark information in these areas to reduce the impact on image quality while improving the robustness and imperceptibility of the watermark.
[0176] HVS-based embedding location selection: During the watermark embedding process, an embedding location selection method based on the human visual system (HVS) is used. This method selects the area with the least visual impact to embed the watermark information based on the human eye's sensitivity to different image regions, thereby minimizing the impact on image quality while ensuring the robustness of the watermark.
[0177] S3: Tamper detection; in order to verify the received image and recover the tampered area, watermark extraction and reverse scrambling are initialized, and the tampered area is marked according to the extracted authentication bits combined with three-layer authentication;
[0178] The specific steps of S3 are:
[0179] Received color image (The image received by the receiver may be an unaltered image with a watermark embedded in it, or it may be an altered image) is divided into multiple independent non-overlapping blocks , the size of each block is ,at the same time, They represent the color components of the received image in the RGB color space. The specific tampering detection structure will be described point by point in the following;
[0180] S31: Authentication bit calculation: For each block, the hash authentication feature algorithm calculates the authentication bit , whose value is bpb, ;
[0181] S32: Extract watermark information: Extract 2-LSB or 3-LSB watermark information from the marked self-block (pixels in the self-block selected and marked for embedding watermark information in the watermark embedding stage. These pixels are given specific watermark information (such as authentication bit and recovery bit) in the embedding stage, and the corresponding watermark information is extracted from these pixels in the extraction stage for tampering detection and image recovery.) to generate the extracted authentication bit ;
[0182] S33: Authentication bit comparison: Compare and calculate the authentication bit and the extracted authentication bits , to determine non-overlapping blocks Whether it has been tampered with, calculate the authentication bit and the extracted authentication bits If equal, then the non-overlapping blocks It is considered that it has not been tampered with; otherwise, further judgment is required;
[0183] S34: Self-block feature comparison: Calculate authentication bit and the extracted authentication bits Not equal, compare the self-block feature authentication bit, if the self-block feature authentication bit and the extracted authentication bit If they are different, the block is considered to have been tampered with;
[0184] S35: Mapping block check: In order to find out the real reason for the difference in authentication information, check whether the mapping block has been tampered with; use the hash authentication feature algorithm to generate the mapping block authentication bit , and extract the hidden authentication information to generate , if the two match, the mapping block is considered not to have been tampered with, otherwise, it is considered a non-overlapping block been tampered with;
[0185] S36: Initial tamper detection results: After traversing all blocks, the initial tamper detection results of the three channels are obtained from the block feature authentication bit 、 and .
[0186] Feature extraction and three-tier authentication: During the tampering detection phase, a feature extraction algorithm combined with a three-tier authentication mechanism performs multi-dimensional image feature analysis and authentication. By comparing the extracted feature information with the embedded watermark information, tampered areas in the image can be accurately detected.
[0187] S4: Self-recovery; decode and reconstruct the three types of tampering based on the block-pixel level recovery mechanism to effectively restore the tampered area.
[0188] The specific steps of S4 are:
[0189] The watermark information in the tampered area may be destroyed. In order to recover the embedded watermark information, based on the tampering detection results ( Perform morphological operations (erode image, dilate image, further erode image) to obtain the final tampering detection result ) proposed a block pixel level recovery mechanism. The self-recovery process is as follows:
[0190] S41: R channel self-recovery;
[0191] S411: Tamper detection results Divide into sizes Blocks, by reverse disrupting the tampering detection results Use keyG to obtain reverse tamper detection results ,According to the proposed mechanism, the tampering detection results Perform block-level first-level recovery and obtain recovery information ;
[0192] S412: Based on tampering detection results and recovery information , the next step is restored at the pixel level; pixel (Refers to a single pixel in an image, which is the smallest unit of an image. During the recovery process, each pixel needs to be judged and restored.) If it is marked as tampered, the bit is restored (used to recover the bit information of the tampered pixel) is from (An intermediate result used in the tampering detection and recovery process to guide the recovery) mapped pixels The embedded diagonal mapping is extracted from the recovered bits Otherwise, restore the is embedded in the red component image The self-recovery position (Embedded in the red component image The recovery bit information in is used to perform recovery operation when the pixel has not been tampered with);
[0193] S413: Reconstruct and recover data using formulas (9) and (10):
[0194] (9);
[0195] (10);
[0196] in: yes (is embedded in the red component image During the watermark embedding phase, the recovery information is embedded into the red component of the image so that it can be used for image restoration when needed.
[0197] Use SparseViT algorithm to Decode and obtain the corresponding decoded image ;
[0198] S42: G channel and B channel self-recovery;
[0199] S421: Block-level tampering detection results Use keyG and keyB to reverse scramble and get and ;
[0200] S422: Based on block-level diagonal mapping, the tamper detection results Reverse the order to obtain ;
[0201] S423: According to the reverse arrangement , reverse tampering detection results and , use Algorithm 2 (Algorithm 2, used to perform initial recovery operations at the block level based on tampering detection results and recovery information) to reconstruct the initial information;
[0202] Algorithm 2:
[0203] Initial self-recovery process of channels G and B
[0204] Input: Receive image , information extraction 、 and ;
[0205] Output: Initial reconstruction channel and ;
[0206] 1. for i = 1 to do
[0207] 2. for j = 1 to do
[0208] 3. If Mark as untampered then
[0209] 4. ;
[0210] 5. Others
[0211] 6. If Mark as untampered then
[0212] 7.
[0213] 8. If Mark as untampered then
[0214] 9. ;
[0215] 10. End the for loop;
[0216] 11. End the for loop;
[0217] S424: Due to the influence of tampered overlapping areas, the tampered areas are filled with the average value of adjacent valid pixels. To improve the performance of restored images, the tampering coverage and recovery process are improved. Areas affected by the tampering overlap problem are reconstructed using the smoothing inpainting algorithm. Experimental results show that when the tampering rate of the watermarked image is less than 80%, the tampered areas can be effectively restored with satisfactory quality.
[0218] S425: Finally, we can obtain the following equation (11):
[0219] (11);
[0220] in: is the restored image obtained previously;
[0221] Represents the dot product operation;
[0222] Represents the restored image.
[0223] Block-pixel-level restoration mechanism and Smoothing Inpainting algorithm: Detected tampered areas are restored using a block-pixel-level restoration mechanism combined with an improved Smoothing Inpainting algorithm. By dynamically adjusting restoration parameters and optimizing the algorithm flow, efficient and high-quality restoration of tampered areas is achieved.
[0224] The above disclosure is only a specific embodiment of the present invention, but the present invention is not limited thereto. Any changes that can be conceived by those skilled in the art should fall within the scope of protection of the present invention.
Claims
1. An improved color image tampering detection and self-recovery method, characterized in that: The following steps are involved: S1: watermark generation; S11: initial step; S12: Authentication watermark generation: A hash authentication feature algorithm is used to establish feature dependencies between blocks to construct authentication bits; S13: Summary image generation: Generate three minimum values using the SparseViT algorithm; The three chaotic sequences are scrambled and rearranged using a dynamic diagonal mapping algorithm to improve recovery quality and enhance security. S2: watermark embedding; S3: tamper detection; S4: Self-recovery; The specific steps of S4 are: S41: R channel self-recovery; S411: Tamper detection results Divide into sizes Blocks, by reverse disrupting the tampering detection results Use keyG to obtain reverse tamper detection results ,According to the proposed mechanism, the tampering detection results Perform block-level first-level recovery and obtain recovery information ; S412: Based on tampering detection results and recovery information , the next step is restored at the pixel level; pixel Reverse tampering detection results If it is marked as tampered, the bit is restored It is from Mapped pixels The embedded diagonal mapping is extracted from the recovered bits Otherwise, restore the is embedded in the red component image The self-recovery position ; S413: Reconstruct and recover data using formulas (9) and (10): (9); (10); in: yes Reconstruction recovery data; Use SparseViT algorithm to Decode and obtain the corresponding decoded image ; S42: G channel and B channel self-recovery; S421: Block-level tampering detection results Use keyG and keyB to reverse scramble and get and ; S422: Based on block-level diagonal mapping, the tamper detection results Reverse the order to obtain ; S423: According to the reverse arrangement , reverse tampering detection results and , reconstruct the initial information; S424: The area affected by the tampering overlap problem is reconstructed using a smooth repair algorithm; S425: Finally, we can obtain the following equation (11): (11); in: is the restored image obtained previously; Represents the dot product operation; Represents the restored image.
2. The improved color image tampering detection and self-recovery method according to claim 1 is characterized in that: The specific steps of S11 are: The size is Color image Divide into multiple independent non-overlapping blocks , the size of each block is , for each divided block , we need to extract the three color component images in the RGB color space and record them as: 、 and .
3. The improved color image tampering detection and self-recovery method according to claim 2, characterized in that: The specific steps of S12 are: S121: three color component images 、 and Divide into multiple non-overlapping blocks ; S122: Extract the most significant bit according to formula (1): (1); in: Indicates that the front of each pixel value is extracted Most significant bit; Indicates rounding down; S123: Use the hash function to calculate the block feature and extract the first four bits of the hash value as the self-block feature authentication bit ; S124: Use the dynamic diagonal mapping algorithm as shown in formula (2) to locate the mapping block and extract the last 4 bits of the hash value as the feature authentication bits of the mapping block ; (2); in: represents the dynamic diagonal mapping algorithm; S125: Reconstruct the self-block feature authentication bit according to formula (3) and the feature authentication bits of the mapping block To get non-overlapping blocks Authentication bits: (3); in: Represents a splicing operation.
4. The improved color image tampering detection and self-recovery method according to claim 2, characterized in that: The specific steps of S13 are: S131: Use SparseViT algorithm to process the red component image Perform feature extraction and generate recovery watermark ; S132: Green component image and blue component image Divide into non-overlapping blocks , use formula (4) to calculate the average intensity value of each block : (4); S133: From the average intensity value Extract the most significant bit as the block recovery bit , as shown in formula (5): (5); Where: d represents the number of MSB bits extracted; S134: Restore all generated blocks to their original positions According to formula (6), the restored watermark is obtained and : (6); Among them: Recovery watermark and Respectively represent the images corresponding to the color components and Recovery watermark; is the color component image and No. x Rank y The block recovery bit of the column; Represents a character concatenation or vector concatenation operation, which is used to sequentially connect multiple recovery bits to form a complete watermark; S135: In order to improve security and recovery rate, an improved diagonal tent chaotic mapping algorithm is used to shuffle and rearrange the watermark recovery 、 and To generate the corresponding recovery watermark 、 and Three copies of .
5. The improved color image tampering detection and self-recovery method according to claim 4, characterized in that: The specific steps of S2 are: S21: Marking position selection; S211: Authentication data The mark position is ; S212: Recovering Data The mark position is ; S213: Recovering Data and The mark position is ; S22: Embedding strategy; S221: Recovering Data Embed 1-LSB; S222: Recovering Data and Embedded into 2-LSB; S223: Authentication data Data is embedded into 2-LSB or 3-LSB according to the embedding position; S23: Generate a temporary watermark image; S231: Finally generate a temporary watermark image ; S232: The key length is determined by the block size, which is Bit; S24: watermark payload; The watermark payload is ; S25: bit adjustment method; In order to improve the quality of the image after embedding the watermark, the bit adjustment method is adopted. The specific adjustment rules are shown in formula (7): (7); in: is the original pixel; Temporary watermark pixels The original pixel Difference; is the final watermark pixel; S26: Embedding position selection based on the human visual system.
6. The improved color image tampering detection and self-recovery method according to claim 4, characterized in that: The specific steps of S3 are: Received color image Divided into multiple independent non-overlapping blocks , the size of each block is ,at the same time, Respectively represent the color components of the received image in the RGB color space; S31: Authentication bit calculation: For each block, the hash authentication feature algorithm calculates the authentication bit ; S32: Extract watermark information: Extract 2-LSB or 3-LSB watermark information from the marked self-block pixels and generate the extracted authentication bit ; S33: Authentication bit comparison: Compare and calculate the authentication bit and the extracted authentication bits , to determine non-overlapping blocks Whether it has been tampered with, calculate the authentication bit and the extracted authentication bits If equal, then the non-overlapping blocks It is considered that it has not been tampered with; otherwise, further judgment is required; S34: Self-block feature comparison: Calculate authentication bit and the extracted authentication bits Not equal, compare the self-block feature authentication bit, if the self-block feature authentication bit and the extracted authentication bit If they are different, the block is considered to have been tampered with; S35: Mapping block check: In order to find out the real reason for the difference in authentication information, check whether the mapping block has been tampered with; use the hash authentication feature algorithm to generate the mapping block authentication bit , and extract the hidden authentication information to generate , if the two match, the mapping block is considered not to have been tampered with, otherwise, it is considered a non-overlapping block been tampered with; S36: Initial tamper detection results: After traversing all blocks, the initial tamper detection results of the three channels are obtained from the block feature authentication bit 、 and .
Citation Information
Patent Citations
Image tampering detection positioning and self-recovery method based on fragile watermark
CN113014742A
Medical image self-recovery method based on image restoration algorithm
CN116416112A