Data dimension reduction method, terminal device, and storage medium
By obtaining encrypted data and calculating the projection matrix through the coordinator, the problem of data dimensionality reduction with inconsistent data formats among multiple parties is solved, and effective dimensionality reduction of the data of the initiator and participants is achieved without data leakage.
Patent Information
- Application Number
- CN202310485650.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-28
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2043-04-28
AI Technical Summary
When multiple data formats are inconsistent, existing technologies struggle to achieve data dimensionality reduction without leaking data from all parties, increasing the difficulty of data dimensionality reduction.
The coordinator obtains encrypted data from the initiator and participants, uses location identifiers to determine the target encrypted data of the true category, calculates the intra-class scatter matrix and inter-class scatter matrix, generates a projection matrix, and sends it to the initiator and participants for data dimensionality reduction.
Without disclosing the data format or exchanging data, it effectively reduced the dimensionality of the data from the initiator and participants, thus solving the problem of inconsistent data formats.
Smart Images

Figure CN116578868B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of data processing, and particularly relates to a data dimension reduction method, a terminal device and a storage medium. BACKGROUND
[0002] Data dimension reduction is a preprocessing step in machine learning and pattern classification application programs, which is used to remove redundant and dependent features in a data set, so as to improve subsequent computing efficiency. In the case of data dimension reduction on multi-party data, the data formats of the parties are not unified, and the data of each party cannot be disclosed to other parties, thereby increasing the difficulty of data dimension reduction. SUMMARY
[0003] Therefore, the embodiments of the present application provide a data dimension reduction method, a terminal device and a storage medium, which can realize dimension reduction on multi-party data under the condition that the data formats of the parties are not unified and the data of each party cannot be disclosed.
[0004] A first aspect of the embodiments of the present application provides a data dimension reduction method, which is executed on a coordinating party, and the method comprises:
[0005] obtaining first encrypted data sent by an initiating party and a position identifier, and obtaining q groups of second encrypted data sent by each participating party; the first encrypted data is obtained by preprocessing and encrypting data in a first data set of the initiating party and a first label corresponding to each data, and the first label represents the category of the data in the first data set; each group of the second encrypted data is obtained by preprocessing and encrypting data in a second data set of the participating party and a corresponding second label; q groups of the second labels are sent by the initiating party to the participating party, and only one group of labels in the q groups of the second labels represents the true category of the data in the second data set;
[0006] determining target encrypted data corresponding to the true category from the q groups of the second encrypted data according to the position identifier;
[0007] determining an intra-class scatter matrix and an inter-class scatter matrix according to the first encrypted data and the target encrypted data;
[0008] determining a projection matrix according to the intra-class scatter matrix and the inter-class scatter matrix;
[0009] sending the projection matrix to the initiating party and the participating party, so as to instruct the initiating party to perform data dimension reduction on the first data set according to the projection matrix, and instruct the participating party to perform data dimension reduction on the second data set according to the projection matrix.
[0010] In an embodiment, the first encrypted data comprises first classification data and first mean difference data, and the second encrypted data comprises second classification data and second mean difference data; the first classification data is determined according to data in the first data set and a first mean vector of a corresponding class, and the first mean difference data is determined according to mean differences of each class of data in the first data set; the second classification data is determined according to data in the second data set and a second mean vector of a class corresponding to the second label, and the second mean difference data is determined according to mean differences of each class of data corresponding to the second label in the second data set; the target encrypted data comprises target classification data in the second classification data and target mean difference data in the second mean difference data;
[0011] The in-class scatter matrix and the inter-class scatter matrix are determined according to the first encrypted data and the target encrypted data, comprising:
[0012] The in-class scatter matrix is determined according to the first classification data and the target classification data;
[0013] The inter-class scatter matrix is determined according to the first mean difference data and the target mean difference data.
[0014] In an embodiment, the in-class scatter matrix is determined according to the first classification data and the target classification data, comprising:
[0015] The encrypted first covariance matrix sent by the initiator and the q groups of encrypted second covariance matrices sent by the participants are obtained;
[0016] The encrypted target covariance matrix corresponding to the real class is determined from the q groups of encrypted covariance matrices according to the position identifier;
[0017] The first sub-matrix is determined according to the first classification data and the target classification data;
[0018] The in-class scatter matrix is determined according to the encrypted first covariance matrix, the encrypted target covariance matrix and the first sub-matrix.
[0019] In an embodiment, the in-class scatter matrix is determined according to the encrypted first covariance matrix, the encrypted target covariance matrix and the first sub-matrix, comprising:
[0020] The encrypted first covariance matrix, the encrypted target covariance matrix and the first sub-matrix are combined to obtain a first combined matrix;
[0021] The first combined matrices corresponding to each class of data are summed to obtain the in-class scatter matrix.
[0022] In an embodiment, the determining the inter-class scatter matrix according to the first mean difference data and the target mean difference data comprises:
[0023] obtaining a second sub-matrix sent by the initiator and q third sub-matrices sent by the participants;
[0024] determining a target sub-matrix from the q third sub-matrices according to the position identifier;
[0025] determining a fourth sub-matrix according to the first mean difference data and the target mean difference data;
[0026] determining the inter-class scatter matrix according to the second sub-matrix, the target sub-matrix and the fourth sub-matrix.
[0027] In an embodiment, if the data category is 2, the mean difference of each category of data in the first data set is the difference between the first mean vectors of two categories of data, and the mean difference of each category of data corresponding to the second label in the second data set is the difference between the second mean vectors of two categories of data; if the data category is greater than 2, the mean difference of each category of data in the first data set is the difference between the first mean vector and the global mean vector, and the mean difference of each category of data corresponding to the second label in the second data set is the difference between the second mean vector and the corresponding global mean vector.
[0028] In an embodiment, the first data set is obtained by screening and sorting a first original data set, and the second data set is obtained by screening and sorting a second original data set; the data in the first data set and the second data set have consistent identifiers.
[0029] In an embodiment, the first encrypted data and the second encrypted data are data after mask encryption, and the mask is an encryption value generated by the initiator and each participant and by each participant in pairs.
[0030] A second aspect of an embodiment of the application provides a data dimension reduction device, comprising:
[0031] The obtaining module is configured to obtain first encrypted data sent by an initiator and a position identifier, and q groups of second encrypted data sent by a participant; the first encrypted data is obtained by preprocessing and encrypting data in a first data set of the initiator and a first label corresponding to each data, and the first label represents a category of the data in the first data set; each group of the second encrypted data is obtained by preprocessing and encrypting data in a second data set of the participant and a second label corresponding to each data; q groups of the second labels are sent by the initiator to the participant, and only one group of labels in the q groups of the second labels represents a true category of the data in the second data set;
[0032] The first calculating module is configured to determine target encrypted data corresponding to the true category from the q groups of the second encrypted data according to the position identifier.
[0033] The second calculating module is configured to determine an intra-class scatter matrix and an inter-class scatter matrix according to the first encrypted data and the target encrypted data.
[0034] The third calculating module is configured to determine a projection matrix according to the intra-class scatter matrix and the inter-class scatter matrix.
[0035] The obtaining module is configured to send the projection matrix to the initiator and the participant, so as to instruct the initiator to perform data dimension reduction on the first data set according to the projection matrix, and instruct the participant to perform data dimension reduction on the second data set according to the projection matrix.
[0036] A third aspect of an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the data dimension reduction method of the first aspect described above when executing the computer program.
[0037] A fourth aspect of an embodiment of the present application provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the data dimension reduction method of the first aspect described above.
[0038] A fifth aspect of an embodiment of the present application provides a computer program product, and when the computer program product is executed on a terminal device, the terminal device executes the data dimension reduction method of any one of the first aspect described above.
[0039] The beneficial effects of this application embodiment compared to the prior art are as follows: The initiator sends q sets of second labels to the participants, and only one set of second labels represents the true category of the data in the second dataset. The coordinator obtains the initiator's preprocessed data and corresponding first labels in the first dataset, as well as the encrypted first data, and obtains the participants' preprocessed data and corresponding q sets of second labels in the second dataset, as well as the encrypted q sets of second data. The coordinator can determine the target encrypted data corresponding to the true category based on the location identifier sent by the initiator. Therefore, even if the participants' second dataset has no labels, and the initiator does not disclose the labels corresponding to the first dataset to the participants, the coordinator can still obtain the target encrypted data corresponding to the true category. Subsequently, the coordinator determines the intra-class scatter matrix and inter-class scatter matrix based on the first encrypted data and the target encrypted data, determines the projection matrix based on the intra-class scatter matrix and inter-class scatter matrix, and sends the projection matrix to the initiator and participants to instruct the initiator to perform data dimensionality reduction on the first dataset based on the projection matrix, and to instruct the participants to perform data dimensionality reduction on the second dataset based on the projection matrix. Therefore, even if the data formats of the first and second datasets are not consistent, and the data of the initiator and participants are not sent to the coordinator, the dimensionality reduction of the data of the initiator and participants can be achieved through the statistical calculations of the coordinator. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0041] Figure 1 This is a schematic diagram illustrating the implementation process of a data dimensionality reduction method provided in an embodiment of this application;
[0042] Figure 2 This is a schematic diagram of the first combination matrix provided in an embodiment of this application;
[0043] Figure 3 This is a schematic diagram of the intra-class scatter matrix provided in an embodiment of this application;
[0044] Figure 4 This is a schematic diagram of the second combination matrix provided in the embodiments of this application;
[0045] Figure 5 This is a schematic diagram of the inter-class scatter matrix provided in an embodiment of this application;
[0046] Figure 6 This is a flowchart illustrating a specific data dimensionality reduction method provided in an embodiment of this application;
[0047] Figure 7 This is a schematic diagram of a data dimensionality reduction device provided in an embodiment of this application;
[0048] Figure 8 FIG. 1 is a structural schematic diagram of a terminal device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0049] In the following description, for the purpose of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc., in order to provide a thorough understanding of the present application. However, it will be apparent to one skilled in the art that the present application can be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
[0050] It should be understood that the term "comprises" when used in this specification and the appended claims indicates the presence of the described features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0051] It should also be understood that the terms used in the present specification and the appended claims are intended to be interpreted in their broadest possible manner, and are not limited to the specific examples set forth in the detailed description and summary.
[0052] It should further be understood that the term "and / or" as used in the specification and the appended claims is intended to mean an inclusive "or" such that any combination of any one or more of the associated listed items is considered to be within the scope of the present application.
[0053] In addition, in the description of the present application, the terms "first", "second", "third", etc. are only used to distinguish descriptions, and cannot be understood as indicating or implying relative importance.
[0054] In the case where the format of the first data set of the initiator and the second data set of the participant are inconsistent, and the data of each party is not disclosed to each other, there is a certain difficulty in realizing data dimension reduction.
[0055] To this end, the application provides a data dimension reduction method. Each data in a first data set of an initiator has a first label, and each data in a second data set of a participant has no label. Therefore, the formats of the data in the first data set and the second data set are inconsistent. The initiator sends q groups of second labels to the participant, and only one group of second labels represents the true category of the data in the second data set. A coordinator obtains the preprocessed and encrypted first encrypted data of the data in the first data set and the corresponding first labels of the initiator, and obtains the preprocessed and encrypted q groups of second encrypted data of the data in the second data set and the corresponding q groups of second labels of the participant. The coordinator can determine the target encrypted data corresponding to the true category according to the position identifier sent by the initiator. Then, the coordinator determines the intra-class scatter matrix and the inter-class scatter matrix according to the first encrypted data and the target encrypted data, determines the projection matrix according to the intra-class scatter matrix and the inter-class scatter matrix, and sends the projection matrix to the initiator and the participant to instruct the initiator to perform data dimension reduction on the first data set according to the projection matrix and instruct the participant to perform data dimension reduction on the second data set according to the projection matrix. Therefore, in the case that the data formats of the first data set and the second data set are inconsistent and the initiator does not disclose the labels corresponding to the first data set to the participant, the coordinator can also obtain the target encrypted data corresponding to the true category, and finally obtain the projection matrix according to the first encrypted data and the target encrypted data, thereby realizing the dimension reduction of the data of the initiator and the data of the participant.
[0056] The data dimension reduction method provided by the application is exemplarily described below.
[0057] The data dimension reduction method provided by the application is used for reducing the data sets owned by an initiator and a plurality of participants, and is executed on a coordinator. The initiator, the participant and the coordinator can all be terminals on a blockchain.
[0058] Please refer to the accompanying Figure 1 The data dimension reduction method provided by an embodiment of the application comprises the following steps.
[0059] S101: Obtain the first encrypted data and the position identifier sent by the initiator, and obtain q groups of second encrypted data sent by each participant. The first encrypted data is obtained by preprocessing and encrypting the data in the first data set of the initiator and the first label corresponding to each data, and the first label represents the category of the data in the first data set. Each group of second encrypted data is obtained by preprocessing and encrypting the data in the second data set of the participant and the corresponding second label. The initiator sends q groups of second labels to the participant, and only one group of labels in the q groups of second labels represents the true category of the data in the second data set.
[0060] The initiator owns a first data set, and each of the plurality of participants owns a second data set. The first data set includes a plurality of data, each of which corresponds to a plurality of features, and each of which corresponds to a first label. The second data set includes a plurality of data, each of which corresponds to a plurality of features, and the data in the second data set does not have a corresponding label.
[0061] For example, the initiator is a bank, each data in the first data set is credit information of a user in the bank, including user name, loan amount, loan time, repayment time, whether overdue, etc., and the first label is a credit level (for example, any one of high, medium, and low). Each participant corresponds to an e-commerce, and each data in the second data set is e-commerce consumption information of a user, including user name, gender, residence, shopping category, shopping amount, etc.
[0062] Each data in the first data set and each data in the second data set has an identifier (such as a name, an ID number, etc.), and the first data set has the same identifier as the identifier in the second data set. Each data in the initiator corresponds to a first label, so each identifier corresponds to a first label. The initiator generates a second label corresponding to each data in the first data set according to the first label corresponding to each data in the first data set. The second label corresponds to the identifier of the data in the first data set one by one, that is, the second label corresponds to the identifier of the data in the second data set one by one. Among the plurality of second labels, only one second label represents the true category of the data in the second data set, that is, only one second label corresponds to the true label of the data in the second data set one by one.
[0063] In an embodiment, the first data set is obtained by screening and sorting a first original data set, and the second data set is obtained by screening and sorting a second original data set. The identifiers of the data in the first data set are consistent, that is, the identifiers of the data in the first data set correspond to the identifiers of the data in the second data set one by one. Therefore, the second label generated by the first data set according to the identifier of the data can correspond to the identifier of the data in the second data set one by one.
[0064] Exemplarily, the data set for data dimensionality reduction includes a data set of an initiator A and N-1 participants, and the N-1 participants are B, C,..., and N, respectively. The first original data set of the initiator A and the first label corresponding to each data are represented as represents any data in the first original data set, represents the label corresponding to the data in the first original data set; the second original data set of the participant B is represented as represents any data in the second original data set of the participant B; the second original data set of the participant N is represented as represents any data in the second data set of the N parties. is a a-dimensional vector, is a b-dimensional vector, is an n-dimensional vector, Only the data in the first original data set of the initiator A party has a corresponding first label.
[0065] The initiator filters and sorts the first original data set according to the PSI (Private Set Intersection) algorithm to obtain the first data set, and each participant filters and sorts the second original data set according to the PSI algorithm to obtain the second data set. The ID order of the data in the first data set and the data in the second data set is consistent, and the number of data in the first data set and the second data set is the same. The first data set of the initiator A party and the corresponding label of each data are represented as The second data set of the participant B party is represented as …, and the second data set of the participant N party is represented as
[0066] After obtaining the first data set, the initiator generates N-1 groups of q messages The initiator sends the N-1 groups of q messages to the N-1 participants respectively, and each participant obtains q messages. Each message is represented as id i represents the ID corresponding to the data, represents the second label corresponding to the data of the lth party, i = 1, 2…p, p represents the number of data in the first data set or the second data set, that is, each message includes a group of second labels. In each group of q messages, only one is real information, that is, only one group of second labels represents the real label (real category) of the data in the second data set of the corresponding participant.
[0067] In an embodiment, the initiator can use the mean vector of each category of data in the first data set to preprocess the data in the first data set, and then use a mask to encrypt the preprocessed data. The participant can use the mean vector of each category of data in the second data set to preprocess the data in the second data set, and then use a mask to encrypt the preprocessed data.
[0068] In an embodiment, the first encrypted data includes first classification data and first mean difference data. The initiator preprocesses the first data set according to the data in the first data set and the first mean vector of the corresponding category, and then uses a mask to encrypt, to obtain the first classification data. The participant preprocesses the second data set according to the data in the second data set and the second mean vector of the category corresponding to the second label, and then uses a mask to encrypt, to obtain the second classification data.
[0069] For example, This represents the set of data of type j for the l-th party, and the initiator uses the formula... Calculate the first mean vector sum of various data types. According to the formula Calculate the second mean vector sum of each data category (l = B, C…N). Each participant receives q messages, and each message corresponds to a set of second labels. Therefore, each participant corresponds to q sets of second labels, representing q classification methods. Based on the q classification methods, each participant calculates q sets of second mean vector sums.
[0070] The initiator updates the first dataset based on the first mean vector, thus obtaining the updated first dataset. in This represents the data in the first dataset. This represents the data in the first updated dataset. Let i represent the first label corresponding to the data in the first dataset, i = 1, 2, ..., p.
[0071] The participants' respective groups have q sets of second mean vector sums. The second dataset is then updated based on these q sets of second mean vector sums, resulting in q sets of updated second datasets.
[0072] in This represents the data in the second dataset of the l-th participant. This represents the second label of the l-th group q. This represents the sum of the second mean vectors corresponding to the second label of the l-th group q. This represents the updated data in the second dataset corresponding to the second label of the l-th group q-th element.
[0073] Initiator A and each participant B, C...N generate PSA masks pairwise according to the PSA (Practical Secure Aggregation) algorithm. For example, the masks for A and B, A and C...B and C...M and N are {mask}. AB ,mask AC , ...,mask BC ,…,mask MN}
[0074] The initiator A and all participating parties have a total of N-1 masks, and each participating party, together with the initiator and other participating parties, has a total of N-1 masks.
[0075] The initiator A encrypts the updated first data set with N-1 masks to obtain first classified data D" AB ,D" AC ,…,D" AN , a total of N-1. Wherein, Wherein, mask Ah represents the mask between the initiator A and each participant, represents the first label, and hash represents the hash operation.
[0076] The participant encrypts the updated second data set corresponding to each group of second labels with N-1 masks to obtain q groups of second classified data, respectively
[0077] Wherein,
[0078]
[0079] The second classified data corresponding to the tth group of second labels of the lth party is represented by mask lh The mask between the lth party and the hth party is represented by mask The tth group of second labels of the lth party is represented by The hash operation is represented by hash, and the size relationship between l and h is determined according to the order of the lth party and the hth party in A, B…N.
[0080] The initiator calculates the mean difference of each type of data in the first data set and encrypts it with a mask to obtain first mean difference data, and the participant calculates the mean difference of each type of data corresponding to the second label in the second data set and encrypts it with a mask to obtain second mean difference data.
[0081] In an embodiment, if the data category is 2, the mean difference of each type of data in the first data set is the difference between the first mean vector sum of 2 types of data, and the mean difference of each type of data corresponding to the second label in the second data set is the difference between the second mean vector sum of 2 types of data; if the data category is greater than 2, the mean difference of each type of data in the first data set is the difference between the first mean vector sum and the global mean vector, and the mean difference of each type of data corresponding to the second label in the second data set is the difference between the second mean vector sum and the corresponding global mean vector.
[0082] For example, if the data category is 2, the initiator calculates the mean difference of 2 types of data according to the formula Wherein, And μ1and μ2denote the first mean vector and, μ1- μ2denotes the mean difference of the two classes of data in the first dataset.
[0083] The participants calculate the mean difference of the two classes of data according to the formula μ1- μ2, where, μ1and μ2denote the second mean vector and, μ1- μ2denote the mean difference of the two classes of data corresponding to the second label of the tth group of the lth participant. μ1- μ2.
[0084] Then, the initiator encrypts the mean difference of the two classes of data with N-1 masks to obtain the first mean difference data, where, R A denotes the first mean difference data.
[0085] The participants encrypt the mean difference of the two classes of data corresponding to each second label of each group with N-1 masks to obtain q second mean difference data where, μ1- μ2denote the second mean difference data corresponding to the second label of the tth group of the lth participant.
[0086] If the data category is greater than 2, the initiator sums the first mean vectors corresponding to each class of data in the first dataset to obtain the global mean vector of the first dataset. Then, according to the formula μ1- μ2, where, μ1- μ2denote the mean difference of the jth class of data, μ l denotes the global mean vector of the first dataset.
[0087] The participants sum the second mean vectors corresponding to each class of data in the second dataset according to each second label to obtain the global mean vector of each group of the second dataset. Then, according to the formula μ1- μ2, where, μ1- μ2denote the mean difference of the jth class of data corresponding to the second label of the tth group of the lth participant, μ l,t denotes the global mean vector corresponding to the second label of the tth group of the lth participant.
[0088] Then, the initiator encrypts the mean difference of each class of data in the first dataset with N-1 masks to obtain the first mean difference data of each class of data. Where, denotes the number of the jth class of data in the first dataset, R Aj denotes the first mean difference data of the jth class of data.
[0089] The participant encrypts the mean difference of each type of data corresponding to each set of second labels by using N-1 masks to obtain q sets of second mean difference data, and each set of second mean difference data can be represented as represents the second mean difference data of the jth type of data corresponding to the tth set of second labels of the lth party, represents the number of the jth type of data corresponding to the tth set of second labels of the lth party.
[0090] Then, the coordinator obtains the first classification data, the first mean difference data, and the position identifier corresponding to the real second label from the initiator, and obtains q sets of second classification data and second mean difference data from the participants.
[0091] S102: determining target encrypted data corresponding to the real class from the q sets of second encrypted data according to the position identifier.
[0092] Specifically, each set of second encrypted data in the q sets of second encrypted data sent by the participant corresponds to a position identifier, and the set of second labels corresponding to the position identifier represents the real class of the data in the second data set. After receiving the q sets of second encrypted data, the coordinator determines the second encrypted data corresponding to the position identifier, which is the target encrypted data.
[0093] In an embodiment, the second encrypted data includes second classification data and second mean difference data, and correspondingly, the target encrypted data includes target classification data in the second classification data and target mean difference data in the second mean difference data.
[0094] S103: determining the intra-class scatter matrix and the inter-class scatter matrix according to the first encrypted data and the target encrypted data.
[0095] In an embodiment, the coordinator determines the intra-class scatter matrix according to the first classification data in the first encrypted data and the target classification data in the target encrypted data. The coordinator determines the inter-class scatter matrix according to the first mean difference data in the first encrypted data and the target mean difference data in the target encrypted data.
[0096] In an embodiment, before obtaining the first classification data and the target classification data, the coordinator obtains the encrypted first covariance matrix sent by the initiator and the q sets of encrypted second covariance matrices sent by the participants, and determines the encrypted target covariance matrix corresponding to the real class from the q sets of encrypted covariance matrices according to the position identifier.
[0097] Specifically, the initiator calculates the first covariance matrix of the jth type of data in the first data set according to the formula and then performs hash encryption on the class to obtain the encrypted first covariance matrix, which is represented as denotes the data in the updated first data set.
[0098] The participant calculates the q sets of second covariance matrices according to the formula denotes the second covariance matrix of the jth class data corresponding to the tth set of second labels of the lth participant, denotes the data in the updated second data set corresponding to the tth set of second labels of the lth participant. Then, the participant encrypts the classes to obtain the encrypted second covariance matrix, denoted as
[0099] The coordinator obtains the encrypted first covariance matrix sent by the initiator and the encrypted second covariance matrix sent by the participant, and then determines the encrypted target covariance matrix in the second covariance matrix according to the location identifier.
[0100] After obtaining the first classification data and the target classification data, the coordinator determines the first sub-matrix according to the first classification data and the target classification data. Specifically, if the first label and the second label are the same, the data corresponding to the first label and the data corresponding to the second label are the same class data, and the first label after the hash operation and the second label after the hash operation are the same. The first classification data and the target classification data are both data obtained after hash operation, and the coordinator determines the first sub-matrix according to the same first label after hash operation and the second label corresponding to the real class, combined with the formula denotes the first sub-matrix of the jth class data, denotes the set of the jth class data of the E party, denotes the set of the jth class data of the F party, and mask EF denotes the mask between the E party and the F party.
[0101] Then, the coordinator determines the intra-class scatter matrix according to the encrypted first covariance matrix, the target covariance matrix, and the first sub-matrix.
[0102] In an embodiment, the coordinator combines the encrypted first covariance matrix, the encrypted target covariance matrix, and the first sub-matrix to obtain a first combination matrix, sums the first combination matrices corresponding to each class of data to obtain the intra-class scatter matrix.
[0103] Specifically, the encrypted first covariance matrix, the encrypted target covariance matrix, and the first sub-matrix corresponding to the jth class data are taken as the elements on the diagonal of the first combination matrix as shown in Figure 2 The first submatrix of the j-th data type is used as the element in the first combined matrix excluding the diagonal.
[0104] Then, the coordinator summed the first combination matrix corresponding to each type of data, resulting in the following: Figure 3 The intra-class scatter matrix is shown.
[0105] In one embodiment, before acquiring the first mean difference data and the target mean difference data, the coordinator acquires the second sub-matrix sent by the initiator and the third sub-matrix sent by the participants, and determines the target sub-matrix from q third sub-matrixes based on the position identifier. Then, the coordinator determines the fourth sub-matrix based on the first mean difference data and the target mean difference data, and determines the inter-class scatter matrix based on the second sub-matrix, the target sub-matrix, and the fourth sub-matrix.
[0106] Specifically, if the data category is 2, the initiator uses the formula... Determine the second submatrix M AA The participants act according to the formula. Determine the third submatrix M ll ,t .
[0107] Afterwards, the initiator sends the second submatrix to the coordinator, and the participants send the third submatrix of group q to the coordinator. The coordinator then determines the target submatrix from the third submatrix based on the position identifier.
[0108] Afterwards, the coordinator followed the formula Determine the fourth submatrix M EF ,in, and These represent any two of the first mean difference data and the target mean difference data for each participant, corresponding to party E and party F respectively. EF This represents the mask between E and F.
[0109] The coordinator will use the second submatrix and the target submatrix as... Figure 5 The elements on the diagonal of the inter-class scatter matrix shown are used as the elements of the inter-class scatter matrix excluding the diagonal.
[0110] If there are more than 2 data categories, the initiator will use the formula. Determine the second submatrix corresponding to the j-th type of data. According to the formula Determine the third submatrix of the j-th class of data corresponding to the second label of the l-th group t.
[0111] Then, the initiator sends the second sub-matrix to the coordinator, the participant sends the q groups of third sub-matrix to the coordinator, and the coordinator determines the target sub-matrix from the third sub-matrix according to the location identifier.
[0112] Then, the coordinator determines the fourth sub-matrix according to the formula , wherein, and respectively represent any two of the first mean difference data and the target mean difference data of each participant, respectively corresponding to the E party and the F party, mask EF represents the mask between the E party and the F party, represents the number of the jth type of data in the E party data set.
[0113] The coordinator takes the second sub-matrix and the target sub-matrix as the elements on the diagonal line of the second combined matrix as shown in Figure 4 , that is, takes the fourth sub-matrix as the elements other than the diagonal line in the second combined matrix. Then, the second combined matrix corresponding to each type of data is summed to obtain the inter-class scatter matrix.
[0114] S104: Determine the projection matrix according to the intra-class scatter matrix and the inter-class scatter matrix.
[0115] Specifically, the coordinator multiplies the inverse matrix of the intra-class scatter matrix and the inter-class scatter matrix according to the formula to obtain the matrix M, calculates the eigenvalues greater than a preset value of the matrix M and the eigenvectors corresponding to these eigenvalues, and the matrix composed of the eigenvectors is the projection matrix. For example, the coordinator determines the maximum d eigenvalues of the matrix M and the corresponding d eigenvectors (w1, w2, …, w d ), and the d eigenvectors constitute the projection matrix W.
[0116] S105: Send the projection matrix to the initiator and the participant to instruct the initiator to perform data dimensionality reduction on the first data set according to the projection matrix, and instruct the participant to perform data dimensionality reduction on the second data set according to the projection matrix.
[0117] Specifically, after obtaining the projection matrix, the coordinator sends the projection matrix to the initiator and the participant, the initiator multiplies the transpose matrix of the projection matrix with each data of the first data set to obtain the data of the first data set after dimensionality reduction, and the participant multiplies the transpose matrix of the projection matrix with each data of the second data set to obtain the data of the second data set after dimensionality reduction. For example, the initiator and the participant obtain the data after dimensionality reduction according to the formula
[0118] In the above embodiment, the initiator sends the q groups of second labels to the participants, and only one group of second labels represents the true class of the data in the second data set. The coordinator obtains the pre-processing and encryption of the first data set and the corresponding first labels by the initiator, and obtains the pre-processing and encryption of the q groups of second labels by the participants. According to the position identifier sent by the initiator, the coordinator can determine the target encrypted data corresponding to the true class. Therefore, in the case that the second data set of the participants has no label, and the initiator does not disclose the label corresponding to the first data set to the participants, the coordinator can also obtain the target encrypted data corresponding to the true class. Then, the coordinator determines the intra-class scatter matrix and the inter-class scatter matrix according to the first encrypted data and the target encrypted data, determines the projection matrix according to the intra-class scatter matrix and the inter-class scatter matrix, and sends the projection matrix to the initiator and the participants, so as to instruct the initiator to perform data dimension reduction on the first data set according to the projection matrix, and instruct the participants to perform data dimension reduction on the second data set according to the projection matrix. Therefore, in the case that the data formats of the first data set and the second data set are not unified, and the data of the initiator and the participants is not sent to the coordinator, the data of the initiator and the participants can be reduced by statistical operation of the coordinator.
[0119] In an embodiment, the specific process of the data dimension reduction method is as shown in Figure 6
[0120] 1. The coordinator instructs the initiator and each participant to generate a mask between each other.
[0121] 2. The initiator filters and sorts the first original data set according to the PSI algorithm to obtain the first data set, and each participant filters and sorts the second original data set according to the PSI algorithm to obtain the second data set. The ID order of the data in the first data set and the data in the second data set is consistent, and the number of data in the first data set and the second data set is the same. The initiator updates the first data set according to the difference between the data in the first data set and the corresponding first mean vector and, to obtain the updated first data set.
[0122] 3. The initiator generates N-1 groups of q messages, and sends the N-1 groups of q messages to N-1 participants respectively, and each participant obtains q messages. In each group of q messages, there is only one true information. At the same time, the initiator sends the position identifier corresponding to the true message in the q messages to the coordinator.
[0123] 4. The q messages correspond to q groups of second labels, the participants determine the second mean vector sum according to the q messages, update the second data set according to the difference between the data in the second data set and the second mean vector sum of the category corresponding to the second label, to obtain q groups of updated second data sets.
[0124] 5. The initiator encrypts the updated first data set using the mask to obtain first classification data, and sends the first classification data to the coordinator. The participant encrypts each updated second data set corresponding to the second label using the mask to obtain q groups of second classification data, and sends the q groups of second classification data to the coordinator.
[0125] 6. The initiator calculates a first covariance matrix according to the updated first data set, encrypts the first covariance matrix to obtain an encrypted first covariance matrix, and sends the encrypted first covariance matrix to the coordinator. The participant calculates q groups of second covariance matrices according to the updated second data set, encrypts the second covariance matrices to obtain encrypted second covariance matrices, and sends the encrypted second covariance matrices to the coordinator.
[0126] 7. The coordinator determines a target covariance matrix from the second covariance matrices according to the location identifier, and determines target classification data from the second classification data.
[0127] 8. The coordinator determines a first sub-matrix according to the first classification data and the target classification data.
[0128] 9. The coordinator determines an intra-class scatter matrix according to the encrypted first covariance matrix, the target covariance matrix, and the first sub-matrix.
[0129] For the case of data class 2 (i.e., binary classification), the process of determining the inter-class scatter matrix is as follows.
[0130] 10.1. The initiator determines the mean difference of the 2-class data in the first data set according to the first mean vector and, and the participant calculates the mean difference of the 2-class data in the q groups of second data according to the second mean vector and.
[0131] 10.2. The initiator determines a second sub-matrix according to the mean difference of the 2-class data in the first data set, and sends the second sub-matrix to the coordinator.
[0132] 10.3. The participant determines q groups of third sub-matrices according to the mean difference of the 2-class data in the q groups of second data, and sends the q groups of third sub-matrices to the coordinator.
[0133] 10.4. The initiator encrypts the mean difference of the 2-class data in the first data set using the mask to obtain first mean difference data, and sends the first mean difference data to the coordinator.
[0134] 10.5. The participant encrypts the mean difference of the 2-class data in the q groups of second data using the mask to obtain q groups of second mean difference data, and sends the q groups of second mean difference data to the coordinator.
[0135] 10.6. The coordinator determines target mean difference data from the q sets of second mean difference data according to the position identifier, and determines a target sub-matrix from the third sub-matrices.
[0136] 10.7. The coordinator determines the inter-class scatter matrix according to the first mean difference data, the target mean difference data, the second sub-matrix, and the target sub-matrix.
[0137] For the case where the number of data classes is greater than 2 (i.e. multi-classification), the process of determining the inter-class scatter matrix is as follows.
[0138] 10.1. The initiator calculates the global mean vector of the first data set, calculates the difference between the first mean vector of each class of data and the global mean vector, and obtains the mean difference of each class of data in the first data set. The participant calculates the difference between the second mean vector corresponding to the q sets of second labels and the global mean vector, and obtains the mean difference of each class of data in the q second data sets.
[0139] 10.2. The initiator determines the second sub-matrix according to the mean difference of each class of data in the first data set, and sends the second sub-matrix to the coordinator.
[0140] 10.3. The participant obtains the q sets of third sub-matrices according to the mean difference of each class of data in the q sets of second data sets, and sends the q sets of third sub-matrices to the coordinator.
[0141] 10.4. The initiator encrypts the mean difference of each class of data in the first data set using a mask to obtain first mean difference data, and sends the first mean difference data to the coordinator.
[0142] 10.5. The participant encrypts the mean difference of each class of data in the q sets of second data sets using a mask to obtain q sets of second mean difference data, and sends the q sets of second mean difference data to the coordinator.
[0143] 10.6. The coordinator determines target mean difference data from the q sets of second mean difference data according to the position identifier, and determines a target sub-matrix from the third sub-matrices.
[0144] 10.7. The coordinator determines the inter-class scatter matrix according to the first mean difference data, the target mean difference data, the second sub-matrix, and the target sub-matrix.
[0145] 11. The coordinator determines the projection matrix according to the intra-class scatter matrix and the inter-class scatter matrix.
[0146] 12. The initiator determines the first data set after dimensionality reduction according to the projection matrix, and the participant determines the second data set after dimensionality reduction according to the projection matrix.
[0147] In the above embodiment, each data in the first data set of the initiator has a first label, and the second data set of the participant has no label. The initiator sends q groups of second labels to the participant, and only one group of second labels represents the true category of the data in the second data set. The coordinator obtains the pre-processing and encryption of the data in the first data set and the corresponding first label by the initiator, and obtains the pre-processing and encryption of the data in the second data set and the corresponding q groups of second labels by the participant. The coordinator can determine the target encryption data corresponding to the true category according to the position identifier sent by the initiator. Then, the coordinator determines the intra-class scatter matrix and the inter-class scatter matrix according to the first encryption data and the target encryption data, determines the projection matrix according to the intra-class scatter matrix and the inter-class scatter matrix, and sends the projection matrix to the initiator and the participant to instruct the initiator to perform data dimension reduction on the first data set according to the projection matrix and instruct the participant to perform data dimension reduction on the second data set according to the projection matrix. Therefore, in the case that the data formats of the first data set and the second data set are not unified and the initiator does not disclose the labels corresponding to the first data set to the participant, the coordinator can also obtain the target encryption data corresponding to the true category, and finally obtain the projection matrix according to the first encryption data and the target encryption data, so as to realize the dimension reduction of the data of the initiator and the data of the participant. Moreover, under the premise of ensuring security, the communication amount is small, the operation process is simple, and the data calculation speed is improved.
[0148] It should be understood that the size of the serial number of each step in the above embodiment does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0149] According to the data dimension reduction method described in the above embodiment, Figure 7 The structure block diagram of the data dimension reduction device provided by the embodiments of the present application is shown. For the convenience of description, only the parts related to the embodiments of the present application are shown.
[0150] As Figure 7 shown, the data dimension reduction device comprises,
[0151] The acquisition module 71 is configured to acquire the first encryption data and the position identifier sent by the initiator, and acquire q groups of second encryption data sent by each participant. The first encryption data is obtained by pre-processing and encrypting the data in the first data set of the initiator and the corresponding first label of each data, and the first label represents the category of the data in the first data set. Each group of second encryption data is obtained by pre-processing and encrypting the data in the second data set of the participant and the corresponding second label. The initiator sends q groups of second labels to the participant, and only one group of labels in the q groups of second labels represents the true category of the data in the second data set.
[0152] The first calculation module 72 is configured to determine target encrypted data corresponding to the real class from the q groups of the second encrypted data according to the position identifier;
[0153] The second calculation module 73 is configured to determine an intra-class scatter matrix and an inter-class scatter matrix according to the first encrypted data and the target encrypted data;
[0154] The third calculation module 74 is configured to determine a projection matrix according to the intra-class scatter matrix and the inter-class scatter matrix;
[0155] The acquisition module 75 is configured to send the projection matrix to the initiator and the participant, so as to instruct the initiator to perform data dimension reduction on the first data set according to the projection matrix, and instruct the participant to perform data dimension reduction on the second data set according to the projection matrix.
[0156] In an embodiment, the first encrypted data includes first classification data and first mean difference data, and the second encrypted data includes second classification data and second mean difference data; the first classification data is determined according to data in the first data set and a first mean vector of a corresponding class, and the first mean difference data is determined according to mean differences of data of each class in the first data set; the second classification data is determined according to data in the second data set and a second mean vector of a class corresponding to the second label, and the second mean difference data is determined according to mean differences of data of each class corresponding to the second label in the second data set; the target encrypted data includes target classification data in the second classification data and target mean difference data in the second mean difference data;
[0157] The second calculation module 73 is specifically configured to:
[0158] determine an intra-class scatter matrix according to the first classification data and the target classification data;
[0159] determine an inter-class scatter matrix according to the first mean difference data and the target mean difference data.
[0160] In an embodiment, the second calculation module 73 is specifically configured to:
[0161] acquire a first encrypted covariance matrix sent by the initiator and q groups of second encrypted covariance matrices sent by the participant;
[0162] determine an encrypted target covariance matrix corresponding to the real class from the q groups of the encrypted covariance matrices according to the position identifier;
[0163] determine a first sub-matrix according to the first classification data and the target classification data;
[0164] determine an intra-class scatter matrix according to the encrypted first covariance matrix, the encrypted target covariance matrix and the first sub-matrix.
[0165] In an embodiment, the second calculation module 73 is specifically configured to:
[0166] combine the encrypted first covariance matrix, the encrypted target covariance matrix and the first sub-matrix to obtain a first combined matrix;
[0167] sum the first combined matrices corresponding to the data of each class to obtain an intra-class scatter matrix.
[0168] In an embodiment, the second calculation module 73 is specifically configured to:
[0169] obtain a second sub-matrix sent by the initiator and q third sub-matrices sent by the participants;
[0170] determine a target sub-matrix from the q third sub-matrices according to the position identifier;
[0171] determine a fourth sub-matrix according to the first mean difference data and the target mean difference data;
[0172] determine an inter-class scatter matrix according to the second sub-matrix, the target sub-matrix and the fourth sub-matrix.
[0173] In an embodiment, if the data class is 2, the mean difference of the data of each class in the first data set is the difference between the first mean vectors of 2 classes, and the mean difference of the data of each class corresponding to the second label in the second data set is the difference between the second mean vectors of 2 classes; if the data class is greater than 2, the mean difference of the data of each class in the first data set is the difference between the first mean vector and the global mean vector, and the mean difference of the data of each class corresponding to the second label in the second data set is the difference between the second mean vector and the corresponding global mean vector.
[0174] In an embodiment, the first data set is obtained by screening and sorting a first original data set, and the second data set is obtained by screening and sorting a second original data set; the data in the first data set and the second data set have consistent identifiers.
[0175] In an embodiment, the first encrypted data and the second encrypted data are data encrypted by a mask, and the mask is an encryption value generated between the initiator and each participant and between each participant.
[0176] It should be noted that the information interaction, execution process and the like between the above apparatuses / units are based on the same concept as the method embodiments of the present application, and the specific functions and the brought technical effects can be referred to the method embodiments part. Therefore, no further description is given here.
[0177] Figure 8 is a structural schematic diagram of a terminal device provided by the embodiment of the present application. The terminal device can be a desktop computer, a notebook computer, a palm computer, a cloud server and the like.
[0178] As shown in Figure 8 , the terminal device of the embodiment includes a processor 81, a memory 82, and a computer program 83 stored in the memory 82 and executable on the processor 81. The processor 81 implements the steps in the above data dimension reduction method embodiments when executing the computer program 83, for example, steps S101-S105 as shown in Figure 1 . Alternatively, the processor 81 implements the functions of the modules / units in the above apparatus embodiments when executing the computer program 83, for example, the functions of the obtaining module 71 to the sending module 75 as shown in Figure 7 .
[0179] For example, the computer program 83 can be divided into one or more modules / units, which are stored in the memory 82 and executed by the processor 81 to complete the present application. The one or more modules / units can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program 83 in the terminal device.
[0180] Those skilled in the art can understand that Figure 8 the terminal device is only an example and does not constitute a limitation on the terminal device, and can include more or fewer components than the diagram, or combine certain components, or different components, for example, the terminal device can also include an input / output device, a network access device, a bus and the like.
[0181] The processor 81 can be a central processing unit (CPU), and can also be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0182] The memory 82 can be an internal storage unit of the terminal device, such as a hard disk or a memory of the terminal device. The memory 82 can also be an external storage device of the terminal device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the memory 82 can also include both the internal storage unit and the external storage device of the terminal device. The memory 82 is used to store the computer program and other programs and data required by the terminal device. The memory 82 can also be used to temporarily store data that has been output or is to be output.
[0183] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional units and modules is exemplified, and in actual application, the above functions can be completed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to complete all or part of the above-described functions. Each functional unit and module in the embodiment can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit, and the integrated unit can be realized in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for easy distinction, and do not limit the protection scope of the present application. The specific working process of the units and modules in the above system can refer to the corresponding process in the foregoing method embodiments, which will not be described here.
[0184] In the above embodiments, the description of each embodiment has its own emphasis, and the parts not described or recorded in detail in a certain embodiment can be referred to the relevant description of other embodiments.
[0185] In the embodiments of the present application, it should be understood that the disclosed apparatus / terminal device and method can be implemented in other manners. For example, the described apparatus / terminal device embodiments are merely schematic. For example, the division of the modules or units is merely logical function division. There can be another division manner for the actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be electrical, mechanical or in other forms.
[0186] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiments.
[0187] In addition, each functional unit in the various embodiments of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0188] If the integrated module / unit is realized in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, all or part of the flow of the above-mentioned embodiment methods can also be completed by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. When the processor executes the computer program, the steps of each method embodiment described above can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable file or some intermediate form. The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc.
[0189] Those skilled in the art can understand that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software manner depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0190] The above-described embodiments are only used to illustrate the technical solutions of the present application, but not limit the present application; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced by equivalent replacements; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A data dimensionality reduction method, executed on a coordinating party, characterized in that, The method includes: The process involves obtaining the first encrypted data and location identifier sent by the initiator, and obtaining q sets of second encrypted data sent by each participant. The first encrypted data is obtained by preprocessing and encrypting the data in the first dataset of the initiator and the first label corresponding to each data point, where the first label represents the category of the data in the first dataset. Each set of second encrypted data is obtained by preprocessing and encrypting the data in the second dataset of the participant and the corresponding second label. The q sets of second labels are sent by the initiator to the participants, and only one set of labels in the q sets of second labels represents the true category of the data in the second dataset. The target encrypted data corresponding to the real category is determined from the second encrypted data in group q based on the location identifier; The intra-class scatter matrix and inter-class scatter matrix are determined based on the first encrypted data and the target encrypted data; The projection matrix is determined based on the intra-class scatter matrix and the inter-class scatter matrix; The projection matrix is sent to the initiator and the participants to instruct the initiator to perform dimensionality reduction on the first dataset based on the projection matrix, and to instruct the participants to perform dimensionality reduction on the second dataset based on the projection matrix.
2. The data dimensionality reduction method according to claim 1, characterized in that, The first encrypted data includes first category data and first mean difference data; the second encrypted data includes second category data and second mean difference data. The first category data is determined based on the sum of the first mean vectors of the data in the first dataset and the corresponding categories; the first mean difference data is determined based on the mean difference of each category in the first dataset. The second category data is determined based on the sum of the second mean vectors of the data in the second dataset and the corresponding categories of the second label; the second mean difference data is determined based on the mean difference of each category corresponding to the second label in the second dataset. The target encrypted data includes target category data in the second category data and target mean difference data in the second mean difference data. The step of determining the intra-class scatter matrix and inter-class scatter matrix based on the first encrypted data and the target encrypted data includes: Determine the intra-class scatter matrix based on the first classification data and the target classification data; The inter-class scatter matrix is determined based on the first mean difference data and the target mean difference data.
3. The data dimensionality reduction method according to claim 2, characterized in that, The step of determining the intra-class scatter matrix based on the first classification data and the target classification data includes: Obtain the encrypted first covariance matrix sent by the initiator and the q sets of encrypted second covariance matrices sent by the participants; Based on the location identifier, determine the encrypted target covariance matrix corresponding to the true category from the encrypted covariance matrices of group q; A first sub-matrix is determined based on the first classification data and the target classification data; The intra-class scatter matrix is determined based on the encrypted first covariance matrix, the encrypted target covariance matrix, and the first submatrix.
4. The data dimensionality reduction method according to claim 3, characterized in that, The step of determining the intra-class scatter matrix based on the encrypted first covariance matrix, the encrypted target covariance matrix, and the first submatrix includes: The encrypted first covariance matrix, the encrypted target covariance matrix, and the first submatrix are combined to obtain a first combined matrix. Summing the first combination matrix corresponding to each type of data yields the intra-class scatter matrix.
5. The data dimensionality reduction method according to claim 2, characterized in that, The step of determining the inter-class scatter matrix based on the first mean difference data and the target mean difference data includes: Obtain the second sub-matrix sent by the initiator and the q third sub-matrixes sent by the participants; The target submatrix is determined from the q third submatrixes based on the location identifier; The fourth sub-matrix is determined based on the first mean difference data and the target mean difference data; The inter-class scatter matrix is determined based on the second sub-matrix, the target sub-matrix, and the fourth sub-matrix.
6. The data dimensionality reduction method according to claim 2, characterized in that, If the data category is 2, the mean difference of each category in the first dataset is the difference between the sum of the first mean vectors of the two categories of data, and the mean difference of each category of the second label in the second dataset is the difference between the sum of the second mean vectors of the two categories of data; If there are more than 2 data categories, the mean difference between each category in the first dataset is the difference between the first mean vector and the global mean vector, and the mean difference between each category corresponding to the second label in the second dataset is the difference between the second mean vector and the corresponding global mean vector.
7. The data dimensionality reduction method according to claim 1, characterized in that, The first dataset is obtained by filtering and sorting the first original dataset, and the second dataset is obtained by filtering and sorting the second original dataset; the data in the first dataset and the second dataset have the same identifier.
8. The data dimensionality reduction method according to claim 1, characterized in that, The first encrypted data and the second encrypted data are data encrypted with a mask, wherein the mask is an encrypted value generated in pairs between the initiator and each of the participants, and between each of the participants.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the data dimensionality reduction method as described in any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the data dimensionality reduction method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Hyperspectral image dimension reduction method and device, terminal equipment and storage medium
CN112150396A
Data processing method and device
CN113780327A