Image Recognition and Encryption Algorithm Based on Artificial Neural Network and Multidimensional Chaotic Sequence

With the continuous development of Internet technology and technological innovation, image recognition technologies such as face unlocking and face brushing payment have gradually entered daily life. However, it can not be ignored that these technologies not only bring us great convenience but also face great risks. The biological characteristics of a face image are unique, and it will be difficult to modify once it is leaked. If the image information stored in the cloud is leaked because it cannot be properly kept, users have no privacy. The encryption and recognition of face image can effectively solve this problem. Aiming at this, high-dimensional chaos Henon Map and one-dimensional chaos Logistic Map are used to generate a key to complete the encryption of the image in the transformation domain, and the capacity and complexity of the key are further enhanced. Then, combined with BP neural network to achieve face image recognition. Finally, the robustness of the proposed algorithm is verified and analyzed by conventional attacks, geometric attacks, and occlusion attacks.


Introduction
With the continuous development and progress of Internet technology, information security and privacy protection have attracted more and more attention [1][2][3][4][5][6][7]. e development of scientific and technological revolution has promoted the advent of the Internet era, and computer intelligent image recognition technology is becoming more and more mature [8][9][10][11]. Face recognition, which is an important field in image recognition, is a biometric technology for identity recognition based on facial features [5,12,13]. It is a research hotspot of artificial intelligence and computer vision. It is widely used in the fields of access control system, financial payment, public security, and so on. e process of traditional authentication methods such as ID card, password, and signature is cumbersome. When users forget to carry relevant certificates or forget the password, it will bring a series of unnecessary troubles, and these methods are easy to be tampered with and forged. Compared with other biometric recognition methods such as iris recognition and fingerprint recognition, the advantage of face recognition is noncontact and nonmandatory. Users do not need to contact the device directly. e recognized face image information is actively obtained by the device, and the recognition process is more friendly. At present, most of the research on face recognition is based on the plaintext domain, and there is little research on encrypted face recognition. In order to effectively protect face image data, it is of great significance to study encrypted face image recognition.
Discrete wavelet transform (DWT) [14,15] has better spatial-frequency domain decomposition characteristics than other frequency-domain transforms, but its antiattack ability is poor. For this reason, we study an encrypted face recognition algorithm based on a neural network [16] and DWT-Discrete Cosine Transform (DWT-DCT) transform [17] and propose an image recognition and encryption algorithm based on an artificial neural network and multidimensional chaotic sequence.

Encryption Method
e encryption process of the encrypted face image recognition algorithm based on neural network and DWT-DCT transformation is shown in Figure 1.
e detailed encryption steps are as follows: (1) Use wavelet transform to decompose the face image f(i, j) with a two-layer wavelet, and obtain 4 subband matrices [LL, HL, LH, HH]; [LL, HL, LH, HH] � DW T2(f(i, j)). (1) (2) Perform DCT transformation on the four sub-band matrices, respectively, to obtain sub-band frequency domain coefficient matrices: LL1, HL1, LH1, and HH1; (3) e chaotic sequence is generated by the Henon map and Logistic map, respectively, and the chaotic sequence is binarized to obtain the binarized matrix H(i, j) and L(i, j); (4) XOR the binary matrix to obtain the encrypted binary matrix S′(i, j); (5) Set the 0 element in S ′ (i, j) to -1, and construct the encrypted binary matrix S(i, j) according to the size of the image; (6) Do point multiplication with the encrypted binary matrix S(i, j) and the sub-band frequency domain coefficient matrix LL1, HL1, LH1, and HH1 to complete the face image encryption in the frequency domain;  [18][19][20] and Henon Map [21][22][23] are shown in Figure 2. It can be seen from the image effects before and after encryption that the encrypted image has a good encryption effect, which can effectively protect image data under the condition that the key is not leaked.

Sensitivity Analysis.
During the experiment, the parameter values of Henon mapping are selected as follows, a � l.5, b � 0.323, X 0 � 0.76235607, Y 0 � 0.2236674091, the growth parameter of Logistic mapping is 4, and the initial value X 0 � 0.122. Taking the first expressive face of the first person in the ORL face database as the test object to test the sensitivity. Due to the limited computational precision of the computer, there will be some data loss in the encryption and decryption of the frequency domain transform, and the image decrypted by the correct key will be slightly different from the original image, but overall the same.
It can be seen from the decrypted images that even if a slight change in the key cannot decrypt the image correctly, causing the decryption to fail, indicating that the encryption method is highly sensitive.

Correlation Analysis.
Correlation analysis is also a kind of data analysis attacks. Generally, the correlation between adjacent pixel values of any plaintext image is strong, whether in the horizontal direction, vertical direction, or diagonal direction. If the encryption effect is good, the correlation between adjacent pixel values in these three directions is relatively weak. e calculation formula of the correlation coefficient between adjacent pixels is where N represents the logarithm of randomly selected adjacent pixels, x(n) and y(n) are pixel values of randomly selected adjacent pixel pairs.
In order to more clearly see the difference between encrypted image and plaintext image, plaintext image Einstein will be used as a test image to test the correlation coefficient of encrypted image and plaintext image in three directions. Figure 3, respectively, shows the correlation distribution Figure 4 of plaintext image and Figure 5ciphertext image in horizontal, vertical, and diagonal directions.

2
Computational Intelligence and Neuroscience rough the test of multiple images, the test values of the correlation coefficient between the plaintext image and the corresponding ciphertext image in three directions show that the value of the correlation coefficient of the ciphertext image in three directions is close to 1, while the value of the correlation coefficient of the ciphertext image in the corresponding direction is close to 0, and some even show a negative correlation. erefore, the plaintext image eliminates the correlation between adjacent pixel values under the action of the encryption algorithm, so that the attacker cannot obtain directly valuable information.

Algorithm Flow
e specific flow of the proposed image recognition and encryption algorithm based on an artificial neural network and multidimensional chaotic sequence is shown in Figure 6.
e detailed identification steps are as follows: (1) Encrypt the image in the DWT-DCT transform domain for the original image database (2) Using the PCA algorithm to extract the characteristics of the encrypted image of the training sample and obtain the projection matrix T (3) e dimension reduction matrix D is obtained by projecting the training sample X through the projection matrix T (4) Use the dimensionality reduction matrix D as the input of the neural network to create and train the neural network (5) Use the proposed encryption method to encrypt the face to be tested to obtain the encrypted image E 1 (6) Project the encrypted image E 1 through the projection matrix T to obtain the dimension-reduced face matrix E 2 (7) Input the dimensionality reduction face matrix E 2 into the trained neural network to complete the recognition of the face to be tested

Recognition Rate.
In constructing the BP neural network [24][25][26], the input of the BP neural network is also different with different energy selected, and the recognition rate of the encryption algorithm will be different. During the experiment, the influence of the energy coefficient on the recognition rate of the neural network was analyzed by changing the size of the energy coefficient. e recognition rates of    Table 1. Table 1 shows that when the selected energy coefficient is 75, the recognition rate of the encryption algorithm at this time is 63.5%. When the energy coefficient chosen increases gradually, the recognition rate of the encryption algorithm will also increase accordingly. When the energy coefficient goes 85%, the eigenvectors corresponding to the first 48 largest eigenvalues are selected, the projection matrix is 10315 * 48, the input after dimension reduction is 200 * 48, and the recognition rate of the encryption algorithm goes to the maximum value of 82%. en, as the energy coefficient increases, the recognition rate of the encryption algorithm will decrease correspondingly. It can be seen that the more significant the selected energy coefficient, the better, and the more retained eigenvectors, the better. Only by selecting appropriate energy coefficients and eigenvectors can the performance of the encryption algorithm be optimal.
In the simulation experiment, the face image of the first person in the ORL face database is selected as the test image to test the robustness of the encrypted face recognition algorithm based on neural network and DWT-DCT transformation. Before the experiment, 50 people in the ORL face database were marked as serial numbers 1-50.
e face images to be tested were subjected to conventional attacks, geometric attacks, lighting attacks, occlusion attacks, and others. e robustness of the encryption algorithm is evaluated by testing whether the image to be tested can still be accurately recognized after being attacked.

Gaussian Noise.
During the experiment, the function imnoise() of Matlab is used to add Gaussian noise to the image to be tested. e data obtained from the experiment are shown in Table 2.
Observing the data in Table 2, it can be concluded that when the Gaussian noise attack intensity increases from 5% to 25%, the PSNR value of the image drops from 12.86 to 8.21. At this time, the image is quite blurred and difficult to see visually.
However, the proposed encryption algorithm can always accurately identify the person whose serial number is 1, indicating that this chapter's encryption algorithm has good antiattack ability against Gaussian noise attacks.

JPEG Compression.
A JPEG compression experiment was performed on the face image to be tested, and the compression quality was used to describe the degree of image compression. e smaller the compression quality, the higher the compression degree of the image, and the worse the image quality. e purpose of image compression is achieved by selectively removing high-frequency redundant parts. e data obtained in the experiment after the JPEG compression attack are shown in Table 3.
Observing at Table 3, it can be seen that when the compression quality is 5, the PSNR value of the image is 22.34, the image has become quite blurred and difficult to identify, but the encryption algorithm can still accurately identify the face image with serial number 1. When the compression quality increases gradually, the PSNR value of the image will increase progressively, and the degree of distortion will become lower and lower. When the compression quality is 25, the PSNR value at this time is 29.75. e proposed encryption algorithm recognizes the encrypted face image as the person whose serial number is 1 in the ORL face database. To sum up, the proposed image recognition and encryption algorithm based on an artificial  Figure 6: e specific flow of the proposed image recognition and encryption algorithm.  Computational Intelligence and Neuroscience 5 neural network and multidimensional chaotic sequence has good resistance to JPEG attacks.

Median Filter.
Median filtering is a nonlinear processing technology that reorders the gray values in the field according to their size. It selects the median value of the ordered sequence as the output pixel value, which can overcome the blurring of image details caused by linear average filtering. e filter window size is [7 × 7], and the face image with 10 times of filtering is tested, and the specific experimental data obtained in the experiment are shown in Table 4.
Observing Table 4, it can be seen that as the number of filters or the filter window increases, the PSNR value of the image will decrease, and the proposed encryption algorithm can always accurately identify the face image with serial number 1.
e encryption algorithm has an excellent antiattack ability to median filter.

Translation Attack.
Under the condition of translation attack, the image is moved up and down, left and right, and the antitranslation attack ability of the encryption algorithm is tested by changing the percentage coefficient of translation. e experimental data obtained by horizontal left shift and horizontal right shift are shown in Table 5.
Observing Table 5, it can be seen that before the horizontal left shift percentage goes 32%, the encryption algorithm can accurately identify the face with serial number 1. When the left shift percentage is 32%, it has suffered a considerable strength attack. e PSNR value of the image is 8.25, the encryption algorithm cannot accurately recognize the face, and it will be mistakenly identified as the person whose serial number is 20. e horizontal right shift can be accurately recognized until the horizontal right shift percentage goes 10%. When the right shift percentage goes 10%, the PSNR is 13.11 at this time, and the encryption algorithm will incorrectly identify the face image for the person whose serial number is 15 in the ORL face database. It is not difficult to see that the ability of the proposed algorithm to resist a horizontal left shift attack is obviously better than that of a horizontal right shift attack. e experimental data obtained by moving the face image to be tested vertically up and down are shown in Table 6.
Observing the data in Table 6, it can be seen that the encryption algorithm has almost the same resistance to vertical upward and vertical downward attacks. When the vertical upward movement percentage is less than 7%, it can accurately identify the person with serial number 1. When the moving percentage reaches 7%, the encryption algorithm will incorrectly identify the person with serial number 19. When the percentage of vertical downward movement goes 6%, the PSNR value of the image will be 16.35, and it will be mistakenly identified as the person with the serial number 17. It can be seen that the encrypted face recognition algorithm has the same resistance to vertical up and vertical down.

Rotation Transformation.
In the experiment, the rotation angle change is used as the change parameter, and the face image to be tested is rotated clockwise and anticlockwise to test the antirotation attack ability of the proposed encrypted face image recognition algorithm. e experimental data obtained after clockwise rotation and anticlockwise rotation are shown in Table 7.
It can be seen from Table 7 that the PSNR value of the image is inversely proportional to the degree of rotation. When the degree of clockwise or anticlockwise rotation increases, the PSNR value of the image will decrease accordingly. When the clockwise rotation goes 13°, the encryption algorithm can be accurately identified. When the rotation degree increases to 13°, the PSNR value is 14.89. e person with serial number 5 will be wrongly identified at this time. For anticlockwise rotation, when the degree of rotation increases to 14°, the encrypted face recognition algorithm will incorrectly identify the person with the serial number 2.   It can accurately identify the person with the serial number 1 before that. e proposed encrypted face recognition algorithm has the same resistance to clockwise rotation as anticlockwise rotation.

Light Attack.
During the experiment, Photoshop software was used to simulate the lighting conditions to preprocess the image. e antilight attack ability of the encrypted face recognition algorithm was tested by changing the light intensity. e experimental data under different illumination conditions are shown in Table 8.
Observing the data in Table 8, it can be seen that when the intensity of the light attack changes from strong to weak and then strong, the PSNR value of the image will decrease as it increases. In this change process, the encrypted face recognition algorithms proposed in this chapter can be accurately identified as the person whose serial number is 1, which indicates that the encrypted face recognition algorithm based on the network and DWT-DCT transformation has good resistance to light attacks.

Occlusion Attack.
In real life, face images will inevitably be occluded by masks, glasses, hats, etc., and occlusion will significantly impact face recognition. In the experiment, Photoshop software is used to preprocess the image to be tested and simulate the occlusion of masks, glasses, and hats to test the resistance of the encrypted face recognition algorithm to occlusion attack. e experimental data after being occluded by different occlusion areas are shown in Table 9.
From the data in Table 9, it can be seen that for the occlusion of glasses, the person with the serial number 1 can be accurately identified before the occlusion area reaches Large. When the occlusion area is further expanded to L, it will be incorrectly recognized as the person with serial number 21 in the ORL face database. For mask occlusion, the encrypted face recognition algorithm can always accurately recognize, while the hat occlusion is always incorrectly recognized as the person with serial number 25. is shows that the designed algorithm has good resistance to glasses occlusion and mask occlusion, while the resistance to hat occlusion is relatively poor.

Analysis and Discussion
e recognition rates of three algorithms (unencrypted, DCT, DFT, and DWT-DCT) are compared with the recognition rates of the algorithms without encryption. e face image recognition rates of various algorithms under different energy coefficients are shown in Figure 7.
It can be seen from the data in Figure 7 that the recognition rates of the three encrypted face image recognition methods are different under different energy coefficients.
When the selected energy coefficient reaches 85%, the recognition rate of the encrypted face recognition algorithm based on DCT transform and DWT-DCT transform reaches the maximum, which are 80% and 81%, respectively, and the difference between the recognition rate of the algorithm    Computational Intelligence and Neuroscience without encryption and 82% is only within 2%. e maximum recognition rate of the encrypted face image recognition algorithm based on the DFT transform appears at the energy coefficient of 95%, reaching 81%. For different encrypted face recognition algorithms, it is necessary to select the appropriate energy coefficient to optimize the algorithm's performance. e security of face image data is effectively protected after chaotic encryption.

Conclusions
is paper proposes an image recognition and encryption algorithm based on an artificial neural network and multidimensional chaotic sequence. It adopts the combination of high-dimensional chaos and one-dimensional chaos to enhance the security of the key. And, complete the image encryption in the DWT-DCT transform domain and use PCA and BP neural network to achieve face recognition. en, the key sensitivity, algorithm recognition rate, and robustness of the encryption algorithm were analyzed and tested. Finally, the algorithm recognition rate and robustness of the three encrypted face recognition algorithms and unencrypted face recognition are compared and analyzed. e results show that the recognition rate of the face recognition method using transform domain encryption is not much different from that of the unencrypted face recognition method, and it has good robustness. And, after encryption, the security of face image data on the Internet is greatly improved.

Data Availability
e data used to support the study are included in the paper.

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