Safe two-party ReLU function implementation method, device, equipment, medium and product

By constructing a secure two-way matrix inner product protocol, efficient and secure computation of the ReLU function and its derivatives is achieved, solving the problems of high computational overhead, severe accuracy loss, and data leakage risk in existing technologies. It is suitable for application scenarios with high data privacy requirements, such as medical, financial, government, and industrial sectors.

CN121750198APending Publication Date: 2026-03-27BEIHANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-31
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

In existing privacy-preserving deep learning, the secure computation framework for the ReLU function suffers from high computational and communication overhead, significant accuracy loss, and the risk of data leakage due to reliance on third-party platforms, especially in scenarios with poor scalability.

Method used

A secure two-sided matrix inner product protocol is constructed using data obfuscation technology. Through the secure two-sided matrix DReLU and ReLU calculation protocol, the secure calculation of the ReLU function and its derivative is achieved, avoiding the introduction of keys and floating-point conversion, and performing operations directly on floating-point numbers, thus ensuring calculation accuracy and security.

Benefits of technology

It achieves efficient and secure ReLU function calculation, balancing computational accuracy and cost, avoiding the risk of data leakage from third-party platforms, and solving the scalability and communication efficiency problems of existing technologies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121750198A_ABST
    Figure CN121750198A_ABST
Patent Text Reader

Abstract

The invention discloses a secure two-party ReLU function implementation method and device, equipment, a medium and a product, and relates to the field of privacy protection deep learning, and the method comprises the steps: constructing a secure two-party matrix row inner product protocol based on a data obfuscation technology; the first participant node and the second participant node execute a secure two-square matrix DReLU calculation protocol based on a secure two-square matrix row inner product protocol; and the first participant node and the second participant node execute a secure two-party matrix ReLU calculation protocol based on the secure two-party matrix DReLU calculation protocol to obtain a calculation result. The method can consider the requirements of higher calculation precision and lower calculation cost, and can solve the problems of low communication efficiency, circuit confusion, poor expansibility of secret sharing and homomorphic encryption technologies, and high reliability caused by the fact that a secret sharing technology needs a large amount of information exchange. The existing homomorphic encryption technology has the problem that a third-party cloud platform is attacked, so that the risk of data leakage is easily caused.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of privacy protection deep learning, and in particular to a secure two-party ReLU function implementation method and device, equipment, medium and product. BACKGROUND

[0002] With the rapid development of big data technology, data plays an increasingly significant role in driving economic and social change and has become a key production factor in the new era. However, in the face of increasingly stringent data privacy protection requirements, how to achieve efficient utilization of data while ensuring that it is not leaked has become a core problem that needs to be solved. In this context, privacy computing, as an emerging data processing technology, has emerged as the times require and provides a feasible path for releasing data value while protecting data privacy. It realizes data participation in computing in an "invisible" state by integrating advanced encryption and security technologies such as secure multi-party computing, homomorphic encryption, and differential privacy, thus balancing data security and application needs. This feature makes privacy computing an important support for data compliance utilization and cross-subject collaboration, and it has quickly become a hot direction for academic research and industrial practice.

[0003] Privacy-preserving machine learning is currently a hot research topic in privacy computing technology and has important application significance in various fields of artificial intelligence applications. In privacy-preserving machine learning, the ReLU function, as a classic ReLU function, plays an important role in the training of models such as multi-layer perceptron and convolutional neural network and is a problem that must be solved in the development of privacy machine learning. Therefore, how to securely implement ReLU function calculation is an important research content. The following summarizes the existing related technical solutions: (1) The CrypTFlow framework uses a hybrid method of garbled circuits and secret sharing to support secure computation of ReLU and other nonlinear functions in deep neural networks. In the calculation of the ReLU function, CrypTFlow represents it as max(0, x), which requires a comparison operation to determine whether the input is greater than zero. The framework constructs a Boolean circuit and uses garbled circuit protocols to complete secure comparison and conditional selection, thereby obtaining the result of the ReLU function without revealing the input.

[0004] The CrypTFlow framework uses garbled circuit technology to implement secure two-party ReLU functions and other nonlinear operations. However, since garbled circuits need to convert the entire calculation process into a Boolean circuit, generating a garbled table will bring significant computational and storage overhead. At the same time, garbled circuits usually represent floating-point numbers in fixed-point number format, which introduces a certain degree of precision loss and affects the accuracy of the final calculation result.

[0005] (2) The Falcon framework is a secure multi-party computation system designed for efficient deep learning, primarily based on a two-party secret sharing scheme. In ReLU function computation, Falcon utilizes an efficient secret sharing comparison protocol to determine the input sign, and combines it with a conditional selection protocol to obtain the final ReLU function output. Specifically, the input is first split into shares held by the two participants, then a Boolean mask is generated by comparing whether the input is greater than zero, and finally the input is multiplied by the mask to achieve the effect of the ReLU function.

[0006] The Falcon framework employs a secret-sharing method to implement secure two-party ReLU functions and other operations. This method splits each participant's private input into multiple shares and distributes these shares to other participants, thus ensuring data privacy within a set of participants that does not exceed a security threshold. However, since each secret needs to be split and communicated, this means that frequent data interaction is required in actual computation, resulting in extremely high communication costs and potentially causing overall system latency.

[0007] (3) The CHET framework focuses on compiling and optimizing tensor programs in a homomorphic encryption environment. In the computation of the ReLU function, since it is nonlinear and contains discontinuous points, CHET employs a polynomial approximation strategy, such as using square root approximation or low-order Chebyshev polynomials. This allows the ReLU function to be expressed as a series of addition and multiplication operations, enabling direct execution within the homomorphically encrypted ciphertext space.

[0008] The CHET framework uses homomorphic encryption to perform nonlinear calculations such as ReLU functions after encrypting private inputs. Thanks to its encryption structure, computations can be performed directly on the ciphertext without decryption, thus protecting data privacy. However, due to the high computational complexity of the ciphertext, the framework requires significant computational and storage resources and faces a substantial communication burden. Furthermore, this method typically relies on third-party platforms for execution; if these platforms are compromised, user data is at risk of leakage.

[0009] Furthermore, regarding scalability, while the three frameworks mentioned above perform well in calculating secure two-party ReLU functions, they exhibit significant issues when scaling to multi-party scenarios. The obfuscated circuitry used in the CrypTFlow framework causes rapid circuit expansion as data size increases, leading to a surge in computational and communication overhead. The two-party secret-sharing scheme used in the Falcon framework requires extensive information exchange in multi-party computations, severely impacting communication efficiency. The homomorphic encryption technology used in the CHET framework, due to its complex encryption mechanism, introduces extremely high computational costs and communication overhead in complex multi-party computations. Summary of the Invention

[0010] To solve the above problems existing in the prior art, the application provides a secure two-party ReLU function implementation method, device, equipment, medium and product.

[0011] To achieve the above object, the application provides the following scheme: In a first aspect, the application provides a secure two-party ReLU function implementation method, comprising: constructing a secure two-party matrix row inner product protocol based on a data confusion technology; The first participant node and the second participant node execute a secure two-party matrix DReLU calculation protocol based on the secure two-party matrix row inner product protocol; The first participant node and the second participant node execute a secure two-party matrix ReLU calculation protocol based on the secure two-party matrix DReLU calculation protocol, and obtain a calculation result.

[0012] Optionally, the first participant node and the second participant node execute a secure two-party matrix DReLU calculation protocol based on the secure two-party matrix row inner product protocol, comprising: The first participant node and the second participant node jointly negotiate a positive integer, and split each element in the private data matrix held by the first participant node and the second participant node into a plurality of random positive numbers that are not equal to each other; Insert 1 between the random positive numbers obtained by the first participant node and the second participant node to form a first vector group and a second vector group; Form a first private matrix based on the first vector group and a second private matrix based on the second vector group; The first participant node secretly generates a random number locally, and determines first private data based on the generated random number and the first private matrix; The second participant node secretly generates a random number locally, and determines second private data based on the generated random number and the second private matrix; The first participant node and the second participant node execute a secure two-party matrix row inner product calculation protocol based on the first private data and the second private data, and obtain a first confusion split result and a second confusion split result; the first confusion split result serves as the private matrix of the first participant node; and the second confusion split result serves as the private matrix of the second participant node; Change the dimension of the private matrix of the first participant node and the dimension of the private matrix of the second participant node to obtain the first private matrix and the second private matrix; The first participant node determines a first output matrix based on the first private matrix and the second private matrix; The second participant node determines a second output matrix based on the first private matrix and the second private matrix; The computing requester determines an output result based on the first output matrix and the second output matrix.

[0013] Optionally, the output result is represented as: ; In the formula, is the output result, is the first output matrix, is the second output matrix, A is the private data matrix of the first participant node, and B is the private data matrix of the second participant node, ) is a DReLU function.

[0014] Optionally, the first participant node and the second participant node perform a secure two-party matrix ReLU computation protocol based on the secure two-party matrix DReLU computation protocol to obtain a computation result, including: The first participant node and the second participant node respectively perform secure two-party matrix DReLU computation based on the secure two-party matrix DReLU computation protocol to obtain a first result and a second result; The first participant node obtains a new first output matrix based on the first result and the private data matrix of the first participant node; The second participant node obtains a new second output matrix based on the second result and the private data matrix of the second participant node; The computing requester obtains the computation result based on the new first output matrix and the new second output matrix.

[0015] Optionally, the computation result is represented as: ; In the formula, is the computation result, is the new first output matrix, is the new second output matrix, A is the private data matrix of the first participant node, and B is the private data matrix of the second participant node, ) is a ReLU function.

[0016] Optionally, the execution process of the secure two-party matrix inner product protocol includes: The auxiliary computing node generates a first random matrix pair and a second random matrix pair; The first participant node obtains a new private data matrix based on the first random matrix pair and the private data matrix of the first participant node; A new private data matrix for the second participant node is obtained based on the second random matrix pair and the private data matrix of the second participant node. The second participating node generates a second obfuscated splitting result, and obtains a secret matrix based on the new private data matrix of the first participating node, the private data matrix of the second participating node, and the random matrix in the second random matrix pair. The first participating node obtains the first obfuscation splitting result based on the new private data matrix of the second participating node, the secret matrix, and the first random matrix.

[0017] Secondly, this application provides a secure two-party ReLU function implementation device, comprising: a first participating node, a second participating node, and a computation requesting party; The computation requester is used to send a computation request for calculating the ReLU function of a two-party matrix and the derivative of the ReLU function to the first participating node and the second participating node via the HTTP communication protocol or the GPRC communication protocol; the first participating node, the second participating node, and the computation requester perform data interaction processing to execute the secure two-party ReLU function implementation method as described in any one of claims 1-6 based on the computation request, and obtain the computation result.

[0018] Thirdly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described secure two-way ReLU function implementation method.

[0019] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described secure two-way ReLU function implementation method.

[0020] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described secure two-way ReLU function implementation method.

[0021] According to the specific embodiments provided in this application, this application has the following technical effects: This application provides a secure two-party ReLU function implementation method, apparatus, device, medium, and product. Based on data obfuscation technology, it constructs a secure two-party matrix inner product protocol. This protocol requires no key and inherently encrypts data using real-number field obfuscation, ensuring "one-time pad" security while achieving higher computational accuracy and lower computational cost. By executing a secure two-party matrix DReLU calculation protocol based on the aforementioned secure two-party matrix inner product protocol, and then executing a secure two-party matrix ReLU calculation protocol based on the same DReLU protocol, the final result can be obtained in parallel with only one round of calls to the secure two-party matrix inner product protocol. This solves the problem of low communication efficiency caused by the large amount of information exchange required by secret sharing technology. In implementation, simply replacing the secure two-party matrix inner product protocol with a secure multi-party matrix inner product protocol is sufficient to implement both the secure two-party matrix DReLU calculation protocol and the secure two-party matrix DReLU calculation protocol, thereby addressing the poor scalability issues of obfuscated circuits, secret sharing, and homomorphic encryption technologies. Furthermore, the execution of the secure two-party matrix inner product protocol, the secure two-party matrix DReLU calculation protocol, and the secure two-party matrix ReLU calculation protocol does not rely on a third-party cloud platform, which can solve the problem of data leakage risk caused by attacks on third-party cloud platforms in existing homomorphic encryption technologies. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 A flowchart illustrating a secure two-party ReLU function implementation method provided in an embodiment of this application; Figure 2 A schematic diagram illustrating a secure two-sided matrix DReLU computation problem provided in an embodiment of this application; Figure 3 This is a schematic diagram illustrating a secure two-sided matrix ReLU calculation problem provided in an embodiment of this application; Figure 4 A schematic diagram of a secure data obfuscation technique provided in an embodiment of this application; Figure 5 A schematic diagram illustrating a secure two-matrix row inner product calculation problem provided in an embodiment of this application; Figure 6 A flowchart of a secure two-party matrix row inner product calculation protocol provided in one embodiment of this application; Figure 7A flowchart of a secure two-way matrix DReLU calculation protocol provided in an embodiment of this application; Figure 8 A flowchart of a secure two-way matrix ReLU calculation protocol provided in an embodiment of this application; Figure 9 This is a schematic diagram of a secure two-party ReLU function implementation device for distributed computing nodes provided in an embodiment of this application; Figure 10 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0024] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0025] In practical privacy-preserving deep learning applications, the nonlinear activation function ReLU plays a crucial role in the expressive power of neural networks. However, in scenarios involving multi-party collaborative modeling, the participating parties often possess sensitive and non-shareable data, posing significant security challenges to the traditional ReLU function and its derivative calculation. For example, in medical image classification tasks, different hospitals possess image features and diagnostic labels for some patients. To improve model accuracy, both parties wish to jointly train a neural network model for disease prediction. During training, ReLU activation of intermediate neurons is required, and the derivative is calculated for backpropagation; during inference, ReLU operations are also performed to complete forward prediction. However, ReLU calculation involves comparing whether the input is greater than 0, which, without protection, can easily lead to data privacy leaks.

[0026] This application proposes a secure two-party ReLU function implementation method, apparatus, device, medium, and product, allowing two data holders to collaboratively calculate ReLU and its derivatives without disclosing the original input and intermediate calculation results. This method considers both forward inference and backward propagation stages, and uses a security protocol to obfuscate the input, achieving privacy protection for activation computation throughout the entire neural network training and inference process.

[0027] The secure two-party ReLU function implementation method, apparatus, device, medium, and product provided in this application are applicable to application scenarios with high data privacy requirements, such as medical, financial, government, and industrial fields. They are particularly valuable in tasks requiring deep learning modeling without exposing raw privacy data, such as intelligent medical image analysis, user behavior prediction, financial fraud detection, and industrial defect detection. The secure two-party ReLU function implementation method, apparatus, device, medium, and product provided in this application can effectively guarantee the nonlinearity of the model while meeting data security requirements during joint computation.

[0028] To make the objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0029] In one exemplary embodiment, this application provides a secure two-party ReLU function implementation method. This method is executed by a computer device, specifically by a terminal or server alone, or by both the terminal and server. In this embodiment, the method is described using a server as an example. Figure 1 As shown, the method includes: Step 100: Construct a secure two-party matrix inner product protocol based on data obfuscation technology.

[0030] Step 101: The first participating node and the second participating node execute the secure two-party matrix DReLU calculation protocol based on the secure two-party matrix inner product protocol.

[0031] Step 102: The first participating node and the second participating node execute the secure two-party matrix ReLU calculation protocol based on the secure two-party matrix DReLU calculation protocol to obtain the calculation result.

[0032] By implementing steps 100-102 above, this application mainly focuses on the problem of secure two-party ReLU function calculation, and achieves efficient, secure and reliable privacy-preserving ReLU function calculation.

[0033] In another exemplary embodiment of this application, the method provided employs a semi-honest model (Semi-Honest Adversaries Security) and privacy-preserving computation technology during execution. The semi-honest model is a specific protocol that assumes all participating parties will honestly participate in privacy-preserving computation, strictly adhering to each step of the process. However, some corrupted parties may attempt to infer the privacy of other parties through intermediate or final results during protocol execution. Privacy-preserving computation technology specifically refers to a series of information security technologies that, without exposing the privacy of any party's private data, break down data silos, facilitate collaborative multi-party computation, and ultimately achieve complex computation and modeling analysis of multi-source data, ensuring that data elements are "usable but not visible" during the circulation and integration process.

[0034] In another exemplary embodiment of this application, the Secure Two-Party Row Inner Product (S2PRIP) protocol constructed in step 100 above, as the name suggests, assumes two mutually distrustful parties, P1 and P2, each holding a secret input matrix. x , y To jointly implement a two-party intra-line product agreement Ultimately, each participant receives the corresponding output. And the output satisfies Throughout the computation process, each participating node only knows the input and output data related to its own computation flow and cannot obtain any intermediate computation results from other participants.

[0035] In another exemplary embodiment of this application, the Secure 2-Party Derivative ReLU Function (S2PDRL) computation protocol involved in step 101, as the name suggests, assumes two mutually distrustful parties, P1 and P2, each holding a secret input matrix. x , y To jointly execute a two-party DReLU protocol Ultimately, each participant receives the corresponding output. And the output satisfies Throughout the computation process, each participating node only knows the input and output data relevant to its own computation flow and cannot obtain any intermediate computation results from other participants. drelu () represents the DReLU function.

[0036] It is known that there are two computation parties, namely the first participant. Second Participant These two computational parties are independent of each other and do not trust each other; the first participant... Holding a dimension as Private data matrix stored only on its own computing node Second Participant Also holding a dimension as Private data matrix stored only on its own computing node The two computational parties hope to achieve this by jointly implementing a secure matrix DReLU protocol. Ultimately, each computation node obtains its corresponding output matrix. The system sends the input and output information to the requesting party to obtain the desired two-party matrix DReLU calculation result. During the calculation process, each participating node can only know its own input and output information and cannot obtain the intermediate settlement results or held data information of other participants. Based on this, the problem form of the secure two-party matrix DReLU function calculation protocol is described as follows: Figure 2 As shown. In this application, the DReLU function operation is performed on the elements corresponding to the input matrix of the DReLU function. The DReLU function is... ,For example ,but . x This indicates the input data.

[0037] In another exemplary embodiment of this application, the secure two-party matrix ReLU function computation protocol involved in step 102, as the name suggests, assumes two mutually distrustful parties, P1 and P2, each holding a secret input matrix. x , y To jointly execute a two-party ReLU protocol Ultimately, each participant receives the corresponding output. And the output satisfies Throughout the computation process, each participating node only knows the input and output data relevant to its own computation flow and cannot obtain any intermediate computation results from other participants. relu () represents the ReLU function.

[0038] It is known that there are two computation parties, the first participating node Second Participant Node They are independent and distrustful of each other, the first participating node Holding a dimension as And it is a private data matrix stored only on its own computing node. Similarly, the second participating node Holding a dimension as Private data matrix The two parties hope to achieve this by jointly implementing a safety matrix ReLU protocol. Ultimately, each participating node in the computation obtains its corresponding output matrix. The data is then sent to the requesting party to aggregate and obtain the desired ReLU calculation result for the two-party matrix. During the calculation process, each participating node can only know its own input and output information and cannot obtain the intermediate settlement results or held data information of other participants. Based on this, the problem form of the secure two-party matrix ReLU function calculation protocol is described as follows: Figure 3 As shown. In this application, the ReLU function operation is performed on the elements corresponding to the input matrix of the ReLU function. The ReLU function is... .For example ,but .

[0039] In another exemplary embodiment of this application, for most multi-party computations, the process of implementing secure computation typically involves multiple interactions. An unavoidable problem arises: how to ensure the security of intermediate results. For example, multiplying two matrices... When used as an intermediate result in the calculation, the first participant node is utilized. Or a second participating node The final matrix obtained The results could potentially lead to the deduction of data from the other party. Therefore, privacy-preserving computation must ensure not only the security of the initial input data but also the security of the intermediate results.

[0040] Secure Data Disguising Technology (SDDT) is a data protection method used to protect intermediate results of secure multi-party computations. By constructing a reasonable computation protocol, the computation result is randomly split, allowing the outputs from multiple parties to combine linearly to form the true target computation result, ultimately achieving one-time pad data privacy protection. Based on this, to ensure the security of intermediate computation results, this application proposes a secure data obfuscation encryption technology. This technology decomposes any multi-way operation into a new multi-way addition to obfuscate the result of intermediate computation values. The principle is illustrated using a two-way operation as an example. Figure 4 As shown. Assume ,in It is the first The objective function of the step is to compute the following. It belongs to the first participating node. No. Step's private data, It belongs to the second participating node. No. Private data in the first step. In the execution of the multi-party secure computation protocol... intermediate results during the step The following constraints will be strictly followed: First Participating Node Only know the results of your own calculations Second Participant Node Only the result is known ,and . formula This illustrates the process of passing intermediate values. Throughout this process, the first participating node... Second Participant Node The exchange of data between them is not permitted, including private data obtained after splitting intermediate computation results. and Similarly, for the first... Step, its private data and By the The first participating node of the step Second Participant Node Output private data and Transmission constitutes, and and Its output and satisfy First participating node Only know the results of your own calculations Second Participant Node Only the result is known Therefore, as long as the intermediate value is split into two random data items and stored separately on the two computational participant nodes at each step of the computation, it can be guaranteed that no party can deduce the original data item from this obfuscated and encrypted data, thus making the entire privacy computation process highly secure.

[0041] In another exemplary embodiment of this application, the problem with the secure two-way matrix inner product protocol constructed in step 100 is defined as follows: It is known that there are two computation parties, the first participating node Second Participant Node They are independent and distrustful of each other, the first participating node Holding a dimension as And it is a private data matrix stored only on its own computing node. Similarly, the second participating node Holding a dimension as Private data matrix The two parties hope to achieve this by jointly implementing a secure matrix inner product protocol. Ultimately, each participating node in the computation receives its corresponding dimension. The output matrix The results are then sent to the requesting party to aggregate and obtain the desired row inner product of the two matrices. During the calculation process, each participating node can only know its own input and output information and cannot obtain the intermediate settlement results or held data information of other participants. Based on this, this problem is formally described as follows: Figure 5 As shown. Figure 5 middle, The row inner product operation represents the matrix inner product. When performing a row inner product operation on two matrices A and B of the same dimension, it means performing an inner product operation on their corresponding row vectors. For example... ,but .

[0042] like Figure 6 As shown, the execution flow of the secure two-party matrix inner product protocol includes: Step 1: Auxiliary computing nodes (also known as product service nodes) Generate two sets of random matrix pairs: a first random matrix pair and a second random matrix pair. The two sets of random matrix pairs include elements of dimension [missing information]. random matrix Dimensions random matrix and dimensions Two random matrices .

[0043] Step 2: Obtain a new private data matrix for the first participating node based on the first random matrix pair and the private data matrix of the first participating node.

[0044] In practical applications, the first participating node Upon receiving the corresponding random matrix pair After (i.e., the first random matrix pair), a new private data matrix is ​​calculated within its nodes. And send it to the second participating node. .

[0045] Step 3: Obtain a new private data matrix for the second participating node based on the second random matrix pair and the private data matrix of the second participating node.

[0046] In practical applications, the second participating node Upon receiving the corresponding random matrix pair After (i.e., the second random matrix pair), a new private data matrix is ​​calculated within its nodes. and send it to the first participating node. .

[0047] Step 4: The second participating node generates the second obfuscated splitting result, and obtains the secret matrix based on the new private data matrix of the first participating node, the private data matrix of the second participating node, and the random matrix in the second random matrix pair.

[0048] In practical applications, the second participating node Received from the first participating node Sending a new private data matrix Then, a random matrix is ​​secretly generated internally. (i.e., the second obfuscated splitting result), and secretly compute the private data matrix locally. Send to the first participating node .

[0049] Step 5: The first participating node obtains the first obfuscated splitting result based on the new private data matrix, secret matrix and first random matrix of the second participating node.

[0050] In practical applications, the first participating node Received private data matrix Subsequently, the first obfuscated splitting result is obtained through local secret computation. . Based on the above description, the first participating node Second participating node The corresponding final obfuscated split results are respectively , The matrix multiplication is sent to the two-party matrix multiplication requester (referred to as the calculation requester), who then summarizes the results to obtain the final row product. Based on this, it can be verified that: .

[0051] In another exemplary embodiment of this application, based on the formal description of the problems of the protocols defined above, during the execution of the protocol for calculating the ReLU function and its derivative of a secure two-sided matrix, the problem of calculating the secure two-sided ReLU function and its derivative often appears in the implementation of privacy neural networks, such as privacy multilayer perceptrons, privacy neural networks, etc., and has important research value. Therefore, without loss of generality, let the first participating node in this protocol... Private data matrix Second participating node The initial input is a private data matrix. Based on this, this application proposes an efficient parallelization and safe ReLU protocol for two-sided matrices and its derivative calculation. Based on this, as... Figure 7 As shown, the process of executing the secure two-way matrix DReLU calculation protocol in step 101 includes: Step 1: First Participant Node Second Participant Node To jointly agree on a positive integer And each element in their respective private data matrix is ​​split into A set of distinct, random positive numbers.

[0052] Step 2: In the first participating node Second Participant Node Inserting 1s between the randomly positive numbers obtained from the splitting process forms the first vector group and the second vector group. The first participating node... Will (Represents a private data matrix) No. Line 1 The elements of the column are split into a single column. A private vector of dimension is represented as or ,satisfy This yields the first vector set. Similarly, the second participating node... Will (Represents a private data matrix) No. Line 1 The elements of the column are split into a single column. A private vector of dimension, represented as or ,satisfy , so as to obtain the second vector group.

[0053] Step 3: Form a first private matrix based on the first vector group, and form a second private matrix based on the second vector group. Wherein, the first participating node... The first vector group { The private matrix is ​​constructed by sequentially assigning each element to a row from top to bottom. (i.e., the first private matrix). Second participating node. The second vector group { The private matrix is ​​constructed by sequentially assigning each element to a row from top to bottom. (i.e., the second private matrix).

[0054] Step 4: First Participant Node A random number is secretly generated locally, and the first private data is determined based on this generated random number and the first private matrix. The generated random number is a large number, denoted as . . For the mutual consultation of both parties to reach an agreement A random prime number between [a certain range] As the first participating node In the interval A randomly selected positive number, followed by the first participating node. Calculate the first private data locally. .

[0055] Step 5: Second Participant Node A random number is secretly generated locally, and the second private data is determined based on this generated random number and the second private matrix. (Second participating node) A large number is secretly generated locally. ,in, As the second participating node In the interval A randomly selected positive number, followed by the second participating node. Calculate the second private data locally. .

[0056] Step 6: First Participant Node Second Participant Node Based on the first and second private data, the secure two-party matrix row inner product calculation protocol described above is executed to obtain a first obfuscation splitting result and a second obfuscation splitting result. The first obfuscation splitting result serves as the private matrix of the first participating node. The second obfuscation splitting result serves as the private matrix of the second participating node. Wherein, the first participating node... Second Participant Node Enter their respective private data and Perform a round of safe two-sided matrix inner product calculation After the secure two-party matrix row inner product calculation protocol is completed, the calculation result for this round is... Split into The two slices (i.e., the first obfuscated split result and the second obfuscated split result) are sent to the first participating node respectively. Second Participant Node , to be the corresponding private output, and the two private output matrices satisfy the relation .

[0057] Step 7: Change the first participating node The dimensions of the private matrix and the second participating node The dimensions of the private matrix are used to obtain the first private matrix and the second private matrix. Among them, the first participating node... Second Participant Node After obtaining their respective private matrices, each entity locally modifies the dimensions of its private matrices to... The first private matrix is ​​obtained respectively. Second private matrix . The function represents the matrix Change to shape The matrix.

[0058] Step 8: First Participant Node The first output matrix is ​​determined based on the first private matrix and the second private matrix.

[0059] Step 9: Second Participant Node The second output matrix is ​​determined based on the first and second private matrices. Among them, the first participating node... The first private matrix Send to the second participating node Second participating node The second private matrix Send to the first participating node Then both parties calculated the results separately: .

[0060] Step 10: Calculate the output result determined by the requester based on the first and second output matrices. The two participating nodes will then use the first output matrix... Second output matrix The result is sent to the computation requester, who then receives the output. .

[0061] In another exemplary embodiment of this application, such as Figure 8 As shown, the execution flow of the secure two-sided matrix ReLU calculation protocol includes: Step 1: The first participating node and the second participating node perform secure two-party matrix DReLU calculations based on the secure two-party matrix DReLU calculation protocol, respectively, to obtain the first result and the second result. Wherein, the first participating node... Second Participant Node Based on the secure two-party matrix DReLU calculation protocol provided above, each inputs its own private data matrix. and Perform a round of secure two-sided matrix DReLU calculation to obtain the results. First participating node First result obtained Second participating node The second result was obtained. .

[0062] This step involves online calculation.

[0063] Step 2: First Participant Node Based on the first result and the first participating node The private data matrix is ​​used to obtain a new first output matrix.

[0064] Step 3: Second Participant Node Based on the second result and the second participating node The private data matrix is ​​used to obtain a new second output matrix.

[0065] Step 4: The requester calculates the result based on the new first output matrix and the new second output matrix.

[0066] The actual implementation process of steps 2-4 can be described as follows: First participating node Second Participant Node Calculate the new output matrix locally. and The two parties will then present the new first output matrix. and the new second output matrix The results are sent to the computation requester, who then aggregates them to obtain the computational results. Therefore, steps 2-4 are performed offline.

[0067] Based on the above description, it can be proven that: . The Hadamard product operation represents the multiplication of matrices. For two matrices A and B of the same dimension, performing the Hadamard product involves multiplying their corresponding elements (i.e., element-wise matrix multiplication). For example... ,but .

[0068] In summary, compared with the prior art, this application has the following advantages: 1. Existing solutions to the problem of secure two-party ReLU function calculation mostly employ computational frameworks based on traditional cryptographic primitives such as homomorphic encryption, secret sharing, and obfuscated circuits. These methods rely on ciphertext space computation with extremely high time and space complexity, leading to low practicality and inefficiency. This application utilizes a secure two-party matrix inner product protocol based on secure data obfuscation technology for calculation, transforming the calculation of the ReLU function and its derivative into a matrix inner product for accurate computation. Since the protocol does not require any key and is based on the real-number field obfuscation encryption of data, it ensures "one-time pad" security while also achieving higher computational accuracy and lower computational cost. Furthermore, by decomposing the ReLU function and its derivative and converting them into a secure two-party matrix inner product protocol operation, it ensures that only one round of computation is needed. The final result can be obtained through parallel computation, solving the problem of low communication efficiency caused by the need for large-scale information exchange in secret sharing technologies. Furthermore, the computation process in this application is based on the real number field, which ensures minimal loss of computational precision in floating-point operations, and the computational complexity is only [amount missing]. Compared to homomorphic encryption, which has higher computational complexity, this method improves computational efficiency.

[0069] Furthermore, the method used in this application avoids the public key encryption and decryption operations in homomorphic encryption schemes, and avoids the operations required to convert floating-point numbers to fixed-point numbers in schemes such as secret sharing and obfuscated circuits. It can be achieved simply through some floating-point operations, which is more efficient and therefore more practical.

[0070] 2. Existing solutions to the problem of secure two-party ReLU function calculation either employ large prime number encryption, which increases the number of bits in the ciphertext or introduces differential noise, causing loss of precision in model training parameters and directly leading to insufficient numerical calculation accuracy, affecting the reliability of the calculation results. The secure two-party matrix DReLU calculation protocol proposed in this application guarantees the accuracy of the calculation by converting the DReLU function into a matrix inner product. Furthermore, the secure two-party matrix ReLU calculation protocol provided in this application also guarantees the accuracy of the function calculation results by converting the ReLU function into matrix DReLU operations and a local Hadamard product operation. Moreover, this application is based on a secure two-party matrix inner product protocol; simply replacing this sub-protocol with a secure multi-party matrix inner product protocol is sufficient to implement both the secure multi-party matrix DReLU protocol and the ReLU protocol, solving the problems of obfuscated circuits, secret sharing, and poor scalability of homomorphic encryption techniques. Furthermore, because this application performs operations directly on floating-point numbers, its accuracy (calculation precision) is almost equivalent to plaintext operations, thus exhibiting high reliability.

[0071] 3. Existing applications involving secure two-party ReLU function computation solutions largely rely on outsourced cloud service systems. However, the reliability of third-party cloud service computing platforms is often low, or they may be attacked by malicious nodes, potentially leading to the leakage of intermediate computation results or critical key information, further posing a security risk of privacy breaches to the original data provider. The secure two-party matrix DReLU protocol and ReLU protocol proposed in this application do not rely on third-party cloud platforms and can solve the risk of data leakage caused by attacks on third-party cloud platforms, which is inherent to homomorphic encryption technologies.

[0072] Based on the same inventive concept, this application also provides a secure two-party ReLU function implementation apparatus for implementing the secure two-party ReLU function implementation method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more secure two-party ReLU function implementation apparatus embodiments provided below can be found in the limitations of the secure two-party ReLU function implementation method described above, and will not be repeated here.

[0073] In one exemplary embodiment, a secure two-party ReLU function implementation apparatus is provided, comprising: a first participating node (i.e., Figure 9 Participant node 1), second participant node (i.e. Figure 9 The participating node 2) and the computation requester.

[0074] The computation requester sends a computation request for calculating the ReLU function and its derivative to the first and second participating nodes via HTTP or GPRS communication protocols. The first participating node, the second participating node, and the computation requester interact to execute a secure two-party ReLU function implementation method as described in any one of claims 1-6 based on the computation request, thereby obtaining the computation result.

[0075] As an optional implementation, the client is treated as the computation requester. For example... Figure 9As shown, a corresponding distributed computing framework is deployed on multiple participating nodes (i.e., the first and second participating nodes) involved in the calculation of the ReLU and its derivative of the two-party secure matrix. This framework consists of five modules: a task acquisition module, a secure computing module, a rule generation module, a consensus computing module, and a data transmission module. The task acquisition module receives and decodes privacy-preserving computing requests from clients. The secure computing module automatically matches the corresponding secure computing protocol based on the parsed computing request. The rule generation module decomposes the computing task according to the asynchronous instruction set of the secure computing protocol, and different computing nodes perform collaborative computing according to their respective sub-rules. After receiving the assigned sub-rules, the consensus computing module ensures the synchronization and consistency of the computation results through a consensus protocol. After the computation is completed, the data transmission module collects the computation results from each participating node and transmits them to the computing requester.

[0076] The implementation process is as follows: An external client sends a computation request for ReLU and its derivative calculations of a two-party matrix to a network endpoint deployed with distributed computing services via HTTP or gRPC communication protocols. Upon receiving the request, the task acquisition module of each participating node parses it and initiates a secure computation service process across multiple participating nodes. Once the task acquisition module has parsed the computational requirements, it passes the request to the secure computation module. The secure computation module performs a joint query through its internal interface, matches the corresponding secure computation protocol, and synchronizes it to the rule generation module in both participating nodes. The rule generation module formulates different asynchronous parallel execution flows based on the different sub-tasks undertaken by the two participating nodes, maintaining communication with the consensus computation module at each step. While the two participating nodes execute each computation instruction, the consensus computation module broadcasts and maintains the consistency of the results from the distributed computing nodes on the chain and controls the stability of the execution flow. After the final computation protocol is executed, the two participating nodes obtain each other's computational sub-results and send the obfuscated and split sub-results to the computation requester via the data sending module to obtain the correct computational result.

[0077] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 10As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data for implementing a safe two-party ReLU function. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When executed by the processor, the computer program implements a safe two-party ReLU function implementation method.

[0078] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0079] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0080] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0081] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0082] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0083] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (RRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).

[0084] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0085] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0086] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for implementing a safe two-sided ReLU function, characterized in that, include: A secure two-party matrix inner product protocol is constructed based on data obfuscation technology. The first participating node and the second participating node execute the secure two-party matrix DReLU calculation protocol based on the secure two-party matrix inner product protocol; The first participating node and the second participating node execute the secure two-party matrix ReLU calculation protocol based on the secure two-party matrix DReLU calculation protocol to obtain the calculation result.

2. The method for implementing a secure two-party ReLU function according to claim 1, characterized in that, The first and second participating nodes, based on the secure two-party matrix inner product protocol, execute the secure two-party matrix DReLU calculation protocol, including: The first participating node and the second participating node jointly negotiate a positive integer, and split each element in the private data matrix held by the first participating node and the second participating node into multiple unequal random positive numbers; Insert 1 between the random positive numbers obtained by splitting the first participant node and the second participant node to form the first vector group and the second vector group; A first private matrix is ​​formed based on the first vector group, and a second private matrix is ​​formed based on the second vector group. The first participating node secretly generates a random number locally, and determines the first private data based on the generated random number and the first private matrix; The second participating node secretly generates a random number locally, and determines the second private data based on the generated random number and the second private matrix; Based on the first private data and the second private data, the first participating node and the second participating node execute a secure two-party matrix row inner product calculation protocol to obtain a first obfuscation splitting result and a second obfuscation splitting result; the first obfuscation splitting result is used as the private matrix of the first participating node; the second obfuscation splitting result is used as the private matrix of the second participating node; By changing the dimensions of the private matrix of the first participating node and the private matrix of the second participating node, we obtain the first private matrix and the second private matrix. The first participating node determines the first output matrix based on the first private matrix and the second private matrix; The second participating node determines the second output matrix based on the first private matrix and the second private matrix; The requester determines the output result based on the first output matrix and the second output matrix.

3. The method for implementing a secure two-party ReLU function according to claim 2, characterized in that, The output result is expressed as follows: ; In the formula, For the output results, This is the first output matrix. Let A be the second output matrix, and B be the private data matrix of the first participating node. ) is the DReLU function.

4. The method for implementing a secure two-party ReLU function according to claim 2, characterized in that, The first and second participating nodes, based on the secure two-party matrix DReLU calculation protocol, execute the secure two-party matrix ReLU calculation protocol to obtain the calculation results, including: The first participating node and the second participating node perform secure two-party matrix DReLU calculations based on the secure two-party matrix DReLU calculation protocol to obtain the first result and the second result, respectively. The first participating node obtains a new first output matrix based on the first result and the private data matrix of the first participating node; The second participating node obtains a new second output matrix based on the second result and the private data matrix of the second participating node; The requester obtains the calculation result based on the new first output matrix and the new second output matrix.

5. The method for implementing a secure two-party ReLU function according to claim 4, characterized in that, The calculation result is expressed as follows: ; In the formula, For the calculation results, For the new first output matrix, Let A be the private data matrix of the first participating node, and B be the private data matrix of the second participating node. ) is the ReLU function.

6. The method for implementing a secure two-party ReLU function according to claim 2, characterized in that, The execution flow of the secure two-party matrix inner product protocol includes: The first random matrix pair and the second random matrix pair are generated by the auxiliary computing node; A new private data matrix of the first participant node is obtained based on the first random matrix pair and the private data matrix of the first participant node. A new private data matrix for the second participant node is obtained based on the second random matrix pair and the private data matrix of the second participant node. The second participating node generates a second obfuscated splitting result, and obtains a secret matrix based on the new private data matrix of the first participating node, the private data matrix of the second participating node, and the random matrix in the second random matrix pair. The first participating node obtains the first obfuscation splitting result based on the new private data matrix of the second participating node, the secret matrix, and the first random matrix.

7. A safe two-sided ReLU function implementation device, characterized in that, include: First participating node, second participating node, and computation requester; The computation requester is used to send a computation request for calculating the ReLU function of the two matrices and the derivative of the ReLU function to the first participating node and the second participating node via the HTTP communication protocol or the GPRC communication protocol. The first participating node, the second participating node, and the computation requesting party perform data interaction processing to execute the secure two-party ReLU function implementation method as described in any one of claims 1-6 based on the computation request, and obtain the computation result.

8. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that the processor executes the computer program to implement the secure two-way ReLU function implementation method according to any one of claims 1-6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the secure two-way ReLU function implementation method as described in any one of claims 1-6.

10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the secure two-way ReLU function implementation method as described in any one of claims 1-6.