A method and system for reversible watermark hiding in color JPEG based on adaptive STC

By adaptively allocating embedding capacity and optimizing embedding order in color JPEG images using the adaptive STC method, the problems of high capacity, low distortion, and reversibility in existing methods for color JPEG images are solved, and efficient and reliable watermark hiding is achieved.

CN122048624BActive Publication Date: 2026-06-30NANCHANG UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NANCHANG UNIV
Filing Date
2026-04-15
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing reversible watermarking methods struggle to achieve high capacity, low distortion, and complete reversibility in color JPEG images, especially lacking a unified framework and effective utilization of the statistical properties of Y and channels and the characteristics of human visual perception.

Method used

The adaptive STC method is used to calculate the embedding adaptation weights of Y, channel, and channel, adaptively allocate the embedding capacity, and embed watermarks in zero-value DCT coefficients using check grid STC encoding. The embedding order and distortion control are optimized by combining the human visual model.

Benefits of technology

It achieves high-capacity, low-distortion, fully reversible watermark hiding in color JPEG images, maintaining image visual fidelity, and supporting applications in multimedia security, digital forensics, and copyright management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122048624B_ABST
    Figure CN122048624B_ABST
Patent Text Reader

Abstract

This application belongs to the field of data processing technology and discloses a method and system for reversible watermark hiding of color JPEG based on adaptive STC. The method includes: acquiring a color JPEG image, decoding and converting it to the Y color space, and extracting the DCT coefficients of the Y, I, and II channels; calculating the embedding adaptation weights according to the statistical characteristics of the DCT coefficients of each channel, and adaptively allocating the embedding capacities of the three channels to the Y, I, and II channels in combination with a preset channel weighting adjustment factor; selecting a candidate set according to the allocated embedding capacity in the order of the three channels, and constructing a carrier sequence from the zero-value coefficients in the candidate set; embedding the watermark to be hidden into the carrier sequence through STC encoding to generate a watermark-hidden JPEG image, thereby achieving high-capacity, low-distortion, and completely reversible watermark hiding for color JPEG images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a method and system for hiding reversible watermarks in color JPEGs based on adaptive STC. Background Technology

[0002] Traditional watermarking methods introduce irreversible distortion after embedding information, making the original data unrecoverable. This makes them unsuitable for applications with extremely high data integrity requirements, such as medical imaging and legal evidence collection. To address this, Reversible Data Hiding (RDH) technology has emerged. This technology can extract the hidden watermark while restoring the original data without loss, and has already demonstrated significant application value in areas such as image authentication and medical data sharing.

[0003] However, most existing reversible watermarking methods are designed for uncompressed grayscale images, relying primarily on spatial redundancy between pixels to achieve reversibility. Therefore, they are difficult to directly apply to the more widely used JPEG image format. While some RDH research has been conducted for JPEG, most still focus on grayscale images, or suffer from limitations such as insufficient embedding capacity, significant degradation in visual quality after embedding, and difficulty in achieving complete reversibility. As color images become the mainstream digital medium, RDH research has gradually expanded to the color image domain, but most schemes remain limited to the uncompressed spatial domain. Extending existing methods to color JPEG images faces two major challenges: first, the JPEG compression process significantly reduces the spatial domain redundancy of the image, making it difficult to directly transfer traditional methods that rely on pixel redundancy; second, the JPEG format uses Y... Color space, its luminance (Y) component and chromaticity (Y) component , The different quantization characteristics and visual sensitivities of the components make existing methods lack systematicity and effectiveness in designing cross-channel embedding strategies.

[0004] Therefore, there is an urgent need in the current technological field for a new technical solution to address the difficulty of existing algorithms in simultaneously utilizing Y. The statistical properties of the three channels and the characteristics of human visual perception highlight the lack of a unified color JPEG reversible watermark hiding scheme that can achieve high capacity, low distortion, and complete reversibility. Summary of the Invention

[0005] The main objective of this invention is to provide a method and system for reversible watermarking in color JPEG based on adaptive STC, aiming to solve at least one of the aforementioned problems in the prior art, particularly the key issues of lack of a unified framework for reversible watermarking in color JPEG domains, insufficient utilization of inter-channel characteristics, and difficulty in balancing capacity and visual quality.

[0006] In a first aspect, the present invention provides a method for reversible watermark hiding in color JPEG based on adaptive STC, comprising the following steps:

[0007] Acquire a color JPEG image, decode the color JPEG image, and convert it to Y. Color space, to extract the Y channel, Channels and Quantization Discrete Cosine Transform (DCT) coefficients of the channel;

[0008] According to the Y channel, the Channel and the The statistical properties of the DCT coefficients of the channel are used to calculate the Y channel, the... Channel and the The texture complexity and zero coefficient density of each DCT sub-block in the channel are used to generate the embedding adaptation weights for each channel;

[0009] Based on the embedded adaptive weights and the preset channel weighting adjustment factor, the Y channel, the... Channel and the Channel adaptive allocation of embedding capacity , , To obtain the embedding capacity allocation results for each channel;

[0010] According to the Y channel, aisle, The information embedding operation is performed on each channel in sequence according to the channel order. The information embedding operation includes: selecting one or more zero-value DCT coefficients in the current channel to be embedded to form a carrier sequence according to the embedding capacity allocation result, and embedding the watermark to be hidden into the carrier sequence through STC encoding to generate a JPEG image with hidden watermark.

[0011] As an optional implementation of the first aspect of this application, the Y channel, the... Channel and the Before the step of calculating the texture complexity and zero coefficient density of each DCT sub-block in a channel to generate the embedding adaptation weights for each channel, a channel characteristic analysis step is also included, specifically including: calculating the texture complexity and zero coefficient density of the Y channel, the... Channel and the In the channel, the density of zero-value AC coefficients among all AC coefficients, and the amplitude distribution of non-zero AC coefficients; combined with a human visual model, by quantizing the step size, the probability of coefficients being zero, and the frequency sensitivity weight of the frequency band position, the Y channel and the... Channel and the The visual sensitivity differences of the channels are used to determine the channel weighting adjustment factor and the frequency sensitivity weight.

[0012] As an optional implementation of the first aspect of this application, the Y channel, the... Channel and the Channel adaptive allocation of embedding capacity , , The steps specifically include: calculating the embedding capacity allocated to channel c based on the total capacity EC of the watermark to be hidden, according to the following formula: Where c is the channel index, ; The embedding capacity allocated to channel c; The weighted adjustment factor for channel c; For the embedding adaptation weights of channel c; , , Y, respectively , The adaptive weight of the channel; wherein, the embedding adaptive weight of channel c is calculated by the following formula: ;in, The texture complexity of the i-th DCT block is calculated from the differential energy of the AC coefficients within the block. This represents the zero coefficient density within the i-th DCT block.

[0013] As an optional implementation of the first aspect of this application, the step of selecting one or more zero-value DCT coefficients in the current channel to be embedded to form a carrier sequence specifically includes: calculating the coefficient priority metric for each DCT coefficient in the current channel to be embedded according to the following formula: ;in, This represents the priority metric value of the position coefficient of the j-th frequency band in the i-th DCT block; This indicates the corresponding quantization step size; This indicates the probability that the coefficient is zero; This represents the frequency sensitivity weight at the j-th frequency band position; all AC coefficients in the current channel to be embedded are quantified according to their coefficient priority. Sort in ascending order and select the top few items in the sorted order. A set of coefficients is formed to constitute a candidate set to be modified, which satisfies the embedding capacity requirement of the channel; from the candidate set to be modified, all zero-value coefficients are selected to form the carrier sequence.

[0014] As an optional implementation of the first aspect of this application, the step of embedding the watermark to be hidden into the carrier sequence through STC encoding specifically includes: calculating the modification cost of modifying each zero-value coefficient in the carrier sequence according to the following formula: ;in, This indicates the cost of modifying the position coefficient; This indicates the corresponding quantization step size; The summation term in the denominator represents the absolute value of the coefficients within the current block, and is a measure of the local texture masking effect. Combining the modification cost and the watermark to be hidden, a coefficient modification sequence with values ​​{0, 1, -1} is generated by STC encoding, and the coefficient modification sequence is superimposed on the carrier sequence to achieve information embedding with minimal total embedding distortion.

[0015] As an optional implementation of the first aspect of this application, before the step of embedding the watermark to be hidden into the carrier sequence through STC encoding, the method further includes: performing a reversible shift operation on all non-zero coefficients in the candidate set to be modified according to the following formula, reserving embedding space for the STC embedding of the zero-value coefficients: ;in, These are the original non-zero coefficients. The coefficients are obtained after performing a reversible shift operation.

[0016] As an optional implementation of the first aspect of this application, the method further includes data extraction and image restoration steps, specifically including: reading the pre-stored Y channel from the file header of the encrypted JPEG image. Channels and Channel embedding capacity , , According to the Y channel, Channels and The data extraction and coefficient recovery operations are performed sequentially on each channel. These operations include: reconstructing an extraction candidate set identical to the embedding stage; and for the encrypted coefficient sequence in the extraction candidate set, invoking the STC decoding mechanism to recover the hidden watermark in the channel according to the following formula: ;in, To recover the hidden watermark, This is the parity check matrix of STC. The candidate set contains a sequence of density coefficients. After data extraction, an inverse mapping operation is performed on the coefficients in the extracted candidate set according to the following formula to recover the original DCT coefficients: ;in, These are the restored original coefficients. The coefficients are for the image with high density.

[0017] Secondly, embodiments of this application provide a color JPEG reversible watermark hiding system based on adaptive STC, comprising:

[0018] The image preprocessing module is used to acquire a color JPEG image, decode the color JPEG image, and convert it to Y... Color space, to extract the Y channel, Channels and Quantization Discrete Cosine Transform (DCT) coefficients of the channel;

[0019] An embedded adaptive weight generation module is used to generate weights based on the Y channel and the... Channel and the The statistical properties of the DCT coefficients of the channel are used to calculate the Y channel, the... Channel and the The texture complexity and zero coefficient density of each DCT sub-block in the channel are used to generate the embedding adaptation weights for each channel;

[0020] An embedded capacity allocation module is used to allocate capacity to the Y channel and the [other channels] based on the embedded adaptive weights and a preset channel weighting adjustment factor. Channel and the Channel adaptive allocation of embedding capacity , , To obtain the embedding capacity allocation results for each channel;

[0021] Information embedding module, used according to Y channel, aisle, The information embedding operation is performed on each channel in sequence according to the channel order. The information embedding operation includes: selecting one or more zero-value DCT coefficients in the current channel to be embedded to form a carrier sequence according to the embedding capacity allocation result, and embedding the watermark to be hidden into the carrier sequence through STC encoding to generate a JPEG image with hidden watermark.

[0022] Thirdly, embodiments of this application provide an electronic device, which includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor. When the program or instructions are executed by the processor, they implement the steps of the method described in the first aspect.

[0023] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.

[0024] Compared with the prior art, the embodiments of the present invention have at least the following beneficial effects: by constructing a system based on Y, The method employs a coefficient priority metric and a channel adaptive capacity allocation strategy to achieve fine-grained embedding control for different color channels. It fully leverages the differences in visual sensitivity and quantization intensity between luminance and chrominance components, combined with the STC matrix embedding mechanism. This enables high-capacity, low-distortion, and fully reversible watermark hiding for color JPEG images while maintaining high visual fidelity and JPEG compression structural invariance. This provides an efficient and reliable technical solution for multimedia security, digital forensics, copyright management, and privacy protection. Attached Figure Description

[0025] Figure 1 This is a flowchart illustrating a reversible watermark hiding method for color JPEG images in one embodiment of the present invention.

[0026] Figure 2 This is a schematic diagram of the compression process of a color JPEG image in one embodiment of the present invention;

[0027] Figure 3 This is a comparison of the PSNR-embedding capacity of the proposed method and the traditional method under different QFs in the USC-SIPI dataset;

[0028] Figure 4 This is a comparison of the SSIM embedding capacity of the proposed method and the traditional method under different QFs on the USC-SIPI dataset;

[0029] Figure 5 This is a comparison of the average PSNR-embedding capacity and average SSIM-embedding capacity of the proposed method and traditional methods under different QFs in the UCID dataset;

[0030] Figure 6 This is a comparison chart of the maximum embedding capacity of the method proposed in this invention and the traditional method when the PSNR threshold is 30 dB;

[0031] Figure 7 This is a comparison of the average INCR-embedding capacity of the proposed method and the traditional method under different QFs in the UCID dataset;

[0032] Figure 8 This is a schematic diagram of the structure of a color JPEG reversible watermark hiding system based on adaptive STC in an embodiment of the present invention. Detailed Implementation

[0033] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0034] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0035] Example 1

[0036] Please see Figure 1 This is a flowchart illustrating a reversible watermark hiding method for color JPEG based on adaptive STC, provided by an embodiment of the present invention. The method may include the following steps:

[0037] S1: Acquire a color JPEG image, decode the color JPEG image, and convert it to Y. Color space, to extract the Y channel, Channels and Quantization Discrete Cosine Transform (DCT) coefficients of the channel.

[0038] In step S1, the color space conversion and DCT coefficient extraction of the image are completed, laying the foundation for subsequent reversible embedding. For example... Figure 2 As shown, image decoding and color space conversion are performed first. Specifically, the input color JPEG image is decoded and converted from the original RGB color space to Y. Color space and downsampling, Y Color space includes the Y component, Components and The components, where the Y component corresponds to the image brightness information. , The components correspond to chromaticity information; this conversion can match the visual characteristics of the human eye, which is more sensitive to brightness and relatively less sensitive to chromaticity.

[0039] Then, quantization and DCT coefficient extraction are performed, specifically, from the decoded Y, , In the three channels, the quantization DCT coefficient matrix and the corresponding quantization table Q of each channel are extracted respectively, and the DCT coefficients of each channel are divided into 8×8 DCT sub-blocks as the basic processing unit for subsequent information embedding.

[0040] Entropy encoding is then performed. Next, channel characteristic analysis is conducted, statistically analyzing the coefficient distribution characteristics of each channel. Specifically, this includes calculating the proportion density of zero-value AC coefficients in all coefficients within each channel, and the amplitude distribution of non-zero coefficients. Simultaneously, in conjunction with a human visual model, Y is evaluated. , The difference in visual sensitivity of the channels is specifically determined by the quantization step size. The probability of a size and a coefficient of zero and frequency sensitivity weights of frequency band locations To jointly quantify visual sensitivity, it was determined that the Y channel has the highest visual weight, and modifications to it are prone to causing significant distortion. , The higher visual tolerance of the channel provides a basis for subsequent capacity allocation and embedding order determination.

[0041] S2: According to the Y channel, the Channel and the The statistical properties of the DCT coefficients of the channel are used to calculate the Y channel, the... Channel and the The texture complexity and zero coefficient density of each DCT sub-block in the channel are used to generate the embedding adaptation weights for each channel.

[0042] Specifically, the embedding adaptation weights of channel c are calculated using the following formula:

[0043] ;

[0044] Where 'c' represents the channel index. ; The texture complexity of the i-th DCT block is calculated from the differential energy of the AC coefficients within the block. This represents the zero coefficient density within the i-th DCT block.

[0045] S3: Based on the embedded adaptive weights and the preset channel weighting adjustment factor, the Y channel, the... Channel and the Channel adaptive allocation of embedding capacity , , This is to obtain the embedding capacity allocation results for each channel.

[0046] In step S3, the embedding capacity is dynamically allocated based on channel characteristics, and the embedding order is determined, providing a quantitative basis for channel-specific embedding. Specifically, based on the following formula, combined with Y, , The coefficient distribution characteristics and visual sensitivity differences of each channel are used to adaptively allocate embedding capacity to each channel. , , ;

[0047] ;

[0048] Where EC represents the total capacity of the hidden watermark to be embedded; c represents the channel index. ; This represents the embedding capacity allocated to channel c; This represents the weighted adjustment factor for channel c; This represents the embedding adaptation weights of channel c; , , Representing Y, , The sum of the adaptive weights of the channels;

[0049] Based on the above allocation rules, more capacity is preferentially allocated to regions with complex textures and many zero coefficients. The Y channel, due to its high visual weight, requires capacity allocation that also considers distortion control; this is achieved by setting a smaller weighting adjustment factor. This limits the embedding capacity ratio of the Y channel, thereby preventing significant visual distortion caused by excessive embedding of the luminance component; at the same time, it clarifies the Y→ → The embedding order of the channels is as follows: first, the information embedding of the Y channel is completed, and then the channels are processed sequentially. , Channels ensure that the embedding process conforms to the laws of human visual perception and reduce overall embedding distortion.

[0050] S4: According to the Y channel, aisle, The information embedding operation is performed on each channel in sequence according to the channel order. The information embedding operation includes: selecting one or more zero-value DCT coefficients in the current channel to be embedded to form a carrier sequence according to the embedding capacity allocation result, and embedding the watermark to be hidden into the carrier sequence through STC encoding to generate a JPEG image with hidden watermark.

[0051] Step S4 is the core step in information embedding, relying on coefficient priority filtering and STC to achieve efficient and reversible embedding. Specifically, for the current channel to be embedded (taking the Y channel as an example), the coefficient priority metric for each DCT coefficient is first calculated according to the following formula. :

[0052] ;

[0053] in, This represents the priority metric value of the position coefficient of the j-th frequency band in the i-th block; This indicates the corresponding quantization step size; This indicates the probability that the coefficient is zero; This represents the frequency sensitivity weight of the j-th frequency band position, aiming to give priority to high-frequency coefficients that are not sensitive to the human eye.

[0054] This coefficient priority metric reflects the distortion cost and embedding priority of coefficient modifications; a smaller value indicates a higher priority. Subsequently, all AC coefficients within the channel are sorted according to... Sort values ​​in ascending order and select the first few. Construct a candidate set to be modified from each coefficient. This ensures that the candidate set can meet the embedding capacity requirements of the channel; then the candidate set... The zero-value coefficients in the sequence are used as the carrier sequence, combined with the watermark to be hidden M and the modification cost calculated by the following formula:

[0055] ;

[0056] in, This represents the cost of modifying the position coefficient. ; indicates the corresponding quantization step size; This represents the absolute value of the coefficients within the current block, and the summation term in the denominator reflects the local texture masking effect.

[0057] The hidden watermark is embedded using STC, generating a coefficient sequence with values ​​{0, 1, -1} while minimizing the total embedding distortion; then the candidate set is processed... The non-zero coefficients in the equation are reversibly shifted according to the following rules to reserve space for the STC embedding of zero-value coefficients, while ensuring the reversibility of subsequent recovery.

[0058] ;

[0059] in, This represents the coefficient after shifting. This represents the original non-zero coefficients. After completing the Y-channel embedding, the same process is followed sequentially in... The remaining hidden watermark is embedded in the channel, and the adaptive allocation capacity of each channel is used to carry all the information. Finally, the embedding capacity of each channel is used as auxiliary information and embedded into the file header of the encrypted JPEG image, providing a key basis for subsequent extraction and recovery.

[0060] Furthermore, this method also includes step S5: data extraction and image restoration.

[0061] In step S5, following the reverse embedding process, the hidden watermark extraction and complete restoration of the encrypted image are achieved, ensuring the reversibility of the method. First, the pre-stored Y, ... Channel Embedded Capacity , , Define the length of information to be extracted from each channel; then proceed according to Y, The extraction order is adjusted, and the coefficient priority metric is recalculated for the target channel (taking the Y channel as an example). And select the first ones in ascending order. Each coefficient is used to construct the extraction candidate set corresponding to the embedding stage. Next, the STC decoding mechanism is invoked to process the candidate set. The sequence of data density coefficients and the parity check matrix Perform the calculation to recover the hidden watermark of the channel using the following formula;

[0062] ;

[0063] in, To recover the hidden watermark, This is the parity check matrix of STC. This is a sequence of density coefficients in the candidate set;

[0064] After information extraction is completed, the original DCT coefficients are recovered according to the inverse mapping rule, as shown in the following formula:

[0065] ;

[0066] in, This represents the original coefficients after restoration. These represent the coefficients of the image with high density. Finally, for... The channel sequentially executes the above extraction and restoration processes, ultimately achieving the complete extraction of all hidden watermarks and Y, Lossless recovery of the original DCT coefficients of the channels completes the reconstruction of the original color JPEG image.

[0067] Experimental results

[0068] To verify the watermark hiding effect of the method of this invention, the feasibility, reversibility, and superiority of the scheme were verified through systematic testing. For reversibility verification, the pixel data and DCT coefficients of the restored image and the original color JPEG image were compared to confirm their complete consistency, verifying the lossless reversibility of the method. Simultaneously, the bit matching degree between the extracted hidden watermark and the original information was checked to ensure no information loss. For performance index testing, the core performance indicators of the scheme were tested on multiple sets of color JPEG image datasets, including the upper limit of embedding capacity for each channel and the overall image, visual distortion (PSNR, SSIM) of the image before and after embedding, and the file size of the encrypted image. For comparative experimental verification, the method of this invention was compared horizontally with existing mainstream JPEG image reversible watermark hiding methods, verifying the significant advantages of this scheme in dimensions such as embedding capacity and visual quality, highlighting its technological innovation and practicality.

[0069] To evaluate the stability of the method of the present invention under different embedding capacities and different image textures, this embodiment conducted extensive experiments on three standard color image databases (including USC-SIPI, Kodak and UCID datasets). In the experiments, the images were compressed with quality factors (QF) of 50, 60 and 70, respectively.

[0070] All experiments were conducted under the same JPEG quantization conditions, the same image encoding process, and a consistent channel capacity allocation strategy. The data embedding order was fixed. To ensure the consistency and reversibility of extraction during experimental testing, a complete embedding, reconstruction, and restoration process was performed on all images for each embedding capacity, and changes in visual quality, color difference, and file size were recorded.

[0071] To verify the effectiveness of the method described in this invention in image steganography and reversible watermark hiding, this embodiment employs a series of objective evaluation metrics to assess the quality of the generated steganographic images. These evaluation metrics include: Peak Signal-to-Noise Ratio (PSNR), Structural Similarity (SSIM), Weighted Peak Signal-to-Noise Ratio (WPSNR), CIEDE2000, Comprehensive Distortion Index (Q), File Size Increment (INCR), and Incremental Bits Per Pixel (IBPP). The specific definitions and calculation methods for each metric are as follows:

[0072] (1) Peak signal-to-noise ratio (PSNR)

[0073] This is used to measure the pixel-level fidelity of a encrypted image relative to the original image. During calculation, the original image I and the encrypted image are first compared... The mean squared error (MSE) across the three channels is then used to calculate the PSNR value based on the maximum pixel value of the image. The larger this value, the less distortion the image exhibits.

[0074] The mean square error is defined as follows:

[0075]

[0076] Where MSE represents the mean squared error; H and W represent the height and width of the image, respectively; i and j represent the row and column indices of the pixel in the image, respectively; This represents the pixel value at coordinates (i,j) in the original JPEG image; This represents the pixel value at coordinates (i,j) of the JPEG image with the watermark hidden.

[0077] The final PSNR is calculated using the following formula:

[0078]

[0079] Wherein, PSNR represents Peak Signal-to-Noise Ratio, measured in decibels (dB); MAX represents the maximum value of the color of an image pixel.

[0080] (2) Structural Similarity Index (SSIM)

[0081] The perceptual consistency between the original image and the superimposed image is measured in terms of brightness, contrast, and structure, and is calculated using the following formula:

[0082]

[0083] in, Represents the original image window I and the encrypted image window Structural similarity index between them; and Representing image window I and The average pixel value is used to estimate brightness information; and Representing image window I and The pixel variance is used to estimate contrast information; Represents image window I and The covariance between them is used to measure the degree of structural similarity; and A constant used to maintain computational stability and to avoid cases where the denominator is zero.

[0084] (3) Weighted peak signal-to-noise ratio (WPSNR)

[0085] This embodiment uses an improved weighted peak signal-to-noise ratio (WPSNR) as an objective evaluation standard for image quality. This method is based on the characteristic that the human visual system is significantly more sensitive to luminance information than chrominance information, and in the Y... In a color space, different channels are assigned specific weights. The specific calculation steps are as follows:

[0086] First, compare the original image I with the encrypted image. Perform color space transformation. Map pixel values ​​to Y using a linear transformation matrix. Color space, separating the luminance component Y and the chrominance component The transformation formula used in this embodiment is as follows:

[0087]

[0088] Secondly, the original image and the image with encryption are calculated separately in terms of Y, The mean square error (MSE) across the three channels is denoted as and Considering that the luminance channel carries the main image structural information, this embodiment sets the weight coefficient of the Y channel to 6, and the weight coefficients of the U and V channels to 1. Weighted mean square error. The calculation formula is:

[0089]

[0090] Finally, the final WPSNR value is calculated based on the weighted mean square error, in decibels (dB):

[0091] WPSNR=10

[0092] Where n is the image bit depth, this indicator can more effectively reflect the subjective visual perception of dense images by the human eye.

[0093] (4) Color difference index (CIEDE2000)

[0094] To accurately quantify color differences perceived by the human eye, this example uses the CIEDE2000 standard color difference formula. The average of the color differences of all pixels is taken as the final image color difference index. The smaller the index value, the less perceptible the visual difference in color.

[0095] CIEDE2000 =

[0096] in, For brightness difference, For color difference and This is due to color tone difference. , , It is a weighted function. It is a rotation term used to correct color differences in the blue area.

[0097] (5) Overall Distortion Index (Q)

[0098] To perform comprehensive ranking and optimization of image quality using a single numerical value, this embodiment defines a comprehensive distortion index Q. This index integrates PSNR, ΔE, and SSIM, and is calculated as follows:

[0099]

[0100] In this example, the weight coefficients for each item are set as follows: = 0.3, = 0.4, = 0.3. This setting balances the contributions of pixel signal-to-noise ratio, chromatic aberration, and structural fidelity to quality evaluation.

[0101] (6) File Increment (INCR)

[0102] This metric measures the storage overhead of steganography operations. The calculation formula is as follows:

[0103] INCR = 8*( )

[0104] in, Indicates the size of the encrypted image. Indicates the size of the original image.

[0105] (7) Incremental bits per pixel (IBPP)

[0106] This metric represents the average number of bits added to the file per pixel; it's a normalized indicator. Directly comparing the total file size increase (INCR) is unfair because different images have different resolutions (width and height). IBPP eliminates the influence of resolution, allowing for horizontal comparisons of storage overhead for images of different sizes. The calculation formula is as follows:

[0107] IBPP =

[0108] Where M and N represent the height and width of the image, respectively.

[0109] 1. Comparative Experiment Setup: To demonstrate the superiority of the method of this invention, it was benchmarked against four representative advanced JPEG reversible watermarking hiding algorithms based on DCT coefficient modification, including schemes by Huang et al., Weng et al., Mao et al., and Li et al. (hereinafter collectively referred to as "conventional methods"). These existing comparative schemes mainly achieve this by modifying the AC coefficients on grayscale images; this embodiment directly extends it to the Y channel of color images for comparison.

[0110] The comparative evaluation focused on two main dimensions: visual quality assessment (using objective metrics PSNR, SSIM, and subjective visual inspection) and embedding capacity analysis. Additionally, file size increment (INCR) was compared to evaluate file size preservation capabilities.

[0111] 2. Visual quality assessment results: In terms of visual quality, performance was compared using quantitative indicators and qualitative visual inspections.

[0112] Objective indicator analysis: such as Figure 3 As shown, experimental results demonstrate that the proposed method consistently outperforms conventional methods across all test images and different QF settings. This performance gain is particularly pronounced in smooth images, such as "airplane" images. For example, at QF=60 and an embedding capacity of 40,000 bits, the PSNR of the proposed method is improved by up to 5 dB compared to conventional methods. This advantage is primarily attributed to the adaptive embedding strategy of the invention, which preferentially utilizes zero-valued DCT coefficients. Since smooth regions contain a large number of such coefficients, the proposed method effectively avoids the extensive coefficient shifting required by conventional methods, thereby minimizing the distortion caused by embedding. Notably, as the payload exceeds 6,000 bits, the performance gap between the proposed method and other methods widens further, demonstrating its high efficiency in high-capacity scenarios.

[0113] Table 1 shows the specific values ​​of various objective evaluation indicators for the method of this invention under different embedding capacities. The data shows that at low embedding capacities (5,000 bits), the method of this invention can achieve near-lossless visual quality, with a PSNR as high as 44.45 dB, an SSIM of 0.99, and a CIEDE2000 color difference value of only 0.71, demonstrating extremely high concealment. With increasing embedding capacities, the indicators show the expected gradual change, but remain at a high level. Especially in high-capacity scenarios (e.g., 41,000 bits), the PSNR remains above the generally accepted good visual quality benchmark of 30.40 dB, and the SSIM maintains a high structural similarity of 0.93, indicating that the texture and edge structure of the image are not significantly damaged. Furthermore, it is noteworthy that at all test capacities, the WPSNR indicator considering human visual characteristics (e.g., 36.82 dB at 41,000 bits) is significantly higher than the traditional PSNR indicator (30.40 dB), which further quantitatively verifies the effectiveness of the present invention in its brightness channel priority and human eye-sensitive area protection strategy. Although the overall distortion index Q value increases with the increase of capacity, the overall value remains in a low range (0.29 to 2.04), which reflects the comprehensive superiority of the present invention in multi-dimensional quality evaluation.

[0114] Table 1. Specific values ​​of various objective evaluation indicators of the method of the present invention under different embedding capacities.

[0115]

[0116] Structural retention capability analysis: such as Figure 4 As shown, in terms of SSIM, traditional methods typically exhibit a sharp decline after reaching a certain capacity threshold, while the method of this invention maintains a more stable and gradual decline. Taking an "airplane" image as an example, existing methods suffer severe structural integrity collapse at approximately 30,000 bits; in contrast, this scheme maintains an SSIM above 0.90 at the same capacity, and even remains above 0.75 at 90,000 bits. This confirms that the strategy of this invention effectively preserves local brightness and contrast.

[0117] Large-scale statistical validation: To verify the statistical generalizability of the method, it was tested on 100 images randomly selected from the UCID database. Figure 5 As shown, the method proposed in this invention consistently maintains the highest level in terms of average PSNR and SSIM values.

[0118] Detailed comparison on the Kodak dataset: As shown in Tables 2 and 3, in experiments on the Kodak dataset with fixed embedding capacities of 20,000 bits and 30,000 bits, the method of this invention achieved the highest average PSNR of 37.94 dB and 35.75 dB, respectively. For specific images such as kodim03, kodim07, and kodim20, the framework of this invention outperforms the second-best method by more than 5 dB. In particular, when the embedding capacity is increased to 30,000 bits, the average PSNR of the existing comparison scheme drops to approximately 31.6 to 31.9 dB, accompanied by significant visual degradation, while this invention still maintains a high average PSNR of 35.75 dB.

[0119] Table 2. Comparison of PSNR between the proposed method and existing algorithms when the embedding capacity is 20,000 bits.

[0120]

[0121] Table 3. Comparison of PSNR between the proposed method and existing algorithms when the embedding capacity is 30,000 bits.

[0122]

[0123] 3. Embedding Capacity Performance Analysis: Regarding embedding capacity, with the constraint of ensuring imperceptibility (PSNR ≥ 30 dB), the framework of this invention achieves the highest effective embedding capacity consistently among all comparative schemes. Specifically, as follows... Figure 6As shown, for the smooth-textured "airplane" image, the method of this invention supports an effective embedding capacity of 43,418 bits, which is about 1.6 times that of the best-performing existing method (about 27,000 bits). For the "lake" image, the advantage is even more pronounced, with the method of this invention reaching 54,121 bits, while competing methods are limited to only about 27,000 bits. This significant capacity improvement is mainly attributed to the adaptive embedding mechanism of this invention. Traditional methods typically prioritize modifying non-zero coefficients to minimize file size expansion, which limits the number of candidate embedding points. In contrast, this invention effectively utilizes zero-valued DCT coefficients through an adaptive selection strategy, circumventing the limitations of traditional methods and significantly expanding the embedding space, thereby achieving higher payload while maintaining high visual fidelity.

[0124] 4. File Size and Storage Efficiency Analysis: To evaluate storage efficiency, this embodiment uses the file size increment (INCR) and bit increment per pixel (IBPP) metrics. For example... Figure 7 As shown, relative to a given embedding capacity, the framework of this invention exhibits an approximately linear and consistently low INCR growth trend. This indicates that fewer extra bits are introduced during data embedding, and the adaptive strategy of this invention is particularly effective in mitigating file size inflation, especially in high-capacity scenarios. Regarding IBPP, as shown in Table 4, the average IBPP of the method of this invention is approximately 0.03, only about 0.01 higher than existing methods. For a standard 512×512 color image, this difference corresponds to a negligible increase in file size, with no observable impact on storage or transmission efficiency. Considering that high-quality JPEG images typically occupy tens to hundreds of KB, the additional overhead introduced by the framework of this invention is well within the constraints of practical applications.

[0125] Table 4. Comparison of the proposed method with traditional methods on the IBPP dataset of the USC-SIPI dataset.

[0126]

[0127] In summary, the method of this invention constructs a Y-based... This invention employs a coefficient priority metric and a channel adaptive capacity allocation strategy to achieve fine-grained embedding control for different color channels. Leveraging the differences in visual sensitivity and quantization intensity between luminance and chrominance components, combined with the STC matrix embedding mechanism, this method achieves efficient and fully reversible data embedding while maintaining image visual consistency. Experimental results demonstrate that the method achieves high embedding capacity and good visual fidelity across various quality factors and types of color images, accurately recovering both the embedded data and the original JPEG image. Overall, this invention provides a high-capacity, low-distortion, and structurally unified solution for reversible data embedding of color compressed images, effectively supporting applications such as authentication, traceability, and secure data management.

[0128] Example 2

[0129] like Figure 8 The diagram shown is a structural schematic of a color JPEG reversible watermark hiding system based on adaptive STC proposed in the second embodiment of this application. The system includes the following key modules:

[0130] Image preprocessing module 100 is used to acquire a color JPEG image, decode the color JPEG image, and convert it to Y... Color space, to extract the Y channel, Channels and Quantization Discrete Cosine Transform (DCT) coefficients of the channel;

[0131] Embedded adaptive weight generation module 200, used to generate weights based on the Y channel, the Channel and the The statistical properties of the DCT coefficients of the channel are used to calculate the Y channel, the... Channel and the The texture complexity and zero coefficient density of each DCT sub-block in the channel are used to generate the embedding adaptation weights for each channel;

[0132] Embedded capacity allocation module 300 is used to allocate capacity to the Y channel and the embedded adaptive weights based on the embedded adaptive weights and a preset channel weighting adjustment factor. Channel and the Channel adaptive allocation of embedding capacity , , To obtain the embedding capacity allocation results for each channel;

[0133] Information embedding module 400, used for embedding information according to Y channel, aisle, The information embedding operation is performed on each channel in sequence according to the channel order. The information embedding operation includes: selecting one or more zero-value DCT coefficients in the current channel to be embedded to form a carrier sequence according to the embedding capacity allocation result, and embedding the watermark to be hidden into the carrier sequence through STC encoding to generate a JPEG image with hidden watermark.

[0134] The color JPEG reversible watermarking hiding system based on adaptive STC in this application embodiment can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, mobile electronic devices can be mobile phones, tablets, laptops, PDAs, in-vehicle electronic devices, wearable devices, ultra-mobile personal computers (UMPCs), netbooks, or personal digital assistants (PDAs), etc., while non-mobile electronic devices can be servers, network attached storage (NAS), personal computers (PCs), etc. This application embodiment does not specifically limit the specific implementation.

[0135] The color JPEG reversible watermark hiding system based on adaptive STC in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit it.

[0136] This application provides a color JPEG reversible watermark hiding system based on adaptive STC, which can achieve... Figure 1 The various processes implemented in the method embodiment of the color JPEG reversible watermark hiding method based on adaptive STC will not be described again here to avoid repetition.

[0137] Optionally, embodiments of this application also provide an electronic device, including a processor, a memory, and a program or instructions stored in the memory and executable on the processor. When the program or instructions are executed by the processor, they implement the various processes of the above-described embodiment of a color JPEG reversible watermark hiding method based on adaptive STC, and can achieve the same technical effect. To avoid repetition, they will not be described again here.

[0138] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described embodiment of a color JPEG reversible watermark hiding method based on adaptive STC, and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0139] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0140] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0141] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0142] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A method for reversible watermark hiding in color JPEG based on adaptive STC, characterized in that, Includes the following steps: Acquire a color JPEG image, decode the color JPEG image, and convert it to Y. Color space, to extract the Y channel, Channels and Quantization Discrete Cosine Transform (DCT) coefficients of the channel; According to the Y channel, the Channel and the The statistical properties of the DCT coefficients of the channel are used to calculate the Y channel, the... Channel and the The texture complexity and zero coefficient density of each DCT sub-block in the channel are used to generate the embedding adaptation weights for each channel; Based on the embedded adaptive weights and the preset channel weighting adjustment factor, the Y channel, the... Channel and the Channel adaptive allocation of embedding capacity , , To obtain the embedding capacity allocation results for each channel; According to the Y channel, aisle, The information embedding operation is performed on each channel in sequence according to the channel order. The information embedding operation includes: selecting one or more zero-value DCT coefficients in the current channel to be embedded to form a carrier sequence according to the embedding capacity allocation result, and embedding the watermark to be hidden into the carrier sequence through STC encoding to generate a JPEG image with hidden watermark.

2. The method according to claim 1, characterized in that, Calculate the Y channel, the Channel and the Before the step of determining the texture complexity and zero-coefficient density of each DCT sub-block in a channel to generate the embedding fitness weights for each channel, a channel characteristic analysis step is also included, specifically including: Calculate the Y channel, the Channel and the In the channel, the density of the proportion of zero-value AC coefficients among all AC coefficients, and the amplitude distribution of non-zero AC coefficients; By combining a human visual model, and through quantizing the step size, the probability of a zero coefficient, and the frequency sensitivity weight of the frequency band position, the Y channel and the... Channel and the The visual sensitivity differences of the channels are used to determine the channel weighting adjustment factor and the frequency sensitivity weight.

3. The method according to claim 1, characterized in that, For the Y channel, the Channel and the Channel adaptive allocation of embedding capacity , , The steps specifically include: The total capacity EC for hiding the watermark is calculated using the following formula to determine the embedding capacity allocated to channel c: ; Where c is the channel index. ; The embedding capacity allocated to channel c; The weighted adjustment factor for channel c; For the embedding adaptation weights of channel c; , , Y, respectively , Adaptive weights of the channel; The embedding adaptation weight of channel c is calculated by the following formula: ; in, The texture complexity of the i-th DCT block is calculated from the differential energy of the AC coefficients within the block. This represents the zero coefficient density within the i-th DCT block.

4. The method according to claim 1, characterized in that, The step of selecting one or more zero-value DCT coefficients within the current channel to be embedded to form a vector sequence specifically includes: The coefficient priority metric for each DCT coefficient in the current channel to be embedded is calculated using the following formula: ; in, This represents the priority metric value of the position coefficient of the j-th frequency band in the i-th DCT block; This indicates the corresponding quantization step size; This indicates the probability that the coefficient is zero; This represents the frequency sensitivity weight at the j-th frequency band position; All AC coefficients in the current channel to be embedded are measured according to their coefficient priority values. Sort in ascending order and select the top few items in the sorted order. A set of coefficients is formed to constitute a candidate set to be modified, and the candidate set to be modified satisfies the embedding capacity requirement of the channel; All zero-value coefficients are selected from the candidate set to be modified to form the carrier sequence.

5. The method according to claim 1 or 4, characterized in that, The step of embedding the watermark to be hidden into the carrier sequence by verifying the STC encoding specifically includes: The cost of modifying each zero-value coefficient in the vector sequence is calculated using the following formula: ; in, This indicates the cost of modifying the frequency band position coefficient; This indicates the corresponding quantization step size; This represents the absolute value of the coefficients within the current block, and the summation term in the denominator is a measure of the local texture masking effect; Combining the modification cost and the watermark to be hidden, a coefficient modification sequence with values ​​{0, 1, -1} is generated by STC encoding, and the coefficient modification sequence is superimposed on the carrier sequence to achieve information embedding with minimal total embedding distortion.

6. The method according to claim 4, characterized in that, Before the step of embedding the watermark to be hidden into the carrier sequence by verifying the STC encoding, the method further includes: For all non-zero coefficients in the candidate set to be modified, perform a reversible shift operation according to the following formula to reserve embedding space for the STC embedding of the zero-value coefficients: ; in, These are the original non-zero coefficients. The coefficients are obtained after performing a reversible shift operation.

7. The method according to claim 6, characterized in that, The method also includes data extraction and image restoration steps, specifically including: Read the pre-stored Y channel from the header of the encrypted JPEG image. Channels and Channel embedding capacity , , ; According to the Y channel, Channels and The data extraction and coefficient recovery operations are performed sequentially on each channel, including: Reconstruct the same extraction candidate set as the embedding stage; For the sequence of data carrier coefficients extracted from the candidate set, the STC decoding mechanism is invoked to recover the hidden watermark in the channel according to the following formula: ; in, To recover the hidden watermark, This is the parity check matrix of STC. This is a sequence of density coefficients in the candidate set; After data extraction is complete, an inverse mapping operation is performed on the coefficients in the candidate extraction set according to the following formula to recover the original DCT coefficients: ; in, These are the restored original coefficients. The coefficients are for the image with high density.

8. A color JPEG reversible watermark hiding system based on adaptive STC, characterized in that, include: The image preprocessing module is used to acquire a color JPEG image, decode the color JPEG image, and convert it to Y... Color space, to extract the Y channel, Channels and Quantization Discrete Cosine Transform (DCT) coefficients of the channel; An embedded adaptive weight generation module is used to generate weights based on the Y channel and the... Channel and the The statistical properties of the DCT coefficients of the channel are used to calculate the Y channel, the... Channel and the The texture complexity and zero coefficient density of each DCT sub-block in the channel are used to generate the embedding adaptation weights for each channel; An embedded capacity allocation module is used to allocate capacity to the Y channel and the [other channels] based on the embedded adaptive weights and a preset channel weighting adjustment factor. Channel and the Channel adaptive allocation of embedding capacity , , To obtain the embedding capacity allocation results for each channel; Information embedding module, used according to Y channel, aisle, The information embedding operation is performed on each channel in sequence according to the channel order. The information embedding operation includes: selecting one or more zero-value DCT coefficients in the current channel to be embedded to form a carrier sequence according to the embedding capacity allocation result, and embedding the watermark to be hidden into the carrier sequence through STC encoding to generate a JPEG image with hidden watermark.

9. An electronic device, characterized in that, The method includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor. When the program or instructions are executed by the processor, they implement the steps of a color JPEG reversible watermark hiding method based on adaptive STC as described in any one of claims 1-7.

10. A readable storage medium, characterized in that, The program or instructions are stored on the readable storage medium, and when the program or instructions are executed by the processor, they implement the steps of the color JPEG reversible watermark hiding method based on adaptive STC as described in any one of claims 1-7.