An image encryption and decryption method based on spatial deep learning

By employing a spatial deep learning-based image encryption and decryption method, and utilizing diffraction neural networks and optical elements for light field modulation, the security and ease of use issues of optical encryption systems are resolved, achieving high key sensitivity and high encryption capacity.

CN119743557BActive Publication Date: 2025-12-26ZHEJIANG UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411808127.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-12-26
Estimated Expiration
2044-12-10

AI Technical Summary

Technical Problem

Existing optical encryption systems suffer from insufficient security and robustness, and are costly to manufacture, making it difficult to meet the ease-of-use requirements of most real-world scenarios.

Method used

An image encryption and decryption method based on spatial deep learning is adopted. By constructing a diffraction neural network, using DMD and SLM to modulate the amplitude and phase of the optical field, and constructing a loss function to optimize the phase modulation matrix, flexible key replacement and high encryption capacity are achieved.

Benefits of technology

It achieves high key sensitivity and high encryption capacity, improves the security and ease of use of optical encryption systems, reduces the possibility of brute-force key search, and enhances the robustness of image encryption systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119743557B_ABST
    Figure CN119743557B_ABST
Patent Text Reader

Abstract

The application discloses an image encryption and decryption method based on spatial deep learning, which comprises the following steps: taking an obtained image to be encrypted as a plaintext image and taking a generated intensity modulation matrix as a key; constructing a diffraction neural network, wherein the diffraction neural network comprises a DMD, an SLM and a CCD camera, loading the key on the DMD, and obtaining a reconstructed image through the diffraction neural network; constructing a loss function based on the difference between the reconstructed image corresponding to a correct key and the plaintext image, and the difference between the reconstructed image corresponding to an incorrect key and an image obtained by reversing the plaintext image in black and white; using a gradient descent algorithm to modulate the phase of a light field by the SLM based on the loss function to obtain an optimized phase modulation matrix; taking the optimized phase modulation matrix as a ciphertext to complete image encryption; and in the decryption process, input light is sequentially passed through the DMD loaded with the key, the modulated SLM and the CCD camera to obtain a final reconstructed image, thereby completing image decryption. The method can easily replace the plaintext and the key, and has high encryption capacity and high key sensitivity.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the field of optical encryption technology, and particularly relates to an image encryption and decryption method based on spatial deep learning. BACKGROUND

[0002] Optical encryption is an important technology in the field of information security. With the increasing emphasis on data privacy, people increasingly need more mature, reliable and efficient information encryption technology. Optical encryption has high information processing speed and strong parallel computing capability, and is particularly suitable for application in image, audio and video coding and encryption tasks, and has broad development prospects in the future.

[0003] Since the double random phase encoding (DPRE) encryption system was proposed in 1995, optical encryption has entered a stage of rapid development. Optical encryption systems based on spatial light phase modulation use the diffraction effect of light to customize the adjustment of super surface micro-nano structures, which can meet most real high-concurrency and high-capacity information encryption scenarios.

[0004] The patent application with the publication number CN107742082A discloses an optical image encryption algorithm, which belongs to the field of image encryption. First, the input image is normalized. Based on the Logistic mapping, the initial value of the input image is generated using the pixel characteristics of the input image. The chaotic phase mask is output by iterating the Logistic mapping. With the help of the phase mask, the image is modulated, and the Fourier transform is combined to process the modulated image and output its Fourier spectrum. The spectrum is then decomposed into two masks. Based on the Fourier mechanism of different fractional orders, the two masks are transformed. Finally, the phase-amplitude truncation coding technology is introduced to effectively solve the problem of contour appearance. Experimental results show that compared with the current image encryption mechanism based on interference principle, the security of the proposed algorithm is higher, and the problem of contour appearance is effectively eliminated.

[0005] However, compared with existing electronic encryption technology, optical encryption systems based on phase modulation have inherent linear and insufficient anti-interference capabilities, which makes optical encryption information vulnerable to attack and tampering. The high cost of micro-nano processing of super surfaces also raises the threshold for building optical encryption systems. Therefore, how to improve the security, robustness and ease of use of optical encryption systems is a difficult problem that needs to be overcome in the field of information security.

[0006] The patent application with the publication number CN118112693A discloses an optical encryption system based on a thermal tuning metasurface. The invention utilizes the principle of temperature state switching of a periodically arranged nanoblock unit structure array to realize multiple security levels of optical encryption, and utilizes polarization multiplexing of light to display two superholographic images in the far field and project a pseudo-information identification code image in the near field. The optical encryption system encrypts information in multiple channels, improving the security of encryption, but the cost of manufacturing a thermal tuning metasurface is high, and the plaintext and key cannot be replaced, which makes it difficult for the system to meet the needs of most real-world scenarios in terms of ease of use. SUMMARY

[0007] The present application provides an image encryption and decryption method based on spatial deep learning, which can easily replace plaintext and keys, and has high encryption capacity and high key sensitivity.

[0008] The present application provides an image encryption and decryption method based on spatial deep learning, which includes:

[0009] The obtained image to be encrypted is used as a plaintext image, and the generated intensity modulation matrix is used as a key;

[0010] A diffraction neural network is constructed, the diffraction neural network includes a DMD, an SLM, and a CCD camera, the key is loaded on the DMD, and a reconstructed image is obtained through the diffraction neural network;

[0011] A loss function is constructed based on the difference between the reconstructed image corresponding to the correct key and the plaintext image, and the difference between the reconstructed image corresponding to the incorrect key and the image obtained by reversing the plaintext image in black and white, and a gradient descent algorithm is used to modulate the phase of the light field using the SLM based on the loss function to obtain an optimized phase modulation matrix, the optimized phase modulation matrix is used as a ciphertext, thereby completing image encryption;

[0012] In the decryption process, the input light passes through the DMD loaded with the key, the modulated SLM, and the CCD camera in sequence to obtain the final reconstructed image, thereby completing image decryption.

[0013] Preferably, the loss function Loss is:

[0014]

[0015] wherein Y is a plaintext image, is a reconstructed image corresponding to a correct key, is an image obtained by reversing the plaintext image in black and white, is a reconstructed image corresponding to an incorrect key, is a key change amount, 0 <1.

[0016] Preferably, the reconstructed image is:

[0017]

[0018] wherein K is a key constructed by an intensity modulation matrix, C is a ciphertext constructed by a phase modulation matrix, j is an imaginary unit, is a Fourier transform operator.

[0019] Preferably, the diffractive neural network module further comprises a laser, a first Fourier lens, an aperture, a second Fourier lens, a beam splitter, a third Fourier lens, and a zero-order diffraction blocker.

[0020] wherein the incident light is emitted by the laser, forms an original key image by the key-loaded DMD, and reaches the SLM for wavefront phase modulation through the 4f system constructed by the first Fourier lens, the aperture, and the second Fourier lens, and the beam splitter, and then shrinks through the third Fourier lens, and the zero-order diffraction blocker blocks the zero-order diffraction spot, and reaches the CCD camera to image the reconstructed image.

[0021] Preferably, the key is composed of a plurality of color blocks of the same size and random gray scale distribution, the average gray scale value of the color blocks is the same as the average gray scale value of the plaintext image, and the corresponding intensity modulation matrix is generated based on the gray scale value of each color block.

[0022] In the encryption and decryption process, the key is not adjusted.

[0023] Preferably, the amplitude of the phase modulation matrix corresponding to the ciphertext is between 0 and 2π, the autocorrelation coefficient of the ciphertext is an impulse function, and the ciphertext distribution satisfies a pseudo-random distribution.

[0024] Preferably, the DMD and the SLM are both connected to a computer, the key is loaded to the DMD based on the computer transmission, the light field amplitude modulation is completed by using the different light transmittances of different positions of the DMD, and the key is introduced into the optical encryption system.

[0025] In the training process through the loss function, the ciphertext is loaded to the SLM based on the computer transmission, the light field phase modulation is completed by using the different optical paths of different positions of the SLM, and the ciphertext is introduced into the optical encryption system.

[0026] Preferably, the DMD is composed of a plurality of micromirrors, the tilt angle of each micromirror is independently controlled by a circuit, the amplitude modulation is realized to obtain the key image.

[0027] Preferably, the SLM adjusts the refractive index of the liquid crystal layer by using the turning of the liquid crystal molecules under the action of voltage, and then performs wavefront phase modulation on the image.

[0028] Compared with the prior art, the application has the following beneficial effects:

[0029] The application is based on the difference between the reconstructed image corresponding to the correct key and the plaintext image, and the difference between the reconstructed image corresponding to the wrong key and the image obtained by reversing the plaintext image, and a loss function is constructed, and the diffraction neural network obtained by training the loss function can generate a reconstructed image close to the plaintext image when the key is correct, and even if a slight key deviation occurs, the reconstructed image is quite different from the plaintext image when the key is wrong, thereby achieving high key sensitivity.

[0030] The application uses spatial multiplexing to encrypt and decrypt multiple images, and different images share a part of the area in the ciphertext, thereby achieving the purpose of significantly improving the encryption capacity while ensuring the decryption performance of the optical system.

[0031] The application can load the required key through the DMD, and use the gradient descent algorithm based on the loss function to modulate the phase of the light field by the SLM to obtain an optimized phase modulation matrix, thereby making it easier to replace the plaintext and the key as needed. BRIEF DESCRIPTION OF DRAWINGS

[0032] Figure 1 A flowchart of the image encryption and decryption method based on spatial deep learning provided by the embodiment of the application is shown in the figure;

[0033] Figure 2 A structure diagram of the diffraction neural network provided by the embodiment of the application is shown in the figure;

[0034] Figure 3 A process diagram of the process of reaching the SLM to modulate the wavefront phase to obtain the reconstructed image is shown in the figure;

[0035] Figure 4 A ciphertext image and its autocorrelation coefficient value diagram provided by the embodiment of the application are shown in the figure;

[0036] Figure 5 A key image, a ciphertext image, a plaintext image and a reconstructed image provided by the embodiment 1 of the application are shown in the figure;

[0037] Figure 6 A correct key image and the corresponding reconstructed image, and a wrong key image and the corresponding reconstructed image provided by the embodiment 1 of the application are shown in the figure.

[0038] Among them, the first Fourier lens 230, the second Fourier lens 231, the third Fourier lens 232, the laser light source 100, the DMD (digital micromirror device) 210, the key 211, the SLM (liquid crystal spatial light modulator) 220, the ciphertext 221, the diaphragm 251, the zero-order diffraction blocker 252, the beam splitter 241, and the CCD camera 310.

[0039] DETAILED DESCRIPTION

[0040] Exemplary embodiments of the present disclosure will be described in greater detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it is understood that the present disclosure can be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure can be thoroughly understood and fully conveyed to those skilled in the art.

[0041] The specific embodiment of the present application provides an image encryption and decryption method based on spatial deep learning, as shown in Figure 1 The specific embodiment of the present application provides an image encryption and decryption method based on spatial deep learning, as shown in

[0042] S1, the obtained image to be encrypted is taken as a plaintext image, and the generated intensity modulation matrix is taken as a key:

[0043] The key provided by the specific embodiment of the present application is composed of a plurality of color blocks with the same size and random distribution of gray scale, the average gray scale value of the color block is the same as the average gray scale value of the plaintext image, so that the final reconstructed image has the same brightness as the plaintext image, and the corresponding intensity modulation matrix is generated based on the gray scale value of each color block. Since there is a difference in the gray scale value of each color block, it can be converted into a difference in the intensity of light, and then a corresponding intensity modulation matrix can be constructed. Since the key is fixed and unchanged, the key does not need to be adjusted during the encryption and decryption process.

[0044] The use of color blocks provided by the specific embodiment of the present application reduces the collimation requirement of the decryption optical system, and the plaintext image can still be restored when there is a slight offset or rotation of the device, thereby improving the robustness of the image encryption system. According to Shannon's information theory, H(K|C)=H(M|C)+H(K|M,C), where M, K, and C are random variables in the plaintext space, the key space, and the ciphertext space, respectively, and H represents the information entropy of an event. When the gray scale values of the color blocks are randomly distributed, H(K|C) is maximum. However, since the average gray scale value of the color block is the same as the average gray scale value of the plaintext, the information of the plaintext is partially reflected.

[0045] S2, a diffraction neural network is constructed, as shown in Figure 2 The diffraction neural network sequentially includes a laser 100, a DMD (digital micromirror device) 210, a first Fourier lens 230, an aperture 251, a second Fourier lens 231, a beam splitter 241, an SLM (liquid crystal spatial light modulator) 220, a third Fourier lens 232, a zero-order diffraction blocker 252, and a CCD camera 310 according to the propagation direction of the light path. The specific embodiment of the present application loads the key 211 onto the DMD (digital micromirror device) 210.

[0046] The light barrier 251 is located on the image plane of the first Fourier lens 230 and the object plane of the second Fourier lens 231, and the CCD camera 310 is located on the image plane of the third Fourier lens 232. The beam splitter 241 is located between the second Fourier lens and the third Fourier lens. The laser light source 100 is a helium-neon laser with a wavelength of 532 nm.

[0047] The incident laser is emitted from the laser light source 100, and the DMD 210 performs amplitude modulation on the light field to generate an original key image. The focal lengths of the first Fourier lens 230 and the second Fourier lens 231 are the same, forming a standard 4f system, so that the original key image remains the same size after passing through the 4f system, then passes through the beam splitter 241 to the SLM 220 for corresponding wavefront phase modulation, and then passes through the third Fourier lens 232 for beam shrinking and the zero-order diffraction blocker 252 for blocking the zero-order diffraction spot, and finally reaches the CCD camera for imaging of the reconstructed image.

[0048] According to the principle of computer holography, the zero-order diffraction light does not carry object information and has relatively concentrated energy, which seriously affects the imaging quality. Therefore, the zero-order diffraction blocker is arranged between the SLM and the third Fourier lens to block the zero-order diffraction spot.

[0049] S3, a loss function is constructed, and the gradient descent algorithm is used to modulate the phase of the light field by the SLM to obtain an optimized phase modulation matrix, the optimized phase modulation matrix is used as a ciphertext, and an image encryption process is realized.

[0050] The loss function provided by the embodiment of the present application is constructed based on the difference between the reconstructed image corresponding to the correct key and the plaintext image, and the difference between the reconstructed image corresponding to the incorrect key and the image obtained by reversing the black and white of the plaintext image. The loss function Loss is:

[0051]

[0052] Y is the plaintext image, Y is the reconstructed image corresponding to the correct key, Y is the image obtained by reversing the black and white of the plaintext image, Y is the reconstructed image corresponding to the incorrect key, is the key change amount, 0 <1.

[0053] In a specific embodiment of this invention, during the encryption process, a gradient descent optimization algorithm is used to simultaneously optimize the diffraction neural network results for both correct and slightly flawed key conditions. This ensures that the reconstructed image output when the key is correct is closer to the plaintext image, while the reconstructed image output when the key is flawed is closer to an inverted version of the plaintext image. Thus, during decryption, even slight changes to the key will lead to a significant decrease in the quality of the output image. This greatly reduces the possibility of an interceptor obtaining an equivalent key through brute-force search, thereby improving the security of the image encryption system.

[0054] In a specific embodiment of this invention, during the encryption process, a diffraction neural network is used as the program expression for the decryption optical system. Its forward process sequentially includes wavefront amplitude modulation, wavefront phase modulation, and Fourier transform; the reconstructed image... for:

[0055]

[0056] Where K is the key constructed from the intensity modulation matrix, C is the ciphertext constructed from the phase modulation matrix, and j is the imaginary unit. K is a Fourier transform operator, K is constant, and C is a variable. C is optimized using gradient descent through the loss function.

[0057] S4. During the decryption process, the input light is sequentially passed through a DMD loaded with the key, a modulated SLM, and a CCD camera to obtain the final reconstructed image, thus completing the image decryption. For example... Figure 2 As shown, the modulated SLM is equivalent to loading ciphertext 221 onto the SLM220. The beam carrying the original key image passes through the SLM220 loaded with ciphertext 221 and undergoes wavefront phase modulation to obtain the initial reconstructed image. The beam carrying the initial reconstructed image then undergoes Fourier transform through the third Fourier lens 232 and the zero-order diffraction blocker 252 blocks the zero-order diffraction spot before reaching the CCD camera 310 for imaging to obtain the final reconstructed image, thus completing the image decryption.

[0058] like Figure 3 As shown, the phase modulation matrix Φ containing the ciphertext information starts from the top left. Bottom left Top right Bottom right It consists of four equal-sized parts, each corresponding to one of the reconstructed images, and each overlapping with its adjacent parts by 50%. The light beam passes through... Amplitude modulation, The initial reconstructed image is obtained after phase modulation, and the final reconstructed image is obtained after Fourier operator transformation. The final reconstructed image is then compared with the plaintext image to obtain the difference. This is the feedforward process of a diffraction neural network.

[0059] The present application uses spatial multiplexing to encrypt and decrypt multiple images. Different images share a part of the area in the ciphertext, which achieves the purpose of significantly improving the encryption capacity while ensuring the decryption performance of the optical system. The larger the multiplexing area ratio, the greater the encryption capacity, but it will lead to a decrease in the decryption ability of the optical system. Preferably, when the multiplexing area accounts for 50% of the total area, the balance between decryption performance and encryption capacity can be maximized.

[0060] As shown in Figure 4 , Figure 4 A is an optimized phase matrix trained by a diffractive neural network, wherein each element has a value range of 0 to 2π, and has no characteristics such as stripes and spots. Further calculation obtains the autocorrelation coefficient matrix of the matrix as shown in Figure 4 B, except for a bright spot in the center, the surrounding is dark, which shows that the autocorrelation coefficient of the phase matrix is an impulse function, and the phase matrix satisfies the pseudo-random distribution. The interceptor cannot directly judge whether the matrix contains information by intercepting the phase matrix, which improves the security of encryption.

[0061] Embodiment 1

[0062] The specific details of the image encryption and decryption system based on spatial deep learning provided in this embodiment are as follows:

[0063] As shown in Figure 5 A, B and C, this embodiment uses 8 images of 256*256 pixels as plaintext, uses a key of 2*2 pixels, and uses a ciphertext of 512*512 pixels. The numerical simulation part uses Python 3.8, selects Nvidia a100 graphics card for training, and uses the learning framework Pytorch. The training process uses the simulated annealing algorithm to accelerate convergence, and the learning rate is reduced to 1 / 10 of the original every 5000 training rounds. The optimizer selects the adaptive moment estimation algorithm (Adam). The learning rate lr=0.001, and the training round number epoch=10000. The decryption process selects a helium-neon laser with a wavelength of 532nm, SLM 220 selects PLUTO-2.1, DMD 210 selects DLP3010, and the pixel size of both is 8*8um. The focal length of the first Fourier lens and the second Fourier lens is 5mm, and the focal length of the third Fourier lens is 8mm.

[0064] Figure 5 D shows the 8 plaintext images used for encryption, as well as the corresponding ciphertext keys and the reconstructed images. The peak signal-to-noise ratio (PSNR) of the reconstructed images is 12.26dB, 11.60dB, 13.52dB, 12.25dB, 12.23dB, 11.95dB, 11.82dB, and 11.80dB, respectively. All 8 plaintext images have good reconstruction effect.

[0065] Figure 6 A, B, C and D of FIG. 1 give the encrypted four images, correct keys and wrong keys and their corresponding reconstructed images. In the encryption process, the gradient descent optimization algorithm is used to optimize the results of the diffraction neural network when the key is correct and slightly wrong, so that the output result is closer to the plaintext image when it is correct, and the output result is closer to the image with black and white reversed when it is wrong.

Claims

1. An image encryption and decryption method based on spatial deep learning, characterized in that, include: The acquired image to be encrypted is used as the plaintext image, and the generated intensity modulation matrix is ​​used as the key; A diffraction neural network is constructed, which includes a DMD, an SLM, and a CCD camera. A key is loaded onto the DMD, and the reconstructed image is obtained through the diffraction neural network. A loss function is constructed based on the difference between the plaintext image and the reconstructed image corresponding to the correct key, and the difference between the image with the plaintext image reversed and the reconstructed image corresponding to the incorrect key. Based on the loss function, a gradient descent algorithm is used to modulate the phase of the light field using SLM to obtain an optimized phase modulation matrix. The optimized phase modulation matrix is ​​then used as ciphertext to complete the image encryption. During the decryption process, the input light is passed sequentially through a DMD loaded with the key, a modulated SLM, and a CCD camera to obtain the final reconstructed image, thereby completing the image decryption. The key consists of multiple color blocks of the same size with randomly distributed gray levels. The average gray level of each color block is the same as the average gray level of the plaintext image. A corresponding intensity modulation matrix is ​​generated based on the gray level of each color block. The key is not adjusted during encryption and decryption.

2. The image encryption and decryption method based on spatial deep learning according to claim 1, characterized in that, The loss function Loss is: Where Y is the plaintext image, The reconstructed image corresponding to the correct key. To reverse the plaintext image to a black and white image, The reconstructed image corresponding to the erroneous key. For key changes, 0 < <1.

3. The image encryption and decryption method based on spatial deep learning according to claim 1 or 2, characterized in that, The reconstructed image for: Where K is the key constructed from the intensity modulation matrix, C is the ciphertext constructed from the phase modulation matrix, and j is the imaginary unit. This is the Fourier transform operator.

4. The image encryption and decryption method based on spatial deep learning according to claim 1, characterized in that, The diffraction neural network module also includes a laser, a first Fourier lens, an aperture, a second Fourier lens, a beam splitter, a third Fourier lens, and a zero-order diffraction blocker. The incident light is emitted through a laser and passes through a key-loaded DMD to form the original key image. The original key image passes through a 4f system constructed by a first Fourier lens, an aperture, and a second Fourier lens, and a beam splitter to reach the SLM for wavefront phase modulation. Then, it passes through a third Fourier lens for beam contraction, and a zero-order diffraction blocker blocks the zero-order diffraction spot. Finally, it reaches a CCD camera to reconstruct the image for imaging.

5. The image encryption and decryption method based on spatial deep learning according to claim 1, characterized in that, The amplitude of the phase modulation matrix corresponding to the ciphertext is between 0 and 2π, the autocorrelation coefficient of the ciphertext is an impulse function, and the distribution of the ciphertext satisfies a pseudo-random distribution.

6. The image encryption and decryption method based on spatial deep learning according to claim 1, characterized in that, Both the DMD and SLM are connected to a computer. The key transmitted by the computer is loaded into the DMD. By utilizing the different transmittance at different positions of the DMD, the amplitude of the light field is modulated to introduce the key into the optical encryption system. During the training process using the loss function, the ciphertext transmitted from the computer is loaded into the SLM. By utilizing the different optical path lengths at different positions of the SLM, the phase modulation of the optical field is completed, thereby enabling the introduction of the ciphertext into the optical encryption system.

7. The image encryption and decryption method based on spatial deep learning according to claim 1, characterized in that, The DMD consists of multiple micromirrors, and the tilt angle of each micromirror is independently controlled by a circuit to achieve amplitude modulation and thus obtain a key image.

8. The image encryption and decryption method based on spatial deep learning according to claim 1, characterized in that, The SLM utilizes the orientation of liquid crystal molecules under voltage to adjust the refractive index of the liquid crystal layer, thereby performing wavefront phase modulation on the image.

Citation Information

Patent Citations

  • Optical image encryption algorithm

    CN107742082A

  • Multi-optical encryption method and system based on thermal tuning metasurface

    CN118112693A

  • Optical encryption method based on correlated imaging

    CN110766596A

  • Image authentication method based on aperture encryption and diffraction imaging

    CN116933277A