Image Watermarking Scheme Using LSB and Image Gradient

: In the modern age, watermarking techniques are mandatory to secure digital communication over the internet. For an optimal technique, a high signal-to-noise ratio and normalized correctional is required. In this paper, a digital watermarking technique is proposed on the basis of the least signiﬁcant bit through an image gradient and chaotic map. The image is segmented into noncorrelated blocks, and the gradient of each block is calculated. The gradient of the image expresses the rapid changes in an image. A chaotic substitution box (S-Box) is used to scramble the watermark according to a piecewise linear chaotic map (PWLCM). PWLCM has a positive Lyapunov exponent and better balance property as compared to other chaotic maps. This S-Box technique is capable of producing a disperse sequence with high nonlinearity in the generated sequence. Least signiﬁcant bit is a simple technique for embedding but it has a high payload capacity and direct pixel manipulation. The embedding payload introduces a tradeoff between robustness and imperceptibility; hence, the image gradient is a technique to identify the best-suited place to embed a watermark and avoid image degradation. By modifying the least signiﬁcant bits of the original image, the watermark signal is embedded according to the image gradient. In the image gradient, the direction and magnitude decide how much embeding can be done. In comparison with other methods, the experimental results show satisfactory progress in robustness against several image processing and geometrical attacks while maintaining the imperceptibility of the watermark signal.


Introduction
Information technology has led to a great revolution in the field of digital communication. In addition to other benefits, it facilitates the distribution, operation, and replication of digital data, thus threatening the safe ownership of digital media. Digital image watermarking is a technique specially designed to solve these issues. In image watermarking, the owner's secret information is implanted into the image, video, and audio without effecting the acceptable quality. The embedded owner's secret information can later be extracted for authentication. The most important aspect of image watermarking is copyright safety and content authentication. Watermarking is classified into image, audio, video, and text embedding and extracting the watermark, because of its better perceptual capacity than AC coefficients. The PSNR and robustness against attacks were good, but the technique was computationally expensive. In [18], a digital image watermarking technique based on DCT, DWT, and SVD was recommended. This technique was robust against geometric attacks. The disadvantage of this technique was its effect on the host image. The comparative literature comparison is given in Table 1. Table 1. Literature review of watermarking techniques.

Method
Blind Robustness Extraction Type [19] Yes Robust to common (R2C) image processing attacks Multi-bit [20] Yes R2C, JPEG, and cropping Single-bit [21] No R2C attacks Multi-bit [22] Yes R2C attacks Multi-bit [23] Yes Robust to Rotation and Flipping attacks Multi-bit The remainder of the paper is arranged as follows: Section 3 proposes the methodology for watermark implanting and watermark extraction; Section 4 presents and discusses the experimental evaluation; Moreover, Section 5 provides the conclusion.

Our Contribution
In this paper, we introuduce a watermarking strategy for protecting the watermark signal, in which an original image is divided into 16 × 16 blocks, and a gradient is applied to calculate the magnitude and direction of each block. The gradient magnitude denotes image changes, while the gradient angle denotes the direction of changes. The capacity of the watermark signal is embedded according to the gradient of each block using the least significant bit technique. In image watermarking, the researcher tries to embed maximum payload without affecting the image visual quality. Greater embedding ensures more robustness; thus, spatial-domain techniques, e.g., LSB, provide a higher payload compared to frequency-domain techniques. The main concern is to balance the performance in terms of undetectability, robustness, and algorithmic complexity. LSB is computationally efficient and has high perceptual quality. To increase security, the watermark to be embedded is scrambled using a chaotic substitution box. This method shows high robustness and imperceptibility when the middle coefficient is used for embedding.

Image Gradient
The image gradient is a core component in image processing, used to find the directional variation in the intensity of the image. The gradient magnitude and direction denote how and where variations occur. The gradient image pixel represents the change in pixel value of the original image at that point, in the relative direction. The magnitude and direction of the gradient are calculated by the equations below.
where g y is the gradient in the y-direction, and g x is gradient in x-direction. M is the magnitude of the gradient. The direction of the gradient is measured by λ.
The image gradient in this proposed process is measured by convolving the original image block with the Prewitt operator. In gradient image, the pixels with large values indicate the edges. To visualize the direction, xand y-direction image gradients are calculated. The filter to calculate the xand y-direction gradients is shown below The image gradient in this proposed process is measured by convolving the original image block with the Prewitt operator. In gradient image, the pixels with large values indicate the edges. To visualize the direction, x-and y-direction image gradients are calculated. The filter to calculate the x-and y-direction gradients is shown below The main concern of this approach is to classify the image into smooth and sharp portions, in order to achieve better imperceptibility of the image. For this purpose, a threshold is calculated to differentiate the local smoothness and sharpness in each block. On the basis of this threshold, a decision can be made on how many bits are to be embedded through LSB embedding.

Least Significant Bit (LSB) Embedding
The LSB is the simplest method available for watermark insertion in spatial-domain watermarking. In the LSB method, operations are directly performed on pixel values, resulting in minor changes in pixel values. By changing the LSB of the host image, a watermark is applied. The insertion and extraction principles are simple and effective. This LSB method has high perceptual quality and is mostly used in fragile watermarking. Figure 1 shows the embedding through message bytes.

Piecewise Linear Chaotic Map
The piecewise linear chaotic map (PWLCM) has recently gained attention because of its ease in depiction, effectiveness in application, and good vital non-linear behavior [24]. It has been proven that PWLCMs are random and have a constant density function on their classification interim. Figure 2 shows the positive values of PWLCM and the Lyapunov exponent, indicating that PWLCM is chaotic in the given range. Chaotic systems always show random behavior.
A PWLCM with four intervals can be indicated by the following equation: where x0 ϵ [0, 1), and p is the control factor p ϵ (0, 0.5).
The main concern of this approach is to classify the image into smooth and sharp portions, in order to achieve better imperceptibility of the image. For this purpose, a threshold is calculated to differentiate the local smoothness and sharpness in each block. On the basis of this threshold, a decision can be made on how many bits are to be embedded through LSB embedding.

Least Significant Bit (LSB) Embedding
The LSB is the simplest method available for watermark insertion in spatial-domain watermarking. In the LSB method, operations are directly performed on pixel values, resulting in minor changes in pixel values. By changing the LSB of the host image, a watermark is applied. The insertion and extraction principles are simple and effective. This LSB method has high perceptual quality and is mostly used in fragile watermarking. Figure 1 shows the embedding through message bytes. The image gradient in this proposed process is measured by convolving the original image block with the Prewitt operator. In gradient image, the pixels with large values indicate the edges. To visualize the direction, x-and y-direction image gradients are calculated. The filter to calculate the x-and y-direction gradients is shown below The main concern of this approach is to classify the image into smooth and sharp portions, in order to achieve better imperceptibility of the image. For this purpose, a threshold is calculated to differentiate the local smoothness and sharpness in each block. On the basis of this threshold, a decision can be made on how many bits are to be embedded through LSB embedding.

Least Significant Bit (LSB) Embedding
The LSB is the simplest method available for watermark insertion in spatial-domain watermarking. In the LSB method, operations are directly performed on pixel values, resulting in minor changes in pixel values. By changing the LSB of the host image, a watermark is applied. The insertion and extraction principles are simple and effective. This LSB method has high perceptual quality and is mostly used in fragile watermarking. Figure 1 shows the embedding through message bytes.

Piecewise Linear Chaotic Map
The piecewise linear chaotic map (PWLCM) has recently gained attention because of its ease in depiction, effectiveness in application, and good vital non-linear behavior [24]. It has been proven that PWLCMs are random and have a constant density function on their classification interim. Figure 2 shows the positive values of PWLCM and the Lyapunov exponent, indicating that PWLCM is chaotic in the given range. Chaotic systems always show random behavior.
A PWLCM with four intervals can be indicated by the following equation: where x0 ϵ [0, 1), and p is the control factor p ϵ (0, 0.5).

Piecewise Linear Chaotic Map
The piecewise linear chaotic map (PWLCM) has recently gained attention because of its ease in depiction, effectiveness in application, and good vital non-linear behavior [24]. It has been proven that PWLCMs are random and have a constant density function on their classification interim. Figure 2 shows the positive values of PWLCM and the Lyapunov exponent, indicating that PWLCM is chaotic in the given range. Chaotic systems always show random behavior.

Chaotic Substitution Box
A substitution box is one of the principal components in a block cipher, and it has a vital role in the substitution process. All topical ciphers follow Shannon's principal of confusion and diffusion. The S-Box used to introduce confusion in a system. The security strength of block ciphers depends upon the substitution box. Thus, it is difficult in research to assemble a strong substitution box that can pass on high nonlinearity and low differential probability values. In general, the S-Box is an auxiliary table which takes multiple input bits and randomly transforms them into output bits. Bijection cryptographic A PWLCM with four intervals can be indicated by the following equation: where x 0 [0, 1), and p is the control factor p (0, 0.5).

Chaotic Substitution Box
A substitution box is one of the principal components in a block cipher, and it has a vital role in the substitution process. All topical ciphers follow Shannon's principal of confusion and diffusion. The S-Box used to introduce confusion in a system. The security strength of block ciphers depends upon the substitution box. Thus, it is difficult in research to assemble a strong substitution box that can pass on high nonlinearity and low differential probability values. In general, the S-Box is an auxiliary table which takes multiple input bits and randomly transforms them into output bits. Bijection cryptographic properties motivated its design, considering The nonlinearity [25], strict avalanche criterion [26], bit independence criterion [26], and linear and differential approximation probability [9,26]. Zaid et al. [27] planned a simple and efficient S-Box design based on a PWLCM map and adaptive optimization technique. Algorithm 1 shows the pseudo code of the S-Box. The proposed S-Box has few mathematical computations and shows better nonlinearity and differential probability values. The random sequence of the S-Box value is shown in Table 2. properties motivated its design, considering The nonlinearity [25], strict avalanche criterion [26], bit independence criterion [26], and linear and differential approximation probability [9,26]. Zaid et al. [27] planned a simple and efficient S-Box design based on a PWLCM map and adaptive optimization technique. Algorithm 1 shows the pseudo code of the S-Box. The proposed S-Box has few mathematical computations and shows better nonlinearity and differential probability values. The random sequence of the S-Box value is shown in Table 2.

Watermarking Scheme
In this paper, an image watermarking based on a chaotic map using LSB and image gradient is presented. The goal of this technique is to provide high capacity, imperceptibility, and robustness against attacks. The performance of our suggested approach is tested by considering well-known parameters, i.e., peak signal-to-noise ratio (PSNR) and normalized correlation (NC). The appropriate embedding positions are chosen using the gradient magnitude and direction of the individual image block. The embedding used in this technique is LSB because of its low computation cost and high perceptual capacity. This proposed framework gives high robustness against common image processing and geometrical attacks because of its embedding in edge surface areas. Figure 3 shows the watermark embedding process, consisting of seven steps. Moreover, Figure 4 represents the flow diagram for extraction of watermark.     Step 1. Divide the host image into 16 × 16 nonoverlapping blocks. The nonoverlapping blocks prevent data loss.

Host
Step 2. Calculate the gradient of each block, i.e., gradient magnitude and direction.
Step 3. Choose the central pixel of each block, and separate them into LSB and MSB.
Step 4. Watermark signals are embedded in the LSB according to the following cases: For magnitude M = , For direction = tan .
Step 4. Select the watermark image and scramble it using the chaotic substitution box.
Step 5. Split the scrambled watermark into LSB and MSB. XOR the LSB of the watermark with the one-or two-bit LSB of the host image.
Step 6. Watermarked image can be constructed with the combination of LSB and MSB.
Step 7. To extract the watermark image, conduct all steps in reverse.

Experimental Results
In this section, to check the performance of proposed scheme, MATLAB-2017 software on a computer with sixth generation Windows 10 and 8 GB RAM was used to conduct tests on standard images taken from the SIPI Image Database at the University of Southern California (http://sipi.usc.edu/database/ Accessed on 22 March 2022). Grayscale testing images Lena and Baboon with a standard size of 512 × 512 and a 32 × 32 grayscale logo as a watermark signal were used. To observe the imperceptibility and robustness of the testing images, several experiments were performed by varying the intensities of the image processing attacks and geometrical attacks.

Perceptual Quality Measures
To calculate the watermarked image perceptual quality, two performance metrics were calculated, i.e., PSNR and structural similarity (SSIM). PSNR measures the visual eminence between the original and watermarked image. A larger value of PSNR shows the visual equivalence of the real and watermarked image. The mathematical formula to measure peak signal to noise ratio is Step 1. Divide the host image into 16 × 16 nonoverlapping blocks. The nonoverlapping blocks prevent data loss.
Step 2. Calculate the gradient of each block, i.e., gradient magnitude and direction.
Step 3. Choose the central pixel of each block, and separate them into LSB and MSB.
Step 4. Watermark signals are embedded in the LSB according to the following cases: For magnitude M = g y 2 + g x 2 , Case 1: M ≥ (max (magnitude)/2) && λ > 0; in this case, one-bit watermark is implanted into the LSB.
Step 4. Select the watermark image and scramble it using the chaotic substitution box.
Step 5. Split the scrambled watermark into LSB and MSB. XOR the LSB of the watermark with the one-or two-bit LSB of the host image.
Step 6. Watermarked image can be constructed with the combination of LSB and MSB.
Step 7. To extract the watermark image, conduct all steps in reverse.

Experimental Results
In this section, to check the performance of proposed scheme, MATLAB-2017 software on a computer with sixth generation Windows 10 and 8 GB RAM was used to conduct tests on standard images taken from the SIPI Image Database at the University of Southern California (http://sipi.usc.edu/database/, accessed on 22 March 2022). Grayscale testing images Lena and Baboon with a standard size of 512 × 512 and a 32 × 32 grayscale logo as a watermark signal were used. To observe the imperceptibility and robustness of the testing images, several experiments were performed by varying the intensities of the image processing attacks and geometrical attacks.

Perceptual Quality Measures
To calculate the watermarked image perceptual quality, two performance metrics were calculated, i.e., PSNR and structural similarity (SSIM). PSNR measures the visual eminence between the original and watermarked image. A larger value of PSNR shows the visual equivalence of the real and watermarked image. The mathematical formula to measure peak signal to noise ratio is PSNR = 10 log 10 where the value 255 is the extreme image pixel strength. The term MSE stands for the mean squared error of image.
where M × N is the size of the image, and e (m, n) 2 is the difference between the watermarked and real image. SSIM measures the similarity between two images on the basis of luminance, contrast, and structure. The mathematical formula of similarity measure is where µ x µ y are the averages of x and y, are the variances of x and y, and is the covariance of x and y. Figure 5 reveals various images i.e., actual image and watermark inserted image. where the value 255 is the extreme image pixel strength. The term MSE stands for the mean squared error of image.
where M × N is the size of the image, and e (m, n) 2 is the difference between the watermarked and real image. SSIM measures the similarity between two images on the basis of luminance, contrast, and structure. The mathematical formula of similarity measure is where μx μy are the averages of x and y, are the variances of x and y, and is the covariance of x and y. Figure 5 reveals various images i.e., actual image and watermark inserted image. The PSNR and SSIM of the Lena and Baboon watermarked images without any attack are shown in Table 3.

Robustness of Watermarking Algorithm
To check the robustness of the watermarking method, the normalized correlation between the real and extracted watermark was calculated. This shows its resistance against different image processing and geometrical attacks. The normalized correlation value varies between 0 and 1; a value close to one indicates that the watermarking algorithm has strong robustness. The PSNR and SSIM of the Lena and Baboon watermarked images without any attack are shown in Table 3.

Robustness of Watermarking Algorithm
To check the robustness of the watermarking method, the normalized correlation between the real and extracted watermark was calculated. This shows its resistance against different image processing and geometrical attacks. The normalized correlation value varies between 0 and 1; a value close to one indicates that the watermarking algorithm has strong robustness.
where W ij , W ij are the inserted and withdrawal watermark strength at point (i, j). The normalized correlation values across multiple attacks i.e., image handling and geometrical are given in Table 4.

Comparison with Other Paper
In this section, we compare the results of our suggested techniques with other techniques. In [28], watermarking was achieved using DWT, DCT, and image gradient. DWT separates the image into multiple bands for insertion. The gradient is used to give a topological map of the image. The method in [13] is blind, whereby the watermark is embedded in the blue component of the RGB image in the spatial domain. The imperceptibility analysis of the methods in [13,28,29] for the baboon image is shown in Table 5. Figure 6 shows different types of images.
where Wij, Wij ′ are the inserted and withdrawal watermark strength at point (i, j). The normalized correlation values across multiple attacks i.e. image handling and geometrical are given in Table 4.

Comparison with Other Paper
In this section, we compare the results of our suggested techniques with other techniques. In [28], watermarking was achieved using DWT, DCT, and image gradient. DWT separates the image into multiple bands for insertion. The gradient is used to give a topological map of the image. The method in [13] is blind, whereby the watermark is embedded in the blue component of the RGB image in the spatial domain. The imperceptibility analysis of the methods in [13,28,29] for the baboon image is shown in Table 5.  Noise insertion, smoothening, cropping, and contrast enhancement are considered common image processing distortions. A comparison of these factors with the method suggested by Mokhnache et al. [28] is shown in Table 6. Figure 7 indicates the comparison of SSIM and PSNR.   Table 7 shows that suggested method has more robustness than the method proposed by Su et al. [13]. Noise insertion, smoothening, cropping, and contrast enhancement are considered common image processing distortions. A comparison of these factors with the method suggested by Mokhnache et al. [28] is shown in Table 6. Figure 7 indicates the comparison of SSIM and PSNR.   Noise insertion, smoothening, cropping, and contrast enhancement are considered common image processing distortions. A comparison of these factors with the method suggested by Mokhnache et al. [28] is shown in Table 6. Figure 7 indicates the comparison of SSIM and PSNR.   Table 7 shows that suggested method has more robustness than the method proposed by Su et al. [13].  Table 7 shows that suggested method has more robustness than the method proposed by Su et al. [13].
In image watermarking, a geometric attack is basically a displacement of a pixel by a random amount. In other words, the original watermark is present, but bits are displaced. The development of such a technique is compulsory in geometric distortion correction. Table 8 illustrates the attacks and normalized correlation results.

Conclusions
In order to determine the efficiency of a watermarking technique, some important properties should be analyzed. Firstly, the effectiveness denotes whether the watermark signal embedded in the host image is properly detected. The value of normalized correlation shows the correctness of the watermark; if it is close to 1, the watermark signal is correctly detected. Secondly, imperceptibility denotes whether there is any effect on the perceptual transparency of the watermark embedded in the host image. Thirdly, the payload denotes the mass of content embedded in the digital image. Increasing the content facilitates watermark detection. Fourthly, security denotes the ability to resist against attacks. A secure cryptographic key is secure against cryptographic attacks. In this article, an LSB and image gradient-based image watermarking approach was presented. The original image was divided into nonoverlapping blocks, and the gradient of each block was calculated. In this way, the smooth and irregular areas of the image could be identified for watermark embedding. Finally, LSB was used to introduce watermarked bits. This approach functioned in the time domain, providing computational efficiency and high perceptual quality. It showed significant robustness against image processing and geometrical attacks. In the future, the proposed technique will be investigated for resistance against modern attacks, such as the boomerang attack. Moreover, this technique will be extended for color and video watermarking.