1 Introduction

The most common way to defeat tampering is to embed a fragile watermark into the image in order to identify and localize any possible image alteration [2]. A fragile watermark is a category of the exact authentication and is simply a mark likely to become undetectable after a work is modified in any way [1], thus, it provides a way to verify the integrity of an image. Confidentiality and integrity are critical in many applications of imagery and require an exact authentication.

Many techniques of spatial and frequency domain exist for authentication using watermarking [37]. Byun et al. [8] proposed a Singular value decomposition (SVD) based fragile watermarking scheme for image authentication. The basic idea is to extract authenticating data from the original image. The singular values are converted to the binary bits using modular arithmetic. Taheri et al. [2] based on the idea of hierarchical watermarking partitioned the image into blocks in a multilevel hierarchy, at the highest level of hierarchy, the image is divided into a set of blocks, the authentication data is then constructed by computing the singular values of each level’s sub-block and then incorporate them into LSBs (Least Significant Bit) of a selected pixels within the block. Unfortunately, these methods require an important time of execution, hence they can’t be used in applications that require low complexity like video authenticating, due to the huge number of images that compose the video. To solve this problem, this paper proposes a new method of fragile watermarking based on SVD and Faber Schauder Discrete Wavelet Transform (FSDWT), this method requires less time of execution, hence it can be used by applications requiring low complexity and can be applied to video authentication.

The proposed algorithm starts by determining the salient zones of the image where the watermark will be inserted, this is done by selecting the salient zones as the extracted contours and textured regions that are close to those contours (CT-Regions). The contours characterize uniquely the image, thus, any modification on the image will results in a modification of CT-Regions. To find these relevant zones of the image, FSDWT is used where the transform detects the CT-Regions by using the dominant blocks of the image. The operations used by this transform are simple and have a low complexity, which results in a fast algorithm. Then the singular values of the dominant blocks are computed using SVD and combined with a logo to watermark the image. As the singular values of an image are very sensitive to their dominant blocks, any modification in the image will dramatically modify the singular values of the dominant blocks, which will lead in a more fragile algorithm and ensure the authenticity of the image. The rest of the paper is organized as follows. Section 2 describes SVD and FSDWT. Section 3 describes details of the proposed method and Sect. 4 presents the experimental results and an analysis of computational complexity. The last section concludes the paper.

2 Background and Theory

2.1 SVD

The decomposition into singular values is based on a linear algebra theorem which states that any \(m \times n\) matrix A with \(m \ge n\) can be factored as:

$$\begin{aligned} A = USV^T \end{aligned}$$
(1)

where U is an \(m \times m\) orthogonal matrix, \(V^T\) is the transposed matrix of an \(n \times n\) orthogonal matrix V, and S is an \(m \times n\) matrix with singular values on the diagonal. The matrix S can be presented as:

$$\begin{aligned} S=\begin{bmatrix} \sigma _1&0&...&0&0 \\ 0&\sigma _2&...&0&0 \\ \vdots&\vdots&\,&\vdots&\vdots \\ 0&0&...&0&\sigma _n \\ 0&0&...&0&0 \\ \end{bmatrix}\!\!, \end{aligned}$$
(2)

and \(\sigma _1 \ge \sigma _2 \ge ... \ge \sigma _n\) For \(i = 1, 2, 3,...,n\), \(\sigma _i\) are called singular values of the matrix A. There are many properties of SVD from the viewpoint of image processing applications:

  • Variations on the singular spectrum and on the matrix A have exactly the same level [9].

  • Singular values represent intrinsic algebraic image properties [10].

  • Singular values represent the image energy, and we can approximate an image by only the first few terms.

  • The first term of singular values will have the largest impact on approximating image, followed by the second term, then the third term, etc.

2.2 Faber Schauder Discrete Wavelet Transform

Wavelets have been found to be extremely useful in digital watermarking. They have a growing impact in signal and image processing, mainly due to multistage and time-frequency localization of the image and their good performance in decorrelating information [11]. FSDWT is a mixed scales representation of an integer wavelet transform [12] which is based on the Lifting Scheme [13] without any boundary treatment, an example of mixed scalars representation of an image (Fig. 1) is shown in Fig. 2. The lifting Scheme of the FSDWT [12] is given by the following algorithm:

$$\begin{aligned} {\left\{ \begin{array}{ll} f^0 = f_{ij} \quad for \ i,j \in Z \\ for \quad 1 \le k \le N \\ f^k_{ij} = f_{2i,2j}^{k-1}\\ g^k_{ij} = (g^{k1}_{ij}, g^{k2}_{ij},g^{k3}_{ij}) \\ g_{ij}^{k1} = f_{2i+1,2j}^{k-1} - \frac{1}{2} (f_{2i,2j}^{k-1}+{f}_{2i+2,2j}^{k-1}) \\ g_{ij}^{k2} = f_{2i,2j+1}^{k-1} - \frac{1}{2} (f_{2i,2j}^{k-1}+f_{2i+2,2j+2}^{k-1}) \\ g_{ij}^{k3} = f_{2i+1,2j+1}^{k-1} - \frac{1}{4}(f_{2i,2j}^{k-1}+f_{2i,2j+2}^{k-1}+ f_{2i+2,2j}^{k-1}+f_{2i+2,2j+2}^{k-1}) \end{array}\right. } \end{aligned}$$
(3)

CT-Regions are efficiently detected by FSDWT. It redistributes the image contained information which is mostly carried in the dominant coefficients. To facilitate the selection of these dominant coefficients in all sub-bands, we use mixed-scales representation which puts each coefficient at the point where its related basis function reaches its maximum. Therefore, a coherent image can be visually obtained with edges and textured regions [14, 15] formed by dominant coefficients. These regions are represented by a high density of dominant coefficients. They present more stability for any transformation and keep visual characteristics of the image [16].

Fig. 1.
figure 1

Original Image

Fig. 2.
figure 2

Mixed scales representation

Fig. 3.
figure 3

Dominant blocks using OTSU

3 Proposed Method

3.1 Watermark Embedding Procedure

Our proposed method is inspired from the one used by Taheri et al. [2] and Byun et al. [8]. In the watermark embedding procedure, the LSB planes of dominant blocks are replaced with the watermark data which is a logo combined with the dominant blocks singular values of the image to be marked. Singular values authenticating data are used since they are sensitive to any modification [8]. Furthermore, in our method the FSDWT gives good results in the term of perceptibility.

Dominant Blocks. We use the OTSU threshold [17] of mixed scales discrete wavelet transform coefficients with a given \(4\times 4\) block as the rule to detect dominant blocks. The dominant coefficient blocks are located on the image CT-Regions. The algorithm to detect dominant coefficients blocks involves the following steps:

  • Step 1: compute the image FSDWT and divide the obtained matrix into \(4\times 4\) blocks.

  • Step 2: calculate the local deviation \(\sigma \) of each block and compare it to the OTSU threshold \(\alpha \) of the matrix obtained in the previous step. If \(\sigma \ge \alpha \), then, the block is considered dominant, thus, this block contains a big density of coefficients which are related to image CT-Regions.

The original image used is the one presented in Fig. 1, then the Fig. 3 is obtained by assigning a gray color to the positions of the image’s pixels corresponding to the dominant blocks using OTSU threshold. The Table 1 shows different images OTSU threshold.

Table 1. OTSU threshold for different images

3.2 Watermark Construction

The watermark embedding process is illustrated in Fig. 4 and is discussed below:

  • Step 1: Convert the image to gray scale.

  • Step 2: Compute the gray scale image dominant blocks.

  • Step 3: Set P selected dominant blocks LSB’s plan to 0.

  • Step 4: Compute SVD of each new dominant block and convert the singular values of each block to 16 bits representation and gather all the obtained bits in a vector \(V_{sv}\).

  • Step 5: Convert each logo’s pixel to 8 bits representation and gather the obtained bits in a vector \(V_{logo}\).

  • Step 6: Apply XOR operation between the bits of \(V_{logo}\) and the bits of \(V_{sv}\), if the size of \(V_{logo}\) is smaller than the size of \(V_{sv}\) we use again the bits of \(V_{logo}\) to finish the rest of \(V_{sv}\) bits.

  • Step 7: Substitute the LSB’s plans of the image dominant blocks with the bits obtained in the step 6.

  • Step 8: Compute the inverse of FSDWT to obtain the watermarked image.

We use 8 bits representation of the logo instead of its 16 bits representation to increase the capacity of embedding.

3.3 Watermark Verification

The watermark verification is achieved by the following:

  • Step 1: Compute the FSDWT of the watermarked image.

  • Step 2: Calculate the dominant blocks of the matrix obtained in step 1.

  • Step 3: Convert, using a key P, the dominant blocks to their 8 bits representation.

  • Step 4: Repeat embedding process steps 2, 3, 4, 5 for the watermarked image.

  • Step 5: Apply XOR operation between the bits obtained in step 3 and the Watermark bits.

  • Step 6: Compare the bits obtained in step 5 (\(S'\)) with the bits obtained in step 4 (S).

The verification algorithm is illustrated in Fig. 5. If the watermarked image is modified, the vector S will not be equal to the vector \(S'\) then we can conclude that the image is not authentic.

Fig. 4.
figure 4

The embedding algorithm

Fig. 5.
figure 5

The extraction algorithm

4 Results and Analysis

4.1 Experimental Results

The results of the proposed fragile watermarking algorithm are presented in this section. We used C++ and OpenCV library to implement the algorithm. A gray image of size \(256\times 256\) and a gray mark of size \(10\times 10\) was used to validate the proposed approach, the Fig. 8 shows this mark. The image of Fig. 1 is used as an original image. The performance evaluation of the method is done with the perceptual transparency. The image quality is measured by PSNR (Peak signal to Noise Ratio), as the PSNR is bigger, as the quality of watermarked image is better. The Table 2 shows the PSNR and MSE (Mean Squared Error) of the watermarked images. The Figs. 6 and 7 show the original image and the watermarked image, the difference between the two images is unnoticeable.

PSNR is measured using the formula:

$$\begin{aligned} PSNR = 10*log_{10}\frac{255^2}{MSE} \end{aligned}$$
(4)

where MSE is the mean squared error between the original image I and the watermarked image WI. Images are of size \(h\times w\).

$$\begin{aligned} MSE = \frac{1}{h*w} \sum _{i=1}^{h} \sum _{j=1}^{w} (I(i,j)-WI(i,j))^2 \end{aligned}$$
(5)
Fig. 6.
figure 6

Original Image

Fig. 7.
figure 7

Watermarked image

Fig. 8.
figure 8

The logo used as a mark

4.2 Computational Complexity

The computational complexity of the proposed algorithm depends on the image dimensions and the number of dominant blocks.

We put: \(h\times w\) the size of the image, \(hW\times wW\) the size of the logo used in watermark generation, \(dim = min(h,w)\), P the number of selected dominant blocks used in the insertion of watermark, \(P_v\) the number of selected dominant blocks used to generate the watermark vector, lBlock the length of dominant block.

FSDWT complexity is of order:

$$\begin{aligned} C_{FSDWT} = \varTheta (h\times w) \end{aligned}$$
(6)

The dominant blocks computation complexity is of order:

$$\begin{aligned} C_{DB} = \varTheta (h\times w) \end{aligned}$$
(7)

In the embedding process, the pixels of watermark are converted to their 8 bits representation, so a vector of \(8\times hW\times wW\) bits is generated. Then a Xor operation is applied between this vector and the vector of 16 bits representation of singular values floored, this vector is of length \(4\times 16\times P_v\) bits. In our case we compute the SVD of \(\frac{hW\times wW}{8}\) dominant blocks of dimension \(lBlock\times lBlock\), so:

$$\begin{aligned} C_{svd}=\varTheta (\frac{hW\times wW}{8} \times lBlock^3) \end{aligned}$$
(8)

To set LSB’s plan of dominant blocks to 0, we compute their SVD and convert their singular values to 16 bits representation,then we need a complexity of:

$$\begin{aligned} C_{LSB} = \varTheta (\frac{hW\times wW}{8} \times lBlock^3) \end{aligned}$$
(9)

To insert the obtained bits in the LSB’s plan of dominant blocks we need a complexity of:

$$\begin{aligned} C_{inser} = \varTheta (P\times h\times w) \end{aligned}$$
(10)

The total running of embedding the watermark is:

$$\begin{aligned} C_{embed}= & {} C_{FSDWT} + C_{DB} + C_{LSB} + C_{inser} \\= & {} \varTheta (\frac{hW\times wW}{8}\times lBlock^3) + \varTheta (P\times h\times w) \nonumber \end{aligned}$$
(11)

Then we can simplify \(C_{embed}\) as:

$$\begin{aligned} C_{embed} =\varTheta (12\times \frac{hW\times wW}{8}) \nonumber + \varTheta (\frac{hW\times wW}{2} \times h\times w) =\varTheta (\frac{hW\times wW}{2} \times h\times w) \nonumber \end{aligned}$$

A comparison of the complexity of different methods with the complexity of our method using \(512\times 512\) and \(10\times 10\) mark is shown in the Table 3.

Table 2. PSNR and MSE of the watermarked images
Table 3. Complexity comparison

5 Conclusion

In this paper, we have presented a low complexity fragile watermarking method based on SVD and FSDWT to authenticate images. The watermarked image obtained is slightly changed and the method is fragile to any alteration attacks due to the usage of LSB’s plan and singular values in the process of embedding the watermark. The method gives good results in the term of complexity and can be used in applications requiring low complexity, more works should be done to detect the tamper regions in the case of attacks. Clarke, F., Ekeland, I.: Nonlinear oscillations and boundary-value problems for Hamiltonian systems. Arch. Rat. Mech. Anal. 78, 315–333 (1982)