1 Introduction

Data hiding techniques concentrates mainly on security, hiding capacity and good visual quality of stego image. There are many data hiding techniques, for instance, Least Significant Bit [1], Pixel Value Differencing [13], and Extraction Function with Modulus [4] method, Exploiting Modification Direction [16] method. Each method was proposed to improve the embedding capacity at the same time maintaining good visual quality. Xinpeng et al. [16] proposed efficient embedding method by EMD that achieves good PSNR and also maintains less changes in the cover image pixel so that it ensures the security. The highest embedding capacity achieved by this method was 1.16 bpp. With the aim of improving the embedding capacity, Chin-Feng Lee et al. [11] proposed an improved EMD method that achieves maximum embedding capacity of 393,216 for an image of size 256 × 256 with 8 - ary notation systems and the bits per pixel (bpp) was improved to 1.5. Ki-yun Jung et al. [4] proposed an improved EMD method that uses 5- ary notational system and achieved maximum rate of 2 bpp and PSNR of 47.95 dB. In the year 2012, Cheonchikkim [6] proposed data hiding method based on code book that uses (2n + x − 1)-ary notational system and the bpp was improved to an average of 3.4943 with n = 2 and x = 5 but the PSNR was reduced to 43.93 dB when compared with that of Ki-yun Jung et al. [4] method. It reveals that there is a tradeoff between PSNR and embedding rate. Multi-bit encoding function based high capacity data hiding scheme was proposed by Wen-Chung Kuo et al. [8] and they achieved highest embedding rate of 3.6 bpp. The extraction function uses a predefined coefficients ci‘s with the modulus operator 2nk + 1 and achieved maximum embedding capacity of 851,968 bits for a cover image of size 512 × 512. The method proposed by Wen-Chung Kuo et al. [8] motivated us to further improve the embedding capacity with good stego image quality. There are other data hiding techniques based histogram shifting [3],based on contrast enhancement [15] to attend the same problem of improving hiding rate.

The rest of the paper is organized as follows. Section II, a brief discussion on methods related to the research, Section III, the detailed description of proposed method, Section IV and V respectively experimental result and conclusion.

2 Related works

Algorithm 1

In the year 2006, Xinpeng Zhang et al. [16] introduced the Exploiting Modification Direction (EMD) method that uses n cover pixels to carry each secret digit which is in (2n + 1) - ary notational systems, the algorithm used in [16] as follows.

  1. Step 1:

    Compute the extraction function given in Eq. (1).

$$ f=\left[\sum \limits_{i=1}^n{x_i}^{\ast }i\right]\operatorname{mod}\left(2n+1\right) $$
(1)

Where * is the normal multiplication operation and not the convolution.

  1. Step 2:

    Embed the (2n + 1)-ary notational secret data into the uncompressed cover image. Let the secret digit be ‘d’, ‘g’ be the pixel value in cover image and ‘G’ be the pixel value of stego image of same size as that of cover image.

figure c
  1. Step 3:

    Use the extraction function given in Eq. (1), to extract the secret data from the pixels G. Embedding rate achieved by this method was 1.16 bpp.

Algorithm 2

With the aim of improving embedding capacity and maintaining the good visual quality, in the year 2009, Ki-Hyun Jung [4] introduced a new algorithm that can embed maximum of 2 bpp. The algorithm proposed in [11] is not using group of pixel instead it uses single pixel and modulo operation. The algorithm proposed in [11] as follows.

Let ‘g’ be the pixel value in a cover image and ‘G’ be the pixel value stego - image, after embedding operation.

  1. Step 1:

    For each pixel in cover image, ‘g’, Compute the extraction function f, given in Eq. (2) and choose the ‘x’ value, in the range [−(2n + 1), +(2n + 1)], such that ‘f’ is equal to ‘d’, where ‘d’ is the secret data.

$$ f\left(g+x\right)\operatorname{mod}\left(2n+1\right) $$
(2)
  1. Step 2:

    For the value of x computed in step 1, compute the stego-pixel G by adding x with g.

  2. Step 3:

    Use the extraction function, given in Eq. (2), to extract the secret data embedded in the pixels of stego image. This algorithm efficiently embeds the data in the cover image pixel and also maintains the good visual quality but the maximum embedding rate per pixel is limited to 2.

Algorithm 3

In the year 2013, Wen-Chung Kuoa et.al. [8] proposed a method for high capacity data hiding with acceptable stego image quality. The method uses predefined weight value ci and extraction function based on the algorithm proposed in [16]. The weights ci were used to compute the extraction function, calculated weights in [8] are, c1 = 1, c2 = 9, c3 = 73, c4 = 585 for the value of k = 3 and n = 4,where ‘k’ indicates number of embedding bits, and ‘n’ indicates number of pixel in a group of cover image. While computing the extraction function, a group of four pixels were considered. The algorithm proposed in [8] as follows

  1. Step 1:

    Compute the extraction function using the Eq. (3)

$$ f=\left[\sum \limits_{i=1}^n\left({c_i}^{\ast }{g}_i\right)\right]\operatorname{mod}{2}^{nk+1} $$
(3)

Where * indicates normal multiplication operation between weight value and pixel from cover image and not the convolution operation.

  1. Step 2:

    Transform the secrete value. The transformation of each secret value {snk} ∈ {0, 1} is done by sum of product.

  2. Step 3:

    Compute the difference ‘D’ between ‘f’ and secret value ‘s’ using the equation given below

$$ D=\left(s-f\right)\operatorname{mod}{2}^{nk+1} $$
  1. Step 4:

    Embedding the secret data in to cover image as follows,

figure d

to perform step 4, a group of n = 4 pixels were considered and each pixel in a group was adjusted using the above algorithm and the stego image Is was constructed. Each group, consisting of four pixel, can embed 13 secret bits, therefore, embedding rate is calculated as, 13/4 = 3.25 bpp. For an image of size 512 × 512, total number of secret bits can be embedded is 512*512*3.25 = 8,51,968 but the PSNR is reduced to an average of 37.25 db.

3 Proposed method

To improve the embedding rate, we propose a method that not only enhances the embedding capacity but also maintains the good visual quality of stego image, that is, the PSNR of the stego image is maintained more than 30 db. In our proposed method, the secret data is converted to n2-ary notational system. Where n- is number of binary digits considered to represent secret data in n2- ary notational systems. In [8, 16], while computing the extraction function, the variable n represents number of pixels in a group of cover image. But in our proposed method the same variable n is used to represents number binary digits considered to convert, secrete binary digits, to n2-ary notational systems. The proposed algorithm, given in detail, as follows

  1. Step 1:

    Convert the secrete information in binary digits in to n2-ary notational system before applying the algorithm, by considering n = 4 bit at a time and represent the secret data as ‘d’.

  2. Step 2:

    For each pixel value ‘g’ in a cover image and for a secret value ‘d’ do the following

for −⌊n2/2⌋ ≤ x ≤ ⌊n2/2⌋

$$ f=\left(g+x\right)\operatorname{mod}\;{n}^2 $$
(4)

if f =  = d

$$ G=g+x $$
(5)
figure e

Where n- is number of binary digits considered to represent secret value in n2- ary notational systems and ⌊⋅⌋ is the flooring operation

  1. Step 3:

    All the embedded values (informations), from the stego - image with adjusted pixel value G, are extracted by applying the extraction function, given in eq. (6), to each value of ‘G’. that is,

figure f

The extracted values f1 are the embedded information in the pixels g.

The major advantage with our proposed n2-ary notational system of secrete digit representation is that we achieved flexibility to scale down or scale up our modulo operator, that is, when the PSNR in dB is the major consideration n can be kept as 2 or 3, that is scaling down ‘n’ to 2 or 3, on the other hand when the higher embedding rate is the major requirement then n can be scaled up to 4 so that we can achieve higher hiding rate than in [8].

4 Experimental result and performance discussion

We tested our proposed method with standard gray scale image of size 512 × 512, all the images were taken from USC-SIPI image data base http://sipi.usc.edu/database/.

PSNR and SSIM are the two performance metrics used to analysis the performance of proposed method. The peak signal-to-noise ratio is calculated between the cover image and the stego - image. (Fig. 1).

$$ {\displaystyle \begin{array}{l} PSNR=10{\log}_{10}\left(\frac{255^2}{MSE}\right) dB\\ {} MSE=\frac{1}{M\times N}\sum \limits_{\mathrm{l}=1}^N\sum \limits_{j=1}^M{\left({g}_{ij}-{G}_{ij}\right)}^2\end{array}} $$

Where,

MxN:

represents number of rows and columns in cover image respectively gijand Gij pixel value in cover image and stego - image respectively

Fig. 1
figure 1

Experimental result Original image (left), Stego- Image (right)

Structural Similarity Index (SSIM) is an another metric for measuring image quality that calculates the Structural similarity Index (SSIM) value for Cover image, with the stego –image. Comparison is made between proposed and ref. [4], since both method use same number of binary digits, that is n = 2, to create secret value but uses different notational system. In Table 1, from the columns of percentage increase in PSNR and percentage increase in SSIM, it is obvious that proposed method has considerable percentage of increase in PSNR and SSIM.

Table 1 Comparison of Proposed Method with Ref [4]

Another comparison is made in terms of embedding capacity, Table 2. The observed embedding capacity of proposed method is compared with methods in [4, 16] and [8]. The proposed method achieves significant embedding capacity that is 85.48% greater than that of [16], 50% greater than that of [4] and 18.75% greater than that of [8]. From the comparison Table 2, the observation is that there is always a tradeoff between embedding capacity and PSNR.

Table 2 Comparison of proposed method with ref. [4, 16] and [8] in terms of Embedding Capacity

The secret information which is embedded in the cover image is imperceptible when the PSNR is higher than 30 dB. To ensure that PSNR and SSIM is calculated with n = 4 for different ranges of randomly generated data. From Table 3, it is obvious that the proposed method not only ensure the imperceptibility and also ensure the consistency for all range of secret message.

Table 3 Verification of Consistency of proposed method for different ranges of randomly generated secret message with n = 4

The bar chart, Fig. 2, shows that proposed method achieves the highest embedding capacity of 10,48,576 bits in terms of bit rate 4 bpp, which is 50% and 18.75% higher than that of the algorithm proposed in [4, 8] respectively.

Fig. 2
figure 2

Comparison of Embedding capacity

Visual quality of the proposed method with n = 2 bits and n = 4 bits was verified, Fig. 1, by considering five standard images, and compared with experimental result of ref. [4]. The experimental result shows that proposed method has good visual quality.  Table.4 gives the overall comparison between the proposed and ref. [4, 16] and [8].

Table 4 Comparison of proposed with [4, 16] and [8]

For the simulation of our proposed method as well as the ref. [4, 8] we used the HP Pavilion 15 Notebook PC with Windows 10 home 64-bit operating system having the following specification intel(R) Core(TM) i5-4210 CPU @1.70GHz and 12 GB RAM. Simulation tool used: MATLAB, Version: 8.4.0.150421 (R2014b).

5 Conclusion

We have proposed an improved high capacity data hiding method that uses n2-ary notational system to represent secret data and the desired value of ‘x’ to adjust the pixel of cover image is chosen within the restricted limit −⌊n2/2⌋ ≤  ×  ≤ ⌊n2/2⌋ that enable us to achieve good quality stego-image for n = 4. Wen-Chung Kuo et al. [8] achieved maximum embedding capacity of 8,51,968 bits, for gray scale image of size 512 × 512, at the cost of an average PSNR of 37.24 dB and we achieved embedding capacity of 10,48,576 bits for an image of size 512 × 512 at cost of an average PSNR of 32.62708 dB which is 18.75% higher than Wen-Chung Kuo et al. [8] method and still we are maintaining good visual quality of stego-image. Based on our experimental result and ref. [8], there is always a tradeoff between the hiding capacity and stego-image quality. Though we achieved highest embedding capacity, still there is a room to improve both bpp and PSNR, improvement in the proposed work will be our future work.