Max pooling method and apparatus for protecting privacy data

By splitting max pooling into row-based or column-based comparison and selection operations, the problem of high communication overhead in existing technologies is solved, achieving efficient privacy data protection and improved computational efficiency.

CN116738464BActive Publication Date: 2026-07-28ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
Filing Date
2023-06-26
Publication Date
2026-07-28

AI Technical Summary

Technical Problem

In existing technologies, secure computation based on secret sharing is inefficient when performing max pooling calculations. In particular, pooling methods for neural network models in machine learning involve a large number of nonlinear comparison operations, resulting in high communication overhead and making it difficult to implement efficiently.

Method used

By splitting the max pooling process into two parts, first performing row-by-row or column-by-column comparison operations, and then selecting the maximum value based on the comparison results, the comparison and selection operations are performed secretly and jointly by multiple parties, reducing redundant calculations.

Benefits of technology

It reduces communication overhead, improves overall computing efficiency, and achieves efficient maximum pooling processing while protecting privacy data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116738464B_ABST
    Figure CN116738464B_ABST
Patent Text Reader

Abstract

The embodiment of the specification provides a maximum pooling processing method and device for protecting privacy data. The method comprises the following steps: based on a local slice of an input matrix, a local slice of a first comparison matrix is determined by multiple parties, which indicates a comparison result of horizontally adjacent elements in the input matrix; based on the local slice of the first comparison matrix, a local slice of an intermediate result matrix is determined by multiple parties, an element of the intermediate result matrix being a larger value of horizontally adjacent elements in the input matrix; based on the local slice of the intermediate result matrix, a local slice of a second comparison matrix is determined by multiple parties, which is used for indicating a comparison result of vertically adjacent elements in the intermediate result matrix; and based on the local slice of the second comparison matrix, a local slice of a pooling result matrix is determined by multiple parties, an element of the pooling result matrix being a larger value of vertically adjacent elements in the intermediate result matrix. The communication overhead can be reduced, and the overall calculation efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to one or more embodiments in the field of computers, and more particularly to a maximum pooling processing method and apparatus for protecting privacy data. Background Technology

[0002] Currently, data held by different data holders may contain users' private information, and data sharing between data holders may infringe on users' privacy. In order to facilitate the flow of data among multiple parties, secure multi-party computation can be used to support joint computation among multiple parties, extract the value of data, and ensure that plaintext information of each party's private data is not leaked during multi-party interactions.

[0003] Secure multi-party computation enables multiple untrusted parties to securely compute a given function without revealing the inputs or intermediate results other than the final outcome. Secret sharing is a method of distributing a secret among different parties, each receiving a portion of the secret, called a shard. The secret can only be recovered by possessing a sufficient number of shards; a single shard cannot. Due to its high efficiency in arithmetic and linear algebra operations, secret sharing is widely used for secure computation in various scenarios, such as secure training and prediction of machine learning models.

[0004] While existing secure computation based on secret sharing offers robust security, it incurs significant communication overhead, leading to low efficiency in joint computation. Furthermore, secure computation based on secret sharing struggles to efficiently implement max pooling, a common pooling method in neural network models for machine learning, which involves numerous non-linear comparison operations and is therefore inefficient. Thus, there is a need for a max pooling method that protects privacy-preserving data, reduces communication overhead, and improves overall computational efficiency. Summary of the Invention

[0005] This specification describes one or more embodiments of a maximum pooling processing method and apparatus for protecting privacy data, which can reduce communication overhead and improve overall computing efficiency.

[0006] Firstly, a maximum pooling processing method for protecting privacy-preserving data is provided, wherein the input matrix is ​​distributed among multiple parties in a secret-sharing manner, and the method is executed by any one of the multiple parties, including:

[0007] Based on the local segment of the input matrix, the local segment of the first comparison matrix is ​​determined by using a first comparison operation performed jointly by multiple parties. The elements of the first comparison matrix are used to indicate the results of the comparison of horizontally adjacent elements in the input matrix.

[0008] Based on the local segment of the first comparison matrix, the local segment of the intermediate result matrix is ​​determined by using the first selection operation performed by multiple parties. The elements of the intermediate result matrix are the larger values ​​among the horizontally adjacent elements in the input matrix.

[0009] Based on the local segment of the intermediate result matrix, the local segment of the second comparison matrix is ​​determined by using a second comparison operation performed jointly by multiple parties. The elements of the second comparison matrix are used to indicate the results of the comparison of vertically adjacent elements in the intermediate result matrix.

[0010] Based on the local partition of the second comparison matrix, the local partition of the pooling result matrix is ​​determined by using the second selection operation performed jointly by multiple parties. The elements of the pooling result matrix are the larger values ​​among the vertically adjacent elements in the intermediate result matrix.

[0011] In one possible implementation, the input matrix has a dimension of W rows and H columns, and determining the local slice of the first comparison matrix includes:

[0012] For the local slice of the input matrix, the first H-1 columns are taken as the local slice of the left slice matrix, and the last H-1 columns are taken as the local slice of the right slice matrix.

[0013] The left slice matrix and the right slice matrix are compared bit by bit using a first comparison operation performed jointly by multiple parties to obtain the local slice of the first comparison matrix.

[0014] Furthermore, the first selection operation is used to select an element at a corresponding position in the left slice matrix or the right slice matrix as an element at a corresponding position in the intermediate result matrix based on whether the value of an element in the first comparison matrix is ​​a predetermined value.

[0015] In one possible implementation, the intermediate result matrix has W rows; determining the local slice of the second comparison matrix includes:

[0016] For the local slice of the intermediate result matrix, the first W-1 rows are taken as the local slice of the upper slice matrix, and the last W-1 rows are taken as the local slice of the lower slice matrix.

[0017] The upper slice matrix and the lower slice matrix are compared bit by bit using a second comparison operation performed jointly by multiple parties to obtain the local slice of the second comparison matrix.

[0018] Furthermore, the second selection operation is used to select an element at a corresponding position in the upper slice matrix or the lower slice matrix as an element at a corresponding position in the pooling result matrix based on whether the value of an element in the second comparison matrix is ​​a predetermined value.

[0019] In one possible implementation, the method further includes:

[0020] Based on the local segment of the first comparison matrix, the local segment of the intermediate index matrix is ​​determined by using a third selection operation performed jointly by multiple parties. The elements of the intermediate index matrix are two-dimensional indices of the corresponding elements in the intermediate result matrix.

[0021] Furthermore, the third selection operation is used to select one of two pre-constructed candidate two-dimensional indices as the element at the corresponding position of the intermediate index matrix based on whether the value of the element in the first comparison matrix is ​​a predetermined value.

[0022] Furthermore, the intermediate index matrix has W rows; the method further includes:

[0023] For the local partition of the intermediate index matrix, the first W-1 rows are taken as the local partition of the upper index matrix, and the last W-1 rows are taken as the local partition of the lower index matrix.

[0024] Based on the local sharding of the second comparison matrix, the fourth selection operation performed by multiple parties is used to select elements in the upper or lower index matrix as elements in the corresponding positions of the pooling index matrix according to whether the value of the element in the second comparison matrix is ​​a predetermined value, thereby obtaining the local sharding of the pooling index matrix.

[0025] Furthermore, prior to the fourth selection operation performed using multi-party collaboration, the method further includes:

[0026] To obtain four-dimensional elements, add two zeros to the end of the elements in the upper index matrix, and add two zeros to the beginning of the elements in the lower index matrix.

[0027] Secondly, a maximum pooling processing method for protecting privacy-preserving data is provided, wherein the input matrix is ​​distributed among multiple parties in a secret-sharing manner, and the method is executed by any one of the multiple parties, including:

[0028] Based on the local segment of the input matrix, the local segment of the first comparison matrix is ​​determined by using a first comparison operation performed jointly by multiple parties. The elements of the first comparison matrix are used to indicate the results of the comparison of vertically adjacent elements in the input matrix.

[0029] Based on the local segment of the first comparison matrix, the local segment of the intermediate result matrix is ​​determined by using the first selection operation performed by multiple parties. The elements of the intermediate result matrix are the larger values ​​among the vertically adjacent elements in the input matrix.

[0030] Based on the local segment of the intermediate result matrix, the local segment of the second comparison matrix is ​​determined by using a second comparison operation performed jointly by multiple parties. The elements of the second comparison matrix are used to indicate the results of the comparison of horizontally adjacent elements in the intermediate result matrix.

[0031] Based on the local partition of the second comparison matrix, the local partition of the pooling result matrix is ​​determined by using the second selection operation performed jointly by multiple parties. The elements of the pooling result matrix are the larger values ​​among the horizontally adjacent elements in the intermediate result matrix.

[0032] Thirdly, a maximum pooling processing apparatus for protecting privacy data is provided, wherein the input matrix is ​​distributed among multiple parties in a secret-shared manner, and the apparatus is located at any one of the multiple parties, comprising:

[0033] A horizontal comparison unit is used to determine the local segment of a first comparison matrix based on the local segment of the input matrix using a first comparison operation performed jointly by multiple parties. The elements of the first comparison matrix are used to indicate the results of comparisons between horizontally adjacent elements in the input matrix.

[0034] A horizontal selection unit is used to determine the local slice of an intermediate result matrix based on the local slice of the first comparison matrix obtained by the horizontal comparison unit, using a first selection operation performed by multiple parties, wherein the elements of the intermediate result matrix are the larger values ​​among the horizontally adjacent elements in the input matrix.

[0035] A vertical comparison unit is used to determine the local segment of a second comparison matrix based on the local segment of the intermediate result matrix obtained by the horizontal selection unit, using a second comparison operation performed jointly by multiple parties. The elements of the second comparison matrix are used to indicate the results of the comparison of vertically adjacent elements in the intermediate result matrix.

[0036] A vertical selection unit is used to determine the local partition of the pooling result matrix based on the local partition of the second comparison matrix obtained by the vertical comparison unit, using a second selection operation performed jointly by multiple parties, wherein the elements of the pooling result matrix are the larger values ​​among the vertically adjacent elements in the intermediate result matrix.

[0037] Fourthly, a maximum pooling processing apparatus for protecting privacy data is provided, wherein the input matrix is ​​distributed among multiple parties in a secret-sharing manner, and the apparatus is located at any one of the multiple parties, comprising:

[0038] A vertical comparison unit is used to determine the local segment of a first comparison matrix based on the local segment of the input matrix and by performing a first comparison operation jointly by multiple parties. The elements of the first comparison matrix are used to indicate the results of the comparison of vertically adjacent elements in the input matrix.

[0039] A vertical selection unit is used to determine the local segment of an intermediate result matrix based on the local segment of the first comparison matrix obtained by the vertical comparison unit, using a first selection operation performed by multiple parties. The elements of the intermediate result matrix are the larger values ​​among the vertically adjacent elements in the input matrix.

[0040] A horizontal comparison unit is used to determine the local segment of a second comparison matrix based on the local segment of the intermediate result matrix obtained by the vertical selection unit, using a second comparison operation performed jointly by multiple parties. The elements of the second comparison matrix are used to indicate the results of the comparison of horizontally adjacent elements in the intermediate result matrix.

[0041] A horizontal selection unit is used to determine the local partition of the pooling result matrix based on the local partition of the second comparison matrix obtained by the horizontal comparison unit, using a second selection operation performed by multiple parties. The elements of the pooling result matrix are the larger values ​​among the horizontally adjacent elements in the intermediate result matrix.

[0042] Fifthly, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method of the first or second aspect.

[0043] In a sixth aspect, a computing device is provided, including a memory and a processor, wherein executable code is stored in the memory, and when the processor executes the executable code, it implements the method of the first aspect or the second aspect.

[0044] According to the method and apparatus provided in the embodiments of this specification, an input matrix is ​​distributed among multiple parties in a secret-shared manner. Each of the multiple parties first determines its own slice of a first comparison matrix based on its own slice of the input matrix using a first comparison operation performed jointly by the multiple parties. The elements of the first comparison matrix are used to indicate the results of comparisons of horizontally adjacent elements in the input matrix. Then, based on its own slice of the first comparison matrix, it determines its own slice of an intermediate result matrix using a first selection operation performed jointly by the multiple parties. The elements of the intermediate result matrix are the larger values ​​among horizontally adjacent elements in the input matrix. Next, based on its own slice of the intermediate result matrix, it determines its own slice of a second comparison matrix using a second comparison operation performed jointly by the multiple parties. The elements of the second comparison matrix are used to indicate the results of comparisons of vertically adjacent elements in the intermediate result matrix. Finally, based on its own slice of the second comparison matrix, it determines its own slice of a pooling result matrix using a second selection operation performed jointly by the multiple parties. The elements of the pooling result matrix are the larger values ​​among vertically adjacent elements in the intermediate result matrix. As can be seen from the above, the embodiments of this specification divide the overall calculation logic into two parts: first, a row-by-row comparison is performed and the maximum value is selected based on the comparison results; then, a column-by-column comparison is performed and the maximum value is selected based on the comparison results. There is no overlapping redundant calculation, which can reduce communication overhead and improve overall calculation efficiency.

[0045] According to another method and apparatus provided in the embodiments of this specification, the input matrix is ​​distributed among multiple parties in a secret-shared manner. Each of the multiple parties first determines its own slice of the first comparison matrix based on its own slice of the input matrix using a first comparison operation performed jointly by the multiple parties. The elements of the first comparison matrix are used to indicate the results of comparisons of vertically adjacent elements in the input matrix. Then, based on its own slice of the first comparison matrix, it determines its own slice of the intermediate result matrix using a first selection operation performed jointly by the multiple parties. The elements of the intermediate result matrix are the larger values ​​among the vertically adjacent elements in the input matrix. Next, based on its own slice of the intermediate result matrix, it determines its own slice of the second comparison matrix using a second comparison operation performed jointly by the multiple parties. The elements of the second comparison matrix are used to indicate the results of comparisons of horizontally adjacent elements in the intermediate result matrix. Finally, based on its own slice of the second comparison matrix, it determines its own slice of the pooling result matrix using a second selection operation performed jointly by the multiple parties. The elements of the pooling result matrix are the larger values ​​among the horizontally adjacent elements in the intermediate result matrix. As can be seen from the above, the embodiments of this specification divide the overall calculation logic into two parts: first, a column-wise comparison is performed and the maximum value is selected based on the comparison results; then, a row-wise comparison is performed and the maximum value is selected based on the comparison results. There is no overlapping redundant calculation, which can reduce communication overhead and improve overall calculation efficiency. Attached Figure Description

[0046] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0047] Figure 1 This is a schematic diagram illustrating an implementation scenario of one embodiment disclosed in this specification;

[0048] Figure 2 This is a schematic diagram illustrating an implementation scenario of another embodiment disclosed in this specification;

[0049] Figure 3 This is a schematic diagram illustrating an implementation scenario of another embodiment disclosed in this specification;

[0050] Figure 4 This diagram illustrates a maximum pooling method for protecting privacy data according to one embodiment.

[0051] Figure 5 This diagram illustrates a maximum pooling method for protecting privacy data according to another embodiment.

[0052] Figure 6 A schematic block diagram of a maximum pooling processing apparatus for protecting privacy data according to one embodiment is shown.

[0053] Figure 7 A schematic block diagram of a maximum pooling processing apparatus for protecting privacy data according to another embodiment is shown. Detailed Implementation

[0054] The solution provided in this specification will now be described with reference to the accompanying drawings.

[0055] Figure 1This is a schematic diagram illustrating an implementation scenario of an embodiment disclosed in this specification. This implementation scenario involves max pooling processing to protect privacy data. Max pooling, as understood, refers to taking the point with the largest value in a local receptive field and is a commonly used pooling method in convolutional neural networks. Max pooling processing to protect privacy data involves taking an input matrix in a secret shared form and obtaining the encrypted pooling result matrix of that input matrix with respect to a preset pooling window and a preset stride without revealing the input matrix. In this embodiment, the max pooling calculation can be optimized for a pooling window size of 2x2 and a stride of 1x1. Both the input matrix and the pooling result matrix are privacy data. The input matrix is ​​distributed among multiple parties in a secret shared form. It can be understood that these multiple parties can be two, three, or four, etc.; only a three-party example is shown in the diagram. Figure 1 As shown, the scenario of maximum pooling processing to protect privacy involves participants A, B, and C, also referred to as the first party, second party, and third party, or simply Party A, Party B, and Party C. Each participant can be any device, platform, server, or device cluster with computing and processing capabilities. All parties must collaborate to achieve maximum pooling processing while protecting data privacy.

[0056] In practical applications, such as machine learning, floating-point arithmetic is often used. However, using secret sharing to implement secure floating-point arithmetic can lead to high overhead, making it difficult to meet actual computational needs. Therefore, the common practice is to use fixed-point numbers to approximate floating-point numbers, achieving significant efficiency improvements at the cost of some precision. Secret sharing protocols are typically defined on rings or domains, each with its own advantages and disadvantages. Computation on rings is more efficient because the modulo operation can be implicitly handled by hardware, compared to computation on domains which requires manual modulo operations.

[0057] In the embodiments of this specification, fixed-point numbers can be mapped to rings for computation. The mapping construction process is as follows: Assume To be a rational number, we need to... Mapping to the integer field, let Where f is the precision in digits, i.e., the number of decimal places, and Int(·) is for rounding to the nearest integer. Then, a modulo operation is performed on x, making... Where k represents the number of bits in x, mapping the input to... On the ring.

[0058] In the embodiments of this specification, the arithmetic of fixed-point numbers is shared in... On the ring. It also incorporates Boolean sharing, whose computation is on... On the ring. Among them, the arithmetic sharing of fragments can be represented as... In the form of Boolean sharing, a fragment can be represented as In the form of.

[0059] Taking a three-party collaborative approach to achieve secure max pooling as an example. The three computation parties are P0, P1, and P2. The secret input x is split into three fragments (x0, x1, x2), satisfying P... i Holding (x) i x i+1 ), and x = (x0 + x1 + x2) mod 2 k .

[0060] It should be noted that the "multiple parties" can be any number of computation parties. The data holder can act as a computation party, and the data holder and the computation party may overlap or not overlap at all. The multiple parties have equal status in the secure max pooling process. Therefore, in the subsequent processing flow description of the embodiments in this specification, only the processing flow of any one of the multiple parties will be described.

[0061] Furthermore, the input matrix is ​​distributed across multiple parties in a secret-sharing manner; that is, the arithmetic share of each element in the input matrix is ​​distributed across multiple parties. Similarly, the pooling result matrix is ​​distributed across multiple parties in a secret-sharing manner; that is, the arithmetic share of each element in the pooling result matrix is ​​distributed across multiple parties. In other words, both the input matrix and the pooling result matrix are in ciphertext form, i.e., in a sharded form. (See reference...) Figure 1 The input matrix is ​​named input, and its size is W. i ×H i The parameters for max pooling are a 2×2 pooling window and a 1×1 step size. The expected result includes the pooling result matrix `max`. Furthermore, the result can also include the pooling index matrix `max_idx`, where each element in the pooling index matrix is ​​the index of the corresponding element in the pooling result matrix within the corresponding pooling window. Party B is any one of the multiple parties, and it has a partition of the input matrix described above. Through secure multi-party computation in conjunction with parties A and C, party B is able to obtain shards of the pooling result matrix. Furthermore, the sharding of the pooling index matrix can also be obtained. This achieves maximum pooling processing that protects privacy. Understandably, during secure maximum pooling, some plaintext data may be known to all parties; for example, the pooling window and step size can be plaintext.

[0062] The following is a brief description of the common computational primitives used in the embodiments of this specification, including:

[0063] Addition and constant multiplication can be performed directly using the original addition secret sharing protocol. Each participant only needs to perform the calculation locally.

[0064] Multiplication, a fixed-point multiplication operation involves two key calculations. First, the participants perform integer multiplication using a standard multiplication protocol. After the multiplication is complete, due to the limited precision of fixed-point data, the result needs to be truncated. The truncation operation is used to truncate the data after doubling the precision: the last f digits are removed, i.e., divided by 2. f ;

[0065] The comparison operation uses the LESS protocol to compare the size of two arithmetic-shared inputs. If the input on the left is less than the input on the right, it returns a boolean share of 1; otherwise, it returns a boolean share of 0.

[0066] Choose the slice operation, input two arithmetic shares and one boolean share, and use the SELECT protocol to select one of the two arithmetic shares based on whether the boolean share is 0 or 1.

[0067] This specification provides embodiments that propose corresponding solutions to reduce communication overhead and improve overall computational efficiency while achieving secure max pooling.

[0068] Figure 2 This is a schematic diagram of another embodiment disclosed in this specification, in which a vertical comparison is performed first, followed by a horizontal comparison. (Refer to...) Figure 2 The input matrix is ​​2×3, which is 2 rows and 3 columns, and can be represented as follows: In typical pooling processing, the input matrix is ​​first processed to construct two pooling windows with a 2×2 pooling window and a 1×1 stride. and Then, within each pooling window, perform independent pairwise comparisons of the four elements. Since there is an intersection of columns between the two pooling windows... Although a binary search approach is used, the comparison of two overlapping elements in the sliding window is a redundant calculation, resulting in additional overhead. This embodiment, through optimization, reduces one redundant comparison of 2 and 5 by splitting the overall calculation logic into two parts. First, row-wise comparisons are performed, and the maximum value is selected based on the comparison results. That is, when comparing elements in adjacent rows, 1 and 4 are compared, and the larger one is 4; when comparing 2 and 5, the larger one is 5; when comparing 3 and 6, the larger one is 6, resulting in an intermediate result matrix of (4 5 6). Then, column-wise comparisons are performed on the intermediate result matrix, and the maximum value is selected based on the comparison results. That is, when comparing elements in adjacent columns, 4 and 5 are compared, and the larger one is 5; when comparing 5 and 6, the larger one is 6, resulting in a pooling result matrix of (5 6). This eliminates redundant calculations and reduces communication overhead, improving overall computational efficiency. Element 5 in the pooling result matrix is ​​located within the pooling window. The index is 0001, and element 6 in the pooling result matrix is ​​in the pooling window. The index in the pooling window is 0001, which means that the pooling window contains 4 elements, so the index is 4-dimensional.

[0069] Figure 3 This is a schematic diagram of another embodiment disclosed in this specification, in which a horizontal comparison is performed first, followed by a vertical comparison. (Refer to...) Figure 3 In this embodiment of the specification, through optimization, one redundant comparison between 2 and 5 can be reduced. The overall calculation logic is split into two parts: first, a column-by-column comparison is performed, and then the maximum value is selected based on the comparison results. That is, when comparing elements in adjacent columns, 1 and 2 are compared, and the larger one is 2; 4 and 5 are compared, and the larger one is 5; 2 and 3 are compared, and the larger one is 3; 5 and 6 are compared, and the larger one is 6. The resulting intermediate result matrix is ​​as follows. Then, the intermediate result matrix is ​​compared row by row, and the maximum value is selected based on the comparison results. That is, the elements of adjacent rows are compared. When comparing 2 and 5, the larger one is 5. When comparing 3 and 6, the larger one is 6. The resulting pooling result matrix is ​​(5 6). There is no overlapping redundant calculation, which can reduce communication overhead and improve overall computing efficiency.

[0070] Figure 4 This diagram illustrates a maximum pooling method for protecting privacy data according to one embodiment, where the input matrix is ​​distributed among multiple parties in a secret-sharing manner. The method can be based on... Figure 1 and Figure 3 In the implementation scenario shown, the method is performed by any one of the multiple parties. For example... Figure 4 As shown, the maximum pooling processing method for protecting privacy data in this embodiment includes the following steps: Step 41, based on the local partition of the input matrix, a first comparison operation performed jointly by multiple parties is used to determine the local partition of the first comparison matrix, wherein the elements of the first comparison matrix are used to indicate the comparison results of horizontally adjacent elements in the input matrix; Step 42, based on the local partition of the first comparison matrix, a first selection operation performed jointly by multiple parties is used to determine the local partition of the intermediate result matrix, wherein the elements of the intermediate result matrix are the larger values ​​among the horizontally adjacent elements in the input matrix; Step 43, based on the local partition of the intermediate result matrix, a second comparison operation performed jointly by multiple parties is used to determine the local partition of the second comparison matrix, wherein the elements of the second comparison matrix are used to indicate the comparison results of vertically adjacent elements in the intermediate result matrix; Step 44, based on the local partition of the second comparison matrix, a second selection operation performed jointly by multiple parties is used to determine the local partition of the pooling result matrix, wherein the elements of the pooling result matrix are the larger values ​​among the vertically adjacent elements in the intermediate result matrix. The specific execution method of each of the above steps is described below.

[0071] First, in step 41, based on the local partition of the input matrix, a first comparison operation performed jointly by multiple parties is used to determine the local partition of the first comparison matrix. The elements of the first comparison matrix are used to indicate the results of comparisons between horizontally adjacent elements in the input matrix. It can be understood that the input matrix can be represented as `input`, and correspondingly, the partitions of the input matrix can be represented as `...`. express.

[0072] In this embodiment of the specification, for a 2×2 pooling window and a 1×1 step size, the first comparison operation can be used to compare two horizontally adjacent elements in the input matrix as a group to obtain the size comparison result of the two elements. This comparison result can be represented by 0 or 1.

[0073] In one example, the input matrix has dimensions of W rows and H columns, and determining the self-partition of the first comparison matrix includes:

[0074] For the local slice of the input matrix, the first H-1 columns are taken as the local slice of the left slice matrix, and the last H-1 columns are taken as the local slice of the right slice matrix.

[0075] The left slice matrix and the right slice matrix are compared bit by bit using a first comparison operation performed jointly by multiple parties to obtain the local slice of the first comparison matrix.

[0076] In the embodiments described in this specification, the dimension of the input matrix can be represented as (W i H i In other words, the aforementioned W = W i The aforementioned H = H i The dimension of the pooling result matrix can be represented as (W) o H o ).

[0077] In this example, the elements of the input matrix are compared horizontally. First, the input matrix is ​​sliced ​​column-wise. The left slice matrix lhs is defined as the first H... i -1 column, the right slice matrix rhs is defined as the back H i -1 column. Next, call the LESS protocol to convert these two columns of size W... i ×(H i Perform pairwise comparisons on the matrix of size W. i ×(H i The first comparison matrix h_cmp is -1). It can be understood that the first comparison operation is performed jointly by multiple parties, and each party obtains a slice of the first comparison matrix.

[0078] The above process can be implemented using the following code:

[0079]

[0080]

[0081]

[0082] For example, if the input matrix is Then lhs is rhs is h_cmp is

[0083] Then, in step 42, based on the local segment of the first comparison matrix, a first selection operation performed jointly by multiple parties is used to determine the local segment of the intermediate result matrix. The elements of the intermediate result matrix are the larger values ​​among the horizontally adjacent elements in the input matrix. It can be understood that the elements of the first comparison matrix are used to indicate the results of the comparison of horizontally adjacent elements in the input matrix; therefore, the larger value among the horizontally adjacent elements in the input matrix can be selected based on the first comparison matrix.

[0084] In one example, the first selection operation is used to select an element at a corresponding position in the left slice matrix or the right slice matrix as an element at a corresponding position in the intermediate result matrix based on whether the value of an element in the first comparison matrix is ​​a predetermined value.

[0085] In this example, based on the horizontal comparison of each element of the input matrix, the maximum value in the horizontal direction is selected to form the intermediate result matrix h_max. The SELECT protocol is called, and the maximum value in h_cmp is selected to form h_max. If the value of an element in h_cmp is 1, an element from lhs is selected; otherwise, an element from rhs is selected.

[0086] The above process can be implemented using the following code:

[0087]

[0088] For example, if lhs is rhs is h_cmp is Then h_max is

[0089] Next, in step 43, based on the local partition of the intermediate result matrix, a second comparison operation performed jointly by multiple parties is used to determine the local partition of the second comparison matrix. The elements of the second comparison matrix are used to indicate the results of comparisons between vertically adjacent elements in the intermediate result matrix. It can be understood that the intermediate result matrix can be represented by h_max, and correspondingly, the partitions of the intermediate result matrix can be represented by h_max. express.

[0090] In this embodiment of the specification, for a 2×2 pooling window and a 1×1 step size, a second comparison operation can be used to compare two vertically adjacent elements in the intermediate result matrix as a group to obtain the size comparison result of the two elements. This comparison result can be represented by 0 or 1.

[0091] In one example, the intermediate result matrix has W rows; determining the local slice of the second comparison matrix includes:

[0092] For the local slice of the intermediate result matrix, the first W-1 rows are taken as the local slice of the upper slice matrix, and the last W-1 rows are taken as the local slice of the lower slice matrix.

[0093] The upper slice matrix and the lower slice matrix are compared bit by bit using a second comparison operation performed jointly by multiple parties to obtain the local slice of the second comparison matrix.

[0094] In the embodiments described in this specification, the dimension of the input matrix can be represented as (W i H i In other words, the aforementioned W = W i The aforementioned H = H i The dimension of the intermediate result matrix can be represented as W. i ×(H i -1).

[0095] In this example, the elements of the intermediate result matrix are compared vertically. First, the intermediate result matrix h_max is sliced ​​row-wise. The upper slice matrix is ​​defined as the first W... i -1 row, the bottom slice matrix is ​​defined as the back W i -1 line. Next, call the LESS protocol to combine these two sizes (W) i -1)×(H i Perform pairwise comparisons on a matrix of size (W - 1) to obtain a matrix of size (W i -1)×(H i The second comparison matrix is ​​v_cmp, which is -1). It is understandable that the second comparison operation is performed jointly by multiple parties, with each party obtaining a slice of the second comparison matrix.

[0096] The above process can be implemented using the following code:

[0097]

[0098]

[0099]

[0100] For example, if the intermediate result matrix is Then upper is (2 3), bottom is (5 6), and v_cmp is (00).

[0101] Finally, in step 44, based on the local partition of the second comparison matrix, a second selection operation performed jointly by multiple parties is used to determine the local partition of the pooling result matrix. The elements of the pooling result matrix are the larger values ​​among the vertically adjacent elements in the intermediate result matrix. It can be understood that the elements of the second comparison matrix are used to indicate the results of the comparison of vertically adjacent elements in the intermediate result matrix; therefore, the larger value among the vertically adjacent elements in the intermediate result matrix can be selected based on the second comparison matrix.

[0102] In one example, the second selection operation is used to select an element at a corresponding position in the upper slice matrix or the lower slice matrix as an element at a corresponding position in the pooling result matrix based on whether the value of an element in the second comparison matrix is ​​a predetermined value.

[0103] In this example, based on the vertical comparison of each element in the intermediate result matrix, the maximum value in the vertical direction is selected to form the pooling result matrix `max_ret`. The `SELECT` protocol is called, and the maximum value is selected based on `v_cmp` to form `max_ret`. If an element of `v_cmp` has a value of 1, an element from the upper column is selected; otherwise, an element from the lower column is selected.

[0104] The above process can be implemented using the following code:

[0105]

[0106] For example, if upper is (2 3), bottom is (5 6), and v_cmp is (0 0), then max_ret is (5 6).

[0107] It is understood that the number of pooling windows included in the input matrix is ​​the same as the number of elements in the pooling result matrix. Each element in the pooling result matrix is ​​the maximum value in the corresponding pooling window, and it has an index within that pooling window. The index identifies its position; for a 2×2 pooling window, the index is 4-dimensional. The embodiments in this specification can not only determine the pooling result matrix but also the index of each element in the pooling result matrix within its corresponding pooling window.

[0108] In one example, the method further includes:

[0109] Based on the local segment of the first comparison matrix, the local segment of the intermediate index matrix is ​​determined by using a third selection operation performed jointly by multiple parties. The elements of the intermediate index matrix are two-dimensional indices of the corresponding elements in the intermediate result matrix.

[0110] Furthermore, the third selection operation is used to select one of two pre-constructed candidate two-dimensional indices as the element at the corresponding position of the intermediate index matrix based on whether the value of the element in the first comparison matrix is ​​a predetermined value.

[0111] In this example, based on the horizontal comparison of each element of the input matrix, the index corresponding to the maximum value in the horizontal direction is selected to form the intermediate index matrix h_idx_max. For the index, since it involves comparing two elements, the one-hot encoded index has a dimension of 2, constructing two candidate two-dimensional indices: {0,1} and {1,0}. The SELECT protocol is called, and the candidate two-dimensional indices are selected to form h_idx_max based on h_cmp. If the value of an element in h_cmp is 1, then {1,0} is selected; otherwise, {0,1} is selected.

[0112] The above process can be implemented using the following code:

[0113] mask0 = {1, 0}

[0114] mask1 = {0, 1}

[0115]

[0116] For example, if h_cmp is Then h_idx_max is

[0117] Furthermore, the intermediate index matrix has W rows; the method further includes:

[0118] For the local partition of the intermediate index matrix, the first W-1 rows are taken as the local partition of the upper index matrix, and the last W-1 rows are taken as the local partition of the lower index matrix.

[0119] Based on the local sharding of the second comparison matrix, the fourth selection operation performed by multiple parties is used to select elements in the upper or lower index matrix as elements in the corresponding positions of the pooling index matrix according to whether the value of the element in the second comparison matrix is ​​a predetermined value, thereby obtaining the local sharding of the pooling index matrix.

[0120] Furthermore, prior to the fourth selection operation performed using multi-party collaboration, the method further includes:

[0121] To obtain four-dimensional elements, add two zeros to the end of the elements in the upper index matrix, and add two zeros to the beginning of the elements in the lower index matrix.

[0122] In this example, based on the vertical comparison of each element in the intermediate result matrix, the index corresponding to the maximum value in the vertical direction is selected to form the pooled index matrix `max_idx_ret`. For the index, since four elements are compared, the dimension of the one-hot encoded index is 4. First, the intermediate index matrix is ​​sliced, and the first W... i -1 line gets upper_idx, then W i -1 line yields `bottom_idx`. Both are two-dimensional indices, so zero-padding is required. For each element of `upper_idx`, two zeros are padded to the end to obtain `padded_upper_idx`; for each element of `bottom_idx`, two zeros are padded to the beginning to obtain `padded_bottom_idx`. Then, the LESS protocol is called, selecting elements based on `v_cmp`. If the value of an element in `v_cmp` is 1, an element from `padded_upper_idx` is selected; otherwise, an element from `padded_bottom_idx` is selected, resulting in `max_idx_ret`.

[0123] The above process can be implemented using the following code:

[0124]

[0125]

[0126]

[0127]

[0128]

[0129] For example, if indexing is performed in a 2x2 window from top to bottom and left to right, then element 5 in the pooling result matrix will be in the pooling window. The index in the table is 0001. First, determine the two-dimensional index of 5 as 01, because 5 is the maximum value in the next row. Add two zeros in front of the two-dimensional index to get the four-dimensional index 0001.

[0130] According to the method provided in the embodiments of this specification, an input matrix is ​​distributed among multiple parties in a secret-shared manner. Each of the multiple parties first determines its own slice of a first comparison matrix based on its own slice of the input matrix using a first comparison operation performed jointly by the multiple parties. The elements of the first comparison matrix are used to indicate the results of comparisons of horizontally adjacent elements in the input matrix. Then, based on its own slice of the first comparison matrix, it determines its own slice of an intermediate result matrix using a first selection operation performed jointly by the multiple parties. The elements of the intermediate result matrix are the larger values ​​among the horizontally adjacent elements in the input matrix. Next, based on its own slice of the intermediate result matrix, it determines its own slice of a second comparison matrix using a second comparison operation performed jointly by the multiple parties. The elements of the second comparison matrix are used to indicate the results of comparisons of vertically adjacent elements in the intermediate result matrix. Finally, based on its own slice of the second comparison matrix, it determines its own slice of a pooling result matrix using a second selection operation performed jointly by the multiple parties. The elements of the pooling result matrix are the larger values ​​among the vertically adjacent elements in the intermediate result matrix. As can be seen from the above, the embodiments of this specification divide the overall calculation logic into two parts: first, a row-by-row comparison is performed and the maximum value is selected based on the comparison results; then, a column-by-column comparison is performed and the maximum value is selected based on the comparison results. There is no overlapping redundant calculation, which can reduce communication overhead and improve overall calculation efficiency.

[0131] Figure 5 This diagram illustrates a maximum pooling method for protecting privacy data according to another embodiment, where the input matrix is ​​distributed among multiple parties in a secret-sharing manner. This method can be based on... Figure 1 and Figure 2 In the implementation scenario shown, the method is performed by any one of the multiple parties. For example... Figure 5As shown, the maximum pooling processing method for protecting privacy data in this embodiment includes the following steps: Step 51, based on the local partition of the input matrix, a first comparison operation performed by multiple parties is used to determine the local partition of the first comparison matrix, wherein the elements of the first comparison matrix are used to indicate the comparison results of vertically adjacent elements in the input matrix; Step 52, based on the local partition of the first comparison matrix, a first selection operation performed by multiple parties is used to determine the local partition of the intermediate result matrix, wherein the elements of the intermediate result matrix are the larger values ​​among the vertically adjacent elements in the input matrix; Step 53, based on the local partition of the intermediate result matrix, a second comparison operation performed by multiple parties is used to determine the local partition of the second comparison matrix, wherein the elements of the second comparison matrix are used to indicate the comparison results of horizontally adjacent elements in the intermediate result matrix; Step 54, based on the local partition of the second comparison matrix, a second selection operation performed by multiple parties is used to determine the local partition of the pooling result matrix, wherein the elements of the pooling result matrix are the larger values ​​among the horizontally adjacent elements in the intermediate result matrix.

[0132] Understandably, with Figure 4 Compared to the embodiments shown, Figure 4 The illustrated embodiment first performed a horizontal comparison, and then performed a vertical comparison; Figure 5 The illustrated embodiment first performs a vertical comparison, then a horizontal comparison. Both embodiments reduce redundant comparisons, thereby improving efficiency.

[0133] In another method provided by the embodiments of this specification, the input matrix is ​​distributed among multiple parties in a secret-shared manner. Each of the multiple parties first determines its own slice of the first comparison matrix based on its own slice of the input matrix using a first comparison operation performed jointly by the multiple parties. The elements of the first comparison matrix are used to indicate the results of comparisons between vertically adjacent elements in the input matrix. Then, based on its own slice of the first comparison matrix, it determines its own slice of the intermediate result matrix using a first selection operation performed jointly by the multiple parties. The elements of the intermediate result matrix are the larger values ​​among the vertically adjacent elements in the input matrix. Next, based on its own slice of the intermediate result matrix, it determines its own slice of the second comparison matrix using a second comparison operation performed jointly by the multiple parties. The elements of the second comparison matrix are used to indicate the results of comparisons between horizontally adjacent elements in the intermediate result matrix. Finally, based on its own slice of the second comparison matrix, it determines its own slice of the pooling result matrix using a second selection operation performed jointly by the multiple parties. The elements of the pooling result matrix are the larger values ​​among the horizontally adjacent elements in the intermediate result matrix. As can be seen from the above, the embodiments of this specification divide the overall calculation logic into two parts: first, a column-wise comparison is performed and the maximum value is selected based on the comparison results; then, a row-wise comparison is performed and the maximum value is selected based on the comparison results. There is no overlapping redundant calculation, which can reduce communication overhead and improve overall calculation efficiency.

[0134] According to another embodiment, a maximum pooling processing apparatus for protecting privacy data is also provided, wherein the input matrix is ​​distributed among multiple parties in a secret-sharing manner, and the apparatus is disposed on any one of the multiple parties, the apparatus being used to perform the operations provided in the embodiments of this specification. Figure 4 The method shown. Figure 6 A schematic block diagram of a maximum pooling processing apparatus for protecting privacy data according to one embodiment is shown. Figure 6 As shown, the device 600 includes:

[0135] The horizontal comparison unit 61 is used to determine the local segment of the first comparison matrix based on the local segment of the input matrix and by using a first comparison operation performed by multiple parties. The elements of the first comparison matrix are used to indicate the results of the comparison of horizontally adjacent elements in the input matrix.

[0136] The horizontal selection unit 62 is used to determine the local segment of the intermediate result matrix based on the local segment of the first comparison matrix obtained by the horizontal comparison unit 61, using a first selection operation performed by multiple parties. The elements of the intermediate result matrix are the larger values ​​among the horizontally adjacent elements in the input matrix.

[0137] The vertical comparison unit 63 is used to determine the local segment of the second comparison matrix based on the local segment of the intermediate result matrix obtained by the horizontal selection unit 62, using a second comparison operation performed by multiple parties. The elements of the second comparison matrix are used to indicate the results of the comparison of vertically adjacent elements in the intermediate result matrix.

[0138] The vertical selection unit 64 is used to determine the local partition of the pooling result matrix based on the local partition of the second comparison matrix obtained by the vertical comparison unit 63, using a second selection operation performed by multiple parties. The elements of the pooling result matrix are the larger values ​​among the vertically adjacent elements in the intermediate result matrix.

[0139] Optionally, as an embodiment, the input matrix has a dimension of W rows and H columns, and the horizontal comparison unit 61 includes:

[0140] The first molecular unit is used to take the first H-1 columns of the input matrix as the local slice of the left slice matrix and the last H-1 columns as the local slice of the right slice matrix for the local slice of the input matrix.

[0141] The first comparison subunit is used to perform a first comparison operation by combining multiple parties to compare the left slice matrix and the right slice matrix obtained by the first segmentation subunit bit by bit to obtain the local slice of the first comparison matrix.

[0142] Furthermore, the first selection operation is used to select an element at a corresponding position in the left slice matrix or the right slice matrix as an element at a corresponding position in the intermediate result matrix based on whether the value of an element in the first comparison matrix is ​​a predetermined value.

[0143] Optionally, as an embodiment, the intermediate result matrix has W rows; the vertical comparison unit 63 includes:

[0144] The second slicing unit is used to take the first W-1 rows of the slice of the intermediate result matrix as the slice of the upper slice matrix and the last W-1 rows as the slice of the lower slice matrix.

[0145] The second comparison subunit is used to perform a second comparison operation using multiple parties, comparing the upper slice matrix and the lower slice matrix obtained by the second segmentation subunit bit by bit to obtain the local slice of the second comparison matrix.

[0146] Furthermore, the second selection operation is used to select an element at a corresponding position in the upper slice matrix or the lower slice matrix as an element at a corresponding position in the pooling result matrix based on whether the value of an element in the second comparison matrix is ​​a predetermined value.

[0147] Optionally, as an embodiment, the apparatus further includes:

[0148] The first index determination unit is used to determine the local segment of the intermediate index matrix based on the local segment of the first comparison matrix and by using a third selection operation performed jointly by multiple parties. The elements of the intermediate index matrix are two-dimensional indices of the corresponding elements in the intermediate result matrix.

[0149] Furthermore, the third selection operation is used to select one of two pre-constructed candidate two-dimensional indices as the element at the corresponding position of the intermediate index matrix based on whether the value of the element in the first comparison matrix is ​​a predetermined value.

[0150] Furthermore, the intermediate index matrix has W rows; the device further includes:

[0151] The index segmentation unit is used to take the first W-1 rows of the local segment of the intermediate index matrix obtained by the first index determination unit as the local segment of the upper index matrix and the last W-1 rows as the local segment of the lower index matrix.

[0152] The index selection unit is used to select elements in the upper or lower index matrix obtained by the index splitting unit as elements in the corresponding position in the pooling index matrix based on the local partition of the second comparison matrix and the fourth selection operation performed by multiple parties, according to whether the value of the element in the second comparison matrix is ​​a predetermined value, thereby obtaining the local partition of the pooling index matrix.

[0153] Furthermore, the device also includes:

[0154] An expansion unit is used to pad the elements in the upper index matrix with two zeros at the end to obtain four-dimensional elements, and to pad the elements in the lower index matrix with two zeros at the beginning to obtain four-dimensional elements, before the fourth selection operation performed by the index selection unit using multiple parties.

[0155] According to the apparatus provided in the embodiments of this specification, an input matrix is ​​distributed among multiple parties in a secret sharing manner. Each of the multiple parties first uses a horizontal comparison unit 61 to determine its own slice of a first comparison matrix based on its own slice of the input matrix, using a first comparison operation jointly performed by the multiple parties. The elements of the first comparison matrix are used to indicate the results of comparisons between horizontally adjacent elements in the input matrix. Then, a horizontal selection unit 62 uses a horizontal selection unit 62 to determine its own slice of an intermediate result matrix based on its own slice of the first comparison matrix, using a first selection operation jointly performed by the multiple parties. The elements of the intermediate result matrix are the input matrix... The intermediate result matrix is ​​first compared by the larger value among its horizontally adjacent elements. Then, the vertical comparison unit 63, based on its own slice of the intermediate result matrix, performs a second comparison operation involving multiple comparisons to determine its own slice of the second comparison matrix. The elements of the second comparison matrix indicate the results of the comparisons of vertically adjacent elements in the intermediate result matrix. Finally, the vertical selection unit 64, based on its own slice of the second comparison matrix, performs a second selection operation involving multiple comparisons to determine its own slice of the pooling result matrix. The elements of the pooling result matrix are the larger values ​​among the vertically adjacent elements in the intermediate result matrix. As can be seen from the above, this embodiment of the specification divides the overall calculation logic into two parts: first, a row-wise comparison is performed and the maximum value is selected based on the comparison results; then, a column-wise comparison is performed and the maximum value is selected based on the comparison results. This avoids overlapping redundant calculations, thereby reducing communication overhead and improving overall calculation efficiency.

[0156] According to another embodiment, a different maximum pooling processing apparatus for protecting privacy data is also provided, wherein the input matrix is ​​distributed among multiple parties in a secret-shared manner, and the apparatus is located on any one of the multiple parties, the apparatus being used to perform the maximum pooling processing provided in the embodiments of this specification. Figure 5 The method shown. Figure 7 A schematic block diagram of a maximum pooling processing apparatus for protecting privacy data according to another embodiment is shown. Figure 7 As shown, the device 700 includes:

[0157] The vertical comparison unit 71 is used to determine the local segment of the first comparison matrix based on the local segment of the input matrix and by using a first comparison operation performed by multiple parties. The elements of the first comparison matrix are used to indicate the results of the comparison of adjacent elements in the vertical direction in the input matrix.

[0158] The vertical selection unit 72 is used to determine the local segment of the intermediate result matrix based on the local segment of the first comparison matrix obtained by the vertical comparison unit 71, using a first selection operation performed by multiple parties. The elements of the intermediate result matrix are the larger values ​​among the vertically adjacent elements in the input matrix.

[0159] The horizontal comparison unit 73 is used to determine the local segment of the second comparison matrix based on the local segment of the intermediate result matrix obtained by the vertical selection unit 72, using a second comparison operation performed by multiple parties. The elements of the second comparison matrix are used to indicate the results of the comparison of horizontally adjacent elements in the intermediate result matrix.

[0160] The horizontal selection unit 74 is used to determine the local partition of the pooling result matrix based on the local partition of the second comparison matrix obtained by the horizontal comparison unit 73, using a second selection operation performed by multiple parties, wherein the elements of the pooling result matrix are the larger values ​​among the horizontally adjacent elements in the intermediate result matrix.

[0161] In another apparatus provided by the embodiments of this specification, the input matrix is ​​distributed among multiple parties in a secret-shared manner. Each of the multiple parties first uses a vertical comparison unit 71 to determine its own slice of a first comparison matrix based on its own slice of the input matrix, using a first comparison operation performed jointly by the multiple parties. The elements of the first comparison matrix are used to indicate the results of comparisons between vertically adjacent elements in the input matrix. Then, a vertical selection unit 72 uses a vertical selection unit 72 to determine its own slice of an intermediate result matrix based on its own slice of the first comparison matrix, using a first selection operation performed jointly by the multiple parties. The elements of the intermediate result matrix are... The larger value among the vertically adjacent elements in the input matrix is ​​used. Then, the horizontal comparison unit 73, based on the local partition of the intermediate result matrix, performs a second comparison operation involving multiple parties to determine the local partition of the second comparison matrix. The elements of the second comparison matrix indicate the comparison results of the horizontally adjacent elements in the intermediate result matrix. Finally, the horizontal selection unit 74, based on the local partition of the second comparison matrix, performs a second selection operation involving multiple parties to determine the local partition of the pooling result matrix. The elements of the pooling result matrix are the larger values ​​among the horizontally adjacent elements in the intermediate result matrix. As can be seen from the above, this embodiment of the specification splits the overall calculation logic into two parts: first, a column-wise comparison is performed and the maximum value is selected based on the comparison results; then, a row-wise comparison is performed and the maximum value is selected based on the comparison results. There is no overlapping redundant calculation, thereby reducing communication overhead and improving overall calculation efficiency.

[0162] The solutions provided in the embodiments of this specification can be applied as underlying protocols to the training and prediction of widely used convolutional neural networks, thereby improving the overall efficiency of upper-layer algorithms.

[0163] According to another embodiment, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed in a computer, causes the computer to perform a combination Figure 4 or Figure 5 The method described.

[0164] According to another embodiment, a computing device is also provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements a combination... Figure 4 or Figure 5 The method described.

[0165] Those skilled in the art will recognize that, in one or more of the examples above, the functions described in this invention can be implemented using hardware, software, firmware, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium.

[0166] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of the present invention should be included within the scope of protection of the present invention.

Claims

1. A max-pooling processing method for protecting privacy data, wherein an input matrix is ​​distributed among multiple parties in a secret-shared manner, and the method is executed by any one of the multiple parties, comprising: Based on the local segment of the input matrix, the local segment of the first comparison matrix is ​​determined by using a first comparison operation performed jointly by multiple parties. The elements of the first comparison matrix are used to indicate the results of the comparison of horizontally adjacent elements in the input matrix. Based on the local segment of the first comparison matrix, the local segment of the intermediate result matrix is ​​determined by using the first selection operation performed by multiple parties. The elements of the intermediate result matrix are the larger values ​​among the horizontally adjacent elements in the input matrix. Based on the local segment of the intermediate result matrix, the local segment of the second comparison matrix is ​​determined by using a second comparison operation performed jointly by multiple parties. The elements of the second comparison matrix are used to indicate the results of the comparison of vertically adjacent elements in the intermediate result matrix. Based on the local partition of the second comparison matrix, the local partition of the pooling result matrix is ​​determined by using the second selection operation performed jointly by multiple parties. The elements of the pooling result matrix are the larger values ​​among the vertically adjacent elements in the intermediate result matrix.

2. The method as described in claim 1, wherein, The input matrix has dimensions of W rows and H columns, and determining the local partition of the first comparison matrix includes: For the local slice of the input matrix, the first H-1 columns are taken as the local slice of the left slice matrix, and the last H-1 columns are taken as the local slice of the right slice matrix. The left slice matrix and the right slice matrix are compared bit by bit using a first comparison operation performed jointly by multiple parties to obtain the local slice of the first comparison matrix.

3. The method as described in claim 2, wherein, The first selection operation is used to select an element at a corresponding position in the left slice matrix or the right slice matrix as an element at a corresponding position in the intermediate result matrix based on whether the value of an element in the first comparison matrix is ​​a predetermined value.

4. The method of claim 1, wherein, The intermediate result matrix has W rows; determining the local slice of the second comparison matrix includes: For the local slice of the intermediate result matrix, the first W-1 rows are taken as the local slice of the upper slice matrix, and the last W-1 rows are taken as the local slice of the lower slice matrix. The upper slice matrix and the lower slice matrix are compared bit by bit using a second comparison operation performed jointly by multiple parties to obtain the local slice of the second comparison matrix.

5. The method of claim 4, wherein, The second selection operation is used to select an element at a corresponding position in the upper slice matrix or the lower slice matrix as an element at a corresponding position in the pooling result matrix based on whether the value of an element in the second comparison matrix is ​​a predetermined value.

6. The method of claim 1, wherein, The method further includes: Based on the local segment of the first comparison matrix, the local segment of the intermediate index matrix is ​​determined by using a third selection operation performed jointly by multiple parties. The elements of the intermediate index matrix are two-dimensional indices of the corresponding elements in the intermediate result matrix.

7. The method of claim 6, wherein, The third selection operation is used to select one of two pre-constructed candidate two-dimensional indices as the element at the corresponding position of the intermediate index matrix, based on whether the value of the element in the first comparison matrix is ​​a predetermined value.

8. The method of claim 6, wherein, The intermediate index matrix has W rows; the method further includes: For the local partition of the intermediate index matrix, the first W-1 rows are taken as the local partition of the upper index matrix, and the last W-1 rows are taken as the local partition of the lower index matrix. Based on the local sharding of the second comparison matrix, the fourth selection operation performed by multiple parties is used to select elements in the upper or lower index matrix as elements in the corresponding positions of the pooling index matrix according to whether the value of the element in the second comparison matrix is ​​a predetermined value, thereby obtaining the local sharding of the pooling index matrix.

9. The method of claim 8, wherein, Prior to the fourth selection operation performed using multi-party collaboration, the method further includes: To obtain four-dimensional elements, add two zeros to the end of the elements in the upper index matrix, and add two zeros to the beginning of the elements in the lower index matrix.

10. A max-pooling processing method for protecting privacy data, wherein an input matrix is ​​distributed among multiple parties in a secret-shared manner, and the method is executed by any one of the multiple parties, comprising: Based on the local segment of the input matrix, the local segment of the first comparison matrix is ​​determined by using a first comparison operation performed jointly by multiple parties. The elements of the first comparison matrix are used to indicate the results of the comparison of vertically adjacent elements in the input matrix. Based on the local segment of the first comparison matrix, the local segment of the intermediate result matrix is ​​determined by using the first selection operation performed by multiple parties. The elements of the intermediate result matrix are the larger values ​​among the vertically adjacent elements in the input matrix. Based on the local segment of the intermediate result matrix, the local segment of the second comparison matrix is ​​determined by using a second comparison operation performed jointly by multiple parties. The elements of the second comparison matrix are used to indicate the results of the comparison of horizontally adjacent elements in the intermediate result matrix. Based on the local partition of the second comparison matrix, the local partition of the pooling result matrix is ​​determined by using the second selection operation performed jointly by multiple parties. The elements of the pooling result matrix are the larger values ​​among the horizontally adjacent elements in the intermediate result matrix.

11. A maximum pooling processing apparatus for protecting privacy data, wherein an input matrix is ​​distributed among multiple parties in a secret-sharing manner, the apparatus being disposed in any one of the multiple parties, comprising: A horizontal comparison unit is used to determine the local segment of a first comparison matrix based on the local segment of the input matrix using a first comparison operation performed jointly by multiple parties. The elements of the first comparison matrix are used to indicate the results of comparisons between horizontally adjacent elements in the input matrix. A horizontal selection unit is used to determine the local slice of an intermediate result matrix based on the local slice of the first comparison matrix obtained by the horizontal comparison unit, using a first selection operation performed by multiple parties, wherein the elements of the intermediate result matrix are the larger values ​​among the horizontally adjacent elements in the input matrix. A vertical comparison unit is used to determine the local segment of a second comparison matrix based on the local segment of the intermediate result matrix obtained by the horizontal selection unit, using a second comparison operation performed jointly by multiple parties. The elements of the second comparison matrix are used to indicate the results of the comparison of vertically adjacent elements in the intermediate result matrix. A vertical selection unit is used to determine the local partition of the pooling result matrix based on the local partition of the second comparison matrix obtained by the vertical comparison unit, using a second selection operation performed jointly by multiple parties, wherein the elements of the pooling result matrix are the larger values ​​among the vertically adjacent elements in the intermediate result matrix.

12. A maximum pooling processing apparatus for protecting privacy data, wherein an input matrix is ​​distributed among multiple parties in a secret-sharing manner, the apparatus being disposed at any one of the multiple parties, comprising: A vertical comparison unit is used to determine the local segment of a first comparison matrix based on the local segment of the input matrix and by performing a first comparison operation jointly by multiple parties. The elements of the first comparison matrix are used to indicate the results of the comparison of vertically adjacent elements in the input matrix. A vertical selection unit is used to determine the local segment of an intermediate result matrix based on the local segment of the first comparison matrix obtained by the vertical comparison unit, using a first selection operation performed by multiple parties. The elements of the intermediate result matrix are the larger values ​​among the vertically adjacent elements in the input matrix. A horizontal comparison unit is used to determine the local segment of a second comparison matrix based on the local segment of the intermediate result matrix obtained by the vertical selection unit, using a second comparison operation performed jointly by multiple parties. The elements of the second comparison matrix are used to indicate the results of the comparison of horizontally adjacent elements in the intermediate result matrix. A horizontal selection unit is used to determine the local partition of the pooling result matrix based on the local partition of the second comparison matrix obtained by the horizontal comparison unit, using a second selection operation performed by multiple parties. The elements of the pooling result matrix are the larger values ​​among the horizontally adjacent elements in the intermediate result matrix.

13. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method of any one of claims 1-10.

14. A computing device comprising a memory and a processor, wherein the memory stores executable code, and the processor, when executing the executable code, implements the method of any one of claims 1-10.