Image encryption method based on neural network convolution kernel

By using a neural network convolution kernel-based image encryption method, which utilizes sparse matrices and linear equations to achieve image encryption, the problems of slow encryption speed and high image distortion rate in existing technologies are solved, achieving fast encryption and high-fidelity decryption.

CN117459655BActive Publication Date: 2026-05-12SHAANXI NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHAANXI NORMAL UNIV
Filing Date
2023-10-31
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing image encryption methods are inadequate in terms of encryption speed and image fidelity during decryption, and are easily cracked.

Method used

An image encryption method based on neural network convolution kernels is adopted. The image encryption is achieved by randomly generating convolution kernels, using sparse matrices and linear equations, extracting high-dimensional information by convolution operations, and randomly selecting the solution as the encrypted image. The original convolution kernel is used for decryption.

Benefits of technology

It achieves fast encryption speed, high-fidelity decryption of images that are difficult to crack, and has good confidentiality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117459655B_ABST
    Figure CN117459655B_ABST
Patent Text Reader

Abstract

The application discloses a kind of image encryption methods based on neural network convolution kernel, comprising: image preprocessing;Determine convolution operation;Original graph is convolved;Encrypted image;Decrypted image.The application uses convolution kernel as the key of encrypted image, is used for image encryption technology, and convolution operation can greatly simplify encryption operation operation, and the way of extracting the high-dimensional information of picture is as encrypted image.The application uses the mathematical principle that linear equation group has infinite solution if the rank of coefficient matrix in linear equation group is less than n, and for the same convolution image, the same convolution kernel can have multiple convolved images, randomly selects a convolved image as encrypted image, with good secrecy and not easy to crack characteristics.The application method has the advantages of fast encryption speed, small decryption image distortion rate and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing technology, specifically relating to methods for encrypting and decrypting images. Background Technology

[0002] Images play an increasingly important role in people's lives, with a large number of pictures being transmitted on social networks. However, this also makes it easy to leak personal privacy. For example, some people use other people's photos to retrieve their packages via facial recognition. Therefore, encrypting and protecting images is particularly important. Most images today are digital images, composed of individual pixels. If we zoom in on an image, we can see small squares, which combine to form the image we see with the naked eye. Each of these small squares stores a pixel value, ranging from 0 to 255.

[0003] To ensure the confidentiality of digital images, in practice, two-dimensional images are typically first converted into one-dimensional data before being encrypted using traditional encryption algorithms. Unlike ordinary text information, images and videos possess temporal, spatial, and visually perceptible characteristics, and can also undergo lossy compression. These characteristics make it possible to design more efficient and secure encryption algorithms for images. Since the 1990s, researchers have utilized these characteristics to propose various image encryption algorithms. In general, image encryption technology is a technique that utilizes the characteristics of digital images to design encryption algorithms in order to improve encryption security and computational efficiency.

[0004] Two common image encryption operations are obfuscation and diffusion. Obfuscation refers to scrambling the original positions of pixel values ​​in a two-dimensional matrix; while diffusion refers to the phenomenon where a small change in the value of one pixel in the original image leads to a large change in the values ​​of all pixels in the entire image.

[0005] Common obfuscation methods include sorting, circular shifting, Arnold transformation, magic square transformation, etc., which use different principles to change the position of pixels. The disadvantage of this type of method is that it relies solely on changing the position of each pixel in the image to make it indistinguishable to the human eye, and it can be cracked when faced with exhaustive calculations. Summary of the Invention

[0006] The technical problem to be solved by the present invention is to overcome the shortcomings of the prior art and provide an image encryption method based on neural network convolution kernels that has fast encryption speed, high image fidelity in decryption, and low distortion rate.

[0007] The technical solution adopted to solve the above technical problems is: an image encryption method based on neural network convolution kernels, including the following steps:

[0008] Step 1. Image Preprocessing

[0009] Take a standard test image and save it as a PNG file as the original image.

[0010] Step 2. Determine the convolution method

[0011] Step 2.1. Use PyCharm software to randomly generate a convolution kernel as the original convolution kernel c;

[0012] Step 2.2. Create and initialize a matrix W of size [(w×h)×(w×h)], where w is the pixel width of the original image and h is the pixel height of the original image;

[0013] Step 2.3. Update matrix W based on the original convolution kernel c to generate a sparse matrix W. / ;

[0014] Step 3. Perform a convolution operation on the original image.

[0015] The original image is flattened into a one-dimensional long vector im_f of size 1*(w×h), and then the long vector im_f is used with the sparse matrix W. / Perform a matrix dot product operation to obtain a long vector im_c_f with a dimension of 1*(w×h). Change the dimension of the long vector im_c_f to w×h to obtain the convolutional image im_c.

[0016] Step 4. Encrypt the image

[0017] The sparse matrix W obtained in step 2.3 / The convolutional image im_c obtained in step 3 is input into the linear equation system Ax = B for solution, where A is a sparse matrix W. / B is the convolutional image im_c, due to the sparse matrix W / Since it is a non-rank matrix, the linear system of equations Ax = B has infinitely many solutions. Randomly select a solution that is different from the original image as the encrypted image.

[0018] Step 5. Decrypt the image

[0019] The decryptor receives the encrypted image from step 4 and the original convolution kernel c, and performs a convolution operation between the encrypted image and the original convolution kernel c to obtain image im. s For image im s The deconvolution operation is performed to obtain the decrypted image.

[0020] As a preferred technical solution, the size of the original convolution kernel c is 3×3 or 5×5, and the convolution stride is 1.

[0021] As a preferred technical solution, the method for updating matrix W based on the original convolution kernel c in step 2.3 is as follows:

[0022] 1) Obtain the index s corresponding to each position (i,j) in matrix W, s = i × w + j, and assign the weight of the center position of the original convolution kernel c to the (s, s) position in matrix W;

[0023] 2) Based on each position (k, l) of the original convolution kernel c, obtain the corresponding matrix position index x and y according to the following formula, 0 < k < m-1, 0 < l < n-1, k and l are both positive integers, m is the height of the original convolution kernel c, and n is the width of the original convolution kernel c;

[0024] x = i + km / 2

[0025] y = j + ln / 2

[0026] 3) When 0 ≤ x < h and 0 ≤ y < w, the weights at position (k, l) of the original convolution kernel c are assigned to position (n, x*w+y) of matrix W, generating a sparse matrix W. / .

[0027] The beneficial effects of this invention are as follows:

[0028] This invention uses a convolution kernel as the key for encrypting images, enabling image encryption technology. Convolution operations greatly simplify encryption calculations, extracting high-dimensional information from the image for encryption. Utilizing the mathematical principle that a linear equation system with a coefficient matrix of incomplete rank has infinitely many solutions, this invention allows for multiple convolved images from the same convolution kernel. Randomly selecting one of these convolved images as the encrypted image provides strong confidentiality and is difficult to crack. Comparative experiments were conducted using this invention and existing image encryption methods, demonstrating that the method of this invention offers advantages such as fast encryption speed and low image distortion rate during decryption. Attached Figure Description

[0029] Figure 1 This is a flowchart illustrating the present invention.

[0030] Figure 2 This is the original diagram of Embodiment 1 of the present invention.

[0031] Figure 3 This is a convolutional graph of Embodiment 1 of the present invention.

[0032] Figure 4 This is the encryption diagram of Embodiment 1 of the present invention.

[0033] Figure 5 This is a decrypted diagram of Embodiment 1 of the present invention. Detailed Implementation

[0034] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments, but the present invention is not limited to the following embodiments.

[0035] exist Figure 1 The image encryption method based on neural network convolution kernels in this embodiment includes the following steps:

[0036] Step 1. Image Preprocessing

[0037] Take a standard test image with a size of 512×512 pixels, transform the image to 100×100 pixels and save it as a PNG file as the original image, such as... Figure 2 ;

[0038] Step 2. Determine the convolution method

[0039] Step 2.1. Use PyCharm software to randomly generate a convolution kernel as the original convolution kernel c. The size of the original convolution kernel c is 3×3 or 5×5. In this embodiment, the size of the original convolution kernel c is 3×3, the convolution stride is 1, and the padding is 1.

[0040]

[0041] Step 2.2. Create and initialize a matrix W of size [(w×h)×(w×h)], where w is the pixel width of the original image and h is the pixel height of the original image;

[0042] Step 2.3. Update matrix W based on the original convolution kernel c to generate a sparse matrix W. / ;

[0043] The method for updating matrix W based on the original convolution kernel c is as follows:

[0044] 1) Obtain the index s corresponding to each position (i,j) in matrix W, s = i × w + j, and assign the weight of the center position of the original convolution kernel c to the (s, s) position in matrix W;

[0045] 2) Based on each position (k, l) of the original convolution kernel c, obtain the corresponding matrix position index x and y according to the following formula, 0 < k < m-1, 0 < l < n-1, k and l are both positive integers, m is the height of the original convolution kernel c, and n is the width of the original convolution kernel c;

[0046] x = i + km / 2

[0047] y = j + ln / 2

[0048] 3) When 0 ≤ x < h and 0 ≤ y < w, the weights at position (k, l) of the original convolution kernel c are assigned to position (n, x*w+y) of matrix W, generating a sparse matrix W. / ;

[0049]

[0050] Step 3. Perform a convolution operation on the original image.

[0051] The original image is flattened into a one-dimensional long vector im_f of size 1*(w×h), and then the long vector im_f is used with the sparse matrix W. / Performing a matrix dot product operation yields a long vector `im_c_f` of dimension 1*(w×h). The dimension of this long vector `im_c_f` is then changed to `w×h` to create the convolutional image `im_c`. Figure 3 ;

[0052] Step 4. Encrypt the image

[0053] The sparse matrix W obtained in step 2.3 / The convolutional image im_c obtained in step 3 is input into the linear equation system Ax = B for solution, where A is a sparse matrix W. / B is the convolutional image im_c, due to the sparse matrix W / Since the matrix is ​​not full rank, the linear system of equations Ax = B has infinitely many solutions. A solution that is different from the original image is randomly selected as the encrypted image, such as... Figure 4 ;

[0054] Step 5. Decrypt the image

[0055] The decryptor receives the encrypted image from step 4 and the original convolution kernel c, and performs a convolution operation between the encrypted image and the original convolution kernel c to obtain image im. s For image im s Performing a deconvolution operation yields the decrypted image, such as... Figure 5 .

Claims

1. An image encryption method based on neural network convolution kernels, characterized in that, Includes the following steps: Step 1. Image Preprocessing Take a standard test image and save it as a PNG file as the original image. Step 2. Determine the convolution method Step 2.

1. Use PyCharm software to randomly generate a convolution kernel as the original convolution kernel c; Step 2.

2. Create and initialize the size to The matrix W, where w is the pixel width of the original image and h is the pixel height of the original image; Step 2.

3. Update matrix W based on the original convolution kernel c to generate a sparse matrix W. / ; The method for updating matrix W based on the original convolutional kernel c is as follows: 1) Obtain the index s corresponding to each position (i, j) in matrix W. The weights at the center of the original convolution kernel c are assigned to the (s, s) position of matrix W; 2) Based on each position (k, l) of the original convolution kernel c, obtain the corresponding matrix position index x and y according to the following formula, 0 < k < m-1, 0 < l < n-1, k and l are both positive integers, m is the height of the original convolution kernel c, and n is the width of the original convolution kernel c. 3) When 0 ≤ x < h and 0 ≤ y < w, the weights at position (k, l) of the original convolution kernel c are assigned to matrix W. At position W, a sparse matrix W is generated. / ; Step 3. Perform a convolution operation on the original image. Flatten the original image to the desired size. A one-dimensional long vector Using long vectors With sparse matrix W / Performing a matrix dot product operation yields the dimension size. long vector , long vector Dimensional change to As a convolutional image ; Step 4. Encrypt the image The sparse matrix W obtained in step 2.3 / Convolutional image obtained in step 3 Input to a system of linear equations Solve in the middle, where A is a sparse matrix W / B is a convolutional image. Due to the sparse matrix W / Since it is a non-rank matrix, the linear system of equations Ax=B has infinitely many solutions. Randomly select a solution that is different from the original image as the encrypted image. Step 5. Decrypt the image The decryptor receives the encrypted image from step 4 and the original convolution kernel c, and performs a convolution operation between the encrypted image and the original convolution kernel c to obtain the image. For images The deconvolution operation is performed to obtain the decrypted image.

2. The image encryption method based on neural network convolution kernels according to claim 1, characterized in that, The size of the original convolutional kernel c is or The convolution stride is 1.