Image encryption method and system based on quaternion convolution
By adjusting the key based on the color distribution characteristics of color medical images, the problem of traditional quaternion convolution encryption ignoring color characteristics is solved, and encryption security and stability are improved.
Patent Information
- Application Number
- CN202410897725.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-05
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-07-05
AI Technical Summary
In the traditional image encryption process using quaternion convolution, the key is randomly generated, causing the encryption process to ignore the color distribution characteristics of color medical images, making it difficult to ensure the security of the encryption results.
Convolution encryption is performed by obtaining the quaternion of each pixel in the image to be encrypted, determining the initial key, and adjusting the key to reflect the color distribution characteristics of the image based on the isolation degree and salient features of the color channel distribution of the pixel. .
It improves the randomness and security of the encryption results, makes them difficult to be cracked by attackers, and enhances the protection capabilities of color medical images.
Smart Images

Figure CN118450060B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image encryption, and in particular to an image encryption method and system based on quaternion convolution. Background Art
[0002] Color medical images refer to medical images obtained using color imaging technology. Color medical images can assist doctors in diagnosing diseases, including medical images of patients' muscle tissue. Since color medical images contain patients' private information, there is a risk of information being stolen and tampered with by criminals during the transmission and storage of color medical images. In order to protect patients' privacy and information security, color medical images need to be encrypted to ensure the security of color medical images and improve the security and reliability of the entire medical system.
[0003] Due to the non-commutative nature of quaternions, researchers usually use quaternion convolution to encrypt color medical images, which increases the complexity and security of encryption. However, in the traditional process of using quaternion convolution for image encryption, the key is randomly generated, which causes the encryption process to ignore the color distribution characteristics of color medical images, making it difficult to ensure the security of the encryption results. Summary of the invention
[0004] In order to solve the technical problem that in the traditional process of image encryption using quaternion convolution, the key is randomly generated, resulting in the encryption process ignoring the color distribution characteristics of color medical images, and it is difficult to ensure the security of the encryption result, the purpose of the present invention is to provide an image encryption method and system based on quaternion convolution, and the technical solution adopted is as follows:
[0005] An image encryption method based on quaternion convolution, the method comprising the following steps:
[0006] Get the quaternion of each pixel in the image to be encrypted;
[0007] Determine the initial key of each pixel; in the image to be encrypted, according to the distribution isolation degree of each color channel of the pixel and the difference between the distribution isolation degrees of all color channels, obtain the key update requirement value of the pixel; according to the key update requirement values of all pixels, determine each point to be adjusted in the image to be encrypted; according to the local significant features of the point to be adjusted and the significant features of the point to be adjusted, obtain the information richness value of the point to be adjusted; according to the information richness value of the point to be adjusted and the key update requirement value, adjust the initial key of the point to be adjusted to obtain the adjusted key of the point to be adjusted;
[0008] The encrypted image is convolutionally encrypted based on the keys and quaternions of all pixels.
[0009] Furthermore, the method for obtaining the key update requirement value includes:
[0010] Using the isolation forest method, the abnormal score of each color channel of the pixel point is obtained according to the isolation degree of the pixel value of each color channel of the pixel point in the image to be encrypted;
[0011] Obtain the isolation parameter of the pixel according to the central tendency of the abnormal scores of all color channels of the pixel;
[0012] Obtain the isolated confidence parameter of the pixel according to the consistency between the anomaly scores of all color channels of the pixel;
[0013] According to the isolation parameter and the isolation confidence parameter of the pixel point, a key update requirement value of the pixel point is obtained; the isolation parameter, the isolation confidence parameter and the key update requirement value are negatively correlated.
[0014] Furthermore, the method for obtaining the isolated parameter includes:
[0015] Calculate the mean of the anomaly scores of all color channels of the pixel to obtain the isolation parameter of the pixel.
[0016] Furthermore, the method for obtaining the point to be adjusted includes:
[0017] Each pixel point whose key update requirement value is greater than a preset requirement threshold is used as each point to be adjusted in the image to be encrypted.
[0018] Furthermore, the method for obtaining the information richness value includes:
[0019] In the image to be encrypted, determining all neighboring pixel points of the point to be adjusted;
[0020] Using a corner detection algorithm, obtaining corner point response values of the point to be adjusted and the neighboring pixel points;
[0021] Obtaining a local significant parameter of the point to be adjusted according to a central tendency of corner point response values of all the neighboring pixel points of the point to be adjusted;
[0022] Acquire an information richness factor of the point to be adjusted according to a difference between the corner point response value of the point to be adjusted and the local significant parameter;
[0023] The information richness value of the point to be adjusted is obtained according to the information richness factor of the point to be adjusted and the corner point response value of the point to be adjusted; the information richness factor, the corner point response value of the point to be adjusted and the information richness value are positively correlated.
[0024] Furthermore, the method for obtaining the adjusted key includes:
[0025] According to the information richness value of the point to be adjusted and the key update requirement value, obtaining the key update necessity value of the point to be adjusted; the key update requirement value and the key update necessity value are positively correlated; the information richness value and the key update necessity value are negatively correlated;
[0026] According to the key update necessity value of the point to be adjusted, the initial key of the pixel point is adjusted to obtain the adjusted key of the point to be adjusted; the key update necessity value, the initial key and the adjusted key are positively correlated.
[0027] Furthermore, the method for obtaining the quaternion includes:
[0028] In the image to be encrypted, the quaternion of the pixel is obtained according to the pixel values of all color channels of the pixel and the transparency of the pixel.
[0029] Furthermore, the all color channels include: an R color channel, a G color channel and a B color channel.
[0030] Furthermore, the initial key is set to: a preset quaternion.
[0031] Furthermore, an image encryption system based on quaternion convolution includes:
[0032] A data acquisition module is used to obtain the quaternion of each pixel in the image to be encrypted;
[0033] The key adjustment module is used to determine the initial key of each pixel point; in the image to be encrypted, according to the distribution isolation degree of each color channel of the pixel point and the difference between the distribution isolation degrees of all color channels, obtain the key update requirement value of the pixel point; according to the key update requirement values of all pixels, determine each point to be adjusted in the image to be encrypted; according to the local significant features of the point to be adjusted and the significant features of the point to be adjusted, obtain the information richness value of the point to be adjusted; according to the information richness value of the point to be adjusted and the key update requirement value, adjust the initial key of the point to be adjusted to obtain the adjusted key of the point to be adjusted;
[0034] The convolution encryption module is used to perform convolution encryption on the image to be encrypted based on the keys and quaternions of all pixels.
[0035] The present invention has the following beneficial effects:
[0036] First, determine the initial key of the pixel. Considering that the main component of the image to be encrypted is the tissue area, the color repetition of the tissue area is high. Using a fixed initial key will make the encryption result less random and less secure. Therefore, it is necessary to analyze the image characteristics of the pixel and adjust the initial key. Since the pixel is in a tissue area with a relatively monotonous color, the distribution and isolation of the pixel is often low, and the key update requirement value of the pixel is obtained; the key update requirement value reflects the possibility that the pixel is in a tissue area with a high color repetition. Determine the points to be adjusted where the key needs to be updated to a greater extent, and provide data support for the subsequent key adjustment of the pixel in the color repetition area. Since there may be abnormal tissue areas in the tissue area, the overall color repetition of the normal tissue area is high, and the significant features of the pixels in the normal tissue area are poor; the abnormal tissue area includes tissue necrosis or tissue variation areas, and the colors in the abnormal tissue area have a certain degree of repeatability, but the repeatability is low and the difference between the colors of the abnormal tissue area and the surrounding normal tissue area is more significant, and the significant features of the pixels in the abnormal tissue area are better; obtain the information richness value of the point to be adjusted; the information richness value represents the possibility that the point to be adjusted is in the abnormal tissue area; considering that the larger the key update demand value is, the more likely the pixel is to be in a tissue area with high color repeatability, and the initial key adjustment degree of the pixel should be greater at this time to ensure the randomness of the encryption result, considering that the larger the information richness value is, the more likely the point to be adjusted is to be in the abnormal tissue area, and the color corresponding to the pixel has low repetition in the image at this time, the initial key adjustment degree of the pixel should be smaller at this time, simplifying encryption and management, and obtaining the adjusted key of the point to be adjusted; the adjusted key fully combines the color distribution characteristics of the image to be encrypted, which helps to ensure the security and stability of encryption. The present invention determines the key by fully combining the color distribution characteristics of the image to be encrypted, so that even if an attacker obtains certain encrypted pixels, it is difficult to crack the overall encryption rule because the key generation of the pixel points is associated with the content of the image to be encrypted, which can better ensure encryption security. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0038] Figure 1 A flowchart of an image encryption method based on quaternion convolution provided by an embodiment of the present invention;
[0039] Figure 2 A structural diagram of an image encryption system based on quaternion convolution provided by an embodiment of the present invention;
[0040] Figure 3 A flow chart of a method for obtaining a key update requirement value provided by an embodiment of the present invention;
[0041] Figure 4 A flow chart of a method for obtaining an information richness value provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0042] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the image encryption method and system based on quaternion convolution proposed by the present invention, its specific implementation, structure, features and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0043] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0044] The following is a detailed description of a specific solution of an image encryption method and system based on quaternion convolution provided by the present invention in conjunction with the accompanying drawings.
[0045] See also Figure 1 , which shows a flowchart of an image encryption method based on quaternion convolution provided by an embodiment of the present invention, the method comprising the following steps:
[0046] Step S1: Obtain the quaternion of each pixel in the image to be encrypted.
[0047] The main purpose of the present invention is to encrypt color medical images to ensure the security of the images. The present invention first needs to obtain the quaternion of each pixel in the image to be encrypted so as to encrypt the image using quaternion convolution.
[0048] First, it is necessary to obtain the image to be encrypted, and use the medical image acquisition equipment to collect the image of the patient's muscle tissue to obtain the original medical image; since the original medical image collected has noise, the noise will affect the accuracy of the image, so the original medical image is subjected to noise reduction operation to eliminate the influence of noise and some external interference, enhance the accuracy of subsequent analysis, and thus obtain the image to be encrypted. The embodiment of the present invention uses median filtering to reduce the noise of the image, and the implementer can set it according to the actual situation.
[0049] In order to facilitate the analysis of the color distribution characteristics of the pixel points, it is necessary to determine all the color channels of the pixel points. Preferably, in one embodiment of the present invention, the image to be encrypted is in RGB color space, so all the color channels corresponding to each pixel in the image to be encrypted include: R color channel, G color channel and B color channel. In other embodiments of the present invention, the image to be encrypted can be in Lab color space, and all the corresponding color channels are L color channel, a color channel and a color channel, which are not limited here.
[0050] Since the present invention uses quaternion convolution to encrypt images, it is necessary to obtain the quaternion of each pixel in the image to be encrypted. It should be noted that quaternion is a prior art well known to those skilled in the art, and is only briefly described here: quaternion is a simple hypercomplex number, which can generally be expressed as q=a+bi+cj+dk, where a, b, c, d are real numbers, i, j, k are imaginary units, b, c, d are coefficients of the imaginary units, bi, cj, dk are the imaginary parts of the quaternion, and a is the real part of the quaternion. .
[0051] Preferably, in one embodiment of the present invention, the method for obtaining a quaternion includes:
[0052] In the image to be encrypted, the quaternion of the pixel is obtained according to the pixel values of all color channels of the pixel and the transparency of the pixel.
[0053] In one embodiment of the present invention, the pixel values of each color channel of the pixel point are used as the coefficients of the imaginary unit of the quaternion of the pixel point, and the transparency of the pixel point is used as the real part of the quaternion of the pixel point. For example, the pixel value of the R color channel of the pixel point is 45, the pixel value of the G color channel is 56, the pixel value of the B color channel is 100, the transparency of the pixel point is 4, and the quaternion of the pixel point can be expressed as 4+45i+56j+100k.
[0054] It should be noted that, in order to facilitate calculation, all indicator data involved in the calculation in the embodiment of the present invention are preprocessed to eliminate the dimension effect. The specific means of eliminating the dimension effect are technical means well known to those skilled in the art and are not limited here.
[0055] Step S2: determine the initial key of each pixel; in the image to be encrypted, obtain the key update requirement value of the pixel according to the difference between the distribution isolation degree of each color channel of the pixel and the distribution isolation degree of all color channels; determine each point to be adjusted in the image to be encrypted according to the key update requirement values of all pixels; obtain the information richness value of the point to be adjusted according to the local significant features of the point to be adjusted and the significant features of the point to be adjusted; adjust the initial key of the point to be adjusted according to the information richness value of the point to be adjusted and the key update requirement value, and obtain the adjusted key of the point to be adjusted.
[0056] First, determine the initial key of the pixel. Considering that the main component of the image to be encrypted is the tissue area, the color repetition of the tissue area is high. Using a fixed initial key will make the encryption result less random and less secure. Therefore, it is necessary to analyze the image characteristics of the pixel and adjust the initial key. Since the pixel is in a tissue area with a relatively monotonous color, the distribution and isolation of the pixel is often low, and the key update requirement value of the pixel is obtained; the key update requirement value reflects the possibility that the pixel is in a tissue area with a high color repetition. Determine the points to be adjusted where the key needs to be updated to a greater extent, and provide data support for the subsequent key adjustment of the pixel in the color repetition area. Since there may be abnormal tissue areas in the tissue area, the overall color repetition of the normal tissue area is high, and the significant features of the pixels in the normal tissue area are poor; the abnormal tissue area includes tissue necrosis or tissue variation areas, and the colors in the abnormal tissue area have a certain degree of repeatability, but the repeatability is low and the difference between the colors of the abnormal tissue area and the surrounding normal tissue area is more significant, and the significant features of the pixels in the abnormal tissue area are better; obtain the information richness value of the point to be adjusted; the information richness value represents the possibility that the point to be adjusted is in the abnormal tissue area; considering that the larger the key update demand value is, the more likely the pixel is to be in a tissue area with high color repeatability, and the initial key adjustment degree of the pixel should be greater at this time to ensure the randomness of the encryption result, considering that the larger the information richness value is, the more likely the point to be adjusted is to be in the abnormal tissue area, and the color corresponding to the pixel has low repetition in the image at this time, the initial key adjustment degree of the pixel should be smaller at this time, simplifying encryption and management, and obtaining the adjusted key of the point to be adjusted; the adjusted key fully combines the color distribution characteristics of the image to be encrypted, which helps to ensure the security and stability of encryption.
[0057] Since quaternion convolution is used for image encryption, the non-commutative property of quaternions is used to make the encryption result random. When the color repeatability of pixels is low, the corresponding quaternion has low repeatability among all quaternions corresponding to the image to be encrypted. At this time, directly using a fixed key can also ensure the security of the encryption result. Therefore, a fixed initial key can be used for some pixels with low color repeatability.
[0058] Preferably, in one embodiment of the present invention, the initial key of each pixel is set to: a preset quaternion, that is, ,The implementer can set the preset quaternion according to the implementation scenario.
[0059] The image to be encrypted has tissue areas and non-tissue edge areas. The color repetition of the tissue area is high. The non-tissue edge area refers to, for example, bones, blood vessels, etc. The color richness of the non-tissue edge area is high. Since there are pixels with high color repetition in the image to be encrypted, directly using the initial key for encryption will make the encryption result less random. Therefore, it is necessary to analyze the color repetition characteristics of the pixels. Since the color repetition of the tissue area is high, the distribution isolation of the pixels in the tissue area is often low. At this time, it is more necessary to update the initial key of the pixels; considering that when the pixel is in the edge area of the non-tissue, the color of the blood vessel or bone area is richer, and the distribution isolation of the pixels in the edge area of the non-tissue is often high, it is less necessary to update the initial key of the pixel; obtain the key update requirement value of the pixel; the key update requirement value reflects the possibility that the pixel is in the tissue area with high color repetition.
[0060] See also Figure 3 , which shows a flow chart of a method for obtaining a key update requirement value provided by an embodiment of the present invention. Preferably, in an embodiment of the present invention, the method for obtaining a key update requirement value includes:
[0061] Step S201: using the isolation forest method, obtaining the abnormality score of each color channel of the pixel point according to the isolation degree of the pixel value of each color channel of the pixel point in the image to be encrypted;
[0062] The larger the anomaly score is, the more different the pixel value corresponding to the color channel of the pixel point is from the pixel value corresponding to the color channel of the image to be encrypted, and the more isolated the pixel value corresponding to the color channel of the pixel point is.
[0063] It should be noted that the isolation forest method is an existing technology well known to those skilled in the art, and only a brief process of obtaining the abnormal score of the color channel of a pixel point is briefly described here:
[0064] According to the pixel values of the color channels of all pixels in the image to be encrypted, an isolation forest tree is constructed, and according to the path of the pixel value of the color channel of the pixel in the isolation forest tree, the abnormal score of the color channel of the pixel is obtained.
[0065] Step S202: obtaining an isolation parameter of a pixel according to the central tendency of the abnormal scores of all color channels of the pixel;
[0066] The larger the isolation parameter is, the more the color of the pixel is different from the image to be encrypted, and the less repetitive the color of the pixel is.
[0067] In one embodiment of the present invention, the mean of the anomaly scores of all color channels of the pixel is calculated to obtain the isolation parameter of the pixel, and the central tendency of the anomaly scores of all color channels of the pixel is characterized by calculating the mean of the anomaly scores of all color channels of the pixel. In other embodiments of the present invention, the sum of the anomaly scores of all color channels of the pixel is calculated to obtain the isolation parameter of the pixel.
[0068] Step S203: obtaining an isolated confidence parameter of the pixel point according to the consistency between the abnormal scores of all color channels of the pixel point;
[0069] The larger the isolation confidence parameter is, the smaller the difference between the anomaly scores of the color channels is, which means that different color channels have similar isolation features, and the higher the credibility of pixel isolation is.
[0070] In one embodiment of the present invention, the variance of the abnormal scores of all color channels of the pixel is calculated, the variance is negatively correlated and mapped, and the isolated confidence parameter of the pixel is obtained. By calculating the variance of the abnormal scores of all color channels of the pixel and negatively correlated and mapping the variance, the consistency between the abnormal scores of all color channels of the pixel is characterized. For example, in one embodiment of the present invention, the negative correlation mapping method is exp (-x) to negatively correlate x. In other embodiments of the present invention, the difference of the abnormal scores of every two color channels of the pixel is calculated, all the differences are averaged, the mean is negatively correlated and mapped, and the isolated confidence parameter of the pixel is obtained.
[0071] Step S204: obtaining a key update requirement value of the pixel point according to an isolation parameter and an isolation confidence parameter of the pixel point; the isolation parameter, the isolation confidence parameter and the key update requirement value are negatively correlated.
[0072] Due to the high color repetitiveness of the tissue area, the isolation degree of the pixels in the tissue area is low; the color repetitiveness of the edge area of the non-tissue is low, and the isolation degree of the pixels in the tissue area is high. The larger the isolation parameter, the less likely the pixel is to be in the tissue area with high color repetitiveness, and the smaller the key update requirement value; the isolation confidence parameter is used as the weight of the isolation parameter, and the smaller the difference in the isolated features of different color channels, the more similar the isolated features of different color channels are, and the more reference the isolated features of the pixels are; the larger the key update requirement value, the more likely the pixel is in the tissue area with high color repetitiveness, and the greater the need to adjust the initial key.
[0073] In one embodiment of the present invention, the product of the isolation parameter and the isolation confidence parameter of the pixel is calculated to obtain the key update requirement value of the pixel.
[0074] Preferably, in one embodiment of the present invention, in order to provide data support for subsequent key adjustment, it is necessary to determine the points to be adjusted where the key needs to be updated to a greater extent, and the method for obtaining the points to be adjusted includes:
[0075] Each pixel point whose key update requirement value is greater than the preset requirement threshold is used as each point to be adjusted in the image to be encrypted. The points to be adjusted represent the pixel points where the key needs to be updated to a greater extent. In one embodiment of the present invention, the preset requirement threshold is 0.8, and the implementer can set it according to the implementation scenario of the key randomness requirement. If the key randomness requirement is greater, the preset requirement threshold can be appropriately reduced to provide more data support for subsequent key adjustment.
[0076] In other embodiments of the present invention, the Harris corner point detection algorithm is used to obtain all corner points in the image to be encrypted according to the significant features of all pixels; each corner point whose key update requirement value is greater than a preset requirement threshold is used as each point to be adjusted in the image to be encrypted. It should be noted that the Harris corner point detection algorithm is a prior art well known to those skilled in the art and will not be described in detail here.
[0077] Considering that there may be abnormal tissue areas in the tissue area, that is, tissue necrosis or tissue variation areas, the colors in the abnormal tissue areas have a certain repeatability, but the repeatability is low and the difference between the colors of the abnormal tissue areas and the surrounding normal tissue areas is more significant. When the repeatability of pixel color is low, the corresponding quaternion has low repeatability in all quaternions corresponding to the image to be encrypted. At this time, directly using the initial key can also ensure the security of the encryption result. The smaller the initial key adjustment degree of the pixel point in the abnormal tissue area should be, in order to determine the possibility that the adjustment point is more likely to be in the abnormal tissue area, the information richness value of the point to be adjusted is obtained.
[0078] See also Figure 4 , which shows a flow chart of a method for obtaining an information richness value provided by an embodiment of the present invention. Preferably, in an embodiment of the present invention, the method for obtaining an information richness value includes:
[0079] Step S211: in the image to be encrypted, determine all neighboring pixels of the point to be adjusted.
[0080] All neighborhood pixels represent the surrounding pixels of the point to be adjusted. In one embodiment of the present invention, the method for obtaining all neighborhood pixels includes: taking all pixels corresponding to the eight neighborhoods of the point to be adjusted as all neighborhood pixels of the point to be adjusted.
[0081] In other embodiments of the present invention, the method for obtaining all neighboring pixel points of the point to be adjusted includes: the preset neighborhood range is an area constructed with the point to be adjusted as the center and the preset neighborhood specification as the size; the preset neighborhood specification is the minimum circumscribed rectangle of pixel points including the preset neighborhood pixel quantity. In one embodiment of the present invention, the preset neighborhood pixel quantity is 25, which can be set by the implementer according to the implementation scenario and is not limited here. All pixel points except the point to be adjusted in the preset neighborhood range of the point to be adjusted are regarded as all neighboring points to be adjusted of the point to be adjusted.
[0082] Step S212: using a corner point detection algorithm to obtain corner point response values of the point to be adjusted and neighboring pixel points;
[0083] The larger the corner point response value, the greater the significance of the pixel point. In one embodiment of the present invention, the Harris corner point detection algorithm can be used. It should be noted that the Harris corner point detection algorithm is a technical means well known to those skilled in the art. Here, only a brief method for obtaining the corner point response value of the point to be adjusted is briefly described: The Harris corner point detection algorithm uses the corner point response function to calculate the grayscale changes of the point to be adjusted in different directions to obtain the corner point response value of the point to be adjusted. Other embodiments of the present invention can also use the Shi-Tomasi corner point detection algorithm, which is not limited here.
[0084] Step S213: obtaining the local significant parameter of the point to be adjusted according to the central tendency of the corner point response values of all neighboring pixel points of the point to be adjusted;
[0085] The larger the local significant parameter is, the more significant the local area where the pixel point is located is. In one embodiment of the present invention, the mean of the corner point response values of all neighboring pixel points in the preset neighborhood range of the point to be adjusted is calculated as the local significant parameter of the point to be adjusted, and the central tendency is reflected by the mean.
[0086] Step S214: obtaining an information richness factor of the point to be adjusted according to the difference between the corner point response value and the local significant parameter of the point to be adjusted;
[0087] The larger the information richness factor, the more obvious the salient features of the pixel point are compared with the local salient features.
[0088] In one embodiment of the present invention, the difference between the corner point response value and the local significant parameter of the point to be adjusted is calculated as the information richness factor of the point to be adjusted, and the difference is reflected by the difference.
[0089] Step S215: obtaining the information richness value of the point to be adjusted according to the information richness factor of the point to be adjusted and the corner point response value of the point to be adjusted; the information richness factor, the corner point response value of the point to be adjusted and the information richness value are positively correlated.
[0090] Since the color difference between the abnormal tissue area and the surrounding normal tissue area is more significant in the tissue area of the abnormal tissue area, the larger the corner point response value of the point to be adjusted, the more likely the pixel point is in the abnormal tissue area, and the larger the information richness value; since the color of the normal tissue area is relatively single, the abnormal tissue area as a whole has richer color information, and the local significant features of the pixel points in the abnormal tissue area are greater than the local significant features of the pixel points in the normal tissue area. The larger the information richness factor, the more obvious the significant features of the pixel points are compared with the local significant features, the more likely the pixel point is in the abnormal tissue area, and the larger the information richness value. The information richness value can reflect the possibility that the adjustment point is more likely to be in the abnormal tissue area. The greater the possibility, the greater the information richness of the pixel point.
[0091] In one embodiment of the present invention, the information richness value of the point to be adjusted is obtained by calculating the product of the information richness factor of the point to be adjusted and the corner point response value of the point to be adjusted.
[0092] Preferably, in one embodiment of the present invention, in order to adjust the initial key of the point to be adjusted that needs to be updated, the method for obtaining the adjusted key includes:
[0093] According to the information richness value of the point to be adjusted and the key update requirement value, the key update necessity value of the point to be adjusted is obtained; the key update requirement value and the key update necessity value are positively correlated; the information richness value and the key update necessity value are negatively correlated;
[0094] According to the key update necessity value of the point to be adjusted, the initial key of the pixel point is adjusted to obtain the adjusted key of the point to be adjusted; the key update necessity value, the initial key and the adjusted key are positively correlated.
[0095] With respect to the above steps, in one embodiment of the present invention, the ratio of the information richness value of the point to be adjusted to the key update requirement value is calculated, and the ratio is proportionally normalized to obtain the key update necessity value of the point to be adjusted; for example, in one embodiment of the present invention, the ratio is proportionally normalized using a standard normalization function; the sum of 1 and the key update necessity value is calculated, and the product of the sum and the initial key is calculated to obtain the adjusted key of the point to be adjusted.
[0096] In one embodiment of the present invention, the adjusted key formula includes:
[0097] ;
[0098] For the The adjusted key of the points to be adjusted; For the The initial key of the point to be adjusted; For the The key update requirement value of the point to be adjusted; For the The information richness value of the point to be adjusted; For the The necessary degree of key update for the points to be adjusted; is the normalization function.
[0099] In the formula, considering that the larger the key update requirement value is, the more likely the pixel is to be in a tissue area with high color repeatability, the greater the initial key adjustment degree of the pixel should be at this time to ensure the randomness of the encryption result. Considering that the larger the information richness value is, the more likely the point to be adjusted is to be in an abnormal tissue area, the color corresponding to the pixel has low repeatability in the image, and the smaller the initial key adjustment degree of the pixel should be at this time to simplify encryption and management. Reflects the necessity of initial key adjustment. The more adjustment is needed, the larger the value is. It reflects the degree of adjustment of the initial key on the basis of retaining the initial key, and obtains the adjusted key of the point to be adjusted, where 1 represents retaining the initial key basis; the adjusted key fully combines the color distribution characteristics of the image to be encrypted, which helps to ensure the security and stability of encryption.
[0100] Step S3: Perform convolution encryption on the image to be encrypted according to the keys and quaternions of all pixels.
[0101] Since the key is randomly generated in the traditional image encryption process using quaternion convolution, if the attacker knows that image encryption only relies on randomness, the attacker will try to crack the key through extensive random sample analysis. The present invention determines the key by fully combining the color distribution characteristics of the image to be encrypted, so that even if the attacker obtains some encrypted pixels, it is difficult to crack the overall encryption law because the key generation of the pixel points is associated with the content of the image to be encrypted, which can better ensure encryption security.
[0102] The adjusted keys of the points to be adjusted are used as the encryption keys of the pixels; the initial keys of the remaining pixels except the points to be adjusted are used as the encryption keys of the pixels; and the encrypted image is convolutionally encrypted according to the encryption keys of all the pixels and the quaternion.
[0103] Specifically, according to the encryption keys and quaternions of all pixels, the convolution encryption process of the encrypted image includes:
[0104] First, according to the quaternions of all pixels, the quaternion matrix of the image to be encrypted is obtained, where each pixel corresponds to a quaternion. A convolution kernel is generated corresponding to the quaternion using the encryption key, that is, the convolution kernel is also called a filter. The quaternion matrix of the image to be encrypted is convolved. This involves sliding the convolution kernel on the image matrix and performing quaternion multiplication or similar operations at each position. Depending on the complexity of the encryption algorithm, additional steps such as phase mask, discrete quaternion Fourier transform, etc. may need to be performed to enhance the security of encryption. Finally, the results of the convolution and any additional steps are converted back to the image format to obtain the encrypted image. It should be noted that since the quaternion does not satisfy the commutative law, it is necessary to ensure the consistency of the encryption and decryption processes. Further, the encrypted image data and the corresponding key are stored. The present invention encrypts color medical images more reliably, thereby ensuring the security of color medical images and improving the security and reliability of the entire medical system.
[0105] It should be noted that the process of decrypting the encrypted graph includes:
[0106] Read the encrypted image data and the corresponding key from the storage medium. The key is managed by version, and it is necessary to ensure that the key version that matches the encrypted data is read. Use the corresponding key to decrypt each pixel or area. This step requires different decryption algorithms or parameters depending on the key. For the parts with rich colors, the present invention can batch process the decryption of these areas due to the same key, thereby improving efficiency. For areas with a single color but frequent key changes, each area or pixel may need to be processed separately. Reconstruct the decrypted data into an image format. This step includes correcting image properties such as color and contrast to ensure that the visual quality of the decrypted image is consistent with the image to be encrypted.
[0107] In summary, the embodiment of the present invention provides an image encryption method and system based on quaternion convolution, firstly obtaining the quaternion of each pixel in the image to be encrypted; in the image to be encrypted, obtaining the key update requirement value of the pixel according to the distribution isolation degree of each color channel of the pixel and the difference between the distribution isolation degrees of all color channels; determining each point to be adjusted in the image to be encrypted according to the key update requirement values of all pixels; obtaining the information richness value of the point to be adjusted according to the local significant features of the point to be adjusted and the significant features of the point to be adjusted; adjusting the initial key of the point to be adjusted according to the information richness value of the point to be adjusted and the key update requirement value, obtaining the adjusted key of the point to be adjusted; and then performing convolution encryption on the image to be encrypted. In the embodiment of the present invention, the key is determined by fully combining the color distribution characteristics of the image to be encrypted, so as to better ensure the security of the encryption result.
[0108] The present invention also proposes an image encryption system based on quaternion convolution, please refer to Figure 2 , which shows a structural diagram of an image encryption system based on quaternion convolution provided by an embodiment of the present invention. The system includes: a data acquisition module 101, a key adjustment module 102, and a convolution encryption module 103.
[0109] The data acquisition module 101 is used to acquire the quaternion of each pixel in the image to be encrypted.
[0110] The key adjustment module 102 is used to determine the initial key of each pixel; in the image to be encrypted, according to the difference between the distribution isolation degree of each color channel of the pixel and the distribution isolation degree of all color channels, the key update requirement value of the pixel is obtained; according to the key update requirement values of all pixels, each point to be adjusted in the image to be encrypted is determined; according to the local significant features of the point to be adjusted and the significant features of the point to be adjusted, the information richness value of the point to be adjusted is obtained; according to the information richness value of the point to be adjusted and the key update requirement value, the initial key of the point to be adjusted is adjusted to obtain the adjusted key of the point to be adjusted.
[0111] The convolution encryption module 103 is used to perform convolution encryption on the image to be encrypted according to the keys and quaternions of all pixels.
[0112] It should be noted that: the system provided in the above embodiment is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the image encryption system based on quaternion convolution and the image encryption method based on quaternion convolution provided in the above embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0113] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0114] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
Claims
1. An image encryption method based on quaternion convolution, characterized in that: The method comprises the following steps: Get the quaternion of each pixel in the image to be encrypted; Determine the initial key of each pixel; in the image to be encrypted, according to the distribution isolation degree of each color channel of the pixel and the difference between the distribution isolation degrees of all color channels, obtain the key update requirement value of the pixel; according to the key update requirement values of all pixels, determine each point to be adjusted in the image to be encrypted; according to the local significant features of the point to be adjusted and the significant features of the point to be adjusted, obtain the information richness value of the point to be adjusted; according to the information richness value of the point to be adjusted and the key update requirement value, adjust the initial key of the point to be adjusted to obtain the adjusted key of the point to be adjusted; According to the keys and quaternions of all pixels, the image to be encrypted is convolutionally encrypted; The method for obtaining the quaternion includes: In the image to be encrypted, the quaternion of the pixel is obtained according to the pixel values of all color channels of the pixel and the transparency of the pixel; The method for obtaining the key update requirement value includes: Using the isolation forest method, the abnormal score of each color channel of the pixel point is obtained according to the isolation degree of the pixel value of each color channel of the pixel point in the image to be encrypted; Obtain the isolation parameter of the pixel according to the central tendency of the abnormal scores of all color channels of the pixel; Obtain the isolated confidence parameter of the pixel according to the consistency between the anomaly scores of all color channels of the pixel; Obtaining a key update requirement value of the pixel point according to the isolation parameter and the isolation confidence parameter of the pixel point; the isolation parameter, the isolation confidence parameter and the key update requirement value are negatively correlated; The method for obtaining the point to be adjusted includes: Each pixel point whose key update requirement value is greater than a preset requirement threshold is used as each point to be adjusted in the image to be encrypted; The method for obtaining the information richness value includes: In the image to be encrypted, determining all neighboring pixel points of the point to be adjusted; Using a corner detection algorithm, obtaining corner point response values of the point to be adjusted and the neighboring pixel points; Obtaining a local significant parameter of the point to be adjusted according to a central tendency of corner point response values of all the neighboring pixel points of the point to be adjusted; Acquire an information richness factor of the point to be adjusted according to a difference between the corner point response value of the point to be adjusted and the local significant parameter; According to the information richness factor of the point to be adjusted and the corner point response value of the point to be adjusted, obtaining the information richness value of the point to be adjusted; the information richness factor, the corner point response value of the point to be adjusted and the information richness value are positively correlated; The method for obtaining the adjusted key includes: According to the information richness value of the point to be adjusted and the key update requirement value, obtaining the key update necessity value of the point to be adjusted; the key update requirement value and the key update necessity value are positively correlated; the information richness value and the key update necessity value are negatively correlated; According to the key update necessity value of the point to be adjusted, the initial key of the pixel point is adjusted to obtain the adjusted key of the point to be adjusted; the key update necessity value, the initial key and the adjusted key are positively correlated; Obtain an adjusted key according to an adjusted key formula, where the adjusted key formula includes: ; For the The adjusted key of the points to be adjusted; For the The initial key of the point to be adjusted; For the The key update requirement value of the point to be adjusted; For the The information richness value of the point to be adjusted; For the The necessary degree of key update for the points to be adjusted; is the normalization function.
2. According to claim 1, the image encryption method based on quaternion convolution is characterized in that: The method for obtaining the isolated parameter includes: Calculate the mean of the anomaly scores of all color channels of the pixel to obtain the isolation parameter of the pixel.
3. The image encryption method based on quaternion convolution according to claim 1, characterized in that: The all color channels include: an R color channel, a G color channel and a B color channel.
4. The image encryption method based on quaternion convolution according to claim 1, characterized in that: The initial key is set to: a preset quaternion.
5. An image encryption system based on quaternion convolution, characterized in that: The system comprises: The data acquisition module is used to acquire the quaternion of each pixel in the image to be encrypted; the method for acquiring the quaternion comprises: in the image to be encrypted, acquiring the quaternion of the pixel according to the pixel values of all color channels of the pixel and the transparency of the pixel; The key adjustment module is used to determine the initial key of each pixel point; in the image to be encrypted, according to the distribution isolation degree of each color channel of the pixel point and the difference between the distribution isolation degrees of all color channels, the key update requirement value of the pixel point is obtained; according to the key update requirement values of all pixels, each point to be adjusted in the image to be encrypted is determined; according to the local significant features of the point to be adjusted and the significant features of the point to be adjusted, the information richness value of the point to be adjusted is obtained; according to the information richness value of the point to be adjusted and the key update requirement value, the initial key of the point to be adjusted is adjusted to obtain the adjusted key of the point to be adjusted; the key update requirement value acquisition method includes: Using the isolation forest method, the abnormal score of each color channel of the pixel point is obtained according to the isolation degree of the pixel value of each color channel of the pixel point in the image to be encrypted; Obtain the isolation parameter of the pixel according to the central tendency of the abnormal scores of all color channels of the pixel; Obtain the isolated confidence parameter of the pixel according to the consistency between the anomaly scores of all color channels of the pixel; Obtaining a key update requirement value of the pixel point according to the isolation parameter and the isolation confidence parameter of the pixel point; the isolation parameter, the isolation confidence parameter and the key update requirement value are negatively correlated; The method for obtaining the point to be adjusted includes: Each pixel point whose key update requirement value is greater than a preset requirement threshold is used as each point to be adjusted in the image to be encrypted; The method for obtaining the information richness value includes: In the image to be encrypted, determining all neighboring pixel points of the point to be adjusted; Using a corner detection algorithm, obtaining corner point response values of the point to be adjusted and the neighboring pixel points; Obtaining a local significant parameter of the point to be adjusted according to a central tendency of corner point response values of all the neighboring pixel points of the point to be adjusted; Acquire an information richness factor of the point to be adjusted according to a difference between the corner point response value of the point to be adjusted and the local significant parameter; According to the information richness factor of the point to be adjusted and the corner point response value of the point to be adjusted, obtaining the information richness value of the point to be adjusted; the information richness factor, the corner point response value of the point to be adjusted and the information richness value are positively correlated; The method for obtaining the adjusted key includes: According to the information richness value of the point to be adjusted and the key update requirement value, obtaining the key update necessity value of the point to be adjusted; the key update requirement value and the key update necessity value are positively correlated; the information richness value and the key update necessity value are negatively correlated; According to the key update necessity value of the point to be adjusted, the initial key of the pixel point is adjusted to obtain the adjusted key of the point to be adjusted; the key update necessity value, the initial key and the adjusted key are positively correlated; Obtain an adjusted key according to an adjusted key formula, where the adjusted key formula includes: ; For the The adjusted key of the points to be adjusted; For the The initial key of the point to be adjusted; For the The key update requirement value of the point to be adjusted; For the The information richness value of the point to be adjusted; For the The necessary degree of key update for the points to be adjusted; is the normalization function; The convolution encryption module is used to perform convolution encryption on the image to be encrypted based on the keys and quaternions of all pixels.
