Abstract
In this article, a framework of privacy-preserving inpainting for outsourced image and an encrypted-image inpainting scheme are proposed. Different with conventional image inpainting in plaintext domain, there are two entities, that is, content owner and image restorer, in our framework. Content owner first encrypts his or her damaged image for privacy protection and outsources the encrypted, damaged image to image restorer, who may be a cloud server with powerful computation capability. Image restorer performs inpainting in encrypted domain and sends the inpainted and encrypted image back to content owner or authorized receiver, who can acquire final inpainted result in plaintext domain through decryption. In our encrypted-image inpainting scheme, with the assist of Johnson–Lindenstrauss transform that can preserve Euclidean distance between two vectors before and after encryption, the best-matching block with the smallest distance to current block can be found and utilized for patch filling in Paillier-encrypted image. To eliminate mosaic effect after decryption, weighted mean filtering in encrypted domain is conducted with Paillier homomorphic properties. Experimental results show that our privacy-preserving inpainting framework can be effectively applied in secure cloud computing, and the proposed encrypted-image inpainting scheme achieves comparable visual quality of inpainted results with some typical inpainting schemes in plaintext domain.
Introduction
Image inpainting is also known as image retouching, the idea of which is inherited from ancient technique of manually repairing valuable artworks in an indiscernible way. 1 Inpainting of digital images has found applications in such fields as repairing of historical photographs, 2 filling in or removing the selected region in images, 3 and wiping off visible watermarks. 4 In recent years, some studies have also been investigated to utilize image inpainting technique in deinterlacing, 5 image compression,6,7 image self-recovery,8,9 data hiding, 10 and repairing missing blocks of JPEG images due to poor channels. 11 As for traditional image restoration, the regions for restoring generally include both noise and useful information. However, the damaged or missing regions to be inpainted often contain no useful information. Hence, the task of inpainting is to produce or create image regions that initially do not exist at all, according to the available information in close neighborhood and some mathematical models. Currently, there are four main categories of image inpainting methods, including interpolation-based methods,12–15 partial differential equation (PDE)-based methods,1,2,16–18 exemplar/patch-based methods,3,19–21 and learning-based methods.22–25 A brief review of these inpainting methods is given in section “Related works.”
Nowadays, with the prosperous development of Internet and mobile network, cloud storage and computing have become more and more prevalent. Due to the limit storage space and computation capability, the users can upload their multimedia data (such as texts, images, audios, and videos) through network, and various kinds of data computing required by users can be outsourced and implemented by cloud server. However, although cloud computing brings promising conveniences, the security issue is also raised at the same time because of the user privacy problem. 26 In other words, users are afraid that their private data will be leaked, or cloud server and the third party may abuse their data. Therefore, a secure and reasonable solution is to encrypt the user data before outsourcing to the cloud for privacy protection, and the cloud server can perform data computing in the encrypted domain. Then, after conducting decryption for the received data from cloud server, the user can obtain the processed data with desirable effects in the plaintext domain. Based on this application scenario and requirements, in recent years, the studies of secure signal processing in encrypted domain have been widely investigated, such as transform, 27 compression, 28 denoising, 29 feature extraction, 30 and data hiding31,32 for encrypted data.
In this article, we mainly focus on the problem of privacy-preserving inpainting for outsourced images. The aim of this problem is to realize the inpainting for encrypted, damaged images of users on the cloud server without sacrificing user privacy. Currently, although many image processing tools have modules to inpaint images, there are still a lot of manual operations that should be involved. In addition, these tools are often not free, and if we just have only a few images required to be inpainted, it is actually not a cost-effective choice to pay for these software. However, if we need to conduct inpainting for a large number of images, these professional tools often involve many manual operations and complex calculations during the implementation on the user client with limited computation capability and power. If we decide to outsource the inpainting work to the cloud, the privacy of image owner must be considered, which means the images to be inpainted should be encrypted at first. However, after the images are encrypted to prevent information leakage, there are also few related information that can be utilized in the encrypted domain for inpainting. Hence, the challenging and innovative task of outsourcing encrypted, damaged images to the cloud for automatic inpainting without leaking privacy deserves our in-depth investigations and has a lot of application scenarios. To the best of our knowledge, the reported works of inpainting all focused on the plaintext domain, and there have been no published literatures about image inpainting in the encrypted domain.
In this work, we propose a damaged image inpainting scheme based on a new privacy-preserving inpainting framework. The main contributions of the proposed scheme are summarized as follows: (1) The operation of image inpainting in our scheme is completely implemented in the encrypted domain, and image restorer cannot access any information of plaintext-image contents; (2) To calculate priority order and find similar blocks in encrypted image, with the assist of Johnson–Lindenstrauss (JL) transform that preserves Euclidean distance between two vectors before and after encryption, the best-matching, intact block can be found in the source region, and the intact patch is exploited to fill the damaged patch in homomorphic encrypted image; (3) To eliminate the undesirable mosaic effect after decryption, the weighted mean filtering in the encrypted domain is performed using the properties homomorphic cryptosystem; (4) Besides protecting the privacy of image owner, the proposed encrypted-image inpainting scheme can achieve comparable performance of inpainted-image quality with respect to some typical inpainting schemes for plaintext images.
The rest parts of the article are organized as follows. Section “Related works” presents brief reviews of image inpainting and homomorphic encryption. Section “Proposed scheme” describes the detailed procedures of the proposed privacy-preserving inpainting scheme for outsourced image, including image encryption, inpainting for encrypted image, and image decryption. Experimental results and analysis are presented in section “Experimental results and analysis.” Section “Conclusion” concludes the article.
Related works
Image inpainting
Generally speaking, current image inpainting methods can be categorized as non-learning-based methods and learning-based methods. Learning-based inpainting methods22–25 often require a large-scale set of intact images for training with a specific deep neural network and then learn how to generate a reasonable repaired result for damaged region in a given image. Non-learning-based inpainting methods depend on the characteristic of autocorrelation within natural image, which usually exploit intact information only in current given image beyond its damaged region and use the exploited intact information to repair damaged region seamlessly in different ways, such as interpolation,12–15 PDE propagation,1,2,16–18 and patch synthesis.3,19–21
Interpolation-based methods
Shih et al. 12 proposed a multi-resolution method using pixel interpolation. In their method, the damaged image for inpainting was segmented into blocks, and the segmentation was conducted until the variances of sub-blocks were smaller than a pre-determined threshold. Damaged pixel was then repaired through the mean value of current sub-block or sub-block of previous level. Another image inpainting scheme with interpolation strategy was proposed in Shih et al., 13 which evaluated neighboring information of each pixel to be inpainted and decided the size of reference window that can be exploited to calculate an interpolated color. However, these methods may lead to blurring effects when damaged pixels were close to image edges.
PDE-based methods
This type of methods was motivated by intensive works on the use of variational and PDE methods in image processing. Bertalmio et al. 2 established an inpainting mathematical model by borrowing ideas from classic fluid dynamics. By iteratively solving the numerical representation of a PDE, intact information of neighboring areas can be smoothly propagated into damaged region along isophote direction. Guided by the connectivity principle of human visual perception, Chan and Shen 16 proposed a non-texture image inpainting method with a third-order PDE, which essentially was an anisotropic diffusion process based on the total variation (TV) model. 17 To meet the requirements of human vision, diffusion intensity was related to the curvature. Even if the remaining objects were disconnected far apart by damaged region, this method can still output acceptable inpainted result. However, the PDE-based methods cannot deal with the large-area inpainting very well and often introduced heavy computation complexity due to high-order mathematic models.
Exemplar/patch-based methods
This type of methods employed the strategy of texture synthesis 33 to repair larger damaged region. Criminisi et al. 20 presented an exemplar-based image inpainting method, which can be used for both region filling and object removal. This method implemented the task of patch synthesis through a best-first filling mechanism, and the value of priority for each patch depended on the percentage of intact pixels and the angle between the isophote and contour normal on the center pixel. After locating the patch with the maximum priority in damaged region, the most similar patch was selected for substitution from the intact region in the image, and then the priority values should be updated to continue above process repeatedly. Inpainting procedure was terminated till all damaged patches were repaired. This method can achieve better inpainted results for larger damaged region than the PDE-based methods, although it may leave some artificial seams between the patches.
Learning-based methods
In recent years, a lot of works have applied the convolutional neural network (CNN) to image inpainting, such as Iizuka et al. 22 and Pathak et al. 25 In these tasks, training samples were utilized to train the deep CNN so that they can estimate the pixel strength of the damaged region in the input image. 24 Benefiting from large-scale training data, these learning-based methods can produce semantic specious inpainting results. However, the existing CNN-based inpainting methods usually completed damaged region by propagating convolution feature to the fully connected layer, which sometimes made the inpainted results lack fine texture details with blurring. Another powerful family of learning-based inpainting methods with deep generative model 23 has also been proposed through introducing the adversarial loss to improve the visual quality of the inpainted results. Generally speaking, learning-based methods can achieve superior global semantic structures of inpainted results compared with non-learning-based methods, while non-learning-based methods can obtain fine local textures of inpainted results with much less computational complexity.
In this work, we mainly focus on the non-learning-based image inpainting methods, which have efficient and clear algorithms to follow and are more possible to be implemented in the encrypted domain with privacy-preserving capability than the learning-based methods.
Homomorphic encryption
To achieve computing in the encrypted domain, appropriate encryption methods should be first addressed. Homomorphic encryption generally includes partially homomorphic encryption (PHE), fully homomorphic encryption (FHE), and somewhat homomorphic encryption (SHE). PHE allows either addition or multiplication operations. Rivest et al. 34 proposed a homomorphic encryption algorithm, which can maintain some algebraic relationships between the plaintext and the ciphertext. These relationships can be exploited to realize the computation for encrypted data effectively. Afterward, several probabilistic public-key cryptosystems were presented, such as ElGamal 35 cryptosystem, Paillier 36 cryptosystem, and Damgård and Jurik 37 cryptosystem, and these cryptographic algorithms only had one homomorphic property, that is, addition or multiplication. For example, Paillier cryptosystem only had the addition homomorphism, which means that the addition of two plaintexts can be achieved through performing some operations on the two corresponding ciphertexts. FHE allows arbitrary number of addition and multiplication operations. 38 In other words, FHE can realize the homomorphisms of addition and multiplication simultaneously, and theoretically speaking, it can solve any privacy-preserving computation problems. SHE allows addition and multiplication operations, but the number of operations is limited. 39
Proposed scheme
In this section, we first present a new privacy-preserving inpainting framework for outsourced image, which can be effectively applied in the environment of cloud computing. Generally speaking, there are two entities in our framework, that is, content owner and image restorer, see Figure 1. Content owner, who has no professional inpainting capability, wants to have his or her damaged image repaired without disclosing image contents for privacy preserving. Hence, the ideal framework for this application scenario is that the content owner first encrypts the damaged image for inpainting and outsources the encrypted image to the image restorer, who may be a cloud server with powerful computation capability. Then, the restorer can conduct the inpainting operation for the damaged image effectively in the encrypted domain and sends the inpainted, encrypted image back to the content owner or the legal receiver, who can directly obtain the inpainted result in plaintext domain through image decryption.

Framework of privacy-preserving inpainting for outsourced image.
To achieve the above described functions in the framework, a specific encrypted-image inpainting scheme is also proposed. Content owner first chooses a target region

Flowchart of the proposed encrypted-image inpainting scheme.
Image encryption
To protect the privacy of content owner, the damaged image
Encryption with Paillier homomorphic cryptosystem
The content owner first encrypts each pixel of the damaged image
where φ denotes the encryption function based on homomorphic cryptosystem, m(i, j) denotes the value of the pixel in
In our scheme, Paillier
36
homomorphic encryption belonging to the RSA-based probabilistic public-key cryptosystem is utilized. In Paillier homomorphic encryption, the content owner first chooses two large primes p and q randomly and calculates n = p·q and λ = lcm(p − 1, q − 1), where lcm(·) denotes the function of the least common multiple. Then, an integer g∈
After generating the public key and the private key, the encryption for each pixel in
where each pixel value for encryption, that is, the plaintext m(i, j) ∈
Actually, besides Paillier homomorphic encryption, the encryption method to generate
Encryption with JL transform
To achieve the operation of block matching in our encrypted-image inpainting, the JL transform, which can not only reduce dimension but also retain Euclidean distance, 40 is also utilized for image encryption. The property of JL transform is based on the following lemma.
Lemma 1
For an arbitrary set
where
Through JL transform, a d-dimension vector can be converted to a k-dimension vector, and the Euclidean distance of two d-dimension vectors is approximate to that of the corresponding two k-dimension vectors after the transform. In Kenthapadi et al.,
41
they analyzed the security of JL transform and proved that JL transform can be utilized for data encryption effectively. In our scheme, a random matrix
When encrypting the damaged image
where
Generation of mask image
Similar with the conventional image inpainting in the plaintext domain, the location of the image region to be inpainted should be provided to the restorer, who does not compromise the security of the scheme. Therefore, a binary mask image
where θ(i, j) is the value of the pixel at the coordinate (i, j) in the mask image
After the above operations, including Paillier encryption, JL transform, and mask generation, the content owner sends the obtained results
Inpainting for encrypted image
After receiving the two encrypted images

Illustration of patch filling by exemplar-based texture synthesis in encrypted domain.
A source region
Block priority calculation
To inpaint the target region
Based on the above analysis, in our scheme, two conditions are considered during the calculation of the block priority: (1) the center pixels of the blocks with higher priorities should be on the boundary of
where the function
It should be noted that, the size l × l of the blocks for priority calculation and further block matching may have influence on the performance of inpainting. Too small size of the blocks will weaken texture features in the inpainted results. However, if the block size is too large, inpainted results will appear the serious mosaic effect. In addition, the size r × r of the source region
Block matching and patch filling
After obtaining the block
The operation of block matching is based on the property of Euclidean distance preserving for JL transform. To conduct block matching and patch filling, the distance between the block
where (x, y) is the coordinate displacement of
where
Through obtaining the best-matching block
where (x*, y*) is the coordinate displacement of
where
where θ′(i, j) is the updated value of the pixel at the coordinate (i, j) in the new mask image
According to the above described steps, the operations of block priority calculation, block matching, and patch filling are iteratively implemented for the updated target region
Region smoothing with weighted mean filtering
Because the process of patch filling in section “Block matching and patch filling” is performed in a blockwise manner, thus, undesirable mosaic effect may appear in the target region
In our scheme, after patch filling, image restorer conducts region smoothing for the target region
Assume m(i1, j1) and m(i2, j2) as the values of two pixels at the coordinates (i1, j1) and (i2, j2) in plaintext domain, respectively. Denote ρ(i1, j1) and ρ(i2, j2) as the encrypted results of m(i1, j1) and m(i2, j2) based on Paillier homomorphic encryption (refer to section “Encryption with Paillier homomorphic cryptosystem”), see equation (16)
Then, the following three equations (17)–(19) can be acquired, where k is an integer
It can be observed from equations (17)–(19) that, under Paillier cryptosystem, ρ(i1, j1)·gk mod n2 is a valid encrypted result for m(i1, j1) + k, ρ(i1, j1) ·ρ(i2, j2) mod n2 is a valid encrypted result for m(i1, j1) + m(i2, j2), and ρk(i1, j1) mod n2 is a valid encrypted result for k·m(i1, j1), respectively.
As for the weighted mean filtering in the plaintext domain, the current pixel m(i, j) in target region
where
where
where ρ′(i, j) denotes the value of the encrypted pixel at coordinate (i, j) in
After all pixels ρ′(i, j) in
Image decryption
After receiving the final inpainted, encrypted image
where m′(i, j) denotes the decrypted result of ρ″(i, j) based on Paillier
36
cryptosystem. Then, since the weight vector
where m″(i, j) denotes the value of the pixel at coordinate (i, j) of the final inpainted image
Experimental results and analysis
To demonstrate the effectiveness and superiority of the proposed scheme, a large number of test images were applied to conduct privacy-preserving image inpainting in the encrypted domain. In addition, we also compared the performance of inpainted quality between our scheme and some typical image inpainting schemes in the plaintext domain. Note that, in real applications, we often do not have original intact images. In the experiments, original intact images were just used to generate corresponding damaged images and to evaluate the visual quality of inpainted results as the references. Some of the images used in experiments and analysis, including Lena, Baboon Portofino, Zelda, Lake, House, Peppers, and Elaine, are illustrated in Figure 4.

Some of the test images. (a) Lena. (b) Baboon. (c) Portofino. (d) Zelda. (e) Lake. (f) House. (g) Peppers. (h) Elaine.
Examples of the proposed scheme
In the proposed scheme, the inpainting operation is performed on the encrypted, damaged image

Encrypted results based on Paillier homomorphic encryption for Lena. (a) Original image. (b) Mask image

Encrypted results based on Paillier homomorphic encryption for Baboon. (a) Original image. (b) Mask image
After image encryption, the encrypted, damaged images were outsourced to image restorer for inpainting in the encrypted domain through the method described in section “Inpainting for encrypted image” (including patch filling and region smoothing). Then, the inpainted results in encrypted domain were sent back to the content owner or authorized receiver. Finally, after image decryption, the inpainted images in the plaintext domain were acquired. Figures 7 and 8(a) show the inpainted images in the encrypted domain for the two encrypted, damaged images Lena and Baboon in Figures 5 and 6(d), respectively, and their corresponding inpainted results in the plaintext domain (i.e. after image decryption) are presented in Figures 7 and 8(b). In our experiments, the two typical indices, peak signal-to-noise ratio (PSNR) and structural similarity (SSIM),
42
were utilized to evaluate visual quality of inpainted images in plaintext domain. Obviously, the greater the values of PSNR and SSIM are, the better visual quality of the inpainted image

Inpainted results for Lena. (a) Inpainted image

Inpainted results for Baboon. (a) Inpainted image
Parameter analysis
In our encrypted-image inpainting scheme, there are four main parameters: s and k in JL transform (section “Encryption with JL transform”), the size l × l of the block for priority calculation and matching (section “Block priority calculation”), and the size r × r of source region for conducting block matching (section “Block matching and patch filling”). The influence of inpainting performance with respect to these parameters is analyzed detailedly in the following. The experiments for parameter analysis in this subsection were conducted on the standard images sized 512 × 512. Besides Lena (τ = 4.93%) and Baboon (τ = 5.20%) in Figures 5 and 6(c), the other two standard images Portofino and Zelda were also used and their damaged rates τ are 3.98% and 3.95% with random forms, respectively.
Parameters s and k in JL transform
During the image encryption of JL transform, a random matrix
Visual quality of inpainted results under different s and k of JL transform (l = 11, r = 33).
PSNR: peak signal-to-noise ratio; SSIM: structural similarity.

Three local patterns used in image encryption based on JL transform. (a) s = 5. (b) s = 9. (c) s = 25.
Parameter of size l × l for block priority calculation and block matching
The procedure of encrypted-image inpainting described in sections “Block priority calculation” and “Block matching and patch filling” is performed in the blockwise manner. For each pixel c in the target region Ω, a block

Visual quality of inpainted results under different sizes l × l of block
Parameter of size r × r for source region Φ
In our scheme, the source region Φ for searching the best-matching block can be defined as the entire image excluding the target region

Visual quality of inpainted results under different sizes r × r for source region
Comparisons with plaintext-domain inpainting schemes
To demonstrate the effectiveness of our scheme, we compared the decrypted, inpainted results of our proposed ciphertext-domain inpainting scheme with those of the three famous plaintext-domain inpainting schemes, that is, TV-based scheme by Shen and Chan, 17 Navier–Stokes PDE-based scheme by Bertalmio et al., 2 and exemplar-based scheme by Criminisi et al. 20
Figure 12 shows the inpainted results for Lena, Baboon, Lake, and House, in which the first column to the fifth column denote the damaged images, the results of the proposed scheme after image decryption, scheme by Shen and Chan, 17 scheme by Bertalmio et al., 2 and scheme by Criminisi et al., 20 respectively. The damaged images Lena in Figure 12(a1) and Baboon in Figure 12(a2) are the same as those in Figures 5(c) and 6(c) with damaged rates τ = 4.93% and τ = 5.20%, respectively. Besides the conventional damage forms (such as lines and scratches in Lena and Baboon) for inpainting that can be considered as region filling, the other two typical examples of object removal for damaged images are presented in Figure 12(a3) and (a4). Detailedly, Figure 12(a3) shows the damaged image Lake imposed with a number of texts (τ = 4.86%). Figure 12(a4) shows the image House with a man as an undesirable foreground object, and to seamlessly remove the man from the image, this object was marked as the black region (τ = 0.96%). Note that, inpainting procedure of the schemes2,17,20 was just performed on the plaintext-domain, damaged images in Figure 12(a1)–(a4), while the inpainting procedure of the proposed scheme was performed on their Paillier-encrypted, damaged versions.

Comparison results for our encrypted-image inpainting and plaintext-image inpainting.2,17,20 (a1)–(a4) Damaged images Lena, Baboon, Lake and House. (b1)–(b4) Results of our scheme after decryption. (c1)–(c4) Results of total variation-based scheme. 17 (d1)–(d4) Results of Navier–Stokes PDE-based scheme. 2 (e1)–(e4) Results of exemplar-based scheme. 20
We can observe from Figure 12 that the structural and textural information in the target region, such as lines and edges in Lena and fur and whiskers in Baboon, are successfully repaired by our scheme and there are not obvious blurring effects. Compared with the three plaintext-domain schemes,2,17,20 our scheme can generally obtain better visual quality of inpainted results than the PDE-based schemes2,17 and achieve the comparable performance with the texture synthesis-based scheme. 20 It can also be found that our scheme can seamlessly remove the imposed texts for Lake and effectively inpaint the occluded window, bushes, and lawn for House without a priori model. The values of PSNR and SSIM for the inpainted results for Lena, Baboon, and Lake under the four schemes are listed in the first three rows of Table 2 (PSNR and SSIM for House are not available due to the absence of original reference image).
In addition to the above inpainting results in Figure 12 for the four images (Lena, Baboon, Lake, and House), four other standard test images, including Portofino, Zelda, Peppers, and Elaine, were also involved in the experiments. The damaged forms for these four images were random, and the corresponding damaged rates τ were 3.98%, 3.95%, 3.01%, and 4.19%, respectively. Table 2 gives a summary of PSNR and SSIM for the seven inpainted images with respect to their corresponding original images under the three plaintext-domain inpainting schemes2,17,20 and the proposed ciphertext-domain inpainting scheme. It can be found that our scheme is more suitable for repairing the images with richer textures and larger damaged area. In a word, although the inpainting procedure of our scheme is implemented in ciphertext domain, it can achieve comparable inpainting performance with plaintext-domain schemes and can also realize privacy preserving for the content owner effectively.
Applications in color images and comparison with PatchMatch
Besides gray-level images, we also applied our scheme in color images for privacy-preserving inpainting. Test images were randomly selected from the ImageNet database, which is a famous large-scale image database in the fields of image recognition and computer vision, and a representative inpainting scheme for color images in plaintext domain, called PatchMatch, 21 was utilized for comparison, see Figure 13. The first column of Figure 13 denotes the original images randomly chosen from ImageNet, and the second column is their damaged versions with various damaged rates. The third column and the fourth column are the inpainted results of our scheme (after image decryption) and PatchMatch, 21 respectively. Note that, PatchMatch 21 was just performed on the damaged images in plaintext domain, that is, Figure 13(b1)–(b4), while our scheme was performed on the Paillier-encrypted, damaged versions of Figure 13(b1)–(b4). It can be observed from Figure 13 that the structural and textural information in the target region, such as lines and textures, was basically repaired by our scheme, and there were not obvious blurring effects. Therefore, our scheme can not only achieve comparable visual quality of inpainted results with the plaintext-domain scheme for color images, that is, PatchMatch, 21 but also can realize privacy protection for image contents from content owner since our inpainting operation of image restorer is processed on encrypted versions of damaged images.

Inpainting application for color images and comparison between our encrypted-image inpainting with the plaintext-image PatchMatch inpainting. 21 (a1)–(a4) Original images from ImageNet. (b1)–(b4) Damaged versions of (a1)–(a4). (c1)–(c4) Results of our scheme after decryption. (d1)–(d4) Results of PatchMatch. 21
Discussions of security and computational complexity
Security discussions
Since Paillier
36
proved that Paillier encryption provides semantic security and the attacker cannot learn any information of the plaintext except for the length of the plaintext, hence, we mainly discuss the security of JL transform used in the scheme. In our scheme, the encrypted result of each pixel by JL transform is a vector instead of a single value. After all H × W pixels m(i, j) in
To defeat the potential binarization attack, we should eliminate the correlation between neighboring pixels. Hence, after Paillier encryption and JL transform, random permutation should be further performed on the two encrypted images
However, since local correlation in the permuted image is removed after random permutation, the source region
Computational complexity
In our scheme, both JL Transform and Paillier encryption cause the ciphertext expansion. To reduce the storage on the client side, the image pixels can be encrypted one by one, and each encrypted pixel is directly transmitted to the cloud immediately. Thus, the client side does not need to store the whole encrypted images. As for Paillier encryption indicated in equation (4), the total data volume transmitted from the client side to the cloud is about 2| n| × H × W bits, where| n| denotes the bit length of n, and H × W is the number of image pixels. Thus, for a 1024-bit integer n, the ciphertext expansion ratio of Paillier encryption in our scheme is about 2 × 1024 / 8 = 256 for one 8-bit pixel. Since the encrypted result of each pixel m(i, j) for JL transform is a k-dimension vector instead of a single value, hence, the ciphertext expansion ratio of JL transform is approximately equal to the parameter k in our scheme. After the cloud completes the operation of image inpainting in encrypted domain, the final inpainted, Paillier-encrypted image
As for execution time, the most complicated computation on the client side is Paillier encryption and decryption. To increase the efficiency, we adopted the fast algorithm proposed by Jost et al.,
44
which is a variant of Paillier cryptosystem based on pre-computing and look-up table. The execution time for the different operations on the sender side and the receiver side is listed in Table 3, which includes Paillier encryption, JL transform, random permutation for image owner/sender, and Paillier decryption and inverse permutation for legal receiver. The pre-computing before encryption consumes 9.56 s. Note that, JL transform is only required on the sender side, and random permutation is conducted for
Execution time of different operations (seconds).
JL: Johnson–Lindenstrauss.
Conclusion
In this work, we propose a new privacy-preserving inpainting framework for outsource image and a specific encrypted-image inpainting scheme, which can not only repair scratches and remove undesirable objects in images seamlessly but also can protect the user privacy through encrypting image contents toward image restorer. Paillier encryption and JL transform are both applied by content owner to generate encrypted results for the damaged image. The inpainting mechanism of our scheme is based on block matching and patch filling for the marked target region according to priority order. Since JL transform can preserve Euclidean distance between two vectors before and after encryption, the best-matching block with the smallest distance to current block can be found in source region and utilized for patch filling in the Paillier-encrypted image by image restorer. To further eliminate the possible mosaic effect after decryption, weighted mean filtering for the intermediate, inpainted image in encrypted domain is conducted based on homomorphic properties of addition in Paillier cryptosystem. After image decryption with correct secret key, content owner or authorized receiver can obtain the final inpainted image in plaintext domain. Experimental results demonstrate that the proposed encrypted-image inpainting scheme not only achieves comparable performance of inpainted-image quality with those typical inpainting schemes for plaintext images but also realizes privacy preserving for image content owner effectively due to the complete encrypted-domain operation.
Our current work belongs to non-learning-based inpainting method with privacy-preserving capability. However, learning-based methods can achieve superior global semantic structures of inpainted results, especially with rapid development of deep learning technique. Therefore, in the future, how to effectively and efficiently achieve the learning-based, privacy-preserving image inpainting deserves in-depth investigations. Some works studied privacy-preserving deep learning with homomorphic cryptosystem45,46 and utilized asynchronous stochastic gradient descent as applied to neural networks, combining with the additively homomorphic encryption, which are helpful to our future work. In addition, functional encryption supports the restricted secret keys that enable a key holder to learn a specific function of encrypted data, but learn nothing else about the data, 47 which may be suitable well to solve the problem of block matching (i.e. a specific function) in encrypted domain. Hence, further works also include realizing encrypted block matching through functional encryption and achieving the noise-resisting robustness of privacy-preserving inpainting.
Footnotes
Acknowledgements
The authors thank the anonymous reviewers for their valuable suggestions.
Handling Editor: Yanjiao Chen
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported in part by the National Natural Science Foundation of China (Grant No. 61902239) and in part by the Research Fund of Guangxi Key Lab of Multi-Source Information Mining and Security (MIMS20-03).
