Quantum color image watermarking scheme based on quantum error correction coding

Quantum image processing, which merges classical image processing techniques with quantum computing, provides exceptional storage capacity and unparalleled parallel computing power. In this study, we present a quantum color image watermarking scheme that employs quantum error correction codes to address issues such as pixel loss and image distortion during watermark embedding and extraction. By utilizing the least significant bit method to embed the color values of the watermark image into those of the carrier image, we improve the scheme’s robustness. We also address the error correction capabilities of channel coding for phase-flip errors and follow the majority principle, resulting in more accurate extraction of the watermark image’s color and enhancing the watermarking scheme’s reliability and integrity. Our experimental simulations demonstrate that the proposed watermarking scheme boasts high security, strong robustness, and excellent concealment.


Introduction
Digital image watermarking is a valuable technology that embeds specific information into digital images for purposes such as identity verification, copyright protection, and source tracking [1,2].This technology helps safeguard image copyrights, confirm image sources, and ensure image integrity.However, traditional digital watermarking schemes have limitations, such as poor robustness and low security, which can result in watermark loss or destruction.To address these issues, researchers have proposed quantum image watermarking [3][4][5][6][7] technology in recent years, which has gained widespread attention.This technology utilizes the properties of quantum superposition and entanglement to enhance the security and robustness of digital image watermarking, thereby protecting the security and privacy of digital images.In future research, we can continue to explore and improve quantum image watermarking technology to meet the increasingly demanding requirements of digital image protection.
In 2003, Venegas-Andraca and Ball first proposed the Qubit Lattice model [8], where the number of qubits required to store the entire image is determined by the pixels of the image, and no use is made of the quantum properties such as superposition and entanglement.The Real Ket model was proposed by Professor Latorre from Spain in 2005 [9].For the first time, this model applies the quantum superposition property to the representation model of quantum images.By continually quartering the image, a balanced quadtree is constructed, and the color information is mapped to the probability amplitudes of the components in the quantum superposition state.The FRQI model was proposed by Le et al in 2010 [10].This model uses a normalized quantum superposition state to store the position and color of the image, resulting in a smaller number of required quantum bits and a more intuitive representation.In 2013, Zhang et al proposed the NEQR model [11], which stores color information in the ground state of a quantum sequence, using a total of 2n+q qubits to represent an image, where n represents the position coordinate information and q represents the color information.This allows for precise manipulation of color information and makes certain image operations that were previously difficult, simple and convenient.Zhang et al also proposed a representation model for polar coordinate images [12], which is similar to the NEQR model.The position information is transformed from horizontal and vertical information to angle and length information in polar coordinates, making it more suitable for image rotation and registration.In subsequent quantum image processing research, a large number of research projects have emerged with the aim of improving the security and reliability of quantum images, including the exploration of quantum image watermarking [13,14] and quantum image encryption [15][16][17].
Different quantum image representation models offer distinct advantages.Choosing the appropriate quantum image representation model for specific quantum image processing processes can significantly impact efficiency and effectiveness [18].In this article, we present a quantum-based channel coding scheme for color image watermarking that utilizes the principles of quantum mechanics and error-correcting codes to enhance the robustness and security of the watermarking process by addressing phase-flip errors.To achieve this, we employ a quantum error-correcting code to solve phase-flip errors and encode the watermark as three qubits.We then embed the encoded binary watermark image into a color host image using the NEQR representation model.Finally, the receiver can use a decoder to decode the quantum state, extract the watermark, and obtain a quantum color carrier image that closely resembles the original one.
The remaining structure of this paper is as follows: in section 2, we provide an overview of the theoretical basis of quantum computing.Section 3 introduces the NEQR model of quantum images and the necessary quantum error-correcting codes.The fourth section presents a detailed description of the process of embedding and extracting quantum binary watermark images based on quantum error-correcting codes, which is the core of this paper.In section 5, we present computer-based experimental results that demonstrate the proposed scheme's performance using various performance metrics.Finally, we summarize the main content of this paper and suggest directions for future research.

Classical least significant bit (LSB) algorithm
The LSB watermarking algorithm is a widely used technique for embedding watermarks in digital media [19,20].This algorithm embeds watermark information into the least significant bit of the digital media files, thus preserving the original audio-visual quality while allowing for watermark extraction through decoding.To extract the watermarked image, one only needs to extract the least significant bit from the watermarked image and combine them.Figure 1 provides the most basic introduction to LSB and MSB, while figure 2 shows a simple example of the LSB algorithm.It is difficult to visually distinguish the carrier image with embedded watermark from the image without embedded watermark.

Arnold transform
Image scrambling refers to a specific transformation applied to the original image, which alters the position or value of its pixels, thus modifying the structure and information of the original image [21,22].This technique can be used to protect the privacy of images, prevent their misuse, and enhance their security.
The Arnold transform is a commonly used discrete mathematical transform in image encryption, scrambling, and compression [23].It is a pixel-based permutation algorithm that is simple, efficient, and highly reversible.The transform rearranges pixels in a specific way to change the position and shape of the image.The mathematical expression of the Arnold transform is given below Specifically, for an image of size N, the transformation rearranges the pixel coordinates (x, y) to (x ′ , y ′ ) according to the formula shown above.By applying this transformation multiple times, the scrambled image becomes increasingly complex and difficult to restore, achieving the effect of encryption or scrambling.
From the above formula, x ′ = (x + y) mod N, y ′ = (x + 2y) mod N can be obtained, and the inverse transformation of Arnold is shown in the following formula.
Similarly, we can obtain x = (2x ′ − y ′ ) mod N, y = (y ′ − x ′ ) mod N.    The Arnold transform utilizes the modulo operation to achieve shearing and stitching, which is used for image scrambling and watermark pre-processing to improve the robustness of image watermarking.After multiple iterations, the scrambled image will periodically recover to the original image.The period of the Arnold transform is generally incalculable but can be calculated for specific image sizes.The iterative formula for the Arnold transform is as follows where I 0 represents the original image without any change, and I n represents the image transformed by n iterations of Arnold transformation.Table 1 shows in detail the number of iteration cycles of Arnold scrambling according to the image size.By iteratively applying the Arnold transform, the spatial distribution characteristics of an image can be altered, increasing its randomness and complexity, thereby enhancing its security and confidentiality.Furthermore, the Arnold transform is reversible and injective, meaning that the transformed image can be restored to its original form through the inverse transformation.Figure 3 shows the effect comparison chart after multiple iterations of Arnold transformation.In the field of quantum communication and quantum computing, document [24,25] proposed the quantum circuit design of Arnold scrambling transform and Arnold inverse scrambling transform, laying a solid foundation for future research.These specific designs are shown in figures 4 and 5.

NEQR model
We can define a classical grayscale N × N image using a real-valued matrix Each element in the matrix represents a pixel, where f ij denotes the gray level.Figure 6 illustrates the concept of a classic image representing the value of each pixel in matrix form.
The novel enhanced quantum representation (NEQR) model is a quantum image processing technique that leverages the superposition state of quantum bits to store the grayscale value of an image pixel [26].By using tensor products, the NEQR model creates entanglement between the quantum bit sequences of storage position and grayscale value, which corresponds to mapping position to color and storing the entire image information.
For an image of color range [0, The representation of NEQR is as follows, where |YX⟩ is used to store the position information of the image.The NEQR model requires 2n qubits to store the image coordinates and m qubits to store the gray values.
A grayscale image requires 8 qubits to store its color information.Figure 7 perfectly shows an example of a grayscale image of size 2 × 2 and its conversion into a NEQR description model.

Quantum equal
Zhou et al proposed quantum equal (QE) in the document [24,25], which is used to compare whether the data presented by two qubits are equal.The specific manifestation of its quantum circuit is clearly presented in figure 8.

Quantum image and quantum error correction code
Quantum image processing is a research field that involves converting classical images into quantum states and processing them on a quantum computer [27].To address the issue of information loss and damage caused by noise and other errors in quantum information transmission and storage, quantum error-correcting codes are designed.Unlike classical error-correcting codes, quantum error-correcting codes leverage the superposition and entanglement properties of quantum states to enhance transmission and storage efficiency and accuracy, effectively reducing the error rate.This chapter provides a solid foundation for the following discussions.

Quantum image preparation
Quantum image preparation is a technique that converts classical images into quantum states for use in quantum information processing and communication [28,29].This involves representing the image information as quantum bit states by converting the pixel values of a classical image to corresponding quantum states and processing them using different encoding methods.
The conversion process of classical image to quantum NEQR model is illustrated in figure 9, where the initial state |φ 0 ⟩ is transformed into NEQR model through the following two operations.

Quantum image reconstruction
Quantum image processing involves storing classical image information in a sequence of qubits and extracting classical image information from quantum bit information [30].The NEQR model achieves this by directly storing the color values of an image using a sequence of qubits in their ground states and reconstructing the corresponding classical image through precise measurement.
We use a measurement operator Γ to measure two quantum basis state sequences and obtain the pixel   Received encoding Decoding results

|000⟩, |001⟩,|010⟩,|100⟩ |000⟩ |110⟩, |101⟩,|110⟩,|111⟩ |111⟩
The |f(Y, X)⟩ quantum bit sequence stores the color information, while the |YX⟩ quantum bit sequence stores the coordinate information.Next, we perform a projection measurement on the basis state sequence that stores the color information, with the projection operator given by: After the above operations, the classical value of the color information at (Y, X) can be measured from the NEQR model of the quantum image, thereby reconstructing the corresponding original classical image.

Quantum error-correcting coding
Quantum error-correcting codes can enhance the reliability and security of quantum communication and quantum computing by protecting quantum information from noise and errors [31][32][33][34].To implement quantum error-correcting codes, the superposition state of qubits is typically encoded, and specific operations are used to entangle these qubits, thereby constructing a quantum error-correcting code capable of detecting and correcting errors.

Solving bit-flip errors with channel coding
In quantum channels, the most common type of error is the bit-flip error.To correct this type of error, a simple three-qubit column encoding scheme can be used for quantum channel encoding, similar to classical error-correcting codes.The table 2 below shows the encoding scheme.
When the input state is |0⟩, the output is |000⟩ ; if the input state is |1⟩, the output is |111⟩.The qubit column received by the receiver is expressed in a superposition of quantum states |x 1 x 2 x 3 ⟩.We can measure the total number of occurrences of |0⟩ or |1⟩ in x 1 ,x 2 and x 3 , and then decode according to the majority rule, the specific method of decoding is shown in table 3.
The decoding process is linear.decoder transformation, the correct channel information can be obtained.The actual D decoder is shown in the following figure 13.

Solving bit-flip errors with channel coding
In the transmission of qubits through a quantum channel, it is also possible to have a phase flip error, which means that the information sent by the sender as |φ⟩ = α|0⟩ + β|1⟩ becomes |φ ′ ⟩ = α|0⟩ − β|1⟩ at the receiver.
When applied to quantum bits, the following operations can convert phase flipping error into bit flipping error.To do so, first apply an H gate to the qubit|φ⟩, transforming it into H | φ⟩.The transformed message is then transmitted through a quantum channel, where two possible scenarios can occur, as shown in table 4.
The receiver performing an H-gate transformation on the received qubit will result in the following two possibilities, as shown in table 5.
Through the two steps mentioned above, we can obtain two states, X | φ⟩ and φ , which allow us to cleverly convert phase-flip errors to bit-flip errors.The specific operation is as follows: Firstly, set up an encoder at the sending end as shown in the following figure 14.
The decoder is shown in the following figure 15.
In conclusion, quantum error-correcting codes offer notable advantages in improving quantum communication, quantum computation, and quantum storage.They provide robustness against noise and possess error correction capabilities, thereby enhancing system reliability and stability, while also expanding storage capacity.These advantages are of paramount importance for achieving dependable quantum technologies and constructing large-scale quantum systems.

Quantum image watermarking scheme
Digital watermarking refers to the process of embedding specific information into digital media such as images, audio, video, etc.This is to protect copyright and prevent illegal distribution, as well as to authenticate integrity and authenticity.Combining with quantum computing technology, more secure and efficient digital watermarking schemes can be developed.Quantum error correction codes can improve the robustness of digital watermarks, making them more tolerant to channel noise and attacks.

The process of watermark embedding
The process of embedding a quantum watermark can be divided into the following stages: Step 3: use the QE module to determine whether the coordinate position information of the carrier image and the watermark image are equal.
Step 4: apply the idea of channel coding in quantum error correction codes to solve phase reversal errors, extract 1 qubit that stores color information in the watermark image | W⟩ described by NEQR, and encode it in the entangled state c 0 YX of 3 physical qubits middle; Step 5: introduce two qubits, make them into the initial state | 0⟩, take the pixel color information as the control bit, and complete the operation of solving the phase flip error correction coding.Even if the watermarked carrier image data is subject to interference or some kind of attack in the transmission channel, causing a small number of qubits of the image color information to be inverted, after the channel-encoded watermarked image is extracted by solving the phase inversion error, its color data will also be Not affected in the slightest; Step 6: embed the error-correction-coded quantum binary image | W⟩ into the quantum color carrier image | C⟩ based on the LSB algorithm, and replace the least significant bits of each RGB channel of the carrier image | C⟩ with the color information of the watermark image at the same position.
More specific operational steps are drawn into a quantum circuit [24,25], and its detailed design is presented in figure 16.

The process of watermark extraction
The watermark extraction process consists of the following steps: Step 1: prepare a quantum binary image   The more specific operational steps in the watermark extraction process are drawn into a quantum circuit [24,25], and its detailed design is presented in figure 17.

Experimental simulation and result analysis
In this section, the above watermarking scheme is simulated and the experimental results are analyzed.Since the quantum computer is not widely used at present, all experiments are simulated on the classical computer.The experiments are implemented in Python 3.9 environment.The hardware environment of the experiment is AMD Ryzen 7 5800H CPU 3.20 GHz 16.0 GB.
In this experimental analysis, we used six color carrier images, all of which have the same size of 512 × 512, while the size of the six binary watermark images is 128 × 128.After embedding these watermark images into the carrier image, it is almost impossible to visually distinguish the watermarked carrier image from the original carrier image, they are almost identical.The actual effect is presented in figure 18.

Peak signal-to-noise ratio (PSNR)
PSNR is a metric for measuring the quality of digital images or videos [35].It is calculated by comparing the signal-to-noise ratio between the original image and the compressed or distorted image, usually expressed in decibels (dB).PSNR is defined based on mean squared error (MSE) [36].To quantitatively describe the visual quality of color images, for images of size MN, I and the watermarked image S, MSE is defined by the following formula PSNR is defined by the following formula When the PSNR value is higher than 40, it indicates that the similarity between the two images is very high, and the difference is almost impossible to detect with the naked eye.This study uses different binary watermark images to be embedded into different color carrier images, and compares them with the original carrier images through PSNR analysis.The detailed experimental data are presented in table 6.The results show that our proposed scheme has minimal impact on the original carrier image during the watermark embedding and extraction process, showing excellent performance.

Bit error rate analysis (BER)
BER is defined as the reciprocal of PSNR, as shown in the following formula [37].
The bit error rate in the experimental simulation results is accurately recorded in table 7. The experimental results show that the BER values of the six carrier color images embedded with watermark images are less than 0.02, that is, less than 2% of the bits have changed.This verifies that in a noise-free environment, there are almost no major changes during data transmission, highlighting a high degree of stability and reliability.

Structural similarity analysis (SSIM)
SSIM is a metric used to measure image similarity, commonly used in the fields of image processing, computer vision, and other related areas.It also takes into account the perception of image structure and texture by the human eye, making it more consistent with the characteristics of the human visual system.SSIM calculates the similarity between two images by comparing three aspects of the images: luminance, contrast, and structure information.It is defined a.s.
where µ x and µ y represent the mean values of the two images, σ 2 x and σ 2 y represent the variances of the two images' luminance, and σ xy represents the covariance between the two images.C 1 and C 2 are two constants used to avoid the denominator being zero.The closer the value of SSIM is to 1, the higher the structural similarity and the smaller the distortion between two images.This composite metric plays a crucial role in measuring image similarity and quality.
Table 8 shows the experimental data of structural similarity analysis in detail.The experimental results clearly and intuitively show that the structural similarity between images is high, the degree of distortion is small, and the robustness is excellent.

Normalized correlation coefficient analysis (NCC)
NCC is often widely used to compare pixel intensities to measure the similarity between two images.
The symbol K(x, y) represents the pixel information of the original watermark image, and K(x, y) represents the pixel information of the extracted watermark image.Generally, when the value of NCC is closer to 1, it indicates that the similarity between the two images is higher.The NCC analysis data is recorded in detail in table 9.The rich experimental results show that there is a strong correlation between the test images.

Histogram analysis
Histogram analysis is a commonly used statistical method used to visualize and understand the distribution of image pixel values, and is widely used in the field of image processing and analysis [38,39].It helps explain the distribution shape, central tendency, and dispersion of the data.We conducted histogram analysis on the six original carrier images and the host images after embedding watermarks.The specific experimental results are clearly presented in figure 19.
An in-depth analysis of the experimental data reveals that the difference between the watermarked host color image and the original carrier image is minimal.The distribution of pixel values is relatively close, with no obvious difference.This further verifies that the algorithm proposed in this study has excellent performance in ensuring image security.

Anti-noise attack analysis
Robustness analysis testing is of great significance in the field of image processing [40].Its purpose is to verify that the image processing algorithm can provide reliable, high-performance and safe image processing services when dealing with various abnormal situations and challenges.Among them, anti-noise attack analysis is a crucial part of robustness analysis, which plays an indispensable role in evaluating, improving and verifying the security and reliability of image watermarking algorithms [41].
Figures 21 and 20 vividly demonstrate the recovery of the watermark image and the carrier image after being attacked by salt and pepper noise of varying degrees during the embedding and extraction process of our experimental scheme.The experimental results clearly show that although the image has been attacked by salt and pepper noise up to 20%, the experimental solution we proposed still shows excellent data recovery capabilities, and the key image information has not been seriously damaged.This strongly proves the good robustness and reliability of the scheme.
We embed multiple watermark images into different host color images, and conduct detailed comparison and analysis of the experimental data after being attacked by salt and pepper noise to varying degrees.The results are fully recorded in table 10.Experimental data clearly demonstrate that this research solution exhibits excellent data recovery capabilities, strengthening its feasibility and trustworthiness in actual citations.

Summary and outlook
Quantum watermarking is a rapidly developing field in quantum information hiding.Quantum images provide a strong foundation for this field.In this paper, we propose a quantum color image watermarking scheme based on quantum error-correcting codes to improve the reliability and integrity of data transmission and storage.Our scheme embeds a quantum binary image watermark into a quantum color carrier image of the same size using the LSB algorithm.During watermark extraction, the majority principle of quantum error-correcting codes is used to accurately extract the color of the watermark image.We evaluate the performance of our scheme using various metrics, including PSNR, SSIM, BER, steganographic capacity, and robustness.The simulation results show that our proposed scheme achieves high imperceptibility and good visual quality while maintaining a low false positive rate.Furthermore, it exhibits strong robustness under noise interference.The proposed scheme presented in this article has some limitations regarding the carrier and watermark sizes, which require further investigation.However, compared to previous quantum watermarking schemes, our proposed scheme offers three main advantages.Firstly, the embedding of the quantum binary watermark and the LSB algorithm can be implemented through a simple quantum circuit, making it practical.Secondly, our watermarking scheme allows for flexible adjustment of the number of bits used for watermark embedding to meet practical needs.Thirdly, experimental simulation analysis shows that our proposed scheme has good visual quality, anti-interference performance, and strong robustness.Additionally, the powerful reliability and integrity of data transmission and storage provided by quantum error correction codes can also be applied to other fields beyond quantum image processing.

Figure 1 .
Figure 1.Basic fundamentals of LSB and MSB.

Figure 3 .
Figure 3.Comparison of image effects after multiple iterations of Arnold transform.

Figure 5 .
Figure 5.The quantum circuit of inverse Arnold image scrambling: (a) x circuit, (b) y circuit.

Figure 6 .
Figure 6.Matrix concept of classic image.

Figure 7 .
Figure 7. NEQR model and its transformation formula for grayscale image.

Figure 8 .
Figure 8. QE circuit realization and its diagram.(a) circuit of QE, (b) diagram of QE.

Figure 9 .
Figure 9. Conversion process from classical image to quantum NEQR model.

Step 1 :
convert the classic color carrier image of size 512 × 512 into | C⟩ through the NEQR description model, and similarly convert the classic binary watermark image of size 128 × 128 into | W⟩; Step 2: apply Arnold transform to the watermark image | W⟩; with an initial value of all | 0⟩ and a pixel size of 2 n × 2 n to store the watermark;Step 2: convert the quantum binary image into an equal probability distribution state through the Hadamard gate, which is used to store the position coordinate information of the watermark pixel; Step 3: extract the Arnold scrambled binary watermark image xxx from the watermarked color carrier image, and perform inverse Arnold scrambling to restore the accurate information of the quantum binary image; Step 4: use the decoder to decode the channel coding that accounts for phase flip errors.And the qubits of the final color information are determined based on the vast majority of principles to improve the reliability and integrity of data transmission; Step 5: by measuring the quantum state of |W ′ ⟩, the pixel position information of the image and the black and white value of each position can be obtained, and then restored to the original classic binary watermark image.

Figure
Figure The rendering effect of the original image and the watermarked image.

Figure 19 .
Figure 19.Schematic diagram of histogram analysis effect.

Table 1 .
Iteration times of Arnold transform.

Table 2 .
Quantum channel encoding with three-qubit columns.

Table 4 .
Situations in the channel.

Table 5 .
Situations after the second transformation.

Table 7 .
BER comparison data analysis.

Table 9 .
NCC comparative data analysis.

Table 10 .
Comparative analysis results after salt and pepper noise attack.