Search

CN-117459655-B - Image encryption method based on neural network convolution kernel

CN117459655BCN 117459655 BCN117459655 BCN 117459655BCN-117459655-B

Abstract

An image encryption method based on a neural network convolution kernel comprises the steps of image preprocessing, convolution operation determination, convolution operation on an original image, image encryption and image decryption. The invention adopts the convolution kernel as the key of the encrypted image for the image encryption technology, and the convolution operation can greatly simplify the encryption operation and is used as the encrypted image in a mode of extracting the high-dimensional information of the picture. The invention uses the mathematical principle that if the rank of the coefficient matrix is smaller than n in the linear equation set, the linear equation set has infinite solution, and for the same convolution image and the same convolution kernel, a convolved image can be randomly selected as an encryption image, so that the invention has the characteristics of good confidentiality and difficult cracking. The method has the advantages of high encryption speed, small distortion rate of the decrypted image and the like.

Inventors

  • YAO CHAO
  • WANG HAOCHEN
  • Feng Longchao

Assignees

  • 陕西师范大学

Dates

Publication Date
20260512
Application Date
20231031

Claims (2)

  1. 1. An image encryption method based on a neural network convolution kernel is characterized by comprising the following steps: Step 1, image preprocessing Taking a standard test chart, and storing the chart in a png format as an original chart; Step 2, determining convolution mode Step 2.1, randomly generating a convolution kernel as an original convolution kernel c by using Pycharm software; Step 2.2. Create and initialize the size to W is the pixel width of the original picture, and h is the pixel height of the original picture; step 2.3, updating a matrix W based on the original convolution kernel c to generate a sparse matrix W / ; the method for updating the matrix W based on the original convolution kernel c comprises the following steps: 1) Obtaining an index s corresponding to each position according to each position (i, j) of the matrix W, Assigning weights of the central positions of the original convolution kernels c to the (s, s) positions of the matrix W; 2) According to each position (k, l) of the original convolution kernel c, indexes x and y of corresponding matrix positions are obtained according to the following formula, wherein k < 0< m-1, n-1, k and l are 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 weight of the original convolution kernel c position (k, l) is assigned to the matrix W At the location, a sparse matrix W / is generated; step 3, carrying out convolution operation on the original graph The original picture is flattened to be the size Long vectors of one dimension of (2) Using long vectors Performing matrix dot product operation with the sparse matrix W / to obtain a dimension of Long vector of (2) Long vector is to Dimension change to As a convolution map ; Step 4, encrypting the image The sparse matrix W / obtained in the step 2.3 and the convolution graph obtained in the step 3 are combined Input to a system of linear equations In the method, A is a sparse matrix W / , and B is a convolution graph Since the sparse matrix W / is a non-full order matrix, the linear equation set ax=b has an infinite solution, and a solution different from the original image is randomly selected as the encrypted image; Step 5, decrypting the image The decryption party receives the image encrypted in the step 4 and the original convolution kernel c, so that the encrypted image and the original convolution kernel c carry out convolution operation to obtain an image For images And performing deconvolution operation to obtain a decrypted image.
  2. 2. The image encryption method based on neural network convolution kernel according to claim 1, wherein the original convolution kernel c has a size of Or (b) The convolution step is 1.

Description

Image encryption method based on neural network convolution kernel Technical Field The invention belongs to the technical field of image processing, and particularly relates to an image encryption and decryption method. Background Images play an increasingly important role in people's life, and a large number of pictures are transmitted in social networks, but personal privacy is also easily compromised. For example, someone takes the principal's express delivery by face recognition with the photos of others. Therefore, it is particularly important to encrypt and protect the picture. Most of the images are now digital images, which are composed of individual pixels. If we zoom in on a picture, we can see one cell, which combine to form an image that we can see with the naked eye. In each small square, pixel values are stored, and the value range is 0-255. In order to realize digital image confidentiality, in actual operation, a two-dimensional image is generally converted into one-dimensional data, and then encryption is carried out by adopting a traditional encryption algorithm. Unlike ordinary text information, images and videos are temporal, spatial, visually perceptible, and can be lossy compressed, which characteristics make it possible to design more efficient and secure encryption algorithms for images. Since the 90 s of the last century, researchers have proposed a variety of image encryption algorithms using these characteristics. In general, an image encryption technique is a technique for designing an encryption algorithm using characteristics of a digital image to improve security and operation efficiency of encryption. Two common operations for image encryption are aliasing and diffusion. Aliasing refers to disturbing the original location of pixel values in a two-dimensional matrix, while diffusion refers to a small change in pixel value in the original image, which results in a large change in pixel value in the entire image. Common confusion methods include sorting, cyclic shift, arnold transformation, magic square transformation and the like, and the purpose of changing the pixel positions is achieved by using different principles, and the disadvantage of the methods is that the positions of all pixels of a picture are changed to make eyes indistinguishable, and the method can be broken when poor computing is encountered. Disclosure of Invention The invention aims to overcome the defects of the prior art and provide the image encryption method based on the neural network convolution kernel, which has the advantages of high encryption speed, high fidelity of decrypted images and small distortion rate. The technical scheme for solving the technical problems is that the image encryption method based on the neural network convolution kernel comprises the following steps: Step 1, image preprocessing Taking a standard test chart, and storing the chart in a png format as an original chart; Step 2, determining convolution mode Step 2.1, randomly generating a convolution kernel as an original convolution kernel c by using Pycharm software; 2.2, creating and initializing a matrix W with the size of [ (w×h) x (w×h) ] and W is the pixel width of the original picture, and h is the pixel height of the original picture; step 2.3, updating a matrix W based on the original convolution kernel c to generate a sparse matrix W /; step 3, carrying out convolution operation on the original graph Flattening the original image into a long vector im_f with a dimension of 1 x (w×h), performing matrix dot product operation by using the long vector im_f and a sparse matrix W / to obtain a long vector im_c_f with a dimension of 1 x (w×h), and changing the dimension of the long vector im_c_f into w×h to be used as a convolution image im_c; step 4, encrypting the image Inputting the sparse matrix W / obtained in the step 2.3 and the convolution graph im_c obtained in the step 3 into a linear equation set ax=B for solving, wherein A is the sparse matrix W /, B is the convolution graph im_c, and since the sparse matrix W / is a non-full order matrix, the linear equation set ax=B has infinite solutions, and a solution which is different from the original graph is randomly selected as an encrypted image; Step 5, decrypting the image And (3) the decryption party receives the image encrypted in the step (4) and the original convolution kernel c, so that the encrypted image and the original convolution kernel c are subjected to convolution operation to obtain an image im s, and the image im s is subjected to deconvolution operation to obtain a decrypted image. As a preferable technical scheme, the size of the original convolution kernel c is 3×3 or 5×5, and the convolution step size is 1. As a preferred technical solution, the method for updating the matrix W based on the original convolution kernel c in the step 2.3 is as follows: 1) Obtaining an index s corresponding to each position according to each position (i, j) of the ma