## 1 Introduction

*et al.*, 2017; Huang

*et al.*, 2017; Li

*et al.*, 2018; Wang

*et al.*, 2018) are much simpler and cheaper than an intrusion detection system (Huang and Hwang, 2012) to protect security and privacy of images by image with an unique digital identity.

*et al.*, 2016; Huang

*et al.*, 2013a; Chen and Guo, 2020; Kim

*et al.*, 2009) (RDH) are applied to embed secrets inside an image as a stego-image with minimal distortion. After the secrets are retrieved from a stego-image at the extraction stage, the original images can be reconstructed exactly. The major applications of RDH are authentication, diagnostic image, military imagery, astronomical images, satellite, and artwork preservation. Shi

*et al.*(2016) classified RDH techniques into six categories: histogram shifting, image compressing (e.g., JPEG), semi-fragile authentication, image contrast enhancement, encrypted images, and RDH based on audio and video. In general, there are two types of popular RDH techniques: histogram shifting (HS) (Thodi and Rodriguez, 2007; Hong

*et al.*, 2008) and difference expansion (DE). In 2006, Ni

*et al.*(2006) proposed the first HS-based RDH by modifying the generated histogram. Some extensions of Ni et al.’s HS-based RDH methods proposed such as block-based HS (Fallahpour and Sedaaghi, 2007), difference-histogram (Lee

*et al.*, 2006), high-frequency IWT coefficients (Xuan

*et al.*, 2007; Huang

*et al.*, 2017). In 2002, Tian (2002) proposed a high capacity DE method. Furthermore, DE has been developed in three species: integer-to-integer transformation (Qiu

*et al.*, 2016), prediction-error expansion (PEE) (Dragoi and Coltuc, 2015), and adaptive embedding (Hong

*et al.*, 2015). There are three approaches in image compressing: RDH with quantized DCT coefficients modification (Huang

*et al.*, 2016), RDH with quantization table modification (Wang

*et al.*, 2013), RDH with Huffman table modification (Wu and Deng, 2011). In 2003, Vleeschouwer

*et al.*(2003) presented the first robust RDH based on the correlations among the neighbouring pixels. In general, the approaches of contrast enhancement RDH applied some functionalities such as histogram bin expansion operations to improve the visual quality. There are four RDH approaches with contrast enhancement: method by histogram bin expansion (Wu

*et al.*, 2015a), method with contrast enhancement for medical images (Wu

*et al.*, 2015b), method with the controlled contrast enhancement (Gao and Shi, 2015), and automatic contrast enhancement method (Kim

*et al.*, 2015). Due to protection of the privacy of data and enabling the cloud server to easily manage the data, more and more researchers study reversible data hiding in encrypted images. The techniques of encrypted images are divided into three types: vacating room before encryption (Cao

*et al.*, 2016), vacating room after encryption (Zhang, 2011), and reversible image transformation (Zhang

*et al.*, 2016).

*et al.*, 2013b). Abbasy and Shanmugam (2011) presented biological aspects of the DNA to increase the level of data confidentiality among clients. Some other authors (Zhang, 2012; Surekha and Swamy, 2013) converted stego-images into encryption data transferred to public Cloud environments. Based on prediction error expansion, a predictive value is calculated by predictors. Then the secret bit-stream will be embedded into the cover image according to the expansion of the difference between a pixel and its predictive values.

*et al.*, 2012; Wu

*et al.*, 2009; Zhang S.

*et al.*, 2016; Jana

*et al.*, 2016) are developed in 2D images. However, many medical images are produced and processed (Tseng and Huang, 2010) as stacks of slices such as CT, MRI, and PET. These slices can be used to generate 3D image volumetric information. Thus, it is important to apply data hiding in 3D images efficiently. Recently, for digital media it is getting more and more important to apply data hiding to the quality of compressed video. Shanableh (2012) applied data hiding schemes to embed secrets into a compressed video bit stream for copyright protection.

*et al.*, 2012; Wu

*et al.*, 2009; Zhang S.

*et al.*, 2016; Jana

*et al.*, 2016) are developed in 2D images. However, many medical images are produced and processed (Tseng and Huang, 2010) as stacks of slices such as CT, MRI, and PET. These slices can be used to generate 3D image volumetric information. Thus, it is important to apply data hiding in 3D images efficiently. Recently, for digital media it is getting more and more important to apply data hiding to the quality of compressed video. Shanableh (2012) applied data hiding schemes to embed secrets into a compressed video bit stream for copyright protection.

## 2 Proposed Method

*et al.*, 2011), a prediction-based reversible hiding method (Chang

*et al.*, 2012), and a histogram-based overflow/underflow process (Huang

*et al.*, 2013b) to embed n bits of secret messages for each block in gray level images. Adopting overlapping blocks partition and a histogram-based overflow/underflow process, the capacity can be improved. Two-tier data hiding will be adopted to embed messages. The detail of a two-tier data hiding scheme is described as follows.

### 2.1 Data Embedding

#### 2.1.1 Tier-1 Data Hiding

*et al.*, 2011) by adjusting the peak point to zero points of the image histogram. The tier-1 data hiding consists of four steps: constructing difference, classifying block type, emptying peak points, and embedding data.

**Step 1:**Construct difference

##### Fig. 2

**Step 2:**Classify block type

*p*and

*q*are equal to 2. So each block will be labelled with the type number for embedding at this stage. In other words, different kinds of block types will be processed by different embedding procedure.

**Step 3:**Empty peak points

*i*, the bins of ${b_{\pm (i+1)}},{b_{\pm (i+2)}},{b_{\pm (i+3)}},\dots ,{b_{\pm (2i+1)}}$ will be emptied by shifting the bins [${b_{-(i+1)}},{b_{-({2^{\textit{bit}\_ \textit{depth}-1}}-1)}}$] leftward and [${b_{+(i+1)}},{b_{+({2^{\textit{bit}\_ \textit{depth}-1}})}}$] rightward where the histogram bins are denoted by ${b_{-({2^{\textit{bit}\_ \textit{depth}-1}}-1)}},\dots ,{b_{0}},\dots ,{b_{+({2^{\textit{bit}\_ \textit{depth}-1}}-1)}}$. For instance, $i=2$ and bit-depth = 8 will empty the bins ${b_{\pm 3}}$, ${b_{\pm 4}}$, ${b_{\pm 5}}$ by shifting the bins ${b_{-3\leqslant t\leqslant -127}}$ leftward and the bins ${b_{3\leqslant t\leqslant 128}}$ rightward. These operations are described by the formula as follows:

##### (2)

\[ {d^{\prime }_{k}}=\left\{\begin{array}{l@{\hskip4.0pt}l}{d_{k}}+\textit{EL}+1\hspace{1em}& \text{if}\hspace{2.5pt}{d_{k}}>\textit{EL},\\ {} {d_{k}}-\textit{EL}-1\hspace{1em}& \text{if}\hspace{2.5pt}{d_{k}}<-\textit{EL},\\ {} {d_{k}}\hspace{1em}& \text{otherwise},\end{array}\right.\]##### (3)

\[ {s^{\prime }_{k}}(i,j)=\left\{\begin{array}{l@{\hskip4.0pt}l}{s_{k}}(i,j)+\textit{EL}+1\hspace{1em}& \text{if}\hspace{2.5pt}{d_{k}}(i,j)>\textit{EL},\\ {} {s_{k}}(i,j)-\textit{EL}-1\hspace{1em}& \text{if}\hspace{2.5pt}{d_{k}}(i,j)<-\textit{EL},\\ {} {s_{k}}(i,j)\hspace{1em}& \text{otherwise},\end{array}\right.\]**Step 4:**Embed data

**(1) Type I.**

##### (5)

\[ {d^{\prime\prime }_{k}}=\left\{\begin{array}{l@{\hskip4.0pt}l}{d^{\prime }_{k}}+\textit{EL}+w\hspace{1em}& \text{if}\hspace{2.5pt}{d^{\prime }_{k}}=\textit{EL},\\ {} {d^{\prime }_{k}}-\textit{EL}-w\hspace{1em}& \text{if}\hspace{2.5pt}{d^{\prime }_{k}}=-\textit{EL},\end{array}\right.\]**(2) Type II-1.**

*w*repeatedly.

##### (7)

\[ {d^{\prime\prime }_{k}}=\left\{\begin{array}{l@{\hskip4.0pt}l}{d^{\prime }_{k}}+{(-1)^{t+1}}\hspace{1em}& \text{if}\hspace{2.5pt}{d^{\prime }_{k}}={v_{m}}\hspace{2.5pt}\text{and}\hspace{2.5pt}w=1,\\ {} {d^{\prime }_{k}}\hspace{1em}& \text{if}\hspace{2.5pt}{d^{\prime }_{k}}={v_{m}}\hspace{2.5pt}\text{and}\hspace{2.5pt}w=0,\end{array}\right.\]**(3) Type II-2.**

##### (8)

\[\begin{aligned}{}& \left\{\begin{array}{l}{n_{0}}\geqslant 2,\\ {} 0\leqslant {n_{L}}<{n_{R}}\leqslant (p\times q)-{n_{0}},\end{array}\right.\end{aligned}\]##### (9)

\[\begin{aligned}{}& {d^{\prime\prime }_{k}}=\left\{\begin{array}{l@{\hskip4.0pt}l}{d^{\prime }_{k}}-1\hspace{1em}& \text{if}\hspace{2.5pt}{d^{\prime }_{k}}=0,\hspace{2.5pt}w=1,\hspace{2.5pt}t<{n_{R}}-{n_{L}},\\ {} {d^{\prime }_{k}}+{(-1)^{t+1}}\hspace{1em}& \text{if}\hspace{2.5pt}{d^{\prime }_{k}}=0,\hspace{2.5pt}w=1,\hspace{2.5pt}t\geqslant {n_{R}}-{n_{L}},\\ {} {d^{\prime }_{k}}\hspace{1em}& \text{if}\hspace{2.5pt}{d^{\prime }_{k}}=0,\hspace{2.5pt}w=0,\end{array}\right.\end{aligned}\]**(4) Type II-3.**

##### (10)

\[ \left\{\begin{array}{l}{n_{0}}\geqslant 2,\\ {} 0\leqslant {n_{R}}<{n_{L}}\leqslant (p\times q)-{n_{0}},\end{array}\right.\]##### (11)

\[ {d^{\prime\prime }_{k}}=\left\{\begin{array}{l@{\hskip4.0pt}l}{d^{\prime }_{k}}+1\hspace{1em}& \text{if}\hspace{2.5pt}{d^{\prime }_{k}}=0,\hspace{2.5pt}w=1,\hspace{2.5pt}t\leqslant {n_{L}}-{n_{R}},\\ {} {d^{\prime }_{k}}-{(-1)^{t+1}}\hspace{1em}& \text{if}\hspace{2.5pt}{d^{\prime }_{k}}=0,\hspace{2.5pt}w=1,\hspace{2.5pt}t>{n_{L}}-{n_{R}},\\ {} {d^{\prime }_{k}}\hspace{1em}& \text{if}\hspace{2.5pt}{d^{\prime }_{k}}=0,\hspace{2.5pt}w=0,\end{array}\right.\]#### 2.1.2 Tier-2 Data Hiding

**Step 1:**Compute the prediction pixel value

**Step 2:**Compute the prediction error

*e*

**Step 4:**Overflow/Underflow process

*et al.*, 2009). At first, we compute the utilization rate of the medical image which consists of intensity rate and underflow/overflow rate. In order to get the intensity rate, we divide the range of intensity by 2 to the power of bit depth. The range of intensity is the difference in the intensity of the cover image between max value and min value. Bit depth is the image quality expressing how many unique shades are available. Images with higher bit depths are able to encode more intensities because there are combinations of 0’s and 1’s available.

##### (15)

\[\begin{aligned}{}& \text{Intensity rate}=\frac{\text{The range of intensity}}{{2^{{^{\text{bit}\_ \text{depth}}}}}},\end{aligned}\]### 2.2 Data Extraction

##### Fig. 3

#### 2.2.1 Tier-2 Data Extraction

*e*, and extracting secrets. At the first stage, we adopt histogram shifting with distance overflow/underflow to invert overflow/underflow process. At the predict pixel value stage, we construct a difference block like in the Tier-1 data hiding, step 2. Then we apply the formula (11) to obtain the predicted pixel value $\hat{p}$. And we get the extracted pixel $\tilde{p}$ at the left-top element of a $2\times 2$ block. Then the formula (12) is adopted to obtain predicted error ${e^{\prime }}$ in predicted error ${e^{\prime }}$ stage. The stage of extracting secrets applies ${e^{\prime }}$ to compute the original pixel by $p=\hat{p}+\lfloor \frac{{e^{\prime }}}{2}\rfloor $. And the secret bit is extracted by $w=\tilde{p}-\hat{p}-(2\times (p-\tilde{p}))$. After extracting secrets, we restore the intermediate image block ${d^{\prime\prime\prime }}$ for tier-2 data extraction.

#### 2.2.2 Tier-1 Data Extraction

**a.**Extracting secrets

*n*. In the case EL = 1, ${d^{\prime\prime\prime }_{k}}$ is ±3 and will extract secret bit “1”. And ${d^{\prime\prime\prime }_{k}}$ is ±2 and will extract secret bit “0”. In the case EL = 2, ${d^{\prime\prime\prime }_{k}}$ is ±5 and will extract secret bit “1”. And ${d^{\prime\prime\prime }_{k}}$ is ±4 and will extract secret bit “0”.

**b.**Inversing histogram shifting

##### (19)

\[ {d^{\prime }_{k}}=\left\{\begin{array}{l@{\hskip4.0pt}l}{d^{\prime\prime }_{k}}+1\hspace{1em}& \text{if}\hspace{2.5pt}{d^{\prime\prime }_{k}}=-1,\\ {} {d^{\prime\prime }_{k}}-1\hspace{1em}& \text{if}\hspace{2.5pt}{d^{\prime\prime }_{k}}=1,\\ {} {d^{\prime\prime }_{k}}\hspace{1em}& \text{if}\hspace{2.5pt}{d^{\prime\prime }_{k}}=0.\end{array}\right.\]##### (20)

\[ {d^{\prime }_{k}}=\left\{\begin{array}{l@{\hskip4.0pt}l}{d^{\prime\prime }_{k}}-\textit{EL}\hspace{1em}& \text{if}\hspace{2.5pt}{d^{\prime\prime }_{k}}=2\textit{EL},\\ {} {d^{\prime\prime }_{k}}-\textit{EL}-1\hspace{1em}& \text{if}\hspace{2.5pt}{d^{\prime\prime }_{k}}=2EL+1,\\ {} {d^{\prime\prime }_{k}}+\textit{EL}\hspace{1em}& \text{if}\hspace{2.5pt}{d^{\prime\prime }_{k}}=-2\textit{EL},\\ {} {d^{\prime\prime }_{k}}+EL+1\hspace{1em}& \text{if}\hspace{2.5pt}{d^{\prime\prime }_{k}}=-2\textit{EL}+1.\end{array}\right.\]**c.**Inversing empty bin

##### (21)

\[ {d_{k}}=\left\{\begin{array}{l@{\hskip4.0pt}l}{d^{\prime }_{k}}-\textit{EL}\hspace{1em}& \text{if}\hspace{2.5pt}{d^{\prime }_{k}}>\textit{EL},\\ {} {d^{\prime }_{k}}+\textit{EL}\hspace{1em}& \text{if}\hspace{2.5pt}{d^{\prime }_{k}}<\textit{EL},\\ {} {d^{\prime }_{k}}\hspace{1em}& \text{otherwise},\end{array}\right.\hspace{1em}\text{where}\hspace{2.5pt}1\leqslant k\leqslant p\times q,\hspace{2.5pt}k\ne m.\]## 3 Experimental Results

*W*and

*H*are the width and the height of the test image. $I(i,j)$ and ${I^{\prime }}(i,j)$ are two pixel values of the cover image and stego-image at the location $(i,j)$. We test on 16-bit depth CT medical image shown in Fig. 4. In Table 1, we set the embedding level to 1. Different kinds of threshold result in capacity and PSNR. Obviously, the more threshold T, the more capacity. The more threshold, the smaller PSNR. On the contrary, we set the threshold to 21 and various embedding levels in Table 2. The greater the embedding level E, the more capacity, and the smaller PSNR. In Table 3, we set an embedding level and threshold to 21. The largest of bpp is 2.641178445 and the PSNR is 63.24405029.

##### Fig. 4

##### Table 1

Image name from the national cancer imaging archive | Image size | Embedding level | Threshold | Capacity | bpp | PSNR |

1.3.6.1.4.1.9328.50.14.2.dcm | 350 × 512 | 1 | 1 | 99,633 | 0.555987723 | 81.92740097 |

6 | 120,508 | 0.672477679 | 79.74795677 | |||

11 | 150,878 | 0.841953125 | 77.48244098 | |||

16 | 179,047 | 0.999146205 | 75.77926976 | |||

21 | 197,696 | 1.103214286 | 74.64371168 |

##### Table 2

Image name from the national cancer imaging archive | Image size | Embedding level | Threshold | Capacity | bpp | PSNR |

1.3.6.1.4.1.9328.50.14.2.dcm | 350 × 512 | 1 | 21 | 197,696 | 1.103214286 | 74.64371168 |

6 | 304,972 | 1.701852679 | 68.91926164 | |||

11 | 365,123 | 2.037516741 | 66.1103813 | |||

16 | 406,108 | 2.266227679 | 64.16268337 | |||

21 | 434,770 | 2.426171875 | 62.72562295 |

##### Table 3

Image name from the national cancer imaging archive | Image size | Embedding level | Threshold | Capacity | bpp | PSNR |

1.3.6.1.4.1.9328.50.14.159.dcm | 395 × 512 | 21 | 21 | 501,905 | 2.481729628 | 62.81406295 |

1.3.6.1.4.1.9328.50.14.1207.dcm | 429 × 512 | 574,925 | 2.617483428 | 63.33996413 | ||

1.3.6.1.4.1.9328.50.14.1210.dcm | 429 × 512 | 515,352 | 2.346263112 | 62.08233045 | ||

1.3.6.1.4.1.9328.50.14.1278.dcm | 444 × 512 | 526,871 | 2.317668743 | 62.05008477 | ||

1.3.6.1.4.1.9328.50.14.1280.dcm | 444 × 512 | 589,797 | 2.594475823 | 63.22757547 | ||

1.3.6.1.4.1.9328.50.14.157.dcm | 395 × 512 | 455,072 | 2.250158228 | 61.92850025 | ||

1.3.6.1.4.1.9328.50.14.1141.dcm | 458 × 512 | 555,916 | 2.370684361 | 62.12956713 | ||

1.3.6.1.4.1.9328.50.14.1908.dcm | 547 × 512 | 739,699 | 2.641178445 | 63.24405029 |

##### Table 4

Image name from the national cancer imaging archive | Image size | Embedding level | Threshold | Capacity | bpp | PSNR |

Lena | 512 × 512 | 1 | 1 | 158,702 | 0.605400085 | 33.63540908 |

2 | 230,835 | 0.880565643 | 30.32126065 | |||

3 | 290,965 | 1.109943390 | 28.06630698 | |||

4 | 340,771 | 1.299938202 | 26.39720695 | |||

Airplane | 512 × 512 | 1 | 1 | 241,027 | 0.919445038 | 34.05170498 |

2 | 324,556 | 1.238082886 | 31.01245276 |

##### Table 5

Image name from the national cancer imaging archive | Image size | Median | Prediction | Our method | |||

Capacity | PSNR | Capacity | PSNR | Capacity | PSNR | ||

1.3.6.1.4.1.9328.50.14.159 | 395 × 512 | 0.71 | 69.9889 | 0.99 | 69.1440 | 1.68 | 69.6712 |

1.3.6.1.4.1.9328.50.14.1207 | 429 × 512 | 0.71 | 69.6336 | 0.99 | 69.2379 | 1.88 | 69.9551 |

1.3.6.1.4.1.9328.50.14.1280 | 444 × 512 | 0.71 | 69 | 0.98 | 69.747 | 1.84 | 69.8189 |

1.3.6.1.4.1.9328.50.14.1210 | 429 × 512 | 0.72 | 73.6699 | 0.96 | 73.396 | 1.02 | 73.3560 |

1.3.6.1.4.1.9328.50.14.1278 | 444 × 512 | 0.73 | 73.3000 | 0.952 | 73.063 | 1.01 | 73.1843 |

1.3.6.1.4.1.9328.50.14.157 | 395 × 512 | 0.73 | 73.3590 | 0.96 | 73.077 | 0.96 | 73.073 |

1.3.6.1.4.1.9328.50.14.1141 | 458 × 512 | 0.73 | 73.7324 | 0.96 | 73.727 | 1.04 | 73.459 |