Joint learning model acquisition method and device based on data heterogeneity
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-06
- Publication Date
- 2026-08-11
AI Technical Summary
[0003]有鉴于此,本发明实施例提供了一种基于数据异构的联合学习模型获取方法、装置、电子设备及计算机可读存储介质,以解决现有技术中由于需求方数据量不足进行数据异构时难以获得具有良好性能的模型的问题
[0016]本发明实施例与现有技术相比存在的有益效果是:本公开实施例基于目标任务对数据分布的需求,构建测试数据分布,结合提出需求的参与方提供的目标训练数据,从其他参与方选择与目标训练数据相似的相似数据进行数据异构,并采用目标训练数据与相似数据训练联合学习模型,以获取目标联合学习模型,最后将目标联合学习模型提供给目标需求方,确保了进行模型训练的数据与目标任务的数据分布一致,使得获得联合学习模型在应用于需求方的目标任务时具有更好的应用效果,提高了联合学习模型的性能,进一步提升了模型的推广泛化能力。
Smart Images

Figure CN116304652B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method and apparatus for obtaining a joint learning model based on heterogeneous data. Background Technology
[0002] Federation learning effectively helps multiple stakeholders utilize data and perform machine learning modeling while meeting requirements for user privacy protection, data security, and government regulations. In federated learning scenarios, the model requester may possess limited data and needs to jointly train a federated learning model with other data owners to ensure the resulting model can be applied to the target task. In this case, the heterogeneity of data during federated learning model training presents significant challenges. On one hand, the data from the requester and other data owners may not be independently and identically distributed; training a model based on all the data from other data owners may lead to a decrease in model inference performance. On the other hand, the requester's own data volume may be insufficient, meaning that the data it possesses may not be independently and identically distributed with the data encountered in the target task; training a model based on existing data may not yield a model with good performance. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide a method, apparatus, electronic device, and computer-readable storage medium for obtaining a joint learning model based on data heterogeneity, in order to solve the problem in the prior art that it is difficult to obtain a model with good performance when data heterogeneity is carried out due to insufficient data volume on the demand side.
[0004] A first aspect of this invention provides a method for obtaining a joint learning model based on heterogeneous data, comprising:
[0005] Based on the data distribution requirements of the target task, construct the test data distribution;
[0006] Based on the target training data and the distribution of the test data provided by the participating party that made the request, similar data that is similar to the target training data is selected from other participating parties;
[0007] A joint learning model is trained using the target training data and the similar data to obtain the target joint learning model;
[0008] The participants whose data distribution meets the preset requirements are identified as the target demanders, and the target joint learning model is provided to the target demanders.
[0009] A second aspect of the present invention provides a device for acquiring a joint learning model based on heterogeneous data, comprising:
[0010] The test data distribution building module is configured to build the test data distribution based on the data distribution requirements of the target task.
[0011] The similar data acquisition module is configured to select similar data that is similar to the target training data from other participants based on the target training data provided by the participating party that made the request and the distribution of the test data;
[0012] The training module is configured to train a joint learning model using the target training data and the similar data to obtain a target joint learning model;
[0013] The allocation module is configured to identify participants whose data distribution meets preset requirements as target demanders and to provide the target joint learning model to the target demanders.
[0014] A third aspect of the present invention provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method.
[0015] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described method.
[0016] The beneficial effects of this invention compared to the prior art are as follows: Based on the data distribution requirements of the target task, this invention constructs a test data distribution, combines the target training data provided by the participating party that made the request, selects similar data from other participating parties to heterogeneously process the data, and trains a joint learning model using the target training data and similar data to obtain the target joint learning model. Finally, the target joint learning model is provided to the target requesting party, ensuring that the data used for model training is consistent with the data distribution of the target task. This results in the joint learning model having better application effects when applied to the target task of the requesting party, improving the performance of the joint learning model, and further enhancing the generalization and propagation capabilities of the model. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a schematic diagram of a joint learning architecture provided by an embodiment of the present invention;
[0019] Figure 2This is a flowchart of a method for obtaining a joint learning model based on heterogeneous data, provided in an embodiment of the present invention;
[0020] Figure 3 This is a schematic diagram of a joint learning model acquisition device based on data heterogeneity provided in an embodiment of the present invention;
[0021] Figure 4 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0022] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of the invention. However, those skilled in the art will understand that the invention can be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of the invention with unnecessary detail.
[0023] Federation learning refers to the comprehensive utilization of multiple AI (Artificial Intelligence) technologies, under the premise of ensuring data security and user privacy, to collaboratively explore the value of data and foster new intelligent business forms and models based on joint modeling. Federation learning has at least the following characteristics:
[0024] (1) Participating nodes control their own data in a weakly centralized joint training mode to ensure data privacy and security in the process of co-creating intelligence.
[0025] (2) In different application scenarios, various model aggregation optimization strategies are established by using screening and / or combination of AI algorithms and privacy-preserving computing to obtain high-level and high-quality models.
[0026] (3) Under the premise of ensuring data security and user privacy, based on multiple model aggregation optimization strategies, obtain methods to improve the performance of the federated learning engine. The performance methods can be improved by solving problems such as parallel computing architecture, information interaction under large-scale cross-domain networks, intelligent perception, and anomaly handling mechanisms.
[0027] (4) Obtain the needs of multiple users in various scenarios, determine the true contribution of each joint participant through a mutual trust mechanism, and allocate incentives accordingly.
[0028] Based on the above approach, an AI technology ecosystem based on collaborative learning can be established, fully leveraging the value of industry data and promoting the implementation of scenarios in vertical fields.
[0029] The following will describe in detail, with reference to the accompanying drawings, a method and apparatus for obtaining a joint learning model based on heterogeneous data according to an embodiment of the present disclosure.
[0030] Figure 1 This is a schematic diagram of a joint learning architecture according to an embodiment of this disclosure. Figure 1 As shown, the architecture of joint learning may include a server (central node) 101 and participants 102, 103 and 104.
[0031] In the joint learning process, a basic model can be established through server 101, which then sends this model to participants 102, 103, and 104 with whom it has established a communication connection. Alternatively, any participant can establish the basic model and upload it to server 101, which then sends it to other participants with whom it has established a communication connection. Participants 102, 103, and 104 construct models based on the downloaded basic structure and model parameters, train the models using local data, obtain updated model parameters, and encrypt and upload these updated model parameters to server 101. Server 101 aggregates the model parameters sent by participants 102, 103, and 104 to obtain global model parameters, which are then transmitted back to participants 102, 103, and 104. Participants 102, 103, and 104 iterate on their respective models based on the received global model parameters until the models converge, thus achieving model training. During the collaborative learning process, the data uploaded by participants 102, 103, and 104 are model parameters. Local data is not uploaded to server 101, and all participants can share the final model parameters. Therefore, collaborative modeling can be achieved while ensuring data privacy. It should be noted that the number of participants is not limited to the three mentioned above, but can be set as needed. This embodiment of the disclosure does not impose any restrictions on this.
[0032] Figure 2 This is a flowchart of a method for obtaining a joint learning model based on heterogeneous data, provided by an embodiment of the present invention. Figure 2 The method for obtaining joint learning models based on heterogeneous data can be derived from... Figure 1 The server 101 in the middle is executed. For example... Figure 2 As shown, the methods for obtaining joint learning models based on heterogeneous data include:
[0033] S201, Based on the data distribution requirements of the target task, construct the test data distribution.
[0034] The target task here can be the target task of the party making the request, or it can be the target task of other users; there are no restrictions. The data distribution may also differ for different target tasks. To ensure that the obtained joint learning model can be effectively applied to the target task, it is necessary to ensure that the training data distribution during model training is consistent with the data distribution requirements of the target task. Therefore, it is necessary to first construct a test data distribution based on the data distribution requirements of the target task, ensuring that the test data distribution is consistent with the data distribution requirements of the target task.
[0035] In this embodiment, constructing the test data distribution may include: determining the data distribution characteristics of the target task based on historical experience information; and constructing the test data distribution of the target task based on the data distribution characteristics. The historical experience information can be human experience knowledge summarized based on the target task. Since the target task is a task to be applied in the future, its test data distribution cannot be directly obtained, but it can be predicted based on historical experience information. Therefore, the test data distribution can be constructed based on historical experience information, ensuring the accuracy of the test data distribution.
[0036] S202, based on the distribution of target training data and test data provided by the participating party that made the request, select similar data from other participating parties that are similar to the target training data.
[0037] During model training, multiple parties can participate. The party that proposes the model request is the target party, initiating model training. Other parties respond to the target party's request and join the training process. During training, each party can provide training data. However, considering that the data provided by other parties may include much irrelevant data, with a completely different distribution from the test data, including such data in the training process would not only fail to improve the training effect but might also reduce the accuracy of the resulting model. Therefore, it is necessary to select similar data from other parties—data similar to the target training data—based on the distribution of the target training and test data provided by the target party, for model training.
[0038] In this embodiment, based on the distribution of target training data and test data provided by the requesting party, similar data similar to the target training data is selected from other parties. Specifically, this may include:
[0039] The training dataset is formed by obtaining the training data of the participants who made the request (target participants). At the same time, the distribution of training data in the training dataset is obtained. The amount of training data can be set as needed. The more training data provided by the target participants, the higher the training accuracy of the model.
[0040] Each training data point in the training data distribution is used as the target training data, and the target number of similar data points is determined based on the test data distribution. The distribution of the training data may differ from that of the test data. To ensure the trained model matches the desired model, it is necessary to ensure that the distribution of the training data is consistent with the distribution of the test data. The method for determining the target number is as follows:
[0041] n = P - test(i) / P - train(i)
[0042] Where P-train represents the training data distribution, P-train(i) is the distribution of the i-th training data in the training data distribution; P-test represents the test data distribution, P-test(i) is the distribution of the test data corresponding to the i-th training data in the test data distribution; n represents the number of targets, n is rounded down to the nearest integer, and the value of i can be 1, 2, 3, ..., n.
[0043] For each training data point, its corresponding distribution in the test data varies, thus affecting the required number of similar data points. For example, for the first training data point, based on the test data distribution, the number of similar data points should be 2 if the test data distribution is satisfied; for the second training data point, the number of similar data points should be 10, and so on. By sequentially identifying each training data point as the target training data, the target number of similar data points can be obtained, facilitating the subsequent determination of similar data points.
[0044] Data from other participants that meet the similarity requirements with the target training data are identified as similar data, with the number of similar data matching the target number. After determining the target number of similar data, data meeting the similarity requirements from other participants are selected as similar data for subsequent model training based on this target number. Specifically, the data from other participants can be sorted according to their similarity to the target training data, and the top-ranked data (the target number) are sequentially selected as similar data for the target training data. Similar data can originate from the same other participant or from different other participants.
[0045] To ensure data security, when determining the similarity between other participants' data and the target training data, privacy protection can be achieved through data encryption methods such as Locality Sensitive Hashing (LSH) to prevent data leakage. Taking LSH as an example, the participant making the request encrypts the target training data to obtain a first hash code, which is then uploaded to the server of the joint learning architecture. Other participants encrypt their data to obtain second hash codes, which are also uploaded to the server. The similarity between each second hash code and the first hash code is calculated, and the data is sorted according to similarity. The top-ranked second hash codes are then identified as target hash codes, and the data corresponding to these target hash codes are considered similar data. Of course, other encryption methods can also be used to protect data privacy, not limited to the above scenario.
[0046] S203 uses target training data and similar data to train a joint learning model to obtain a target joint learning model.
[0047] On one hand, a training dataset is constructed from the training data distribution of the participating parties that made the request. On the other hand, similar data is copied a corresponding number of times based on the number of times each similar data point is selected in each of the other participating parties, thus obtaining a training dataset for each of the other participating parties. Then, the joint learning model is trained using the training datasets of the participating parties that made the request and the training datasets of each of the other participating parties to obtain the target joint learning model. During the training process, data from each participating party does not need to be uploaded. Instead, the model is trained locally, and the obtained model parameters are uploaded to the server. The server aggregates the parameters and then distributes them back to each participating party for the next round of model training. The model training process can be repeated multiple times until a target joint learning model that meets the requirements is obtained.
[0048] S204, identify the participants whose data distribution meets the preset requirements as the target demanders, and provide the target joint learning model to the target demanders.
[0049] In this embodiment, the party making the request can be the target requester, other participants in the training, or any other requester; there are no restrictions. To ensure that the requester achieves the desired results when using the target joint learning model, it is necessary to screen the requesters.
[0050] For example, demanders can be screened based on the distribution of test data for the target joint learning model. In this case, based on the model's requirements, the data distribution of the participants is obtained. These participants are not limited to those involved in the model training process. The consistency between the participant's data distribution and the test data distribution is determined to be greater than a preset threshold. If the consistency is greater, it means the participant's data distribution matches the target joint learning model's data distribution. Applying the target joint learning model to this participant's target task will yield good results, thus identifying this participant as a target demander and providing the target joint learning model to them. Conversely, if the consistency is less than a preset threshold, it means the participant's data distribution is inconsistent with the target joint learning model's data distribution. The target joint learning model cannot be applied to this participant's target task, therefore, this participant is not a target demander.
[0051] For example, since the target training model is obtained by training on the training data of the target participant, and it also represents the application requirements of the target participant, the demand party can be screened based on the training data distribution of the participant making the demand (target participant). In this case, based on the model's requirements, the data distribution of the participants is obtained. These participants are not limited to those involved in the model training process. It is then determined whether the consistency between the participant's data distribution and the target participant's training data distribution exceeds a preset threshold. If the consistency exceeds the threshold, it means that the participant's data distribution is consistent with the target participant's training data distribution. In this case, applying the target joint learning model to the participant's target task will also have good application results. Therefore, the participant is identified as a target demand party, and the target joint learning model is provided to the target demand party. If the consistency between the participant's data distribution and the training data distribution is less than the preset threshold, it means that the participant's data distribution is inconsistent with the target participant's training data distribution. The target joint learning model cannot be applied to the participant's target task, and therefore, the participant is not a target demand party.
[0052] The beneficial effects of the technical solution provided by the embodiments of this disclosure include at least the following: First, the embodiments of this disclosure determine the data distribution requirements of the target task based on historical experience information, construct a test data distribution, combine the target training data provided by the participating party that made the request, select similar data similar to the target training data from other participating parties to perform data heterogeneity, and use the target training data and similar data to train a joint learning model to obtain a target joint learning model. Finally, the target joint learning model is provided to the target requesting party. By incorporating historical experience information into the data heterogeneity process, it is ensured that the data used for model training is consistent with the data distribution of the target task, so that the obtained joint learning model has a better application effect when applied to the target task of the requesting party, improving the performance of the joint learning model and further enhancing the generalization capability of the model.
[0053] All of the above-mentioned optional technical solutions can be combined in any way to form the optional embodiments of this application, and will not be described in detail here.
[0054] The following are embodiments of the apparatus of the present invention, which can be used to execute embodiments of the method of the present invention. For details not disclosed in the embodiments of the apparatus of the present invention, please refer to the embodiments of the method of the present invention.
[0055] Figure 3 This is a schematic diagram of a joint learning model acquisition device based on heterogeneous data, provided in an embodiment of the present invention. Figure 3 As shown, the device for acquiring a joint learning model based on heterogeneous data includes a test data distribution construction module 301, a similar data acquisition module 302, a training module 303, and an allocation module 304. Specifically, the test data distribution construction module 301 is configured to construct a test data distribution based on the data distribution requirements of the target task; the similar data acquisition module 302 is configured to select similar data from other participants based on the target training data and test data distribution provided by the participating party making the request; the training module 303 is configured to train a joint learning model using the target training data and similar data to obtain the target joint learning model; and the allocation module 304 is configured to determine the participating party whose data distribution meets preset requirements as the target requesting party and provide the target joint learning model to the target requesting party.
[0056] Furthermore, the test data distribution construction module 301 is specifically configured as follows: based on historical experience information, determine the data distribution characteristics of the target task; based on the data distribution characteristics, construct the test data distribution of the target task.
[0057] Furthermore, the similar data acquisition module 302 is specifically configured as follows: acquiring the training data distribution of the participating parties that made the request; taking each piece of training data in the training data distribution as the target training data in turn, and determining the target number of similar data based on the test data distribution; confirming the data from other participating parties that meet the similarity requirements with the target training data as similar data, and the number of similar data is consistent with the target number.
[0058] Furthermore, the training module 303 is specifically configured as follows: using the data involved in the training data distribution of the participants who made the request as training data to construct the training dataset of the participants who made the request; copying the similar data according to the number of times each similar data is selected in each other participant to obtain the training dataset of each other participant; and training the joint learning model according to the training dataset of the participants who made the request and the training dataset of each other participant to obtain the target joint learning model.
[0059] In some embodiments, the allocation module 304 is specifically configured to: obtain the data distribution of the participants according to the model's requirements; determine whether the consistency between the participants' data distribution and the test data distribution is greater than a preset threshold; if the consistency between the participants' data distribution and the test data distribution is greater than the preset threshold, then determine the participants as the target demanders; and provide the target joint learning model to the target demanders.
[0060] In other embodiments, the allocation module 304 is specifically configured to: obtain the data distribution of the participants based on the model's requirements; determine whether the consistency between the participants' data distribution and the training data distribution of the participants who made the requirements is greater than a preset threshold; if the consistency between the participants' data distribution and the training data distribution is greater than the preset threshold, then determine the participants as the target demanders; and provide the target joint learning model to the target demanders.
[0061] Based on the data distribution requirements of the target task, this embodiment constructs a test data distribution. It combines the target training data provided by the participating party that made the request with similar data selected from other participating parties for data heterogeneity. A joint learning model is then trained using the target training data and similar data to obtain the target joint learning model. Finally, the target joint learning model is provided to the target requesting party. By incorporating historical experience information into the data heterogeneity process, it ensures that the data used for model training is consistent with the data distribution of the target task. This results in a better application effect of the joint learning model when applied to the target task of the requesting party, improving the performance of the joint learning model and further enhancing its generalization and applicability.
[0062] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0063] Figure 4 This is a schematic diagram of the electronic device 4 provided in an embodiment of the present invention. Figure 4 As shown, the electronic device 4 of this embodiment includes a processor 401, a memory 402, and a computer program 403 stored in the memory 402 and executable on the processor 401. When the processor 401 executes the computer program 403, it implements the steps in the various method embodiments described above. Alternatively, when the processor 401 executes the computer program 403, it implements the functions of each module / unit in the various device embodiments described above.
[0064] For example, computer program 403 may be divided into one or more modules / units, which are stored in memory 402 and executed by processor 401 to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of computer program 403 in electronic device 4.
[0065] Electronic device 4 can be a desktop computer, laptop, handheld computer, cloud server, or other electronic device. Electronic device 4 may include, but is not limited to, processor 401 and memory 402. Those skilled in the art will understand that... Figure 4 This is merely an example of electronic device 4 and does not constitute a limitation on electronic device 4. It may include more or fewer components than shown, or combine certain components, or different components. For example, electronic device may also include input / output devices, network access devices, buses, etc.
[0066] Processor 401 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0067] The memory 402 can be an internal storage unit of the electronic device 4, such as a hard disk or RAM. The memory 402 can also be an external storage device of the electronic device 4, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory 402 can include both internal and external storage units of the electronic device 4. The memory 402 is used to store computer programs and other programs and data required by the electronic device. The memory 402 can also be used to temporarily store data that has been output or will be output.
[0068] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0069] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0070] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments of the invention herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of the invention.
[0071] In the embodiments provided by this invention, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. Multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0072] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0073] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0074] If integrated modules / units are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program may include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. Computer-readable media may include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in a computer-readable medium may be appropriately added to or subtracted according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.
[0075] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A method for obtaining a federated learning model based on data heterogeneity, applied to a network architecture comprising a server and a plurality of participants, wherein the server and the plurality of participants are connected by a communication connection, and the method is executed by the server; characterized in that, include: Based on the data distribution requirements of the target task, construct the test data distribution; The test data distribution is consistent with the data distribution requirements of the target task; Based on the target training data and the distribution of the test data provided by the participating party that made the request, similar data that is similar to the target training data is selected from other participating parties; A joint learning model is trained using the target training data and the similar data to obtain the target joint learning model; The participants whose data distribution meets the preset requirements are identified as the target demanders, and the target joint learning model is provided to the target demanders. The selection of similar data from other participants, based on the target training data provided by the requesting participant and the distribution of the test data, includes: Obtain the training data distribution of the participants who made the request; Each piece of training data in the training data distribution is used as the target training data in turn, and the target number of similar data is determined according to the test data distribution. The party making the request encrypts the target training data to obtain a first hash code, and uploads the first hash code to the server of the joint learning architecture; Other participants encrypt their data to obtain a second hash code, and then upload the second hash code to the server of the joint learning architecture. Obtain the similarity between each second hash code and the first hash code, and select a target number of second hash codes whose similarity meets the preset requirements as the target hash codes; The data corresponding to the target hash code is confirmed as similar data.
2. The method of claim 1, wherein, The steps for constructing the test data distribution based on the data distribution requirements of the target task include: Based on historical experience information, determine the data distribution characteristics of the target task; Based on the data distribution characteristics, the test data distribution for the target task is constructed.
3. The method of claim 1, wherein, The step of training a joint learning model using the target training data and the similar data to obtain the target joint learning model includes: The training data distribution of the parties making the request is used as the training data to construct the training dataset of the parties making the request. The similar data is copied according to the number of times each similar data is selected in each other participant to obtain the training dataset for each of the other participants; The joint learning model is trained using the training datasets of the requesting party and each of the other parties to obtain the target joint learning model.
4. The method of claim 1, wherein, The participants whose data distribution meets preset requirements are identified as target demanders, and the target joint learning model is provided to the target demanders, including: Based on the requirements provided by the model, obtain the data distribution of the participants; Determine whether the consistency between the data distribution of the participating party and the test data distribution is greater than a preset threshold; If the consistency between the data distribution of the participating party and the test data distribution is greater than a preset threshold, then the participating party is determined to be the target demand party; The target joint learning model is provided to the target demander.
5. The method of claim 1, wherein, The participants whose data distribution meets preset requirements are identified as target demanders, and the target joint learning model is provided to the target demanders, including: Based on the requirements provided by the model, obtain the data distribution of the participants; Determine whether the consistency between the data distribution of the participating party and the training data distribution of the participating party that made the request is greater than a preset threshold. If the consistency between the data distribution of the participating party and the training data distribution is greater than a preset threshold, then the participating party is determined to be the target demand party; The target joint learning model is provided to the target demander.
6. A device for acquiring a joint learning model based on heterogeneous data, applied in a network architecture including a server and multiple participants, wherein the server establishes a communication connection with the multiple participants, and the device is deployed in the server; characterized in that, include: The test data distribution building module is configured to build the test data distribution based on the data distribution requirements of the target task. The similar data acquisition module is configured to select similar data that is similar to the target training data from other participants based on the target training data provided by the participating party that made the request and the distribution of the test data; The training module is configured to train a joint learning model using the target training data and the similar data to obtain a target joint learning model; The allocation module is configured to identify participants whose data distribution meets preset requirements as target demanders, and to provide the target joint learning model to the target demanders. The similar data acquisition module is specifically configured to: acquire the training data distribution of the participating parties that made the request; sequentially use each piece of training data in the training data distribution as target training data, and determine the target number of similar data based on the test data distribution; The party making the request encrypts the target training data to obtain a first hash code and uploads the first hash code to the server of the joint learning architecture; other parties encrypt their data to obtain a second hash code and upload the second hash code to the server of the joint learning architecture; obtain the similarity between each second hash code and the first hash code, and select a target number of second hash codes whose similarity meets the preset requirements as the target hash code; The data corresponding to the target hash code is confirmed as similar data.
7. An electronic 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 steps of the method as described in any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Data heterogeneous processing method and device based on similarity measurement, computer equipment and computer readable storage medium
CN113435534A
Data sharing method and device based on block chain and federal learning
CN113553377A