Optical image encryption via high-quality computational ghost imaging using iterative phase retrieval

A novel computational ghost imaging scheme based on specially designed phase-only masks, which can be efficiently applied to encrypt an original image into a series of measured intensities, is proposed in this paper. First, a Hadamard matrix with a certain order is generated, where the number of elements in each row is equal to the size of the original image to be encrypted. Each row of the matrix is rearranged into the corresponding 2D pattern. Then, each pattern is encoded into the phase-only masks by making use of an iterative phase retrieval algorithm. These specially designed masks can be wholly or partially used in the process of computational ghost imaging to reconstruct the original information with high quality. When a significantly small number of phase-only masks are used to record the measured intensities in a single-pixel bucket detector, the information can be authenticated without clear visualization by calculating the nonlinear correlation map between the original image and its reconstruction. The results illustrate the feasibility and effectiveness of the proposed computational ghost imaging mechanism, which will provide an effective alternative for enriching the related research on the computational ghost imaging technique.


Introduction
Also known as correlated photon imaging [1,2], ghost imaging is a most intriguing optical imaging technique that allows the reconstruction of objects by using intensity correlation. Generally, the imaging setup consists of two optical beams in a conventional pseudo-thermal ghost imaging configuration, where the object beam is usually collected by a single-pixel bucket detector without any spatial resolution and the reference beam diffracted by a diffuser is detected by a spatially resolving detector. Although the object is not placed at the reference beam, it can be decoded by correlating the signals recorded in two detectors. Until now, a large number of new configurations and algorithms on ghost imaging has been developed [3][4][5][6][7][8][9][10].
Since Refregier and Javidi proposed the famous image encryption architecture based on double random phase encoding in the Fourier transform domain [11], numerous optical techniques have been widely applied in the field of information security owing to their high speed parallel processing and multidimensional capabilities [12][13][14][15]. Meanwhile, various optical transforms such as fractional Fourier transform, Fresnel transform, gyrator transform, and other means have been applied, where additional parameters can be considered the secret keys to enhance the level of security [16][17][18][19][20][21][22][23][24][25][26][27][28]. Due to its novel physical characteristics such as the complexity of its optical parameters, the ghost imaging technique can provide a promising alternative for the optical cryptosystem [29][30][31][32][33]. Zhang et al [34] encrypted a fast Fourier transformed image using the compressive ghost imaging system to improve the level of security. Wu et al [35] demonstrated the validity of applying computational ghost imaging for optical multipleimage encryption. Li et al [36] used a compressive ghost imaging system to encode an interim synthesized with multiple images using coordinate sampling. Wang and Zhao [37] designed a ghost imaging scheme with Walsh-Hadamard pattern pairs to realize fast reconstruction. Chen and Chen [38] reported a ghost imaging based authentication using binary signals to implement data compression. Chen [39] presented correlated-photon secured imaging where the phase-only masks were extracted from known random intensity maps. Jiang et al [40] proposed an information security scheme where the ciphertext is obtained by summing the weighted secret keys to guarantee the security. Zhang et al [41] used disordered speckles in a ghost imaging system to assure higher security with a small key. Qin and Zhang [42] used a customized data container to ensure the lossless recovery of primary information in the conventional ghost imaging based encryption scheme. In the row scanning compressive ghost imaging scheme described in [43], the original images became sparse patterns using lifting wavelet transform.
Through analyzing most of the aforementioned based image encryption schemes, it can be found that there are two main disadvantages in the process of ghost imaging. First, the quality of the reconstructed image from the measured intensities collected by a single-pixel bucket detector need to be further improved. Because random phase-only masks embedded into a spatial light modulator in the object beam path contain overlap information, the number of these masks would be huge to obtain the reconstructed image with high quality. Second, it is very inconvenient in storage and transmission when a large amount of phase-only masks are considered as secret keys. To overcome these shortcomings, we propose a novel computational ghost imaging scheme based on specially designed phase-only masks to encrypt original images. Although the optical implementation is similar to the conventional configuration, the use of these specially designed phase-only masks can reduce the number of measured intensities greatly. These masks are deduced from a spatially orthogonal Hadamard matrix by using an iterative phase retrieval algorithm, which sharply decreases the redundancy between them. Besides these masks, the setup parameters such as light wavelength and axis distance in the process of computational ghost imaging are applied as significant secret keys to enhance system security. Meanwhile, a significantly small number of measured intensities can be used to verify original information by using a nonlinear correlation algorithm.
The remainder of this paper is organized as follows. In section 2, the proposed computational ghost imaging scheme based on specially designed phase-only masks is introduced in detail. Meanwhile, the retrieval process of these masks from the Hadamard matrix with a certain order is discussed. In section 3, the experimental results are presented with a security analysis. Finally, a brief conclusion is provided in section 4.

Scheme description
As a novel technique to allow the reconstruction of an object by means of intensity correlation between two optical beams in a conventional pseudo-thermal ghost imaging configuration [1], the signal beam scattered at the object arm is detected by a single-pixel bucket detector and the reference beam diffracted by a rotating diffuser at the reference arm is collected by a spatially resolving detector such as a charge-coupled device. Shapiro [44] described a computational ghost imaging arrangement by computing the intensity patterns detected in the reference arm offline, which yields background-free images and controls their resolution and field of view via adjusting spatial light modulator parameters. Bromberg et al [45] experimentally demonstrated that a pseudo-thermal ghost imaging can be implemented with only a single detector by introducing a set of random phase profiles using a computer-controlled spatial light modulator. It is worth noting that the main complexity of this modified configuration is mainly caused by the calculation rather than the experimental apparatus.
To improve the quality of the reconstructed object retrieved from a certain number of intensity distributions collected in the object arm, a mechanism of computational ghost imaging is proposed based on specially designed phase-only masks, which has a configuration similar to that of the conventional optical system. The experimental setup is schematically shown in figure 1, where the laser beam is collimated for the illumination and a set of different random phase-only masks are input into the spatial light modulator in turn. The wave is modulated by the phase-only mask, and the resultant random speckle pattern passes through the object at an axis distance from the spatial light modulator plane. The intensity distribution, denoted as B i , is collected by the bucket detector without spatial resolution located just behind the object plane, which can be mathematically expressed as Here, T (µ, υ) is the transmission function of the object, is the free-space propagation field about the phase-only mask exp ( jϕ i (x, y)), and (µ, υ) denotes the transversal coordinates of the object plane. For each phase-only mask exp ( jϕ i (x, y)) embedded into the spatial light modulator, the related freespace propagation field at axis distance z can be conducted by using the Fresnel diffraction as Here, * denotes the convolution calculation and h (x, y, z) is the point pulse function of the Fresnel propagation, which is defined as Here, λ is the wavelength of the laser beam. In order to reconstruct the object, the intensity distributions collected by the bucket detector are cross-correlated with the aforementioned speckle patterns derived from the known phase-only masks. Suppose the total number of the collected intensity distributions is N, then the reconstructed object can be mathematically described as Here, · is the ensemble average calculation. Differing from conventional computational ghost imaging, different random phase-only masks embedded into the spatial light modulator are substituted with the specially designed ones in the proposed configuration, which can reconstruct the object with high quality using a small number of correlated intensities. The specially designed phase-only masks are generated using the modified Gerchberg-Saxton algorithm, where the Walsh-Hadamard patterns are applied as the amplitude constraint in the iterative phase retrieval process. The basic block with order 2 is usually applied to build the Hadamard matrix with any order, which is mathematically defined as Then, the Hadamard matrix with order 2 k can be obtained with the following recursive formula as Obviously, a Hadamard matrix with any order is square and symmetric, where each element equals +1 or −1. Suppose the size of the specially designed phase-only mask is M × N pixels, which satisfies the condition as M × N = 2 k . After the Hadamard matrix with order 2 k is calculated with equations (5) and (6), each row can be rearranged into a 2D pattern image with M × N elements, from which a specially designed phase-only mask is retrieved using an iterative phase retrieval algorithm. Thereafter, a total of 2 k phase-only masks can be generated from this Hadamard matrix, which can be wholly or partially used in the process of computational ghost imaging. Denoting one of the rearranged pattern images as f i (µ, υ) and the corresponding phase-only mask as exp ( jϕ i (x, y)), which are respectively located in the image plane and the phase-only mask plane, the iterative process is described as follows: (1) Firstly, an estimated phase mask exp jϕ (0) i (x, y) in the phase-only mask plane is generated, which will be updated in the following iterative rounds. The initial phase distribution ϕ y) is composed of a statistically independent white sequence in the range [0, 2π], which has M × N elements.
(2) In the nth round, the wave propagation forward to the image plane is performed. The resultant complex-valued wavefront is described as Here, FwP denotes the free-space wave propagation with the light wavelength λ and axial distance z.
The pattern image f i (µ, υ) is applied as the amplitude constraint in the image plane to update the above wavefront U Here, arg (·) is used to extract the phase function of the argument. (4) The wave back-propagation is implemented from the image plane to the phase-only mask plane, and the corresponding process can be expressed as It should be pointed out that only the phase part i (x, y) of the propagation result is preserved for the next round when the iterative process will not be stopped. The phase function in the next round can be mathematically described as (5) To judge whether the iterative process has stopped, the correlation coefficient (CC) between the amplitude of the estimated output U (n) i (µ, υ) 2 and the desired pattern image f i (µ, υ) is calculated as the convergent criterion, which is defined as Here, E [·] denotes the expected value operator. For brevity, the coordinates are omitted. Usually, a real value very close to 1 is set as the threshold of the CC, which can guarantee that the best iteration result is achieved. (6) Repeat the above steps (2)-(5) until the CC value reaches the pre-defined threshold. Once the iteration process is finished, the last updated result exp jϕ (n+1) i (x, y) will be considered as the specially designed phase-only mask.
To illustrate the iterative process of the aforementioned specially designed phase-only mask, a flow chart is given in figure 2. It should be pointed out that the elements with value −1 in the rearranged pattern image will be set to 0. Due to the potential application in the field of optical image

Results and analysis
In the computational ghost imaging encoded system shown in figure 1, the plane wave from a He-Ne laser emitting at 632.8 nm is used for the illumination. In the process of collecting intensity distributions, a series of specially designed phase-only masks exp ( jϕ i (x, y)) , i = 1, 2, . . . , K, are sequentially input into the spatial light modulator, whose resolution are 64 × 64 pixels with a 20 µm pixel pitch. The propagation distance between the spatial light modulator and the bucket detector plane is 7.4 cm, while the laser beam waist is 740 µm. By the van Cittert-Zernike theorem, the speckle size at the object plane can be calculated with δ (z) = λz/πω and ω is the laser beam waist, which roughly leads to 20 µm. Figure 3(a) shows a typical pattern generated from one row of the Hadamard matrix with order 2 12 , which indicates that the size of the pattern is 64 × 64 pixels. Figure 3(b) shows its corresponding phase-only mask retrieved with the modified Gerchberg-Saxton algorithm. The relationship between the number of iterations and CCs is plotted in figure 3(c), from which it is obvious that the phase retrieval process has a high convergence rate. After 15 iterations, the CC value can achieve above 0.95. Most importantly, there should be no strong correlation between any two phase-only masks in the process of ghost imaging. Figure 3(d) depicts the correlations among these specially designed phase-only masks, where each coefficient is calculated between the first mask and one of other ones. It can be seen that these phase-only masks are strongly uncorrelated, which means that these masks can satisfy the system requirement. Figure 4(a) shows a binary image with 64 × 64 pixels, where the pattern represents the meaning of Buddha in Chinese. It is designed by oneself and encrypted using the proposed computational ghost imaging scheme. When all specially designed phase-only masks are sequentially embedded, a 1D vector composed of 4096 measured intensities collected using the bucket detector is considered as the ciphertext. Figure 4(b) depicts the distribution of the ciphertext, from which the information of the original image cannot be deduced. Besides phase-only masks, some parameters such as wavelength and axis distance are usually considered as secret keys in optical image encryption schemes. When all secret keys are correctly applied, the reconstructed image obtained by using the second-order correlation algorithm described as equation (4) is shown in figure 4(c). It is evident that the result is satisfactory so that a significant structure to the original pattern can be clearly observed with naked eyes. To evaluate the performance of the proposed scheme, the peak signal noise ratio (PSNR) between the original image f and the reconstructed one g is mathematically calculated as For brevity, the coordinates are omitted. The mean squared error (MSE) between them is expressed as For the result shown in figure 4(c), the PSNR and the CC are 13.2532 dB and 0.9693, respectively. In addition, the quality of reconstructed image can be further improved through subsequent processing with optimization methods such as smooth l 0 algorithm [46]. The reconstructed image with high fidelity is shown in figure 4(d), for which the PSNR is almost equal to 1 as well as the CC achieve 274.8202 dB.
In an optical security system, the number of phase-only masks should be reduced as soon as possible, which is convenient for the storage and transmission of these secret keys. When 40.0%, 60.0%, and 80.0% of the specially designed phase-only masks are sequentially embedded into the spatial light modulator to collect the measured intensities, the reconstructed images are displayed in figures 5(a)-(c), respectively. It can be seen that the quality of the reconstructed image continually improves with the increase of the number of measured intensities. Although the image shown in figure 5(a) is very blurred, the content can still be observed. The PSNRs for figures 5(a)-(c) are 7.4861, 8.6102, and 9.7460 dB, respectively. The corresponding CCs are 0.6216, 0.7568, and 0.8761, respectively. If the original image does not need to be observed visually, a significantly small number of measured intensities can be used to verify its presence using a nonlinear correlation algorithm [39]. Figure 6(a) shows the reconstructed noise-like image when only using 3.0% of the phase-only masks, which cannot convey any valid information. The corresponding nonlinear correlation map with a remarkable peak is shown in figure 6(b) and indicates the existence of the original image.
To analyze the security of phase-only masks, an eavesdropping test should be conducted under the assumption that a potential hacker can illegally access a portion of the mask keys. Supposing all the specially designed phase-only masks are used to collect intensities, a certain part of these masks is known by the hacker and others are substituted with randomly generated phase-only masks. The reconstructed images are shown in figures 7(a)-(d) when 30.0%, 40.0%, 50.0%, and 60.0% of phase-only masks are eavesdropped, respectively. The PSNRs for figures 7(a)-(d) are 6.4275, 6.8899, 7.3275, and 7.4377 dB, respectively. The corresponding CCs are 0.2868, 0.3994, 0.4911, and 0.5876, respectively. It can be seen that only when the hacker knows at least 60.0% of these  masks he will be able to discern the content of the original image more clearly.
As important secret keys, the optical parameters such as wavelength and axis distance can provide additional protection to ensure that the ciphertext cannot be easily cracked. In the proposed scheme, when the wrong wavelength with an error of ±50 nm is used to reconstruct the original image, the results are respectively shown in figures 8(a) and (b), from which no information related to the input can be observed visually. Similarly, the reconstructed images as shown in figures 8(c) and (d) do not contain sufficient content about the original pattern when the wrong axis distance with deviation of ±5 mm is applied. It is illustrated that these optical parameters used in the process of computational ghosting imaging play a vital role in enhancing the security of the cryptosystem.
It is worth noting that a gray-scale image can be encrypted efficiently using the proposed computational ghost imaging based scheme. As shown in figure 9(a), a pattern with 64 × 64 pixels cropped from the central part of the image 'Lena' is considered as the original information, which was chosen  from the USC-SIPI image database [47]. The result reconstructed from all measured intensities using the second-order correlation algorithm is shown in figure 9(b). Although the image is somewhat blurred, the content of the original pattern can be distinguished completely. The PSNR and the CCs are 24.5876 dB and 0.9705, respectively. Figure 9(c) shows the optimized pattern using the smooth l 0 algorithm, where its PSNR is every close to 1 and its CC achieves 261.8366 dB. If 6.0% of the specially designed phase-only masks are used, the reconstructed pattern shown in figure 9(d) does not render any information visually. However, the nonlinear correlation map between the input pattern and reconstructed one shown in figure 9(e) has a shark peak over the noisy background, which can verify the presence of original information. It should be pointed out that there is a certain increase in the number of phase-only masks applied in the process of the computation of ghost imaging, because a gray scale image possesses a larger spectrum range and more information than a binary one. Other analysis results similar to the binary pattern can be obtained.

Conclusion
In summary, a novel optical image encryption scheme utilizing computational ghost imaging has been presented based on a series of the specially designed phase-only masks. Each mask is retrieved from a pattern image using a modified Gerchberg-Saxton algorithm, and the pattern image is generated with one of the rows of the Hadamard matrix with a certain order. It has been illustrated that the quality of the reconstructed images can be noticeably improved when the measured intensities collected with all phase-only masks are used. Meanwhile, it has been found that the reconstructed image can be authenticated efficiently without clear visualization when a significantly small number of phase-only masks are used in computational ghost imaging. Besides these phase-only masks, the security of the cryptosystem can be effectively guaranteed by considering optical parameters such as light wavelength and axis distance as the secret keys. It is believed that this research on the specially designed phase-only masks will enrich the functionality of computational ghost imaging techniques further.