# Reversible Data Hiding of Digital Image Based on Pixel Combination Algorithm

Authors: Jingmin Zhang
Journal: Advances in Multimedia
 (2022)

---

## Abstract

In order to improve the security effect of image information, this paper studies the reversible information hiding of the digital images combined with the pixel combination algorithm and proposes an improved simulated annealing algorithm using the incremental calculation method of statistical functions. Moreover, according to the gray gradient information contained in the image, this paper proposes an automatic threshold determination algorithm suitable for the unimodal gray distribution images and uses this algorithm to complete the threshold determination and binary segmentation of all images. In addition, this paper optimizes the model by transforming the isolated pores inside the model and removing the isolated matrix area. Through comparative experiments, it can be seen that the reversible information hiding method for digital images based on the pixel combination algorithm proposed in this paper has a good image information confidentiality effect.


---

## Body

## 1. Introduction

The embedding process of reversible information hiding based on the digital images can be understood as using a certain processing method to transform the pixel values to generate a redundant space and then embedding the secret information into the obtained redundant space [1]. The size of the redundant space directly affects the hidden capacity of the carrier image. For the embedding algorithm, if there is no certain reversible rule that can be followed in the extraction process, the carrier image cannot be recovered completely lossless while extracting the secret information [2]. From a theoretical point of view, the larger the redundant space, the larger the length of the secret information that can be hidden, the smaller the pixel modification of the carrier image, and the smaller is the distortion of the original carrier image. Therefore, the reversible information hiding algorithms are based on the two aspects of hiding capacity and image quality as the starting point to find an algorithm that can obtain as much redundant space as possible, modify the pixels of the carrier image as little as possible, and minimize the computational complexity [3].Encryption technology based on cryptography is a widely used information security method [4]. It converts multimedia data such as images, videos, and audios from plaintext to chaotic ciphertext, thereby realizing the protection of multimedia content. Encryption technology protects the multimedia data to a certain extent but it also has the following limitations: first, the ciphertext is easy to attract the attention of attackers and the security of the decrypted multimedia data will not be guaranteed [5]; second, the encryption technology cannot realize copyright tracking and content integrity authentication because the integrity authentication in cryptography is achieved through digital signatures [6], rather than directly embeddeding them in multimedia data. In addition, in application scenarios such as social media, the practicability of encryption technology is not strong because the multimedia data shared by people on social platforms is generally identifiable plaintext, not ciphertext. In order to protect the copyright of multimedia works and the integrity of their contents, information hiding technology has developed rapidly. Information hiding technology is a technology that embeds secret information into multimedia data such as images, audios, videos, and texts without being noticed by people [7]. Due to the redundancy of the multimedia data itself and the limitations of human vision and hearing, the multimedia data before and after information embedding is not much different, so its use value and sensory effect are not affected. The embedded information can have nothing to do with the multimedia carrier itself. At this time, the information hiding technology realizes the secret communication function [8], focusing on imperceptibility. If the embedded information is related to the multimedia carrier itself (such as the copyright information of the multimedia carrier), the information hiding technology realizes functions such as copyright authentication and integrity authentication [9], focusing on robustness, that is, in the embedded information. The embedded information can still be detected after the multimedia carrier undergoes unintentional or malicious operations such as compression, rotation, and trimming. Whether it is for secret communication or copyright protection, the embedding of the secret information changes the original multimedia data more or less, resulting in a certain degree of distortion. Although this kind of distortion is not easy to be noticed by people, in some special application scenarios, such as medical images, military image, and legal documents, even a small distortion will bring serious consequences [10]. In addition, with the advancement of technology, people have higher and higher requirements for the definition of digital images, audio, video, and other multimedia works, and the distortion caused by information hiding will become more and more easily detected. Therefore, in order to restore the original multimedia carrier after information extraction, researchers propose reversible data hiding (RDH). Reversible information hiding technology is a technology in which the secret information is embedded in the original carrier in a reversible manner, so that after the information is extracted, the original carrier can be recovered without damage [11]. Different from the traditional information hiding technology, the RDH technology requires that the embedded secret information can be extracted losslessly, the original carrier can be restored losslessly [12], and the quality of the embedded information carrier is higher. In recent years, the rapid development of cloud computing has provided convenience for the storage and processing of massive multimedia data. Individual users can store and share a large number of files in the cloud, and enterprise users can use the cloud to process data to save costs. However, data stored in the cloud is also at risk of being exposed and tampered with. Storing digital images in clear text in the cloud has certain risks. In order to protect the privacy for individual users and for business users to protect the business secrets, the encrypted version of the digital image may be uploaded to the cloud server [13]; in order to facilitate the management and retrieval of encrypted images, cloud service managers embed relevant information (such as copyright and abstract) so that RDH technology is facing new challenges; because in traditional RDH technology, the carrier is usually plain text image. However, after encryption, the plaintext image becomes a messy ciphertext, and the statistical characteristics of the original plaintext image and the correlation between the adjacent pixels are lost, and the traditional RDH technology is no longer applicable. In this context, it is of great significance to study the reversible information hiding technology of encrypted images [14]. Reversible data hiding in encrypted image (RDH-EI) technology is a technology that embeds secret information in encrypted images in a reversible way, and after the information is extracted losslessly, the original image can be restored losslessly [15], which is the combination and development of reversible information hiding technology and encryption technology. Based on the original intention of privacy protection, the RDH-EI algorithm applied to cloud storage scenarios should provide users with a simple and secure image encryption method on the user side to protect user privacy; in order to facilitate the management of ciphertext images by cloud service providers, the RDH-EI algorithm should be provided with large hidden capacity; at the receiving end, high-quality decrypted images and restored original images that are completely consistent with the original images are reasonable requirements that the RDH-EI algorithm should meet [16]. Most of the existing encrypted image reversible information hiding algorithms are based on the symmetric encryption domain, use stream cipher to encrypt the original image bitwise XOR, and use the spatial correlation of the image to reconstruct the original image. However, we also found that the RDH-EI algorithm based on the symmetric encryption domain has the following problems: (1) the ciphertext image generated by the existing stream cipher encryption has the risk of information leakage, (2) the quality of the decrypted image is not high, and (3) the information embedding rate is relatively low [17].Taking the hidden position as the starting point, reversible information hiding can be divided into spatial domain and transform domain information hiding. Based on the image hiding in the spatial domain, the purpose of hiding the secret information is achieved by modifying the gray value of image pixels. Because human vision is least sensitive to the least significant bits of an image pixel, the secret information is typically embedded in the spatial domain by modifying the least significant bits of a pixel. Based on the image hiding in the transform domain, the purpose of hiding the information is achieved by modifying the coefficients in the transform domain, such as Fourier coefficients, discrete cosine coefficients, and wavelet coefficients [18]. Generally speaking, the reversible algorithm based on the transform domain has high security but the algorithm complexity is relatively high. Starting from the type of carrier data, reversible information hiding techniques can be divided into image-based, video-based, audio-based, or document-based. Image-based reversible information hiding is the most discussed which utilizes the redundant data information of the images and the sensitive characteristics of the human visual system for information hiding [19]. The realization method of the video-based reversible algorithm is not much different from that of the image but it has higher requirements on the real-time performance of the algorithm. The audio-based reversible algorithm mainly uses the data redundancy of audio files and the sensitive characteristics of the human auditory system to hide the secret information. Document-based reversible algorithm uses its words, lines, or formats to complete the concealment of secret information.This paper combines the pixel combination algorithm to carry out the research on the reversible information hiding of the digital images to improve the encryption effect of digital images and reduce the information risk in the information age.


## 2. Pixel Binning Algorithm

### 2.1. Simulated Annealing Algorithm (SAA)

The annealing process of solids belongs to the research field of statistical physics and thermodynamics. According to the existing research results, it can be known that when the temperature of the system is cooled toT, the probability P of particles in the state i inside the equilibrium system is satisfied and the Gibbs regular distribution is satisfied:(1)Pi=exp−Ei/kT∑iexp−Ei/kT.In the formula,Ei is the energy of the particle in the i state, k is the Boltzmann constant, and T is the absolute temperature.The algorithm uses the random number generation algorithm to generate random numbers in the interval (0,1). IfP > 1, the change is an important change; otherwise, it is an unimportant change.(2)Pij=exp−ΔEkT.In the formula, AE is the difference in energy when the system is in statesj and i, respectively, and ΔE=Ej−Ei.Various types of statistical functions must be considered as much as possible, so that the pore structure features contained in the reference image can be fully characterized. The greater the amount of computation required, the greater the effect on the execution efficiency of the algorithm. The definitions of the three are as follows:(3)φ=Ix,(4)Sr=IxIx+r,(5)Lr=∏i=ss+rIi.In the formula, <> represents the average of its internal calculated values,x is the attribute value of the pixel at the x position inside the image, the pore is 1, and the matrix is 0.In order to correspond to the energy in the solid annealing process, the “energy” of the image system to be reconstructed is taken as the weighed sum of the squares of the differences of different types of statistical values between itself and the reference image and is defined as follows:(6)E=∑r=oRαSr−S0r2+βLr−L0r2.In the formula,α and β are the weight values corresponding to different types of statistical functions, respectively, and S(r) and L(r) are, respectively, the values of the different types of statistical functions of the image system to be reconstructed. So(r) and Lo(r) are the different types of statistical function values of the reference image, respectively, and R is the maximum statistical distance that needs to be calculated between the two pixels.Analogous to the annealing process of the previous solid, the acceptance probability of the new system is calculated according to the following formula:(7)P=1,ΔE≤0,exp−ΔET,ΔE>0.In the formula,Ei is the difference between the energy changes before and after the disturbance of the reconstructed system.ΔE=Enew−Eini is the temperature used to simulate the solid annealing process, and a larger value is set in the initial state.Based on the metropolis criteria, the acceptance criteria for rebuilding the system updates are(8)P≥rand0,1.The conventional simulated annealing algorithm is shown in Figure1.Figure 1
Flowchart of the conventional simulated annealing algorithm.That is, after the pixel positions are exchanged, only incremental calculations need to be performed in a specific direction centered on the exchanged pixels.(9)ΔC=Cnew−Cini.From the definition of the two-point probability function given by formula (4), it can be seen that the contribution value of the matrix pixel (represented by 0 in the reconstructed image matrix) to the statistical function is zero. The relationship is expressed as follows:(10)Ctotal=2×Cind,ΔC=Cnew−Cini=2×Cnewind−2×Ciniind.In the formula,Ciniind and Cnewind, respectively, correspond to the values of the pore phase pixel points at the selected positions before and after the exchange of pixel positions.The sum of the relative linear path function contributions of all pores in the system can be expressed as follows:(11)Csum=2×N−r,r≤N,0,r>N.The matrix pixels are denoted asN0−u, N0−d, N0−l, and N0−r , respectively, and the pore pixels are denoted as N1−u, N1−d, N1−l, and N1−r, respectively. Finally, the total number of consecutive adjacent pores centered on the selected pores and matrix pixels is calculated according to the row and column directions, respectively.For the initial system before pixel position exchange, the consecutive adjacent pore phases in the row and column directions can be calculated by the following equations, respectively:(12)Nrowini=N1−l+N1−r+1,Pore,No−l,Matrix,N0−r,Matrix,Ncohmnini=N1−u+N1−d+1,Pore,No−u,Matrix,N0−d,Matrix.Moreover, for the updated system after pixel position exchange, the initial matrix phase is updated to the pore phase and the pore connectivity may be enhanced. Therefore, it is necessary to modify formula (13) at this time to calculate the total number of continuous adjacent pore phases in the row and column directions of the update system, as follows:(13)Nrownew=N1−l,MatrixN1−l,PoreN0−l+N0−r+1,PoreNcohmnnew=N1−u,MatrixN1−d,MatrixN0−u+N0−d+1,Pore,(14)ΔC=Cnew−Cini=2×Nrownew−r+2×Ncolumnnew−r−2×Nrowini−r−2×Ncolumnini−rFormulas (13) and (14) should be replaced by formulas (18) and (19), respectively.(15)Nrowini=0,PoreNo−l,MatrixN0−r,MatrixNcohmnini=N1−u+N1−d+1,PoreNo−u,MatrixN0−d,Matrix,(16)Nrownew=N0−l+Col1−Col0,MatrixN0−l−Col1−Col0,Pore0,PoreNcohmnnew=N1−u,MatrixN1−d,MatrixN0−u+N0−d+1,Pore,(17)Nrowini=N1−l+N1−r+1,MatrixNo−l,MatrixN0−r,PoreNcohmnini=0,PoreNo−u,MatrixN0−d,Matrix,(18)Nrownew=N1−l,MatrixN1−l,PoreN0−l+N0−r+1,PoreNcohmnnew=N0−u+Row1−Row0,MatrixN0−d+Row1−Row0,Matrix0,Pore.In the formula, Row0, Col0 and Row1, Col1 are the row and the column numbers of the selected matrix phase and pore phase, respectively.


### 2.2. Image Preprocessing

Image grayscale is mainly used for color images. Color images contain more information. In order to improve the efficiency of the subsequent image processing, it is necessary to convert them into grayscale images for processing.The grayscale of the color image is mainly realized by weighing the average processing of the three color components in the color image and finally converting them into a gray value. In order to make the grayscaled image more in line with the visual effect of the human eye, formula (20) is usually used to calculate the converted grayscale value of each pixel in the color image.(19)Gray=0.399×R+0.587×G+0.114×B.In the formula, Gray is the converted grayscale value andR, G, and B are the red, green, and blue components of a pixel, respectively.As an example, Figure2 shows the result of a color image grayscaled using the above method. In fact, the above method cannot completely retain all the detailed information in the color image and the grayscale effect of the above method is acceptable if the requirements are not strict.Figure 2
Grayscale color image. (a) Color image and (b) grayscale image.
(a)(b)Image enhancement mainly improves the image quality through the grayscale mapping of images. Grayscale mapping is to directly convert the grayscale value of each pixel in the original image into another new grayscale value according to a certain mapping rule, thereby improving the quality of the image. Specifically, it can be explained by the following formula:(20)gt=Egs.In the formula,gs and gt are the grayscale values before and after the pixel point mapping at a certain position of the image and E is the grayscale mapping function.It is suggested that the brightness adjustment of the image is only suitable for the case where the gray value of the image after the brightness adjustment does not exceed its display range; that is, the gray range of the original image itself is a subset of the range that can be displayed.(21)gt=Egs=gs±a,gt=0,gt<0,255,gt>255.In the formula,a is a constant. The FIB/SEM reference image used by the improved simulated annealing algorithm in the previous section is taken as an example, and the brightness is adjusted. The result is shown in Figure 3. It can be seen that the brightness adjustment is just a shift of the grayscale histogram of the image to the left or right, without any change in the shape of the histogram. Therefore, the brightness adjustment of the image only improves the display effect of the image visually and has no effect on the subsequent image processing, so all the images used in this study are not adjusted for brightness.Figure 3
Image brightness adjustment. (a) Original image, (b) original grayscale histogram, (c) image after the brightness adjustment, and (d) the brightness-adjusted grayscale histogram.
(a)(b)(c)(d)The mean filter operates on the image based on template convolution. It selects ann∗n template (where n = 2k + 1 and k is a positive integer) to move it over the entire area and uses formula (23) to calculate the average value of the neighborhood of a certain pixel. It is used as the gray value of the pixel.(22)gx,y=1n2∑s,t∈Nx,yfs,t.In the formula,N(x, y) corresponds to the n × n neighborhood of the image f(x, y) at the position (x, y).Different coefficients can be selected according to the distance from the center point, and the weighted average of the neighborhood is used to determine the pixel value of the center point. The specific calculation form is as follows:(23)gx,y=∑s,t∈Nx,yws,tfs,t∑s,t∈Nx,yws,t.In the formula,ws,t is the weight of pixels at different distances from the center point.The specific calculation form can be expressed as(24)gmedianx,y=medians,t∈Nx,yfs,t.In essence, the median filtering is a special case of percentage filtering; that is, the gray value at the 50% position of each pixel sequence in the template is selected as the output result. By changing the gray values at different positions of the selection sequence, such as the 0% position or the 100% position, we will get the minimum and maximum filtering, respectively. The specific form is as follows:(25)gminx,y=mins,t∈Nx,yfs,t,gmaxx,y=maxs,t∈Nx,yfs,t.According to the above processing results of mean filter and median filter, take the average value of the minimum filter and maximum filter results as the result output of the new filter, that is, midpoint filter. The specific form is as follows:(26)gmid=12mins,t∈Nx,yfs,t+maxs,t∈Nx,yfs,t=12gminx,y+gmaxx,y.Midpoint filtering combines the advantages of two image denoising methods, average filtering and sorting filtering. The specific processing results are shown in Figure4.Figure 4
Comparison of midpoint filtering results of images under different template sizes. (a) SEM image: from left to right, filter mask sizes are 3 × 3, 5 × 5, and 7 × 7, respectively, and (b) FIB/SEM images: from left to right, the filter mask sizes are 3 × 3, 5 × 5, and 7 × 7, respectively.
(a)(b)


### 2.3. Thresholding Image Segmentation

The basic principle of thresholding image segmentation is very simple. That is, by comparing the gray value of each pixel in the image with the selected threshold, the category of the pixel is determined according to the result of the comparison into target (foreground) or background.(27)gx,y=1,fx,y>T,0,fx,y≤T.In the formula,T is the selected image segmentation threshold, f(x, y) and gx,y are the gray values of the pixels at the position (x, y) before and after segmentation, respectively, and 1 and 0 are the labels assigned to each category of the segmented image.The optimal threshold for image segmentation can generally be expressed in the following form:(28)T=Tx,y,fx,y,px,y.In this paper, we consider an m-level grayscale imagef(x, y) with a size of M × N (where, for an 8 bit grayscale image, m=28 ), G=0,1,...,m−1 is the gray value set of f(x, y) and Ni is the number of pixels with gray value i in f(x, y). Based on the above description, the distribution probability of pixels with gray value i in the gray image f(x, y) can be expressed as follows:(29)pt=NiM×N.Now, we assume that a given thresholdT is selected and the pixels in f(x, y) are divided into two categories by formula (28): target C and background C. Among them, the gray value interval included in C is [0, T] and the gray value interval included in C is [T. +1, m − 1]. The total distribution probabilities of the pixels included in the background C are as follows:(30)ω0=∑i=0Tpi,ω1=∑i=T+1m−1pi.The average grayscale values of the pixels contained in the targetC0 and the background C1 are(31)μ0=1ω0∑i=0Tipi,μ1=1ω1∑i=T+1m−1ipi.The average gray value of all pixels in the imagef(x, y) is(32)μ=∑i=0m−1ipi=ω0μ0+ω1μ1.Based on the above-obtained pixel gray mean and its corresponding distribution frequency, we briefly introduce several currently widely used global threshold determination algorithms and give the specific calculation methods of the threshold used.


#### 2.3.1. Huang Algorithm

Huang algorithm mainly determines the optimal threshold by minimizing the fuzzy measure of the image. The specific calculation form is as follows:(33)ET∗=minT∈GET,ET=−1ln2∑i=0m−1ηilnηi+1−ηiln1−ηipi,ηi=CC+i−μ0,i≤T,CC+i−μ1,i>T..In the formula, C is a constant, which usually selects the difference between the maximum gray value and the minimum gray value of the pixel in the image, that is,C=imax−imin.


#### 2.3.2. MaxEntropy Algorithm

The MaxEntropy algorithm determines the optimal threshold by maximizing the total amount of information about the target and the background in the image. The specific calculation form is as follows:(34)HT∗=maxT∈GHTHT=lnω0ω1−1ω0∑i=0Tpilnpi−1ω1∑i=T+1m−1pilnpi.


#### 2.3.3. Otsu Algorithm

The Otsu algorithm is also known as the maximum interclass variance algorithm. The specific calculation form of the optimal threshold is as follows:(35)σB2T∗=maxT∈GσB2T,σB2T∗=ω0ω1μ0−μ12.


#### 2.3.4. Yen Algorithm

The Yen algorithm determines the optimal threshold by maximizing the total correlation between the target and the background in the image. The specific calculation form is as follows:(36)CT∗=maxT∈GcTCT=2lnω0ω1−ln∑i=0Tpi2∑i=T+1m−1pi2


#### 2.3.5. Valley-Emphasis Algorithm

The Valley-Emphasis algorithm uses different thresholds to segment the image, so that the corrected interclass variance value reaches the maximum and then determines the optimal threshold. The specific calculation form is as follows:(37)VET∗=maxT∈GVETVET=1−pTσB2T.Figure5 shows its corresponding gray distribution histogram.Figure 5
Pixel gray distribution histogram. (a) SEM image and (b) FIB/SEM image.
(a)(b)


## 2.1. Simulated Annealing Algorithm (SAA)

The annealing process of solids belongs to the research field of statistical physics and thermodynamics. According to the existing research results, it can be known that when the temperature of the system is cooled toT, the probability P of particles in the state i inside the equilibrium system is satisfied and the Gibbs regular distribution is satisfied:(1)Pi=exp−Ei/kT∑iexp−Ei/kT.In the formula,Ei is the energy of the particle in the i state, k is the Boltzmann constant, and T is the absolute temperature.The algorithm uses the random number generation algorithm to generate random numbers in the interval (0,1). IfP > 1, the change is an important change; otherwise, it is an unimportant change.(2)Pij=exp−ΔEkT.In the formula, AE is the difference in energy when the system is in statesj and i, respectively, and ΔE=Ej−Ei.Various types of statistical functions must be considered as much as possible, so that the pore structure features contained in the reference image can be fully characterized. The greater the amount of computation required, the greater the effect on the execution efficiency of the algorithm. The definitions of the three are as follows:(3)φ=Ix,(4)Sr=IxIx+r,(5)Lr=∏i=ss+rIi.In the formula, <> represents the average of its internal calculated values,x is the attribute value of the pixel at the x position inside the image, the pore is 1, and the matrix is 0.In order to correspond to the energy in the solid annealing process, the “energy” of the image system to be reconstructed is taken as the weighed sum of the squares of the differences of different types of statistical values between itself and the reference image and is defined as follows:(6)E=∑r=oRαSr−S0r2+βLr−L0r2.In the formula,α and β are the weight values corresponding to different types of statistical functions, respectively, and S(r) and L(r) are, respectively, the values of the different types of statistical functions of the image system to be reconstructed. So(r) and Lo(r) are the different types of statistical function values of the reference image, respectively, and R is the maximum statistical distance that needs to be calculated between the two pixels.Analogous to the annealing process of the previous solid, the acceptance probability of the new system is calculated according to the following formula:(7)P=1,ΔE≤0,exp−ΔET,ΔE>0.In the formula,Ei is the difference between the energy changes before and after the disturbance of the reconstructed system.ΔE=Enew−Eini is the temperature used to simulate the solid annealing process, and a larger value is set in the initial state.Based on the metropolis criteria, the acceptance criteria for rebuilding the system updates are(8)P≥rand0,1.The conventional simulated annealing algorithm is shown in Figure1.Figure 1
Flowchart of the conventional simulated annealing algorithm.That is, after the pixel positions are exchanged, only incremental calculations need to be performed in a specific direction centered on the exchanged pixels.(9)ΔC=Cnew−Cini.From the definition of the two-point probability function given by formula (4), it can be seen that the contribution value of the matrix pixel (represented by 0 in the reconstructed image matrix) to the statistical function is zero. The relationship is expressed as follows:(10)Ctotal=2×Cind,ΔC=Cnew−Cini=2×Cnewind−2×Ciniind.In the formula,Ciniind and Cnewind, respectively, correspond to the values of the pore phase pixel points at the selected positions before and after the exchange of pixel positions.The sum of the relative linear path function contributions of all pores in the system can be expressed as follows:(11)Csum=2×N−r,r≤N,0,r>N.The matrix pixels are denoted asN0−u, N0−d, N0−l, and N0−r , respectively, and the pore pixels are denoted as N1−u, N1−d, N1−l, and N1−r, respectively. Finally, the total number of consecutive adjacent pores centered on the selected pores and matrix pixels is calculated according to the row and column directions, respectively.For the initial system before pixel position exchange, the consecutive adjacent pore phases in the row and column directions can be calculated by the following equations, respectively:(12)Nrowini=N1−l+N1−r+1,Pore,No−l,Matrix,N0−r,Matrix,Ncohmnini=N1−u+N1−d+1,Pore,No−u,Matrix,N0−d,Matrix.Moreover, for the updated system after pixel position exchange, the initial matrix phase is updated to the pore phase and the pore connectivity may be enhanced. Therefore, it is necessary to modify formula (13) at this time to calculate the total number of continuous adjacent pore phases in the row and column directions of the update system, as follows:(13)Nrownew=N1−l,MatrixN1−l,PoreN0−l+N0−r+1,PoreNcohmnnew=N1−u,MatrixN1−d,MatrixN0−u+N0−d+1,Pore,(14)ΔC=Cnew−Cini=2×Nrownew−r+2×Ncolumnnew−r−2×Nrowini−r−2×Ncolumnini−rFormulas (13) and (14) should be replaced by formulas (18) and (19), respectively.(15)Nrowini=0,PoreNo−l,MatrixN0−r,MatrixNcohmnini=N1−u+N1−d+1,PoreNo−u,MatrixN0−d,Matrix,(16)Nrownew=N0−l+Col1−Col0,MatrixN0−l−Col1−Col0,Pore0,PoreNcohmnnew=N1−u,MatrixN1−d,MatrixN0−u+N0−d+1,Pore,(17)Nrowini=N1−l+N1−r+1,MatrixNo−l,MatrixN0−r,PoreNcohmnini=0,PoreNo−u,MatrixN0−d,Matrix,(18)Nrownew=N1−l,MatrixN1−l,PoreN0−l+N0−r+1,PoreNcohmnnew=N0−u+Row1−Row0,MatrixN0−d+Row1−Row0,Matrix0,Pore.In the formula, Row0, Col0 and Row1, Col1 are the row and the column numbers of the selected matrix phase and pore phase, respectively.


## 2.2. Image Preprocessing

Image grayscale is mainly used for color images. Color images contain more information. In order to improve the efficiency of the subsequent image processing, it is necessary to convert them into grayscale images for processing.The grayscale of the color image is mainly realized by weighing the average processing of the three color components in the color image and finally converting them into a gray value. In order to make the grayscaled image more in line with the visual effect of the human eye, formula (20) is usually used to calculate the converted grayscale value of each pixel in the color image.(19)Gray=0.399×R+0.587×G+0.114×B.In the formula, Gray is the converted grayscale value andR, G, and B are the red, green, and blue components of a pixel, respectively.As an example, Figure2 shows the result of a color image grayscaled using the above method. In fact, the above method cannot completely retain all the detailed information in the color image and the grayscale effect of the above method is acceptable if the requirements are not strict.Figure 2
Grayscale color image. (a) Color image and (b) grayscale image.
(a)(b)Image enhancement mainly improves the image quality through the grayscale mapping of images. Grayscale mapping is to directly convert the grayscale value of each pixel in the original image into another new grayscale value according to a certain mapping rule, thereby improving the quality of the image. Specifically, it can be explained by the following formula:(20)gt=Egs.In the formula,gs and gt are the grayscale values before and after the pixel point mapping at a certain position of the image and E is the grayscale mapping function.It is suggested that the brightness adjustment of the image is only suitable for the case where the gray value of the image after the brightness adjustment does not exceed its display range; that is, the gray range of the original image itself is a subset of the range that can be displayed.(21)gt=Egs=gs±a,gt=0,gt<0,255,gt>255.In the formula,a is a constant. The FIB/SEM reference image used by the improved simulated annealing algorithm in the previous section is taken as an example, and the brightness is adjusted. The result is shown in Figure 3. It can be seen that the brightness adjustment is just a shift of the grayscale histogram of the image to the left or right, without any change in the shape of the histogram. Therefore, the brightness adjustment of the image only improves the display effect of the image visually and has no effect on the subsequent image processing, so all the images used in this study are not adjusted for brightness.Figure 3
Image brightness adjustment. (a) Original image, (b) original grayscale histogram, (c) image after the brightness adjustment, and (d) the brightness-adjusted grayscale histogram.
(a)(b)(c)(d)The mean filter operates on the image based on template convolution. It selects ann∗n template (where n = 2k + 1 and k is a positive integer) to move it over the entire area and uses formula (23) to calculate the average value of the neighborhood of a certain pixel. It is used as the gray value of the pixel.(22)gx,y=1n2∑s,t∈Nx,yfs,t.In the formula,N(x, y) corresponds to the n × n neighborhood of the image f(x, y) at the position (x, y).Different coefficients can be selected according to the distance from the center point, and the weighted average of the neighborhood is used to determine the pixel value of the center point. The specific calculation form is as follows:(23)gx,y=∑s,t∈Nx,yws,tfs,t∑s,t∈Nx,yws,t.In the formula,ws,t is the weight of pixels at different distances from the center point.The specific calculation form can be expressed as(24)gmedianx,y=medians,t∈Nx,yfs,t.In essence, the median filtering is a special case of percentage filtering; that is, the gray value at the 50% position of each pixel sequence in the template is selected as the output result. By changing the gray values at different positions of the selection sequence, such as the 0% position or the 100% position, we will get the minimum and maximum filtering, respectively. The specific form is as follows:(25)gminx,y=mins,t∈Nx,yfs,t,gmaxx,y=maxs,t∈Nx,yfs,t.According to the above processing results of mean filter and median filter, take the average value of the minimum filter and maximum filter results as the result output of the new filter, that is, midpoint filter. The specific form is as follows:(26)gmid=12mins,t∈Nx,yfs,t+maxs,t∈Nx,yfs,t=12gminx,y+gmaxx,y.Midpoint filtering combines the advantages of two image denoising methods, average filtering and sorting filtering. The specific processing results are shown in Figure4.Figure 4
Comparison of midpoint filtering results of images under different template sizes. (a) SEM image: from left to right, filter mask sizes are 3 × 3, 5 × 5, and 7 × 7, respectively, and (b) FIB/SEM images: from left to right, the filter mask sizes are 3 × 3, 5 × 5, and 7 × 7, respectively.
(a)(b)


## 2.3. Thresholding Image Segmentation

The basic principle of thresholding image segmentation is very simple. That is, by comparing the gray value of each pixel in the image with the selected threshold, the category of the pixel is determined according to the result of the comparison into target (foreground) or background.(27)gx,y=1,fx,y>T,0,fx,y≤T.In the formula,T is the selected image segmentation threshold, f(x, y) and gx,y are the gray values of the pixels at the position (x, y) before and after segmentation, respectively, and 1 and 0 are the labels assigned to each category of the segmented image.The optimal threshold for image segmentation can generally be expressed in the following form:(28)T=Tx,y,fx,y,px,y.In this paper, we consider an m-level grayscale imagef(x, y) with a size of M × N (where, for an 8 bit grayscale image, m=28 ), G=0,1,...,m−1 is the gray value set of f(x, y) and Ni is the number of pixels with gray value i in f(x, y). Based on the above description, the distribution probability of pixels with gray value i in the gray image f(x, y) can be expressed as follows:(29)pt=NiM×N.Now, we assume that a given thresholdT is selected and the pixels in f(x, y) are divided into two categories by formula (28): target C and background C. Among them, the gray value interval included in C is [0, T] and the gray value interval included in C is [T. +1, m − 1]. The total distribution probabilities of the pixels included in the background C are as follows:(30)ω0=∑i=0Tpi,ω1=∑i=T+1m−1pi.The average grayscale values of the pixels contained in the targetC0 and the background C1 are(31)μ0=1ω0∑i=0Tipi,μ1=1ω1∑i=T+1m−1ipi.The average gray value of all pixels in the imagef(x, y) is(32)μ=∑i=0m−1ipi=ω0μ0+ω1μ1.Based on the above-obtained pixel gray mean and its corresponding distribution frequency, we briefly introduce several currently widely used global threshold determination algorithms and give the specific calculation methods of the threshold used.


### 2.3.1. Huang Algorithm

Huang algorithm mainly determines the optimal threshold by minimizing the fuzzy measure of the image. The specific calculation form is as follows:(33)ET∗=minT∈GET,ET=−1ln2∑i=0m−1ηilnηi+1−ηiln1−ηipi,ηi=CC+i−μ0,i≤T,CC+i−μ1,i>T..In the formula, C is a constant, which usually selects the difference between the maximum gray value and the minimum gray value of the pixel in the image, that is,C=imax−imin.


### 2.3.2. MaxEntropy Algorithm

The MaxEntropy algorithm determines the optimal threshold by maximizing the total amount of information about the target and the background in the image. The specific calculation form is as follows:(34)HT∗=maxT∈GHTHT=lnω0ω1−1ω0∑i=0Tpilnpi−1ω1∑i=T+1m−1pilnpi.


### 2.3.3. Otsu Algorithm

The Otsu algorithm is also known as the maximum interclass variance algorithm. The specific calculation form of the optimal threshold is as follows:(35)σB2T∗=maxT∈GσB2T,σB2T∗=ω0ω1μ0−μ12.


### 2.3.4. Yen Algorithm

The Yen algorithm determines the optimal threshold by maximizing the total correlation between the target and the background in the image. The specific calculation form is as follows:(36)CT∗=maxT∈GcTCT=2lnω0ω1−ln∑i=0Tpi2∑i=T+1m−1pi2


### 2.3.5. Valley-Emphasis Algorithm

The Valley-Emphasis algorithm uses different thresholds to segment the image, so that the corrected interclass variance value reaches the maximum and then determines the optimal threshold. The specific calculation form is as follows:(37)VET∗=maxT∈GVETVET=1−pTσB2T.Figure5 shows its corresponding gray distribution histogram.Figure 5
Pixel gray distribution histogram. (a) SEM image and (b) FIB/SEM image.
(a)(b)


## 2.3.1. Huang Algorithm

Huang algorithm mainly determines the optimal threshold by minimizing the fuzzy measure of the image. The specific calculation form is as follows:(33)ET∗=minT∈GET,ET=−1ln2∑i=0m−1ηilnηi+1−ηiln1−ηipi,ηi=CC+i−μ0,i≤T,CC+i−μ1,i>T..In the formula, C is a constant, which usually selects the difference between the maximum gray value and the minimum gray value of the pixel in the image, that is,C=imax−imin.


## 2.3.2. MaxEntropy Algorithm

The MaxEntropy algorithm determines the optimal threshold by maximizing the total amount of information about the target and the background in the image. The specific calculation form is as follows:(34)HT∗=maxT∈GHTHT=lnω0ω1−1ω0∑i=0Tpilnpi−1ω1∑i=T+1m−1pilnpi.


## 2.3.3. Otsu Algorithm

The Otsu algorithm is also known as the maximum interclass variance algorithm. The specific calculation form of the optimal threshold is as follows:(35)σB2T∗=maxT∈GσB2T,σB2T∗=ω0ω1μ0−μ12.


## 2.3.4. Yen Algorithm

The Yen algorithm determines the optimal threshold by maximizing the total correlation between the target and the background in the image. The specific calculation form is as follows:(36)CT∗=maxT∈GcTCT=2lnω0ω1−ln∑i=0Tpi2∑i=T+1m−1pi2


## 2.3.5. Valley-Emphasis Algorithm

The Valley-Emphasis algorithm uses different thresholds to segment the image, so that the corrected interclass variance value reaches the maximum and then determines the optimal threshold. The specific calculation form is as follows:(37)VET∗=maxT∈GVETVET=1−pTσB2T.Figure5 shows its corresponding gray distribution histogram.Figure 5
Pixel gray distribution histogram. (a) SEM image and (b) FIB/SEM image.
(a)(b)


## 3. Reversible Information Hiding in Digital Images

This paper proposes a reversible information hiding algorithm for the encrypted images based on the pixel combination algorithm. It includes four parts and they are image encryption, information hiding, image decryption, and information extraction. The algorithm framework is shown in Figure6.Figure 6
A structure block diagram of image reversible information hiding algorithm.In order to verify the performance of the algorithm in this paper, the algorithm in this paper is compared with the literature [1] and literature [2]. Table 1 presents a comparison of the net embedding rates of the three algorithms. The results are shown in Table 1 and Figure 7.Table 1
Effect evaluation of the digital image reversible information hiding method based on the pixel combination algorithm.
The method of this paperThe method of literature [1]The method of literature [2]Lena0.97970.31310.6969Airplane0.93930.36360.7272Camera0.97970.48480.6666Man0.95950.27270.6161Tiffany0.97970.32320.6565Peppers0.94940.25250.7272Lake0.91910.21210.6767Baboon0.61610.11110.3232Figure 7
Statistics of the comparative test data.It can be seen from the comparative experiments that the reversible information hiding method for digital images based on the pixel combination algorithm proposed in this paper has a good image information confidentiality effect.


## 4. Conclusion

With the continuous development of reversible digital steganography technology, it has attracted the attention of many researchers. Although the research on reversible digital steganography originated from lossless image authentication, the data embedded in digital images does not necessarily have to be traditional authentication information such as digital signatures. For example, the management and the legal use of military secret maps, the authorized use of military secret images, and the retrieval and labeling of medical image information can all use the reversible digital image technology for data embedding. At the same time, the original carrier data is restored when needed, while the embedded data is extracted. This paper combines the pixel combination algorithm to carry out the research on the reversible information hiding of the digital images. Through comparative experiments, it can be seen that the reversible information hiding method for digital images based on pixel combination algorithm proposed in this paper has a good image information confidentiality effect.



---

*Source: 8627056-2022-07-15.xml*