Homomorphic encryption optimization-based convolutional neural network secure inference method and system

By designing a computational method and encoding strategy for ciphertext rotation reuse, the dense-state inference process of convolutional neural networks is optimized, the number of rotation operations is reduced, the computational complexity is lowered, and data security is ensured, thus solving the problem of high computational cost caused by frequent ciphertext rotation.

CN121750201BActive Publication Date: 2026-04-28SHANDONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANDONG UNIV
Filing Date
2026-03-02
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

In existing convolutional neural network dense-state inference schemes based on homomorphic encryption, ciphertext rotation operations are frequent, resulting in high computational complexity and making it difficult to effectively solve the problem of frequent rotation operations in convolutional computation.

Method used

A computational method for ciphertext rotation multiplexing and a novel encoding and grouping strategy were designed. By pre-rotating the plaintext convolution kernel coefficient vector and performing specific rotation operations on the encrypted data using a rotation key, the number of rotations is reduced. The input data is then directly merged after the SISO module, eliminating the rotation operations in the merging stage.

Benefits of technology

It significantly reduces the computational complexity of cloud computing platforms, ensures data privacy and security, avoids the risk of data leakage in the cloud, and improves the efficiency of convolutional neural network inference.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121750201B_ABST
    Figure CN121750201B_ABST
Patent Text Reader

Abstract

The present disclosure provides a homomorphic encryption optimization-based convolutional neural network security inference method and system, relating to the technical field of artificial intelligence and data security, applied to a cloud computing platform, comprising: receiving encrypted data, a rotation key and a plaintext convolution kernel coefficient vector; pre-rotating the plaintext convolution kernel coefficient vector to obtain a plurality of pre-rotated plaintext kernel coefficient vectors; for each convolution kernel group, performing a specific rotation operation on the encrypted data using the rotation key according to the alignment offset required by each group of data to generate rotated ciphertext; multiplexing the rotated ciphertext, sequentially performing homomorphic multiplication and homomorphic addition operations on the rotated ciphertext and the plurality of pre-rotated plaintext kernel coefficient vectors to obtain intermediate ciphertext; performing optimized inter-group aggregation calculation, aggregating all aligned intermediate ciphertexts through homomorphic addition to obtain the final output ciphertext of convolution, and sending it to the data owner. The present disclosure improves the efficiency of convolutional neural network inference under homomorphic encryption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the fields of artificial intelligence and data security technology, specifically to a secure inference method and system for convolutional neural networks based on homomorphic encryption optimization. Background Technology

[0002] The statements in this section are merely background information relating to this disclosure and do not necessarily constitute prior art.

[0003] With the rapid development of artificial intelligence technology, Deep Learning as a Service (DLaaS) has become the mainstream model for cloud-based intelligent applications. In this model, cloud computing platforms with powerful computing resources provide users with efficient neural network inference services. Convolutional Neural Networks (CNNs), as an important type of artificial intelligence and deep learning, are widely used in key areas such as facial recognition and medical image diagnosis. However, these applications often involve extremely sensitive user privacy data (such as biometrics and medical record images). In the traditional DLaaS model, users need to upload raw data to the cloud computing platform in plaintext, facing serious data leakage risks. How to achieve secure and reliable convolutional neural network inference without exposing users' raw data has become a crucial problem that academia and industry urgently need to solve.

[0004] Homomorphic encryption (HE) technology allows addition and multiplication operations to be performed directly in ciphertext. The decrypted result is identical to the result of performing the same operation on plaintext, achieving "data usable but not visible." This can be used to solve the encrypted inference problem of convolutional neural networks (CNNs). In homomorphic encryption, to improve throughput, SIMD (Single Instruction Multiple Data) technology is typically used to package multiple plaintext data into a single ciphertext. However, during convolution operations, frequent ciphertext rotation operations must be performed to align the data in the ciphertext slots with the convolution kernel weights. Compared to homomorphic addition and homomorphic multiplication, ciphertext rotation involves complex key exchanges and polynomial transformations, resulting in computational and communication overheads several orders of magnitude higher. Therefore, the number of ciphertext rotation operations directly determines the latency and efficiency of the entire inference process.

[0005] Existing techniques have made some progress in reducing multiplication depth and optimizing activation functions, but they still have the following significant limitations in optimizing the rotation of convolutional layers:

[0006] (1) First, in single-input single-output (SISO) convolution computation, existing methods often perform independent rotation operations for each sliding window position or each weight element, failing to fully exploit the reuse potential of ciphertext data, resulting in the number of rotations increasing linearly with the convolution kernel size and high computational cost.

[0007] (2) Secondly, in the convolution aggregation stage of multiple inputs and multiple outputs, existing solutions usually require additional rotation operations to align the intermediate results of different channels to the same slot for accumulation, which further increases the total rotation overhead of the system.

[0008] Therefore, existing dense-state inference schemes for convolutional neural networks based on homomorphic encryption cannot effectively solve the problem of frequent rotation operations in convolution calculations, and a new computational architecture and encoding strategy are urgently needed. Summary of the Invention

[0009] To address the aforementioned issues, this disclosure proposes a secure inference method and system for convolutional neural networks based on homomorphic encryption optimization. It designs a computational method for ciphertext rotation reuse, significantly reducing the required rotation operations without increasing homomorphic multiplication and addition. Furthermore, it designs a novel encoding and grouping strategy, packaging input data according to channels, allowing the input data to be directly merged and added after passing through the SISO (Single-Input-Single-Output) computation module. This eliminates the rotation operations required in the merging stage, significantly reducing the computational complexity of cloud computing platforms.

[0010] According to some embodiments, the present disclosure adopts the following technical solutions:

[0011] A secure inference method based on homomorphic encryption optimization of convolutional neural networks is applied to cloud computing platforms, including:

[0012] The data received includes encrypted data sent by the data owner, a rotation key sent by the key management center, and a plaintext convolution kernel coefficient vector sent by the model parameter owner.

[0013] The plaintext convolution kernel coefficient vector is pre-rotated to obtain multiple pre-rotated plaintext kernel coefficient vectors;

[0014] Perform optimized intra-group multiplication and summation calculations. For each group of convolutional kernels, use a rotation key to perform a specific rotation operation on the encrypted data based on the alignment offset required for each group of data, generating rotated ciphertext.

[0015] The rotated ciphertext is reused by performing homomorphic multiplication and homomorphic addition operations on the rotated ciphertext and multiple pre-rotated plaintext kernel coefficient vectors in sequence to obtain the intermediate ciphertext;

[0016] Optimized inter-group aggregation computation is performed, which aggregates all aligned intermediate ciphertexts through homomorphic addition to obtain the final output ciphertext of the convolution, and then sends it to the data owner.

[0017] According to some embodiments, the present disclosure adopts the following technical solutions:

[0018] A secure inference method based on homomorphic encryption optimization using convolutional neural networks, applied to data owners, including:

[0019] Receive the public and private keys sent by the key management center and obtain the privacy data to be inferred;

[0020] For privacy-preserving data used in reasoning, a "row-first, channel-first" strategy is employed to encode it using SIMD technology, resulting in a plaintext vector which is then packaged.

[0021] The public key is used to encrypt the packaged plaintext vector to generate an input data set containing multiple independent encrypted data.

[0022] Send the dataset containing encrypted data to the cloud computing platform and outsource the inference computing task to the cloud computing platform;

[0023] Receive the final output ciphertext sent by the cloud computing platform, decrypt the final output ciphertext using the private key, and obtain the convolution result.

[0024] According to some embodiments, the present disclosure adopts the following technical solutions:

[0025] Secure inference methods based on homomorphic encryption optimization of convolutional neural networks include:

[0026] The data owner receives the public and private keys sent by the key management center and obtains the privacy data to be inferred. The data owner encodes the privacy data to be inferred using SIMD technology with a "row-first, channel-first" strategy to obtain a plaintext vector and packages it. The packaged plaintext vector is encrypted using the public key to generate an input data set containing multiple independent encrypted data. The data owner sends the data set containing the encrypted data to the cloud computing platform.

[0027] The cloud computing platform receives encrypted data from the data owner, a rotation key from the key management center, and plaintext convolutional kernel coefficient vectors from the model parameter owner. The platform pre-rotates the plaintext convolutional kernel coefficient vectors to obtain multiple pre-rotated plaintext kernel coefficient vectors. It then performs optimized intra-group multiplication and addition operations. For each convolutional kernel group, it uses the rotation key to perform a specific rotation operation on the encrypted data based on the required alignment offset for each group of data, generating rotated ciphertext. The platform reuses the rotated ciphertext by performing homomorphic multiplication and addition operations sequentially with the multiple pre-rotated plaintext kernel coefficient vectors to obtain intermediate ciphertext. Finally, it performs optimized inter-group aggregation operations, aggregating all aligned intermediate ciphertexts through homomorphic addition to obtain the final output ciphertext of the convolution, which is then sent to the data owner.

[0028] The data owner receives the final output ciphertext sent by the cloud computing platform, decrypts the final output ciphertext using a private key, and obtains the convolution result.

[0029] According to some embodiments, the present disclosure adopts the following technical solutions:

[0030] A secure inference system based on homomorphic encryption optimization of convolutional neural networks includes:

[0031] The encryption module performs the following steps: The data owner receives the public and private keys sent by the key management center and obtains the privacy data to be inferred; The data owner encodes the privacy data to be inferred using SIMD technology with a "row-first, channel-first" strategy to obtain a plaintext vector and packages it; The packaged plaintext vector is encrypted using the public key to generate an input data set containing multiple independent encrypted data; The data owner sends the data set containing the encrypted data to the cloud computing platform.

[0032] The convolutional inference module specifically executes the following steps: The cloud computing platform receives encrypted data from the data owner, a rotation key from the key management center, and plaintext convolutional kernel coefficient vectors from the model parameter owner; the cloud computing platform pre-rotates the plaintext convolutional kernel coefficient vectors to obtain multiple pre-rotated plaintext kernel coefficient vectors; the cloud computing platform performs optimized intra-group multiplication and addition calculations, for each convolutional kernel group, using the rotation key to perform specific rotation operations on the encrypted data according to the alignment offset required for each group of data, generating rotated ciphertext; the cloud computing platform reuses the rotated ciphertext, performing homomorphic multiplication and homomorphic addition operations sequentially with the rotated ciphertext and multiple pre-rotated plaintext kernel coefficient vectors to obtain intermediate ciphertext; the cloud computing platform performs optimized inter-group aggregation calculations, aggregating all aligned intermediate ciphertexts through homomorphic addition to obtain the final output ciphertext of the convolution, and sends it to the data owner;

[0033] The decryption module works as follows: The data owner receives the final output ciphertext sent by the cloud computing platform, uses the private key to decrypt the final output ciphertext, and obtains the convolution result.

[0034] According to some embodiments, the present disclosure adopts the following technical solutions:

[0035] A computer program product includes a computer program that, when executed by a processor, implements the aforementioned secure inference method based on homomorphic encryption optimization of a convolutional neural network.

[0036] According to some embodiments, the present disclosure adopts the following technical solutions:

[0037] A non-transitory computer-readable storage medium is provided for storing computer instructions, which, when executed by a processor, implement the aforementioned secure inference method for convolutional neural networks based on homomorphic encryption optimization.

[0038] According to some embodiments, the present disclosure adopts the following technical solutions:

[0039] An electronic device includes a processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory to enable the electronic device to implement the convolutional neural network secure inference method based on homomorphic encryption optimization.

[0040] Compared with the prior art, the beneficial effects of this disclosure are as follows:

[0041] This disclosure presents a secure inference method for convolutional neural networks based on homomorphic encryption optimization. The model consists of four parties: a key management center, a data owner, a model parameter owner, and a cloud computing platform. The key management center is responsible for independent key generation and distribution; the data owner uploads private data to the cloud computing platform in encrypted form; the model parameter owner uploads model parameters to the cloud computing platform; and the cloud computing platform, as the computing core, performs encrypted convolutional inference computation without obtaining plaintext data. A ciphertext rotation multiplexing computation method is designed in the SISO (Single-Input-Single-Output) computation module, significantly reducing the required rotation operations without increasing homomorphic multiplication and addition. A novel encoding and grouping strategy is designed to package the input data according to channels, allowing the input data to be directly merged and added after passing through the SISO computation module, eliminating the rotation operations required in the merging stage and significantly reducing the computational complexity of the cloud computing platform.

[0042] This disclosed secure inference method for convolutional neural networks based on homomorphic encryption optimization constructs a physical isolation mechanism between the private key (data decryption right) and the rotation key (computation right) by introducing an independent Key Management Center (KMC). The KMC leverages the mathematical decoupling of computational and decryption capabilities in homomorphic encryption to ensure that although the cloud computing platform holds the rotation key to perform encrypted operations, it cannot access the original data due to the lack of the private key, thereby eliminating the risk of data leakage in the cloud.

[0043] This disclosure presents a secure inference method for convolutional neural networks based on homomorphic encryption optimization. For the SISO (Single Input Single Output) module, a homomorphic convolution computation method with ciphertext rotation multiplexing is proposed. By pre-aligning the offsets of convolution kernels using the same ciphertext and performing intra-group multiplication and accumulation as well as inter-group aggregation of intermediate ciphertexts, SISO convolution can be implemented efficiently, greatly reducing the computational complexity on the cloud computing platform.

[0044] This disclosure presents a secure inference method for convolutional neural networks based on homomorphic encryption optimization. For multi-input, multi-output scenarios of homomorphic convolution, it designs a novel encoding and grouping strategy to ensure that the intermediate results generated by all input channels after computation by the SISO module are naturally aligned to the same output channel group in the ciphertext. This allows the system to complete aggregation through direct homomorphic addition, completely eliminating the need for any additional ciphertext rotation operations. The scheme described in this disclosure reduces the complexity of convolutional layer rotation and does not introduce additional homomorphic addition and multiplication, demonstrating practical feasibility and high efficiency. Attached Figure Description

[0045] The accompanying drawings, which form part of this disclosure, are used to provide a further understanding of this disclosure. The illustrative embodiments of this disclosure and their descriptions are used to explain this disclosure and do not constitute an undue limitation of this disclosure.

[0046] Figure 1 This is a flowchart of a secure inference method for convolutional neural networks based on homomorphic encryption optimization, according to an embodiment of this disclosure. Detailed Implementation

[0047] The present disclosure will be further described below with reference to the accompanying drawings and embodiments.

[0048] It should be noted that the following detailed descriptions are illustrative and intended to provide further explanation of this disclosure. Unless otherwise specified, 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 disclosure pertains.

[0049] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this disclosure. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms “comprising” and / or “including” are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0050] Example 1

[0051] One embodiment of this disclosure provides a secure inference method for convolutional neural networks based on homomorphic encryption optimization. The overall architecture consists of a key management center, a data owner, a model parameter owner, and a cloud computing platform. The key management center is responsible for independent key generation and distribution; the data owner uploads private data to the cloud computing platform in encrypted form; the model parameter owner uploads model parameters to the cloud computing platform; and the cloud computing platform, as the computing core, executes the encrypted inference calculation process of the convolutional neural network without obtaining plaintext data. This overall method can reduce or even eliminate unnecessary ciphertext rotation operations while ensuring computational correctness, thereby improving the efficiency of convolutional neural network inference under homomorphic encryption. Specific steps include:

[0052] Step 1: The data owner receives the public and private keys sent by the key management center and obtains the privacy data to be inferred; the data owner encodes the privacy data to be inferred using SIMD technology with a "row-first, channel-first" strategy to obtain a plaintext vector and packages it; the packaged plaintext vector is encrypted using the public key to generate an input data set containing multiple independent encrypted data; the data owner sends the data set containing the encrypted data to the cloud computing platform.

[0053] Step 2: The cloud computing platform receives encrypted data from the data owner, a rotation key from the key management center, and plaintext convolutional kernel coefficient vectors from the model parameter owner. The cloud computing platform pre-rotates the plaintext convolutional kernel coefficient vectors to obtain multiple pre-rotated plaintext kernel coefficient vectors. The cloud computing platform performs optimized intra-group multiplication and addition calculations. For each convolutional kernel group, it uses the rotation key to perform a specific rotation operation on the encrypted data based on the required alignment offset for each group of data, generating rotated ciphertext. The cloud computing platform reuses the rotated ciphertext, performing homomorphic multiplication and homomorphic addition operations sequentially with the multiple pre-rotated plaintext kernel coefficient vectors to obtain intermediate ciphertext. The cloud computing platform performs optimized inter-group aggregation calculations, aggregating all aligned intermediate ciphertexts through homomorphic addition to obtain the final output ciphertext of the convolution, and sends it to the data owner.

[0054] Step 3: The data owner receives the final output ciphertext sent by the cloud computing platform, decrypts the final output ciphertext using the private key, and obtains the convolution result.

[0055] As one embodiment, the specific functionalities of the key management center, data owner, model parameter owner, and cloud computing platform disclosed herein include:

[0056] 1) Key Management Center (KMC): As an independent and trusted third party in the system, it is responsible for system initialization and key generation. The KMC generates public keys, private keys, and rotation keys, and sends the public and private keys separately to the data owner, while sending the rotation keys required for computation to the cloud computing platform, thereby achieving the isolation between the right to decrypt data and the right to perform encrypted computation.

[0057] 2) Data Owner (DO): Holds the privacy-sensitive data to be inferred (such as images, voice, etc.), and wishes to use an external model for inference but must ensure data privacy. The DO is responsible for encoding and encrypting the input data using a public key, outsourcing the inference computation task to the cloud computing platform, and decrypting the inference result using a locally stored private key after receiving the encrypted inference result.

[0058] 3) Model Owner (MO): Owns the convolutional neural network model parameters and is responsible for offline grouping and encoding of convolutional kernel weights. It securely uploads the processed plaintext convolutional kernel coefficients to the cloud computing platform without directly deploying the original model files.

[0059] 4) Cloud Computing Platform (CCP): Possesses powerful computing resources and is responsible for executing core encrypted inference tasks. CCP receives ciphertext data from DO and preprocessed model parameters from MO, and uses the rotation key to perform optimized SISO computation and ciphertext aggregation to complete convolutional neural network encrypted inference.

[0060] Furthermore, this disclosure presents a secure inference method based on homomorphic encryption optimization using convolutional neural networks. The convolutional neural network utilizes convolutional kernels to efficiently extract spatial features from data such as images and speech, and is one of the mainstream architectures in the current computer vision field. Taking images as the input data as an example, the specific technical solution is implemented as follows:

[0061] 1) The data owner (DO) pre-calculates the set of rotation steps for the input encrypted data. and And send it to the Key Management Center (KMC).

[0062] 2) The Key Management Center (KMC) generates the keys used for encrypting data and performing homomorphic operations, including: the public key used for encryption and homomorphic computation. pk The private key used for decryption sk (Saved by DO); and a series of rotation keys necessary to support subsequent convolution calculations. and ,in and For all preset rotation step sizes (e.g.) (etc.), covering various offsets required for subsequent convolutional sliding windows, while setting the size of a single ciphertext line to . n .

[0063] 3) The Key Management Center (KMC) transmits the generated public key through a secure channel. and private key Send the rotation key to the data owner (DO). and The message is sent to the CCP cloud computing platform. At this point, CCP has the ability to perform all homomorphic operations, but cannot decrypt any ciphertext.

[0064] 4) The data owner (DO) obtains the following dimensions: Input image X Following a row-first, channel-first coding strategy, SIMD (Single Instruction Multiple Data) technology is used to arrange and encode the image data into a long plaintext vector. For the first... One input channel ( ), its two-dimensional data ( Flatten, and in the long plaintext vector Repeated filling in consecutive slots A copy of the channel data (of which) , (where is the order of the polynomial in homomorphic encryption).

[0065] 5) The data owner (DO) uses the public key. Encrypt the plaintext vector to obtain the initial ciphertext. .Will Each input channel is packaged into A set of input data containing multiple independent encrypted data is formed from a single initial ciphertext. This packaging method ensures data alignment in subsequent calculations. The data owner (DO) will provide the encrypted input data set. Send to the CCP cloud computing platform.

[0066] As an example, the computation process of the optimized SISO (Single-Input Single-Channel) module in the CCP cloud computing platform will be described below. The SISO module can calculate the result of homomorphic convolution of one channel of data and its corresponding convolution kernel. The steps are as follows:

[0067] 6) Let the kernel size be... ,in This represents the kernel size. The model parameter owner (MO) will use a kernel of size... The convolutional kernel units are divided into There are 1 group, each containing 1 group. Each weight data point is used to adapt to the optimized SISO computation structure. Among them, the following conditions are met: Let the input [X]c be the data of one channel.

[0068] 7) For each convolutional kernel group, the model parameter ownership method (MO) is set for each... The convolution kernel generates the corresponding plaintext kernel coefficient vector (plaintext convolution kernel coefficient vector). ( The vector is of length . The plaintext vector, by The non-zero coefficients are composed of 0 and 0, and the positions of their non-zero elements are determined by the weights covered by that group in the convolution kernel and the required loop offset. The distribution formula is ,in , ,

[0069] here , , and when hour ,otherwise .

[0070] 8) The model parameter owner (MO) will transfer the plaintext kernel coefficient vector. K i Send to the cloud computing platform CCP.

[0071] 9) The cloud computing platform CCP adjusts the plaintext kernel coefficient vector according to the offset required for homomorphic multiplication. Perform a pre-rotation to generate a pre-rotated plaintext kernel coefficient vector (pre-rotated plaintext kernel coefficient vector). These vectors are generated offline and do not consume online inference time.

[0072] 10) The cloud computing platform CCP performs optimized SISO computation (intra-group multiplicative summation): for each group ( The CCP, based on this set of data (a total of...), The required alignment offset for (number of data) ( Use the rotation key obtained from the key management center. Execute on the input ciphertext Rotation operation to calculate rotated ciphertext .

[0073] 11) Then reuse the rotated ciphertext Combine it with all the members in that group Pre-calculated rotated plaintext kernel coefficient vector at each position ( Perform homomorphic scalar multiplication and addition operations sequentially. (This step involves) performing partial summation within the group to obtain the intermediate ciphertext. .

[0074] 12) The cloud computing platform CCP continues to perform optimized SISO computation (inter-group aggregation): CCP collects all The output ciphertext of each group ,in The range of values ​​is to 2 These intermediate ciphertexts became misaligned due to block rotation. The cloud computing platform CCP then used the corresponding rotation key again. These intermediate ciphertexts are rotated to align them. Specifically, for the index... ( The group of ) and its corresponding rotation step size The calculation method is as follows ,if ,otherwise .

[0075] 13) The cloud computing platform CCP uses rotation keys obtained from the key management center. Perform rotation operation .

[0076] 14) The cloud computing platform CCP aggregates all aligned ciphertexts using homomorphic addition to obtain the final output ciphertext of the SISO convolution. Its total number of rotations is .

[0077] 15) Subsequently, the cloud computing platform CCP sends the final encrypted output to the data owner DO, who then uses their private key... Decrypting the result yields the convolution result. , This completes the computation of the entire convolutional layer.

[0078] Example 2

[0079] One embodiment of this disclosure provides a secure inference method for convolutional neural networks based on homomorphic encryption optimization, applied to a cloud computing platform. The specific process includes:

[0080] The data received includes encrypted data sent by the data owner, a rotation key sent by the key management center, and a plaintext convolution kernel coefficient vector sent by the model parameter owner.

[0081] The plaintext convolution kernel coefficient vector is pre-rotated to obtain multiple pre-rotated plaintext kernel coefficient vectors;

[0082] Perform optimized intra-group multiplication and summation calculations. For each group of convolutional kernels, use a rotation key to perform a specific rotation operation on the encrypted data based on the alignment offset required for each group of data, generating rotated ciphertext.

[0083] The rotated ciphertext is reused by performing homomorphic multiplication and homomorphic addition operations on the rotated ciphertext and multiple pre-rotated plaintext kernel coefficient vectors in sequence to obtain the intermediate ciphertext;

[0084] Optimized inter-group aggregation computation is performed, which aggregates all aligned intermediate ciphertexts through homomorphic addition to obtain the final output ciphertext of the convolution, and then sends it to the data owner.

[0085] As one embodiment, the computation process of homomorphic convolution applied to a cloud computing platform according to this disclosure includes:

[0086] 1) The CCP on the cloud computing platform received Then, the computation of privacy-preserving convolutional layers begins. The kernel size owned by the model parameter owner MO is [size missing]. . Each size is Consider it as a basic unit, and thus the entire convolution kernel can be considered as a... The convolution kernel matrix, where each value of the matrix is The convolution kernel unit.

[0087] 2) The model parameter owner (MO) will assign convolutional kernels according to the output channels. Divided into There are 1 block, each with a size of 1. Continue for each block according to the input channel. Divided into Groups, each group contains Each channel corresponds to a convolutional kernel unit.

[0088] 3) The model parameter owner MO has this The convolutional kernel units corresponding to each channel calculate the pre-rotated plaintext kernel coefficient vector. The model parameter owner (MO) sends the plaintext kernel coefficient vector to the cloud computing platform (CCP). The plaintext convolution kernel coefficient vector is a plaintext vector of a set length, generated by... i The convolution kernel consists of 0 and 0, and the position of its non-zero elements is determined by the weights covered by this group in the convolution kernel and the required loop offset. The model parameter owner sends the plaintext convolution kernel coefficient vector to the cloud computing platform.

[0089] The CCP cloud computing platform provides plaintext kernel coefficient vectors. Perform a pre-rotation to obtain the rotated plaintext required by the scheme. . , ( ).

[0090] 4) The CCP cloud computing platform provides a packaged set of encrypted input data for each input channel. (It contains) Part 1 (Copies of each input channel) using an optimized SISO module computation method to compute the ciphertext. With the generated aggregated plaintext kernel coefficient vector The convolution is performed. This operation simultaneously computes the input channel. Internal to the first The group output channel contains Each contribution produces an intermediate ciphertext. The ciphertext contains Partial results.

[0091] 5) The CCP on the cloud computing platform will add the intermediate ciphertexts in the same block, that is... .

[0092] 6) Employing an input packing strategy and convolutional kernel vector encoding method, all The middle cipher Data corresponding to the same output spatial location and specific channels within the output channel group are naturally located on the exact same slot index of their respective ciphertexts.

[0093] 7) Therefore, the CCP cloud computing platform does not need to perform any expensive rotation operations to realign the data; it directly uses homomorphic addition to... Summing the ciphertext in the middle: The convolution result can then be obtained. .

[0094] 8) Subsequently, the cloud computing platform CCP will present the results. Send to the data owner DO, who then uses their private key. Decrypting the result yields the convolution result. , This completes the computation of the entire convolutional layer.

[0095] Example 3

[0096] One embodiment of this disclosure provides a secure inference method for convolutional neural networks based on homomorphic encryption optimization, applied to a data owner, comprising the following steps:

[0097] Receive the public and private keys sent by the key management center and obtain the privacy data to be inferred;

[0098] For privacy-preserving data used in reasoning, a "row-first, channel-first" strategy is employed to encode it using SIMD technology, resulting in a plaintext vector which is then packaged.

[0099] The public key is used to encrypt the packaged plaintext vector to generate an input data set containing multiple independent encrypted data.

[0100] Send the dataset containing encrypted data to the cloud computing platform and outsource the inference computing task to the cloud computing platform;

[0101] Receive the final output ciphertext sent by the cloud computing platform, decrypt the final output ciphertext using the private key, and obtain the convolution result.

[0102] As one embodiment, the specific implementation process of the convolutional neural network secure inference method based on homomorphic encryption optimization disclosed herein, applied to the data owner, is as follows:

[0103] 1) The data owner (DO) pre-calculates the set of rotation step sizes. and And send it to the Key Management Center (KMC).

[0104] 2) The Key Management Center (KMC) generates public keys for encrypting data and performing homomorphic operations. and the private key used for final decryption. To support efficient convolution operations on cloud computing platforms, KMC needs to generate a series of rotation keys. and Here and Represents a preset set of rotation step sizes (e.g.) (etc.), covering various offsets required for subsequent convolutional sliding windows.

[0105] 3) The Key Management Center (KMC) will manage the public key. and private key Send the rotation key to the data owner (DO). and Send to the cloud computing platform CCP.

[0106] 4) The data owner (DO) employs a "row-first, channel-first" strategy using SIMD (Single Instruction Multiple Data) technology for encoding. For the first... One input channel ( ), its two-dimensional data ( Flatten, and in the long plaintext vector Repeated filling in consecutive slots A copy of the channel data (of which) , (where is the order of the polynomial in homomorphic encryption).

[0107] 5) The data owner (DO) uses the public key. The packaged plaintext vector is encrypted to generate a vector containing... A set of independent encrypted input data Subsequently, the data owner sent this encrypted data to the cloud computing platform CCP.

[0108] 6) The model parameter owner MO will have dimensions of The convolutional kernel units are divided into There are 1 group, each containing 1 group. Each weighted data point is used to adapt to the optimized SISO calculation structure.

[0109] 7) For each convolutional kernel group, the model parameter owner (MO) pre-calculates the corresponding plaintext kernel coefficient vector. and will Send to the cloud computing platform CCP.

[0110] Example 4

[0111] One embodiment of this disclosure provides a secure inference system for convolutional neural networks based on homomorphic encryption optimization, comprising:

[0112] The encryption module performs the following steps: The data owner receives the public and private keys sent by the key management center and obtains the privacy data to be inferred; The data owner encodes the privacy data to be inferred using SIMD technology with a "row-first, channel-first" strategy to obtain a plaintext vector and packages it; The packaged plaintext vector is encrypted using the public key to generate an input data set containing multiple independent encrypted data; The data owner sends the data set containing the encrypted data to the cloud computing platform.

[0113] The convolutional inference module specifically executes the following steps: The cloud computing platform receives encrypted data from the data owner, a rotation key from the key management center, and plaintext convolutional kernel coefficient vectors from the model parameter owner; the cloud computing platform pre-rotates the plaintext convolutional kernel coefficient vectors to obtain multiple pre-rotated plaintext kernel coefficient vectors; the cloud computing platform performs optimized intra-group multiplication and addition calculations, for each convolutional kernel group, using the rotation key to perform specific rotation operations on the encrypted data according to the alignment offset required for each group of data, generating rotated ciphertext; the cloud computing platform reuses the rotated ciphertext, performing homomorphic multiplication and homomorphic addition operations sequentially with the rotated ciphertext and multiple pre-rotated plaintext kernel coefficient vectors to obtain intermediate ciphertext; the cloud computing platform performs optimized inter-group aggregation calculations, aggregating all aligned intermediate ciphertexts through homomorphic addition to obtain the final output ciphertext of the convolution, and sends it to the data owner;

[0114] The decryption module works as follows: The data owner receives the final output ciphertext sent by the cloud computing platform, uses the private key to decrypt the final output ciphertext, and obtains the convolution result.

[0115] Example 5

[0116] One embodiment of this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the aforementioned secure inference method based on homomorphic encryption optimization of a convolutional neural network.

[0117] Example 6

[0118] One embodiment of this disclosure provides a non-transitory computer-readable storage medium for storing computer instructions. When these computer instructions are executed by a processor, they implement the aforementioned secure inference method for convolutional neural networks based on homomorphic encryption optimization.

[0119] Example 7

[0120] One embodiment of this disclosure provides an electronic device, including: a processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory to enable the electronic device to implement the convolutional neural network secure inference method based on homomorphic encryption optimization.

[0121] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0122] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0123] While the specific embodiments of this disclosure have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of this disclosure. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of this disclosure are still within the scope of protection of this disclosure.

Claims

1. A secure inference method for convolutional neural networks based on homomorphic encryption optimization, characterized in that, Applied to cloud computing platforms, including: The data received includes encrypted data sent by the data owner, a rotation key sent by the key management center, and a plaintext convolution kernel coefficient vector sent by the model parameter owner. The plaintext convolution kernel coefficient vector is pre-rotated to obtain multiple pre-rotated plaintext kernel coefficient vectors; Perform optimized intra-group multiplication and summation calculations. For each group of convolutional kernels, use a rotation key to perform a specific rotation operation on the encrypted data based on the alignment offset required for each group of data, generating rotated ciphertext. The rotated ciphertext is reused by performing homomorphic multiplication and homomorphic addition operations on the rotated ciphertext and multiple pre-rotated plaintext kernel coefficient vectors in sequence to obtain the intermediate ciphertext; Optimized inter-group aggregation computation is performed, which aggregates all aligned intermediate ciphertexts through homomorphic addition to obtain the final output ciphertext of the convolution, and then sends it to the data owner.

2. The secure inference method for convolutional neural networks based on homomorphic encryption optimization as described in claim 1, characterized in that, The key management center is an independent and trusted third party responsible for generating public keys for encrypting data and performing homomorphic operations, private keys for final decryption, and rotation keys for performing efficient convolution operations. It sends the public and private keys separately to the data owner and sends the rotation keys required for convolution calculations to the cloud computing platform.

3. The secure inference method for convolutional neural networks based on homomorphic encryption optimization as described in claim 1, characterized in that, The model parameter owner groups convolutional kernel units of a set size, with each group containing set weight data to adapt to the optimized SISO computation structure. For each convolutional kernel group, the model parameter owner pre-calculates the corresponding plaintext convolutional kernel coefficient vector, which is a plaintext vector of a set length. i The convolution kernel consists of 0 and 0, and the position of its non-zero elements is determined by the weights covered by this group in the convolution kernel and the required loop offset. The model parameter owner sends the plaintext convolution kernel coefficient vector to the cloud computing platform.

4. A secure inference method based on homomorphic encryption optimization of convolutional neural networks, characterized in that, Applied to the data owner as described in claim 1, including: Receive the public and private keys sent by the key management center and obtain the privacy data to be inferred; For privacy-preserving data used in reasoning, a "row-first, channel-first" strategy is employed to encode it using SIMD technology, resulting in a plaintext vector which is then packaged. The public key is used to encrypt the packaged plaintext vector to generate an input data set containing multiple independent encrypted data. Send the dataset containing encrypted data to the cloud computing platform and outsource the inference computing task to the cloud computing platform; Receive the final output ciphertext sent by the cloud computing platform, decrypt the final output ciphertext using the private key, and obtain the convolution result.

5. The secure inference method for convolutional neural networks based on homomorphic encryption optimization as described in claim 4, characterized in that, The privacy data to be inferred is encoded using SIMD technology with a "row-first, channel-first" strategy to obtain a plaintext vector, which is then packaged. The packaged plaintext vector is encrypted using a public key to generate an input data set containing multiple independent encrypted data items, including: For a specific input channel, its two-dimensional data is flattened, and multiple copies of the channel data are repeatedly filled into consecutive slots. The plaintext vector is then encrypted using the public key to obtain the initial ciphertext. Multiple input channels are then packaged into a corresponding number of independent initial ciphertexts to form an input data set containing multiple independent encrypted data.

6. A secure inference method for convolutional neural networks based on homomorphic encryption optimization, characterized in that, include: The data owner receives the public and private keys sent by the key management center and obtains the private data to be inferred; The data owner uses a "row-first, channel-first" strategy to encode the privacy data for inference using SIMD technology, obtaining plaintext vectors and packaging them; the packaged plaintext vectors are encrypted using a public key to generate an input data set containing multiple independent encrypted data; the data owner sends the data set containing the encrypted data to the cloud computing platform. The cloud computing platform receives encrypted data sent by the data owner, a rotation key sent by the key management center, and a plaintext convolution kernel coefficient vector sent by the model parameter owner. The cloud computing platform pre-rotates the plaintext convolution kernel coefficient vector to obtain multiple pre-rotated plaintext kernel coefficient vectors. The cloud computing platform performs optimized intra-group multiplication and summation calculations. For each convolution kernel group, the platform uses the rotation key to perform a specific rotation operation on the encrypted data according to the alignment offset required for each group of data, generating rotated ciphertext. The cloud computing platform reuses the rotated ciphertext by performing homomorphic multiplication and homomorphic addition operations on the rotated ciphertext and multiple pre-rotated plaintext kernel coefficient vectors in sequence to obtain intermediate ciphertext. The cloud computing platform performs optimized inter-group aggregation computation, aggregating all aligned intermediate ciphertexts through homomorphic addition to obtain the final output ciphertext of the convolution, and sends it to the data owner. The data owner receives the final output ciphertext sent by the cloud computing platform, decrypts the final output ciphertext using a private key, and obtains the convolution result.

7. A secure inference system based on homomorphic encryption optimization of a convolutional neural network, characterized in that, include: The encryption module performs the following steps: The data owner receives the public and private keys sent by the key management center and obtains the privacy data to be inferred; The data owner encodes the privacy data to be inferred using SIMD technology with a "row-first, channel-first" strategy to obtain a plaintext vector and packages it; The packaged plaintext vector is encrypted using the public key to generate an input data set containing multiple independent encrypted data; The data owner sends the data set containing the encrypted data to the cloud computing platform. The convolutional inference module specifically executes the following: The cloud computing platform receives encrypted data sent by the data owner, a rotation key sent by the key management center, and a plaintext convolutional kernel coefficient vector sent by the model parameter owner; the cloud computing platform pre-rotates the plaintext convolutional kernel coefficient vector to obtain multiple pre-rotated plaintext kernel coefficient vectors; the cloud computing platform performs optimized intra-group multiplication and summation calculations, and for each convolutional kernel group, performs a specific rotation operation on the encrypted data using the rotation key according to the alignment offset required for each group of data to generate rotated ciphertext; The cloud computing platform reuses the rotated ciphertext by performing homomorphic multiplication and homomorphic addition operations on the rotated ciphertext and multiple pre-rotated plaintext kernel coefficient vectors in sequence to obtain intermediate ciphertext. The cloud computing platform performs optimized inter-group aggregation computation, aggregating all aligned intermediate ciphertexts through homomorphic addition to obtain the final output ciphertext of the convolution, and sends it to the data owner. The decryption module works as follows: The data owner receives the final output ciphertext sent by the cloud computing platform, uses the private key to decrypt the final output ciphertext, and obtains the convolution result.

8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the secure inference method for convolutional neural networks based on homomorphic encryption optimization as described in any one of claims 1-6.

9. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium is used to store computer instructions, which, when executed by a processor, implement the secure inference method for convolutional neural networks based on homomorphic encryption optimization as described in any one of claims 1-6.

10. An electronic device, characterized in that, include: The device includes a processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory to enable the electronic device to implement the secure inference method based on homomorphic encryption optimization of convolutional neural networks as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Method and circuit for processing encrypted data and related product

    CN114168991A

  • Safe convolutional neural network based on homomorphic encryption and use method thereof

    CN116248251A