Image Encryption Algorithm Based on an Improved ML Neuron Model and DNA Dynamic Coding

Aiming at the problems of small key space, low security, and low algorithm complexity in a low-dimensional chaotic system encryption algorithm, an image encryption algorithm based on the ML neuron model and DNA dynamic coding is proposed. The algorithm first performs block processing on the R, G, and B components of the plaintext image to obtain three matrices, and then constructs a random matrix with the same size as the image components through logistic mapping and performs DNA encoding, DNA operation, and DNA decoding on the two parts. Second, it performs determinant permutation on the matrix by two different chaotic sequences obtained by logistic mapping iteration. Finally, it merges the block and image components to complete the image encryption and obtain the ciphertext image. Wherein, DNA encoding, DNA operation, and DNA decoding methods are all randomly and dynamically determined by the chaotic sequence generated by the ML neuron chaotic system. According to simulation results and performance analysis, the algorithm has a larger key space, can effectively resist various statistical and differential attacks, and has better security and higher complexity.


Introduction
With the rapid development of cloud computing technology [1] and the widespread application of the 5G network technology [2] in recent years, digital image transmission has already become an indispensable part in all walks of life. As digital images contain a large amount of important data such as security privacy and confidential information, there is a risk of theft in the transmission of digital image information in various fields. Fortunately, the birth of image encryption technology [3][4][5][6] solves this problem and ensures the confidentiality of digital images. Since chaotic systems have the characteristics of sensitivity to initial values, pseudo-randomness, and unpredictability, more and more image encryption algorithms based on chaos have been proposed [7][8][9]. e image encryption algorithm proposed in literature [7] is based on the image segmentation and a multi-diffusion model, which improves the security of the algorithm. e chaotic image encryption algorithm proposed in the literature [8] combines two methods of block scrambling and dynamic index diffusion, and its advantages are fast and safe. e image encryption algorithm based on the fractional order chaotic system proposed in literature [9] has higher security and execution efficiency. e advantage of DNA computing lies in that it can perform parallel computing, which reduces power consumption and has a high storage density. Researchers have explored the complementary base pairing principle in DNA theory [10][11][12] and introduced it to realize image encryption. Literatures [13,14] proposed many DNA-based encryption schemes. Although these schemes combine the chaotic system with DNA encoding theory, which improves the complexity of the system, the security performance still needs improvement because of the not-high chaotic dimension and the not-large key space. In recent years, more and more new image encryption algorithms that combine chaotic mapping and DNA encoding have been proposed by scholars.
e newly emerged algorithms have better encryption effects and are more secure than previous ones. erefore, many researchers from various fields have also begun to pay attention to and deeply understand this type of an image encryption algorithm that combines chaotic mapping and DNA encoding [15][16][17][18].
is paper proposes a new image encryption algorithm to generate the required ciphertext image more securely by adopting the DNA random dynamic coding method and combining the ML neuron chaotic system.

ML Neuron Model.
e ML neuron model is a twodimensional model [19][20][21] based on the research results of the muscle fibers of the Arctic goose. is article uses an improved three-dimensional ML neuron model [22,23], and its differential equation is as follows: In formula (1): V is the neuron membrane potential; ω is the neuron recovery variable; u is the slow-changing regulation current; g k , g ca , and g l are the maximum conductance of K + , Ca 2+ , and the leakage current channel, respectively; V k , V ca , and V l are the reversal voltages corresponding to the abovementioned channels, respectively; λ(V) is the activation time constant; ω ∞ (V) and m ∞ (V) are the steady-state values of the opening probability of the ion channel K + and Ca 2+ , respectively; and μ is a constant.
Part of the parameters of the abovementioned ML neuron model are set, respectively, as g ca � 1.2 μF/cm 2 , V ca � 1 mV, g k � 2 μF/cm 2 , g l � 0.5 μF/cm 2 , V l � −0.5 mV, μ � 0.005, and keep other parameters unchanged. When the parameter V ca � 0.83 mV, the ML neuron model is at the   Table 1: DNA encoding table.   1  2  3  4  5  6  7  8  00  A  A  C  C  G  G  T  T  01  C  G  A  T  A  T  C  G  10  G  C  T  A  T  A  G  C  11  T  T  G  G  C  C  A  A   Table 2: DNA addition.   A  C  G  T  A  A  C  G  T  C  C  G  T  A  G  G  T  A  C  T  T  A  C  G   Table 3: DNA subtraction.
Computational Intelligence and Neuroscience chaotic discharge state, whose time history diagram is shown in Figure 1. Moreover, the phase plane diagram also shows that it is in a chaotic state, as shown in Figure 2.

DNA Encoding and Operations
ere are 4 kinds of nucleotides in a DNA sequence, namely, A (adenine), G (guanine), C (cytosine), and T (thymine). Wherein, A and T, G, and C have complementary relationships, which are very similar to that of the binary code 0 and 1 in mathematics, so 00 and 11, 01 and 10 also have a complementary relationship. A, T, G, and C are represented by two-digit binary 00, 11, 10, and 01, respectively. According to the principle of complementary pairing, there are 8 sets of encoding rules. As shown in Table 1, the corresponding DNA decoding rules and DNA encoding rules are on the contrary.  (10) Obtain two logistic chaotic sequences. e initial value is obtained according to Algorithm 1 to produce two chaotic sequences x 01 � sum(I 1 (:))/255 × M × N × 2 x 02 � sum(I 2 (:))/255 × M × N × 2 (11) Sort the two chaotic sequences obtained in the previous step in descending order and obtain the position sequence before the ranking. Take the sequence value before ranking and its corresponding index as the exchange coordinates of row and column to perform row and column permutation on the matrix.

Image Encryption Algorithm
is paper divides the color digital image into three twodimensional matrices, which greatly reduce the time and space resources required. DNA encoding and calculation are performed on each two-dimensional matrix block, then row and column permutations are performed again after encryption, and finally the three channels are merged to obtain a color encrypted image. e three chaotic sequences generated by the ML neuron chaotic system determine the DNA encoding, decoding, and operation rules of each block. e initial value of the chaotic system is determined by the original image to ensure the effect of "one image, one cryptogram." ree different chaotic sequences which are obtained by performing three iterations on the logistic mapping are used to perform DNA operations with the original image, as well as row and column permutations after DNA decoding operations. e flowchart of the image encryption algorithm is shown in Figure 3. e specific encryption procedure can be summed up by Algorithm 1. e decryption algorithm is the inverse process of the abovementioned encryption algorithm and will not be described in detail here.

Experimental Simulation and Safety
Performance Analysis

Experimental Simulation.
e experiment was completed on the MATLABR2017, a platform in the Win10 system, and the algorithm in this paper was used to encrypt and decrypt a color Lena image with a size of 512 × 512. e result of encrypting and decrypting the Lena image is shown in Figure 4.

Histogram Analysis.
e grayscale histogram of the image can objectively reflect the distribution of image pixels. Figure 5 shows the grayscale histogram of the R, G, and B channels before and after the Lena image encryption through the comparison of grayscale.
In order to quantitatively compare whether the difference between the histograms of the test ciphertext and the ideal ciphertext image is significant, a chi-square test is used to analyze the uniformity of the histograms. e calculation method is shown in formula (3): wherein, f � M × N/256, M, N represents the size of the image. f i is the frequency of occurrence of gray value i. When the significance level is 0.05, the corresponding chi-square critical value is 293.2478. e calculation results of the chi-square analysis are shown in Table 6, from which it can be seen that the chi-square values of all ciphertexts are less than 293.2478, and the encryption algorithm has passed the chi-square test. erefore, the encryption algorithm proposed in this paper can effectively resist statistical attacks [26].

Correlation Analysis of Adjacent Pixels.
e correlation between adjacent pixels of a plaintext image is very strong, so the image is vulnerable to statistical analysis attacks. e calculation formula of the correlation coefficient between two pixels in the image is as shown in formulas (4)- (7): Computational Intelligence and Neuroscience wherein N is the logarithm of the required pixel, and x, y are the gray values of adjacent pixels. Different selection methods of x, y will lead to the correlation coefficients in different directions, including the horizontal direction, the vertical direction, and the opposite angle direction. N pixels point pairs are randomly selected from different directions, which makes N � 5000, and the correlation coefficient of each plaintext and ciphertext is calculated. It can be seen from the results of a certain experiment shown in Table 7 that the correlation coefficients of the three plaintext images in each direction are very large and close to 1, indicating that the adjacent pixels in each direction of the plaintext image are extremely correlated; at the same time, the correlation coefficients of the three ciphertext images are all extremely small and very close to 0, indicating that the correlation between adjacent pixels in all directions of the ciphertext image is extremely weak. In addition, compared with the methods proposed in literature [27] and literature [28], the algorithm proposed in this paper can eliminate the correlation between adjacent pixels and conceal the data characteristics of the original image.
Figures 6-8are the pixel distribution diagrams of three channels R, G, and B of the Lena plaintext and ciphertext image in different directions. It can be seen that the distribution of plaintext pixels is linear, while the distribution of ciphertext pixels is disorderly and irregular. erefore, the algorithm in this paper can effectively reduce the correlation between adjacent pixels of plaintext images and can effectively resist statistical analysis attacks.

Global Entropy and Local Entropy
Analysis. e definition of information entropy refers to the uncertainty of information, while the definition of image information entropy refers to the distribution probability of image gray values. When the distribution probability reaches the equal condition, the information entropy will be at the maximum value, which shows that the randomness of the ciphertext image is very high and that the encryption algorithm has a strong ability to resist statistical attacks. e calculation formula of global entropy is as formula (8): where L refers to the gray level of the image and p(m i ) represents the probability that the gray value m i appears. Table 8 shows the comparison with the encryption algorithms in existing literature. It can be seen that the global entropy of the encryption algorithm proposed in this paper is closer to the ideal value of 8.
On the basis of global entropy, Wu Y et al. proposed a calculation method called "local Shannon entropy," which overcomes the shortcomings of inaccuracy, inconsistency, and low efficiency of global entropy [31]. e local entropy is an improvement over the global entropy. It first randomly selects non-overlapping blocks in the image and then calculates the average value of the global entropy for the small image blocks. According to the method described in the literature, 30 non-overlapping blocks are randomly selected in the image. When the number of pixels in each block is 1936, the local entropy is calculated, and the ideal value is 7.9024. Within the 0.01 level, if the local entropy is between 7.9017 and 7.9032, it means that the local entropy of the image is ideal and the image has good randomness. e local entropy test results are shown in Table 9.

Key Sensitivity Analysis.
Key sensitivity refers to the resulting chaotic sequence changes after a small change to the key in the encryption algorithm, which has a great impact on the encrypted and decrypted image. If the key is not sensitive enough to correctly reconstruct the original image even with a slightly different key, the key may degenerate. In this paper, the key sensitivity test method of the encryption algorithm is given. e first method is direct observation. e same encrypted image is decrypted with a slightly changed key and the differences between the images are observed. We can improve the anti-cracking ability of the encryption algorithm by increasing a certain number of digits after the decimal point of the key. e decrypted image obtained when one of the encrypting keys x 0 is changed from 0.5475       Computational Intelligence and Neuroscience 9 to 0.547500000000001 is shown in Figure 9. It can be found that the decryption is not successful when the key is changed slightly, which shows that the proposed encryption algorithm has good key sensitivity and can effectively resist the exhaustive attacks. When one of the keys changes slightly, the histograms of the three channels of R, G, and B of the incorrectly decrypted images are as shown in Figure 10. It can be found that even if the original image is not successfully decrypted, the histograms of the decrypted image are still evenly distributed and can effectively resist attacks. e second method is to use the indicator NBCR (number of bit change rate) to quantitatively illustrate the key sensitivity from another perspective [32]. e NBCR of matrices B 1 and B 2 is defined as formula (9): where Ham(B 1 , B 2 ) is the Hamming distance of the two matrices B 1 and B 2 and len is the total number of bits of B 1 and B 2 .
If the NBCR result is close to 50%, it means that B 1 and B 2 are completely different matrices without any correlation. Specifically, the seven parameters (μ, x 0 , x 01 , x 02 , X(0), Y(0), Z(0)) in the algorithm are used as keys to form an infinite dimensional key space, and K is slightly changed (10 − 11 ) to obtain another key K ′ . Every parameter change in (μ, x 0 , x 01 , x 02 , X(0), Y(0), Z(0)) is in a very small δ interval. For example, the small change of x 0 is x 0 + 10 − 11 ∈ [x 0 − δ, x 0 + δ](δ � 10 − 10 ), and other parameters remain unchanged. Encrypting the original image with the keys K and K ′ , respectively, to obtain the encryption results C 1 and C 2 , and then calculate the NBCR values of C 1 and C 2 ; the same encryption result is decrypted with keys K and K ′ , respectively, to obtain decryption results D 1 and D 2 , and then calculate the NBCR values of D 1 and D 2 . e NBCR test results of the algorithm in this paper are shown in Table 10.
It can be seen from Table 10 that the calculated NBCR is very close to 50%, indicating that the results are completely different, which means that the algorithm is very sensitive to slightly changed keys.

Plaintext Sensitivity Analysis.
e plaintext sensitivity analysis aims to analyze the degree of change of the ciphertext image caused by the slight change of the plaintext image under the same key condition. When the change is large, the encryption system has a strong plaintext sensitivity and can effectively resist differential attacks. NPCR (pixel change rate) and UACI (pixel average change intensity) are usually used to detect the ability of image encryption schemes to resist differential attacks. e calculation formulas (10) and (11) are as follows: In the formula, M × N is the image size. Assuming that two plaintext images are different in only one pixel, after using the same algorithm to encrypt, the pixel values of the positions (m, n) in the ciphertext image are, respectively, I 1 (m, n) and I 2 (m, n); when the value of the two is the same, then the value of C(m, n) is 0, otherwise the value is 1. In the Lena plaintext, a pixel is randomly selected and its value is increased by 1, the same algorithm is used to encrypt, and the NPCR and UACI values are calculated. e results are shown in Table 11.
It can be seen from Table 11 that the NPCR of the image encrypted by the algorithm proposed in this paper is close to the ideal value of 100%, and the UACI is close to the ideal value of 33%. Compared with literature [33] and literature [34], the algorithm in this paper has stronger anti-differential attack capability.
Although the calculated NPCR and UACI values are close to the ideal values, only the NPCR and UACI values of the encrypted image are given quantitatively. In order to qualitatively analyze whether the encryption algorithm can   e test results are shown in Table 12. From the data in the table, it can be seen that the NPCR value and the UACI value are both within the confidence interval, so it can be proved that the algorithm proposed in this paper is sufficient to resist differential attacks.

Key Space Analysis.
e algorithm proposed in this paper uses a total of three logistic chaotic mappings. Although the values of parameter μ are the same, the initial values x 0 of each time are different. erefore, μ, x 0 , and the three initial values X(0), Y(0), and Z(0) of the ML neuron chaotic system can all be used as the system keys. e image is decrypted by changing the number of digits after the decimal point of the key to get the key sensitivity 10 − 15 , 10 − 16 , 10 − 16 , 10 − 16 , 10 − 16 , 10 − 16 , 10 − 16 of the key μ, x 0 , x 01 , x 02 , X(0), Y(0), Z(0), respectively, so the key capacity 10 15 × 10 16 × 10 16 × 10 16 × 10 16 × 10 16 × 10 16 � 10 111 of the encryption algorithm is obtained. Literature [36] pointed out that the key space of a security cryptosystem should be greater than 2 100 and both ENISA and NIST standards require a key size of at least 2 112 . e key space of the encryption scheme in this paper is larger than the above standards.   is paper uses noise attack and cropping attack to analyze the robustness of the proposed image encryption algorithm. ere is often a lot of noise in the transmission channel, which has a serious impact on the transmission of encrypted images, and even causes the decryption algorithm to fail to restore the identifiable original image. erefore, an excellent encryption algorithm must have certain noise robustness. In the process of information transmission, the loss of encrypted image information data will occur from time to time, which is often referred to as cropping attack. erefore, the image encryption algorithm needs to be able to resist the cropping   attack, so that it can successfully decrypt and recover recognizable images. PSNR (peak signal-to-noise ratio) between the original image and the decrypted image is an important indicator to measure the quality of the decrypted image, and its definition is shown in formulas (12) and (13).
PSNR � 10 × log MAX 2 where M × N is the image size, P(i, j) and D(i, j) are the original image and decrypted image, respectively, and MAX 2 I is the square of the maximum pixel value of the image. In order to analyze the anti-noise capability of the encrypted image, salt and pepper noises with different noise densities were added to the encrypted image, and the PSNR of the original image and the decrypted image was calculated.
e Lena encrypted images after adding noise densities of 0.005, 0.05, and 0.1 and the images decrypted using the proposed encryption algorithm are shown in Figure 11. It can be concluded from the figure that under the attack of salt and pepper noise, the decrypted image can still be recognized well.
e PSNR value between the original image and the decrypted image under the noise attack is calculated , and the results are shown in Table 13.   Experiments show that the proposed encryption algorithm has strong robustness against salt and pepper noise attacks. In order to analyze the anti-cropping attack capability of the encrypted image, the data of the encrypted image are crop by 1/16, 1/4 and ½, respectively, and the encryption algorithm proposed in this paper is used for decryption, respectively. e experimental effect is shown in Figure 12. As can be seen from the figure, under the crop attack, the decrypted image still has a certain degree of recognition. e PSNR value between the original image and the decrypted image under the crop attack is calculated, and the results are shown in Table 14. Experiments show that the proposed encryption algorithm has the ability to resist crop attack.

Speed Performance Analysis.
In addition to considering security, encryption speed is also an important aspect to measure the pros and cons of encryption algorithms, especially for real-time network transmission requirements. For images of different sizes, the encryption speed of this algorithm and existing encryption algorithms is compared, as shown in Table 15. e computer used for testing is Intel(R) Core(TM) i5-8265U CPU (1.60 GHz), 8G memory. It can be seen from the table that the algorithm in this paper has certain advantages and high real-time performance, which is very necessary for the image encryption algorithm.

Conclusions
e encryption algorithm proposed in this paper combines an improved ML neuron model with DNA encoding. First, the original image and the logistic chaotic matrix are divided into blocks and DNA encoding is performed, respectively, and then the DNA operation and decoding between the same positions of the two image blocks is continued. Second, the continuous iteration of the chaotic sequence is used to perform determinant permutation on the matrix. Finally, the ciphertext image is obtained, in which the DNA encoding, operation, and decoding methods are determined by the chaotic sequence generated by the ML neuron chaotic system. Encryption performance analysis proves that the algorithm has a larger key space, better statistical characteristics, stronger key sensitivity and plaintext sensitivity, and can effectively resist various attacks such as exhaustive attacks, statistical analysis attacks, and differential attacks, indicating that it has good security and effectiveness.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.