1 Introduction

Digital watermarking is a technique that allows for embedding additional information in multimedia objects. A watermark can be used to hide data in a signal in a way that it is not perceived by a human eye, but may be retrieved with use of a dedicated algorithm. This technology can be used in copyright protection, hidden communication, and many other applications.

Watermarking systems consist of two entities. The first one is an encoder which embeds host signal with some additional information. The second one, called decoder, is able to detect the watermark, and retrieve the hidden information. There are many data embedding techniques. Two main classes of watermarking schemes are quantization-based techniques [2] and spread spectrum (SS) techniques [4]. The latter allows for spreading the information over the entire host signal. The watermark may be simply added to the host signal (additive SS [3]) or it may multiply the signal (multiplicative SS [8]). Usually it is assumed that the original host signal is not known at the decoder side (blind decoding) and Pearson correlation is used to detect the watermarks. Such a decoding scheme is vulnerable to any correlations between the host signal and the embedded information. Malvar and Florencio [6] proposed an improved spread spectrum (ISS), which reduces the negative influence of the above-mentioned correlation on the decoding performance. In ISS, the embedding strength depends on the correlation between the watermark and the work it is embedded into. Valizadeh and Wang [9] proposed another method—correlation-and-bit-aware spread spectrum that additionally modifies watermark embedding strength with respect to the embedded bit sign and the correlation sign.

In this paper we present real-data evaluation of the performance of the correlation-and-bit-aware spread spectrum. The distribution of pixels’ values of real images significantly dithers from Gaussian distribution. The dither is even more severe when we consider DCT coefficients instead of pixels’ values. Thus, we decided to evaluate the performance of those above-mentioned algorithms in the presence of JPEG compression and additive Gaussian noise. The performed tests confirmed the robustness of the considered algorithms against JPEG compression and addition of Gaussian noise and allowed to estimate some sub-optimal configurations of algorithms’ parameters.

The paper is a extended version of a conference paper [5]. The remaining part of this paper is organized as follows. Section 2 describes the evaluated algorithm. Evaluation methodology is presented in Section 3, and the results are shown in Section 4. Section 5 concludes and gives a short discussion.

2 Correlation-and-bit-aware spread spectrum

The concept of correlation-and-bit-aware spread spectrum was proposed and is described in details in Valizadeh and Wang [9]. To make this paper as self-contained as possible, we introduce some fundamental information and equations related to that algorithm.

In traditional spread spectrum, a message bit b represented by a bipolar value { − 1, + 1} is embedded with a strength A > 0 into a host signal (e.g. image represented by a vector).

The information bit that is embedded takes a value from binary set { − 1, + 1}. Every bit is spread over the host signal using security key \(s = [s_1, s_2, \ldots, s_N]^T\), where s i is taken randomly from binary set { − 1, + 1}. The watermarked signal is then described by the following equation:

$$ r_i = x_i + s_iAb, \quad i=1, 2, \ldots, N. $$
(1)

At the decoder side, the information bit is estimated as a sign of Pearson correlation coefficient between the received signal and the security key:

$$ b = \text{sign}(z) $$
(2)

where:

$$ z = \frac{\sum_{i=1}^{N} (r_i-\bar{r}) (s_i-\bar{s})}{\sqrt{\sum_{i=1}^{N} ({r_i-\bar{r}})^2 \sum_{i=1}^{N} ({s_i-\bar{s}})^2 }} $$
(3)

An interference between the host signal and the embedded bit has a noise-like effect at the decoder side and causes errors during decoding. One of possible methods to reduce the interference was proposed by Malvar and Florencio [6]. In the ISS method they introduced a free parameter λ h that modulates the embedding strength in the presence of interference between signals. Malvar and Flornecio shown that optimal λ h for Gaussian signals is 1/N, where N is the size of the signal sample. For convenience, we decided to use λ = λ h N. The interference is calculated here as a dot product of the signals. The watermarked signal is obtained as follows:

$$ r = x + sAb -\lambda {ss^Tx}/{N} $$
(4)

The idea of reducing the distortions from interference between the host and the embedded signals was extended by Valizadeh and Wang [9]. At first they proposed the correlation-aware spread spectrum (CASS) scheme where a message bit is inserted into the host signal with two different amplitudes: A 1, A 2: A 1 < A 2. The amplitude choice depends on the sign of the correlation between the key signal s and the host signal x, and bit b. If the correlation sign is equal to b, smaller amplitude is chosen:

$$ r= \begin{cases} x+sA_1, & \text{if } s^Tx\geq 0, b=+1 \\ x-sA_2, & \text{if } s^Tx\geq 0, b=-1 \\ x-sA_1, & \text{if } s^Tx < 0, b=-1 \\ x+sA_2, & \text{if } s^Tx < 0, b=+1 \\ \end{cases} $$
(5)

In the CAISS method Valizadeh and Wang combined CASS with ISS. Again, theoretically optimal λ h is 1/N for Gaussian signals and again we use λ = λ h N for convenience:

$$ r= \begin{cases} x+sA_1, & \text{if } s^Tx\geq 0, b=+1 \\ x-sA_2 - \lambda {s(s^Tx)}/{N}, & \text{if } s^Tx\geq 0, b=-1 \\ x-sA_1, & \text{if } s^Tx < 0, b=-1 \\ x+sA_2 - \lambda {s(s^Tx)}/{N}, & \text{if } s^Tx < 0, b=+1 \\ \end{cases} $$
(6)

3 Evaluation methodology

The reported results were obtained on the BOWS2 data-set [1] containing 10,000 images. The processing workflow of our experiments is illustrated in Fig. 1.

Fig. 1
figure 1

The processing workflow of the proposed experiment

Due to the size of the data set, selected experiments were performed on n used selected images. The procedure for choosing the images was as follows: first we sorted all images with respect to their pixel value variances and then picked every m − th image where m = 10 000/n used. We excluded from our analysis 3 vastly overexposed images: 1126.pgm, 1258.pgm and 1478.pgm. In CAISS the embedding strength depends on correlation between the watermark and the host signal. This implies that for the same embedding parameters, the distortion depends on the content. This property produces visible artifacts while embedding watermarks block-wise in the spatial domain. Though the overall distortion of the image may be low, some of the blocks are distorted much more than others and thus resulting image is not acceptable. The problem is clearly illustrated in Fig. 2. It shows some differences between embedding watermark with use of CAISS in spatial and DCT domain. In Fig. 2b all of 800 embedded bits were correctly decoded after JPEG compression with quality Q = 75 while there were 12 erroneously decoded bits in Fig. 2c though only 256 bits were embedded.

Fig. 2
figure 2

CAISS watermarking in DCT and spatial domain. PSNR between the cover image and watermarked image is equal 36.99 dB in both cases. The left part of Fig. 2d corresponds to a DCT domain, whilst right part to the spatial domain. The contrast of an image is enhanced in order to emphasize the difference between the watermarking inflicted artifacts

One may encounter similar issue while embedding watermark in block-wise DCT spectrum. To avoid this problem, we embedded the watermark in the full image DCT spectrum. After the DCT transformation of the image, we excluded high- and low-frequency coefficients defined by first K/2 and last K/2 ones in the zig-zag order. The remaining ones were randomly permuted and divided into blocks of length L. The random permutation assures us that each and every block will follow the same distribution. Since the watermark is added to the signal and we operate on 8-bit images, the watermarking process may lead to a saturation of some of the pixels. In order to reduce this problem we restrict the intensity range of input images to the range of 5 to 250. Thus if the amplitude of the watermark pattern does not exceed 5, saturation is avoided.

We noticed that the dependency between the distortion and the content is a cause of wide, non-Gaussian PSNR distribution for fixed parameters values. We modified embedding strength by changing A1 and A2, preserving A 1/A 2 ratio to keep PSNR between the cover image and watermarked image in desired range. The modification allows us to compare BER (i.e. the fraction of erroneously decoded bits) of different algorithms without the problem of different PSNR distributions.

4 Results

In [9], the authors simulated theoretical performance of CAISS using artificial Gaussian signals. Real images usually significantly dither from Gaussian distribution. We use DCT coefficients as a host signal for above-mentioned reason, thus we are dealing with values that are approximated by Laplacian probability distribution functions [7].

4.1 JPEG compression

We started our evaluation with the assessment of BER performance under medium JPEG compression (Q = 75) while varying λ and the A 1/A 2 ratio. The results are shown in Fig. 3. Every value was obtained using 100–10,000 images (depending on BER—more images were needed for lower BER to obtain tight confidence intervals). 800 bits were embedded in a single image—one bit in one block of size L = 256. The images were of size 512×512 px. Thus, for each image we left K = 57344 (21.9 %) DCT coefficients unmodified. After embedding, every image was saved as JPEG with quality level Q = 75, and the watermark was decoded afterwards. For \(A_1/A_2 \lesssim{0.2}\), CAISS behaves worse than traditional spread spectrum regardless of λ. This effect is clearly visible in Fig. 4 where we plotted the results for all tested λ. For clarity, the confidence intervals are omitted. BER decreases rapidly with increasing A 1/A 2. For small λ, the decrease stops around A 1/A 2 ≈ 0.4. With increase of λ the minimum shifts towards larger A 1/A 2 values. Also the minimum BER drops quickly. Finally, for λ ≈ 2 and A 1/A 2 ≈ 0.85, BER is a few thousand times smaller than for traditional spread spectrum. Further increase of λ or A 1/A 2 ratio neither improves, nor deteriorates the BER performance.

Fig. 3
figure 3

BER with 95 % confidence intervals vs. A 1 to A 2 ratio for different λ values in CAISS, PSNR fixed to 37.0±0.3 dB, JPEG quality Q = 75, 800 bits embedded into each image

Fig. 4
figure 4

Comparison of a performance of spread spectrum and CAISS for various λ values, and PSNR fixed to 37 dB. Each image was embedded with 800 bits and compressed with JPEG quality Q = 75 before decoding

Next we compared CAISS with ISS. To be fair in our comparison, we used best λ for ISS scheme. As previously, we picked 100–10,000 images for every single test and embedded 800 bits in each of the images. The results are presented in Fig. 5. Increasing λ makes BER drop quickly and the deep minimum is definitely present around λ ≈ 1.5. The ISS’s performance is clearly worse than that of CAISS with properly chosen parameters. The difference between the performance of those two methods is about twice as large as the width of 95 % confidence intervals of BER. Selected BERs for best parameters choice are presented in Table 1. All of those results were obtained with use of all 9,997 images (as indicated earlier, three were excluded). The results show the BER performance of CAISS and ISS with the parameters chosen sub-optimally for medium (Q = 75) JPEG compression. For other compression levels one may find the parameters that result in better performance. We did not examine the dependency between the optimal values of CAISS (or ISS) parameters and the level of JPEG compression (Q). It is clear that even with sub-optimal choice of CAISS parameters, the method gives a few times smaller BER than ISS. The improvement, as compared with traditional spread spectrum, is close to as much as four orders of magnitude. However one need to be aware that this results holds for JPEG compression quality Q = 75 and the results obtained for other Q values will presumably be different. Especially, those settings of CAISS (and ISS) that are sub-optimal for the considered case will rather not be sub-optimal for other compression quality levels. The chosen ISS and CAISS settings were only sub-optimal and it is probably possible to get slightly lower BER for different parameters settings for both considered methods.

Fig. 5
figure 5

BER vs. λ in ISS scheme, PSNR fixed to 37.0±0.3 dB, JPEG quality Q = 75 and 800 bits embedded into each image

Table 1 Comparison of spread spectrum watermarking schemes

At last, we evaluated the BER behavior of a fixed configuration of CAISS and ISS under changing JPEG quality level. The results are shown in Fig. 6. Note that both CAISS and ISS with the considered settings significantly outperform traditional spread spectrum. For images with strong compression (Q = 50), CAISS and ISS performance is similar and BER is a few times smaller than with use of traditional spread spectrum. As the JPEG quality grows, the differences between the BER performance of considered embedding techniques also increase. This increase is significant as for medium JPEG compression (Q = 75) BER performance of CAISS is almost 4 orders of magnitude better than for the traditional spread spectrum. It should also be noted that BER of CAISS is a few times smaller than for ISS. For JPEG quality levels larger than 75 (for CAISS) and 80 for ISS we did not observe any bit errors, hence BER was significantly smaller than 10 − 6. It should be also noted that the parameters of CAISS and ISS used in this test were earlier found as nearly optimal for JPEG compression with quality level Q = 75. It is possible that one may get better results for other compression levels with use of different CAISS and ISS parameters’ values.

Fig. 6
figure 6

Comparison of the performance in the presence of JPEG compression. Each image was embedded with 800 bits of watermark. BERs are plotted with 95 % confidence intervals

4.2 Additive Gaussian noise

Another type of attack that resembles some other popular attacks is an addition of Gaussian noise. We have evaluated that property in the same manner as the robustness for JPEG compression. We started our evaluation by measuring BER performance while varying λ and A 1/A 2 for a fixed watermark to noise ratio (WNR) of −15 dB. The results are shown in Fig. 7. For clarity, the confidence intervals are not shown in the left plot, however because of large numbers of erroneously decoded bits, those intervals are rather tight (the width of each of them is smaller than 2×10 − 4) and they would not bring much information to the plot.

Fig. 7
figure 7

a Presents BER vs. A 1/A 2 for different λ values in CAISS scheme obtained for 500 images, PSNR fixed to 37.0 ± 0.3 dB, Gaussian noise added with WNR = − 15 dB, 800 bits embedded into each image. b Shows BERs with 95 % confidence intervals for two λ values that got best performance on the left part. The BER values were obtained with use of 2,000 images, PSNR fixed to 37.0±0.3 dB, Gaussian noise added with WNR = − 14 dB, 800 bits embedded into each image

Again, it is clear that the choice of A 1/A 2 is crucial for the performance of the considered algorithm. In contrast to the previous experiment, varying λ does not bring much difference in BER. The most interesting observation is the fact that for the majority of possible parameters’ choices, CAISS behaves worse than traditional spread spectrum technique. However, with optimally chosen parameters, CAISS gives BER over two times better than traditional spread spectrum. We found BER = 0.0031 ± 0.0002 for traditional spread spectrum and minimum BER = 0.0013 ± 0.0002 for two configurations of CAISS: with λ = 1.0, A1/A2 = 0.90 and λ = 1.5, A1/A2 = 1.00.

Further, we decided to compare BER of CAISS, ISS and SS for various amplitudes of Gaussian noise. Again, to be fair in our comparison, first we decided to find optimal λ value for ISS scheme. BER for ISS with the presence of Gaussian noise and WNR = −15 dB is shown in Fig. 8. The optimal λ value for ISS scheme is 1.0 in this scenario, although the BER does not vary much and is not much lower than derived earlier 0.0031 ± 0.0002 for traditional spread spectrum technique. The performance dependency on the amplitude of additive Gaussian noise is presented in Fig. 9 Again all of the presented values were obtained for images with PSNR=37 dB after watermark embedding. In the presence of the Gaussian noise and WNR= −15 dB, both CAISS and ISS deliver only 2–3 times smaller BER than traditional spread spectrum. With decreasing noise strength, the superiority of the improved techniques quickly becomes striking. For WNR>−11 dB we could not detect any erroneously decoded bits neither for CAISS nor for ISS. Hence BER must have been lower than ~10 − 6. For the same noise level, BER was larger than 10 − 4 in a scenario with traditional spread spectrum watermark embedding. The most interesting thing here is the fact, that ISS performance is virtually the same as performance of CAISS. That is especially intriguing that for JPEG compression CAISS delivered significantly lower BER than ISS for a wide range of compression levels.

Fig. 8
figure 8

BER performance of ISS watermarking method in presence of Gaussian noise with WNR= − 15 dB. Each image was embedded with 800 bits of watermark

Fig. 9
figure 9

BER performance of considered watermarking techniques in presence of additive Gaussian noise. Each image was embedded with 800 bits of watermark. BERs are plotted with 95 % confidence intervals

4.3 Image scaling

Image scaling is another attack representing a group of geometric attacks. Additionally its influence on an image is similar to the effect introduced by average filtering. We have evaluated that property in the same manner as the robustness for JPEG compression and additive Gaussian noise. In that experiment every watermarked image was first scaled down (i.e. scale factor< 1) and then rescaled to the original size before decoding. The results are presented in Fig. 10. The results presented for CAISS and ISS were obtained for parameters that were found to be near optimal in presence of scaling with a scaling factor of 0.5 (λ = 2.0, A1/A2 = 0.70 for CAISS and λ = 1.8 for ISS). The obtained results are presented in Fig. 10. Again all of the presented values were obtained for images with PSNR = 37 dB after embedding 800 bits of watermark into each image. For small scales all of the considered schemes behaves rather poorly with BER around 5 % for images downsized to half of an original size (i.e. scaling factor of 0.5). For such a scaling factor, we found BER equal to 4.69 ± 0.15 % for CAISS, 5.08 ± 0.22 % for ISS and 6.89 ± 0.18 % for traditional spread spectrum. The reported uncertainties are 95 % confidence intervals. Hence, CAISS gave the results that were statistically significantly better than ISS and SS though the improvement was rather minor. The performance improves quickly with increasing scale factor. For scale factor larger than 0.9, both ISS and CAISS show BER around 10 − 6 or smaller, almost 3 orders of magnitude better than traditional spread spectrum. However, one may notice that for intermediate scaling factor values, CAISS seems to behave statistically significantly worse than ISS. That may come from the fact that the parameters of CAISS and ISS were set to be nearly optimal for scaling factor of 0.5 and not necessarily optimal for different values of the scaling factor. It may be possible to find more universal parameters configurations however that is out of scope of this paper.

Fig. 10
figure 10

BER performance of various spread spectrum algorithms in presence of image scaling. Each image was embedded with 800 bits of watermark. BERs are plotted with 95 % confidence intervals

5 Conclusions

In this paper the performance of correlation-and-bit-aware spread spectrum (CAISS) watermarking was compared with that of traditional, and the improved spread spectrum. The evaluation was carried out in DCT domain. Thus, we were dealing with non-Gaussian signals. The obtained results indicate that the considered technique is robust against medium JPEG compression and outperforms traditional spread spectrum technique by more than three orders of magnitude in terms of BER, assuming the parameters are chosen properly. At the same time CAISS outperforms ISS by a factor of about two. For JPEG quality level as low as Q = 55 we obtained BER considerably better than 0.01 while embedding 800 bits into an images of size 512×512. The robustness of CAISS against additive Gaussian noise was also evaluated and compared to ISS and traditional spread spectrum. Both CAISS and ISS show much lower BERs than traditional spread spectrum, and the difference between improved techniques and SS quickly grows with the decrease of noise level. Although in a case of JPEG compression CAISS significantly outperforms ISS, such a dependency is no longer apparent in the presence of Gaussian noise and after rescaling.

All of our tests were performed with PSNR between the watermarked image and the cover image fixed at the level of 37.0±0.3 dB, thus we confirmed that this technique should be considered the best choice for watermarking applications where spread spectrum techniques are applicable especially in applications were JPEG compression is expected.

It should be noted that we did not evaluate the dependency between the optimal parameters choice and the quality of JPEG compression nor the amplitude of Gaussian noise nor scaling factor in rescaling attack. Thus, for JPEG compression quality Q different than 75, Gaussian noise WNR different than −15 dB and scaling factor different than 0.5, one may possibly find better parameters of CAISS (or ISS) than those reported in this article.