1 Introduction

With the accelerating digitization scenario and exceptionally increased connectivity, the total outlook of various technological fields has experienced remarkable changes. Internet of Things (IoT) has paved the way for excellent healthcare systems resulting in the emergence of e-healthcare with the principle objective being ‘personalization of healthcare’. The typical function of an e-healthcare setup includes continuous collection and monitoring of patient-specific data, analysis of the received data, and transmission of the processed information. DICOM (Digital Imaging and Communications in Medicine) is a standard used for transmission and storage of information in medical images. Digital imagery forms a critical part in e-diagnosis and is very important for the transmission of Electronic Patient Record (EPR) in an e-health setup. One of the requirements of the healthcare industry is to store the medical records of patients which comprise medical images and their analysis. The different modalities in which medical images are generated and stored by medical imaging systems are X-ray, Ultrasound, Magnetic Resonance Imaging (MRI), and Computerised Tomography (CT) [14]. Medical images consist of sensitive data that is highly susceptible to alterations which might be intentional as well as unintentional and have potential chances of being modified both within the high-security storages and outside while transmission, extraction, and analysis in the medical system environment. The exponential development of modern technologies in the areas of electronics and communication has enabled remote access and distribution of medical information, thereby increasing the security threats to medical images. Even if there is a slight modification (intentional or unintentional) in the medical image or the embedded data (which includes EPR), it may lead to incorrect diagnosis and therefore can have life-threatening consequences. Thus, effective security measures need to be taken for the sake of protecting the medical imaging data, to ensure its privacy and integrity. To achieve the objectives of security and privacy of medical data, several techniques have been employed. Digital Watermarking [21] is one of the methods which effectively address security issues. It is the technique of hiding any type of imperceptible information (watermark) into the digital content (audio, video, image, text). The embedded data carries authentication or copyright information. Extraction or detection of the embedded watermark helps in the validation of the credibility of the content and also helps in the identification of the real owner of the digital content [7]. Since hiding any type of information leads to deterioration of the perceptual quality of the image, we must employ a reversible data hiding approach using which we can completely retrieve the cover image in its original form. Peak Signal to Noise Ratio (PSNR) and Structural Similarity Index Matrix (SSIM) do not take into account all the medical image characteristics which are significant for accurate diagnosis [5]. Also, medical images are mostly obtained with low image quality and have poor contrast because most imaging modalities used in diagnostics are harmful to the human body and hence the images are taken with low energy. From the diagnostic point of view, we must bring out the image details that lie within the low dynamic range. Therefore, the objective is to pay more emphasis on medical image characteristics i.e. to improve the visual quality and not on increasing PSNR and meanwhile detect whether any kind of tampering has occurred. In this paper we have enhanced the visual quality of ROI of the medical image, using contrast stretching, to improve the diagnosis. Further, we have reversibly embedded a fragile watermark in ROI to detect tamper in the diagnostic region. The security of embedded watermark has been taken care of using DNA encryption. The main contributions of the proposed work are:

  1. 1

    The proposed method enhances the contrast of the low-contrast medical images by utilizing contrast stretching based on histogram bin shifting.

  2. 2

    It provides high data hiding capacity (compared to state-of-the-art) while maintaining perceptual quality stego images.

  3. 3

    The ROI can be obtained back into its original form at the receiver in its pre-embedding form, facilitating better diagnostics.

  4. 4

    It facilitates tamper detection at the receiver as a result of embedding of a fragile watermark in ROI.

The rest of the paper is organized as follows: Related work is presented in section 2. Proposed work (Data embedding method and Data extraction method) is discussed in section 3 and 4. In section 5 experimental results are mentioned and discussed. The paper concludes in section 6 which contains a conclusion and future research direction.

2 Related work

Many algorithms employing data hiding have been extensively investigated in literature [15]. Data is usually hidden in two modes: reversible and irreversible. The major drawback of hiding data irreversibly is that after embedding confidential data, it causes distortion, and retrieval of the host-image in its original form won’t be possible. Since any kind of alteration of medical data is unacceptable, therefore reversible data hiding is usually used to avoid distortion [16]. The first Reversible Data Hiding [RDH] algorithm (US patent) was given by Barton in 1997 [4]. The researcher proposed that in addition to secret data, authentication information should be sent along for verification of the received data by the legitimate users. RDH is realized using various approaches like interpolation, pixel repetition, difference expansion, and histogram bin shifting [8, 11, 13]. Histogram Modification based watermarking techniques has the advantage of providing robustness against various image processing attacks. The first work on Histogram Shifting (HS) based RDH was undertaken in [12]. In the approach of histogram shifting [25], the first important step is generating an image’s histogram, from which the pixel with the highest frequency of occurrence i.e. the peak pixel value and the pixel with the least frequency of occurrence called zero-point is computed. The peak point and zero-point information is used to embed the data. Most of the histogram shifting techniques employ a block-based approach, making them resistant against several image processing operations. Lin [10] put forward the idea of multilevel reversible data hiding for increasing the payload based on histogram difference. First, the difference image is created by the calculation of different values of two neighboring pixels. The difference image is divided into 4 × 4 blocks, followed by the creation of variance matrix (3 × 4) and data embedding is finally done by histogram shifting of each block. Although, this approach would result in decreased embedding capacity at the same time, an appreciable increase in robustness is seen. Tsai [20] presented the idea of a residue image instead of a difference image employed in Lin’s approach. In Lin’s algorithm, the difference image is formed by difference values of neighboring pixels while the residue image is formed by calculating difference values between the two pixels in the non-overlapping block. For obtaining reversibility in histogram-based watermarking techniques, the information about the peak point and the zero point should be embedded along, which would decrease the embedding capacity. Tian et.al [19] put forward the Difference Expansion [DE] method of reversible data hiding. In this approach, the calculation of the difference values using the neighboring pixels (vertical or horizontal) and embedding of data is done in the selected difference values. Reversibility of data is attained by embedding location information of secret data. The drawback of this technique is that the location information of secret data would result in a decrease in the embedding capacity. To increase the embedding capacity, Alattar [1] modified the earlier proposed idea by embedding two bits of data into any three-pixel values, resulting in increased capacity [2]. A generalized approach of [2] was presented in [3], by embedding data in the difference expansion of vectors of pixels. An improved version of the DE method is Prediction Expansion Error expansion (PEE) which was reported by Rodriguez and Thodi [17]. In PEE, estimation of the prediction error from the neighborhood pixels is done, instead of DE, and the information bits are embedded in the expanded prediction error. The location map of the pixels that are used for embedding is compressed and is embedded along with the watermark. Rodriguez and Thodi [18] further improved their proposed algorithm by using Histogram Shifting [HS], along with PEE, which requires the location map of overflow/underflow locations. This improvement increased the payload to a great extent which was achieved by replacing the location map with the overflow /underflow locations. Khan et.al [9], reported that the extent of data deterioration is the major difference between the approach of data hiding using histogram shifting and one using location map. In the approach involving location map, only the pixels in which embedding is done are modified and consequently deformed. Comparatively, in algorithms, involving histogram shifting, not only the pixels in which embedding is done but the rest of the pixels which are not utilized for data hiding may also get degraded. In most of the cases, pixel or block-based approach is employed in DE based watermarking techniques where an alteration in data in one pixel or block does not have any effect on the rest of the pixels or blocks. The problem can arise only if there is any modification in the location map, as it would lead to incorrect retrieval of data. So, expansion based techniques, though prove useful for ensuring authenticity and integrity but can be fragile to certain attacks. For medical image watermarking, SSIM and PSNR are not the perfect image quality metrics rather focus should be on improving the characteristics of the medical image which are diagnostically important [5, 15]. A couple of interesting contrast based reversible data hiding algorithms have been reported by Wu [22] and G. Gao [6]. They put forward the fact that in certain images (poor illumination), like medical and satellite images, the major objective is to increase the visual quality rather than increasing the PSNR and worked on enhancing the contrast. These contrast based RDH algorithms encountered the problems of overflow and underflow which were overcome by Yang’s technique [24]. Yang proposed ROI based high capacity data hiding algorithm with contrast enhancement for medical images but did not support any kind of tamper detection.

3 Data embedding method

The embedding algorithm of the proposed method comprises of Image segmentation, Contrast stretching, ROI embedding, NROI embedding, and Stego Image formation from embedded segments. Fig. 1 shows the block diagram of the embedding algorithm.

Fig. 1
figure 1

Block Diagram of Embedding Algorithm

3.1 Segmentation of medical image into ROI and NROI

In image processing, the prime step for analysis of medical images is the segmentation i.e., the process of dividing the medical image into ROI and NROI. ROI is the region which contains the sensitive data that is critical for diagnosis. NROI is largely the background region that has uniform intensity and contains redundant information, which is of no significance regarding patient diagnosis. To bring out the minute details of the affected region, the visual quality of ROI has to be higher than that of NROI. This can be achieved by enhancing the contrast of the ROI. To maintain the perceptual quality of ROI, a lesser amount of data is embedded into ROI. Since the surrounding background region comprises mostly of monotonous information, most of the data embedding is done in this region. The major difficulties in the segmentation of medical images arise due to the wide variation in human anatomy and different modalities used for creating medical images (X-ray, CT scan, MRI, etc.). In this algorithm, we have employed a simplified semi-automatic approach, independent of the image type. Firstly, the expert selects the diseased region that is required for analysis. The coordinates of the ROI are automatically saved. Figure 2(a) and (b) show the original medical image and corresponding ROI respectively. Since in the proposed work, data embedding is done in the ROI and NROI regions separately, so it is required that the segmentation co-ordinates be sent for extracting the embedded data and recovering the original image.

Fig. 2
figure 2

(a) Original Medical Image (b) Segmented ROI

3.2 Contrast stretching of ROI

All the existing Reversible Data Hiding (RDH) techniques aim at either improving the PSNR or increasing the embedding capacity but the major objective of the proposed algorithm has been to increase the visual quality of the image. So, this is one of the key steps of the proposed algorithm. To bring out the details that lie within the low dynamic range, the contrast enhancement technique plays a significant role. In the proposed algorithm, we have first enhanced the contrast of the ROI region, which is followed by embedding data reversibly. The existing contrast based RDH schemes [6, 22] have employed histogram shifting for enhancing the contrast of the image. The drawback of these histogram shifting based algorithms is the dependency of the contrast on the embedding rate i.e. if the rate of embedding is low, it would result in images with weak contrast and if the rate of embedding is too high, it would result in problems of overflow and underflow. So, to overcome the problems of overflow and underflow, in the proposed algorithm, we have first done the contrast stretching of ROI and then embedded data reversibly. The conventional techniques that employ histogram shifting for enhancing the contrast have a lesser number of empty bins that are required for reversible data embedding. In the proposed algorithm, the probability of the presence of an empty bin adjacent to the peak bin has been attained using contrast. By contrast stretching, we create a greater probability of an empty bin adjacent to the peak bin, which further increases the payload that has to be embedded reversibly. The contrast of an image determines the dynamic range of its histogram. In simpler words, it is the measure of the intensity values present in the entire image. For an image to have high contrast, the pixels of the image should occupy all the greyscale values and have a uniform distribution. Since ROI doesn’t comprise of all the greyscale values, the technique of contrast stretching is used to obtain a uniform distribution and enhance the finer details that are not clear in low contrast ROI.

3.2.1 Steps involved in contrast stretching

Step 1: Histogram generation of ROI gives the greyscale values present in the image along with their frequency of occurrence (intensity counts). Figure 3 shows the histogram of the original medical image.

Fig. 3
figure 3

Histogram of the ROI of Medical Image

Step 2: Calculation of maximum grey level and minimum grey level of the ROI region. The maximum grey level is denoted by ‘rmax’ and the minimum grey level is denoted by ‘rmin’.

Step 3: Calculating the range to which the image needs to be stretched. A greyscale image (8 bit) has a dynamic range of 0–255. To enhance the contrast of the ROI region, we stretch the greyscale from 0 to 255. Let ‘lmin’ denotes the minimum value of the range and ‘lmax’ denotes the maximum value of the range. Therefore, the minimum value (lmin) is 0 and the maximum value (lmax) is 255. The contrast stretching algorithm stretches the boundaries of the histogram to lmax and lmin.

Step 4: Linear Scaling and Mapping for stretching of the ROI (dividing by the range of ROI and mapping the linear scaled ROI to the stretched range). Let ‘Lo’ denote the linear scaled ROI and ‘sroi’ denotes the stretched ROI.

$$ {\displaystyle \begin{array}{c} Lo= ROI- rmin/\left( rmax- rmin\right)\\ {} sroi= round\left[\left( lmax- lmin\right)\ast Lo+ lmin\right]\end{array}} $$

Step 5: Histogram generation of the stretched ROI (sroi). The stretched histogram of the ROI extends from 0 to 255. The generated histogram shows a large number of empty bins that are used for embedding data reversibly. Also, the perceptual quality of the stretched ROI (sroi) is far superior to the ROI without contrast enhancement as it brings out the clear details of the region of interest which further proves advantageous for an accurate diagnosis. The results of stretched histogram and contrast-enhanced image have been shown in Fig. 4.

Fig. 4
figure 4

(a) Histogram of Stretched ROI (sroi) of Medical Image (b) Contrast Stretched ROI

3.3 ROI embedding

Reversible data embedding in Region of Interest is done in selective peak bins and not in all the bins. The peak bins which have adjacent empty bins are only used for data embedding. The presence of adjacent empty bins to the peak bins is only achieved using contrast stretching. The creation of a large number of empty bins is achieved by contrast stretching of ROI. Since only those peak bins are employed for reversible data embedding which has an adjacent empty bin, therefore it automatically overcomes the problem of overflow and underflow. Also, we have pre-defined the range of intensities that are used for embedding, i.e. only peaks falling in that range are used for embedding data. The process of data embedding can be divided into two sub-steps:

3.3.1 Locating the peak bins with adjacent empty bins

The various steps involved in locating the peak bins with adjacent empty bins are:

Step 1: Firstly, arrange the various intensity values in descending order. This is done to locate the first peak value, followed by locating the subsequent peaks.

Step 2: Define the range of intensities in which peaks are to be selected.

Step 3: Since data embedding is done only in peak bins with adjacent empty bins, therefore the entire image is scanned for peaks with adjacent empty bins to their right or left.

Step 4: The peak bins are stored in one array and their adjacent empty bins are stored in the second array. Let ‘peakk’ denote the array of all peaks and ‘binp’ denotes the array of empty bins.

Step 5: The frequency of various peak values is an important parameter for determining the amount of data that can be embedded reversibly. The counts of various peak values are stored in another array denoted by ‘prob’. This array determines the capacity of ROI.

3.3.2 Embedding of data into the peak bins

The secret data (i.e. either 0 or 1) is embedded into the peak bins in such a way that if ‘1’ is to be embedded, there would be no change in the peak pixel but if ‘0’ is to be embedded, the peak pixel would be replaced by its corresponding empty pixel value. For authentication analysis, we embed a 32 × 32 watermark in the ROI region. Pertinent to mention that security of the secret data and watermark has been ensured by encrypting it using DNA encryption. The rule for key selection has been generated using a fundamental logistic map as presented by xa + 1 = μ(1 − xa) with μ = 3.6 and xa=0.5. The obtained key is XORed with the watermark using the operations given in Table 1. The data related to initial conditions is embedded at predefined locations at RONI as overhead, to manage the key.

Table 1 XOR operation of DNA sequence

There would be no embedding in the pixels that do not belong to ‘peakk’. Let ‘sroi stego’ denotes the stego stretched ROI formed after embedding. The various steps involved in the embedding of data into peak bins are given in the ROI embedding algorithm referred to as Algorithm 1.

figure a

The histogram of embedded stego ROI is shown in Fig. 5. On comparing it with the histogram of the stretched ROI, it can be seen that the empty bins have been filled.

Fig. 5
figure 5

Histogram of Embedded ROI

3.4 NROI embedding and Stego image formation

For maintaining the visual quality of ROI, the amount of data that is embedded into the NROI has been increased to achieve high embedding capacity. NROI is a region of uniform intensity that is of less or no significance to diagnosis. Following steps are used for NROI embedding:

Step 1: The segmentation step gives the co-ordinates of ROI and NROI. NROI is the background or outer rectangular portion. For embedding, we further segment the NROI into four regions – NROI (upper), NROI (lower), NROI (right), and NROI(left).

Step 2: The four NROI regions are converted into single arrays and converted to form a large NROI array or NROI block in which embedding is done. Further, we make use of LSB substitution for embedding data into the NROI region.

Step 3: The secret data is embedded in the first LSB plane, which is followed by embedding secret data in the second LSB plane.

Since the embedding of data has been done separately in the ROI and NROI, so to form the stego image, we need to combine the NROI stego with the ROI stego. The large stego block is divided into four parts and combined them with the ROI stego image to obtain the Stego image. Figure 6 shows the stego image formed after the combination.

Fig. 6
figure 6

Stego Image

4 Data extraction method

The extraction algorithm of the proposed technique consists of the segmentation of the Stego image into NROI stego and ROI stego. The segmentation is carried out by using the coordinates extracted from the NROI. Figure 7 shows the block diagram of the extraction algorithm of the proposed technique.

Fig. 7
figure 7

Block Diagram of Extraction Algorithm

The detailed description of each stage during extraction is presented as follows:

Stage 1: Segmentation of Stego image into NROI stego and ROI stego: The segmentation is carried out by using the coordinates extracted from the NROI.

Stage 2: Extraction of data from NROI: For extraction, we further divide the NROI into four regions – NROI stego (upper), NROI stego (lower), NROI stego (right) and NROI stego (left). The four NROI stego regions are converted into single arrays and combined to form an NROI array or NROI block in which embedding is done. Data is extracted from the LSBs of the NROI stego block. After data extraction, we get the actual NROI.

Stage 3: Extraction of data from ROI: For data extraction from ROI, the peak values (peakk), empty bins (binp), and length of peaks (len) are sent as overhead information in the NROI. The entire stego image is scanned for the various peaks (peakk) and empty bins (binp) and data is extracted as follows:

  1. a

    If the value of the pixel is equal to the value of the peak pixel (peakk), then the extracted data (i.e. embedded data) is ‘1’. To recover the original ROI, the value of the pixel is kept the same. Let ‘xdata’ denote the extracted data. Let roi stego denotes the stego ROI.

    $$ {\displaystyle \begin{array}{c}\boldsymbol{if}\ \boldsymbol{roi}\ \boldsymbol{stego}\left(\boldsymbol{i},\boldsymbol{j}\right)=\boldsymbol{peakk}\left(\boldsymbol{i},\boldsymbol{j}\right)\\ {}\boldsymbol{then}\ \boldsymbol{xdata}=\mathbf{1}\\ {}\boldsymbol{sroi}\left(\boldsymbol{i},\boldsymbol{j}\right)=\boldsymbol{peakk}\left(\boldsymbol{i},\boldsymbol{j}\right)\end{array}} $$
  1. b.

    If the value of the pixel is equal to the value of the empty bin (binp), then the extracted data (i.e. the embedded data) is ‘0’. To recover the original ROI, the value of the empty bin (binp) is replaced by the value of the corresponding peak pixel (peakk).

    $$ {\displaystyle \begin{array}{c}\boldsymbol{if}\ \boldsymbol{roi}\ \boldsymbol{stego}\left(\boldsymbol{i},\boldsymbol{j}\right)=\boldsymbol{binp}\left(\boldsymbol{i},\boldsymbol{j}\right)\\ {}\boldsymbol{then}\ \boldsymbol{xdata}=\mathbf{0}\\ {}\boldsymbol{sroi}\left(\boldsymbol{i},\boldsymbol{j}\right)=\boldsymbol{peakk}\left(\boldsymbol{i},\boldsymbol{j}\right)\end{array}} $$
  1. c.

    The above two steps are repeated until all the embedded data has been extracted from the modified peaks.

  2. 1

    If the pixel value is neither equal to a peak value (peakk) nor is it equal to the value of the empty bin (binp), then no data is extracted from those bins. Therefore, no modification is made in the value of those pixels.

    $$ \boldsymbol{sroi}\left(\boldsymbol{i},\boldsymbol{j}\right)=\boldsymbol{roi}\ \boldsymbol{stego}\left(\boldsymbol{i},\boldsymbol{j}\right) $$

The above steps result in the formation of ROI (contrast stretched).

Stage 5: Reverse Contrast Stretching. To recover the original ROI from the stretched ROI, maximum greyscale value (rmax) and minimum greyscale value (rmin) are used and ROI is recovered reversibly as follows:

$$ \boldsymbol{roi}=\left[\boldsymbol{rmax}-\boldsymbol{rmin}\ast \frac{\left(\boldsymbol{sroi}-\boldsymbol{lmin}\right)}{\left(\boldsymbol{lmax}-\boldsymbol{lmin}\right)}+\boldsymbol{rmin}\right] $$

Also, lmax and lmin are the extreme values to which the ROI was stretched and roi denotes the ROI without contrast stretching. This stage results in the formation of ROI from stretched ROI (sroi).

Stage 6: Combining ROI and NROI to form the original medical image.

The various steps have been summarised in data extraction algorithm, referred to as Algorithm 2.

figure b

5 Experimentation and results

To evaluate the performance of the proposed contrast enhancement based RDH algorithm, we have taken 8 medical images and 5 general images of size 256 × 256. Further, the binary watermark of size 32 × 32 has been used for authentication purposes. The test images and the watermark have been presented in Fig. 8.

Fig. 8
figure 8

256 × 256 Test images and 32 × 32 Watermark

The experimentation has been carried out on MATLAB 2017a (version 9.2.0538062) and the performance of the proposed algorithm has been evaluated in terms of standard objective quality metrics such as Peak Signal to Noise Ratio (PSNR), Structural Similarity Index Matrix (SSIM), and No-Reference Quality Metric for contrast-distorted images (NR-CDIQA) while the perfection of extraction of data and recovery of the original image is evaluated in terms of Bit Error Rate (BER). Further, the embedding capacity of the technique is calculated in terms of bits per pixel (bpp).

5.1 Imperceptibility and payload analysis of medical and general images

To evaluate the proposed scheme various parameters have been calculated and among them, Table 2 presents the imperceptibility and payload analysis of the medical images along with another metric NR-CDIQA which is an important evaluation parameter for image quality analysis of contrast stretched images.

Table 2 Imperceptibility and Payload Analysis of Stego Image

For imperceptibility analysis PSNR and SSIM values have been evaluated, these values come out to less; the reason for the same is the process of contrast stretching, which has been done to increase the visual quality and creation of empty bins for embedding data reversibly. The process of contrast stretching modifies ROI to a great extent and for such contrast distorted images; PSNR and SSIM cannot be accurate metrics to assess the image quality [24]. No-Reference Quality Metric for contrast-distorted images (NR-CDIQA) [5] is the metric that correctly assesses the image quality of contrast distorted images and is based on the principle of natural scene statistics. The NR-CDIQA takes into account the effect of contrast stretching of ROI and the resulting high values are in tune with the results of the subjective analysis of the images. PSNR values are evaluated based on the quadratic sum of the difference between the original medical image and the stego image and has been proved not to be an accurate metric to assess the quality of the image in Image Quality Assessment (IQA) research area [23]. SSIM also cannot be a metric that perfectly determines the image quality of contrast distorted images because it is based upon the structural characteristics of the image and is the cosine value of the angle between the cover and the stego image respectively. The evaluated payload reflects the high embedding capacity of the contrast-based reversible data hiding algorithm. Figure 9 shows the stego medical images.

Fig. 9
figure 9

Stego Medical Images

Table 3 shows the PSNR and SSIM values of the eight medical test images with respect to the processed images (i.e. contrast stretched host images). The PSNR results of Table 3 are found to be high, an indication of good visual quality. Further SSIM values are found to be close to 1 which is an indication of structural similarity between the stego image and the processed cover image. The results of Table 3 also suggest that it is only because of contrast stretching that PSNR and SSIM with respect to the original image come out to be less.

Table 3 Imperceptibility Analysis of Stego Image with respect to Processed Original Image

It is pertinent to mention, that a set of 100 images from OPENi medical image repository database is used for evaluation of the scheme and the average results obtained for PSNR and SSIM are 47.67 and 0.9921 respectively.

Tables 4 and 5 show the imperceptibility analysis of the 8 medical images with respect to the original image and the processed original image at varying payloads of 0.01, 0.1, 0.75, and 1 bits per pixel (bpp) respectively.

Table 4 Imperceptibility Analysis of Stego Image at Fixed Capacity (0.01, 0.1. 0.75 and 1 bpp)
Table 5 Imperceptibility Analysis of Stego Image at various payloads

Further, for analysis of general images, the entire image has been treated as ROI and contrast enhancement of the entire image has been done. Table 6 gives imperceptibility analysis with respect to the original image. The resulting low values are due to contrast stretching.

Table 6 Imperceptibility analysis of test images

Table 7 shows PSNR and SSIM analysis of general images with respect to the processed original image. The resulting values are found to be high because now the PSNR and SSIM are calculated with respect to processed images (contrast-enhanced).

Table 7 PSNR and SSIM analysis test images

5.2 Subjective analysis

In this section, we present the subjective analysis of the medical images used for embedding the diagnostic information. Figure 10 shows the subjective analysis of the four medical images, showing the ROI of four medical images, their stretched ROI (sroi), and the stego ROI (ROI in which secret data has been embedded). It also shows the respective embedding capacities of the ROI. Since ROI is the region that contains the sensitive data that is critical for diagnosis, therefore major objective has been to increase its perceptual quality than to increase its embedding capacity. This has been achieved by enhancing the contrast of the ROI. From the analysis, it can be seen that visual quality of stretched ROI (sroi) and stego ROI is far greater than ROI and hence, the process of contrast stretching brings out the minute details, thereby enhancing the diagnostic process.

Fig. 10
figure 10

Subjective Analysis of ROI Medical Images

5.3 Comparative analysis

Yang et.al [24] have also proposed a contrast-based high capacity data hiding scheme with contrast enhancement for medical images. To show that the proposed technique is a better contrast based scheme, we have done the comparative PSNR and SSIM analysis at a fixed capacity of 1 bit per pixel (bpp) for medical images 2, 3, and 4 respectively. Figures 11 and 12 show the comparative PSNR and SSIM analysis respectively. The resulting PSNR values, though slightly but are found to be greater as compared to Yang’s technique which makes it a better technique. Moreover, resulting SSIM values are found to be greater when compared to Yang’s technique and so there is more structural similarity between the original image and the stego image in the proposed technique. Besides, Table 8 shows comparative embedding capacity analysis of the proposed technique with that of Yang’s technique and the results show that the proposed technique outperforms Yang’s technique.

Fig. 11
figure 11

a Comparative PSNR Analysis of Medical Images with Yang’s Technique [24] b Comparative SSIM Analysis of Medical Images with Yang’s Technique [24]

Fig. 12
figure 12

a : Authentication Analysis of Medical Images for no attack, b: Authentication Analysis of Medical Images for median filtering, c: Authentication Analysis of Medical Images for the addition of salt and pepper noise, d: Authentication Analysis of Medical Images for histogram equalization, e: Authentication Analysis of Medical Images for the addition of Gaussian noise, f: Authentication Analysis of Medical Images for sharpening

Table 8 Comparative Embedding Capacity (in bits) Analysis of Medical Images with Yang’s Technique [24]

5.4 Tamper detection and authentication analysis

In this section, we show the tamper detection capability of the proposed scheme. A 32 × 32-bit fragile watermark has been embedded into ROI to detect the tamper for authenticating the data before being used for diagnosis. Further, the basic motive for adding this feature to the proposed method is to prevent the wrong diagnosis due to alteration in the content of the image and also to initiate the request for resending the data if it is corrupt.

Tamper Detection deals with the process of verifying whether the data received is tampered or not. For tamper detection and hence authentication at the receiver a binary 32 × 32 watermark shown in Fig. 8 has been embedded in ROI. This watermark data is interleaved within secret data and embedded into ROI as per section 3.3 and Algorithm 1. The authentication of this region is more significant since it is required for diagnostic analysis. To evaluate our scheme for authentication, various attacks including salt and pepper noise, median filtering, histogram equalization, Gaussian noise, low pass filtering, and sharpening have been carried out on the stego-medical images. The experimental results show that the proposed algorithm is capable of detecting the tamper, as it reports high BER for all attacks. This is testimony to the fact that the slightest tamper in ROI of these images can be detected using the proposed scheme. The various attacks along with results obtained are presented as under:

  1. a

    No attack: When the stego image containing watermark has not been altered, the extracted logo (Fig. 12 (a)) from various medical images shows clarity revealing that no attack has varied the content of the image.

  1. b

    Median filtering: The Stego image is filtered using a median filter of size 3 × 3. The average BER obtained is 0.3642 which is indicative of tamper in the stego image. The watermark extracted after median filtering is shown in Fig. 12 (b).

  2. c

    Salt and pepper noise: When Stego image is subjected to Salt and pepper noise with density = 0.01watermark extracted after the attack is not clean which shows alteration in content of the image. This can be viewed in Fig. 12 (c).

  3. d

    Histogram equalization: BER obtained after performing histogram equalization is 0.6641 which shows a very high bit error rate. This can be visualized from Fig. 12 (d).

  4. e

    Gaussian noise: Gaussian noise with mean zero and variance 0.001 has been applied to stego image, upon which the BER value of 0.5078 has been obtained. The extracted watermark is shown in Fig. 12 (e).

  5. f

    Sharpening: Fig. 12 (f) shows the result obtained after extraction of the watermark from stego image, once its contrast is sharpened. The BER of 0.4883 has been obtained showing a high degree of error between the embedded and extracted watermark.

The subjective and objective results presented in Figs. 12(b)-12(f) show that our proposed scheme is capable of reporting any tamper to the received image. Subjectively it could be seen from the distorted watermarks extracted for all attacks, while as high BER values obtained explain it objectively. It is pertinent to mention that we have only reported the results of four images. However, we have subjectively and objectively analysed the other four test images as well (Medical Image 5-Medical Image 8). For the latter four images (5–8) the average BER values of 0.3648, 0.3381, 0.6481, 0.5099 and 0.4436, have been observed for median filtering, salt and pepper noise, histogram equalization, Gaussian noise and sharpening respectively. The subjective, as well as objective analysis, signifies that the proposed technique can detect tamper.

6 Conclusion

A contrast stretching based data hiding scheme with tamper detection capability has been presented in this paper. In this technique, a spatial domain approach has been used which has primarily focussed on improving the visual quality, rather than increasing the embedding capacity. The technique has been employed for medical images wherein the image can be divided into two portions i.e. Region of interest (ROI) and Non-Region of Interest (NROI). The visual quality of the ROI which is the diagnostically critical region has been greatly increased by enhancing its contrast. The contrast stretching technique has played a significant role in bringing out the details that lie within the low dynamic range. Another aspect of this scheme is that we can recover the ROI completely making the technique of contrast enhancement reversible. A fragile watermark has been embedded in the ROI to detect tamper if any. The scheme has been evaluated for perceptual similarity and content authentication by subjecting it to various image processing and geometric attacks. The various metrics that have been employed for evaluating the performance are NR-CDIQA, PSNR, and SSIM. The PSNR value of 47.58 dB and SSIM value of 0.9915 for the test images for the processed image (contrast stretched image) is an indicator of good visual quality and high structural similarity respectively. From the subjective analysis, we infer that the contrast of the ROI has been greatly enhanced resulting in superior visual quality and improved diagnostic process. It has been observed that the proposed scheme can detect any tamper caused due to noise addition and various filtering activities (like median filtering, sharpening) which has been validated by the high value of BER. A comparison of the proposed technique with the existing contrast based RDH technique shows that the proposed scheme performs better on account of both tamper detection and image imperceptibility. From the attributes of the proposed technique, it can find wide application in a typical E- healthcare system. In the future, this work will be extended for localization as well as correction of the tampered region and can be employed for real-time applications.