Image encryption and decryption method based on space deep learning

Through the image encryption and decryption method based on spatial deep learning, and the diffraction neural network is used to optimize the light field modulation, the problem of insufficient linear and anti-interference capabilities of the existing optical encryption system is solved, high key sensitivity and high encryption capacity are achieved, and the security and ease of use of the system are improved.

CN119743557AActive Publication Date: 2025-04-01ZHEJIANG UNIV

Patent Information

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

AI Technical Summary

Technical Problem

The existing optical encryption systems based on phase modulation have problems such as linearity and insufficient anti-interference capabilities, which leads to the susceptibility of encrypted information being attacked and tampered with. At the same time, the cost of metasurface micro-nano processing is high, limiting the ease of use of the system.

Method used

Using the image encryption and decryption method based on spatial deep learning, a diffraction neural network is constructed, and the light field amplitude and phase modulation is used to generate an optimized phase modulation matrix as the ciphertext, and the key and ciphertext are optimized through loss function and gradient descent algorithm.

Benefits of technology

It realizes high key sensitivity and high encryption capacity, and can easily replace plaintext and keys, improving the security and robustness of the optical encryption system, while reducing the manufacturing cost of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119743557A_ABST
    Figure CN119743557A_ABST
Patent Text Reader

Abstract

The invention discloses an image encryption and decryption method based on spatial deep learning, and the method comprises the steps: enabling an obtained to-be-encrypted image to serve as a plaintext image, and enabling a generated intensity modulation matrix to serve as a secret key; a diffraction neural network is constructed, the diffraction neural network comprises a DMD, an SLM and a CCD camera, the secret key is loaded on the DMD, and a reconstructed image is obtained through the diffraction neural network; constructing a loss function 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 reversing the plaintext image in black and white, and modulating the light field phase by using SLM based on the loss function by using a gradient descent algorithm to obtain an optimized phase modulation matrix, and taking the optimized phase modulation matrix as a ciphertext, thereby completing image encryption. And in the decryption process, the input light sequentially passes through the DMD loaded with the secret key, the modulated SLM and the CCD camera to obtain a final reconstructed image, so that image decryption is completed. According to the method, the plaintext and the secret key can be easily replaced, and high encryption capacity and high secret key sensitivity can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of optical encryption technology, and specifically relates to an image encryption and decryption method based on spatial deep learning. Background Art

[0002] Optical encryption is an important technology in the field of information security. As data confidentiality has gradually gained attention, people are increasingly in need of more mature, reliable and efficient information encryption technologies. Among them, optical encryption has high information processing speed and strong parallel computing capabilities, and is particularly suitable for image, audio and video encoding and decoding and encryption tasks, and has broad development prospects in the future.

[0003] Optical encryption has entered a rapid development stage since the dual random phase encoding (DPRE) encryption system was proposed in 1995. The optical encryption system based on spatial optical phase modulation uses the diffraction effect of light to customize the metasurface micro-nano structure, which can meet most high-concurrency and high-capacity information encryption scenarios in reality.

[0004] The invention patent application with 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 Logistic mapping, the pixel characteristics of the input image are used to generate its initial value, and the chaotic phase mask is output through iterative Logistic mapping; with the help of the phase mask, the image is modulated, and combined with Fourier transform, the modulated image is processed and its Fourier spectrum is output; then the spectrum is decomposed into equal modulus to obtain two masks; then the two masks are transformed based on Fourier mechanisms of different fractional orders; finally, the phase-amplitude truncation coding technology is introduced to effectively solve the contour appearance problem. Experimental results show that compared with the current image encryption mechanism based on the interference principle, the proposed algorithm has higher security and effectively eliminates the contour appearance problem.

[0005] However, compared with existing electronic encryption technologies, optical encryption systems based on phase modulation have inherent linearity and insufficient anti-interference capabilities, which makes optical encryption information easy to attack and tamper with. The high cost of micro-nano processing of metasurfaces 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 current information security field.

[0006] The invention patent application with publication number CN118112693A discloses an optical encryption system based on a thermally tuned metasurface. The invention uses the principle that a periodically arranged array of nanoblock unit structures switches with temperature to achieve multiple security levels of optical encryption. It uses polarization multiplexing of light to display two super-holographic images in the far field and project an identification code image of pseudo information in the near field. The optical encryption system encrypts information in multiple channels, improving the security of encryption. However, the cost of manufacturing a thermally tuned metasurface is high, and the plaintext and key cannot be replaced, resulting in the system's ease of use being difficult to meet the needs of most real-world scenarios. Summary of the invention

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

[0008] The present invention provides an image encryption and decryption method based on spatial deep learning, comprising: The acquired image to be encrypted is used as a plaintext image, and the generated intensity modulation matrix is ​​used as a key; Constructing a diffraction neural network, the diffraction neural network includes a DMD, an SLM and a CCD camera, loading a key on the DMD, and obtaining a reconstructed image through the diffraction neural network; 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 wrong key and the image with the plaintext image reversed in black and white. Based on the loss function, a gradient descent algorithm is used to modulate the light field phase using the SLM to obtain an optimized phase modulation matrix. The optimized phase modulation matrix is ​​used as the ciphertext to complete image encryption. During the decryption process, the input light passes through the key-loaded DMD, the modulated SLM, and the CCD camera in sequence to obtain the final reconstructed image, thereby completing the image decryption.

[0009] Preferably, the loss function Loss is: Among them, Y is the plaintext image, is the reconstructed image corresponding to the correct key, To invert the black and white of the plaintext image, is the reconstructed image corresponding to the wrong key, is the key change amount, 0< <1.

[0010] Preferably, the reconstructed image for: Where K is the key constructed by the intensity modulation matrix, C is the ciphertext constructed by the phase modulation matrix, j is the imaginary unit, is the Fourier transform operator.

[0011] Preferably, the diffraction 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; Among them, the incident light is emitted through the laser and forms the original key image through the key-loaded DMD. The original key image passes through the 4f system and beam splitter constructed by the first Fourier lens, the aperture and the second Fourier lens to reach the SLM for wavefront phase modulation, and then passes through the third Fourier lens to reduce the beam, and the zero-order diffraction blocker blocks the zero-order diffraction spot, and reaches the CCD camera to reconstruct the image for imaging.

[0012] Preferably, the key is composed of a plurality of color blocks of the same size and randomly distributed grayscale, the average grayscale value of the color blocks is the same as the average grayscale value of the plaintext image, and a corresponding intensity modulation matrix is ​​generated based on the grayscale value of each color block; The key is not adjusted during the encryption and decryption process.

[0013] 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.

[0014] Preferably, the DMD and SLM are both connected to a computer, and the key transmitted by the computer is loaded into the DMD. The light field amplitude modulation is completed by utilizing the different transmittances of different positions of the DMD to introduce the key into the optical encryption system; During the training process using the loss function, the ciphertext transmitted by the computer is loaded into the SLM, and the light field phase modulation is completed by utilizing the different optical path lengths at different positions of the SLM to introduce the ciphertext into the optical encryption system.

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

[0016] Preferably, the SLM utilizes the steering of liquid crystal molecules under the action of voltage to adjust the refractive index of the liquid crystal layer, thereby performing wavefront phase modulation on the image.

[0017] Compared with the prior art, the present invention has the following beneficial effects: The present invention constructs a loss function based on the difference between a reconstructed image corresponding to a correct key and a plaintext image, and the difference between a reconstructed image corresponding to an incorrect key and an image in which the plaintext image is inverted in black and white. The diffraction neural network trained by the loss function can generate a reconstructed image close to the plaintext image when the key is correct. When the key is incorrect, even if a very small key deviation occurs, the reconstructed image is greatly different from the plaintext image, thereby achieving high key sensitivity.

[0018] The present invention utilizes spatial multiplexing to encrypt and decrypt multiple images, and different images share a portion of area in the ciphertext, thereby achieving the purpose of significantly improving the encryption capacity while ensuring the decryption performance of the optical system.

[0019] Since the present invention can load the required key through the DMD, and use the SLM to modulate the light field phase based on the loss function using a gradient descent algorithm to obtain an optimized phase modulation matrix, it is easier to replace the plaintext and key as needed. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 A flowchart of an image encryption and decryption method based on spatial deep learning provided by a specific embodiment of the present invention; Figure 2 A structural diagram of a diffractive neural network provided for a specific embodiment of the present invention; Figure 3 A schematic diagram of a process of performing wavefront phase modulation on a SLM to obtain a reconstructed image provided by a specific embodiment of the present invention; Figure 4 A ciphertext image and a numerical diagram of its autocorrelation coefficient provided by a specific embodiment of the present invention; Figure 5 The key image, ciphertext image, plaintext image and reconstructed image provided in Example 1 of the present invention; Figure 6 The correct key image and the corresponding reconstructed image, the wrong key image and the corresponding reconstructed image provided in Example 1 of the present invention.

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

[0022] Specific embodiment The exemplary embodiments disclosed in the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments disclosed in the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.

[0023] The specific embodiment of the present invention provides an image encryption and decryption method based on spatial deep learning, such as Figure 1 As shown, including: S1. Use the acquired image to be encrypted as the plaintext image and the generated intensity modulation matrix as the key: The key provided by the specific embodiment of the present invention is composed of multiple color blocks of the same size and randomly distributed grayscale. The average grayscale value of the color block is the same as the average grayscale value of the plaintext image, so that the final reconstructed image has the same brightness as the plaintext image. The corresponding intensity modulation matrix is ​​generated based on the grayscale value of each color block. Since there are differences in the grayscale values ​​inside each color block, they can be converted into differences in light intensity, and then the corresponding intensity modulation matrix can be constructed. Since the key is fixed, the key is not adjusted during the encryption and decryption process.

[0024] The use of color blocks provided in a specific embodiment of the present invention reduces the collimation requirements of the decryption optical system, and can still restore the plaintext image when the device is slightly offset or rotated, 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, key space, and ciphertext space, respectively, and H represents the information entropy of the event. When the grayscale values ​​of the color blocks are randomly distributed, H(K|C) is the largest. However, the average grayscale value of the color block is the same as the average grayscale value of the plaintext, which will partially reflect the information of the plaintext.

[0025] S2, construct a diffractive neural network, such as Figure 2 As shown, the diffraction neural network 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 in sequence according to the propagation direction of the optical path. The specific embodiment of the present invention loads the key 211 onto the DMD (digital micromirror device) 210.

[0026] The aperture 251 provided in the specific embodiment of the present invention 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 532nm.

[0027] The incident laser provided in the specific embodiment of the present invention is emitted from the laser light source 100, and the amplitude of the light field is modulated by the DMD 210 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. Therefore, the original key image maintains its original size after passing through the 4f system, and then reaches the SLM 220 through the beam splitter 241 for corresponding wavefront phase modulation. After being beam-shrunk by the third Fourier lens 232 and the zero-order diffraction blocker 252 to block the zero-order diffraction spot, it reaches the CCD camera to reconstruct the image for imaging.

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

[0029] S3. Construct a loss function, and use the gradient descent algorithm to modulate the light field phase using SLM through the loss function to obtain an optimized phase modulation matrix. The optimized phase modulation matrix is ​​used as ciphertext to realize the image encryption process.

[0030] The loss function provided in the specific embodiment of the present invention 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 wrong key and the image in which the plaintext image is inverted in black and white. The loss function Loss is: Among them, Y is the plaintext image, is the reconstructed image corresponding to the correct key, To invert the black and white of the plaintext image, is the reconstructed image corresponding to the wrong key, is the key change amount, 0< <1.

[0031] In the encryption process, the specific embodiment of the present invention uses a gradient descent optimization algorithm to optimize the diffraction neural network results when the key is correct and slightly wrong at the same time, so that the reconstructed image output when it is correct is closer to the plaintext image, and the reconstructed image output when it is wrong is closer to the image with the plaintext image reversed in black and white. In this way, during the decryption process, a slight change in the key will cause the quality of the output image to drop significantly. This can greatly reduce the possibility of the interceptor to obtain an equivalent key through violent search, and improve the security of the image encryption system.

[0032] In the encryption process of the specific embodiment of the present invention, a diffraction neural network is used as a program expression for the decryption optical system, and its forward process includes wavefront amplitude modulation, wavefront phase modulation and Fourier transform in sequence; the reconstructed image for: Where K is the key constructed by the intensity modulation matrix, C is the ciphertext constructed by the phase modulation matrix, j is the imaginary unit, is the Fourier transform operator, K is constant, C is a variable, and C is optimized by the gradient descent method through the loss function.

[0033] S4. During the decryption process, the input light is sequentially passed through the key-loaded DMD, the modulated SLM and the CCD camera to obtain the final reconstructed image, thereby completing the image decryption. Figure 2 As shown, the modulated SLM is equivalent to loading the ciphertext 221 on the SLM220. The light beam carrying the original key image is subjected to wavefront phase modulation through the SLM220 loaded with the ciphertext 221 to obtain an initial reconstructed image. The light beam carrying the initial reconstructed image is then subjected to Fourier transformation by the third Fourier lens 232 and the zero-order diffraction blocker 252 to block the zero-order diffraction spot, and reaches the CCD camera 310 for imaging to obtain the final reconstructed image, thereby completing image decryption.

[0034] like Figure 3 As shown, the phase modulation matrix Φ containing the ciphertext information is , bottom left , Top Right , bottom right The beam passes through four equal parts, each of which corresponds to one of the reconstructed images and overlaps with the adjacent parts by 50%. Amplitude modulation, After phase modulation, the initial reconstructed image is obtained, and after Fourier operator transformation, the final reconstructed image is obtained, and the final reconstructed image is compared with the plaintext image to obtain the difference. This is the forward process of the diffraction neural network.

[0035] The present invention uses spatial multiplexing to encrypt and decrypt multiple images. Different images share a part of the area in the ciphertext, achieving the purpose of significantly improving the encryption capacity while ensuring the decryption performance of the optical system. The larger the proportion of the reused area, the larger the encryption capacity, but it will cause the decryption ability of the optical system to decrease. Preferably, when the reused area accounts for 50% of the total area, the balance between decryption performance and encryption capacity can be guaranteed to the greatest extent.

[0036] like Figure 4 As shown, Figure 4 A is the optimized phase matrix obtained by diffraction neural network training, in which each element ranges from 0 to 2π and has no features such as stripes and spots. The autocorrelation coefficient matrix of the matrix is ​​further calculated as follows: Figure 4 As shown in B, except for a bright spot in the center, there are dark spots all around, indicating 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 determine whether the matrix contains information by intercepting the phase matrix, which improves the security of encryption.

[0037] Example 1 The specific details of the image encryption and decryption system based on spatial deep learning provided in this embodiment are as follows: like Figure 5 As shown in A, B and C, this embodiment uses 8 256*256 pixel images as plaintext, a 2*2 pixel key and a 512*512 pixel ciphertext. The numerical simulation part uses Python 3.8, NVIDIA a100 graphics card is selected for training, and the learning framework used is Pytorch. The training process uses the simulated annealing algorithm to accelerate convergence, and the learning rate drops to 1 / 10 of the original after every 5000 rounds of training. The optimizer uses the adaptive moment estimation algorithm (Adam). The learning rate lr=0.001, and the number of training rounds epoch=10000. The decryption process uses a helium-neon laser with a wavelength of 532nm, SLM 220 selects PLUTO-2.1, and DMD 210 selects DLP3010. The pixel size 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.

[0038] Figure 5 As shown in D, the 8 plaintext images used for encryption, the corresponding ciphertext keys and the reconstructed images are given. The peak signal-to-noise ratios (PSNRs) of the reconstructed images are 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 effects.

[0039] Figure 6Figures A, B, C and D show the correct and incorrect keys and their corresponding reconstructed images when encrypting four images. During the encryption process, the gradient descent optimization algorithm is used to optimize the diffraction neural network results 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 the plaintext image reversed when it is wrong.

Claims

1. A method for image encryption and decryption based on spatial deep learning, characterized in that: include: The acquired image to be encrypted is used as a plaintext image, and the generated intensity modulation matrix is ​​used as a key; Constructing a diffraction neural network, the diffraction neural network includes a DMD, an SLM and a CCD camera, loading a key on the DMD, and obtaining a reconstructed image through the diffraction neural network; 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 wrong key and the image with the plaintext image reversed in black and white. Based on the loss function, a gradient descent algorithm is used to modulate the light field phase using the SLM to obtain an optimized phase modulation matrix. The optimized phase modulation matrix is ​​used as the ciphertext to complete image encryption. During the decryption process, the input light passes through the key-loaded DMD, the modulated SLM, and the CCD camera in sequence to obtain the final reconstructed image, thereby completing the image 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: Among them, Y is the plaintext image, is the reconstructed image corresponding to the correct key, To invert the black and white of the plaintext image, is the reconstructed image corresponding to the wrong key, is the key change amount, 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:

4. Among them, K is the key constructed by the intensity modulation matrix, C is the ciphertext constructed by the phase modulation matrix, j is the imaginary unit, is the Fourier transform operator.

5. 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; Among them, the incident light is emitted through the laser and forms the original key image through the key-loaded DMD. The original key image passes through the 4f system and beam splitter constructed by the first Fourier lens, the aperture and the second Fourier lens to reach the SLM for wavefront phase modulation, and then passes through the third Fourier lens to reduce the beam, and the zero-order diffraction blocker blocks the zero-order diffraction spot, and reaches the CCD camera to reconstruct the image for imaging.

6. The image encryption and decryption method based on spatial deep learning according to claim 1, characterized in that: The key is composed of a plurality of color blocks of the same size and randomly distributed grayscale, the average grayscale value of the color blocks is the same as the average grayscale value of the plaintext image, and a corresponding intensity modulation matrix is ​​generated based on the grayscale value of each color block; The key is not adjusted during the encryption and decryption process.

7. 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 ciphertext distribution satisfies a pseudo-random distribution.

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

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

10. The image encryption and decryption method based on spatial deep learning according to claim 1, characterized in that: The SLM utilizes the steering of liquid crystal molecules under the action of 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

  • Volume holographic four-dimensional code anti-counterfeiting implementation method

    CN111291844A

  • Multi-three-dimensional scene encryption and decryption method with controllable amplification and decryption

    CN113343268A

Cited By

  • Design method of multi-scale convolutional network and single-plane diffraction element optical number cooperation system

    CN120255151A

  • Hybrid photoelectric encryption method and system based on physical diffraction layer

    CN121000387A

  • Hybrid optoelectronic encryption method and system based on physical diffraction layer

    CN121000387B