Joint image compression and encryption based on sparse Bayesian learning and bit-level 3D Arnold cat maps

Image compression and image encryption are two essential tasks in image processing. The former aims to reduce the cost for storage or transmission of images while the latter aims to change the positions or values of pixels to protect image content. Nowadays, an increasing number of researchers are focusing on the combination of these two tasks. In this paper, we propose a novel joint image compression and encryption approach that integrates a quantum chaotic system, sparse Bayesian learning (SBL) and a bit-level 3D Arnold cat map, so-called QSBLA, for such a purpose. Specifically, the QSBLA consists of 6 stages. First, a quantum chaotic system is employed to generate chaotic sequences for subsequent compression and encryption. Second, as one method of compressive sensing, SBL is used to compress images. Third, an operation of diffusion is performed on the compressed image. Fourth, the compressed and diffused image is transformed into several bit-level cubes. Fifth, 3D Arnold cat maps are used to permute each bit-level cube. Finally, all the bit-level cubes are integrated and transformed into a 2D pixel-level image, resulting in the compressed and encrypted image. Extensive experiments on 8 publicly-accessed images demonstrate that the proposed QSBLA is superior or comparable to some state-of-the-art approaches in terms of several measurement indices, indicating that the QSBLA is promising for joint image compression and encryption.


Introduction
Images can provide rich information to human vision systems and have become one of the most important ways to transfer information. Currently, thousands of millions of images are produced every day, determining how to efficiently store and transmit such a large number of images is a very challenging task. Due to the bulky data capacity of images, the bytes occupied by images must be reduced to facilitate storage and transmission. The high redundancy and strong correlation that usually exist in an image afford possibilities for image compression. The discrete cosine transform (DCT), discrete Fourier transform (DFT), discrete wavelet transform (DWT), and so on, are widely-used image compression methods [1][2][3], and some of transform [34], the optimized tensor CS and 3D Lorenz system [35], the 2D CS with a discrete fractional random transform [36], and so on [37][38][39][40].
As one type of CS, sparse Bayesian learning (SBL) has shown its superiority in physiological signal analysis [41][42][43], pattern recognition [44], visual tracking [45] and time series forecasting [46][47][48][49][50] since it was proposed [51,52]. The existing study has shown that SBL has many advantages over some other compressive sensing models [44,52,53]. Regarding image encryption, diffusion and permutation are two typical types of operations that change the values and the positions of pixels in images, respectively [54,55]. Image compression is naturally an operation of diffusion because it can encode the original images into images with fewer sizes. The Arnold cat map is a popular way to permute the pixels for image encryption [56][57][58][59]. As far as the processing unit is concerned, image encryption is usually performed on blocks of pixels, at the pixel level, DNA level (two bits) and bit level. Generally speaking, for a fixed processing power, encryption on lower-level data often involves more pixels to ensure better encryption results can be achieved [15,60].
Inspired by the extreme sensitivity of quantum chaos, compression ability of CS and permutation power of Arnold, this paper proposes a novel approach that integrates a quantum chaotic system, sparse Bayesian learning and a bit-level 3D Arnold cat map, namely, QSBLA, for joint image compression and encryption. Specifically, the proposed QSBLA consists of 6 stages: 1) a quantum chaotic system is employed to generate a chaotic sequence for subsequent different operations of compression and encryption; 2) SBL is used to compress the original image; 3) a diffusion operation called CDCP is performed on the compressed image; 4) the compressed and diffused image is transformed into a bit-level cuboid, and then, the cuboid is reshaped to one or more bit-level cubes; 5) for each bit-level cube, a 3D Arnold cat map is applied to permute the bits; and 6) all the bit-level cubes are integrated into a bit-level cuboid and then transformed into a pixel-level compressed and encrypted image. The QSBLA is applied to eight publicly accessed test images, and the results indicate that it can achieve good compression performance and has the ability to resist several types of attacks.
The remainder of this paper is structured as follows. Section 2 describes some concepts of the proposed approach. The QSBLA approach is proposed in detail in Section 3. Then, we report and analyze the experimental results in Section 4. Finally, we conclude the paper in Section 5.

Quantum chaotic system
A quantum logistic map can be constructed with quantum corrections, as dissipative quantum systems are often coupled to a path of harmonic oscillators [13,14]. It has been shown that a chaotic map can be created through the very lowest-order quantum corrections by Eq (1) [13]. n . After setting r and β, we can iterate Eq (1) with initial parameters x 0 ; y 0 ; z 0 ; x � 0 and z � 0 to produce a chaos sequence. In the experiment, once x 0 , y 0 and z 0 are set to real numbers, x � 0 and z � 0 are the same as x 0 and z 0 , and then they will be replaced by x 0 and z 0 .
Iterating Eq (2) with real initial parameters x 0 , y 0 , z 0 and the real constant �, the chaos sequence of real numbers is produced.

Arnold cat map
Arnold's cat map is one of the well-known chaotic maps, and the name was from the fact that Vladimir Arnold demonstrated its effects on an image of a cat in the 1960s [61,62]. When applying the map to encrypt an image, the image appears to be randomly permuted. However, if the map is repeated a certain number of times, the original image will appear again. The 2D Arnold cat map, formulated as Eq (3), has been widely used in image encryption.
where a and b are two specified positive integers, (x 0 , y 0 ) is the new position of the original image position (x, y), and N is the size of the original square image. By adding two extra parameters c and d, we can obtain a 3D Arnold cat map, as defined by Eq (4): significantly, which can be lines or random points. Fig 1 shows that the map has good chaotic characteristics and randomness. In quantum chaotic theory, chaos cannot be measured in the same way as defined in classical dynamics (i.e., through Lyapunov exponents) because the evolution operator in quantum mechanics is coupled. Here, Fig  The purposes of the sequence K for JICE are twofold: (1) sorting the subsequence of K to obtain the index of the original data for permutation and diffusion; and (2) using the subsequence of K to form the measurement matrix for SBL. In the proposed approach, the i-th point in K is mapped to the integral range of [0, 255] by Eq (7) for both purposes.
where mod and |�| are the modulo and the absolute value operation respectively, and b�c denotes the flooring operation [12]. The discretization through Eq (7) can improve the randomness of K to enhance the encryption.

Sparse bayesian learning
Sparse Bayesian learning (SBL) was first proposed for regression and classification by Tipping in 2001, and its main idea is to obtain sufficiently sparse solutions from the data in a mapped high-dimensional space via kernel-tricks by a Bayesian framework [51]. Later, the nonkernel SBL was proposed and widely applied to signal recovery, compressive sensing and sparse representation [41,52].  From the perspective of compressive sensing, if the sparsity exists in the original signal or in its corresponding transform domains, the high-dimensional signal has the potential to be projected into a low-dimensional space by a dictionary (also known as a measurement matrix) to achieve compression [32]. Moreover, the original signal can then be recovered as close as possible via the compressed signal.
Mathematically, sparse signal recovery can be defined by Eq (8): where Θ 2 R P×Q is a measurement matrix with P samples and each has Q features, and y = [y 1 , y 2 , � � �, y P ] T is a target vector, � is noise and x = [x 1 , x 2 , � � �, x Q ] T is the vector to be resolved to quantify the weights of the columns in F. SBL aims to seek a vector x that has as many zero entities as possible while it still approximates the targets y accurately [48,52].
With an approximative zero-mean Gaussian noise (� in Eq (8)) with unknown variance σ 2 , the framework of SBL assumes the Gaussian likelihood model as Eq (9): Now, the task of seeking maximum likelihood estimates for x is transformed into the task of seeking the minimum ℓ 2 -norm solution to Eq (8). However, it can usually find nonsparse solutions. To cope with this issue, the SBL estimates a parameterized prior, instead of using a fixed prior as adopted in some other compressive sensing approaches, over weights from the data by Eq (10): where γ = [γ 1 , γ 2 , � � �, γ Q ] T is a vector to control the prior variance of each weight, and Q hyperparameters need to be estimated in total. There are two key steps to estimate these hyperparameters, i.e., marginalizing over the weights as well as performing the maximum likelihood optimization algorithm. When compared with other CS algorithms, SBL has the following advantages: 1) The recovery performance is robust to the characteristics of the measurement matrix; 2) SBL usually outperforms some other CS algorithm regarding local and global convergence; 3) The solutions of SBL are sparser than those of LASSO-type algorithms; and 4) Some robust learning rules can be used to automatically estimate the regularization term of SBL to achieve good results of compressive sensing. Therefore, SBL is suitable for image compression [44,53]. For more details, interested readers can refer to [52].

SBL-based image compression
The traditional image lossy compression methods, such as FT, DCT, DWT and so on, have been successfully applied to some compression standards such as JPEG, MPEG, H.26X and so on. With ever-increasing applications of these methods, some of their disadvantages have emerged. For example, when the compression ratio (CR) is very high, the decompression image will have such extensive obvious rectangle block shapes that difficulties in introducing human visual characteristics arise. Therefore, improving the quality of decompression images, increasing the CR and speeding up the encoding and decoding procedure are consistent directions followed by researchers.
CS can efficiently reconstruct a signal from very few samples by finding solutions to underdetermined linear systems.
This signal technique fully exploits the sparsity of a signal to compress information when receiving.
For a given sparse signal x of length N, it can be expressed as Eq (11): where s is a transform coefficient vector of length M (M � N), and C is an orthogonal transform matrix, also known as a sparse basis matrix. Assuming � = 0, Eq (8) is deduced to as follows where F is called the measurement matrix as in Section 3.2. In the scheme, sparse signals s represent the plain image I. The sparse representation of original signals s by C is executed by DCT. The measurement matrix F is formed by the random integers from the quantum chaotic sequence K, and F is rescaled within [−0.5, 0.5] by the following Eq (13).
F rh�h ( K À minðKÞ maxðKÞ À minðKÞ À 0:5; Thus, for a pixel-level image I with size of h × w and different compression ratios CR = r, 0 < r < 1, we choose the top r × h rows from the image after the sparse representation result to compress it. Then, the size of C is h × h, and the size of F is rh × h. After the transformation of I with FC, the data type of y is double. The y has to be stored as an unsigned 8-bit integer. Here, we need to map y within [0, 255] and record the rounded result as integers by Eq (14). By doing so, we can save 50% of the storage space for the encrypted image and one pixel only needs a one-byte space. Therefore, the maximum and minimum of y need to be stored as keys.
Step 1: Generate a sparse representation matrix C.
Step 2: Generate a measurement matrix F and scale it by Eq (13).
In contrast, the steps of SBL decompression are listed below: Step 1: Rescale y to the real numbers within the original minimum and maximum.
Step 2: Generate the measurement matrix F in the same way from K and scale it within [−0.5, 0.5].
Step 3: Likewise, generate the sparse transformation matrix C with DCT.
Step 5: Learn μ through y and Θ by SBL.
Moreover, the pseudo code of SBL compression and decompression is demonstrated in Algorithm 1 and Algorithm 2 which provide more details of SBL-based image compression.

Bit-level 3D Arnold cat map
Since the 3D Arnold cat map transformation can be conducted on cubes only, an image has to be reshaped to one or several cubes before encryption. For a pixel-level image with a size of h × w, where h and w indicate the height and width of the image, respectively, we first transform it into a bit-level cubic with a size of h × w × 8. Then, we transform the bit-level cubic into one or more cubes using a previously proposed I2C algorithm [15]. For example, a pixel-level image with size 512 × 512 can be transformed into a bit-level cubic with a size 512 × 512 × 8, and then it can be further transformed into a bit-level cube with size 128 × 128 × 128. Similarly, a 256 × 256 pixel-level image can be transformed into 2 64 × 64 × 64 bit-level cubes.
Once we obtain the cube(s), bit-level permutation can be conducted via the 3D Arnold cat map defined by Eq (4). For example, given a 3 × 3 × 3 input cube and parameters (a, b, c, d) =

QSBLA: The proposed joint image compression and encryption approach
The flowchart of the QSBLA is shown in Fig 3. After generating the quantum chaotic sequence, the JICE procedure consists of five steps: 1) SBL compression, 2) ciphertext diffusion in the crisscross pattern (CDCP) diffusion [54], 3) transformation from a 2D pixel-level image to bitlevel cubes [15], 4) 3D Arnold cat map permutation, and 5) transformation from bit-level cubes to a 2D pixel-level image. The diffusion aims to change the pixel values while the permutation aims to rearrange the positions of bits.
The procedure of the proposed QSBLA is described in detail as follows: Step 1: Generating the quantum chaotic sequence: Generate the quantum chaotic sequence with initial keys by Eqs (1) and (2). Step 2: SBL compression: Compress the plain image through Eq (8) detailed in Section 3.3. The DCT transformation is used for sparse representation. Measurement matrix F is composed of the chaotic sequence K.
Step 3: CDCP diffusion: Conduct CDCP operations on the compressed image following the steps in [54].
Step 4: Transformation from a 2D pixel-level image to bit-level cubes: Use the I2C algorithm proposed in [15] to transform the 2D pixel-level compressed and diffused image to several bit-level cubes for the convenience of the subsequent 3D Arnold cat map.
Step 5: 3D Arnold cat map permutation: For each bit-level cube, the 3D Arnold cat map is used to permute the bits as in Section 3.4. Since the permutation on bits can result in the change of corresponding pixel values, such an operation also has the effect of diffusion.
Step 6: Transformation from bit-level cubes to a 2D pixel-level image: All the bit-level cubes are first merged into a bit-level cuboid, and then the cuboid is transformed to a pixel-level 2D image, i.e., the compressed and encrypted image.
The decryption and decompression is the inverse procedure of the compression and encryption. In addition, the pseudo codes of the QSBLA and the corresponding decryption and decompression procedures are listed in detail in Algorithm 1 and Algorithm 2, respectively.

Experimental settings
To measure the performance of the QSBLA, some state-of-the-art image encryption approaches, such as CDCP [54], the hyperchaotic and DNA sequence-based method (HC-DNA) [63], a class hyperchaos-based scheme (CHC) [55], and an image cipher scheme with block-based scrambling and image filtering (IC-BSIF) [64], are tested with some popular evaluation indices. We also compare with some popular compression and encryption schemes for some specific images with some evaluation indices. The parameters for the above schemes are set as those in the corresponding papers. The parameters of the QSBLA are described as the following. The initial parameters for the quantum chaotic system are x 0 = 0.4239, y 0 = 0.0239 and z 0 = 0.0239. Additionally, the other parameters are � = 0.001, r = 3.99 and β = 6.
The original integral chaotic sequence generated by the quantum chaotic equations is adopted from the point at which it begins, that is to say, the start position of the chaotic sequence is 1.
The round of the Arnold transformation is also set to 1. If necessary, the start position of the sequence and the rounds of the Arnold cat map can be also used as the security keys.
To demonstrate the performance of the proposed QSBLA, we use 8 images for experiments. The names and sizes of the testing images are listed in Table 1. All the images are publiclyaccessed and are very popular in the literature on image processing [65][66][67].
In the experiments, we use the structural similarity (SSIM) and the peak signal-to-noise ratio (PSNR) for compression effect analysis, the key space and sensitivity for security key analysis, histogram, information entropy and correlation for statistical analysis, the number of pixels change rate (NPCR) and the unified average changing intensity (UACI) for differential attack analysis, and noise and data loss for robustness analysis. Furthermore, we analyze known-plaintext and chosen-plaintext attacks, as well as computation time.
All the experiments were conducted with MATLAB 2016b on a 64-bit Windows 7 with 8 GB memory and an i3 CPU at 3.4 GHz.

Encrypted images and decrypted images
With the QSBLA, the encryption images of Finger, Cameraman and Barbara, and their corresponding recovered images are shown in Figs 4-6, respectively. From the first column to the third column, their CRs are 0.25, 0.5 and 0.75. The heights of compressed and encrypted images are 1/4, 1/2 and 3/4 of their corresponding original images, as shown in the first row. The second row shows the corresponding recovered images from the first row.
As can be seen from Figs 4-6, when the CR increases, the recovered images gradually achieve better quality. When CR = 0.75, it is hard to find out the difference between the plain images and the corresponding recovered images based on human vision.
When we compare the results of Cameraman by QSBLA and those by Ref. [29], we can find that the pixels in compressed and encrypted image by QSBLA distribute more uniformly than those by Ref. [29]. At the same time, the quality of the recovered Cameraman by QSBLA is better than that by Ref. [29]. Similar results can be found from the results of Barbara by QSBLA and those by Ref. [32].

Structural similarity (SSIM).
The structural similarity index (SSIM) defined with Eq (15) is used to measure the quality of the decompression and decryption image [60].
where x and y are two images, μ x and μ y are the average values of x and y, s 2 x and s 2 y are the variance of x and y, respectively, and σ xy is the covariance of x and y. In addition, C 1 = (0.01 × L) 2 , C 2 = (0.03 × L) 2 , where L = 255 is the gray level of the pixel value. The smaller the SSIM is, the greater the difference of both images and the less the similarity.
The SSIM values of the testing images by the proposed QSBLA are shown in Table 2. From this table, with the compression ratio increasing, the variation of SSIM are consistent with the Joint image compression and encryption based on sparse Bayesian learning and bit-level 3D Arnold cat maps  Table 2 are all less than 0.9, the decompression and decryption images in Figs 4 to 6 appear very similar to the results in Ref. [29] and Ref. [32], whose mean SSIM (MSSIM) is greater than 0.96.

Peak signal-to-noise ratio (PSNR).
The peak signal-to-noise ratio (PSNR) is a widely used index to quantify the similarity between the plain image and the recovered image after processing to judge the effectiveness of compression, which is computed by Eqs (16) and (17) [60].
ðIði; jÞ À Eði; jÞÞ 2 ; ð16Þ where I(i, j) and E(i, j) are the pixel gray values of the plain image and the recovered image,  Joint image compression and encryption based on sparse Bayesian learning and bit-level 3D Arnold cat maps respectively, the MSE is the mean variance of the plain image and the recovered image, N = w × h is the pixel number of the image, and w and h is the width and height of the image, respectively. The PSNR of the QSBLA is compared with the methods of Ref. [29] and Ref. [32], and the results are listed in Table 3. From Table 3, it can be seen that the PSNR by the QSBLA with the image Cameraman increases steadily as the CR varies from 0.25 to 0.75. Although the PSNR values of Cameraman by QSBLA are not as good as those of Ref. [29] and Ref. [32], they are very close to the best results, showing that the proposed QSBLA is comparable to the competitive approaches in terms of the compression effect.

Security key analysis
An effective encryption scheme should be extremely sensitive to any small changes in its security key and has an enough large key space. Therefore, key space and sensitivity to the security key are two important factors in image encryption. Both a large key space and extreme sensitivity is very helpful to resist any brute-force attacks.

Key space.
The security keys of the proposed QSBLA include 6 values to generate the chaotic sequence, i.e., ðx 0 0 ; y 0 0 ; z 0 0 ; r; b; 2Þ, as well as the maximum and minimum of y 1 in Algorithm 1, i.e., (y max , y min ). That is to say, the security keys are composed of 8 values, i.e., ðx 0 0 ; y 0 0 ; z 0 0 ; r; b; 2; y max ; y min Þ. If each initial value has a precision of 10 −15 , the size of the key space is 10 15 × 8 = 10 120 � 2 399 . From the view of cryptology, the key space whose size is larger than 2 100 implies high-level security [68,69]. Therefore, the key space of the proposed QSBLA is so large that it can resist all kinds of brute-force attacks. Moreover, the start position and rounds of the chaotic sequence to form the measurement matrix of CS or the Arnold transform matrix can also be used as security keys to further expand the key space of the QSBLA.

Sensitivity to the security key.
An image encryption algorithm with an extreme sensitivity requires that any tiny changes in the keys will produce a completely different cipher image, that is to say, if the security key changes slightly, the recovered image will become totally different from the plain image.
To verify the sensitivity to the security key of the QSBLA, we decrypt the encrypted images twice but with slightly different keys to result in two encrypted images. First, the encryption keys (x 0 0 ¼ 0:4239, y 0 0 ¼ 0:0239, z 0 0 ¼ 0:0239, r 0 = 3.99, β 0 = 6, � 0 = 0.001, y max , y min ) are used to decrypt the encrypted images, where y max and y min are associated with the contents of the corresponding plaintext image. Then, the encrypted compression images are decrypted with slightly different keys ðx 1 0 ¼ 0:4239 þ 10 À 15 , y 1 0 ¼ 0:0239, z 1 0 ¼ 0:0239, r 1 = 3.99, β 1 = 6, � 1 = 0.001, y max , y min ). The experimental results of Finger, Cameraman, Barbara and Baboon are shown in Fig 7. As seen, even a very slight change of 10 −15 with the correct keys results in completely different recovered images from the decrypted images. The wrong decrypted decompression images resemble a random number map and show no visual information about the plain images. It validates that the QSBLA is extremely sensitive to the security key.

Statistical analysis
For the purpose of performance evaluation of the QSBLA, some typical statistical analysis, such as histogram analysis, information entropy and correlation analysis are adopted in the experiments.

Histogram analysis.
Histograms are popular and effective ways to measure the distribution of all the pixel values in an image. In general, the histogram of a plain image is unevenly distributed, while that of an encrypted image produced by a good encryption method should have a uniform distribution. A uniform distribution of a histogram always represents a totally random-like image with relatively low correlations among neighborhood pixels and has the least probability of hacking the encrypted image to recover the corresponding plain image. In other words, the more even the histogram of the encrypted image is, the better the encryption scheme is in resisting histogram attacks.
The plain images, encrypted images and recovered images, and their corresponding histograms are shown in Fig 8. The histograms in the second column are from the plain images in the first column. These histograms have shapes that resemble some peaks or valleys, while all the histograms in the fourth column of encrypted images distribute very evenly and almost uniformly. The third column shows the encrypted images, of which the CR is 0.25 and the height is 1/4 of the original image. The recovered images are listed in the fifth column, while the corresponding histograms are listed in the sixth column. Because we use lossy SBL to compress the image with CR = 0.25, the recovered image in the fifth column is slightly blurred, and the histograms have lost some details with the peaks or valleys.
Nevertheless, these almost even histograms of encrypted images indicate that the QSBLA has a strong ability to resist histogram attacks. Moreover, the proposed approach can encrypt any images to flat and even histograms without exception. These results confirm that the QSBLA works very well for any types of image.
The results in this section verify that it is impossible to recover the plain image after encryption through the cryptosystem by analyzing its histogram and to make the statistical analysis  attack successful when hackers try to attack the compressed and encrypted images with a very even histogram in the fourth row of Fig 8. 4.5.2 Information entropy. Information entropy (IE) is the average rate at which information is produced by a stochastic source of data. Here, it is used to reflect the complexity or orderliness of the encryption system. The intensity of an 8-bit grayscale image has 2 8 possible values ([0, 255]). The IE is defined as Eq (18) [70]: where p(Q i ) is the probability that the pixel gray value Q i exists in an image [63]. The maximum of IE is 8 when Q i of an encrypted image has the same probability, i.e., 1

256
. The perfect uniform distribution of the encrypted image has the maximal IE, 8.
The IEs of plain images and corresponding compressed and encrypted images produced by different encryption schemes are listed in Table 4. The third column under QSBLA shows the entropies of the final encrypted compression images. It can be seen from this table that the IEs of the plain images are far below 8, while those of compressed and encrypted images are very close to the theoretical optimal value of 8. The IEs of QSBLA are within [7.9878, 7.9977]. Although the QSBLA achieves none of the 8 optimal values while both CHC and IC-BSIF obtain the optimal values 4 times, the IE range of [7.9878, 7.9977] by the QSBLA is very close to the theoretical optimal value, 8. It can be seen that, as a compression and encryption approach, the QSBLA is very comparable to the state-of-the-art encryption models regarding IE.
We further use Peppers to compare the QSBLA with a compression and encryption scheme, Ref. [71], and the results are listed in Table 5, where LCR and HCR are the compression ratio of the low-frequency component and the high-frequency component respectively. The IEs of Joint image compression and encryption based on sparse Bayesian learning and bit-level 3D Arnold cat maps Peppers by QSBLA are much higher than those by Ref. [71]. All the IEs of Pepper under different CRs is greater than 7.997 and the maximum of Ref. [71] is only 5.5981. Although the comparison is under different CR, LCR and HCR, their encrypted images of QSBLA and Ref. [71] are still comparable for entropy performance. The possible reason is that the QSBLA conducts compression and then encryption while Ref. [71] performs encryption and then compression, and the latter will discard some less important information (zeros and values close to zero) in compression, losing the diversity of the information and decreasing the IE values.

Correlation analysis.
The grayscale levels of two neighboring pixels in a natural image are always similar and thus are highly correlated. The correlation of two neighboring pixels in a natural image is usually close to 1. A good image encryption algorithm should produce an encrypted image with very low correlation to make sure it is impossible to deduce information from its neighbors.
The correlation coefficient γ is the most-widely used index to quantify the correlation, which can be formulated as Eq (19) [72].
ðx i À EðxÞÞðy i À EðyÞÞ; g ¼ covðx; yÞ ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi DðxÞDðyÞ where x and y are the grayscale values of two neighboring pixels among the total N pixels in an image. As shown in Table 6, we compute the correlation coefficients γ for all plain images and compressed and encrypted images at three directions, i.e., horizontal γ h , vertical γ v , and diagonal γ d [63]. This table shows that the correlation coefficients of all the plain images are close to 1 in all directions, meaning high correlation, whereas those of all the compressed and encrypted images are slightly greater than 0, showing very low correlation. This result indicates that the QSBLA is able to effectively reduce the correlation to a very low degree, even with compression. The QSBLA outperforms the rest of the schemes on 3 out of 24 correlation coefficients, however, the other algorithms, HC-DNA, CDCP, CHC and IC-BSIF, achieve the optimal value 5, 3, 6 and 7 times. By comparing the results, it is obvious that the QSBLA has the same good performance in terms of correlation of the compressed and encrypted images.
To conduct a correlation analysis further, we also select 2500 pairs of neighboring pixels randomly in the horizontal direction from the plain images and the corresponding compressed and encrypted images by the QSBLA to show their distribution maps of neighboring pixels in Fig 9. The correlation values of plain images distribute near the diagonal area of a coordinate plane, showing strong correlation of the input plain images. In particular, the more the correlation points are close to the diagonal line that neighboring pixel distribution maps have, the higher the correlation of an image. For example, for plain images Peppers and Boats, their maps in Fig 9(j) and 9(l) show that these two images have higher correlation than the other 6 images. However, the gray values of compressed and encrypted images distribute randomly and evenly on the whole plane, showing very weak correlation of the compressed and encrypted images. The experimental results demonstrates that most of the correlation is eliminated by the QSBLA.

Analysis of resisting differential attacks
Based on the theory of cryptography, differential attack should be well defended by any image encryption schemes. Hence, any trivial change like a bit or a pixel change in a plain image should result in a totally different encrypted image.
For differential attack analysis, the number of pixels change rate (NPCR) and the unified average changing intensity (UACI) are two widely used performance indexes. The NPCR stands for the variation ratio of two encrypted images when their plain images are slightly changed on one bit or one pixel. The UACI defines the average intensity of the differences between the encrypted images from the plain image and the one bit or one pixel changed plain images. Theoretically, NPCR and UACI between two encrypted images, Q 1 and Q 2 , can be defined as Eqs (20) and (21), respectively [73].  where w and h are still the width and the height of the image, and d ij is defined as Eq (22): The NPCR focuses on the number of pixels changing their values in the differential attack. The UACI concentrates on the average difference between the correct encrypted image and the encrypted image from differential attack. The expectations of NPCR and UACI of an encrypted image with 256 grayscale levels are 99.6094% and 33.4635% [73]. Generally, the more that NPCR becomes close to 100% and the larger that UACI is, the more effectively the encryption scheme can resist differential attacks.
We randomly choose one pixel in the plain images and only change one bit of the chosen gray value to compute the NPCR and UACI for one time. This process is repeated 10 times. And then the averaged NPCR and UACI of QSBLA, HC-DNA, CDCP, CHC and IC-BSIF are reported in Tables 7 and 8 as the final results. We can see from Table 7 that regarding NPCR, the QSBLA outperforms HC-DNA, CHC and IC-BSIF, and it also achieves comparable results with CDCP. QSBLA, CDCP and CHC achieve 3, 4 and 1 optimal NPCR values respectively. In Table 8, regarding UACI, QSBLA has one of the best records compared with all the other schemes, whereas HC-DNA still has the poorest results in all cases and IC-BSIF has 4 of the best records. The values of NPCR and UACI indicate that the QSBLA is able to resist differential attacks very well. It is worth noting that the proposed scheme includes compression while the other 4 methods do nothing about image compression.

Robustness analysis
Noise and data loss are inevitable for images during storage and transmission. A good JICE scheme should be able to resist noise or data loss. Theoretically, the compressed image is more difficult to be robust because the compression image converges more information into a smaller storage space. Compared with the encrypted lossless compression algorithms, any noise or data loss in lossy encryption algorithms should have more effects on the recovered image and thus lead to less robustness. The results of robustness analysis by the QSBLA are shown in Figs 10 and 11. We first add 0.5%, 1% and 2% salt & pepper noise into the compressed and encrypted Cameraman with CR = 0.25, and the corresponding recovered images are shown in the first to the third column of Fig 10, respectively. It can be seen that, as far as 0.5% and 1% salt & pepper noise is concerned, although the recovered image contains much noise, it can recover the plain image to some extent. However, when the noise increases to 2%, we can only see some of the outline of Cameraman. When the encrypted compression image (CR = 0.25) has 0.4%, 1.56%, 6.25% and 25% data loss, the proposed QSBLA can recover Cameraman until data loss reaches 6.25% even though CR = 0.25 is a comparably high CR for CS, as shown in Fig 11. For 6.25% data loss, the decrypted image retains some information for us to recognize Cameraman, as shown in the third column of Fig 11. For 25% data loss, the main information of Cameraman about its contour is lost and the left information in the Fig 11 is random values. From the analysis, conclusively, the proposed QSBLA is robust to a certain extent.

Known-plaintext and chosen-plaintext attack analysis
As analyzed previously, any tiny changes in the plain image can result in a totally different cipher image, so the proposed QSBLA can resist differential attacks, a typical chosen-plaintext attack. In addition, the security keys include y max and y min which are associated with the contents of the corresponding plain image. So different plain images will produce different security keys. Hackers usually use images of all black and all white to crack image encryption algorithms. The compressed and encrypted images of all black and all white with a size of 256 × 256 with different CRs are shown in Fig 12. It can be seen that all the compressed and encrypted images are all noise-like and all the corresponding histograms are very close to uniform distributions, showing that the proposed QSBLA has good encryption effect for both images of all black and all white. From the above analysis, we can see that the QSBLA is capable of resisting known-plaintext and chosen-plaintext attacks.

Computing time analysis
Different JICE algorithms have different performance on computing complexity. So the encryption and decryption time of different size images at different CRs is tested, and their results are listed in Tables 9 and 10. As we can see from the tables, like other JICE algorithms, generally speaking, the smaller CR or the smaller image size, the less computational time is. But there is an exception for CR = 0.75 regarding decryption, the decryption time drop significantly especially for images Cameraman, Barbara, Peppers. The reason is that SBL converges to the final solution in a shorter time compared with CR = 0.65 although it needs to compute more variables when CR = 0.75.
The comparison between QSBLA and Ref. [32] is listed in Tables 11 and 12. When CR = 0.75, the decryption time of QSBLA is less for Peppers. In other cases, the time is longer than Ref. [32]. We further compare the compression and encryption time with CR = 0.55 for Cameraman and Peppers, and the results are shown in Table 13. It can be seen that outperforms Ref. [39] but underperforms the other compared schemes. The computing time is possible improved by using parallel computing to optimize SBL and run it on GPU. This is our future work.

Conclusions
Image compression and image encryption are two important tasks in image processing. In this paper, we propose a novel approach that integrates a quantum chaotic system, sparse Bayesian learning and a 3D Arnold cat map, namely, QSBLA, for joint image compression and encryption. The novelty of the QSBLA is introducing SBL to compress images and using a 3D Arnold cat map to permute bit-level cubes. The extensive experiments demonstrate that the QSBLA has the ability to achieve good compression performance and is capable of resisting several types of attacks, showing that the QSBLA is promising for joint image compression Joint image compression and encryption based on sparse Bayesian learning and bit-level 3D Arnold cat maps and encryption. In the future, we will study the permutation on DNA-level data and extend the proposed QSBLA to joint image compression and encryption for color images.
Supporting information S1 File. Data. All the data for the experiments in the paper. (ZIP)