Improved color image tampering detection and self-recovery method

By selecting the watermark embedding position based on the human eye vision system in color images, and combining technologies such as SparseViT algorithm and dynamic diagonal mapping, the lack of performance of existing watermark technology in color image processing is solved, and high-quality watermark images, accurate tamper detection and efficient recovery effects are achieved.

CN120125416AActive Publication Date: 2025-06-10QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES)
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510622324.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-15
Publication Date
2025-06-10
Estimated Expiration
2045-05-15

AI Technical Summary

Technical Problem

The existing watermarking technology has insufficient performance in color image processing, especially in practical application scenarios such as smart cities, the demand for tampering detection and recovery of color images is growing, but traditional watermarking technology is mainly concentrated on grayscale images and cannot effectively process color images.

Method used

The embedding position selection method based on the human eye vision system (HVS) is adopted to select the area with the least visual impact to embed watermark information, and the SparseViT algorithm, dynamic diagonal mapping and improved tent chaos mapping are introduced to generate more robust and distinguished watermark information. Combined with feature extraction and three-layer authentication mechanism, the accuracy of tamper detection is significantly improved.

Benefits of technology

It improves the quality of watermark images, enhances the accuracy of tamper detection, realizes efficient and high-quality recovery of tampered areas, improves the security and attack resistance of watermarks, reduces the complexity and cost of algorithms, and reduces false detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120125416A_ABST
    Figure CN120125416A_ABST
Patent Text Reader

Abstract

The invention discloses an improved color image tampering detection and self-recovery method, which relates to the technical field of image processing, and is characterized by comprising the following steps: S1, generating a watermark; s11, an initial step; s12, authentication watermark generation: establishing a feature dependency relationship between blocks by adopting a Hash authentication feature algorithm so as to construct an authentication bit; s13, generating an abstract image: generating three minimum values by using a SparseViT algorithm; respectively scrambling and rearranging the three chaotic sequences by using a dynamic diagonal mapping algorithm so as to improve the recovery quality and enhance the safety; s2, embedding a watermark; s3, tampering detection; and S4, performing self-recovery. The invention aims to solve multiple defects of the existing watermarking technology in color image processing, and cope with new challenges brought by digital media content diversification and network environment complexity at the same time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and more specifically, to an improved method for detecting and self-recovering color image tampering. Background Art

[0002] With the rapid development of digital image processing technology, images are at risk of being tampered with during transmission, storage, and sharing, which may cause serious economic and social problems in fields such as industry, healthcare, and justice. To address this challenge, digital watermarking technology has emerged, enabling the verification of image integrity and authenticity by embedding invisible watermark information in images. However, existing watermarking technologies still have deficiencies in aspects such as watermarked image quality, tampering 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 have emerged continuously, posing higher requirements for the anti-attack ability of watermarks.

[0003] The existing technologies are as follows: Color Image Tampering Detection and Self-Recovery Based on Fragile Watermark: This solution proposes a method for detecting and self-recovering color image tampering based on fragile watermark. By combining block-based regular marking and pixel-based continuous marking to embed watermark information, the quality of the watermarked image is improved. This method also develops a scheme for diagonal block tampering detection based on feature extraction combined with three-layer authentication to resist tampering attacks of different shapes and sizes. In addition, a block pixel-level recovery mechanism and the Smoothing Inpainting algorithm are designed to achieve high-quality recovery of tampered images. Experimental results show that this solution has excellent performance in tampering detection and image self-recovery.

[0004] Image Tampering Detection Based on SparseViT: SparseViT is a vision Transformer model based on the sparse self-attention mechanism. Through the sparse computing mode, the model adaptively extracts non-semantic features in image tampering detection. This model not only avoids manual feature extraction but also significantly reduces the computational cost and achieves SOTA performance on multiple datasets. In addition, this model also introduces a learnable multi-scale feature fusion mechanism to further improve the generalization ability of the model.

[0005] Deep learning-based watermarking method; Deep learning watermarking algorithms are emerging digital watermarking methods based on deep learning technology, which are different from traditional digital watermarking methods. Traditional methods are based on signal processing, information theory, and cryptography, and realize the embedding and extraction of watermarks through manually designed algorithms. In contrast, deep learning watermarking algorithms use deep learning models such as neural networks to process watermark information. Existing deep learning-based watermarking schemes mainly use the E-N-D framework, which consists of three parts: an encoder, a noise layer, and a decoder.

[0006] Disadvantages of the prior art (1) Insufficient robustness: In the face of various attacks (such as image compression, rotation, scaling, etc.), the watermarks in existing watermarking technologies are easily damaged, resulting in the inability to detect or extract them, thus reducing the reliability and effectiveness of the watermarks.

[0007] (2) Insufficient invisibility: While protecting the original data, the invisibility of the watermarks in existing watermarking technologies is not strong enough, there is a certain risk of leakage, and they are easily discovered.

[0008] (3) Insufficient security: Existing watermarking technologies are vulnerable to detection and modification by attackers. For example, by adding noise or performing operations such as shearing, scaling, and rotation, the watermarks are forged or tampered with.

[0009] (4) Low processing efficiency: Many digital watermarking algorithms require complex encryption and decryption processes to protect the security of the watermarks, which increases the complexity of the algorithms and will increase the costs of hardware and software.

[0010] (5) False detection problem: Some digital watermarking algorithms may cause false detection, that is, mislabeling an image or text without a watermark as having a watermark, which may lead to unnecessary disputes and controversies. Summary of the invention

[0011] The technical problem to be solved by the present invention is to provide an improved method for detecting and self - recovering color image tampering, aiming to solve multiple deficiencies of existing watermarking technologies in color image processing and to address new challenges brought about by the diversification of digital media content and the complexity of the network environment. Specifically, the present invention is committed to solving the following technical problems: First, the performance of existing watermarking technologies in color image tampering detection and recovery is insufficient. Especially in practical application scenarios such as smart cities, the demand for color image tampering detection and recovery is increasing day by day, while traditional watermarking technologies mainly focus on grayscale images and cannot effectively process color images. Second, there is the problem of the degradation of the quality of the watermarked image. Existing technologies may have a greater 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 the image quality while ensuring the robustness of the watermark. Third, the accuracy of tampering detection is insufficient. Existing technologies have limited detection accuracy when facing complex attacks and large - scale data. The present invention generates more robust and distinguishable watermark information by introducing technologies such as the SparseViT algorithm, dynamic diagonal mapping, and improved tent chaotic mapping, and combines feature extraction with a three - layer authentication mechanism, significantly improving the accuracy of tampering detection. Fourth, there is the problem of high - quality recovery of the tampered area. Existing technologies have deficiencies in recovery quality, especially in color images. The present invention realizes the efficient and high - quality recovery of the tampered area through a block - pixel - level recovery mechanism combined with an improved SmoothingInpainting algorithm, dynamically adjusting the recovery parameters and optimizing the recovery effect. Fifth, the security and anti - attack ability of the watermark are weak. Existing technologies are vulnerable to various attacks and threats. The present invention enhances the randomness and unpredictability of the watermark through dynamic diagonal mapping and improved tent chaotic mapping, further improving the security and robustness of the watermark. In addition, with the development of AI technology, technologies for automatically identifying and removing watermarks are emerging continuously, posing higher requirements for the anti - attack ability of watermarks. The present invention improves the anti - attack ability of the watermark by introducing advanced algorithms and technologies to cope with these new challenges.

[0012] The present invention adopts the following technical solutions to achieve the invention purpose: An improved method for detecting and self - recovering color image tampering, characterized by comprising the following steps: S1: Watermark generation; S11: Initial step; S12: Authentication watermark generation: Using a hash authentication feature algorithm to establish the feature dependence between blocks to construct authentication bits; S13: Abstract 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 respectively to improve the recovery quality and enhance security; S2: Watermark Embedding; S3: Tampering Detection; S4: Self-Recovery.

[0013] As a further limitation of this technical solution, the specific steps of S11 are as follows: Divide the color image with size into multiple independent non-overlapping blocks , and the size of each block is . For each divided block , it is necessary to extract its three color component images in the RGB color space and record them as: , , and .

[0014] As a further limitation of this technical solution, the specific steps of S12 are as follows: S121: Divide the three color component images , and into multiple non-overlapping blocks ; S122: Extract the most significant bits from them according to Equation (1): (1); where: indicates that the first most significant bits of each pixel value are extracted; indicates rounding down; S123: Use a hash function to calculate the block features, and extract the first four bits of the hash value as the self-block feature authentication bits ; S124: Use the dynamic diagonal mapping algorithm to locate the mapped blocks according to Equation (2), and extract the last 4 bits of the hash value as the feature authentication bits of the mapped blocks ; (2); where: indicates the dynamic diagonal mapping algorithm; S125: Reconstruct the self-block feature authentication bits and the feature authentication bits of the mapped blocks to obtain the authentication bits of the non-overlapping blocks : (3); Wherein: Represents a splicing operation.

[0015] As a further limitation of this technical solution, the specific steps of S13 are: S131: Use the SparseViT algorithm to extract features from the red component image to generate a restored watermark ; S132: Divide the green component image and the blue component image into non-overlapping blocks , and calculate the average intensity value of each block using Equation (4) : (4); S133: Extract the most significant bit from the average intensity value as the block restoration bit , as shown in Equation (5): (5); Wherein: d represents the number of bits of the extracted MSB; S134: Combine all the generated block restoration bits according to Equation (6) to obtain the restored watermark and : (6); Wherein: the restored watermark and respectively represent the restored watermarks corresponding to the color component images and ; is the block restoration bit of the th row and th column of the color component images x and y ; represents a character splicing or vector concatenation operation, used to concatenate multiple restoration bits in sequence to form a complete watermark; S135: To improve security and recovery rate, an improved diagonal tent chaotic mapping algorithm is used to shuffle and rearrange the restored watermarks , and to generate three copies of the corresponding restored watermarks , and .

[0016] As a further limitation of this technical solution, the specific steps of S2 are as follows: S21: Marking position selection; S211: The marking position of the authentication data is ; S212: The marking position of the recovery data is ; S213: The marking position of the recovery data and is ; S22: Embedding strategy; S221: The recovery data is embedded with 1-LSB; S222: The recovery data and are embedded into 2-LSB; S223: The authentication data is embedded into 2-LSB or 3-LSB according to the data at 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 and is bits per block; S24: Watermark load; The watermark load is ; S25: Bit adjustment method; In order to improve the quality of the image after embedding the watermark, a bit adjustment method is adopted, and the specific adjustment rule is shown in Equation (7): (7); Where: is the original pixel; is the temporary watermark pixel and the original pixel of the difference; is the final watermark pixel; S26: Embedding position selection based on the human visual system.

[0017] As a further limitation of this technical solution, the specific steps of S3 are as follows: The received color image is divided into multiple independent non-overlapping blocks , and the size of each block is , meanwhile, 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 the watermark information of 2-LSB or 3-LSB from the marked self-block pixels to generate the extracted authentication bit ; S33: Authentication bit comparison: Compare the calculated authentication bit and the extracted authentication bit , to determine whether the non-overlapping block has been tampered with. If the calculated authentication bit and the extracted authentication bit are equal, the non-overlapping block is considered not to have been tampered with; otherwise, further judgment is required; S34: Self-block feature comparison: If the calculated authentication bit and the extracted authentication bit are not equal, compare the self-block feature authentication bits. If the self-block feature authentication bit and the extracted authentication bit are different, the self-block is considered to have been tampered with; S35: Mapping block check: In order to find out the real reason for the authentication information difference, 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, the non-overlapping block is considered to have been tampered with; S36: Initial tampering detection result: After traversing all blocks, obtain the initial tampering detection results of the self-block feature authentication bits of the three channels , and .

[0018] As a further limitation of the present technical solution, the specific steps of S4 are as follows: S41: R-channel self-recovery; S411: Divide the tampering detection result into blocks of size . Through reverse scrambling of the tampering detection result using keyG, obtain the reverse tampering detection result . According to the proposed mechanism, perform block-level first-level recovery in the tampering detection result to obtain the recovery information ; S412: Based on the tampering detection result and the recovery information , perform the next recovery at the pixel level; the pixel If it is marked as tampered in the reverse tampering detection result , then the recovery bit is the mapped pixel from which the embedded diagonal mapping recovery bit is extracted, otherwise, the recovery bit is the self-recovery bit embedded in the red component image ; ; S413: Reconstruct the recovery data through formulas (9) and (10): (9); (10); Where: is the reconstructed recovery data; Use the SparseViT algorithm to decode to obtain the corresponding decoded image ; S42: Self-recovery of the G channel and B channel; S421: The block-level tampering detection result is respectively reverse-shuffled using keyG and keyB to obtain and ; S422: Based on the block-level diagonal mapping, reverse-arrange the tampering detection result to obtain ; S423: According to the reverse arrangement , the reverse tampering detection result and , perform initial information reconstruction; S424: The areas affected by the tampering coincidence problem are reconstructed using a smoothing repair algorithm; S425: Finally, obtain through formula (11): (11); Where: is the recovery image obtained previously; represents the dot product operation; represents the recovered image.

[0019] Compared with the prior art, the advantages and positive effects of the present invention are as follows: Higher watermark image quality: The present invention selects the embedding position based on the human visual system (HVS), choosing the area with the least visual impact to embed the watermark information, thereby minimizing the impact on image quality while ensuring the robustness of the watermark. In contrast, the prior art may have a greater impact on image quality after embedding the watermark, especially in color images. Higher tampering detection accuracy: The present invention generates more robust and distinguishable watermark information by introducing technologies such as the SparseViT algorithm, dynamic diagonal mapping, and improved tent chaotic mapping, and combines feature extraction with a three-layer authentication mechanism, significantly improving the accuracy of tampering detection. In contrast, the prior art has limited detection accuracy when facing complex attacks and large-scale data. Higher quality of tampered area recovery: The present invention combines a block pixel-level recovery mechanism with an improved Smoothing Inpainting algorithm, dynamically adjusts the recovery parameters, optimizes the recovery effect, and achieves efficient and high-quality recovery of the tampered area. In contrast, the prior art has deficiencies in recovery quality, especially in color images. Stronger security and anti-attack ability of the watermark: The present invention enhances the randomness and unpredictability of the watermark through dynamic diagonal mapping and improved tent chaotic mapping, further improving the security and robustness of the watermark. In contrast, the prior art is vulnerable to various attacks and threats, and the security and anti-attack ability of the watermark are weak. Higher processing efficiency: The present invention reduces the algorithm complexity through reasonable algorithm design and parameter adjustment, improves the efficiency of watermark embedding and extraction, and reduces the hardware and software costs. In contrast, the prior art requires complex encryption and decryption processes, increasing the algorithm complexity and cost. Fewer false detection phenomena: The present invention improves the accuracy of tampering detection through feature extraction and a three-layer authentication mechanism, reduces false detection phenomena, and ensures the reliability of watermark detection. In contrast, the prior art may lead to false detections, that is, incorrectly marking an image or text without a watermark as having a watermark, which may cause unnecessary disputes and controversies. The present invention has good advantages and application prospects in terms of watermark image quality, tampering detection accuracy, tampered area recovery quality, security and anti-attack ability of the watermark, processing efficiency, and false detection phenomena. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 It is a roadmap of the watermark generation and embedding process of the present invention.

[0021] Figure 2 It is a schematic diagram of the generation of authentication bits of the present invention. DETAILED DESCRIPTION OF THE INVENTION

[0022] The following will describe in detail a specific embodiment of the present invention in conjunction with the accompanying drawings. It should be understood that the protection scope of the present invention is not limited by the specific embodiment.

[0023] The object of the present invention is to provide an improved color image forgery 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, invisibility, and security of the watermark are significantly improved, while the processing efficiency is optimized and the misdetection problem is reduced. Specifically, the present invention aims to: (1) Improve the robustness of the watermark: By introducing the SparseViT algorithm and dynamic diagonal mapping, enhance the resistance of the watermark to various attacks, and ensure that the watermark can still be accurately detected and extracted after the image undergoes operations such as compression, rotation, and scaling.

[0024] (2) Enhance the invisibility of the watermark: By the HVS - based embedding position selection method, select the region with the least visual impact to embed the watermark, so as to minimize the impact on the image quality while ensuring the robustness of the watermark.

[0025] (3) Improve the security of the watermark: By the improved tent chaotic mapping, enhance the randomness and unpredictability of the watermark, and further improve the security and anti - attack ability of the watermark.

[0026] (4) Optimize the 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 costs of hardware and software.

[0027] (5) Reduce the misdetection problem: Through feature extraction and a three - layer authentication mechanism, improve the accuracy of forgery detection, reduce the misdetection phenomenon, and ensure the reliability of watermark detection.

[0028] The present invention includes the following steps: Data processing: The present invention relies on the CoMoFoD database, industrial scenario database, and USC - SIPI image database. Among them, the CoMoFoD database: This is a commonly used database for copy - move forgery detection, containing original images, forged images, and color masks, etc. This database is used to evaluate the recovery performance of the proposed method under different texture challenges; the industrial scenario database: Collected by the team, containing 50 images of different industrial scenarios. These images are used to test the effectiveness and robustness of the proposed method in actual industrial scenarios; the USC - SIPI image database: This is a standard image database, mainly used for image processing and compression research. The images in this database are used for comparison with existing works to verify the superiority of the proposed method.

[0029] S1: Watermark generation.

[0030] S11: Initial step.

[0031] The specific steps of S11 are as follows: Divide the color image with size into multiple independent non - overlapping blocks , and the size of each block is . For each divided block , it is necessary to extract its three color component images in the RGB color space, which are respectively denoted as: , , and .

[0032] S12: Authentication watermark generation: The Hash Authentication Feature (HAF) algorithm is used to establish the feature dependency relationship between blocks to construct authentication bits. To cope with various images, the HAF algorithm is used to generate authentication watermarks corresponding to , and respectively, denoted as , and . The specific steps of S12 are as follows: S121: Divide the three color component images , and into multiple non - overlapping blocks ; S122: Extract the Most Significant Bit (MSB) according to Equation (1): (1); where: represents extracting the first bits of the most significant bits of each pixel value, and the value is 5; represents rounding down; S123: The block feature is considered one of the key features for block authentication. Use a hash function to calculate the block feature, and extract the first four bits of the hash value as the self - block (A self - block refers to an independent and non - overlapping block obtained by dividing an image. These blocks are used to generate authentication information and recovery information and are a basic unit in the method.) feature authentication bit , as shown in the process of generating authentication bits at the two 16 - grid squares above Figure 2 ; S124: To destroy the separation of blocks and the robustness of the watermark, use the dynamic diagonal mapping algorithm as Equation (2) to locate the mapped blocks, and extract the last 4 bits of the hash value as the feature authentication bit of the mapped blocks , as shown in the process of generating the following two 16 - grid squares at the authentication bit Figure 2 ; (2); Where: represents the dynamic diagonal mapping algorithm, which is used to map the image block to the diagonal position to enhance the security and recovery quality of the watermark. Specifically, a block is mapped to another position through the diagonal mapping rule, thus scrambling the order of the blocks; S125: Reconstruct the self - block feature authentication bit according to Equation (3) and the feature authentication bit of the mapped block to obtain the authentication bits of non - overlapping blocks . The generation process of the entire authentication bit is as shown in Figure 2 ; (3); Where: represents the concatenation operation. For example, is 1000, is 0110, then is 10000110.

[0033] 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 respectively to improve the recovery quality and enhance the security.

[0034] Application of the SparseViT algorithm: Use the SparseViT algorithm to replace the traditional SPIHT algorithm to generate watermark information. Through the sparse attention mechanism and the vision Transformer architecture, the SparseViT algorithm can extract image features more efficiently and generate more robust and discriminative watermark information.

[0035] Dynamic diagonal mapping: Change the traditional diagonal mapping to dynamic diagonal mapping. The dynamic diagonal mapping adjusts the mapping parameters in real - time according to the image content and watermark information, making the distribution of the watermark information in the image more random and unpredictable, and improving the security and anti - attack ability of the watermark.

[0036] Improved tent chaotic mapping: Use the improved tent chaotic mapping to replace the traditional chaotic mapping algorithm. By introducing an adaptive parameter adjustment mechanism, the improved tent chaotic mapping enhances the complexity and randomness of the chaotic system, further improving the security and robustness of the watermark.

[0037] The proposed algorithm for creating three tamperings is used to recover the tampered area.

[0038] HAF (Hash Authentication Feature), IDLCM (Improved Diagonal Tent Chaotic Map), SVG (Sparse Vision Transformer Averaging Algorithm).

[0039] The specific steps of S13 are as follows: S131: Use the SparseViT algorithm to extract features from the red component image to generate the recovered watermark ; SparseViT adaptively extracts the non-semantic features of the image through the sparse self-attention mechanism. These features are sensitive to image tampering and reduce the computational complexity at the same time. The introduction of the SparseViT algorithm can improve the efficiency and robustness of the watermark generation process, especially when dealing with high-resolution images.

[0040] S132: Divide the green component image and the blue component image into non-overlapping blocks , and calculate the average intensity value of each block using Equation (4) : (4); S133: Extract the most significant bit (MSB) from the average intensity value as the block recovery bit , as shown in Equation (5): (5); where: d represents the number of bits of the extracted MSB, and the value is 6; S134: Combine all the generated block recovery bits according to Equation (6) to obtain the recovered watermark and : (6); where: the recovered watermark and respectively represent the recovered watermarks corresponding to the color component images and ; is the block recovery bit of the th row and th column of the color component images x and y ; Represents a character concatenation or vector connection operation, used to connect multiple restored bits in a certain order to form a complete watermark; S135: To improve security and recovery rate, an improved diagonal tent chaotic map algorithm (Improved Diagonal Tent Chaotic Map, IDLCM) is used to shuffle and rearrange the restored watermark 、 and to generate corresponding restored watermarks 、 and and three copies of.

[0041] Embed block-level dynamic diagonal mapping restored bits; The block-level dynamic diagonal mapping restored bits and (The restored bits generated by the dynamic diagonal mapping algorithm related to and ) are embedded into the red component image to represent the dynamic diagonal mapping restored information of the restored watermark and ; Embed block-level improved tent chaotic mapping restored bits; The block-level improved tent chaotic mapping restored bits and are respectively embedded into the color component images and to represent the improved chaotic mapping restored information of the restored watermarks and respectively arranged by keyG and keyB.

[0042] S2: Watermark embedding; Combine the changed authentication bits with the restored bits. Watermark embedding is completed by combining block-based regular marking and pixel-based continuous marking and applying the human visual system (HVS).

[0043] The specific steps of the said S2 are: Based on the authentication data and the restored data , the watermark embedding process details the program of embedding watermark information and performing bit adjustment. To minimize the damage to the watermark image, block-based regular marking and pixel-based continuous marking are proposed.

[0044] S21: Marking position selection; S211: The marking position of the authentication data is ; S212: Restore data The marked position of ; S213: Restore data and The marked position of ; S22: Embedding strategy; S221: Restore data Embed 1 - LSB (Least Significant Bit); S222: Restore data and Embed into 2 - LSB; S223: Authenticate data Embed the data according to the data at the embedding position into 2 - LSB or 3 - LSB; if the 2 - LSB at the embedding position has available data, authenticate the data Embed into 3 - LSB; The embedding method combining block - based and pixel - based: Adopt the embedding method combining block - based regular marking and pixel - based continuous marking, and embed the watermark information into specific positions of the image. By reasonably adjusting the embedding strength and position, achieve the efficient embedding of watermark information and the optimization of image quality.

[0045] S23: Generate a temporary watermark image; S231: Finally generate a temporary watermark image ; S232: The key length is determined by the block size and is bits per block; S24: Watermark load; The watermark load is , and to ensure the quality of the watermark image, a larger block size is a better choice; S25: Bit adjustment method; To improve the quality of the image after embedding the watermark, adopt the bit adjustment method, and the specific adjustment rules are shown in Equation (7): (7); Where: is the original pixel; is the temporary watermark pixel The difference between the original pixel of ; is the final watermark pixel; S26: Embedding Location Selection Based on the Human Visual System (HVS); After in-place adjustment, use the embedding location selection method based on the Human Visual System (HVS) to further optimize the watermark embedding location. The HVS method takes advantage of the fact that the human eye is less sensitive to areas with high brightness and strong contrast changes in an image, and selects these areas to embed watermark information to reduce the impact on image quality while improving the robustness and imperceptibility of the watermark.

[0046] Embedding Location Selection Based on HVS: During the watermark embedding process, use the embedding location selection method based on the human visual system (HVS). This method selects the areas with the least visual impact to embed watermark information according to the sensitivity of the human eye to different image regions, thus minimizing the impact on image quality while ensuring the robustness of the watermark.

[0047] S3: Tampering Detection; To verify the received image and restore the tampered area, watermark extraction and inverse scrambling are initialized, and the tampered area is marked according to the extracted authentication bits combined with three-layer authentication; The specific steps of S3 are as follows: Received color image (that is, the image received at the receiving end, which may be an untampered image with a watermark embedded or a tampered image) is divided into multiple independent non-overlapping blocks , and the size of each block is , and at the same time, respectively represent the color components of the received image in the RGB color space, and the specific tampering detection structure will be described item by item next; S31: Authentication Bit Calculation: For each block, the hash authentication feature algorithm calculates the authentication bit , and its value is bpb, ; S32: Extract Watermark Information: Extract the watermark information of 2-LSB or 3-LSB from the pixels of the marked self-blocks (the pixels in the self-blocks selected and marked for embedding watermark information during the watermark embedding stage. These pixels are given specific watermark information (such as authentication bits and recovery bits) during the embedding stage, and the corresponding watermark information is extracted from these pixels during the extraction stage for tampering detection and image recovery.), and generate the extracted authentication bit ; S33: Authentication Bit Comparison: Compare the calculated authentication bit and the extracted authentication bit to determine whether the non-overlapping block has been tampered with. If the calculated authentication bit and the extracted authentication bit are equal, then the non-overlapping block It is considered not tampered; otherwise, further judgment is needed; S34: Self-block feature comparison: Calculate the authentication bits and the extracted authentication bits are not equal. Compare the self-block feature authentication bits. If the self-block feature authentication bits and the extracted authentication bits are different, it is considered that the self-block has been tampered; S35: Mapping block check: To find the real reason for the authentication information difference, check whether the mapping block has been tampered; Use the hash authentication feature algorithm to generate the mapping block authentication bits , and extract the hidden authentication information to generate , if the two match, it is considered that the mapping block has not been tampered, otherwise, it is considered that the non-overlapping block has been tampered; S36: Initial tampering detection result: After traversing all blocks, obtain the initial tampering detection results of the three channels, the self-block feature authentication bits , and .

[0048] Feature extraction and three-layer authentication mechanism: In the tampering detection stage, use the feature extraction algorithm combined with the three-layer authentication mechanism to perform multi-dimensional feature analysis and authentication on the image. By comparing the extracted feature information with the embedded watermark information, accurately detect the tampered area in the image.

[0049] S4: Self-recovery; Based on the block pixel-level recovery mechanism, decode and reconstruct the three types of tampering to effectively recover the tampered area.

[0050] The specific steps of the above-mentioned S4 are as follows: The watermark information in the tampered area may be damaged. To recover the embedded watermark information, based on the tampering detection result ( Perform morphological operations (erode the image, dilate the image, further erode the image) to obtain the final tampering detection result ) A block pixel-level recovery mechanism is proposed. The self-recovery process is as follows: S41: R-channel self-recovery; S411: Divide the tampering detection result into blocks of size , through reverse scrambling of the tampering detection result using keyG, obtain the reverse tampering detection result , according to the proposed mechanism, perform the first-level block-level recovery in the tampering detection result to obtain the recovery information ; S412: Based on the tampering detection result and the recovery information , perform the next recovery at the pixel level; pixel (referring to a single pixel point in the image, which is the smallest unit of the image. During the recovery process, judgment and recovery operations need to be performed on each pixel.) If it is marked as tampered in the reverse tampering detection result , then the recovery bit (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) the mapped pixel to extract the embedded diagonal mapping recovery bit , otherwise, the recovery bit is the self-recovery bit embedded in the red component image (the recovery bit information embedded in the red component image for performing recovery operations when the pixel is not tampered); S413: Reconstruct the recovery data through formulas (9) and (10): (9); (10); Where: is (the recovery information embedded in the red component image . During the watermark embedding stage, the recovery information is embedded into the red component of the image for image recovery when needed) the reconstructed recovery data; Use the SparseViT algorithm to decode to obtain the corresponding decoded image ; S42: Self-recovery of the G channel and the B channel; S421: The block-level tampering detection result is respectively reversely shuffled using keyG and keyB to obtain and ; S422: Based on the block-level diagonal mapping, reverse arrange the tampering detection result to obtain ; S423: According to the reverse arrangement , the reverse tampering detection result and , use Algorithm 2 (Algorithm2, used to perform initial recovery operations at the block level according to the tampering detection result and the recovery information.) for initial information reconstruction; Algorithm 2: Initial self-recovery process of channels G and B Input: Receive an image , Information extraction 、 and ; Output: Initial reconstruction channel and ; 1. for i = 1 to do 2. for j = 1 to do 3. If marked as not tampered then 4. ; 5. Otherwise 6. If marked as not tampered then 7.

[0051] 8. If marked as not tampered then 9. ; 10. End the for loop; 11. End the for loop; S424: Affected by the tampered overlapping area, fill the tampered area with the average value of adjacent valid pixels; To improve the performance of the restored image, the tampering coverage and restoration process are improved. The area affected by the tampered coincidence problem is reconstructed using the Smoothing Inpainting algorithm. Experimental results show that when the tampering rate of the watermarked image is less than 80%, the tampered area can be effectively restored and the quality is satisfactory; S425: Finally obtained through Equation (11): (11); Where: is the restored image obtained previously; represents the dot product operation; represents the restored image.

[0052] Block pixel-level restoration mechanism and Smoothing Inpainting algorithm: For the detected tampered area, a block pixel-level restoration mechanism combined with an improved Smoothing Inpainting algorithm is used for restoration. By dynamically adjusting the restoration parameters and optimizing the algorithm flow, efficient and high-quality restoration of the tampered area is achieved.

[0053] The specific embodiments of the present invention disclosed above are only examples. However, the present invention is not limited thereto, and any changes that can be conceived by those skilled in the art shall fall within the protection scope 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 respectively using a dynamic diagonal mapping algorithm to improve the recovery quality and enhance security. S2: watermark embedding; S3: tamper detection; S4: Self-recovery.

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 , the three color component images in the RGB color space need to be extracted and recorded as: , and .

3. The improved color image tampering detection and self-recovery method according to claim 2 is characterized in that: The specific steps of S12 are: S121: Convert three color component images , and Divide into multiple non-overlapping blocks ; S122: Extract the most significant bit from it according to formula (1): (1); in: Indicates that the previous value of each pixel 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 concatenation operation.

4. The improved color image tampering detection and self-recovery method according to claim 2 is 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 the 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 bits of the extracted MSB; S134: Restore all generated blocks According to formula (6), we can get the restored watermark and : (6); Among them: restore watermark and Respectively represent the color component images and Recovery watermark; is the color component image and No. x Line 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 is characterized in that: The specific steps of S2 are: S21: Marking position selection; S211: Authentication data The marker position is ; S212: Recover Data The marker position is ; S213: Recover Data and The marker position is ; S22: Embedding strategy; S221: Recover 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 rule is shown in formula (7): (7); in: is the original pixel; Is a temporary watermark pixel 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 is 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 bits ; 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 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 to have not been tampered with, otherwise, it is considered a non-overlapping block has been tampered with; S36: Initial tampering detection results: After traversing all blocks, the initial tampering detection results of the three channels are obtained from the block feature authentication bit , and .

7. The improved color image tampering detection and self-recovery method according to claim 6 is characterized in that: The specific steps of S4 are: S41: R channel self-recovery; S411: Tamper detection results Divide into blocks, and tamper detection results by reversely disrupting Use keyG to obtain reverse tampering detection results , according to the proposed mechanism, in the tampering detection results Perform block-level first-level recovery in the ; S412: Based on tampering detection results and recovery information , the next step is to restore at the pixel level; pixel Reverse tampering detection results If the file is marked as tampered, the bit is restored. is from Mapping pixels The embedded diagonal mapping recovered bits extracted from Otherwise, restore the is embedded in the red component image The self-recovery position ; S413: Reconstruct the recovery 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 tampering detection result 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 obtain through equation (11): (11); in: is the restored image obtained previously; Represents the dot product operation; Represents the restored image.

Citation Information

Patent Citations

  • Image tampering detection positioning and self-recovery method based on fragile watermark

    CN113014742A

  • Watermark embedding and image self-recovery method based on reference matrix and LSB replacement

    CN114511437A

  • Color image self-recovery method based on three-dimensional reference matrix

    CN115439299A

  • Medical image self-recovery method based on image restoration algorithm

    CN116416112A

  • Image tampering detection and self-recovery method and device based on digital watermark

    CN118313996A