Image processing method and device, equipment and medium

By introducing data security processing layer and homomorphic encryption technology into the neural network image classification model, the problems of data privacy and computing efficiency are solved, and efficient and secure data processing and classification results are achieved.

CN118887443APending Publication Date: 2024-11-01WUXI INST OF INTERCONNECT TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410890843.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-04
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

When using neural networks to classify data, how to improve computing efficiency while ensuring data privacy, especially on devices with limited computing resources, and avoid the risk of cloud platform computing speed and privacy leakage.

Method used

By introducing a data security processing layer into the image classification model, including the matrix input data cache module, the matrix inverse operation module and the matrix output data cache module, the data inverse operation is performed and homomorphic encryption technology is combined to ensure data security and through convolution Processing to obtain target classification results.

Benefits of technology

It improves data security and computing efficiency, realizes efficient data processing on limited computing resource devices, reduces the risk of privacy leakage, and optimizes the computing speed of the cloud platform.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118887443A_ABST
    Figure CN118887443A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an image processing method and device, equipment and a medium. The method comprises the following steps: acquiring a group of images to be processed; wherein the group of to-be-processed images comprises to-be-processed images of at least one participant; inputting the to-be-processed image into an image classification model to obtain a target classification result; wherein the image classification model is additionally provided with a data security processing layer, and the data security processing layer is constructed with a matrix input data caching module, a matrix inverse operation module and a matrix output data caching module; and the data security processing layer outputs target security data obtained by performing inversion operation on the to-be-processed image, and the target security data is subjected to convolution processing to obtain a target classification result. According to the technical scheme, the data security can be improved through the data security processing layer, rapid data processing is achieved through the matrix inverse operation module, and the calculation efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of machine learning technology, and in particular to an image processing method, device, equipment and medium. Background Art

[0002] Neural network is an important data classification tool. A well-trained neural network can efficiently and accurately complete the classification and prediction of input data, and has a wide range of applications in information processing, pattern recognition, etc.

[0003] Data security computing refers to the general term for data analysis and computing technologies jointly completed by two or more parties under the premise of ensuring that the data is not leaked. When ordinary users want to use neural networks to classify data, they often need to entrust the data to professional institutions. At this time, how to protect data privacy becomes the most important issue. In addition, the neural network algorithm has a large amount of calculation and cannot run well on devices with limited computing resources.

[0004] At present, the introduction of cloud computing services provides a solution that can entrust complex neural network computing tasks to cloud servers. However, the computing power of cloud servers may be limited. If the amount of calculation is huge, it will affect the computing speed of the cloud platform, and there is also a risk of privacy leakage. Summary of the invention

[0005] The present invention provides an image processing method, device, equipment and medium, which can improve data security through a data security processing layer, realize rapid data processing through a matrix inverse operation module, and improve computing efficiency.

[0006] According to one aspect of the present invention, there is provided an image processing method, comprising:

[0007] Acquire a group of images to be processed; wherein the group of images to be processed includes an image to be processed of at least one participant;

[0008] Inputting the image to be processed into an image classification model to obtain a target classification result;

[0009] Among them, the image classification model is additionally provided with a data security processing layer, which is constructed with a matrix input data cache module, a matrix inverse operation module and a matrix output data cache module; the data security processing layer outputs the inverse operation of the image to be processed to obtain target security data, and the target security data is processed through convolution to obtain a target classification result.

[0010] Optionally, the data security processing layer outputs performing an inversion operation on the image to be processed to obtain target security data, including:

[0011] Obtaining the image to be processed and the first key of each participant, and the second key of the data security processing layer;

[0012] Inputting the to-be-processed images of each participant into the image classification model to obtain predicted classification data;

[0013] Homomorphically encrypt the predicted classification data according to the first key and the second key to obtain a gradient ciphertext of each participant;

[0014] The gradient ciphertext is homomorphically decrypted according to the first key to obtain target security data.

[0015] Optionally, homomorphically encrypting the predicted classification data according to the first key and the second key to obtain a gradient ciphertext of each participant includes:

[0016] Determining a gradient vector of the image classification model through the predicted classification data; wherein the gradient vector includes a set number of gradient vectors;

[0017] Homomorphically encrypt the set number of gradient vectors using the second key to obtain a set of gradient ciphertext vectors;

[0018] Aggregating the gradient ciphertext vectors in the gradient ciphertext vector set to obtain an aggregated gradient ciphertext vector;

[0019] The aggregated gradient ciphertext vector is homomorphically encrypted according to the first key to obtain the gradient ciphertext of each participant.

[0020] Optionally, the first key includes a public key and a private key of a participant;

[0021] Correspondingly, the aggregated gradient ciphertext vector is homomorphically encrypted according to the first key to obtain the gradient ciphertext of each participant, including:

[0022] Using a first identifier and a second identifier to represent a first gradient ciphertext and a second gradient ciphertext of the aggregated gradient ciphertext respectively;

[0023] Performing blinding processing on the first gradient ciphertext and the second gradient ciphertext respectively by using a blinding factor to obtain a blinded first gradient ciphertext and a second gradient ciphertext;

[0024] The gradient ciphertext of each participant is determined according to the public key of each participant and the blinded first gradient ciphertext and second gradient ciphertext.

[0025] Optionally, determining the gradient ciphertext of each participant according to the public key of each participant and the blinded first gradient ciphertext and the second gradient ciphertext includes:

[0026] The blinded first gradient ciphertext and the second gradient ciphertext are homomorphically encrypted using the public key of each participant to obtain a first-level ciphertext;

[0027] Performing a de-blinding factor process on the first-level ciphertext to obtain a second-level ciphertext;

[0028] The second-level ciphertext is encrypted according to the set parameters to obtain the third-level ciphertext, so as to obtain the gradient ciphertext of each participant.

[0029] Optionally, performing homomorphic decryption on the gradient ciphertext according to the first key to obtain target security data includes:

[0030] Homomorphically decrypt the three-level ciphertext based on the private key to obtain a set number of aggregated gradient plaintexts;

[0031] Combine a set number of aggregated gradient plaintexts to obtain target security data.

[0032] Optionally, the image classification model includes a convolution kernel;

[0033] The target safety data is processed through convolution to obtain a target classification result, including:

[0034] The target security data is sent to the convolution kernel for convolution operation to obtain a target classification result.

[0035] According to another aspect of the present invention, there is provided an image processing apparatus, comprising:

[0036] An image acquisition module, used to acquire a group of images to be processed; wherein the group of images to be processed includes an image to be processed of at least one participant;

[0037] A classification result acquisition module is used to input the image to be processed into an image classification model to obtain a target classification result;

[0038] Among them, the image classification model is additionally provided with a data security processing layer, which is constructed with a matrix input data cache module, a matrix inverse operation module and a matrix output data cache module; the data security processing layer outputs the inverse operation of the image to be processed to obtain target security data, and the target security data is processed through convolution to obtain a target classification result.

[0039] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0040] at least one processor; and

[0041] a memory communicatively connected to the at least one processor; wherein,

[0042] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the image processing method described in any embodiment of the present invention.

[0043] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the image processing method described in any embodiment of the present invention when executed.

[0044] The technical solution of the embodiment of the present invention is to obtain a group of images to be processed; wherein, the group of images to be processed includes images to be processed of at least one participant; the images to be processed are input into an image classification model to obtain a target classification result; wherein, the image classification model is additionally provided with a data security processing layer, the data security processing layer is constructed with a matrix input data cache module, a matrix inverse operation module and a matrix output data cache module; the data security processing layer outputs the inverse operation of the images to be processed to obtain target security data, and the target security data is processed by convolution to obtain the target classification result. This technical solution can improve the security of data through the data security processing layer, realize fast data processing through the matrix inverse operation module, and improve computing efficiency.

[0045] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. 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 creative work.

[0047] Figure 1 is a flowchart of an image processing method provided according to Embodiment 1 of the present invention;

[0048] Figure 2 is an example diagram of the architecture of an image classification model provided according to the first embodiment of the present invention;

[0049] Figure 3 is a flowchart of an image processing method provided according to Embodiment 2 of the present invention;

[0050] Figure 4 is a structural schematic diagram of an image processing device provided according to Embodiment 3 of the present invention;

[0051] Figure 5 It is a schematic diagram of the structure of an electronic device provided according to Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0052] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0053] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0054] Embodiment 1

[0055] Figure 1 1 is a flowchart of an image processing method provided according to the first embodiment of the present invention. This embodiment is applicable to the case of classifying images. The method can be executed by an image processing device. The image processing device can be implemented in the form of hardware and / or software. The image processing device can be configured in an electronic device with data processing capabilities. Figure 1 As shown, the method includes:

[0056] S110: Obtain a group of images to be processed.

[0057] The group of images to be processed includes images to be processed of at least one participant. The images to be processed can be understood as images that need to be classified. The participants can be understood as users who need to perform image classification. In this embodiment, images to be processed of at least one participant can be obtained.

[0058] S120, inputting the image to be processed into an image classification model to obtain a target classification result.

[0059] Among them, the image classification model is additionally provided with a data security processing layer, and the data security processing layer is constructed with a matrix input data cache module, a matrix inverse operation module and a matrix output data cache module. The data security processing layer outputs an inverse operation on the image to be processed to obtain the target security data, and the target security data is processed by convolution to obtain the target classification result. In this embodiment, the data security processing layer can be understood as an operation of performing data security calculation on the image to be processed, which can further include the security of the data of each participant. In this embodiment, the data security processing layer can be used to achieve the purpose of security protection of the data of each participant. Among them, the matrix input data cache module can be used to cache data from the memory of the image classification model and transmit it to the matrix inverse operation module. The matrix inverse operation module can be used to receive data from the matrix input data cache module, perform an inverse operation, and send the result of the inverse operation to the matrix output data cache module. The matrix output data cache module can be used to cache data from the matrix inverse operation module and send it to the serialization module for subsequent multiplication and addition operations.

[0060] The image classification model in this embodiment is a trained neural network model that can be used to classify multiple user input images. The target security data can be data processed by the data security processing layer, that is, data obtained through privacy calculation. The target classification result can be understood as the classification result obtained after the image to be processed is processed by the image classification model. The specific method is to input the image to be processed into the image classification model, and obtain the target security data through the processing of each module of the data security processing layer in the image classification model, and send the target security data to the convolution kernel of the image classification model for convolution processing to obtain the target classification result.

[0061] In this embodiment, optionally, the image classification model includes a convolution kernel; the target safety data is processed by convolution to obtain a target classification result, including: sending the target safety data to the convolution kernel for convolution operation to obtain a target classification result.

[0062] Among them, the convolution kernel can be a convolution operation processing on the input image to be processed. Different convolution kernel types have different characteristics and functions. In this embodiment, a suitable convolution kernel type can be selected according to the requirements of the specific task. Exemplarily, the convolution kernel of this embodiment may include a serialization module, a multiplication and accumulation module, and an accumulator module. In this embodiment, the target security data processed by the data security processing layer can be sent to the convolution kernel, and a matrix multiplication and addition operation can be performed to obtain a target classification result.

[0063] Through such a setting in this embodiment, the convolution kernel in the image classification model can perform convolution operation on the data processed by the data security processing layer, thereby achieving effective processing of the target security data.

[0064] The architecture example of the image classification model of this embodiment is shown in FIG. Figure 2 As shown, the technical solution of this embodiment can be applied to neural network acceleration and data security computing. Among them, data security computing can be understood as including the data privacy of different participants. Specifically, the neural network accelerator architecture with data security computing includes a control module, a control interface module, a data interface module, DRAM, DMA, an input data cache module, a serialization module, a multiplier accumulator module, an accumulator module, an activation module, a pooling module and a data security processing layer; wherein, the data security processing layer is constructed with a matrix input data cache module, a matrix inverse operation module and a matrix output data cache module; the control module: through the control interface module, it is used to send commands to the matrix input data cache module, the matrix inverse operation module, the matrix output data cache module, the input data cache module, DMA, the serialization module, the multiplier accumulator module, the accumulator module, the activation module, and the pooling module, and an external interface is designed for communicating with an external system. The control interface module can be used to send configuration instructions to each module. The data interface module can be used for the controller to read and write operations to the DRAM. DRAM can be used to store the data required for calculation and the calculation results. DMA can directly access the memory and is used to read and write operations to the DRAM. Input data cache module: used to cache pixel, feature, weight and other data from DMA. The serialization module is used to load input feature data, pixel data and weight data from the input data cache module, and load data from the matrix output data cache module, and transmit it to the multiplication and accumulation module. The multiplication and accumulation module is used to receive feature data and weight data, perform multiplication and addition operations, and output the output results to the accumulator module. The accumulator module is used to accumulate the partial sums of the multiplication and accumulation modules and send the results to the activation module. The activation module is used to perform post-processing operations on individual data elements, and by performing nonlinear transformations on the inputs, the network can learn and represent more complex functional relationships. The pooling module is used to receive data from the activation module and perform pooling operations, which can effectively reduce the size of the parameter matrix, thereby reducing the number of parameters in the last connected layer. The matrix input data cache module is used to cache data from DMA and transmit it to the matrix inverse operation module. The matrix inverse operation module is used to receive data from the matrix input data cache module, perform inversion operations, and send the results to the matrix output data cache module. The matrix output data cache module is used to cache the data from the matrix inverse operation module and send it to the serialization module for subsequent multiplication and addition operations.

[0065] Exemplarily, the implementation process of the modularity of image classification in this embodiment can be specifically as follows: Step 1: First, the control module writes the convolution data into the DRAM through the data interface module, and then configures the DMA through the control interface module, including the size and address of the data to be read. The DMA takes out the data from the DRAM according to the configuration information, and determines whether to perform a convolution operation or a data security calculation operation according to the configuration information; wherein the configuration information is pre-configured, and specifically can configure the operation to be performed, such as configuration information such as a convolution operation or a data security calculation operation; other information can also be configured, and can be configured according to actual needs. If a convolution operation is performed, the data is sent to the input data cache module. If a data security calculation operation is performed, jump to step 4. Step 2: The input data cache module sends the data to the convolution kernel for convolution operation, and the serialization module first takes out the feature data and weight data from the input data cache module, and sends the feature data and weight data to different MAC units for multiplication and accumulation calculations, and then sends the calculation results of each MAC unit to the accumulator for accumulation operation to obtain the convolution operation result. Step 3: The convolution result is sent to the activation module. After the activation module performs post-processing operations on a single data element, if pooling operation is not required, the result can be directly written back to DRAM; if pooling operation is required, the data can be sent to the pooling module for maximum pooling, minimum pooling or mixed pooling, etc., and finally the result is written back to DRAM, and the control module reads the result back through the data interface module. Step 4: DMA takes out the data from DRAM according to the configuration information and sends it to the matrix input data cache module. The matrix inverse operation module reads the data from the matrix input data cache module for inversion operation, and then sends the result to the matrix output data cache module. Finally, it is sent to the convolution kernel for matrix multiplication and addition operation, and the result is written back to DRAM, and the control module reads the result back through the data interface module.

[0066] The technical solution of the embodiment of the present invention is to obtain a group of images to be processed; wherein the group of images to be processed includes images to be processed of at least one participant; the images to be processed are input into an image classification model to obtain a target classification result; wherein the image classification model is additionally provided with a data security processing layer, the data security processing layer is constructed with a matrix input data cache module, a matrix inverse operation module and a matrix output data cache module; the data security processing layer outputs an inverse operation on the image to be processed to obtain target security data, and the target security data is processed by convolution to obtain the target classification result. This technical solution can improve the security of data through the data security processing layer, realize fast data processing through the matrix inverse operation module, and improve computing efficiency.

[0067] Embodiment 2

[0068] Figure 3This is a flow chart of an image processing method provided according to the second embodiment of the present invention, and this embodiment is optimized based on the above embodiment. The specific optimization is: the data security processing layer outputs an inverse operation on the image to be processed to obtain the target security data, including: obtaining the image to be processed and the first key of each participant, and the second key of the data security processing layer; inputting the image to be processed of each participant into the image classification model to obtain predicted classification data; homomorphically encrypting the predicted classification data according to the first key and the second key to obtain the gradient ciphertext of each participant; homomorphically decrypting the gradient ciphertext according to the first key to obtain the target security data. Figure 3 As shown, the method includes:

[0069] S310, obtaining the image to be processed and the first key of each participant, as well as the second key of the data security processing layer.

[0070] The image to be processed may be an image that each participating user needs to classify. The first key may be a user's key. The first key may include a private key and a public key of each participating party. The second key may include a private key and a public key of a data security processing layer.

[0071] Exemplarily, in this embodiment, an image classification model architecture including a data security processing layer can be constructed; in this embodiment, the input of the image classification model can have n participating users P = {P i |1≤i≤n}, where P i represents the i-th user; the parameters of the image classification model can be initialized, a large prime number p is selected as the security modulus, and the bit length L(p) of p is used as the security parameter k, that is, L(p) = k, L(p) ≥ 1024; then the residual class ring Z is constructed according to p p = {0, 1, ..., p-1}, where Z p is a set of integers from 0 to p-1, and then in Z p The original root g of p is randomly selected from the above. The specific method of obtaining the first key of each participant can be that each user P i In the remaining class ring Z p Randomly pick an integer x from i As your own private key sk i =x i , and calculate its own public key parameters p, g and y i As your own public key pk i =(p,g,y i ), where mod represents the modulus operation and ≡ represents the congruence. The data security processing layer can be in the residual class ring Z p Randomly select an integer a as your private key sk a= a, and calculate its own public key parameters p, g and y a As your own public key pk a =(p,g,y a ).

[0072] In this embodiment, the image to be processed of each participant, the private key and public key of each participant, and the public key and private key of the data security processing layer can be obtained.

[0073] S320: Input the to-be-processed images of each participant into the image classification model to obtain predicted classification data.

[0074] The predicted classification data may be prediction result data obtained by inputting the image to be processed into the image classification model. In this embodiment, the image to be processed of each participant may be used as the input of the image classification model for forward propagation to obtain the predicted classification data.

[0075] S330. Perform homomorphic encryption on the predicted classification data according to the first key and the second key to obtain the gradient ciphertext of each participant.

[0076] Homomorphic encryption refers to performing a specific operation on the ciphertext obtained after homomorphic encryption of the predicted classification data, and then performing homomorphic decryption on the result to obtain a plaintext equivalent to the data result obtained by directly performing the same calculation on the original plaintext data. Gradient ciphertext can be understood as the ciphertext obtained by performing homomorphic encryption on the gradient vector obtained by calculating the predicted classification data.

[0077] In this embodiment, the specific method of performing homomorphic encryption on the predicted classification data according to the first key and the second key can be to first process the predicted classification result to obtain the corresponding gradient vector, and then perform homomorphic encryption on the gradient vector according to the first secret key of each participant and the second key of the data security processing layer to obtain the gradient ciphertext of each participant.

[0078] In this embodiment, optionally, the predicted classification data is homomorphically encrypted according to the first key and the second key to obtain the gradient ciphertext of each participant, including: determining the gradient vector of the image classification model through the predicted classification data; homomorphically encrypting a set number of gradient vectors with the second key to obtain a gradient ciphertext vector set; aggregating the gradient ciphertext vectors in the gradient ciphertext vector set to obtain an aggregated gradient ciphertext vector; homomorphically encrypting the aggregated gradient ciphertext vector according to the first key to obtain the gradient ciphertext of each participant.

[0079] Among them, the gradient vector includes a set number of gradient vectors; the gradient vector can be a gradient vector of a weight parameter of an image classification model. The set number can be the same as the number of weight parameters of the image classification model. The number of weight parameters can be set and can be set according to actual needs. In this embodiment, the gradient vector of the image classification model determined by predicting the classification data can be a gradient vector of the weight parameters of the image classification model calculated by using the mean square error loss function on the prediction result. The gradient ciphertext vector set can include the ciphertext of a set number of gradient vectors. The aggregated gradient ciphertext vector can be obtained by aggregating the ciphertext of a set number of gradient vectors.

[0080] In this embodiment, a set number of gradient vectors can be homomorphically encrypted by a second key, and the method of obtaining a gradient ciphertext vector set can be to homomorphically encrypt a set number of gradient vectors by a public key of a data security processing layer to obtain a gradient ciphertext vector set. In this embodiment, all gradient ciphertext vectors in the gradient ciphertext vector set can be aggregated to obtain an aggregated gradient ciphertext vector; in this embodiment, the aggregated gradient ciphertext vector can be blinded by the public key of each participant, and then the aggregated gradient ciphertext after blinding can be homomorphically encrypted to obtain the gradient ciphertext of each participant.

[0081] Exemplarily, in this embodiment, when training the image classification model, the weight parameter vector of the image classification model can be initialized as the weight parameter vector w0, the number of iterations is d, the maximum number of iterations is D, D ≥ 100, and d = 1, the current weight parameter vector is, where the number of weight parameters of w0 is T, T ≥ 10000, when d = 1, w d =w0.

[0082] In this embodiment, each participant user P i Use the image to be processed as the input of the image classification model for forward propagation to obtain the predicted classification result of the current iteration And use the mean square error loss function to predict the classification results Calculate the gradient vector Δw of the weight parameters of the convolutional neural network model (i_d) , where Δw (i_d) The number of gradients is T; then the public key pk of the data security processing layer is used a For the gradient vector Δw (i_d) Perform homomorphic encryption to obtain the gradient ciphertext vector set W d , and W d Upload to the data security processing layer.

[0083]

[0084] in, Represents the participant user Pi The obtained gradient ciphertext vector includes T gradient ciphertexts, Enc() represents homomorphic encryption, Exp() represents an exponential function with g as the base, and K it Represents the participant user P i In Z p A randomly selected integer from represents the tth gradient ciphertext, 1≤t≤T. The data security processing layer processes the gradient ciphertext vector set W d Aggregate all the gradient ciphertext vectors in to get the aggregated gradient ciphertext vector

[0085]

[0086]

[0087] in, represents the tth aggregate gradient ciphertext;

[0088] Then, the aggregated gradient ciphertext vector is homomorphically encrypted using the public key of each participating user to obtain the gradient ciphertext of each participating user.

[0089] Through such a setting in this embodiment, the predicted classification results in the image classification model can be encrypted according to the keys of the participants and the keys of the data security processing layer, thereby solving the technical problems in the prior art that privacy information is easily leaked and cannot resist collusion attacks, and improving the computing efficiency through the various modules of the data security processing layer.

[0090] In this embodiment, optionally, the first key includes the public key and private key of the participating party; accordingly, the aggregated gradient ciphertext vector is homomorphically encrypted according to the first key to obtain the gradient ciphertext of each participating party, including: using the first identifier and the second identifier to respectively represent the first gradient ciphertext and the second gradient ciphertext of the aggregated gradient ciphertext; blinding the first gradient ciphertext and the second gradient ciphertext respectively by a blinding factor to obtain the blinded first gradient ciphertext and the second gradient ciphertext; determine the gradient ciphertext of each participating party according to the public key of each participating party and the blinded first gradient ciphertext and the second gradient ciphertext.

[0091] The first identifier and the second identifier may be user-defined identifiers used to characterize the first gradient ciphertext and the second gradient ciphertext in the aggregate gradient ciphertext. The blinding factor may be a random integer. The gradient ciphertext of each participant may include gradient ciphertexts of different levels. For example, the gradient ciphertext may include level 1 ciphertext, level 2 ciphertext, level 3 ciphertext, etc.

[0092] Specifically, in this embodiment, the data security processing layer can randomly select an integer in the remaining class ring as a blinding factor. The blinding process in this embodiment can be blinding is to perform a random operation on the ciphertext, and obtain a new ciphertext using a random number. In this embodiment, a random integer can be used as a blinding factor, and the first gradient ciphertext and the second gradient ciphertext can be blinded by the blinding factor to obtain the blinded first gradient ciphertext and the second gradient ciphertext, and then the blinded first gradient ciphertext and the second gradient ciphertext are homomorphically encrypted according to the public key of each participating user to obtain different levels of ciphertexts of each participating user.

[0093] For example, in this embodiment, and Respectively represent the t-th aggregate gradient ciphertext The first gradient ciphertext and the second gradient ciphertext Right now in represents the tth aggregate gradient plaintext, The system is in the residual ring Z p Randomly select an integer s as the blinding factor, and use the blinding factor s to aggregate the gradient ciphertext Perform blinding processing to obtain the first gradient ciphertext and the second gradient ciphertext after blinding:

[0094]

[0095] Through such a setting in this embodiment, the ciphertext can be blinded by a random integer to obtain a new ciphertext, and then encryption and other operations are performed, which further improves the security of the ciphertext.

[0096] In this embodiment, optionally, the gradient ciphertext of each participant is determined based on the public key of each participant and the blinded first gradient ciphertext and the second gradient ciphertext, including: homomorphically encrypting the blinded first gradient ciphertext and the second gradient ciphertext through the public key of each participant to obtain a first-level ciphertext; performing de-blinding factor processing on the first-level ciphertext to obtain a second-level ciphertext; encrypting the second-level ciphertext according to set parameters to obtain a third-level ciphertext to obtain the gradient ciphertext of each participant.

[0097] Among them, the first-level ciphertext can be the ciphertext obtained by homomorphically encrypting the blinded first gradient ciphertext and the second gradient ciphertext through the public key of each participating user. The de-blinding factor processing can be understood as the operation of removing the blinding factor. The second-level ciphertext can be the ciphertext obtained by removing the blinding factor of the first-level ciphertext. The setting parameters can be understood as the set data. The setting parameters in this embodiment can be random integers, or they can be set according to actual needs. This embodiment does not limit this. The third-level ciphertext can be understood as the ciphertext obtained by re-encrypting the second-level ciphertext by setting parameters. In this embodiment, the specific method of encrypting the second-level ciphertext by setting parameters to obtain the third-level ciphertext can be to calculate the third-level ciphertext by setting parameters and the homomorphic encryption algorithm.

[0098] For example, in this embodiment, the participant user P i The public key pk i Homomorphically encrypt the blinded first gradient ciphertext and the second gradient ciphertext to obtain the first-level ciphertext Among them, z it The data security processing layer can be used in the remaining class ring Z p An integer randomly selected from the ciphertext Perform the deblinding factor to obtain the secondary ciphertext

[0099] Finally, the data security processing layer can be used in the remaining class loop Z p Randomly select an integer e from it , and calculate P according to the following formula i The third level ciphertext Then send it to the corresponding participant user P i .

[0100]

[0101] In this embodiment, blinding is to perform a random operation on the ciphertext, and use the random integer s to obtain a new ciphertext. The decryption results of the new and old ciphertexts are the same, but the new ciphertext does not necessarily correspond to the original plaintext. Therefore, before blinding, encryption processing, and re-blinding processing, each step is a different ciphertext, which is equivalent to an additional layer of protection. In this embodiment, through such a setting, encryption can be performed through the public key of the participating user and the random integer to obtain ciphertexts of different levels, further improving the security of the data.

[0102] S340. Perform homomorphic decryption on the gradient ciphertext according to the first key to obtain target security data.

[0103] Among them, homomorphic decryption can decrypt the gradient ciphertext through the private key to obtain the corresponding plaintext data. The target security data can be understood as the plaintext data decrypted from the gradient ciphertext. In this embodiment, the gradient ciphertext can be homomorphically decrypted according to the private key in the first key to obtain the corresponding target security data.

[0104] In this embodiment, optionally, the gradient ciphertext is homomorphically decrypted according to the first key to obtain the target security data, including: performing homomorphic decryption on the third-level ciphertext based on the private key to obtain a set number of aggregated gradient plaintexts; combining the set number of aggregated gradient plaintexts to obtain the target security data.

[0105] In this embodiment, the three-level ciphertext can be homomorphically decrypted according to the private key of each participant to obtain a set number of aggregated gradient plaintexts, and the obtained aggregated gradient plaintexts are combined into an aggregated gradient plaintext vector as the target security data.

[0106] For example, in this embodiment, each participant user P i Through your own private key sk i For level 3 ciphertext Perform homomorphic decryption to obtain T aggregated gradient plaintexts And combine the homomorphic decryption results of T three-level ciphertexts into an aggregate gradient plaintext vector The target security data is obtained. For example:

[0107]

[0108] In addition, the image classification model in this embodiment also includes an input layer, num convolutional layers-activation-pooling layers, an output layer, etc., where num≥2, and the output layer is sequentially connected to multiple fully connected layers. P i obtain n image data to be processed, and annotate each image, use more than half of the images and their labels as the training image sample set, and use the remaining images and their labels as the test image sample set, n ≥ 1000; in this embodiment, the gradient plaintext vector can be aggregated The weight parameter w of the image classification model d Update, and then determine whether d ≥ the set number of iterations D. If so, get the trained convolutional neural network model, otherwise, set d = d + 1, and continue to input the image to be processed for iteration until the set maximum number of iterations D is reached. i You can also use your own test image sample set as the input of the trained image classification model for image classification, and obtain the results of each test image to verify the reliability of the image classification model.

[0109] The technical solution of the embodiment of the present invention obtains the image to be processed and the first key of each participant, as well as the second key of the data security processing layer; inputs the image to be processed of each participant into the image classification model to obtain predicted classification data; homomorphically encrypts the predicted classification data according to the first key and the second key to obtain the gradient ciphertext of each participant; homomorphically decrypts the gradient ciphertext according to the first key to obtain the target security data. This technical solution can perform privacy calculation processing on the data through the data security processing layer, thereby improving the security of the data, and realizes rapid data processing through the matrix inverse operation module, thereby improving the calculation efficiency.

[0110] Embodiment 3

[0111] Figure 4 It is a structural schematic diagram of an image processing device provided according to Embodiment 3 of the present invention.

[0112] like Figure 4 As shown, the device comprises:

[0113] The image acquisition module 410 is used to acquire a group of images to be processed; wherein the group of images to be processed includes an image to be processed of at least one participant;

[0114] The classification result acquisition module 420 is used to input the image to be processed into the image classification model to obtain the target classification result;

[0115] Among them, the image classification model is additionally equipped with a data security processing layer, which is constructed with a matrix input data cache module, a matrix inverse operation module and a matrix output data cache module; the data security processing layer outputs the inverse operation on the image to be processed to obtain the target security data, and the target security data is processed through convolution to obtain the target classification result.

[0116] Optionally, the image processing device further includes the following modules to complete the output of the data security processing layer and perform an inverse operation on the image to be processed to obtain target security data:

[0117] A key acquisition module, used to acquire the image to be processed and the first key of each participant, and the second key of the data security processing layer;

[0118] The classification data acquisition module is used to input the to-be-processed images of each participant into the image classification model to obtain the predicted classification data;

[0119] A gradient ciphertext acquisition module, used to homomorphically encrypt the predicted classification data according to the first key and the second key to obtain the gradient ciphertext of each participant;

[0120] The target security data determination module is used to homomorphically decrypt the gradient ciphertext according to the first key to obtain the target security data.

[0121] Optional, gradient ciphertext acquisition module, including:

[0122] A gradient vector determination unit, used to determine a gradient vector of an image classification model by predicting classification data; wherein the gradient vector includes a set number of gradient vectors;

[0123] A gradient ciphertext vector set acquisition unit, configured to homomorphically encrypt a set number of gradient vectors using a second key to obtain a gradient ciphertext vector set;

[0124] A vector aggregation unit, used for aggregating the gradient ciphertext vectors in the gradient ciphertext vector set to obtain an aggregated gradient ciphertext vector;

[0125] The vector encryption unit is used to homomorphically encrypt the aggregated gradient ciphertext vector according to the first key to obtain the gradient ciphertext of each participant.

[0126] Optionally, the first key includes a public key and a private key of the participant;

[0127] Accordingly, the vector encryption unit includes:

[0128] A ciphertext representation subunit, used to respectively represent a first gradient ciphertext and a second gradient ciphertext of the aggregated gradient ciphertext using a first identifier and a second identifier;

[0129] A blinding processing subunit, used to perform blinding processing on the first gradient ciphertext and the second gradient ciphertext respectively by using a blinding factor to obtain the blinded first gradient ciphertext and the second gradient ciphertext;

[0130] The gradient ciphertext determination subunit is used to determine the gradient ciphertext of each participant according to the public key of each participant and the blinded first gradient ciphertext and the second gradient ciphertext.

[0131] Optionally, the gradient ciphertext determination subunit is specifically used to homomorphically encrypt the blinded first gradient ciphertext and the second gradient ciphertext through the public key of each participant to obtain a first-level ciphertext; perform de-blinding factor processing on the first-level ciphertext to obtain a second-level ciphertext; encrypt the second-level ciphertext according to set parameters to obtain a third-level ciphertext, so as to obtain the gradient ciphertext of each participant.

[0132] Optionally, the target security data determination module is specifically used to perform homomorphic decryption on the third-level ciphertext based on the private key to obtain a set number of aggregated gradient plaintexts; and combine the set number of aggregated gradient plaintexts to obtain the target security data.

[0133] Optionally, the image classification model includes a convolution kernel;

[0134] The image processing device also includes the following modules to complete the target safety data through convolution processing to obtain the target classification result:

[0135] The convolution operation module is used to send the target security data to the convolution kernel for convolution operation to obtain the target classification result.

[0136] An image processing device provided by an embodiment of the present invention can execute an image processing method provided by any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.

[0137] Embodiment 4

[0138] Figure 5 1 is a schematic diagram of the structure of an electronic device provided according to Embodiment 4 of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0139] like Figure 5 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, ROM 12 and RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0140] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0141] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as an image processing method.

[0142] In some embodiments, the image processing method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the image processing method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the image processing method in any other appropriate manner (e.g., by means of firmware).

[0143] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0144] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0145] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0146] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0147] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0148] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0149] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0150] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. An image processing method, characterized in that: include: Acquire a group of images to be processed; wherein the group of images to be processed includes an image to be processed of at least one participant; Inputting the image to be processed into an image classification model to obtain a target classification result; Among them, the image classification model is additionally provided with a data security processing layer, which is constructed with a matrix input data cache module, a matrix inverse operation module and a matrix output data cache module; the data security processing layer outputs the inverse operation of the image to be processed to obtain target security data, and the target security data is processed through convolution to obtain a target classification result.

2. The method according to claim 1, characterized in that The data security processing layer outputs an inversion operation on the image to be processed to obtain target security data, including: Obtaining the image to be processed and the first key of each participant, and the second key of the data security processing layer; Inputting the to-be-processed images of each participant into the image classification model to obtain predicted classification data; Homomorphically encrypt the predicted classification data according to the first key and the second key to obtain a gradient ciphertext of each participant; The gradient ciphertext is homomorphically decrypted according to the first key to obtain target security data.

3. The method according to claim 2, characterized in that The predicted classification data is homomorphically encrypted according to the first key and the second key to obtain a gradient ciphertext of each participant, including: Determining a gradient vector of the image classification model through the predicted classification data; wherein the gradient vector includes a set number of gradient vectors; Homomorphically encrypt the set number of gradient vectors using the second key to obtain a set of gradient ciphertext vectors; Aggregating the gradient ciphertext vectors in the gradient ciphertext vector set to obtain an aggregated gradient ciphertext vector; The aggregated gradient ciphertext vector is homomorphically encrypted according to the first key to obtain the gradient ciphertext of each participant.

4. The method according to claim 3, characterized in that The first key includes a public key and a private key of a participant; Correspondingly, the aggregated gradient ciphertext vector is homomorphically encrypted according to the first key to obtain the gradient ciphertext of each participant, including: Using a first identifier and a second identifier to represent a first gradient ciphertext and a second gradient ciphertext of the aggregated gradient ciphertext respectively; Performing blinding processing on the first gradient ciphertext and the second gradient ciphertext respectively by using a blinding factor to obtain a blinded first gradient ciphertext and a second gradient ciphertext; The gradient ciphertext of each participant is determined according to the public key of each participant and the blinded first gradient ciphertext and second gradient ciphertext.

5. The method according to claim 4, characterized in that Determining the gradient ciphertext of each participant according to the public key of each participant and the blinded first gradient ciphertext and the second gradient ciphertext includes: The blinded first gradient ciphertext and the second gradient ciphertext are homomorphically encrypted using the public key of each participant to obtain a first-level ciphertext; Performing a de-blinding factor process on the first-level ciphertext to obtain a second-level ciphertext; The second-level ciphertext is encrypted according to the set parameters to obtain the third-level ciphertext, so as to obtain the gradient ciphertext of each participant.

6. The method according to claim 5, characterized in that Homomorphically decrypting the gradient ciphertext according to the first key to obtain target security data includes: Homomorphically decrypt the three-level ciphertext based on the private key to obtain a set number of aggregated gradient plaintexts; Combine a set number of aggregated gradient plaintexts to obtain target security data.

7. The method according to claim 1, characterized in that The image classification model includes a convolution kernel; The target safety data is processed through convolution to obtain a target classification result, including: The target security data is sent to the convolution kernel for convolution operation to obtain a target classification result.

8. An image processing device, characterized in that: include: An image acquisition module, used to acquire a group of images to be processed; wherein the group of images to be processed includes an image to be processed of at least one participant; A classification result acquisition module is used to input the image to be processed into an image classification model to obtain a target classification result; Among them, the image classification model is additionally provided with a data security processing layer, which is constructed with a matrix input data cache module, a matrix inverse operation module and a matrix output data cache module; the data security processing layer outputs the inverse operation of the image to be processed to obtain target security data, and the target security data is processed through convolution to obtain a target classification result.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the image processing method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the image processing method according to any one of claims 1 to 7 when executed.

Citation Information

Patent Citations

  • Convolutional neural network image classification method based on homomorphic encryption

    CN112949741A

  • Encrypted image classification method and device based on convolutional neural network

    CN114022708A

  • Ciphertext image classification deep learning processing method, system model and storage medium

    CN118194314A

  • Method and device for intersecting unbalanced private sets

    US20240143795A1