1 Introduction

Image steganography is used to hide secret information within an image [4]. Two major approaches used are reversible and irreversible image steganography.

In reversible image steganography [1, 912, 16, 17, 19, 23, 27, 28, 33] the cover image can be reconstructed accurately while extracting the payload from the stego image. The stego image is the image obtained after embedding the secret message in cover image. Most of the existing reversible image steganography schemes are very complex and achieve small embedding capacity [1, 13, 26, 27]. Embedding capacity can be increased by adaptive embedding of payload near sharper edges. More bits can be accommodated in sharper edges using adaptive selection.

Irreversible image steganography schemes achieve higher embedding capacity with minimum computation time. Detection of hidden information in stego image resulting from irreversible stego system is straightforward. Many steganalytic schemes [7, 10, 14] have been proposed in literature, which can accurately detect the presence of secret information embedded using irreversible image steganography. These methods are prone to easy detection of the embedded information. Even though irreversible image steganography schemes achieve low computation time, low level of security degrades the performance of such system. Encryption of secret information could be one of the solutions. However, inclusion of encryption spoils the use of steganography as the fundamental need of image steganography is to eradicate the suspicion of hidden data.

In this paper an adaptive image steganography technique which bears high embedding rate is proposed. Adaptive nature of the embedding process increases the embedding rate without increasing the detectability. Binary payload is embedded in edge area of a grayscale cover image. Grayscales of the cover image are used to embed binary payload in selected area based on some threshold which determines the number of bits to be embedded.

2 Related work

There are many reversible image steganography schemes proposed in the literature which employ encryption to achieve higher level of security. Wu et al. proposed a reversible image steganography scheme [32], where the secret message is encrypted using either AES or DES. The encrypted bits are then embedded in a code tree computed from the frequency of absolute error values. Error values are computed using MED predictor [32].

Scheme proposed in [29] generates an intermediate image by converting a pair of pixel values of secret image into four hexadecimal values and then four hexadecimal values are converted to three decimal values. This intermediate image is then distributed and embedded into n cover images. To recover the secret image one has to gather all n stego images. The steganography scheme used in this method is straightforward. Detection of hidden information is so trivial that any steganalysis scheme can detect the presence of hidden information with more than 80 % accuracy.

A data hiding based on side-match vector quantization (SMVQ) has been proposed by Chang et al. [3]. For each block of cover image codeword is generated using SMVQ. These codeword are used to embed the secret data. If secret bit is equal to 0, the closest codeword generated by SMVQ is encoded. For a secret bit 1 the approximation of the first closest codeword and the second closest codeword is computed to replace the closest codeword. Even though the proposed scheme effectively encodes the secret message, for a large payload the size of transformed index table can increase the space complexity of the steganography system. Moreover, the embedding capacity of the scheme is low compared to other existing image steganography schemes.

High embedding rate of irreversible image steganography draws researchers to work in this area. Level of security is a concern in irreversible image steganography. Easy detection of hidden data is possible with some powerful steganalytic tools.

Least Significant Bit (LSB) replacement is the most common irreversible steganography scheme. The binary bits of the secret data are hidden in the cover image by replacing the LSBs of the cover image with the secret binary bits [31]. The method is so trivial that an attacker can easily detect the presence of hidden information.

An improvement over LSB is achieved in LSB matching (LSBM) where a +1 or −1 is added to the pixel of the cover image if the corresponding LSB matches with the secret bit. In LSBM as the probability of increasing or decreasing the number of odd or even pixel is same, the usual asymmetry introduced in LSB is avoided. Steganalytic schemes which work for LSB replacement fails to detect the presence of secret message, if LSBM is used.

Modification rate is further reduced in LSB matching revisited (LSBMR) [11, 22]. A pair of pixel is used to embed the secret bits. A secret bit is added to the first pixel of the pair and another bit is embedded using the relationship of the pair of pixels. As only one pixel of the pair is modified to embed two secret bits the modification rate reduces to 0.375 bit per pixel (bpp) [22]. General asymmetry introduced in LSB does not exist in LSBMR hence detection of the presence of secret bits is difficult. There are some edge adaptive methods proposed in literature such as hide behind corner (HBC) [8]. Edge adaptive irreversible image steganography proposed by Lou et al. [20] embeds secret data adaptively in the selected regions of the cover image. Method proposed in [20] extends LSBMR [22] and embeds secret data in edge areas of the cover image baring smoother areas. To embed the secret data cover image is first rotated using a specific key. Edge areas of the modified cover are identified to embed the secret information adaptively. This method is highly secure as percentage accuracy of detection of most of the statistical analysis used on the stego images, generated using the method proposed by Luo et al. [20], is less. The method proposed in [20] identifies an edge as the difference between two consecutive pixels. Data is embedded only in those areas where a vertical edge exists. A single bit is embedded in two consecutive pixels. Even though this method selects edge area adaptively it is done using a single threshold value. Hence the method proposed in [20] is not at all adaptive when it comes to embedding. The proposed method tries to identify vertical as well as horizontal edges to embed the secret data, which intern increases the embedding capacity of the proposed scheme. MMED effectively predicts horizontal as well as vertical edges. Edges are classified into three categories using three levels of threshold. More bits are embedded in sharper edges, which again increase the embedding rate. Result analysis shows that the proposed method achieves better results with respect to embedding rate and lesser percentage accuracy of detection compared to most of the state of the art steganography methods.

3 Proposed method

Proposed method has two major phases; embedding and recovery as shown in Fig. 1. To embed the secret message S, MMED predictor is used to compute the edge image from the cover image. Region selector divides the edge image into nonoverlapping Ζ × Ζ blocks. Predicted error greater than a particular threshold, are selected from each block for capacity estimation. Capacity of each block is measured by computing the number of bits that can be embedded into a particular block. In each block for a particular predictive error one, two or three bits of the secret message can be embedded into the corresponding grayscale of the original cover depending on the threshold. Capacity is computed by adding the number of bits that can be embedded in a particular grayscale of a block. If the capacity of the block is not enough to accommodate the secret data region selector re-computes the region for embedding. There are certain additional information required for extraction of the secret data such as block size (Z) and threshold (T k ) which are embedded in those regions which are not used for data embedding.

Fig. 1
figure 1

Flow of proposed scheme. a Embedding process. b Extraction process

To extract the secret message edge image is computed from the cover image and auxiliary information such as threshold and block size are extracted from the stego image. Based on threshold and block size the regions containing the secret information are identified. Extraction process then extracts secret information from the selected regions.

3.1 Embedding process

The cover image C of size m × n is first converted to predictive error image of same size using MMED predictor. A template shown in Fig. 2a is used to compute the predictive error image. Predictive error image is computed as

Fig. 2
figure 2

a Template for MMED, b Sample sub image and c Corresponding MMED predictive error image

$$ MMED(x)=\left\{\begin{array}{cc}\hfill \left|x- \min \left(b,c\right)\right|\hfill & \hfill if\kern0.5em a\ge \max \left(b,c\right)\hfill \\ {}\hfill \left|x- \max \left(\mathrm{b},\mathrm{c}\right)\right|\hfill & \hfill if\kern0.5em a\le \min \left(b,c\right)\hfill \\ {}\hfill \left|x-\left(b+c-a\right)\right|\hfill & \hfill \mathrm{otherwise}\hfill \end{array}\right. $$

A sample sub image is shown in Fig. 2b and its corresponding MMED predictive error image is shown in Fig. 2c. Shaded pixel in Fig. 2b is has a = 1, b = 4 and c = 7 and 1 ≤ min (4,7), hence the corresponding MMED value is MMED(3) = |3 − max(4, 7)| = 4. This MMED value corresponding to 3 is the shaded pixel shown in Fig. 2c. It is evident from Fig. 2c that the predictive error image contains the horizontal as well as vertical edges of the sample sub image.

Predictive error image computed using MMED predictor is divided into non-overlapping blocks of Ζ × Ζ pixels.

Secret message S is divided into three subparts namely S 1 , S 2 and S 3 such that |S 1| = 60 percent of |S|, |S 2| = 30 percent of |S|, |S 3| = 10 percent of |S| and |S| = |S 1| + |S 2| + |S 3|. Threshold T k for region selector is computed using a threshold selection parameter p k . M(p k ) is the set of MMED values defined as M(p k ) = {MMED(x ij )|p k  ≤ MMED(x ij ) < 23 + k, ∀ x ij  ∈ C} where k ∈ {1, 2, 3}. Threshold parameters are defined as p 1 ∈ {0, 1, 2 … 15}, p 2 ∈ {16, 17, 18 … 31} and p 3 ∈ {32, 33, 34 … 63}. Threshold values are computed using threshold selection parameters as \( {T}_k=\underset{p_k}{ \arg \max}\left\{\left|M\left({p}_k\right)\right|\ge \left|{S}_k\right|\right\} \) where k ∈ {1, 2, 3}.

MMED predictor computes the edge areas for a given image. Relationship amongst the neighboring pixels is used to identify the edge areas. Pixels belonging to sharper edges accommodate more secret bits whereas pixels belonging to smoother edges used to embed least number of bits. As number of pixels belonging to smoother areas is more, embedding capacity can still be maintained. Threshold T k is used to determine whether a pixel in the cover image belongs to sharper edge or smoother edge. Number of bits embedded in a particular pixel x ij  ∈ C depends upon T k . Embedding is performed on cover image C as follows

  1. Case1:

    (MMED(x ij ) ≥ T 1 & MMED(x ij ) < T 2)

    LSB 1(x ij ) = LSB 2(x ij ) ⊕ s t1 where LSB 1(x ij ) and LSB 2(x ij ) represents Least Significant Bit (LSB) and second LSB of x ij respectively. s t1 is the tth bit in S 1 where t ∈ {1, 2, ….. |S 1|}. “⊕” is X-OR operation.

  2. Case2:

    (MMED(x ij ) ≥ T 2 & MMED(x ij ) < T 3)

    LSB 1(x ij ) = LSB 3(x ij ) ⊕ s t2 and LSB 2(x ij ) = LSB 4(x ij ) ⊕ s t + 12 . s t2 is the tth bit in S 2 where t ∈ {1, 2, ….. |S 2|}.

  3. Case3:

    (MMED(x ij ) ≥ T 3)

    LSB 1(x ij ) = LSB 4(x ij ) ⊕ s t3 , LSB 2(x ij ) = LSB 5(x ij ) ⊕ s t + 13 and LSB 3(x ij ) = LSB 6(x ij ) ⊕ s t + 23 . s t3 is the tth bit in S 3 where t ∈ {1, 2, ….. |S 3|}.

Pixels belonging to smoother edges are used to embed one or two bits of the secret message. Secret bits are used to replace either single LSB of the pixels belonging to the smoother edge area or two LSBs of the pixel belonging to the smoother edge area. Three bits are embedded in the pixels belonging to sharper edge area.

3.2 Extraction process

To extract the secret data from stego image additional information; block size (Z) and threshold (T k ) are extracted from the stego image. Stego image is divided into non overlapping Ζ × Ζ blocks. MMED predictor is used to identify the regions where the secret data is embedded. Number of bits embedded in a particular region depends upon the threshold (T k ).

Extraction is performed on stego image based on threshold (T k ) as follows

  1. Case1:

    (MMED(x ij ) ≥ T 1 & MMED(x ij ) < T 2)

    s t1  = LSB 2(x ij ) ⊕ LSB 1(x ij ) where LSB 1(x ij ) and LSB 2(x ij ) represents Least Significant Bit (LSB) and second LSB of x ij respectively. s t1 is the tth bit in S 1 where t ∈ {1, 2,..... |S 1|}. “⊕” is X-OR operation.

  2. Case2:

    (MMED(x ij ) ≥ T 2 & MMED(x ij ) < T 3)

    s t2  = LSB 3(x ij ) ⊕ LSB 1(x ij ) and s t + 12  = LSB 4(x ij ) ⊕ LSB 2(x ij ). s t2 is the tth bit in S 2 where t ∈ {1, 2, ….. |S 2|}.

  3. Case3:

    (MMED(x ij ) ≥ T 3)

    s t3  = LSB 4(x ij ) ⊕ LSB 1(x ij ), s t + 13  = LSB 5(x ij ) ⊕ LSB 2(x ij ) and s t + 23  = LSB 6(x ij ) ⊕ LSB 3(x ij ). s t3 is the tth bit in S 3 where t ∈ {1, 2, ….. |S 3|}.

Pixels from the stego image are selected using raster scan. MMED values are compared with threshold to decide on the number of bits to be extracted from each pixel of the stego image.

3.3 Complexity analysis

To compute the MMED at most 7 fundamental operations are required per pixel. As the size of the image is m × n the total number of operations required to compute MMED is 7 × (m × n). M(pk) is computed for each block of size Z × Z using 2 fundamental operations (≤, <) per pixel, hence the total operations required to compute M(pk) per block is 2 × (Z × Z). As there are \( \frac{\mathrm{m}\times \mathrm{n}}{\mathrm{Z}\times \mathrm{Z}} \) blocks, hence the number of comparisons required to compute M(pk) over entire image is 2 × (m × n). Similarly threshold selection requires at most 6 × (m × n) operations. So, parameter selection process requires at most 15 × (m × n) operations. Embedding and extraction process requires (2 × 7 × S) operations. Hence the computation complexity of the proposed method is O((m × n) + S).

4 Experimental results

Proposed scheme has been analyzed using 500 images from USC-SIPI image database. Qualitative as well as quantitative analysis of the proposed scheme have been done using these images. The proposed scheme has been compared with Reversible as well as irreversible image steganography methods. Quantitative measures such as embedding rate, embedding capacity and peak signal to noise ratio (PSNR) are used. Performance of the proposed method has been evaluated using different steganalysis techniques.

4.1 Qualitative and quantitative analysis

Embedding rate is measured as the total number of bits embedded in a particular cover image. Percentage embedding is used to measure as well as compare the embedding rate of the proposed scheme. PSNR is used to measure the quality of the stego images produced. PSNR is defined as

$$ PSNR=10{ \log}_{10}\left(\frac{I_{\max}^2}{MSE}\right)(dB) $$

It is the ratio of the square of maximum grayscale intensity I max to the mean square error (MSE) of the original cover and the corresponding stego image. MSE is defined as

\( MSE=\frac{1}{MN}{\displaystyle \sum_{i=1}^M{\displaystyle \sum_{j=1}^N{\left(\left|{x}_{ij}-{x}_{ij}^{\prime}\right|\right)}^2}} \) where x ij is a pixel in original cover and x ij is the corresponding pixel in the stego image. M and N denote the row and column size respectively. Quality of stego image is directly proportional to PSNR. Higher the PSNR better is the quality of stego image [24]. Figure 3 shows some of the cover images for which Table 1 illustrates the embedding capacity and corresponding PSNR of the proposed scheme and some of the existing reversible image steganography schemes.

Fig. 3
figure 3

Cover images for which embedding capacity and corresponding PSNR are computed. a Elaine, b Boat, c Pepper, d Baboon, e Barbara

Table 1 Comparison of maximum payload (bits) and corresponding PSNR (dB)

Table 1 shows that the proposed scheme achieves higher embedding capacity than most of the reversible image steganography methods. Embedding region selected for different embedding rate is shown in Fig. 4. It is visually clear from Fig. 4 that embedding is done mostly in edge areas, if the embedding rate is low. Hence maximum visual quality can be achieved in stego images with lower embedding rate. Even though embedding rate is increased to 50 %, embedding is confined to edge area of the cover image as shown in Fig. 4. With higher embedding rate the proposed scheme tends to keep smoother regions intact, which increases the visual quality of the stego images even for higher embedding rates.

Fig. 4
figure 4

Embedding regions in cover image Barbara. a 20 % embedding, b 30 % embedding, c 50 % embedding

Figure 5 shows the capacity distortion curves of different steganography techniques for two images namely Barbara and Eline. Secret bits are embedded in images of size 100 × 100. Method proposed by Thodi et al. [26] has been implemented using prediction error expansion with histogram shifting and flag bits (i.e. P3 version [26]) to compare the results with our proposed method. Proposed method achieves better PSNR even with higher embedding rates as shown in Fig. 5. Proposed scheme is analyzed and compared with existing irreversible steganography methods using embedding rate, average PSNR and average modification rate. Modification rate is defined as the number of bits flipped in a cover image to embed the secret data. We have implemented theses steganography schemes to compute the stego images for 500 grayscale images taken from the database. Different embedding rates are used to compute PSNR and modification rate of all images. Averages of PSNR and modification rate computed for all images are taken to compare the quality of the stego images. Embedding rates, average PSNR and average modification rates for different image steganography methods are shown in Table 2. Please note that for greater modification rate of the proposed scheme compared to the other methods, higher value of PSNR indicates higher quality of the stego images produced by the proposed scheme.

Fig. 5
figure 5

a Capacity distortion curve of image Barbara, b Capacity distortion curve of image Eline

Table 2 Comparison of embedding rate and average PSNR (dB)

4.2 Visual attack

Visual attack is the most commonly used tool to detect the presence of the hidden data [20, 25]. Visual distortion introduced into the low level bit planes of the stego image reveals the regions where the secret data has been hidden. Proposed scheme embeds secret data in LSBs of the cover image. Depending upon the sharpness of the edge three or two or single least significant bit plane is used to embed the secret data. Visually bit planes obtained after embedding the secret data are not different from the least significant bit planes of the original cover as shown in Fig. 6. Least significant bit planes of the stego image Barbara shown in Fig. 6, are obtained using 30 % embedding rate. Please note that the proposed scheme does not leave any visual artifacts in the resulting stego image even for higher embedding rates. As steganography methods such as LSBM and LSBMR use random embedding, visual artifacts bound to creep into smooth regions of the resulting stego image. As edge areas are used in the proposed scheme to embed the secret data, it tends to leave smooth regions in a cover. Hence better quality stego images are obtained.

Fig. 6
figure 6

ac three least significant bit planes of cover image Barbara. df three least significant bit planes of stego image of Barbara

4.3 Statistical attack

Steganalysis is a method to detect the presence of hidden secret information in an image. Different statistical tools are used to extract the features of the cover and stego images to test the robustness of the steganography technique against the possible statistical attacks. Steganalysis schemes can be broadly classified as

  1. 1.

    Steganalysis specific to a steganography method.

  2. 2.

    Blind Steganalysis.

Specific steganalysis schemes accurately detect the presence of secret information embedded into the stego images [18]. These schemes are so powerful that they can even estimate the embedding ratio of the steganography scheme. There are some steganalysis schemes which can reliably detect the presence of secret message for LSB based steganography methods. Regular Singular (RS) analysis is one of the most popular steganalysis schemes used to detect the presence of secret message for LSB replacement algorithms [2, 4, 6, 15, 20].

Blind steganalysis schemes tend to classify the images into categories namely cover and stego images. These schemes first extract the features of cover as well as stego images. A classifier is selected and trained using the features extracted from the training sets of cover and the stego images. The test images are then classified into cover and stego images using the classifier. Features are extracted from the images to construct the feature vector of optimal dimensions to differentiate the stego images from the cover.

4.3.1 RS analysis

RS analysis classifies pixels into either regular or singular groups. Regular and singular groups are identified with respect to a mask m. Mask m is a set of −1, 0 and 1 which captures the flipping of pixels of the cover image. General idea of the RS analysis is to detect the change in regular and singular groups with increasing embedding rates. To avoid detection of the presence of secret message in stego images difference between regular groups R m , R − m and singular groups S m , S − m should be restricted to minimum. As HBC and Luo et al. [20] are edge adaptive image steganography methods based on LSB the proposed scheme is compared with HBC and Luo et al. [20] using RS analysis. Figure 7 shows RS diagram for Luo et al. [20], HBC and the proposed scheme. Relative percentage of regular and singular groups of different embedding rates computed for the image Barbara. Please note that for proposed scheme the differences between R m , R − m and S m , S − m do not increase substantially with increasing embedding rates. Hence the detection probability is less. Difference values for HBC start to expand from 25 % embedding rate where as for the proposed scheme the difference values start to increase beyond 30 % embedding rate. The performance of the proposed scheme is comparable with the steganography scheme proposed by Luo et al. [20]. However the embedding rate of the proposed scheme is better than Luo et al. [20].

Fig. 7
figure 7

RS diagram for HBC, Luo et al. and Proposed Scheme. Relative percentage of regular and singular groups for the image Barbara is taken across y axis. Embedding rate is shown across x axis. a Proposed Scheme, b Luo et al. [20], c HBC

4.3.2 Higher order statistical analysis

We have generated 500 stego images from 500 cover images selected from USC-SIPI image database using five irreversible steganography methods. Most appropriate high order statistical analysis of stego images generated using LSB based steganography method has been proposed in [5]. Farid-72D proposed in [5] decomposes the images using separable quadrature mirror filters (QMFs) [30]. Statistical features such as mean, variance, skewness and kurtosis are computed from the decomposed images using Farid-72D [21]. Fisher linear discriminant (FLD) [21, 24] classifier is used to determine the whether an image contains secret message or not. Statistical features extracted from cover and stego images in training set are used to train FLD. Interchangeably 499 out of 500 images from the set of cover and stego image are used as the training data and remaining image is used as the test data. Accuracy of detection is computed over 500 images. Percentage accuracy computed from Average accuracy is shown in Table 3. Table 3 shows that the detection accuracy for the proposed scheme is less as compared to other existing LSB based irreversible image steganography methods.

Table 3 Percentage accuracy for each feature set and different steganography methods

5 Conclusion

Proposed method is an edge adaptive irreversible image steganography. A modified edge predictor is proposed to identify the edge areas of a cover image. An adaptive method is also proposed to identify the sharper edges, which can be used to embed more secret message bits. Adaptive nature of the proposed approach increases the embedding capacity and reduces the detection probability. Result analysis shows that the proposed scheme is robust enough to foil most of the powerful steganalysis schemes.