Image watermark embedding performance optimization method based on search tree
By constructing a search tree to optimize the parameters of the image watermarking algorithm, the problems of parameter sensitivity and low efficiency of traditional parameter tuning are solved, achieving efficient image watermark embedding performance optimization and improving robustness and transparency.
Patent Information
- Application Number
- CN202511519948.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-23
- Publication Date
- 2026-01-16
AI Technical Summary
Existing image watermarking algorithms suffer from parameter sensitivity issues, leading to insufficient embedding rates, excessive distortion, or decreased robustness. Traditional manual parameter tuning is inefficient, and regression models suffer from suboptimal parameters and poor generalization.
A search tree-based approach is adopted to systematically explore the parameter space of the image watermarking embedding model. The parameters are optimized by constructing a search tree and using strategies such as depth-first search, breadth-first search, and random selection, combined with incremental adjustment, gradient-guided search, and heuristic search, to optimize metrics such as PSNR, SSIM, and embedding capacity.
It improves the overall performance of image watermark embedding, avoids local optima, enhances search efficiency and accuracy, is highly adaptable, can find the best balance across multiple performance metrics, and improves robustness and transparency.
Smart Images

Figure CN121353049A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to image security technology, specifically to a method for optimizing the performance of image watermark embedding based on a search tree. Background Technology
[0002] In the field of digital media security and copyright protection, image watermarking embedding technology has been widely researched and applied in key areas such as digital communication, military, medical, and cloud services. Its core idea is to hide additional information within multimedia data without compromising its usability, while ensuring the visual quality of the image.
[0003] Existing image watermarking algorithms typically rely on a set of adjustable parameters. The choice of different parameters will directly affect the algorithm's embedding rate, PSNR, SSIM and other indicators.
[0004] 1. Spatial embedding algorithms: such as the LSB insertion algorithm, which directly modifies the least significant bit of the pixel in the spatial domain, and whose performance is affected by the choice of the embedding position. Alternatively, there are algorithms based on prediction error spreading (PVO), whose performance is affected by the spreading threshold.
[0005] 2. Frequency domain embedding algorithms: such as DCT domain embedding algorithms, whose performance is affected by the embedding strength factor and the selected frequency domain block position, or DWT domain embedding algorithms, whose performance is affected by parameters such as the number of decomposition layers, embedding subbands, and embedding strength.
[0006] 3. Deep learning-based embedding algorithms: performance is affected by parameters such as network structure, number of channels, embedding strength, and convolution kernel size.
[0007] In addition, there are reversible watermarking embedding algorithms, which typically have a threshold to determine the embedding capacity. Blind watermarking algorithms are also affected by the detection threshold, while non-blind watermarking algorithms are affected by the correlation coefficient of the original image. It can be seen that image watermarking algorithms generally suffer from parameter sensitivity: unreasonable parameter settings can lead to insufficient embedding rate, excessive distortion, or decreased robustness. Therefore, efficiently searching for and optimizing parameter combinations to avoid the inefficiency and performance bottlenecks of traditional manual parameter tuning is a crucial technique for improving the practicality of image watermarking technology.
[0008] Previous studies have attempted to establish multivariate regression models to determine the relationship between the watermark embedding parameter set and image texture complexity, thereby optimizing the parameters. However, this method suffers from some drawbacks inherent in regression models themselves.
[0009] For example, Chinese patent application CN111062853A discloses a texture-based adaptive image watermark embedding method and system, as well as an extraction method and system. The adaptive image watermark embedding method includes: establishing a functional relationship between watermark embedding parameters and global and local texture values of a textured region through multivariate regression analysis; and adaptively adjusting the watermark embedding parameters according to the texture values of the region to maximize the invisibility of the watermark and enhance its robustness. However, establishing a regression model first requires a training set. Ensuring that the parameter set of the training set is optimal may require manual debugging, and to ensure high generalization, a large amount of time needs to be spent manually debugging a large number of images. Furthermore, the regression model itself has certain errors, and the calculated parameters may not be optimal.
[0010] For example, Chinese patent application CN109300078B discloses a spread spectrum watermarking embedding method with adaptive embedding strength. This method involves designing a spread spectrum watermark capable of completely shielding host signal interference using prior knowledge of host signal interference, and then adaptively adjusting the embedding strength value in the spread spectrum watermark according to different carrier images. This maximizes the robustness of the watermark while ensuring the invisibility of each image. However, this patent primarily applies to frequency domain watermarking embedding, aiming to improve the robustness of watermark embedding. Summary of the Invention
[0011] Purpose of the invention: The purpose of this invention is to address the shortcomings of existing technologies and provide a search tree-based method for optimizing image watermark embedding performance. Through systematic parameter search and optimization, this method improves the performance of the image watermark embedding model and achieves comprehensive optimization of watermark embedding performance indicators (such as peak signal-to-noise ratio, structural similarity, embedding capacity, etc.).
[0012] Technical solution: The present invention provides a method for optimizing the performance of image watermark embedding based on a search tree, comprising the following steps:
[0013] Step 1: First, determine the parameters to be optimized in all image watermarking embedding models, form a parameter set P, and determine the preset value range of each parameter in parameter set P; then, determine several image watermarking embedding performance indicators to be optimized, including PSNR, SSIM, and embedding capacity, etc.
[0014] Step 2: Set the data structure of the nodes in the search tree. The data structure of any node in the search tree includes a parameter vector V and image watermark embedding performance information calculated based on the parameter vector V of that node.
[0015] The parameter vector V refers to the parameter set P being arranged in a preset order, with specific values selected for each parameter, thereby instantiating the parameter set P into a parameter vector V; the content of the image watermark embedding performance information and the image watermark embedding performance index to be optimized determined in step 1 maintain a one-to-one correspondence.
[0016] Step 3: Construct the root node of the search tree; First, set the initial values of all parameters in the parameter set P to form an initial parameter vector, and calculate the initial watermark embedding performance based on the initial parameter vector, thereby constructing the root node of the search tree; The initial values of the parameters are obtained by random selection, empirical setting, or using the default configuration.
[0017] Step 4: For all leaf nodes of the current search tree, select one leaf node and modify each element of the parameter vector V stored in that leaf node one by one. Each modification generates a new parameter vector, which is denoted as V1, V2, V3, ... V i , i=1,2,3,...; the selection methods for the leaf nodes include, but are not limited to, depth-first search, breadth-first search, random selection, etc.; the methods for changing the elements of the parameter vector include, but are not limited to, incremental adjustment, gradient-guided adjustment, heuristic search adjustment, etc.
[0018] Subsequently, for each parameter vector V i The image watermark embedding performance based on the vector is calculated sequentially, and the obtained performance is compared with the image watermark embedding performance calculated by the parameter vector V stored in the currently selected leaf node to determine the new vector V. i Which of the two, the original parameter vector V and the parameter vector V, is the optimal parameter vector? The method for determining the optimal parameter vector includes, but is not limited to, the single index comparison method, the weighted comprehensive evaluation method, the Pareto optimal comparison method, etc. Finally, the following operations are performed based on the determination result.
[0019] Scenario 1: If parameter vector V is the optimal parameter vector, or if at least one parameter in parameter vector V changes beyond its preset value range in step 1, or based on parameter vector V and the new vector V... i If the watermark embedding performance is the same, then the current leaf node remains unchanged and no child node generation operation is performed;
[0020] Case 2: If the parameter vector V i It is the optimal parameter vector, and there are currently no nodes in the search tree storing the parameter vector V. iIf the corresponding watermark embedding performance metrics are not met, a new child node is created under the current leaf node. The data structure of the child node follows the data structure of the search tree node specified in step 2, including the modified parameter vector V. i and based on parameter vector V i Image watermark embedding performance information;
[0021] Case 3: If the parameter vector V i It is the optimal parameter vector, but a node in the search tree already stores the parameter vector V. i If the corresponding watermark embedding performance metrics are not considered, the current leaf node will remain unchanged, and no child node generation operation will be performed.
[0022] Step 5: After performing Step 4 on all leaf nodes in the search tree in sequence, if no leaf node enters Case 2 and generates its corresponding child node, then the search tree is determined to be constructed.
[0023] Step 6: For all leaf nodes of the constructed search tree, sequentially obtain the parameter vector V stored in each leaf node and the corresponding image watermark embedding performance, and determine the optimal parameter vector again to select the parameter vector V' with the best performance; the method for determining the optimal parameter vector in this step must be consistent with the method used in step 4.
[0024] Furthermore, the specific method of step 1 is as follows:
[0025] Step 1.1: Determine the image watermark embedding model, which includes at least one image watermark embedding algorithm. Once the image watermark embedding model is determined, the algorithm contained within it must not be changed throughout the entire implementation process.
[0026] Step 1.2: Collect all the parameters to be optimized involved in each algorithm of the image watermarking embedding model to form a parameter set P; the elements in the parameter set P are variable values, symbols, objects or any combination thereof. The elements can exist independently of each other or be related to each other according to predefined relational rules. The parameter set P is an inherent property of the image watermarking embedding model. The parameter sets P of different models are independent of each other. The number of elements contained in the parameter set P is finite. After the composition of the parameter set P is determined, it is not allowed to add or delete elements in the set P. The value of each element in the parameter set P should be allowed to be set so that it can be instantiated into a parameter vector V in subsequent steps.
[0027] If the parameter set P is empty, the determined model cannot be optimized. In order to ensure the effectiveness of parameter modification, the modifiable value range of each parameter should be set in advance before the start of the step to avoid the parameter being modified beyond the allowed range.
[0028] Step 1.3: Predetermine at least one image watermark embedding performance index for evaluation. The performance index serves as the evaluation criterion for the subsequent parameter optimization process and is used to determine the merits of different parameter vectors V in image watermark embedding.
[0029] Furthermore, the specific details of the performance indicators are as follows:
[0030] Peak signal-to-noise ratio (PSNR) is used to characterize the degree of distortion in an image after watermark embedding; assuming an image has a height of... , width is The original image is a two-dimensional matrix. The image after embedding the watermark is a two-dimensional matrix. The image is a grayscale image with a maximum grayscale value of The formula for calculating the peak signal-to-noise ratio (PSNR) is:
[0031] ;
[0032] ;
[0033] Structural similarity (SSIM) is used to characterize the structural similarity between the embedded image and the original image; for calculating the structural similarity of local image regions, it is necessary to extract the original image. a local area And map it to the same area of the image after the watermark is embedded, denoted as . For the region The average value of the pixels in For the region The average value of the pixels in For the region The variance of pixel values in For the region The variance of pixel values in For the region and region The covariance of pixel values. and To ensure stable constant coefficients and avoid denominators of 0, the calculation method is as follows:
[0034] ;
[0035] Embedding capacity is used to characterize the amount of watermark information that can be embedded under this parameter configuration; the image watermark embedding performance index should be clearly set before the method is implemented, and its meaning and algorithm should remain unchanged throughout the parameter optimization process, and should not be arbitrarily changed or added to.
[0036] Furthermore, in step 2, when setting the data structure of a node, the specific parameter configuration of the watermark embedding model used on that node is explicitly recorded through the parameter vector V; the image watermark embedding performance information is calculated in the image watermark embedding model based on the corresponding parameter vector V stored in the node.
[0037] Here, the parameter vector V refers to the arrangement of parameters in set P according to a preset, fixed order (e.g., [quantization step size, embedding strength, frequency index...]), and then assigning a specific value within its range to each parameter, thus forming a complete and executable parameter configuration scheme, i.e., parameter vector V = (v1, v2, ..., v n This vector uniquely defines the parameter settings used when embedding a watermark at this node. Image watermark embedding performance information records the specific values of various performance metrics calculated when watermark embedding is performed using the parameter vector V of this node. For example, if the determined performance metrics are PSNR and embedding capacity, then this information is a tuple (PSNR value, capacity value). This performance information is the direct basis for subsequent judgment of the merits of different nodes.
[0038] Furthermore, after obtaining the initial parameter vector in step 3, the initial parameter vector is input into the image watermark embedding model to calculate the corresponding initial image watermark embedding performance index. Then, based on the initial parameter vector and the corresponding image watermark embedding performance index, the root node of the tree is constructed.
[0039] Furthermore, the specific method of step 4 is as follows:
[0040] In the current search tree, identify all leaf nodes and select one leaf node as the node to be processed. The selection of the leaf node can be based on depth-first search (DFS), breadth-first search (BFS), random selection, or other alternative selection strategies. Assume that the length of the parameter set P is N and the length of the parameter vector V is also N.
[0041] Obtain the parameter vector V=[v1,v2,...,v] stored in the leaf node. N ], sequentially for each element v in the vector i The parameters are modified as follows: i = 1, 2, 3, ..., N; the modification methods include incremental adjustment: within the preset parameter allowable range, one or more parameter values in the parameter vector V are increased or decreased according to a set step size; gradient-guided adjustment: when the performance index has differentiable characteristics, the parameters are adjusted according to the gradient direction of the performance index; heuristic search adjustment: based on historical search results or heuristic rules (such as prioritizing the change of parameters with greater influence), some parameters are selectively modified.
[0042] Each pair of parameter vectors V is modified once for each individual element, thus generating a new parameter vector; these new vectors are denoted sequentially as V1, V2, V3, ..., V N For each new parameter vector V i Perform the image watermark embedding operation and calculate the image watermark embedding performance metrics to be optimized, such as PSNR, SSIM, and embedding capacity, as determined in step 1.
[0043] For each V i It determines whether the current leaf node or the parameter vector V stored in the selected leaf node is better; then, based on the actual situation, it selects three corresponding operation scenarios to further optimize the search process or continue to build child nodes.
[0044] In the process of optimizing image watermark embedding parameters, when evaluating based on a single image watermark embedding performance index, the parameter vector that maximizes the performance of that single image watermark embedding index is selected as the optimal parameter vector; when evaluating based on multiple image watermark embedding performance indices, the parameter vector that maximizes the performance of all image watermark embedding indices is selected as the optimal parameter vector.
[0045] The core advantages of this invention are reflected in three aspects: First, by systematically exploring the high-dimensional parameter space through a tree structure, it can effectively avoid getting trapped in local optima, and has higher search efficiency and accuracy compared with traditional grid search and regression model building methods; Second, it supports multiple node selection strategies, parameter change methods, and performance comparison methods, which can be flexibly configured according to specific watermark embedding models and performance requirements, demonstrating strong adaptability; Finally, through multi-objective optimization methods such as weighted comprehensive evaluation and Pareto optimality, it can properly handle the trade-off relationship between multiple competing performance indicators and find the optimal balance point.
[0046] Beneficial effects: By systematically constructing and traversing a search tree, this invention intelligently explores the parameter space of the watermark embedding model, effectively finding parameter configurations that perform well on multiple performance indicators. It also solves the shortcomings of using regression models in existing patents, and the calculated optimal parameters can have higher accuracy than regression models, thus enabling image watermark embedding to have higher performance.
[0047] Compared with the prior art, the present invention has the following advantages:
[0048] (1) This invention can be applied to any type of watermark embedding algorithm, such as spatial domain and frequency domain types. For example, for spatial domain watermark embedding algorithms based on prediction error expansion, the parameters typically include block size, sorting rules, and embedding threshold. These parameters directly affect performance indicators such as embedding capacity and signal-to-noise ratio (PSNR). All of the above parameters can be used as a parameter set P, and the parameters can be optimized using the search tree method. As another example, for frequency domain watermark embedding methods based on DCT, DWT, DFT, etc., the parameters generally include frequency band selection, embedding strength, embedding position, etc. All of the above parameters can also be used as a parameter set P, and the parameters can be optimized using the search tree method.
[0049] Existing technical solutions often involve adaptive parameter tuning methods for specific types of watermark embedding algorithms. For example, patent CN109300078B only optimizes frequency domain watermark embedding algorithms, resulting in weak generalization. This invention, however, offers greater application flexibility.
[0050] (2) This invention does not rely on any prior knowledge. It only requires the implementation to provide a parameter set P, and the amount of change of each parameter after the creation of a new node can be set. Then, the performance optimization method of this invention can be attempted. Compared with existing methods that require the implementer to have prior knowledge, this is more convenient. For example, patent CN111062853A requires the implementer to have a training set to build a regression model, and it is not easy to build a high-quality training set for image watermark embedding performance under optimal parameters.
[0051] (3) This invention uses a search tree to search for optimal parameters. The search process is highly flexible and has a wide range of expansion options, which can be controlled by the specific implementation algorithm. For example, in step 4, if no better parameter vector is found, the parameters are changed X times to form X new nodes. If the new parameters on these X nodes still cannot improve the image watermark embedding performance, the parameter search is stopped. If a new parameter can improve the performance, the search continues according to step 4 based on this parameter. This design increases the time complexity to a certain extent, but it provides redundancy even if the search fails. This example also fully demonstrates the scalability of the method in this invention.
[0052] (4) This invention can optimize the parameters in the image watermark embedding algorithm. The final selected parameter set can achieve better performance in terms of embedding rate, PSNR, SSIM, etc., so that the watermark achieves a balance between robustness and transparency. The obtained optimal parameter set can effectively improve the watermark's resistance to various attacks (compression, noise, cropping, etc.). In practical applications, users can easily obtain watermark parameter configurations with better performance, reducing the difficulty of manual parameter tuning. Attached Figure Description
[0053] Figure 1 This is an overall flowchart of the present invention;
[0054] Figure 2 This is a flowchart of the image watermark embedding performance optimization method based on search tree according to the present invention;
[0055] Figure 3 This is a schematic diagram illustrating the depth-first spanning tree construction process in an embodiment.
[0056] Figure 4 The image shows the test results of an example. Detailed Implementation
[0057] The technical solution of the present invention will be described in detail below, but the scope of protection of the present invention is not limited to the embodiments described.
[0058] like Figure 1 As shown, the present invention provides a method for optimizing image watermark embedding performance based on a search tree, characterized by comprising the following steps:
[0059] Step 1: First, determine the parameters to be optimized in all image watermarking embedding models, form a parameter set P, and determine the preset value range of each parameter in parameter set P; then, determine several image watermarking embedding performance indicators to be optimized, including PSNR, SSIM, and embedding capacity.
[0060] Step 2: Set the data structure of the nodes in the search tree. The data structure of any node in the search tree includes a parameter vector V and image watermark embedding performance information calculated based on the parameter vector V of that node.
[0061] The parameter vector V refers to the parameter set P being arranged in a preset order, with specific values selected for each parameter, thereby instantiating the parameter set P into a parameter vector V; the image watermark embedding performance information corresponds one-to-one with the image watermark embedding performance indicators to be optimized.
[0062] Step 3: Construct the root node of the search tree; First, set the initial values of all parameters in the parameter set P to form an initial parameter vector, and calculate the initial watermark embedding performance based on the initial parameter vector, thereby constructing the root node of the search tree;
[0063] Step 4: For all leaf nodes of the current search tree, select one leaf node and modify each element of the parameter vector V stored in that leaf node one by one. Each modification generates a new parameter vector, which is denoted as V1, V2, V3, ... V i , i=1,2,3,...N;
[0064] Subsequently, for each parameter vector V i The image watermark embedding performance based on the vector is calculated sequentially, and the obtained performance is compared with the image watermark embedding performance calculated by the parameter vector V stored in the currently selected leaf node to determine the new vector V. i Which of the two, the original parameter vector V and the corresponding parameter vector V, is the optimal parameter vector? Finally, based on the determination result, the following three types of operations are performed.
[0065] Scenario 1: If parameter vector V is the optimal parameter vector, or if at least one parameter in parameter vector V changes beyond its preset value range in step 1, or based on parameter vector V and the new vector V... i If the watermark embedding performance is the same, then the current leaf node remains unchanged and no child node generation operation is performed;
[0066] Case 2: If the parameter vector V i It is the optimal parameter vector, and there are currently no nodes in the search tree storing the parameter vector V. i If the corresponding watermark embedding performance metrics are not met, a new child node is created under the current leaf node. The data structure of the child node follows the data structure of the search tree node obtained in step 2, including the modified parameter vector V. i and based on parameter vector V i Image watermark embedding performance information;
[0067] Case 3: If the parameter vector V i It is the optimal parameter vector, but a node in the search tree already stores the parameter vector V. i If the corresponding watermark embedding performance metrics are not considered, the current leaf node will remain unchanged, and no child node generation operation will be performed.
[0068] Step 5: After performing Step 4 on all leaf nodes in the search tree in sequence, if no leaf node enters Case 2 and generates its corresponding child node, then the search tree is determined to be constructed.
[0069] Step 6: For all leaf nodes of the constructed search tree, obtain the parameter vector V and the corresponding image watermark embedding performance stored in each leaf node in turn, and determine the optimal parameter vector again to select the parameter vector V' with the best performance.
[0070] The specific method of step 1 in the above embodiment is as follows:
[0071] Step 1.1: Determine the image watermark embedding model, which includes at least one image watermark embedding algorithm. Once the image watermark embedding model is determined, the algorithm contained within it must not be changed throughout the entire implementation process.
[0072] Step 1.2: Collect all the parameters to be optimized involved in each algorithm of the image watermarking embedding model to form a parameter set P; the elements in the parameter set P are variable values, symbols, objects or any combination thereof. The elements can exist independently of each other or be related to each other according to predefined relational rules. The parameter set P is an inherent property of the image watermarking embedding model. The parameter sets P of different models are independent of each other. The number of elements contained in the parameter set P is finite. After the composition of the parameter set P is determined, it is not allowed to add or delete elements in the set P. The value of each element in the parameter set P should be allowed to be set so that it can be instantiated into a parameter vector V in subsequent steps.
[0073] If the parameter set P is empty, the determined model cannot be optimized. In order to ensure the effectiveness of parameter modification, the modifiable value range of each parameter should be set in advance before the start of the step to avoid the parameter being modified beyond the allowed range.
[0074] Step 1.3: Predetermine at least one image watermark embedding performance index for evaluation. The performance index serves as the evaluation criterion for the subsequent parameter optimization process and is used to determine the merits of different parameter vectors V in image watermark embedding.
[0075] In step 2 of this embodiment, when setting the data structure of a node, the specific parameter configuration of the watermark embedding model used on that node is clearly recorded through the parameter vector V; the image watermark embedding performance information is calculated in the image watermark embedding model based on the corresponding parameter vector V stored in the node.
[0076] Here, the parameter vector V refers to the arrangement of parameters in set P according to a preset, fixed order (e.g., [quantization step size, embedding strength, frequency index...]), and then assigning a specific value within its range to each parameter, thus forming a complete and executable parameter configuration scheme, i.e., parameter vector V = (v1, v2, ..., v n This vector uniquely defines the parameter settings used when embedding a watermark at this node. Image watermark embedding performance information records the specific values of various performance metrics calculated when watermark embedding is performed using the parameter vector V of this node. For example, if the determined performance metrics are PSNR and embedding capacity, then this information is a tuple (PSNR value, capacity value). This performance information is the direct basis for subsequent judgment of the merits of different nodes.
[0077] After obtaining the initial parameter vector in step 3 of the above embodiment, the initial parameter vector is input into the image watermark embedding model to calculate the corresponding initial image watermark embedding performance index. Then, based on the initial parameter vector and the corresponding image watermark embedding performance index, the root node of the tree is constructed. The construction of the search tree requires a starting point, namely the root node. The process of constructing the root node is as follows:
[0078] First, an initial parameter vector V0 needs to be generated. To do this, an initial value needs to be assigned to each parameter in the parameter set P. There are several strategies for selecting this initial value: (1) Default configuration: Use the default parameters recommended by the model designer; (2) Experience setting: Select a set of parameters that are considered to perform well based on domain knowledge or previous experiments; (3) Random generation: Randomly select a value within the range of values for each parameter.
[0079] Then, using this initial parameter vector V0, the image watermark embedding model determined in step 1 is run to perform the complete watermark embedding and extraction (if applicable) process, and all performance index values defined in step 1 are calculated. Finally, the initial parameter vector V0 and the calculated initial performance information are packaged together, and the root node of the search tree is created according to the node data structure defined in step 2. This root node serves as the initial state of the search tree and is also the ancestor node of all subsequent expansion operations.
[0080] In step 4 of this embodiment, all leaf nodes are identified in the current search tree, and one leaf node is selected as the node to be processed. The selection of the leaf node can be based on depth-first search (DFS), breadth-first search (BFS), random selection, or other alternative selection strategies. Depth-first search (DFS) prioritizes the most recently created node for in-depth exploration, which helps to quickly explore a certain region of the parameter space. Breadth-first search (BFS) prioritizes nodes at the same level for processing, which helps to explore the entire space evenly and avoid premature exploration of local regions. Random selection randomly selects a leaf node to increase the randomness of the exploration. Performance-based selection prioritizes the node with the best current performance for expansion, similar to best-first search.
[0081] Assume that the length of the parameter set P is N, and the length of the parameter vector V is also N;
[0082] Obtain the parameter vector V=[v1,v2,...,v] stored in the leaf node. N ], sequentially for each element v in the vector iThe parameters are modified, i=1,2,3,...,N; the modification methods include: incremental adjustment: within the preset parameter allowable range, one or more parameter values in the parameter vector V are increased or decreased according to a set step size; gradient-guided adjustment: when the performance index has differentiable characteristics, the parameters are adjusted according to the gradient direction of the performance index; heuristic search adjustment: based on historical search results or heuristic rules (such as prioritizing the change of parameters with greater influence), some parameters are selectively modified.
[0083] Incremental adjustment refers to increasing or decreasing a numerical parameter by a fixed step size δ, for example, V1 = [v1+δ, v2, ..., v n V2 = [v1, v2+δ, ..., v] n ].
[0084] Gradient-guided tuning refers to the process of calculating the gradient of a performance metric with respect to a parameter if the performance metric is differentiable with respect to that parameter (which may be applicable in some neural network-based models), and then making small adjustments along the gradient direction in the hope of improving performance.
[0085] Heuristic search tuning refers to prioritizing adjustments to parameters known to have a significant impact on performance, based on historical experience or parameter sensitivity analysis, with a wider range or more frequent adjustments.
[0086] Each pair of parameter vectors V is modified once for each individual element, thus generating a new parameter vector; these new vectors are denoted sequentially as V1, V2, V3, ..., V N For each new parameter vector V i Perform the image watermark embedding operation and calculate the image watermark embedding performance metrics to be optimized, such as PSNR, SSIM, and embedding capacity, as determined in step 1.
[0087] For each V i It determines whether the current leaf node or the parameter vector V stored in the selected leaf node is better; then, based on the actual situation, it selects three corresponding operation scenarios to further optimize the search process or continue to build child nodes.
[0088] In the process of optimizing image watermarking embedding parameters, when evaluating based on a single image watermarking embedding performance index, the parameter vector that maximizes that single index is selected as the optimal parameter vector. When evaluating based on multiple indexes, the parameter vector that maximizes all indexes is selected as the optimal vector. Methods for determining the optimal parameter vector include single-index comparison, weighted comprehensive evaluation, and Pareto optimality comparison. Single-index comparison: using only one specific performance index as the evaluation standard.
[0089] For example, in optimizing image watermark embedding parameters, assuming there are a series of parameter vectors to be compared and their corresponding image watermark embedding performance, and only the embedding capacity is used as the evaluation criterion, the parameter vector that maximizes the embedding capacity is selected as the optimal parameter vector. A weighted comprehensive comparison method is used, and for multiple performance indicators, a comprehensive score can be calculated based on preset weights to determine the overall performance. For example, in image watermark embedding, the embedding rate can also be considered. Signal-to-noise ratio (PSNR) SSIM and structural similarity Assign weights respectively , , Calculate the overall performance score ; .
[0090] For example, in image watermark embedding parameter optimization, assuming there is a series of parameter vectors to be compared and their corresponding image watermark embedding performance, then selecting the parameter vectors that enable the watermark embedding performance to be optimized is crucial. The highest parameter vector is the optimal parameter vector. This involves calculating... The formula is: The Pareto optimal comparison method is used to simultaneously consider the optimal solution space of multiple performance indicators.
[0091] For example, in the optimization of image watermark embedding parameters, assuming there is a series of parameter vectors to be compared and their corresponding image watermark embedding performance, and if it is necessary to pursue high embedding capacity, high PSNR and high SSIM at the same time, then the parameter vector that makes the embedding capacity the highest, the PSNR the highest and the SSIM the highest is selected as the optimal parameter vector.
[0092] To further verify the technical effectiveness of this invention, this embodiment uses a reversible information hiding algorithm for encrypted images based on implicit heterogeneous joint coding as the image watermark embedding model to be optimized. This model includes the following optimizable parameters, forming a parameter set P = {block width, block height, critical length}.
[0093] The value ranges for each parameter are set as follows, assuming the image width is W and the height is H:
[0094] (1) BlockWidth: The value range is [2, W] (unit: pixels);
[0095] (2) BlockHeight: The value range is [2, H] (unit: pixels);
[0096] (3) L_th: The value range is [3, W*H] (unit: pixels);
[0097] The defined performance metric is embedding capacity: which measures the number of bits (bpp) that can be embedded per pixel.
[0098] The detailed method for step 2 in this embodiment is as follows:
[0099] The data structure for the search tree nodes is defined as shown in the following Python code:
[0100] class TreeNode:
[0101] def __init__(self, parameter_vector, performance):
[0102] self.V = parameter_vector # Parameter vector, such as [8, 4, 'MED']
[0103] self.Perf = performance # Performance metric, such as [38.5, 3.2, 0.98]
[0104] self.children = [] # List of child nodes
[0105] The detailed method for step 3 in this embodiment is as follows:
[0106] The initial parameter vector V0 = (2, 2, 3) is generated using an empirical setting method.
[0107] Using this parameter vector to run the watermark embedding model, the initial performance was calculated on the standard test image Lena: the embedding capacity equals 837834 bits.
[0108] The detailed method for step 4 in this embodiment is as follows:
[0109] (1) Selection strategy and change method: The leaf node selection strategy is breadth-first search (BFS).
[0110] (2) Parameter change method: Incremental adjustment, all parameters are increased by 1 each time.
[0111] (3) Method for judging the merits: Since there is only one indicator to be optimized, the single indicator judgment method can be selected.
[0112] The following is the process of building a search tree:
[0113] The first iteration (processing the root node [2,2,3]) has an embedding capacity of 837317 bits.
[0114] Generate candidate parameter vector:
[0115] V1 = [3, 2, 3] (Increase block_width)
[0116] V2 = [2, 3, 3] (Increase block_height)
[0117] V3 = [2, 2, 4] (Add L_fix)
[0118] Performance calculation and comparison:
[0119] V1: Embedded capacity = 837317 bits (equal to the root node) → Perform step 4.1, do not create a node;
[0120] V2: Embedded capacity = 838795 bits (better than the root node) → Execute step 4.2 to create child nodes;
[0121] V3: compressedLen = 837834 bits (better than the root node) → Execute step 4.2 to create child nodes.
[0122] In the second iteration (the parameter vector V on the selected leaf node is [2,3,3]), the current node performance is: embedding capacity = 838795.
[0123] Generate candidate parameter vector:
[0124] V1 = [3, 3, 3] (Increase block_width);
[0125] V2 = [2, 4, 3] (Increase block_height);
[0126] V3 = [2, 3, 4] (Add L_fix)
[0127] Performance calculation and comparison:
[0128] V1: Embedded capacity = 838795 bits (equal to the current node) → Proceed to step 4.1;
[0129] V2: Embedded capacity = 839688 bits (better than the current node) → Execute step 4.2 to create child nodes;
[0130] V3: Embedded capacity = 841103 bits (better than the current node) → Execute step 4.2 to create child nodes;
[0131] In the third iteration (the parameter vector V on the selected leaf node is [2,2,4]), the current node's performance is: embedding capacity = 837834 bits.
[0132] Generate candidate parameter vector:
[0133] V1 = [3, 2, 4] (Increase block_width)
[0134] V2 = [2, 3, 4] (Increase block_height)
[0135] V3 = [2, 2, 5] (Add L_fix)
[0136] Performance calculation and comparison:
[0137] V1: Embedded capacity = 839444 bits (better than the current node) → Execute step 4.2 to create child nodes.
[0138] V2: There is a parameter vector V = V2 on a node in the search tree, so proceed with step 4.1 and do not create a child node.
[0139] V3: Embedded capacity = 837642 bits (inferior to the current node), therefore step 4.3 is executed, and no child node is created.
[0140] In subsequent iterations, the newly created leaf nodes [3,2,4], etc., continue to be processed in the same way. This continues until the method described in step 5 is satisfied, at which point no more child nodes can be created. Figure 3 As shown, examine a branch of the search tree created from node [2,2,4] in this embodiment. The case where no node is created is omitted from the figure.
[0141] The detailed method for step 6 in this embodiment is as follows:
[0142] Based on the output data, the optimal parameter configuration is determined as follows: Optimal parameter vector: V' = [3, 6, 4], with an optimal performance embedding capacity of 841324. Compared to the root node, the absolute performance improvement is 841324 - 837317 = 4007, and the relative improvement is approximately 0.48%.
[0143] This embodiment applies the above method to the BOSSBase dataset to verify the technical solution of the present invention. The specific effects are shown in Table 1. The improvement in embedding capacity on the entire dataset is as follows: Figure 4As shown.
[0144] Table 1. Percentage improvement in embedding capacity of the present invention on the BOSSBase dataset
[0145] Number of images in the dataset 10000 Maximum embedded capacity increase percentage 160.50% Minimum embedded capacity increase percentage 0.00% Average embedded capacity increase percentage 2.23%
[0146] As shown in Table 1, this invention demonstrates performance optimization capabilities on image datasets. This is because, firstly, for the hidden image reversible information hiding algorithm with implicit heterologous joint coding selected in this embodiment, adjusting the algorithm's parameters can further improve the embedding capacity for images with complex textures. Secondly, this invention enables the finding of a more optimal set of parameter vectors for this type of image. Finally, since different images have different texture complexities, the embedding capacity improvement is very significant for some images (e.g., trees, grass), reaching a maximum improvement of 1.6 times, while some images (e.g., snow, sky) have very low texture complexity, making it difficult to improve the embedding capacity. The performance improvement on the entire dataset is 2.23%, further demonstrating that this invention can improve the performance of existing image watermarking embedding algorithms.
[0147] In summary, this invention effectively solves the problems of low efficiency and easy getting trapped in local optima in traditional watermark embedding parameter optimization by systematically exploring the parameter space and using intelligent search strategies. The parameter optimization process is constructed as a dynamically growing search tree, where each node represents a specific set of parameter configurations and their corresponding performance. Through iterative expansion and evaluation, the global optimal solution is gradually approached.
[0148] This invention focuses on optimizing a reversible information hiding algorithm for encrypted images based on implicit heterologous joint coding. Through systematic optimization of key parameters such as block size, critical length, and pixel prediction method, the embedding capacity and overall performance of the algorithm are significantly improved. Experimental results show that the optimized parameter configuration, while maintaining image quality, increases the embedding capacity by up to 160.50% and improves the overall performance score by 2.23%, fully verifying the effectiveness and practicality of this invention.
Claims
1. A search tree based image watermark embedding performance optimization method, characterized in that, The method comprises the following steps: Step 1, first determine all the parameters to be optimized in the image watermark embedding model, form a parameter set P, and determine the preset value range of each parameter in the parameter set P; then determine several image watermark embedding performance indicators to be optimized, the image watermark embedding performance indicators including PSNR, SSIM and embedding capacity; Step 2, set the data structure of the nodes of the search tree, the data structure of any node in the search tree including a parameter vector V and image watermark embedding performance information calculated based on the parameter vector V on the node; The parameter vector V refers to arranging each parameter in the parameter set P according to a preset order, selecting a specific value for each parameter, and then instantiating the parameter set P into a parameter vector V; the image watermark embedding performance information is one-to-one corresponding to the image watermark embedding performance indicators to be optimized; Step 3, construct the root node of the search tree; first set the initial values of all parameters in the parameter set P to form an initial parameter vector, and calculate the initial watermark embedding performance based on the initial parameter vector, thereby constructing the root node of the search tree; Step 4, for all leaf nodes of the current search tree, select one of the leaf nodes, and change each element of the parameter vector V stored on the leaf node one by one, each change produces a new parameter vector, and the new vectors are sequentially recorded as V1, V2, V3,...V i , i = 1, 2, 3,...N; Subsequently, for each parameter vector V i , the image watermark embedding performance based on the vector is calculated in turn, and the resulting performance is compared with the image watermark embedding performance calculated based on the parameter vector V stored in the currently selected leaf node, to determine which of the two, the new vector V i and the corresponding original parameter vector V, is the optimal parameter vector; finally, according to the determination result, three types of operation scenarios are performed; Case 1, if the parameter vector V is the optimal parameter vector, or at least one parameter in the parameter vector V is changed beyond its preset value range in step 1, or the watermark embedding performance based on the parameter vector V and the new vector V i is the same, the current leaf node is kept unchanged, and no child node generation operation is performed. Case 2, if the parameter vector V i is the optimal parameter vector, and there is no any node in the search tree to store the parameter vector V i and its corresponding watermark embedding performance indicator, a new child node is created under the current leaf node, the data structure of the new child node follows the data structure of the search tree node obtained in step 2, including the changed parameter vector V i and the image watermark embedding performance information based on the parameter vector V i ; Case 3, if the parameter vector V i is the optimal parameter vector, but there already exists a node in the search tree storing the parameter vector V i and its corresponding watermark embedding performance indicator, then keep the current leaf node unchanged and do not perform any child node generation operation; Step 5, after step 4 is sequentially performed on all leaf nodes in the search tree, if none of the leaf nodes enters situation 2 to generate its own corresponding child node, it is determined that the search tree is constructed; Step 6, for all leaf nodes of the constructed search tree, sequentially obtain the parameter vector V stored in each leaf node and the corresponding image watermark embedding performance, and determine the optimal parameter vector again, so as to select the performance-optimal parameter vector V'.
2. The search tree based image watermark embedding performance optimization method of claim 1, wherein, The specific method of step 1 is: Step 1.1, determine the image watermark embedding model, and the preset image watermark embedding model has at least one image watermark embedding algorithm; Step 1.2, collect all the parameters to be optimized involved in each algorithm in the image watermark embedding model to form a parameter set P; the elements in the parameter set P include variable values, symbols, objects and any combination thereof, and after determining the composition of the parameter set P, no addition or deletion operation is allowed on the elements in the parameter set P; If the parameter set P is empty, the image watermark embedding model cannot be optimized, in order to ensure the effectiveness of parameter modification, the modifiable value range of each parameter should be set in advance; Step 1.3, pre-determine at least one image watermark embedding performance indicator for evaluation, which is used as the evaluation criterion in the subsequent parameter optimization process, for determining the advantages and disadvantages of different parameter vectors V in image watermark embedding effect.
3. The search tree based image watermark embedding performance optimization method according to claim 1 or 2, characterized in that, The specific content of the image watermark embedding performance indicator is as follows: The peak signal-to-noise ratio (PSNR) is used to represent the distortion degree of the image after the watermark is embedded; assuming that the height of an image is , the width is , the original image is a two-dimensional matrix , the image after the watermark is embedded is a two-dimensional matrix , the image is a gray image, and the maximum gray value is , the calculation method is as follows: ; ; Structural similarity SSIM is used to represent the structural similarity between the embedded image and the original image; The original image is taken out at the time of calculation a certain local region in the middle and is mapped to the same region of the image with the watermark embedded ; the average value of the pixel values in the region , the average value of the pixel values in the region , the variance of the pixel values in the region , the variance of the pixel values in the region , the covariance of the pixel values in the region and the region ; and is a constant coefficient; the calculation formula of the structural similarity SSIM is: ; Embedding capacity is used to represent the amount of watermark information that can be embedded under the parameter configuration.
4. The search tree based image watermark embedding performance optimization method of claim 1, wherein, When setting the data structure of the node in step 2, the specific parameter configuration of the watermark embedding model used on the node is recorded by the parameter vector V; The image watermark embedding performance information is calculated based on the corresponding parameter vector V stored in the node in the image watermark embedding model.
5. The search tree based image watermark embedding performance optimization method of claim 1, wherein, After the step 3 obtains the initial parameter vector, the initial parameter vector is input into an image watermark embedding model to calculate a corresponding initial image watermark embedding performance index, and then a root node of a tree is constructed based on the initial parameter vector and the corresponding image watermark embedding performance index.
6. The search tree based image watermark embedding performance optimization method of claim 1, wherein, The specific method of the step 4 is as follows: In the current search tree, all leaf nodes are identified first, and one leaf node is selected as a to-be-processed node; assuming that the length of the parameter set P is N, the length of the parameter vector V is also N; then the parameter vector V stored in the leaf node is obtained, V=[v1, v2,..., vN}, and each element v N in the vector is changed in turn, i=1, 2, 3,..., N. i A single element in each pair of parameter vectors V is changed, that is, a new parameter vector is generated, and the new vectors are sequentially recorded as V1, V2, V3,..., V N For each new parameter vector V i An image watermark embedding operation is performed, and an image watermark embedding performance index to be optimized is calculated; For each new parameter vector V i , it is determined which of the two, V or the parameter vector V stored in the currently selected leaf node, is better; then, according to the actual situation, three types of corresponding operation situations are selected to be executed to further optimize the search process or continue to build child nodes; In the image watermark embedding parameter optimization process, when evaluation is performed based on a single image watermark embedding performance index, a parameter vector that makes the single image watermark embedding performance index reach a maximum value is selected as an optimal parameter vector; when evaluation is performed based on multiple image watermark embedding performance indexes, a parameter vector that makes all the image watermark embedding performance indexes reach the highest values is selected as the optimal parameter vector.
Citation Information
Patent Citations
An image spread spectrum watermarking embedding method with adaptive embedding strength
CN109300078B
Adaptive image watermark embedding method and system and extraction method and system
CN111062853A