Longitudinal federal data enhancement method for sample imbalance problem

By adopting the SMOTE sampling method based on the principle of random abandonment in vertical federated learning, the sample imbalance problem in vertical federated learning is solved, and new samples are generated, model fitting effect is improved and label leakage is avoided, and data is realized balance.

CN119150321AActive Publication Date: 2024-12-17SHENYANG AEROSPACE UNIVERSITY +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411235196.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-04
Publication Date
2024-12-17
Estimated Expiration
2044-09-04

AI Technical Summary

Technical Problem

In vertical federated learning scenarios, the sample imbalance problem is amplified, and the existing solutions are mainly applicable to horizontal federated learning scenarios. In vertical federated learning, the SMOTE algorithm has the risk of label leakage in vertical federated learning, which is difficult to effectively solve.

Method used

Using the SMOTE sampling method based on the random abandonment principle, the coordinator generates a homomorphic encryption key pair, and the Participant I and Participant II generate an encryption distance matrix, decrypt and interpolate based on the private key, and combines the interpolation principle of SMOTE to generate. New samples ensure sample balance without revealing tag information.

Benefits of technology

It effectively solves the sample imbalance problem in vertical federated learning, generates new small-class samples, improves the model fitting effect, avoids label leakage, and achieves data balance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119150321A_ABST
    Figure CN119150321A_ABST
Patent Text Reader

Abstract

The invention relates to a longitudinal federal data enhancement method for a sample imbalance problem, which comprises the following steps that: a coordinator generates a homomorphic encryption key pair, retains a private key, and distributes a public key to a participant I and a participant II in participants; meanwhile, the participant I and the participant II generate respective encryption key pairs, reserve own private keys and send public keys to each other; the coordinator decrypts the encrypted distance matrix based on a private key to obtain an unencrypted distance matrix, generates interpolation information based on a random abandoning principle, encrypts the interpolation information through a public key sent by the participant II, and sends the encrypted interpolation information to the participant II; whether the number of the small samples meets the requirement or not is judged, the participant I adds the small-class samples of the new samples Xgnnew of all the participants I in the process to the original data Xg of the participant I, and the sample parts, not used for interpolation, in the original data Xg of the participant I are replaced by the multiple-class samples; and the balance of multi-class samples and few-class samples in the original data of the participant I and the participant II is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of artificial intelligence and relates to a longitudinal federated data enhancement method for sample imbalance problem. Background Art

[0002] Privacy computing technologies represented by federated learning have developed rapidly in recent years and have become a popular method to break data silos. It is similar to distributed learning, but places more emphasis on protecting user data privacy. In a federated learning scenario, data usually resides on the user's device, ensuring that the central server only receives and aggregates model parameters, not raw data. This feature allows all participants to cooperate with each other without leaking privacy, and use multi-party data to improve the performance and accuracy of the model.

[0003] The collaborative modeling method in federated learning breaks down data silos, improves data availability, and also raises the requirements for data quality. For example, the sample imbalance problem is amplified in this scenario. Especially in vertical federated learning, there are strict requirements for customer overlap between two or more participants. After sample encryption and alignment, the imbalanced problem may be further amplified.

[0004] Most of the current methods for solving sample imbalance in federated learning scenarios are applicable to horizontal federated learning scenarios, while there is limited research on solving sample imbalance in vertical federated scenarios. Vertical federated learning involves challenges such as model partitioning, secure data storage and transmission, efficient model aggregation, updating, and ensuring label privacy during imbalanced processing.

[0005] Sample enhancement is the most direct way to solve the imbalance problem in traditional centralized learning. The balance is made up by increasing the number of minority class samples. Among them, the SMOTE algorithm has always been trusted. In recent years, SMOTE variants have emerged in a blowout manner. Therefore, it is introduced into vertical federated learning, but this method has risks. The SMOTE algorithm generates new samples by neighbor interpolation between minority class samples, which will allow the party without labels to infer the sample labels, especially for binary classification tasks, which will cause the labels to be completely leaked. The secure and privacy-preserving SMOTE sampling method based on the random abandonment principle proposed in the present invention can effectively solve this problem. Summary of the invention

[0006] In order to solve the above problems, the technical solution adopted by the present invention is: a longitudinal federated data enhancement method for sample imbalance problem, comprising the following steps:

[0007] Step 1: The coordinator generates a homomorphic encryption key pair, retains the private key, and distributes the public key to Participant I and Participant II. At the same time, Participant I and Participant II generate their own encryption key pairs, retain their own private keys, and send the public key to each other.

[0008] Step 2: Get the original data X of participant I g The minority class samples and multiple multi-class samples are used as interpolation samples X g_interpolation , generate the encrypted distance matrix [[D total ]];

[0009] Step 3: The coordinator decrypts the encrypted distance matrix [[D total ]], get the unencrypted distance matrix D total , sort the distance information of each row of the coordinator distance matrix in ascending order, and save the corresponding index in a matrix Idx alldis ,Idx alldis ∈R n×n , denoted as, and sent to participant I;

[0010] Step 4: Participant I selects Idx according to the number of neighbors K. alldis Find the K nearest neighbors of each sample except itself, denoted as Idx K ;

[0011] Step 5: Based on the random abandonment principle, generate interpolation information, encrypt it with the public key sent by participant II, and send it to participant II;

[0012] Step 6: Participant II uses the key to decrypt the encrypted information sent by participant I and obtain the interpolated information. Participants I and II generate new samples by combining the interpolated information and the interpolation principle of SMOTE: Participants I and II obtain their own new samples X g_new and X h_new , participant I sends the new sample X g_new Samples X added to the alignment for interpolation g_interpolation In the example, participant II sends the new sample X h_new Add to the interpolated sample X after alignment h_interpolation , used for the next round of interpolation;

[0013] Step 7: Determine whether the number of samples meets the requirement. If not, return to step 3. If it meets the requirement, give participant I a new sample X. g_new and new sample X from participant II h_new The same ID information, participant II will transfer all X h_new Add to X h , participant I will take all the new samples X of participant I in this process g_newThe minority class samples are added to the original data X of participant I g , multi-class samples for participant I original data X g The samples X in which interpolation is not performed g_nointerpolation Partial replacement is performed to achieve a balance between the multi-class samples and the minority-class samples in the original data of Participant I and Participant II.

[0014] Furthermore: the participant I and the participant II generate their own encryption key pairs and encrypt them using the asymmetric encryption method RSA.

[0015] Furthermore: the number of the small number of samples is more than 50% of the original data of participant I.

[0016] Further: the interpolated sample of participant I and the original data X of participant II h The interpolation sample alignment under privacy protection uses the ID number to perform the interpolation sample alignment under privacy protection.

[0017] Furthermore: the distance matrix of participant I or the distance matrix of participant II is aggregated to obtain the distance matrix of the participant, that is, the distance matrix of participant I is added to the distance matrix of participant II to obtain the distance matrix of the participant.

[0018] Further: the process of generating the encrypted distance matrix based on the participants I and II is as follows:

[0019] Get participant I's raw data X g The minority class samples and multiple multi-class samples are used as interpolation samples X g_interpolation , the interpolated sample of participant I and the original data X of participant II h Perform interpolation sample alignment under privacy protection, and participant II obtains the aligned sample X h_interpolation , the sample that participant I did not use for interpolation is X g_nointerpolation , then the following relationship is satisfied:

[0020] Calculate the distance between each two samples in Participant I and Participant II respectively by index order, and save the distance matrix D respectively. a ,a∈{g,h},D a ∈R n×n , n is the number of samples, and the encrypted distance matrix [[D a ]], where participant I does not calculate the label when calculating the distance;

[0021] The distance matrix of the participants is obtained by aggregating the distance matrix of participant I or the distance matrix of participant II: total ]]=ΣDa , the coordinator obtains the distance matrix of the participants.

[0022] Further: the process of generating interpolation information based on the random abandonment principle, encrypting it with the public key sent by participant II, and sending it to participant II is as follows:

[0023] Participant I uses the random abandonment principle, that is, for each sample, a random abandonment factor λ, λ∈(0,1) is introduced, and different abandonment thresholds are given to the random abandonment factor according to the category of the sample. The abandonment threshold of the minority class sample is recorded as threshold minority , the abandonment threshold of multi-class samples is recorded as threshold majority , when λ is greater than the corresponding threshold, the sample is skipped and no interpolation is performed; an interpolation node weight ω is randomly generated for the sample that needs to be interpolated, ω∈(0,1). Finally, participant I indexes the sample that needs to be interpolated Idx interpolation And its Idx K The index Idx of a neighbor randomly selected from the K neighbors corresponds to near It is packaged with the corresponding interpolation weight ω, encrypted with the public key sent by participant II, and sent to participant II.

[0024] Further: threshold minority >threshold majority , 1≥threshold minority ≥0, 1≥threshold majority ≥0.

[0025] Furthermore, the participants I and II generate new samples x by interpolating information and combining the interpolation principle of SMOTE. ai_new as follows:

[0026] x ai_new =x ai +ω i (x ai_near -x ai ),a∈{g,h}

[0027] Where: x i represents the samples used for interpolation, x i_near represents its nearest neighbor sample, ω i is the interpolation node weight, a represents the participant, g represents participant I, and h represents participant II.

[0028] The invention provides a method for enhancing longitudinal federated data for sample imbalance problem, which has the following advantages:

[0029] The present invention is a sampling method for the sample imbalance problem in a vertical federation scenario. It uses the random abandonment principle to generate new minority samples as much as possible to compensate for the sample balance without leaking label information, thereby solving the problem of unsatisfactory model fitting effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0031] Figure 1 It is a flow chart of the scheme of the present invention;

[0032] Figure 2 For the random abandonment principle explanation diagram of the present invention, ;

[0033] Figure 3 The radar charts of the evaluation parameters of the classification prediction results after sampling and compensating the imbalance of the three types of imbalanced data and the classification prediction results of the original imbalanced data are compared in the present invention (average of 10 random experiments), where (a) is the radar chart of vowel, (b) is the radar chart of segment, and (c) is the radar chart of shuttle;

[0034] Figure 4 The following is a comparison chart of the evaluation parameter F1-score of the classification prediction results after sampling and compensating the imbalance of three types of imbalanced data and the classification prediction results of the original imbalanced data in 10 random experimental lines, where (a) is the experimental line comparison chart of vowel, (b) is the experimental line comparison chart of segment, and (c) is the experimental line comparison chart of shuttle;

[0035] Figure 5 The radar charts of the evaluation parameters of the classification prediction results after sampling and compensating the imbalance of the three types of imbalanced data in the present invention without considering label leakage and using SMOTE sampling to compensate for the balance (same imbalance ratio) are compared (average of 10 random experiments), where (a) is the comparison radar chart of vowel, (b) is the comparison radar chart of segment, and (c) is the comparison radar chart of shuttle;

[0036] Figure 6The box-line comparison diagram of the evaluation parameter F1-score of the classification prediction results after sampling to compensate for the imbalance of three types of imbalanced data in the present invention without considering label leakage and using SMOTE sampling to compensate for the balance (same imbalance ratio) in 10 random experiments; (a) is the box-line comparison diagram of vowel, (b) is the box-line comparison diagram of segment, and (c) is the box-line comparison diagram of shuttle. DETAILED DESCRIPTION

[0037] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0038] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and is by no means intended to limit the present invention and its application or use. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0039] Figure 1 It is a flow chart of the scheme of the present invention;

[0040] A longitudinal federated data augmentation method for sample imbalance problem includes the following steps:

[0041] Step 1: The coordinator generates a homomorphic encryption key pair, retains the private key, and distributes the public key to Participant I and Participant II. At the same time, Participant I and Participant II generate their own encryption key pairs, retain their own private keys, and send the public key to each other.

[0042] Step 2: Get the original data X of participant I g The minority class samples and multiple multi-class samples are used as interpolation samples X g_interpolation , generate the encrypted distance matrix [[D total ]];

[0043] Step 3: The coordinator decrypts the encrypted distance matrix [[D total ]], get the unencrypted distance matrix D total , sort the distance information of each row of the coordinator distance matrix in ascending order, and save the corresponding index in a matrix Idx alldis ,Idx alldis ∈R n×n , denoted as, and sent to participant I;

[0044] Step 4: Participant I selects Idx according to the number of neighbors K. alldis Find the K nearest neighbors of each sample except itself, denoted as Idx K ;

[0045] Step 5: Based on the random abandonment principle, generate interpolation information, encrypt it with the public key sent by participant II, and send it to participant II;

[0046] Step 6: Participant II uses the key to decrypt the encrypted information sent by participant I and obtain the interpolated information. Participants I and II generate new samples by combining the interpolated information and the interpolation principle of SMOTE: Participants I and II obtain their own new samples X g_new and X h_new , participant I sends the new sample X g_new Samples X added to the alignment for interpolation g_interpolation In the example, participant II sends the new sample X h_new Add to the interpolated sample X after alignment h_interpolation , used for the next round of interpolation;

[0047] Step 7: Determine whether the number of samples meets the requirement. If not, return to step 3. If it meets the requirement, give participant I a new sample X. g_new and new sample X from participant II h_new Same ID information (do not repeat with the original data), participant II will add all X h_new Add to X h , participant I will take all the new samples X of participant I in this process g_new The minority class samples are added to the original data X of participant I g , multi-class samples for participant I original data X g The samples X in which interpolation is not performed g_nointerpolation Partially replace, and finally get a new X g and X h , to achieve a balance between multi-class samples and minority-class samples in the original data of Participant I and Participant II.

[0048] Steps S1 / S2 / S3 / S4 / S5 are executed sequentially;

[0049] Supplementary Coordinator, Participant, Participant I and Participant II

[0050] The coordinator is a third party with integrity outside the modeling participants, and is used to coordinate and transmit the intermediate parameters of the model to prevent any party from knowing the other party's information.

[0051] Participants are the key roles in model building.

[0052] Participant I, the initiator of model building, carries partial feature information and sample labels of the samples;

[0053] Participant II, the invited party to build the model, has overlapping samples with Participant I, but contains different feature information and does not carry sample labels.

[0054] Furthermore: the participant I and the participant II generate their own encryption key pairs and encrypt them using the asymmetric encryption method RSA.

[0055] Furthermore: the number of the small number of samples is more than 50% of the original data of participant I.

[0056] Further: the interpolated sample of participant I and the original data X of participant II h The interpolation sample alignment under privacy protection uses the ID number to perform the interpolation sample alignment under privacy protection.

[0057] Furthermore: the distance matrix of participant I or the distance matrix of participant II is aggregated to obtain the distance matrix of the participant, that is, the distance matrix of participant I is added to the distance matrix of participant II to obtain the distance matrix of the participant.

[0058] Further: the acquisition of participant I original data X g The minority class samples and multiple multi-class samples are used as interpolation samples X g_interpolation , generate the encrypted distance matrix [[D total The process is as follows:

[0059] S21: Get the original data X of participant I g The minority class samples and multiple multi-class samples are used as interpolation samples X g_interpolation , the interpolated sample of participant I and the original data X of participant II h Perform interpolation sample alignment under privacy protection, and participant I obtains the aligned sample X h_interpolation , the sample that participant I did not use for interpolation is X g_nointerpolation , then the following relationship is satisfied:

[0060] S22: After the samples are aligned, the same sample is in the same position in both participants, so subsequent operations can be performed by indexing only. The distance between each two samples in participant I and participant II is calculated in order of indexes, and the distance matrix D is saved respectively. a ,a∈{g,h},D a ∈R n×n , n is the number of samples, and the encrypted distance matrix [[Da ]], where participant I does not calculate the label when calculating the distance;

[0061] S23: The distance matrix of the participants is obtained by aggregating the distance matrix of participant I or the distance matrix of participant II: total ]]=ΣD a , the coordinator obtains the distance matrix of the participants.

[0062] Figure 2 This is an explanation diagram of the random abandonment principle of the present invention.

[0063] Further: the process of generating interpolation information based on the random abandonment principle, encrypting it with the public key sent by participant II, and sending it to participant II is as follows:

[0064] Participant I uses the random abandonment principle, that is, for each sample, a random abandonment factor λ, λ∈(0,1) is introduced, and different abandonment thresholds are given to the random abandonment factor according to the category of the sample. The abandonment threshold of the minority class sample is recorded as threshold minority , the abandonment threshold of multi-class samples is recorded as threshold majority , when λ is greater than the corresponding threshold, the sample is skipped and no interpolation is performed; an interpolation node weight ω is randomly generated for the sample that needs to be interpolated, ω∈(0,1). Finally, participant I indexes the sample that needs to be interpolated Idx interpolation And its Idx K The index Idx of a neighbor randomly selected from the K neighbors corresponds to near It is packaged with the corresponding interpolation weight ω, encrypted with the RSA public key sent by participant II, and sent to participant II.

[0065] Further: threshold minority >threshold majority , 1≥threshold minority ≥0, 1≥threshold majority ≥0.

[0066] Furthermore, the participants I and II generate new samples x by interpolating information and combining the interpolation principle of SMOTE. ai_new as follows:

[0067] x ai_new =x ai +ω i (x ai_near -x ai ),a∈{g,h}

[0068] Where: x irepresents the samples used for interpolation, x i_near represents its nearest neighbor sample, ω i is the interpolation node weight, a represents the participant, g represents participant I, and h represents participant II.

[0069] Participant I carries the label calculation while performing this process;

[0070] This example uses three unbalanced datasets, vowel, segment and shuttle, with an imbalance ratio between 6 and 13. (See KEEL: https: / / sci2s.ugr.es / keel / imbalanced.php?order=feat#sub10) to conduct experiments. The three datasets are divided into two parties according to the importance of features, where the party holding weak features and labels is participant I, and the party holding strong features is participant II. In the data of participant I, 40% of the minority class samples and an equal amount of multi-class samples are used as prediction data, and the remaining data are used as training data. The host data is not segmented and is directly used for sample intersection.

[0071] Embodiment 1: This example is to explore whether the present invention can effectively solve the sample imbalance problem in the vertical federated learning scenario.

[0072] (1) Sampling stage: Participant I randomly selects 50%-70% of the minority class samples and 3-6 times of the majority class samples in the training set as interpolation samples. The two parties perform sample intersection, so that the two parties obtain two parts for interpolation samples, and the order corresponds one to one. By performing sample sampling according to the present invention, the imbalance ratio is reduced to between 2 and 3.

[0073] (2) Training phase: Participant II and Participant I perform sample intersection on the original unbalanced training data and the training data obtained after sampling by the present invention to obtain their own training data. Both parties send the training data to the classification training model for training, and save the two models afterwards.

[0074] (3) Prediction stage: Participant II obtains its own prediction data by performing sample intersection with the prediction data of participant I. Both parties predict the prediction data using the above model and use evaluation indicators such as AUC, F1-score, KS, Precision, Recall, and Gmeans to evaluate the prediction ability. The evaluation indicators of the 10 experimental results are averaged and the radar contrast is drawn. Figure 3 As shown (these 6 indicators are all between 0 and 1, and the larger the better). Figure 3The radar charts of the evaluation parameters of the classification prediction results after sampling and compensating the imbalance of the three types of imbalanced data and the classification prediction results of the original imbalanced data are compared in the present invention (average of 10 random experiments), where (a) is the radar chart of vowel, (b) is the radar chart of segment, and (c) is the radar chart of shuttle;

[0075] observe Figure 3 The classification ability of the data sampled from the three data sets is significantly stronger than that of the original data model. At the same time, the F1-score of the 10 experiments is plotted as a discounted comparison chart as shown in the figure. Figure 4 shown.

[0076] Figure 4 The following is a comparison chart of the evaluation parameter F1-score of the classification prediction results after sampling and compensating the imbalance of three types of imbalanced data and the classification prediction results of the original imbalanced data in 10 random experimental lines, where (a) is the experimental line comparison chart of vowel, (b) is the experimental line comparison chart of segment, and (c) is the experimental line comparison chart of shuttle;

[0077] observe Figure 4 , the F1-score of the 10 experiments on the three data sets of the present invention is higher than the results of the original data. The results show that the present invention can effectively improve the sample imbalance problem in the vertical federated learning scenario.

[0078] Embodiment 2: This example is to explore whether the present invention, due to the need for label protection, uses some minority samples for interpolation, and uses pseudo data samples generated by multi-class samples to replace the original multi-class samples, which will lead to serious performance loss.

[0079] (1) Sampling stage: The sampling method of the present invention is the same as that of Example 1, but the traditional SMOTE method is used to generate new samples by interpolating only the minority class samples without changing the multi-class samples. The same imbalance ratio is controlled, and the number of samples of each class is almost the same.

[0080] (2) Training phase: Participant II and Participant I perform sample intersection on the training data obtained after traditional SMOTE sampling and the training data obtained after sampling of the present invention to obtain their own training data. Both parties send the training data to the classification training model for training and save the two models afterwards.

[0081] (3) Prediction stage: Participant II obtains its own prediction data by performing sample intersection with the prediction data of participant I. Both parties predict the prediction data using the above model, and also use AUC, F1-score, KS, Precision, Recall, Gmeans and other evaluation indicators to evaluate the prediction ability. The evaluation indicators of the 10 experimental results are averaged and the radar contrast is drawn. Figure 5 shown.

[0082] Figure 5 The radar charts of the evaluation parameters of the classification prediction results after sampling and compensating the imbalance of the three types of imbalanced data in the present invention without considering label leakage and using SMOTE sampling to compensate for the balance (same imbalance ratio) are compared (average of 10 random experiments), where (a) is the comparison radar chart of vowel, (b) is the comparison radar chart of segment, and (c) is the comparison radar chart of shuttle;

[0083] observe Figure 5 The classification ability of the data sampled from the three data sets is significantly stronger than that of the original data model. At the same time, the improvement effect of the F1-score of the 10 experiments compared with the original unbalanced data F1-score is plotted as a box line comparison diagram as shown in the figure. Figure 6 Observation Figure 5 ,The 6 evaluation indicators of the present invention in 10 experiments on 3 data sets are very consistent with the traditional SMOTE.

[0084] Figure 6 The box-line comparison diagram of the evaluation parameter F1-score of the classification prediction results after sampling to compensate for the imbalance of three types of imbalanced data in the present invention without considering label leakage and using SMOTE sampling to compensate for the balance (same imbalance ratio) in 10 random experiments; (a) is the box-line comparison diagram of vowel, (b) is the box-line comparison diagram of segment, and (c) is the box-line comparison diagram of shuttle.

[0085] observe Figure 6 , the box overlap of the F1-score improvement effect of the present invention in 10 experiments on 3 data sets is high. The results show that the performance of the present invention is close to that of the traditional SMOTE method.

[0086] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for longitudinal federated data augmentation for sample imbalance problem, characterized by: The following steps are involved: Step 1: The coordinator generates a homomorphic encryption key pair, retains the private key, and distributes the public key to Participant I and Participant II. At the same time, Participant I and Participant II generate their own encryption key pairs, retain their own private keys, and send the public key to each other. Step 2: Get the original data X of participant I g The minority class samples and multiple multi-class samples are used as interpolation samples X g_interpolation , generate the encrypted distance matrix [[D total ]]; Step 3: The coordinator decrypts the encrypted distance matrix [[D total ]], get the unencrypted distance matrix D total , sort the distance information of each row of the coordinator distance matrix in ascending order, and save the corresponding index in a matrix Idx alldis ,Idx alldis ∈R n×n , denoted as, and sent to participant I; Step 4: Participant I selects Idx according to the number of neighbors K. alldis Find the K nearest neighbors of each sample except itself, denoted as Idx K ; Step 5: Based on the random abandonment principle, generate interpolation information, encrypt it with the public key sent by participant II, and send it to participant II; Step 6: Participant II uses the key to decrypt the encrypted information sent by participant I and obtain the interpolated information. Participants I and II generate new samples by combining the interpolated information and the interpolation principle of SMOTE: Participants I and II obtain their own new samples X g_new and X h_new , participant I sends the new sample X g_new Samples X added to the alignment for interpolation g_interpolation In the example, participant II sends the new sample X h_new Add to the interpolated sample X after alignment h_interpolation , used for the next round of interpolation; Step 7: Determine whether the number of samples meets the requirement. If not, return to step 3. If it meets the requirement, give participant I a new sample X. g_new and new sample X from participant II h_new The same ID information, participant II will transfer all X h_new Add to X h , participant I will take all the new samples X of participant I in this process g_new The minority class samples are added to the original data X of participant I g , multi-class samples for participant I original data X g The samples X in which interpolation is not performed g_nointerpolation Partial replacement is performed to achieve a balance between multi-class samples and minority class samples in the original data of Participant I and Participant II.

2. According to claim 1, a method for longitudinal federated data enhancement for sample imbalance problem is characterized by: The participant I and the participant II generate their own encryption key pairs and encrypt them using the asymmetric encryption method RSA.

3. The method for longitudinal federated data enhancement for sample imbalance problem according to claim 1, characterized in that: The number of the small sample is more than 50% of the original data of Participant I.

4. The method for longitudinal federated data enhancement for sample imbalance problem according to claim 1, characterized in that: The interpolated samples of participant I and the original data X of participant II h The interpolation sample alignment under privacy protection uses the ID number to perform the interpolation sample alignment under privacy protection.

5. The method for longitudinal federated data enhancement for sample imbalance problem according to claim 1, characterized in that: The distance matrix of participant I or the distance matrix of participant II is aggregated to obtain the distance matrix of the participant, that is, the distance matrix of participant I is added to the distance matrix of participant II to obtain the distance matrix of the participant.

6. The method for longitudinal federated data enhancement for sample imbalance problem according to claim 1, characterized in that: The acquisition of participant I original data X g The minority class samples and multiple multi-class samples are used as interpolation samples X g_interpolation , generate the encrypted distance matrix [[D total The process is as follows: Get participant I's raw data X g The minority class samples and multiple multi-class samples are used as interpolation samples X g_interpolation , the interpolated sample of participant I and the original data X of participant II h Perform interpolation sample alignment under privacy protection, and participant II obtains the aligned sample X h_interpolation , the sample that participant I did not use for interpolation is X g_nointerpolation , then the following relationship is satisfied: X g_nointerpolation ∪X g_interpolation =X g , Calculate the distance between each two samples in Participant I and Participant II respectively by index order, and save the distance matrix D respectively. a ,a∈{g,h},D a ∈R n×n , n is the number of samples, and the encrypted distance matrix [[D a ]], where participant I does not calculate the label when calculating the distance; The distance matrix of the participants is obtained by aggregating the distance matrix of participant I or the distance matrix of participant II: total ]]=ΣD a , the coordinator obtains the distance matrix of the participants.

7. The method for longitudinal federated data enhancement for sample imbalance problem according to claim 1, characterized in that: The process of generating interpolation information based on the random abandonment principle, encrypting it with the public key sent by participant II, and sending it to participant II is as follows: Participant I uses the random abandonment principle, that is, for each sample, a random abandonment factor λ, λ∈(0,1) is introduced, and different abandonment thresholds are given to the random abandonment factor according to the category of the sample. The abandonment threshold of the minority class sample is recorded as threshold minority , the abandonment threshold of multi-class samples is recorded as threshold majority , when λ is greater than the corresponding threshold, the sample is skipped and no interpolation is performed; an interpolation node weight ω is randomly generated for the sample that needs to be interpolated, ω∈(0,1). Finally, participant I indexes the sample that needs to be interpolated Idx interpolation And its Idx K The index Idx of a neighbor randomly selected from the K neighbors corresponds to near It is packaged with the corresponding interpolation weight ω, encrypted with the public key sent by participant II, and sent to participant II.

8. The method for longitudinal federated data enhancement for sample imbalance problem according to claim 1, characterized in that: threshold minority >threshold majority ,1≥threshold minority ≥0,1≥threshold majority ≥0。 9. The method for longitudinal federated data enhancement for sample imbalance problem according to claim 1, characterized in that: Participants I and II generate new samples x by interpolating information and combining the interpolation principle of SMOTE ai_new as follows: x ai_new =x ai +ω i (x ai_near -x ai ),a∈{g,h} Where: x i represents the samples used for interpolation, x i_near represents its nearest neighbor sample, ω i is the interpolation node weight, a represents the participant, g represents participant I, and h represents participant II.

Citation Information

Patent Citations

  • Longitudinal federated learning sample imbalance processing method based on OT protocol

    CN114548419A

  • Improved SMOTE method based on random undersampling

    CN114970704A

  • Semi-supervised graph imbalance learning method

    CN116881710A

  • Unbalanced data classification method based on label propagation and resampling combination

    CN118133177A