1 Introduction

The healthcare industry demands the organizations store, analyze, and reference historical medical imaging data for quite a long time. Most of the healthcare disciplines preserve their complete personal clinical systems in some local data repositories which comprises of a direct-attached storage, storage area network, or network-attached storage. In reality, the pressing data store needs for the ever incrementing and cumulating storage and archival of the primary and secondary image copies are resulting in a “Big Data” explosion in imaging. As a next important mark of revolution the healthcare industry is moving towards industry-standard protocols for storing and accessing medical images, which is a cross-discipline enterprise archive. Recently, architectures of archiving medical images in cloud computing could be found in [14].

While it is stimulating to have convenient medical imaging archive which is completely inter operable across disciplines, there are some critical security and privacy risks which could hamper its wide acceptance. This situation leads to an open issue on one hand, in spite of the strict healthcare regulations to integrate business associates [14], cloud providers are not usually covered. In contrast, due to the high value of the sensitive medical images, these third-party storage servers frequently become the targets of various malicious behaviors which bring about exposure/alteration of the image content. To ensure integrity control and privacy protection of the medical images, it is essential to have some effective security mechanisms which operate with semi-trusted servers [20].

In this paper, we attempt to investigate the secure archiving of medical images which are stored on semi-trusted cloud servers, and focus on addressing the complicated and challenging integrity control and privacy preservation issues. With the intention of protecting the medical images stored on a semi-trusted server, a novel reversible data hiding (RDH) scheme is proposed as the main security primitive.

Most of the state-of-the-art RDH methods aim at providing a good performance in higher data embedding capacity and lower the distortion of the marked-image [28, 31, 42]. Based on this purpose, many RDH methods on images have been proposed. The part of RDH methods are realized through a process of semantic lossless compression [27, 37, 43], in which some space is saved for embedding extra data by lossless compressing the image. This compressed image should be “close” to the original image, so one can get a marked-image with good visual quality. The other part of RDH methods are achieved in image spatial domain and they have two major approaches: difference expansion(DE) and histogram shift(HS). The DE method was proposed by Tian et al. [32, 33] firstly and it performs better by providing a higher EC while keeping the distortion low when compared with the lossless-compression-based schemes. The DE method also has a lot of extension versions, in which prediction error expansion(PEE) has attracted considerable attention since this approach has the potential to well exploit the spatial redundancy in natural images. PEE is firstly proposed by Thodi and Rodriguez in [34] and [35], and this technique has been widely adopted by many subsequent RDH works [11, 17, 21, 29]. In PEE, instead of considering the difference operator as the decorrelation operation in DE, a pixel predictor is utilized. In some recent works [3, 17, 19, 26, 29, 30], the authors illustrated that combining adaptive embedding strategy such as sorting or pixel-selection with other reversible techniques such as PEE, can dramatically improve the embedding performance. Besides DE, HS is another most successful approach for RDH. By this approach, a histogram is first generated, and then reversible data embedding is realized by modifying the generated histogram. HS-based RDH is first proposed by Ni et al. in [23]. So far, Ni et al.’s HS method is extensively investigated and many subsequent works are proposed. In addition, PEE also have been widely utilized by HS for performance enhancement as well which called HS-PEE based RDH methods. In this way, a large payload can be embedded into the cover image by modifying the prediction-error histogram, and the embedding distortion can be controlled by simultaneously utilizing expansion and shifting. One type of improved HS-PEE based RDH methods focuses on exploiting advanced prediction techniques to generate a more sharply distributed prediction-error histogram [4, 9, 12, 18, 21, 24, 29, 30]. In addition, a sorting strategy is also used for performance enhancement, and this method works rather well with an improved performance compared with the prior arts [4, 15, 16]. Another type of improved methods exploited an optimal expansion-bins-selection mechanism for HS-PEE [22, 38]. In general, for a given capacity, considering the specific distribution of the generated histogram, the optimal expansion bins are selected such that the embedding distortion is minimized. In a word, the existing RDH methods used two techniques for pursuing high PSNR value, one is give priority of modifications to PEs in smooth regions, the other one is sort pixels based on smooth degree.

As a lot of literatures shown, most of the existing RDH in medical images aims at achieving high capacity and pursuing high PSNR value, but less considering the characteristics of the medical images. In fact, most of medical images include large smooth regions. Additionally, Osamah et al. [1] divided medical image into smooth region and non-smooth region and applied a high embedding capacity scheme for the smooth region while applied traditional DE method for the non-smooth region. For some special medical image, Bao et al. [2] proposed tailored reversible data hiding schemes for the electronic clinical atlas by exploiting its inherent characteristics, and Huang et al. [13] proposed a histogram shifting method for image reversible data hiding for high bit depth (16 bit) medical images.

In general, the perceptual quality of images often needs to be improved by contrast enhancement, to increase the dynamic range or to bring out image details. For example, it is often demanded that the contrast of medical images can be enhanced for helping diagnosis. Hence, we try to enhance the contrast of medical images’ ROI region and embed the data reversibly meanwhile. Although reversible data hiding scheme with image contrast enhancement are achieved in [7, 39, 41], in which the methods [7, 39] have some limitations: First, two methods only applied histogram shifting (HS) scheme to select two highest bins of image histogram for data hiding, and repeated this process until embedded all secret data. Hence, they will cause the overflow and underflow case due to use of the histogram shifting and they solve this case by using preprocessing handle. However, preprocessing handle could lead to new distortion of the marked-image. Second, two methods only enhance contrast in the global spatial domain but do not specifically for the image’s ROI region, so they preferentially enhance the NROI region which is the background region of the medical images. In addition, Yang et al. [41] proposed RDH in medical images with enhanced contrast in texture area, but the texture regions in this paper depends on the two side bins of the PEH. Hence, it can’t reflect the ROI region accurately and it leads to the high location map when embedding rate is too high. To overcome the aforementioned drawbacks, this paper proposes a ROI-based high capacity reversible data hiding algorithm with contrast enhancement for medical images. The proposed method firstly adopts Pai et al.’s “adaptive threshold detector” (ATD) [25] segmentation algorithm to automatically separate the ROI region and non-ROI (NROI) region from the medical image. Secondly, the proposed method stretches the contrast of the ROI region and embed the data into stretched histogram’s highest bins repeatedly. Lastly, the proposed method embeds required large of secret data into NROI region regardless its quality. In addition, the proposed method needs to record the location of the segmentation but it avoids the overflow and underflow case. Hence, the proposed method can reduce the size of the location map from another point of view. Therefore, better visual quality of the enhanced medical images and high performance reversible data hiding can be achieved with the proposed method meanwhile.

Fig. 1
figure 1

The framework of the proposed method’s embedding procedure

This paper is organized as follows. In Section 2, we elaborate proposed ROI-based reversible data hiding for medical images. The performance of the proposed method is evaluated and compared with the other methods in Section 3, and conclusion is finally presented in Section 4.

2 Proposed ROI-based reversible data hiding for medical images

The proposed ROI-based reversible data hiding for medical images consists of four stages: ROI and NROI segmentation, ROI-based RDH method, NROI-based RDH method, extraction and recovery processing. As shown in Fig. 1, ROI and NROI segmentation stage is to separate the ROIs from the cover image, ROI-based RDH stage is to embed the secret data into ROI area for achieving the contrast enhancement effect in ROI area even in very small embedding rate, NROI-based RDH stage is to embed the other secret data into NROI area for achieving the high embedding rate, extraction and recovery stage is to extract the secret data from the marked image and recover original image lossless.

2.1 ROI and non-ROI segmentation

In most of medical images, “region of interest” (ROI) is the center region which contains important information for helping accurate diagnosis; NROI is the background region which contains monochrome information and useless in diagnosis. Hence, the quality of ROI region should be improved with embedding data into it even in low embedding rate and NROI region should be embedded more data for achieving high embedding rate. Generally, the interested objects and background on a medical image can be distinguished by their gray-level intensities so that the thresholds method can be applied to separating the interested objects and background. Hence, this paper adopts Pai et al.’s “adaptive threshold detector” (ATD) [25] segmentation algorithm in automatically separating the interested objects from the medical image. ATD algorithm considers the standard deviations, quantities, and group intervals of the data in all classified classes as the factors deciding the optimal thresholds. Due to the limit of space, we will not give the detailed implementation, which can be found in [25].

Let I be a medical image, \(I\left ({x,y} \right )\) be a pixel located at the coordinates \(\left ({x,y} \right )\) on I, and the optimal threshold I be computed from the gray-level histogram of I by ATD [25]. Then, a binary image S e g b is generated by:

$$ Seg_{b} \left( {x,y}\right) = \left\{\begin{array}{ll} 0 & \text{ if } I\left( {x,y} \right) \ge I^{*}\\ 1 & {Otherwise} \\ \end{array}\right.. $$
(1)

We named \(I\left ({x,y} \right )\) as an interested pixel only when \(Seg_{b} \left ({x,y} \right ) = 0\), where all the adjacent interested pixels comprise the ROI region. The remaining of I is called NROI region.

Assume that if we embed data into ROI region and NROI region respectively, so it is required that the same segmentation can be performed on the marked image when extracting the data and recovering the original image. Since the part of pixel’s gray level in marked images are different from in original images after data embedding, there is no guarantee that the same automatic segmentation can be repeated on the marked images. If we record all segmentation information \(Seg_{b} \left ({x,y} \right )\) as part of additional information and embed it into original image, the cost is too great. As we mentioned before, ROI region are concentrated in the center of the most medical images. Therefore, we use an approximation \(\overline {ROI}\) and \(\overline {NROI}\) to approximate the original ROI region and NROI region and use \(\overline {ROI}\) region and \(\overline {NROI}\) region to achieve RDH scheme in following parts.

In row x, the columns of first and last interested pixels are \(y1{}_{x} = first(\text {Seg}_{b} \left ({x,:} \right ) = 0)\) and \(y2{}_{x} = last(\text {Seg}_{b} \left ({x,:} \right ) = 0)\) respectively. Hence, the approximation binary image \(Se{g}^{\prime }_{b} \) is generated by:

$$ Seg^{\prime}_{b} \left( {x,y} \right) = \left\{\begin{array}{ll} 0 & \text{ if } y1_{x} < y < y2_{x}\\ 1 & {Otherwise}\\ \end{array} \right.. $$
(2)

We name approximation \(\overline {ROI}\) region when \(Se{g}^{\prime }_{b} \left ({x,y} \right ) = 0\) and approximation \(\overline {NROI}\) region when \(Se{g}^{\prime }_{b} \left ({x,y} \right ) = 1\). We take the ‘Brain’ medical image as an example to show the original segmentation result in Fig. 2b and approximation segmentation result in Fig. 2c.

Fig. 2
figure 2

The segmentation of “Brain” medical image

2.2 ROI-based data embedding scheme

In general, we aim at enhancing the ROI region’s contrast for improving the quality of medical images and achieving the RDH method meanwhile. Hence, we try to enhance the contrast of the ROI area while embed the data reversibly even at a very low embedding rate. The other contrast-based RDH method all simply utilized the histogram shifting scheme to achieve contrast enhancement [7, 39]. However, these methods may over depend on the embedding rate, namely, if embedding rate is too low, the image contrast may be weak-enhanced and if embedding rate is too high, it will cause overflow and underflow case. As we know, digital image processing indicates that: “If an image’s pixels occupy all possible grayscale and have uniform distribution, this image will with high contrast and changeful gray color [8].” Inspirited from this rule, in order to avoid of the overflow and underflow case, this paper firstly stretches the grayscale of the ROI region into [0,255], then embeds the data into the highest bins and fills in the absent bins repeatedly as far as possible to obtain the uniform distribution.

2.2.1 Contrast stretching

In the following part of this paper, we all use approximation \(\overline {ROI}\) region and \(\overline {NROI}\) region to participate the calculation. In general, the histogram of the most image’s \(\overline {ROI}\) region can’t occupy all possible grayscale [0,255], so we stretch grayscale into [0,255] for enhancing the contrast of \(\overline {ROI}\) region. We calculate the minimum and maximum gray level of the \(\overline {ROI}\) region and named them as \(\overline {ROI}_{\min } \) and \(\overline {ROI}_{\max } \). If grayscale is stretched into [\(L_{\min } ,L_{\max } \)], all pixels in \(\overline {ROI}\) region are stretched into

$$ \overline {SROI} (x,y) = round\left[ {\left( {L_{\max} - L_{\min} } \right)\times \frac{\overline {ROI} (x,y) - \overline {ROI}_{\min} } {\overline {ROI}_{\max} - \overline {ROI}_{\min} } + \overline {ROI}_{\min} } \right], $$
(3)

where \(\overline {ROI} (x,y)\) is the gray level of the pixel in \(\overline {ROI}\) region, \(\overline {SROI} (x,y)\) is the gray level of the stretched pixel in \(\overline {ROI}\) region. In general, \(L_{\min } = 0\) and \(L_{\max } = 255\).

Here, we take an example to explain the procedure of the contrast stretching. As shown in Fig. 3, if there are four gray level values (3,4,7,8) in \(\overline {ROI}\) region and the \(L_{\min } = 1,L_{\max } = 10\). According to the (3), all pixels in \(\overline {ROI}\) region are stretched to (1,3,8,10).

Fig. 3
figure 3

An example of the contrast stretching algorithm

This section stretches the grayscale of the \(\overline {ROI}\) region. It has two advantages: 1.Because other contrast-based RDH methods often apply histogram shifting (HS) scheme for data hiding, they will cause the overflow and underflow problem and solve this problem by using preprocessing handle. However, preprocessing handle could lead to new distortion of the marked-image and new additional information of the location map. In this paper, we stretch the grayscale of the \(\overline {ROI}\) region firstly, and then embed the data into peak bins of the stretched histogram without extending the histogram bins. Therefore, the proposed method avoids overflow or underflow problem when enhancing the contrast. 2. Because other contrast-based RDH methods may over depend on the embedding rate, namely, if embedding rate is too low, the image contrast may be weak-enhanced. In this paper, we firstly stretch the grayscale of the \(\overline {ROI}\) region into [0,255], then embed the data into the highest bins repeatedly for obtaining the uniform distribution. Therefore, the proposed method doesn’t depend on the embedding rate, the same result in low embedding rate and high embedding rate.

2.2.2 Embedding data into ROI region

Section 2.2.1 introduces the procedure of stretching the grayscale of \(\overline {ROI}\) region, this section introduces how to embed data into stretched \(\overline {SROI} \) region and obtain the uniform distribution of the histogram meanwhile. Due to the range of grayscale is narrow in most medical images and the grayscale of the \(\overline {ROI} (x,y)\) is stretched into \(\overline {SROI} (x,y)\), so it will have a lot of absent grayscale bins. Motivated by rule that mentioned in digital image processing:“If an image’s pixels occupy all possible grayscale and have uniform distribution, this image will with high contrast and changeful gray color [8],” we embed the data into the highest bins of the \(\overline {SROI} (x,y)\)’s histogram and fill in the absent bins reversibly without shifting procedure. The details embedding process are as follows:

  1. 1.

    Calculate the histogram of the \(\overline {SROI} (x,y)\). We use h(k) to indicate the number of pixels assuming gray value \(k,k \in \left [ {0,255} \right ]\).

  2. 2.

    Select the peak bin which its adjacent bin is absent. Here, gray value of peak bin is denoted by k m , the number of peak bin is denoted by \(h(k_{m} ) = \max (h(k))\).

  3. 3.

    Embed the data into the peak bin k m . The data embedding can be conducted by

    $$ {k}^{\prime} = \left\{\begin{array}{ll} {k + d_{i}} & \text{ if } k = k_{m} \& k_{m} \in \left[ {0,126} \right]\& h\left( {k_{m} + 1} \right) = 0\\ {k - d_{i}} & \text{ if } k = k_{m} \& k_{m} \in \left[ {129,255} \right]\& h\left( {k_{m} - 1} \right) = 0\\ k & \text{if } k \ne k_{m}\\ \end{array}\right., $$
    (4)

    in which \(d_{i} \in \left ({0,1} \right )\) is the secret data that to be embedded.

  4. 4.

    Repeat step 2-3 until all secret data are embedded or there are no absent bins in the modified histogram.

As shown in Fig. 4, here we continue with the example of Section 2.2.1 to introduce how to embed the maximum data into bins. At first round, the stretched histogram have bins of k∈(1,3,8,10), in which L m i n =1, L m a x =10. Finding the peak bin of the histogram, namely, h(3)=20 which bin belongs to [1,4], and its right bin is absent. Hence, we can embed 20bits data into this bin. Here, we suppose the probability of the ’1’ and ’0’ that in secret data are all 0.5, then h(3)= h(4)=10. At second round, the peak bin of the modified histogram is h(8)=16 which bin belongs to [6,10] and its left bin is absent, then 16bits data are embedded into h(8), so h(7)= h(8)=8. Repeated six embedding rounds, all absent bins are filled in and 72bits maximum data are embedded into the selected bins.

Fig. 4
figure 4

An example of embedding data into stretched bins

In order to extract the data and recover the original data, please note that gray value of peak bin k m also need be embedded into previous round’s peak bin by using 8 bits and last peak bin k last will be part of additional information embedded into NROI region that will be introduced in Section 2.3.1. Section 2.2.1 enhances the contrast of \(\overline {ROI}\) region by contrast stretching method; this section utilizes the absent bins of the stretched histogram to embed the data without shifting other bins which avoid the overflow or underflow problem. In addition, since the contrast are enhanced by contrast stretching method, the proposed method have no over-enhancing and weak-enhancing problem which caused by high and low embedding rate in other contrast-based RDH schemes [39, 41].

2.3 NROI-based data embedding scheme

In Section 2.2, ROI region’s contrast is enhanced and data are embedded into ROI region firstly. However, if embedding rate is high, ROI region can’t embed all secret data and we can embed the other data into NROI region. In addition, since the NROI region contains only a flat color and unimportant in subjective diagnosis, we can embed more data into it and don’t care its quality of NROI region.

2.3.1 NROI-based data embedding scheme

As mentioned before, the gray value range of \(\overline {\mathrm {N}ROI} \) region is monocular. And most of \(\overline {\mathrm {N}ROI} \) region of medical image is dark. Hence, we preprocess the \(\overline {\mathrm {N}ROI} \) region and reduce the minimum gray value of \(\overline {\mathrm {N}ROI} \) region to 0 for avoiding the underflow case when embedding rate is high. Hence, we calculate the minimum gray value of \(\overline {\mathrm {N}ROI}\) region firstly:

$$ \overline {NROI}_{\min} = \min (\overline {NROI} (x,y)) $$
(5)

Then, all pixels in \(\overline {NROI}\) region are preprocessed by

$$ \overline {NROI_{P}} (x,y) = \overline {NROI} (x,y) - \overline {NROI}_{\min} $$
(6)

In addition, since the \(\overline {NROI}\) region is unimportant for subjective diagnosis; we embed the additional information into it. As we know, the four sides of most medical images don’t include important information; we embed the additional information into it. Assume the size of an image is [M,N], and we use four side’s h rows and h columns to embed additional information. Then, the LSB of H=2h×N+2h×M−4h 2 pixels as shown in Fig. 5 are replaced by the additional information.

Fig. 5
figure 5

The four sides of image that used to embed the additional information

Now, we discuss the composition of the additional information. As mentioned in Section 2.1, in order to record the location of segmentation and extract the data and recover the original image losslessly, we need record the columns y1 x and y2 x in row x by l o g 2 N bits respectively, so there are 2∗l o g 2 NM bits to record the segmentation information. The segmentation information is compressed by the JBIG2 standard [10] as part of additional information and named as S c o m , its size denoted as N s e g . Therefore, in order to extract data and recover cover image conveniently, the proposed method replaces LSB of the four sides H pixels by the following additional information: size of compressed segmentation information N s e g , compressed segmentation information S c o m , the minimum and maximum gray value of the \(\overline {ROI}\) region as \(\overline {ROI}_{\min } \) and \(\overline {ROI}_{\max } \), the minimum gray value of \(\overline {NROI}\) region as \(\overline {NROI}_{\min } \), selected last peak bin k l a s t in ROI-based data embedding scheme, selected last peak bin f l a s t in NROI-based data embedding scheme which will be introduced in Section 2.3.2, payload size of \(\overline {ROI}\) region, payload size of \(\overline {NROI}\) region. Please note that the LSB of the four sides H pixels as H L S B is also compressed and embedded as a part of the payload.

2.3.2 Embedding data into NROI region

Section 2.2 introduces the procedure of embedding data into \(\overline {ROI}\) region of medical images and enhances the contrast of \(\overline {ROI}\) region, this section introduces how to embed the rest of data into \(\overline {NROI}\) region meanwhile. Since the gray value range of \(\overline {NROI}\) region is monocolor, the histogram is narrow and high. We embed the rest data into the peak bin of the \(\overline {NROI}\) region’s histogram by using the histogram shifting RDH method. Section 2.3.1 preprocesses the \(\overline {NROI} (x,y)\) into \(\overline {NROI_{P}} (x,y)\), then details of embedding process are as follows:

  1. 1.

    Calculate the histogram of the \(\overline {NROI_{P}} (x,y)\). We use h(f) to indicate the number of pixels assuming gray value \(f,f \in \left [ {0,255} \right ]\).

  2. 2.

    Select the peak bin. Here, gray value of peak bin is denoted by f m , the number of peak bin is denoted by \(h(f_{m} ) = \max (h(f))\).

  3. 3.

    Embed the data into the peak bin f m . The data embedding can be conducted by

    $$ {f}^{\prime} = \left\{\begin{array}{ll} {f + d_{i}} & \text{if } f = f_{m}\\ f & \text{ if } f < f_{m}\\ {f + 1} & \text{if } f > f_{m}\\ \end{array}\right. \quad , $$
    (7)

    in which \(d_{i} \in \left ({0,1} \right )\) is the secret data that to be embedded.

  4. 4.

    Repeat step 2-3 until all secret data are embedded.

In order to extract the data and recover the original data, please note that gray value of peak bin f m needs to be embedded into previous round’s peak bin by using 8 bits. In addition, selected last peak bin f l a s t as one of additional information needs to be embedded into four sides of images that introduced in Section 2.3.1. Since the \(\overline {NROI}\) region of most of medical images are dark and monocolor, we preprocess the \(\overline {\mathrm {N}ROI} \) region and reduce the minimum gray value of \(\overline {\mathrm {N}ROI} \) region to 0. Hence, in our experiment, it can avoid the underflow or overflow in high capacity.

2.4 Extraction and recovery processing

Sections 2.2 and 2.3 illustrate the data embedding procedure of ROI-based and NROI-based methods. Inverse with the embedding order, we firstly do extraction and recovery processing in \(\overline {NROI}\) region and then in \(\overline {ROI}\) region. Next, we introduce the steps of extraction and recovery processing:

  1. 1.

    Read LSB of the four sides H pixels in marked-image to extract the additional information. It includes the size of compressed segmentation information N s e g , compressed segmentation information S c o m , the minimum and maximum gray value of the \(\overline {ROI}\) region as \(\overline {ROI}_{\min }\) and \(\overline {ROI}_{\max }\), the minimum gray value of \(\overline {NROI}\) region as \(\overline {NROI}_{\min } \), selected last peak bin k l a s t in ROI-based data embedding scheme, selected last peak bin f l a s t in NROI-based data embedding scheme, payload size of \(\overline {ROI}\) region, payload size of \(\overline {NROI}\) region.

  2. 2.

    Decompress the compressed segmentation information S c o m into segmentation information \(Se{g}^{\prime }_{b} \left ({x,y} \right )\). And according to the \(Se{g}^{\prime }_{b} \left ({x,y} \right )\), marked-image is segmented into \(\overline {ROI}\) region and \(\overline {NROI}\) region.

  3. 3.

    According to the selected last peak bin f l a s t in NROI-based data embedding scheme and payload size of \(\overline {NROI}\) region, all pixels in preprocessed \(\overline {NROI}\) region are recovered repeatedly as

    $$ f = \left\{\begin{array}{ll} {f}^{\prime} & \text{if } {f}^{\prime} \le f_{m}\\ {{f}^{\prime} - 1} & \text{if } {f}^{\prime} \ge f_{m} + 1\\ \end{array}\right. $$
    (8)

    And secret data are extracted repeatedly as

    $$ d_{i} = \left\{\begin{array}{ll} 0 \hfill & \text{if } {f}^{\prime} = f_{m}\\ 1 \hfill & \text{if } {f}^{\prime} = f_{m} + 1\\ \end{array}\right. $$
    (9)
  4. 4.

    According to the minimum gray value of \(\overline {NROI}\) region as \(\overline {NROI}_{\min } \), pixels in \(\overline {NROI}\) region are recovered further by

    $$ \overline {NROI} (x,y) = \overline {NROI_{P}} (x,y) + \overline {NROI}_{\min} $$
    (10)
  5. 5.

    According to the selected last peak bin k l a s t in ROI-based data embedding scheme, all pixels in stretched \(\overline {ROI}\) region are recovered repeatedly as

    $$ k = \left\{\begin{array}{ll} {{k}^{\prime} - 1} & \text{if } {k}^{\prime} = k_{m} + 1\& k_{m} \in \left[ {0,126} \right]\\ {{k}^{\prime} + 1} & \text{if } {k}^{\prime} = k_{m} - 1\& k_{m} \in [129,255]\\ {k}^{\prime} & {else} \\ \end{array}\right. $$
    (11)

    And secret data are extracted repeatedly as

    $$ d_{i} = \left\{\begin{array}{ll} 1 & \text{if } {k}^{\prime} = k_{m} + 1\& k_{m} \in \left[ {0,126} \right]\\ 1 & \text{if } {k}^{\prime} = k_{m} - 1\& k_{m} \in [129,255]\\ 0 & \text{if } {k}^{\prime} = k_{m}\\ \end{array}\right. $$
    (12)
  6. 6.

    According to the minimum and maximum gray value of the \(\overline {ROI}\) region as \(\overline {ROI}_{\min } \) and \(\overline {ROI}_{\max } \), all pixels in \(\overline {ROI}\) region are recovered further by

    $$ \overline {ROI} (x,y) = round\left[ {\left( {\overline {ROI}_{\max} - \overline {ROI}_{\min} } \right)\times \frac{\overline {SROI} (x,y) - \overline {ROI}_{\min} } {L_{\max} - L_{\min} } + \overline {ROI}_{\min}} \right] $$
    (13)
  7. 7.

    Replace the LSB of the four sides H pixels as H L S B that embedded into \(\overline {NROI}\) region and extracted by step 3.

3 Experiment results

We do a lot of experiments on some medical images. However, due to the limitation of the space, we only randomly choose three medical images which are named as ‘Brain’, ‘Chest’ and ‘Xray’ with the sizes of 256×256,512×512,256×256 to show the experiment results and subjective perception. Three cover test images are shown in Fig. 6. In order to illustrate the characteristic of the proposed method, we do three series experiments: discuss the embedding performance when only embed data into the \(\overline {ROI}\) region of medical images, discuss the change of histogram when enhanced the contrast of the \(\overline {ROI}\) region and embedded the maximum data into the \(\overline {ROI}\) region, discuss the subjective perception of marked-images in different embedding rates when compared with Wu et al.’s and Gao et al.’s methods [7, 39] which are also contrast-based RDH methods.

Fig. 6
figure 6

Three cover medical images

Firstly, we discuss the maximum embedding bits by the proposed method when only embed data into \(\overline {ROI}\) region of medical images. As shown in Fig. 7, Fig. 7a,d,g are three cover test medical images, Fig. 7b,e,h are binary images which indicated the segmentation results and details are represented in Section 2.1, Fig. 7c,f,i are marked-images that embedded maximum data only into \(\overline {ROI}\) region with 38776bits, 211394bits, 45525bits respectively. The contrast of the \(\overline {ROI}\) region is enhanced obviously in all three medical images, and the NR-CDIQA [5] values are 2.4679, 2.7994and 2.6261 respectively. Here, NR-CDIQA is a no-reference (NR) IQA method only for contrast enhancement and it was proposed based on the principle of natural scene statistics (NSS). Therefore, NR-CDIQA method can effectively assess the quality of contrast distorted images and it consists with the subjective perception because it based on the principle of NSS. The higher the score of NR-CDIQA, the better quality of images. Here, we use the contrast enhancement region, which is the ROI region, to calculate the NR-CDIQA values in this paper. In Fig. 7, the maximum embedding rates that only embedded data into \(\overline {ROI}\) region are 0.59bpp, 0.81bpp and 0.69bpp in three medical images, so we can embed more data into \(\overline {NROI}\) region for achieving higher embedding rate. In general, the proposed method can achieve 3bpp embedding rate at least in most of medical images.

Fig. 7
figure 7

Embedded only into \(\overline {ROI}\) region of three cover medical images, in which (a,d,g) are original images, (b,e,h) are \(\overline {ROI}\) region of three cover images, (c,f,i) are marked-images when embedded maximum data into \(\overline {ROI}\) region

Secondly, we discuss the change of histograms when enhanced the contrast of the \(\overline {ROI}\) region and embedded the maximum data into the \(\overline {ROI}\) region. Figure 8 shows the change of histograms between the three medical images, in which Fig. 8a,d,g are the original histograms of three medical images’ \(\overline {ROI}\) region, Fig. 8b,e,h are the stretched histograms of the three medical images’ \(\overline {ROI}\) region, Fig. 8c,f,i are the histogram of the three marked-images which embedded maximum data into \(\overline {ROI}\) region. From Fig. 8a,d,g, we can see that histogram bins are concentrated, and then histogram bins are stretched into [0,255] by using the contrast stretching algorithm as shown in Fig. 8b,e,h. In Fig. 8c,f,i, a lot of histogram bins are reduced to half and all absent bins are filled in due to embedded secret data ‘1’ into these bins for achieving uniform distribution in histogram.

Fig. 8
figure 8

Histogram bins of the three medical images \(\overline {ROI}\) region, in which (a,d,g) are original histogram, (b,e,h) are stretched histogram, (c,f,i) are histogram of three marked-images when embedded maximum data into \(\overline {ROI}\) region

Thirdly, we discuss the subjective perception of marked-images in different embedding rate and compare the results with Wu et al.’s and Gao et al.’s methods [7, 39]. In order to demonstrate the performance of the proposed method, we do experiment on three medical images by Wu et al.’s method [39], Gao et al.’s method [7] and the proposed method when embedding rates are 0.01bpp, 1bpp, 2bpp and 3bpp respectively. The marked images of three medical images are shown in Figs. 910 and 11 and corresponding parameters are shown in Tables 12 and 3. Since the doctors are the only appropriate persons to assess the quality of these marked medical images, we invited 10 doctors from the medical imaging profession in Anhui medical University to judge the quality of each marked images. The Mean Opinion Score (MOS) which is between [0,100] can be used to reflect the perceived quality of the image. The higher the MOS value, the better of the image quality. In addition, before the experiment, a short training showing the approximate range of quality of the images was also presented to each subject. Subjects were shown images in a random order and the randomization was different for each subject. Then subjects reported their judgments of quality according to each image’s number. Due to the subjective experiments are cumbersome to design and the time is constraint, we do our best to ensure that the testing environment was as close to the real-world as possible. All 10 subjects test 36 images in Figs. 911. Here, we give the average MOS score by 10 subjects in each image as shown in Tables 13. From the point of subjective perception, doctors found that the proposed method effectively enhances the contrast of all three medical images in all embedding rate when compared with the results by Wu et al.’s and Gao et al.’s methods. That is because most of medical images include a lot of smooth area, such as background, Wu et al.’s method selects two highest bins of image’s gray histogram to embed data, which means enhancing the contrast of background in \(\overline {\mathrm {N}ROI}\) region priority. Since the Gao et al.’s method embeds the data into spatial domain and IWT domain respectively, in which embedding procedure in spatial domain is same with Wu et al.’s method by adding the controlled threshold denoted by T_rce =0.55. Hence, since the relative contrast errors (RCE) [6] is smaller than T_rce when embedding rates are 0.01bpp, 1bpp and 2bpp by the Gao et al.’s method, the results in Gao et al.’s method are same to Wu et al.’s method. However, the proposed method segments the medical images into \(\overline {ROI}\) region and \(\overline {\mathrm {N}ROI} \) region according to the Section 2.1, and enhances the contrast and embeds the data into \(\overline {ROI}\) region firstly, and then embeds the other data into \(\overline {\mathrm {N}ROI}\) region for pursuing high embedding rate. Hence, the proposed method can improve the quality of three marked-images obviously even at a very low embedding rate as shown in Fig. 9c, Fig. 10c, Fig. 11c, such as in 0.01bpp.

Fig. 9
figure 9

“Brain” marked-images by using three RDH methods in 0.1bpp,1bpp,2bpp and 3bpp respectively

Fig. 10
figure 10

“Chest” marked-images by using three RDH methods in 0.1bpp,1bpp,2bpp and 3bpp respectively

Fig. 11
figure 11

“Xray” marked-images by using three RDH methods in 0.1bpp,1bpp,2bpp and 3bpp respectively

Table 1 “Brain” marked-image’s parameter that corresponds to Fig. 9
Table 2 “Chest” marked-image’s parameter that corresponds to Fig. 10
Table 3 “Xray” marked-image’s parameter that corresponds to Fig. 11

In Tables 13, we also calculate the PSNR, SSIM [36], and NR-CDIQA [5] parameters for all marked images, in which PSNR, SSIM and NR-CDIQA are used to assess marked image’s quality. Please note that the PSNR and SSIM which are the traditional IQA methods belong to the full-reference image quality assessment(IQA),but NR-CDIQA is a no-reference (NR) IQA method only for contrast enhancement and it was proposed based on the principle of natural scene statistics (NSS). Therefore, NR-CDIQA method can effectively assess the quality of contrast distorted images and it consists with the subjective perception because it based on the principle of NSS. The higher the score of NR-CDIQA, the better quality of images. When compared with the PSNR, SSIM and NR-CDIQA values between the three RDH methods in Tables 13, the PSNR and SSIM values by proposed method are all smaller than by the other two RDH methods which is opposite to the subjective perception in Figs. 911, but NR-CDIQA values by proposed method are all higher than by the other two RDH methods which is consistent with the subjective perception in Figs. 911. That is because the proposed method is prior to enhance the contrast of \(\overline {ROI} \) region by stretching the grayscale, namely, it leads larger change in \(\overline {ROI} \) region. However, PSNR metric largely depends on the quadratic sum of difference between original image and distortion image, so PSNR has been proved that it is not a strict metric for assessing image quality in IQA research area [40]. In addition, the essence of the structural comparison function in SSIM metric is the cosine value of the angle between two images, which reflects the image structure characteristic. Hence, SSIM can’t completely reflect the quality of contrast enhanced images. However, NR-CDIQA is an IQA method that dedicated to automatic quality assessment of contrast changed images, so it can reflect the effect of contrast enhancement in ROI region correctly.

With increase of the embedding rate, the proposed method firstly embeds part of secret data into all histogram bins of the \(\overline {ROI}\) region, and then embeds the rest of the data into \(\overline {\mathrm {N}ROI} \) region. Therefore, it doesn’t affect the quality of \(\overline {ROI}\) region which means not affect the subjective diagnosis. Please note that the four sides of medical image are used to embed the additional information that represented in Section 2.3.1. In a word, when compared with other contrast-based RDH methods, the proposed method can enhance the contrast of the \(\overline {ROI} \) region in all embedding rates obviously, and it can achieve the higher capacity performance.

4 Conclusion

This paper proposes a novel ROI-based reversible data hiding method with contrast enhancement, with a special application to medical images. Instead with the traditional RDH method which is pursuing the high PSNR value, this paper aims at improving the quality of medical images by enhancing the contrast of the ROI region when achieving the RDH scheme simultaneously. The proposed method segments the medical image into ROI region and NROI region by using “adaptive threshold detector” (ATD) segmentation algorithm and approximates the ROI and NROI regions to approximation \(\overline {ROI}\) and \(\overline {NROI}\) for extracting the data and recovering the original data lossless. Then, the proposed method embeds the data into \(\overline {ROI} \) region and \(\overline {NROI}\) region respectively. In spirited by the rule of the contrast enhancement, the contrast of the \(\overline {ROI}\) region is stretched and data are embedded into peak bins of the stretched histogram for improving the quality of the \(\overline {ROI}\) region. The rest of the data are embedded into \(\overline {NROI}\) region based on the histogram shifting RDH method and regardless the quality of the \(\overline {NROI}\) region for pursuing high capacity performance. When compared with other contrast-based RDH methods, the experiment shows that the proposed method can achieve more contrast enhancement effects and better visual quality for medical images. In addition, the proposed method can avoid the overflow and underflow problem but needs to embed segmentation information as a part of additional information. In a word, the proposed method suits for improving the quality of medical images which have clear ROI region and NROI region and embeds large capacity data reversibly.