WO2023071106A1 - Federated learning management method and apparatus, and computer device and storage medium - Google Patents

Federated learning management method and apparatus, and computer device and storage medium Download PDF

Info

Publication number
WO2023071106A1
WO2023071106A1 PCT/CN2022/089694 CN2022089694W WO2023071106A1 WO 2023071106 A1 WO2023071106 A1 WO 2023071106A1 CN 2022089694 W CN2022089694 W CN 2022089694W WO 2023071106 A1 WO2023071106 A1 WO 2023071106A1
Authority
WO
WIPO (PCT)
Prior art keywords
model
participating
participating terminal
preset
parameters
Prior art date
Application number
PCT/CN2022/089694
Other languages
French (fr)
Chinese (zh)
Inventor
李泽远
王健宗
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2023071106A1 publication Critical patent/WO2023071106A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • G06N20/20Ensemble learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/08Insurance

Definitions

  • the embodiment of the present application relates to the field of federated learning, especially a federated learning management method, device, computer equipment and storage medium.
  • the insurance company calculates whether the credit value of the policyholder meets the insurance requirements through the history of major diseases of the policyholder, medical history, and the health status statement submitted by the policyholder. In cases where the sex cannot be judged, the insurance company cannot publish the user's data to obtain verification from a third-party organization, or directly aggregate the data of the medical institution into a model to determine the true credit value of the policyholder.
  • the inventor of the present application realized in the research that the traditional blockchain consensus mechanism based on federated learning adopts the Byzantine Fault Tolerance consensus algorithm (Practical Byzantine Fault Tolerance, PBFT). Participants' behavior evaluation, and the inability to quantify and calculate the contribution of participants after the training is over.
  • PBFT Byzantine Fault Tolerance consensus algorithm
  • the embodiment of the present application provides a federated learning management method, device, computer equipment, and storage medium that can evaluate the behavior of participants according to the consensus process, and quantify and calculate the contribution of participants after training.
  • a technical solution adopted by the embodiment created by this application is to provide a federated learning management method
  • multiple participating terminals train their respective local databases through the preset federated model, and obtain a model parameter corresponding to each participating terminal; train the preset joint model through each model parameter, and record each model Participate in the contribution data of the joint model; based on the contribution data and the preset reputation scoring consensus mechanism model, perform reputation scoring on each participating terminal; Carry out reward and punishment management.
  • the embodiment of the present application also provides a federated learning management device, including: a training module, used for multiple participating terminals to train their respective local databases through a preset federated model, and obtain the corresponding a model parameter; the training module is also used to train the preset joint model through each model parameter, and record the contribution data of each model participating in the joint model; the scoring module is used to The contribution data and the preset reputation scoring consensus mechanism model are used to perform reputation scoring on each participating terminal; the management module is used to perform reward and punishment management on each participating terminal according to the reputation scoring of each participating terminal.
  • an embodiment of the present application also provides a computer device, which includes a memory and a processor, where computer-readable instructions are stored in the memory, and when the computer-readable instructions are executed by the processor, the The processor executes the federated learning management method:
  • an embodiment of the present application further provides a storage medium storing computer-readable instructions, wherein, when the computer-readable instructions are executed by one or more processors, one or more processors execute the The federated learning management approach described:
  • Fig. 1 is one of the schematic flow charts of the federated learning management method of a specific embodiment of the present application
  • Fig. 2 is the second schematic flow diagram of the federated learning management method of a specific embodiment of the present application
  • FIG. 3 is the third schematic flow diagram of a federated learning management method in a specific embodiment of the present application.
  • FIG. 4 is a schematic diagram of a consensus mechanism model of reputation scoring in a specific embodiment of the present application.
  • FIG. 5 is the fourth schematic flow diagram of a federated learning management method in a specific embodiment of the present application.
  • FIG. 6 is the fifth schematic flow diagram of a federated learning management method in a specific embodiment of the present application.
  • FIG. 7 is the sixth schematic flow diagram of a federated learning management method in a specific embodiment of the present application.
  • FIG. 8 is the seventh schematic flow diagram of a federated learning management method in a specific embodiment of the present application.
  • FIG. 9 is a schematic diagram of the basic structure of a federated learning management device according to an embodiment of the present application.
  • FIG. 10 is a block diagram of a basic structure of a computer device according to an embodiment of the present application.
  • AI artificial intelligence
  • digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
  • Artificial intelligence basic technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation/interaction systems, and mechatronics.
  • Artificial intelligence software technology mainly includes computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning/deep learning.
  • various insurance systems determine whether the credit value of the policyholder meets the insurance requirements by judging the relevant information of the policyholder.
  • the data of the policyholder can be trained based on the federated learning model to expand the data dimension of the policyholder to determine whether the credit value of the policyholder meets the insurance requirements.
  • each insurance system calculates whether the credit value of the insured meets the insurance requirements through the history of the insured’s history of major disease visits and the health status statement submitted by the insured, but there is a lack of dimensionality of the insured’s data , the authenticity of the data cannot be judged, etc., each insurance system (insurance company) cannot publish its own user data to obtain verification from a third-party organization, or directly aggregate the data of multiple medical institutions together for modeling.
  • each insurance system can train the relevant information of the policyholder in the local database to realize the expansion of the data dimension of the policyholder.
  • Each participant in the federated learning model needs to rely on the central node to update or issue parameters. If the central node fails or acts maliciously, the results of the entire federated learning collaborative training will be affected.
  • federated learning in related technologies also has some other issues such as data transmission efficiency.
  • Model training involves a large number of calculations, and the joint modeling of all parties will involve a large amount of data interaction.
  • each gradient iteration involves communication costs. Therefore, communication efficiency is also a challenge that federated learning will encounter during the implementation process.
  • there are issues such as uneven sample distribution from institution to institution, and so on.
  • this application thinks of a federated learning management method, which can judge whether it is qualified for federated learning training according to the credibility of each participating terminal before training; participating terminals can supervise each other during training.
  • the honesty of participating terminals during the training process is voted and scored, and their own credibility is maintained to prevent information tampering; after training, participants are rewarded and punished based on their credibility scores.
  • the behavior evaluation of participating terminals is carried out according to the consensus process, and the contribution to the participants is quantified and calculated after the training, which improves the accuracy of each participating terminal in obtaining and judging user data.
  • FIG. 1 it is a schematic flow diagram of a federated learning management method provided in this embodiment, including S201 to S204:
  • the above-mentioned multiple participating terminals may be multiple institutions (or companies) such as health big data institutions, medical institutions, and insurance institutions, and each participating terminal has its own local database, which includes its own user information .
  • each participating terminal trains user information through a preset federated model based on its own local database, so as to obtain a model parameter corresponding to each participating terminal.
  • each participating terminal After introducing federated learning, each participating terminal conducts training in the local database to expand the data dimension of the policyholder. In federated learning, each participant needs to rely on The central node updates or issues parameters.
  • a model parameter corresponding to each participating terminal may also be obtained through the following steps.
  • step S201 may include the following steps S201a and S201b:
  • Each participating terminal among the plurality of participating terminals respectively uses the preset federated model to train a local database to obtain model parameters and weight values corresponding to each participating terminal.
  • each participating terminal performs data model training on the local database through the preset federated model, establishes the model, first numerically processes the information corresponding to each user in the participating terminal database, and then screens out relevant information from it. High feature information, so as to obtain the model parameters and weight values corresponding to each participating terminal.
  • federated learning can enable all participants to cooperate to complete the training of a data model.
  • the trained model is based on the data of all participants, but the participants will not disclose their own data. Raw data.
  • the above preset federated models may be: horizontal federated learning, vertical federated learning, federated transfer learning, and so on.
  • Each of the multiple participating terminals uploads corresponding model parameters and weight values to the blockchain.
  • each participating terminal uses the preset federated model to train the local database and obtains the model parameters and weight values corresponding to each participating terminal, it can upload the model parameters and weight values to the same zone Blockchain (shared database).
  • health big data institutions, medical institutions, and insurance institutions can use their respective databases to train locally with a preset federated model, obtain initial model parameters and weight values, and upload them to the blockchain.
  • each participating terminal needs to create corresponding task configuration information based on the federation model.
  • each participating terminal can determine and create the task configuration information of the federated model task by responding to the user's federated learning setting operation; wherein, the task configuration information of the federated model task includes but is not limited to: task type, engine framework , automatic parameter tuning algorithm, early termination algorithm, feature engineering information and methods, and data preprocessing methods and other information.
  • each participating terminal After each participating terminal determines the task configuration information corresponding to the federated model task, each participating terminal sends the task configuration information to the blockchain, so that the blockchain can obtain the task configuration information of multiple participating terminals participating in the federated model. Since the task configuration information does not involve data security and privacy issues, each participating terminal can send the task configuration information to the blockchain without encryption.
  • model parameters are integrated, and then joint training is performed to obtain joint model parameters (global model) corresponding to multiple participating terminals, and determine each The contribution data of participating terminals.
  • the user behavior of each participating terminal during the training process the contribution to the joint model and the consensus voting results can be recorded and other information.
  • step S202 may include the following steps S202a to S202d:
  • the blockchain can integrate model parameters of multiple participating terminals to obtain a concatenated model parameter, thereby generating federated parameters.
  • model parameters ie, global model parameters
  • the blockchain initializes the model training configuration information (that is, the parameters of the joint model) in the federated learning task according to the federated parameters, and executes the model training operation of the federated learning task based on the initialized model training configuration information, Generate the corresponding eigenvectors.
  • the model training configuration information that is, the parameters of the joint model
  • feature engineering information for model training operations is determined, and according to the feature engineering information, user data samples are subjected to feature processing to obtain model training data samples and corresponding feature vectors are generated.
  • the blockchain performs difference calculation according to the generated feature vector and the preset label vector to obtain the feature difference corresponding to the joint model.
  • the blockchain recalculates the deviation value corresponding to each model parameter according to the obtained characteristic difference value and the model parameter corresponding to each participating terminal, so as to generate the corresponding contribution data of each participating terminal according to the corresponding deviation value of each participating terminal.
  • CE-PBFT Practical Byzantine Fault Tolerance of Credibility Evaluation
  • FIG. 4 it is a model diagram of the reputation scoring consensus mechanism corresponding to the federated learning management method provided by the embodiment of this application.
  • the reputation scoring consensus mechanism performs reputation evaluation on each participating terminal according to the determined contribution data corresponding to each participating terminal Scoring, each participating terminal corresponds to a reputation score.
  • the contribution data includes: user behavior of each participating terminal, contribution to the joint model, and consensus voting results.
  • the above step S203 may include the following steps S203a and S203b:
  • S203a Input the user behavior of each participating terminal, the contribution to the joint model, and the consensus voting result into the reputation scoring consensus mechanism model.
  • the block chain records the user behavior of each participating terminal during the training process, the contribution to the joint model and the consensus voting results (that is, the user behavior in the training process of the historical records, the contribution to the joint model and consensus voting results, if there is no historical record, it will be calculated from this voting).
  • each participating terminal After uploading the parameters this time, each participating terminal begins to vote. If a participating terminal gives up voting, the reputation score will be reduced. If it is lower than the scoring threshold, it will not be eligible for federated model learning and training.
  • the blockchain inputs three pieces of information, namely user behavior of each participating terminal, contribution to the joint model, and consensus voting results, into the reputation scoring consensus mechanism model, so that the reputation scoring consensus mechanism model is The three pieces of information of each participating terminal are analyzed and processed to determine the reputation score corresponding to each participating terminal.
  • the reputation scoring consensus mechanism calculates the corresponding reputation of each participating terminal based on the three information of each participating terminal's user behavior, contribution to the joint model, and consensus voting results, and according to the proportion of each information Score.
  • the credibility score consensus mechanism model calculates the reputation score corresponding to each participating terminal, it sends the reputation score corresponding to each participating terminal to each participating terminal.
  • ⁇ , ⁇ , ⁇ are parameters
  • T is the score of previous historical votes. Indicates the updated value of the participant's reputation score after voting, i and j represent different participants, and t represents the current number of votes. Others means to increase the score. If the participating terminal actively participates in voting or performs well during the training process, the score will be added, otherwise the score will be reduced.
  • the federated learning management method provided by the embodiment of the present application may also include the following steps S301 and S302:
  • the global model is a model form when the joint model is trained to a converged state.
  • the reputation score consensus mechanism model evaluates user behavior according to the consensus process, sets the reputation score for voting dynamic weight adjustment, and performs joint training tasks with parameters after model training to generate a global model and obtain global parameters of the global model.
  • the block chain updates the model parameters of the global model and sends them to each participating terminal, so that the federated model of each participating terminal can obtain the global parameters.
  • S204 Perform reward and punishment management on each participating terminal according to the reputation score of each participating terminal.
  • the reputation score consensus mechanism model rewards and punishes the reputation scores of each participating terminal according to the reputation scores of each participating terminal. Participating terminals with low reputation scores may have malicious behaviors and low contribution to this training. Unable to participate in the next round of federated model learning and training.
  • step S204 may include the following steps S204a and S204b:
  • the reputation score of each participating terminal is compared with a preset scoring threshold (for example, 50 points), and the reputation score of any participating terminal is less than When scoring the threshold, it can be determined that the contribution of the participating terminal is low, or there is malicious behavior, etc., and the participating terminal is prohibited from participating in the next round of joint training.
  • a preset scoring threshold for example, 50 points
  • the reputation score of any participating terminal is between 50 and 100, it means that the participating terminal has excellent performance. Through active participation in model training, there is no malicious behavior in the process, and finally the reputation score reaches 100, and the points will be reset. If the value is 50, the scoring of the next cycle will start again. When the participating terminal has malicious behavior or passively participates in model training, the reputation score will continue to decrease, and eventually it will be lower than 50 and model training cannot be performed.
  • the federated learning management method provided by the embodiment of the present application may further include the following steps S401 and S402:
  • the reputation scoring consensus mechanism model respectively obtains the voting status of each participating terminal, and updates the reputation scoring of each participating terminal after 2) the voting ends.
  • the reputation scoring consensus mechanism model cannot obtain the voting result of a certain participating terminal, it is determined that the participating terminal has given up voting, and the reputation score of the participating terminal is reduced.
  • the federated learning management method provided in this embodiment uses a preset federated model to train the respective local databases of multiple participating terminals to obtain a model parameter corresponding to each participating terminal, so that the preset federated learning parameters can be adjusted through each model parameter.
  • the model is trained, and the contribution data of each model participating in the joint model is recorded during the training process.
  • the contribution data of multiple participating terminals is analyzed through the preset reputation scoring consensus mechanism model to evaluate the reputation of each participating terminal. Scoring, so as to carry out reward and punishment management for each participating terminal according to the reputation score of each participating terminal.
  • the model training parameters of each participating terminal are uploaded to the blockchain, and the credibility score consensus mechanism is used according to the results of voting scores. Rewarding or punishing participating terminals can fully mobilize the enthusiasm of participating terminals, and can also reduce the existence of participating terminals that have malicious or selfish behaviors.
  • the federated learning management method provided in the embodiment of the present application may be executed by a federated learning management device, or a control module in the federated learning management device for executing the federated learning management method.
  • the federated learning management device provided in the embodiment of the present application is described by taking the federated learning management device executing the federated learning management method as an example.
  • the federated learning management methods shown in the drawings of the above methods are all described in conjunction with a drawing in the embodiments of the present application as an example.
  • the federated learning management method shown in the drawings of the above methods can also be implemented in combination with any other drawings shown in the above embodiments that can be combined, and will not be repeated here.
  • FIG. 9 is a schematic diagram of the basic structure of the federated learning management device in this embodiment.
  • a federated learning management device includes: a training module 801, used for multiple participating terminals to train their local databases through a preset federated model to obtain a model parameter corresponding to each participating terminal;
  • the training module 801 is also used to train the preset joint model through each model parameter, and record the contribution data of each model participating in the joint model;
  • the scoring module 802 is used to train the joint model based on the contribution data and
  • the preset reputation scoring consensus mechanism model performs reputation scoring on each participating terminal;
  • the management module 803 is configured to perform reward and punishment management on each participating terminal according to the reputation scoring of each participating terminal.
  • the training module 801 is specifically used for each of the multiple participating terminals to use the preset federated model to train the local database to obtain a model corresponding to each participating terminal parameters and weight values; the device also includes: an upload module 804; the upload module 804 is used for each participating terminal in the plurality of participating terminals to upload corresponding model parameters and weight values to the block chain.
  • the training module 801 is specifically configured to concatenate the model parameters of the multiple participating terminals to generate federated parameters;
  • the parameters of the model are initialized, and the initialized joint model is trained according to the preset training samples to generate a feature vector;
  • the training module 801 is specifically further configured to, based on the feature vector and the preset label vector, Calculate the characteristic difference of the joint model;
  • the training module 801 is specifically configured to calculate the deviation value of each model parameter according to the characteristic difference, and generate the contribution data according to the deviation value.
  • the contribution data includes: user behavior of each participating terminal, contribution to the joint model, and consensus voting results; Behavior, contribution to the joint model and consensus voting results are input into the reputation scoring consensus mechanism model; the scoring module 802 is also specifically used to read the output of the credibility scoring consensus mechanism model The reputation score of each participating terminal.
  • the device further includes: an acquisition module 805 and a sending module 806; the acquisition module 805 is configured to acquire global parameters of the global model, wherein the global model is when the joint model is trained to a convergence state model form; the sending module 806 is configured to distribute the global parameters to the participating terminals, so that the federated models of the participating terminals generate global parameters.
  • the management module 803 is specifically configured to compare the reputation score of each participating terminal with a preset scoring threshold; When the score is less than the score threshold, the participating terminals are prohibited from participating in the next round of joint training.
  • the management module 803 is further configured to sequentially read the voting results of the participating terminals; the management module 803 is further configured to lower the voting results of the participating terminals when any participating terminal gives up voting. reputation score.
  • a computer device includes a memory and a processor, wherein computer-readable instructions are stored in the memory, and when the computer-readable instructions are executed by the processor, the processor executes the federated learning management method:
  • the federated learning management method also includes:
  • Each of the plurality of participating terminals uses the preset federated model to train a local database to obtain model parameters and weight values corresponding to each participating terminal;
  • Each of the plurality of participating terminals uploads corresponding model parameters and weight values to the block chain.
  • the federated learning management method also includes:
  • the contribution data includes: user behavior of each participating terminal, contribution to the joint model, and consensus voting results;
  • the federated learning management method further includes:
  • the federated learning management method also includes:
  • the federated learning management method also includes:
  • the participating terminal is prohibited from participating in the next round of joint training.
  • the federated learning management method also includes:
  • a storage medium storing computer-readable instructions, which, when executed by one or more processors, cause one or more processors to execute the federated learning management method:
  • the federated learning management method also includes:
  • Each of the plurality of participating terminals uses the preset federated model to train a local database to obtain model parameters and weight values corresponding to each participating terminal;
  • Each of the plurality of participating terminals uploads corresponding model parameters and weight values to the block chain.
  • the federated learning management method also includes:
  • the contribution data includes: user behavior of each participating terminal, contribution to the joint model, and consensus voting results;
  • the federated learning management method further includes:
  • the federated learning management method also includes:
  • the federated learning management method also includes:
  • the participating terminal is prohibited from participating in the next round of joint training.
  • the federated learning management method also includes:
  • the federated learning management device in the embodiment of the present application may be a device, or a component, an integrated circuit, or a chip in a terminal.
  • the device may be a mobile electronic device or a non-mobile electronic device.
  • the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle electronic device, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant).
  • non-mobile electronic devices can be servers, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (television, TV), teller machine or self-service machine, etc., this application Examples are not specifically limited.
  • Network Attached Storage NAS
  • personal computer personal computer, PC
  • television television
  • teller machine or self-service machine etc.
  • the server can be an independent server, or it can provide cloud services, cloud database, cloud computing, cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, content delivery network (Content Delivery Network, CDN), and cloud servers for basic cloud computing services such as big data and artificial intelligence platforms.
  • cloud services cloud database, cloud computing, cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, content delivery network (Content Delivery Network, CDN), and cloud servers for basic cloud computing services such as big data and artificial intelligence platforms.
  • the federated learning management device provided in the embodiment of the present application can implement various processes implemented by the federated learning management device in the method embodiments shown in FIGS. 1 to 8 . To avoid repetition, details are not repeated here.
  • the federated learning management device trains the respective local databases of multiple participating terminals through a preset federated model to obtain a model parameter corresponding to each participating terminal, so that the preset The joint model is trained, and the contribution data of each model participating in the joint model is recorded during the training process. Finally, the contribution data of multiple participating terminals is analyzed through the preset reputation scoring consensus mechanism model, so as to analyze the contribution data of each participating terminal. Reputation scoring, so as to carry out reward and punishment management for each participating terminal according to the reputation scoring of each participating terminal.
  • the model training parameters of each participating terminal are uploaded to the blockchain, and the credibility score consensus mechanism is used according to the results of voting scores. Rewarding or punishing participating terminals can fully mobilize the enthusiasm of participating terminals, and can also reduce the existence of participating terminals that have malicious or selfish behaviors.
  • FIG. 10 is a block diagram of the basic structure of the computer device in this embodiment.
  • the computer device includes a processor, a non-volatile storage medium, a memory and a network interface connected through a system bus.
  • the non-volatile storage medium of the computer device stores an operating system, a database, and computer-readable instructions
  • the database can store control information sequences, and when the computer-readable instructions are executed by the processor, the processor can realize a A Federated Learning Management Approach.
  • the processor of the computer equipment is used to provide computing and control capabilities and support the operation of the entire computer equipment.
  • Computer-readable instructions may be stored in the memory of the computer device, and when the computer-readable instructions are executed by the processor, the processor may execute a federated learning management method.
  • the network interface of the computer device is used for connecting and communicating with the terminal.
  • FIG. 8 is only a block diagram of a partial structure related to the solution of this application, and does not constitute a limitation on the computer equipment to which the solution of this application is applied.
  • the specific computer equipment can be More or fewer components than shown in the figures may be included, or some components may be combined, or have a different arrangement of components.
  • the processor is used to execute the specific functions of the acquisition module 801 , the construction module 802 and the adjustment module 803 in FIG. 8 , and the memory stores program codes and various data required for executing the above modules.
  • the network interface is used for data transmission between user terminals or servers.
  • the memory in this embodiment stores the program codes and data required to execute all sub-modules in the federated learning management device, and the server can call the program codes and data of the server to execute the functions of all sub-modules.
  • the computer device trains the respective local databases of multiple participating terminals through a preset federated model, so as to obtain a model parameter corresponding to each participating terminal, so that the preset joint model can be performed through each model parameter. Training, and record the contribution data of each model participating in the joint model during the training process, and finally analyze the contribution data of multiple participating terminals through the preset reputation scoring consensus mechanism model, so as to perform reputation scoring on each participating terminal, Therefore, according to the reputation score of each participating terminal, reward and punishment management is performed on each participating terminal.
  • the model training parameters of each participating terminal are uploaded to the blockchain, and the credibility score consensus mechanism is used according to the results of voting scores. Rewarding or punishing participating terminals can fully mobilize the enthusiasm of participating terminals, and can also reduce the existence of participating terminals that have malicious or selfish behaviors.
  • the application can be used in numerous general purpose or special purpose computer system environments or configurations. Examples: personal computers, server computers, handheld or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, including A distributed computing environment for any of the above systems or devices, etc.
  • This application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer.
  • program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types.
  • the application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network.
  • program modules may be located in both local and remote computer storage media including storage devices
  • the present application also provides a storage medium storing computer-readable instructions.
  • the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the federated learning management method in any of the above embodiments.
  • the aforementioned storage medium may be a nonvolatile storage medium such as a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM).
  • the present application also provides a storage medium storing computer-readable instructions, the storage medium of the computer-readable instructions may be non-volatile or volatile, and the computer-readable instructions are executed by one or more processors When, one or more processors are made to execute the steps of the federated learning management method in any of the above embodiments.
  • the aforementioned storage medium may be a nonvolatile storage medium such as a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM).

Abstract

The present application relates to the technical field of artificial intelligence. Provided are a federated learning management method and apparatus, and a computer device and a storage medium. The method comprises: a plurality of participating terminals training respective local databases by means of a preset federated model, so as to obtain a model parameter corresponding to each participating terminal; training a preset joint model by means of each model parameter, and recording data of contributions of each model parameter to the joint model; on the basis of the contribution data and a preset credibility score consensus mechanism model, performing credit scoring on each participating terminal; and according to a credit score of each participating terminal, performing reward and punishment management on each participating terminal.

Description

联邦学习管理方法、装置、计算机设备及存储介质Federal learning management method, device, computer equipment and storage medium
本申请要求于2021年10月26日提交中国专利局、申请号为202111249348.0、申请名称为“联邦学习管理方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with application number 202111249348.0 and titled "Federal Learning Management Method, Device, Computer Equipment, and Storage Medium" filed with the China Patent Office on October 26, 2021, the entire contents of which are incorporated by reference incorporated in this application.
技术领域technical field
本申请实施例涉及联邦学习领域,尤其是一种联邦学习管理方法、装置、计算机设备及存储介质。The embodiment of the present application relates to the field of federated learning, especially a federated learning management method, device, computer equipment and storage medium.
背景技术Background technique
对于健康保险的风控问题,保险公司通过投保人历史重大疾病、就诊史、投保人提交的健康状况说明书来计算投保人的信用值是否达到投保要求,这就存在投保人数据维度缺失,数据真实性无法判断等情况,保险公司不能将用户的数据向外公布获取第三方机构的验证,或者直接将医疗机构的数据聚合到一起建模,确定投保人真实的信用值。For the risk control of health insurance, the insurance company calculates whether the credit value of the policyholder meets the insurance requirements through the history of major diseases of the policyholder, medical history, and the health status statement submitted by the policyholder. In cases where the sex cannot be judged, the insurance company cannot publish the user's data to obtain verification from a third-party organization, or directly aggregate the data of the medical institution into a model to determine the true credit value of the policyholder.
本申请发明人在研究中意识到,传统基于联邦学习的区块链共识机制采用拜占庭容错共识算法(Practical Byzantine Fault Tolerance,PBFT),该算法中投票机制只有通过和不通过,无法根据共识流程进行参与者的行为评估,训练结束后无法对参与者的贡献度量化计算等问题。The inventor of the present application realized in the research that the traditional blockchain consensus mechanism based on federated learning adopts the Byzantine Fault Tolerance consensus algorithm (Practical Byzantine Fault Tolerance, PBFT). Participants' behavior evaluation, and the inability to quantify and calculate the contribution of participants after the training is over.
申请内容application content
本申请实施例提供一种能够根据共识流程进行参与者的行为评估,训练结束后对参与者的贡献度量化计算的联邦学习管理方法、装置、计算机设备及存储介质。The embodiment of the present application provides a federated learning management method, device, computer equipment, and storage medium that can evaluate the behavior of participants according to the consensus process, and quantify and calculate the contribution of participants after training.
为解决上述技术问题,本申请创造的实施例采用的一个技术方案是:提供一种联邦学习管理方法,In order to solve the above technical problems, a technical solution adopted by the embodiment created by this application is to provide a federated learning management method,
包括:多个参与终端通过预设的联邦模型对各自本地的数据库进行训练,得到每个参与终端对应的一个模型参数;通过各模型参数对预设的联合模型进行训练,并记录所述各模型参对所述联合模型的贡献数据;基于所述贡献数据和预设的信誉度评分共识机制模型,对各参与终端进行信誉评分;根据所述各参与终端的信誉评分,对所述各参与终端进行奖惩管理。Including: multiple participating terminals train their respective local databases through the preset federated model, and obtain a model parameter corresponding to each participating terminal; train the preset joint model through each model parameter, and record each model Participate in the contribution data of the joint model; based on the contribution data and the preset reputation scoring consensus mechanism model, perform reputation scoring on each participating terminal; Carry out reward and punishment management.
为解决上述技术问题,本申请实施例还提供一种联邦学习管理装置,包括:训练模块,用于多个参与终端通过预设的联邦模型对各自本地的数据库进行训练,得到每个参与终端对应的一个模型参数;所述训练模块,还用于通过各模型参数对预设的联合模型进行训练,并记录所述各模型参对所述联合模型的贡献数据;评分模块,用于基于所述贡献数据和预设的 信誉度评分共识机制模型,对各参与终端进行信誉评分;管理模块,用于根据所述各参与终端的信誉评分,对所述各参与终端进行奖惩管理。In order to solve the above technical problems, the embodiment of the present application also provides a federated learning management device, including: a training module, used for multiple participating terminals to train their respective local databases through a preset federated model, and obtain the corresponding a model parameter; the training module is also used to train the preset joint model through each model parameter, and record the contribution data of each model participating in the joint model; the scoring module is used to The contribution data and the preset reputation scoring consensus mechanism model are used to perform reputation scoring on each participating terminal; the management module is used to perform reward and punishment management on each participating terminal according to the reputation scoring of each participating terminal.
为解决上述技术问题本申请实施例还提供一种计算机设备,其中,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行所述联邦学习管理方法:In order to solve the above-mentioned technical problems, an embodiment of the present application also provides a computer device, which includes a memory and a processor, where computer-readable instructions are stored in the memory, and when the computer-readable instructions are executed by the processor, the The processor executes the federated learning management method:
多个参与终端通过预设的联邦模型对各自本地的数据库进行训练,得到每个参与终端对应的一个模型参数;Multiple participating terminals train their respective local databases through the preset federated model, and obtain a model parameter corresponding to each participating terminal;
通过各模型参数对预设的联合模型进行训练,并记录所述各模型参对所述联合模型的贡献数据;Train the preset joint model through each model parameter, and record the contribution data of each model participant to the joint model;
基于所述贡献数据和预设的信誉度评分共识机制模型,对各参与终端进行信誉评分;Perform reputation scoring on each participating terminal based on the contribution data and the preset reputation scoring consensus mechanism model;
根据所述各参与终端的信誉评分,对所述各参与终端进行奖惩管理。According to the reputation score of each participating terminal, reward and punishment management is performed on each participating terminal.
为解决上述技术问题本申请实施例还提供一种存储有计算机可读指令的存储介质,其中,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行所述联邦学习管理方法:In order to solve the above-mentioned technical problems, an embodiment of the present application further provides a storage medium storing computer-readable instructions, wherein, when the computer-readable instructions are executed by one or more processors, one or more processors execute the The federated learning management approach described:
多个参与终端通过预设的联邦模型对各自本地的数据库进行训练,得到每个参与终端对应的一个模型参数;Multiple participating terminals train their respective local databases through the preset federated model, and obtain a model parameter corresponding to each participating terminal;
通过各模型参数对预设的联合模型进行训练,并记录所述各模型参对所述联合模型的贡献数据;Train the preset joint model through each model parameter, and record the contribution data of each model participant to the joint model;
基于所述贡献数据和预设的信誉度评分共识机制模型,对各参与终端进行信誉评分;Perform reputation scoring on each participating terminal based on the contribution data and the preset reputation scoring consensus mechanism model;
根据所述各参与终端的信誉评分,对所述各参与终端进行奖惩管理。According to the reputation score of each participating terminal, reward and punishment management is performed on each participating terminal.
附图说明Description of drawings
本申请上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present application will become apparent and easy to understand from the following description of the embodiments in conjunction with the accompanying drawings, wherein:
图1为本申请一个具体实施例的联邦学习管理方法的流程示意图之一;Fig. 1 is one of the schematic flow charts of the federated learning management method of a specific embodiment of the present application;
图2为本申请一个具体实施例的联邦学习管理方法的流程示意图之二;Fig. 2 is the second schematic flow diagram of the federated learning management method of a specific embodiment of the present application;
图3为本申请一个具体实施例的联邦学习管理方法的流程示意图之三;FIG. 3 is the third schematic flow diagram of a federated learning management method in a specific embodiment of the present application;
图4为本申请一个具体实施例的信誉度评分共识机制模型示意图;FIG. 4 is a schematic diagram of a consensus mechanism model of reputation scoring in a specific embodiment of the present application;
图5为本申请一个具体实施例的联邦学习管理方法的流程示意图之四;FIG. 5 is the fourth schematic flow diagram of a federated learning management method in a specific embodiment of the present application;
图6为本申请一个具体实施例的联邦学习管理方法的流程示意图之五;FIG. 6 is the fifth schematic flow diagram of a federated learning management method in a specific embodiment of the present application;
图7为本申请一个具体实施例的联邦学习管理方法的流程示意图之六;FIG. 7 is the sixth schematic flow diagram of a federated learning management method in a specific embodiment of the present application;
图8为本申请一个具体实施例的联邦学习管理方法的流程示意图之七;FIG. 8 is the seventh schematic flow diagram of a federated learning management method in a specific embodiment of the present application;
图9为本申请一个实施例的联邦学习管理装置基本结构示意图;FIG. 9 is a schematic diagram of the basic structure of a federated learning management device according to an embodiment of the present application;
图10为本申请一个实施例的计算机设备的基本结构框图。FIG. 10 is a block diagram of a basic structure of a computer device according to an embodiment of the present application.
具体实施方式Detailed ways
下面详细描述本申请的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,仅用于解释本申请,而不能解释为对本申请的限制。Embodiments of the present application are described in detail below, examples of which are shown in the drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the figures are exemplary only for explaining the present application, and are not construed as limiting the present application.
本技术领域技术人员可以理解,除非特意声明,这里使用的单数形式“一”、“一个”、“所述”和“该”也可包括复数形式。应该进一步理解的是,本申请的说明书中使用的措辞“包括”是指存在所述特征、整数、步骤、操作、元件和/或组件,但是并不排除存在或添加一个或多个其他特征、整数、步骤、操作、元件、组件和/或它们的组。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。Those skilled in the art will understand that unless otherwise stated, the singular forms "a", "an", "said" and "the" used herein may also include plural forms. It should be further understood that the word "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and/or components, but does not exclude the presence or addition of one or more other features, Integers, steps, operations, elements, components, and/or groups thereof. In addition, "and/or" in the specification and claims means at least one of the connected objects, and the character "/" generally means that the related objects are an "or" relationship.
本技术领域技术人员可以理解,除非另外定义,这里使用的所有术语(包括技术术语和科学术语),具有与本申请所属领域中的普通技术人员的一般理解相同的意义。还应该理解的是,诸如通用字典中定义的那些术语,应该被理解为具有与现有技术的上下文中的意义一致的意义,并且除非像这里一样被特定定义,否则不会用理想化或过于正式的含义来解释。Those skilled in the art can understand that, unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as commonly understood by those of ordinary skill in the art to which this application belongs. It should also be understood that terms, such as those defined in commonly used dictionaries, should be understood to have meanings consistent with their meaning in the context of the prior art, and unless specifically defined as herein, are not intended to be idealized or overly Formal meaning to explain.
本申请实施例可以基于人工智能技术对相关的数据进行获取和处理。其中,人工智能(Artificial Intelligence,AI)是利用数字计算机或者数字计算机控制的机器模拟、延伸和扩展人的智能,感知环境、获取知识并使用知识获得最佳结果的理论、方法、技术及应用系统。The embodiments of the present application may acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. .
人工智能基础技术一般包括如传感器、专用人工智能芯片、云计算、分布式存储、大数据处理技术、操作/交互系统、机电一体化等技术。人工智能软件技术主要包括计算机视觉技术、机器人技术、生物识别技术、语音处理技术、自然语言处理技术以及机器学习/深度学习等几大方向。Artificial intelligence basic technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation/interaction systems, and mechatronics. Artificial intelligence software technology mainly includes computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning/deep learning.
在相关技术中,各家保险系统通过判断投保人的相关信息来确定投保人的信用值是否达到投保要求。通常情况下,可以基于联邦学习模型对投保人的数据进行训练,扩充投保人的数据维度,确定投保人的信用值是否达到投保要求。In related technologies, various insurance systems determine whether the credit value of the policyholder meets the insurance requirements by judging the relevant information of the policyholder. Under normal circumstances, the data of the policyholder can be trained based on the federated learning model to expand the data dimension of the policyholder to determine whether the credit value of the policyholder meets the insurance requirements.
针对相关技术中的确定投保人的信用值是否达到投保要求,主要通过以下实现方式:To determine whether the credit value of the policyholder meets the insurance requirements in related technologies, it is mainly implemented through the following methods:
在传统的健康险风控场景下,各家保险系统通过投保人历史重大疾病就诊史、投保人提交的健康状况说明书,来计算投保人的信用值是否达到投保要求,但存在投保人数据维度缺失,数据真实性无法判断等情况,各家保险系统(保险公司)不能将自身用户数据向外公布, 以获取第三方机构的验证,或者直接将多家医疗机构的数据聚合到一起建模。In the traditional health insurance risk control scenario, each insurance system calculates whether the credit value of the insured meets the insurance requirements through the history of the insured’s history of major disease visits and the health status statement submitted by the insured, but there is a lack of dimensionality of the insured’s data , the authenticity of the data cannot be judged, etc., each insurance system (insurance company) cannot publish its own user data to obtain verification from a third-party organization, or directly aggregate the data of multiple medical institutions together for modeling.
通常,各家保险系统通过引入联邦学习模型,可以在本地数据库对投保人的相关信息进行训练,实现投保人数据维度的扩充。在联邦学习模型中的各参与方需要依赖中心节点进行参数的更新或下发,若中心节点出现故障或恶意行为,那么整个联邦学习协同训练的结果将受到影响。Usually, by introducing a federated learning model, each insurance system can train the relevant information of the policyholder in the local database to realize the expansion of the data dimension of the policyholder. Each participant in the federated learning model needs to rely on the central node to update or issue parameters. If the central node fails or acts maliciously, the results of the entire federated learning collaborative training will be affected.
由于不能够让原始数据外传,只能去传输一些模型中间数据,比如梯度信息。可事实上,即便就是这些梯度信息的泄露,也还是会有原始数据被推导出来的风险。并且也不能保证联邦学习的每个参与方都是诚实的。因为每个参与方他们可能有不同的动机。那么我们说到不诚实的参与方又分为两种:一种是恶意的,一种是无恶意但是好奇的。所谓恶意的参与方,就是他可能会来对模型进行投毒,比如故意传输一些错误的数据来损害其他参与方的利益,而好奇的参与方他不会去损害其他参与方的利益,但是他会对他收集到的所有的交互数据进行分析来试图推导其他各方的原始数据。Since the original data cannot be transmitted, we can only transmit some intermediate data of the model, such as gradient information. But in fact, even if the gradient information is leaked, there is still a risk that the original data will be deduced. And there is no guarantee that every participant in federated learning is honest. Because each participant may have different motivations. Then when we talk about dishonest participants, there are two types: one is malicious, and the other is innocent but curious. The so-called malicious participant is that he may come to poison the model, such as deliberately transmitting some wrong data to harm the interests of other participants, while the curious participant will not harm the interests of other participants, but he All the interaction data he collects will be analyzed to try to deduce the original data of other parties.
当然相关技术中的联邦学习还有一些其他比如数据传输效率的问题。模型训练会涉及到大量的运算,那么各方联合建模就会涉及到大量的数据进行交互的问题。比如像在梯度下降的时候,每一步的梯度迭代都会涉及到通信成本。所以通信效率这块也是联邦学习在落地过程中会遇到的挑战。此外,还有像机构与机构之间样本分布不均衡的问题等等。Of course, federated learning in related technologies also has some other issues such as data transmission efficiency. Model training involves a large number of calculations, and the joint modeling of all parties will involve a large amount of data interaction. For example, in gradient descent, each gradient iteration involves communication costs. Therefore, communication efficiency is also a challenge that federated learning will encounter during the implementation process. In addition, there are issues such as uneven sample distribution from institution to institution, and so on.
如果能够将各家保险系统的模型训练后的参数都上传到区块链,通过点对点通信,摆脱中心服务器的依赖。同时区块链的共识机制能识别各参与方的贡献度进行奖励或者惩罚,对恶意行为可以被事后溯源,实现联邦学习在训练过程中减少恶意节点(使用无效、病毒数据训练)或自私节点(不积极提供数据资源,只索取其他参与方资源)参与模型训练。If it is possible to upload the parameters after model training of each insurance system to the blockchain, through peer-to-peer communication, we can get rid of the dependence on the central server. At the same time, the consensus mechanism of the blockchain can recognize the contribution of each participant to reward or punish, and the source of malicious behavior can be traced afterwards, so that federated learning can reduce malicious nodes (training with invalid, virus data) or selfish nodes ( Do not actively provide data resources, only ask for resources from other participants) to participate in model training.
针对上述实现方式中存在的问题,本申请想到了一种联邦学习管理方法,能够通过在训练前根据每个参与终端的信誉度来判断是否具备联邦学习训练资格;训练中参与终端可以互相监督其他参与终端在训练过程中的诚实度进行投票评分,并维护自己的信誉度,防止信息篡改;训练后通过信誉度评分高低对参与方进行奖惩管理。In view of the problems existing in the above-mentioned implementation methods, this application thinks of a federated learning management method, which can judge whether it is qualified for federated learning training according to the credibility of each participating terminal before training; participating terminals can supervise each other during training. The honesty of participating terminals during the training process is voted and scored, and their own credibility is maintained to prevent information tampering; after training, participants are rewarded and punished based on their credibility scores.
并且,根据共识流程进行参与终端的行为评估,训练结束后对参与者的贡献度量化计算,提高了各参与终端获取并判断用户数据的准确度。In addition, the behavior evaluation of participating terminals is carried out according to the consensus process, and the contribution to the participants is quantified and calculated after the training, which improves the accuracy of each participating terminal in obtaining and judging user data.
如图1所示,为本实施例提供的一种联邦学习管理方法的流程示意图,包括S201至S204:As shown in Figure 1, it is a schematic flow diagram of a federated learning management method provided in this embodiment, including S201 to S204:
S201、多个参与终端通过预设的联邦模型对各自本地的数据库进行训练,得到每个参与终端对应的一个模型参数。S201. Multiple participating terminals train their respective local databases through a preset federated model to obtain a model parameter corresponding to each participating terminal.
示例性地,上述多个参与终端可以为健康大数据机构、医疗机构、保险机构等多个机构(或公司),每个参与终端都具有各自本地的数据库,该数据库中包括有各自的用户信息。Exemplarily, the above-mentioned multiple participating terminals may be multiple institutions (or companies) such as health big data institutions, medical institutions, and insurance institutions, and each participating terminal has its own local database, which includes its own user information .
示例性地,每个参与终端各自基于各自本地的数据库,通过预设的联邦模型对用户信息进行训练,以得到每个参与终端各自对应一个模型参数。Exemplarily, each participating terminal trains user information through a preset federated model based on its own local database, so as to obtain a model parameter corresponding to each participating terminal.
可以理解的是,上述预设的联邦模型为现有技术中,各参与终端通过引入联邦学习后,在本地数据库中进行训练实现投保人数据维度的扩充,在联邦学习中的各参与方需要依赖中心节点进行参数的更新或下发。It can be understood that the above-mentioned preset federated model is an existing technology. After introducing federated learning, each participating terminal conducts training in the local database to expand the data dimension of the policyholder. In federated learning, each participant needs to rely on The central node updates or issues parameters.
在一种可能的实现方式中,还可以通过以下步骤得到每个参与终端对应的一个模型参数。In a possible implementation manner, a model parameter corresponding to each participating terminal may also be obtained through the following steps.
示例性地,如图2所示,上述步骤S201可以包括以下步骤S201a和S201b:Exemplarily, as shown in FIG. 2, the above step S201 may include the following steps S201a and S201b:
S201a、所述多个参与终端中的每个参与终端分别利用所述预设的联邦模型对本地的数据库进行训练,得到每个参与终端对应的模型参数和权重值。S201a. Each participating terminal among the plurality of participating terminals respectively uses the preset federated model to train a local database to obtain model parameters and weight values corresponding to each participating terminal.
示例性地,每个参与终端通过预设的联邦模型对本地的数据库进行数据模型训练,建立模型,先将参与终端数据库中每个用户对应的信息进行数值化处理,再从中筛选出相关度较高的特征信息,从而得到每个参与终端对应的模型参数和权重值。Exemplarily, each participating terminal performs data model training on the local database through the preset federated model, establishes the model, first numerically processes the information corresponding to each user in the participating terminal database, and then screens out relevant information from it. High feature information, so as to obtain the model parameters and weight values corresponding to each participating terminal.
需要说明的是,联邦学习可使得各个参与方之间协同来完成一个数据模型的训练,训练出的模型是基于所有参与方的数据而达到的效果,但参与方彼此之间不会泄露各自的原始数据。It should be noted that federated learning can enable all participants to cooperate to complete the training of a data model. The trained model is based on the data of all participants, but the participants will not disclose their own data. Raw data.
示例性地,上述预设的联邦模型可以为:横向联邦学习、纵向联邦学习、联邦迁移学习等。Exemplarily, the above preset federated models may be: horizontal federated learning, vertical federated learning, federated transfer learning, and so on.
S201b、所述多个参与终端中的每个参与终端分别将对应的模型参数和权重值上传至区块链。S201b. Each of the multiple participating terminals uploads corresponding model parameters and weight values to the blockchain.
示例性地,每个参与终端在利用所述预设的联邦模型对本地的数据库进行训练,得到每个参与终端对应的模型参数和权重值之后,可以将模型参数和权重值共同上传至同一区块链(共享数据库)。Exemplarily, after each participating terminal uses the preset federated model to train the local database and obtains the model parameters and weight values corresponding to each participating terminal, it can upload the model parameters and weight values to the same zone Blockchain (shared database).
示例性地,健康大数据机构、医疗机构、保险机构可以利用各自的数据库在本地利用预设的联邦模型进行训练,得到初始的模型参数和权重值,并上传到区块链中。For example, health big data institutions, medical institutions, and insurance institutions can use their respective databases to train locally with a preset federated model, obtain initial model parameters and weight values, and upload them to the blockchain.
示例性的,以车险领域为例,因每个司机的驾驶习惯不同,有的司机可能用车用得很多,而可能有的司机可能他的车常年停在地下车库里;有的司机可能驾车习惯比较好,有的司机可能喜欢超速,从事一些危险驾驶的行为。同样投保一年,那能不能针对每个不同的用户设计不一样的保费呢,比如用车时间长的用户比用车时间少的用户保费高,驾驶习惯不好的用户比驾驶习惯好的用户保费高。这样对于保险公司来说也可以降低风险,对那些出事故概率比较高的用户提高保费,也能够将一部分不好的用户阻挡在外。通过对每个参与终端中的用户信息进行联邦学习训练,得到对应的模型参数和权重值。As an example, take the field of auto insurance as an example. Because each driver has different driving habits, some drivers may use their cars a lot, while some drivers may park their cars in underground garages all year round; some drivers may drive It is better to get used to it. Some drivers may like to speed and engage in some dangerous driving behaviors. It is also insured for one year, so can we design different insurance premiums for different users? For example, users who use the car for a long time have higher insurance premiums than users who use the car for less time, and users with bad driving habits are more expensive than users with good driving habits. High premiums. In this way, insurance companies can also reduce risks, increase premiums for users with a higher probability of accidents, and also block some bad users. By performing federated learning training on user information in each participating terminal, the corresponding model parameters and weight values are obtained.
具体实现中,各参与终端需要基于联邦模型创建对应的任务配置信息。具体来说,各参与终端可以通过响应用户的联邦学习设置操作,对联邦模型任务的任务配置信息进行确定并进行创建;其中,联邦模型任务的任务配置信息包括但不限于:任务类型、引擎框架、自动调参算法、提前终止算法、特征工程信息及方法和数据预处理方法等信息。In specific implementation, each participating terminal needs to create corresponding task configuration information based on the federation model. Specifically, each participating terminal can determine and create the task configuration information of the federated model task by responding to the user's federated learning setting operation; wherein, the task configuration information of the federated model task includes but is not limited to: task type, engine framework , automatic parameter tuning algorithm, early termination algorithm, feature engineering information and methods, and data preprocessing methods and other information.
当各参与终端确定联邦模型任务对应的任务配置信息后,各参与终端将任务配置信息发送至区块链,以使区块链获取参与联邦模型的多个参与终端的任务配置信息。由于任务配置信息不涉及数据安全隐私问题,因此,各参与终端可以不经加密地向区块链发送该任务配置信息。After each participating terminal determines the task configuration information corresponding to the federated model task, each participating terminal sends the task configuration information to the blockchain, so that the blockchain can obtain the task configuration information of multiple participating terminals participating in the federated model. Since the task configuration information does not involve data security and privacy issues, each participating terminal can send the task configuration information to the blockchain without encryption.
S202、通过各模型参数对预设的联合模型进行训练,并记录所述各模型参对所述联合模型的贡献数据。S202. Train the preset joint model through each model parameter, and record the contribution data of each model participating in the joint model.
示例性地,区块链在接收到各参与终端上传的各模型参数之后,将这些模型参数进行整合,然后进行联合训练,得到多个参与终端对应的联合模型参数(全局模型),并确定每个参与终端的贡献数据。Exemplarily, after the block chain receives the model parameters uploaded by each participating terminal, these model parameters are integrated, and then joint training is performed to obtain joint model parameters (global model) corresponding to multiple participating terminals, and determine each The contribution data of participating terminals.
示例性地,在区块链通过各模型参数对预设的联合模型进行训练的过程中,可以记录每个参与终端在训练过程中的用户行为、对所述联合模型的贡献度和共识投票结果等信息。Exemplarily, in the process of training the preset joint model through various model parameters in the blockchain, the user behavior of each participating terminal during the training process, the contribution to the joint model and the consensus voting results can be recorded and other information.
示例性地,如图3所示,上述步骤S202可以包括以下步骤S202a至S202d:Exemplarily, as shown in FIG. 3, the above step S202 may include the following steps S202a to S202d:
S202a、将所述多个参与终端的模型参数进行拼接,生成联邦参数。S202a. Concatenate the model parameters of the multiple participating terminals to generate federated parameters.
示例性地,区块链可以将多个参与终端的模型参数进行整合处理,以得到一个拼接模型参数,从而生成联邦参数。Exemplarily, the blockchain can integrate model parameters of multiple participating terminals to obtain a concatenated model parameter, thereby generating federated parameters.
需要说明的是,上述联邦参数为通过多个参与终端的模型参数共同得到的模型参数(即全局模型参数)。It should be noted that the above-mentioned federation parameters are model parameters (ie, global model parameters) jointly obtained from model parameters of multiple participating terminals.
S202b、根据所述联邦参数对所述联合模型的参数进行初始化,并根据预设的训练样本对所述初始化后的联合模型进行训练,生成特征向量。S202b. Initialize parameters of the joint model according to the federation parameters, and train the initialized joint model according to preset training samples to generate feature vectors.
示例性地,区块链根据联邦参数,对联邦学习任务中的模型训练配置信息(即联合模型的参数)进行初始化,并基于初始化后的模型训练配置信息,执行联邦学习任务的模型训练操作,生成对应的特征向量。Exemplarily, the blockchain initializes the model training configuration information (that is, the parameters of the joint model) in the federated learning task according to the federated parameters, and executes the model training operation of the federated learning task based on the initialized model training configuration information, Generate the corresponding eigenvectors.
示例性地,在初始化后的模型训练配置信息中,确定针对模型训练操作的特征工程信息,根据特征工程信息,对用户数据样本进行特征处理,得到模型训练数据样本,生成对应的特征向量。Exemplarily, in the initialized model training configuration information, feature engineering information for model training operations is determined, and according to the feature engineering information, user data samples are subjected to feature processing to obtain model training data samples and corresponding feature vectors are generated.
S202c、基于所述特征向量与预设的标注向量,计算所述联合模型特征差值。S202c. Calculate the feature difference of the joint model based on the feature vector and a preset label vector.
S202d、根据所述特征差值计算所述各模型参数偏差值,并根据所述偏差值生成所述贡献 数据。S202d. Calculate the deviation value of each model parameter according to the characteristic difference value, and generate the contribution data according to the deviation value.
示例性地,区块链根据生成的特征向量与预设的标注向量,进行作差计算,得到联合模型对应的特征差值。Exemplarily, the blockchain performs difference calculation according to the generated feature vector and the preset label vector to obtain the feature difference corresponding to the joint model.
进一步的,区块链根据得到的特征差值,根据各参与终端对应的模型参数,再次计算各模型参数对应的偏差值,从而根据各参与终端对应的偏差值生成各参与终端对应的贡献数据。Further, the blockchain recalculates the deviation value corresponding to each model parameter according to the obtained characteristic difference value and the model parameter corresponding to each participating terminal, so as to generate the corresponding contribution data of each participating terminal according to the corresponding deviation value of each participating terminal.
S203、基于所述贡献数据和预设的信誉度评分共识机制模型,对各参与终端进行信誉评分。S203. Perform reputation scoring on each participating terminal based on the contribution data and the preset reputation scoring consensus mechanism model.
示例性地,信誉度评分共识机制(Practical Byzantine Fault Tolerance of Credibility Evaluation,CE-PBFT)根据共识流程进行用户行为评估,对投票动态权重调整设置信誉评分,联合模型训练后的参数进行联合训练任务,生成全局模型。Exemplarily, the Practical Byzantine Fault Tolerance of Credibility Evaluation (CE-PBFT) evaluates user behavior according to the consensus process, sets the reputation score for voting dynamic weight adjustment, and performs joint training tasks with the parameters after joint model training. Generate a global model.
如图4所示,为本申请实施例提供的联邦学习管理方法对应的信誉度评分共识机制的模型图,信誉度评分共识机制根据确定的各参与终端对应的贡献数据,对各参与终端进行信誉评分,每个参与终端对应一个信誉得分。As shown in Figure 4, it is a model diagram of the reputation scoring consensus mechanism corresponding to the federated learning management method provided by the embodiment of this application. The reputation scoring consensus mechanism performs reputation evaluation on each participating terminal according to the determined contribution data corresponding to each participating terminal Scoring, each participating terminal corresponds to a reputation score.
示例性地,所述贡献数据包括:所述各参与终端的用户行为、对所述联合模型的贡献度和共识投票结果。如图5所示,上述步骤S203可以包括以下步骤S203a和S203b:Exemplarily, the contribution data includes: user behavior of each participating terminal, contribution to the joint model, and consensus voting results. As shown in FIG. 5, the above step S203 may include the following steps S203a and S203b:
S203a、将所述各参与终端的用户行为、对所述联合模型的贡献度和共识投票结果输入至所述信誉度评分共识机制模型中。S203a. Input the user behavior of each participating terminal, the contribution to the joint model, and the consensus voting result into the reputation scoring consensus mechanism model.
示例性地,区块链上记录了之前各参与终端在训练过程中的用户行为、对联合模型的贡献度和共识投票结果(即历史记录的训练过程中的用户行为、对联合模型的贡献度和共识投票结果,若没有历史记录从本次投票开始计算)。在本次上传参数后,各参与终端开始投票,若某个参与终端放弃投票,则信誉度评分降低,低于评分阈值后不具备联邦模型学习训练资格。Exemplarily, the block chain records the user behavior of each participating terminal during the training process, the contribution to the joint model and the consensus voting results (that is, the user behavior in the training process of the historical records, the contribution to the joint model and consensus voting results, if there is no historical record, it will be calculated from this voting). After uploading the parameters this time, each participating terminal begins to vote. If a participating terminal gives up voting, the reputation score will be reduced. If it is lower than the scoring threshold, it will not be eligible for federated model learning and training.
示例性地,区块链将每个参与终端的用户行为、对联合模型的贡献度和共识投票结果这三个信息输入至信誉度评分共识机制模型中,以使得信誉度评分共识机制模型分别对每个参与终端的这三个信息进行分析处理,确定每个参与终端对应的信誉得分。Exemplarily, the blockchain inputs three pieces of information, namely user behavior of each participating terminal, contribution to the joint model, and consensus voting results, into the reputation scoring consensus mechanism model, so that the reputation scoring consensus mechanism model is The three pieces of information of each participating terminal are analyzed and processed to determine the reputation score corresponding to each participating terminal.
示例性地,信誉度评分共识机制根据每个参与终端的用户行为、对联合模型的贡献度和共识投票结果这三个信息,并根据每个信息的比重,计算得到每个参与终端对应的信誉得分。Exemplarily, the reputation scoring consensus mechanism calculates the corresponding reputation of each participating terminal based on the three information of each participating terminal's user behavior, contribution to the joint model, and consensus voting results, and according to the proportion of each information Score.
S203b、读取所述信誉度评分共识机制模型输出的所述各参与终端的信誉评分。S203b. Read the reputation scores of the participating terminals output by the reputation scoring consensus mechanism model.
示例性地,信誉度评分共识机制模型在计算得到每个参与终端对应的信誉得分之后,将每个参与终端对应的信誉得分发送至每个参与终端。Exemplarily, after the credibility score consensus mechanism model calculates the reputation score corresponding to each participating terminal, it sends the reputation score corresponding to each participating terminal to each participating terminal.
示例性地,信誉度评分共识机制模型对每个参与终端对应的信誉得分的计算方法如公式 一所示:Exemplarily, the calculation method of the credibility score consensus mechanism model for each participating terminal is shown in formula 1:
Figure PCTCN2022089694-appb-000001
Figure PCTCN2022089694-appb-000001
其中,α,β,λ为参数,T是对之前历史投票做出的评分,
Figure PCTCN2022089694-appb-000002
表示投票后参与方信誉评分更新后的值,i,j表示不同参与方,t表示当前投票次数。others表示增加分数,若参与终端积极参与投票或者训练过程中表现良好则额外增加分数,否则减少分数。
Among them, α, β, λ are parameters, and T is the score of previous historical votes.
Figure PCTCN2022089694-appb-000002
Indicates the updated value of the participant's reputation score after voting, i and j represent different participants, and t represents the current number of votes. Others means to increase the score. If the participating terminal actively participates in voting or performs well during the training process, the score will be added, otherwise the score will be reduced.
示例性地,上述步骤S203之前,如图6所示,本申请实施例提供的联邦学习管理方法,还可以包括以下步骤S301和S302:Exemplarily, before the above step S203, as shown in FIG. 6, the federated learning management method provided by the embodiment of the present application may also include the following steps S301 and S302:
S301、获取全局模型的全局参数。S301. Acquire global parameters of the global model.
其中,所述全局模型为所述联合模型训练至收敛状态时的模型形态。Wherein, the global model is a model form when the joint model is trained to a converged state.
S302、将所述全局参数分发至所述各参与终端,以使所述各参与终端的联邦模型生成全局参数。S302. Distribute the global parameter to each participating terminal, so that the federated model of each participating terminal generates a global parameter.
示例性地,信誉度评分共识机制模型根据共识流程进行用户行为评估,对投票动态权重调整设置信誉评分,联合模型训练后的参数进行联合训练任务,生成全局模型,得到全局模型的全局参数。Exemplarily, the reputation score consensus mechanism model evaluates user behavior according to the consensus process, sets the reputation score for voting dynamic weight adjustment, and performs joint training tasks with parameters after model training to generate a global model and obtain global parameters of the global model.
示例性地,区块链将全局模型的模型参数更新后发送给各参与终端,以使各参与终端的联邦模型获取到全局参数。Exemplarily, the block chain updates the model parameters of the global model and sends them to each participating terminal, so that the federated model of each participating terminal can obtain the global parameters.
S204、根据所述各参与终端的信誉评分,对所述各参与终端进行奖惩管理。S204. Perform reward and punishment management on each participating terminal according to the reputation score of each participating terminal.
示例性地,信誉度评分共识机制模型根据各参与终端的信誉评分,对各参与终端的信誉评分进行奖惩,信誉评分低的参与终端可能存在有恶意行为、对本次训练贡献度低等,将无法参与下一轮联邦模型学习训练。Exemplarily, the reputation score consensus mechanism model rewards and punishes the reputation scores of each participating terminal according to the reputation scores of each participating terminal. Participating terminals with low reputation scores may have malicious behaviors and low contribution to this training. Unable to participate in the next round of federated model learning and training.
示例性地,如图7所示,上述步骤S204可以包括以下步骤S204a和S204b:Exemplarily, as shown in FIG. 7, the above step S204 may include the following steps S204a and S204b:
S204a、将所述各参与终端的信誉评分与预设的评分阈值进行比对。S204a. Compare the credit score of each participating terminal with a preset score threshold.
S204b、当任一参与终端的信誉评分小于所述评分阈值时,则禁止所述参与终端参与下一轮的联合训练。S204b. When the reputation score of any participating terminal is less than the scoring threshold, prohibit the participating terminal from participating in the next round of joint training.
示例性地,信誉度评分共识机制模型在获取到各参与终端的信誉评分之后,将各参与终端的信誉评分于预设的评分阈值(例如50分)作比较,在任一参与终端的信誉评分小于评分阈值时,可以判定该参与终端的贡献度较低,或存在恶意行为等,禁止该参与终端参与下一轮的联合训练。Exemplarily, after the reputation score consensus mechanism model of each participating terminal is obtained, the reputation score of each participating terminal is compared with a preset scoring threshold (for example, 50 points), and the reputation score of any participating terminal is less than When scoring the threshold, it can be determined that the contribution of the participating terminal is low, or there is malicious behavior, etc., and the participating terminal is prohibited from participating in the next round of joint training.
具体的,在任一参与终端的信誉度评分在50和100之间时,说明该参与终端表现优异,通过积极参与模型训练,过程无恶意行为,最终使信誉度评分达到100,则积分会重置为50,重新开始下一周期的计分,当参与终端有恶意行为或者消极参与模型训练时,信誉度评分会 不停减少,最终低于50而无法进行模型训练。Specifically, when the reputation score of any participating terminal is between 50 and 100, it means that the participating terminal has excellent performance. Through active participation in model training, there is no malicious behavior in the process, and finally the reputation score reaches 100, and the points will be reset. If the value is 50, the scoring of the next cycle will start again. When the participating terminal has malicious behavior or passively participates in model training, the reputation score will continue to decrease, and eventually it will be lower than 50 and model training cannot be performed.
示例性地,上述步骤S204之后,如图8所示,本申请实施例提供的联邦学习管理方法,还可以包括以下步骤S401和S402:Exemplarily, after the above step S204, as shown in FIG. 8 , the federated learning management method provided by the embodiment of the present application may further include the following steps S401 and S402:
S401、依次读取所述各参与终端的投票结果。S401. Read the voting results of the participating terminals in sequence.
S402、当任一参与终端放弃投票时,则降低所述参与终端的信誉评分。S402. When any participating terminal abstains from voting, reduce the reputation score of the participating terminal.
示例性地,信誉度评分共识机制模型分别获取各参与终端的投票情况,并在2)投票结束后对各参与终端的信誉评分进行更新。Exemplarily, the reputation scoring consensus mechanism model respectively obtains the voting status of each participating terminal, and updates the reputation scoring of each participating terminal after 2) the voting ends.
示例性地,在信誉度评分共识机制模型获取不到某一参与终端的投票结果时,确定该参与终端放弃投票,则降低参与终端的信誉评分。Exemplarily, when the reputation scoring consensus mechanism model cannot obtain the voting result of a certain participating terminal, it is determined that the participating terminal has given up voting, and the reputation score of the participating terminal is reduced.
本实施例提供的联邦学习管理方法,通过预设的联邦模型对多个参与终端各自本地的数据库进行训练,以得到每个参与终端对应的一个模型参数,从而通过各模型参数对预设的联合模型进行训练,并在训练的过程中记录各模型参对联合模型的贡献数据,最终通过预设的信誉度评分共识机制模型对多个参与终端的贡献数据进行分析,以对各参与终端进行信誉评分,从而根据各参与终端的信誉评分,对各参与终端进行奖惩管理。以针对联邦学习依赖中心服务器,可能会出现故障或恶意行为等问题,将各参与终端的模型训练后参数都上传到区块链,通过信誉度评分共识机制根据投票分数结果,对不同贡献度的参与终端进行奖励或者惩罚,可以充分调动了各参与终端的积极性,也能减少存在恶意行为或自私行为的各参与终端存在。The federated learning management method provided in this embodiment uses a preset federated model to train the respective local databases of multiple participating terminals to obtain a model parameter corresponding to each participating terminal, so that the preset federated learning parameters can be adjusted through each model parameter. The model is trained, and the contribution data of each model participating in the joint model is recorded during the training process. Finally, the contribution data of multiple participating terminals is analyzed through the preset reputation scoring consensus mechanism model to evaluate the reputation of each participating terminal. Scoring, so as to carry out reward and punishment management for each participating terminal according to the reputation score of each participating terminal. In order to solve problems such as federated learning relying on the central server, there may be failures or malicious behaviors, the model training parameters of each participating terminal are uploaded to the blockchain, and the credibility score consensus mechanism is used according to the results of voting scores. Rewarding or punishing participating terminals can fully mobilize the enthusiasm of participating terminals, and can also reduce the existence of participating terminals that have malicious or selfish behaviors.
需要说明的是,本申请实施例提供的联邦学习管理方法,执行主体可以为联邦学习管理装置,或者该联邦学习管理装置中的用于执行联邦学习管理方法的控制模块。本申请实施例中以联邦学习管理装置执行联邦学习管理方法为例,说明本申请实施例提供的联邦学习管理装置。It should be noted that, the federated learning management method provided in the embodiment of the present application may be executed by a federated learning management device, or a control module in the federated learning management device for executing the federated learning management method. In the embodiment of the present application, the federated learning management device provided in the embodiment of the present application is described by taking the federated learning management device executing the federated learning management method as an example.
需要说明的是,本申请实施例中,上述各个方法附图所示的联邦学习管理方法均是以结合本申请实施例中的一个附图为例示例性的说明的。具体实现时,上述各个方法附图所示的联邦学习管理方法还可以结合上述实施例中示意的其它可以结合的任意附图实现,此处不再赘述。It should be noted that, in the embodiments of the present application, the federated learning management methods shown in the drawings of the above methods are all described in conjunction with a drawing in the embodiments of the present application as an example. In specific implementation, the federated learning management method shown in the drawings of the above methods can also be implemented in combination with any other drawings shown in the above embodiments that can be combined, and will not be repeated here.
具体请参阅图9,图9为本实施例联邦学习管理装置基本结构示意图。Please refer to FIG. 9 for details. FIG. 9 is a schematic diagram of the basic structure of the federated learning management device in this embodiment.
如图9所示,一种联邦学习管理装置,包括:训练模块801,用于多个参与终端通过预设的联邦模型对各自本地的数据库进行训练,得到每个参与终端对应的一个模型参数;所述训练模块801,还用于通过各模型参数对预设的联合模型进行训练,并记录所述各模型参对所述联合模型的贡献数据;评分模块802,用于基于所述贡献数据和预设的信誉度评分共识 机制模型,对各参与终端进行信誉评分;管理模块803,用于根据所述各参与终端的信誉评分,对所述各参与终端进行奖惩管理。As shown in FIG. 9, a federated learning management device includes: a training module 801, used for multiple participating terminals to train their local databases through a preset federated model to obtain a model parameter corresponding to each participating terminal; The training module 801 is also used to train the preset joint model through each model parameter, and record the contribution data of each model participating in the joint model; the scoring module 802 is used to train the joint model based on the contribution data and The preset reputation scoring consensus mechanism model performs reputation scoring on each participating terminal; the management module 803 is configured to perform reward and punishment management on each participating terminal according to the reputation scoring of each participating terminal.
在一些方式中,所述训练模块801,具体用于所述多个参与终端中的每个参与终端分别利用所述预设的联邦模型对本地的数据库进行训练,得到每个参与终端对应的模型参数和权重值;所述装置还包括:上传模块804;所述上传模块804,用于所述多个参与终端中的每个参与终端分别将对应的模型参数和权重值上传至区块链。In some manners, the training module 801 is specifically used for each of the multiple participating terminals to use the preset federated model to train the local database to obtain a model corresponding to each participating terminal parameters and weight values; the device also includes: an upload module 804; the upload module 804 is used for each participating terminal in the plurality of participating terminals to upload corresponding model parameters and weight values to the block chain.
在一些方式中,所述训练模块801,具体用于将所述多个参与终端的模型参数进行拼接,生成联邦参数;所述训练模块801,具体还用于根据所述联邦参数对所述联合模型的参数进行初始化,并根据预设的训练样本对所述初始化后的联合模型进行训练,生成特征向量;所述训练模块801,具体还用于基于所述特征向量与预设的标注向量,计算所述联合模型特征差值;所述训练模块801,具体还用于根据所述特征差值计算所述各模型参数偏差值,并根据所述偏差值生成所述贡献数据。In some manners, the training module 801 is specifically configured to concatenate the model parameters of the multiple participating terminals to generate federated parameters; The parameters of the model are initialized, and the initialized joint model is trained according to the preset training samples to generate a feature vector; the training module 801 is specifically further configured to, based on the feature vector and the preset label vector, Calculate the characteristic difference of the joint model; the training module 801 is specifically configured to calculate the deviation value of each model parameter according to the characteristic difference, and generate the contribution data according to the deviation value.
在一些方式中,所述贡献数据包括:所述各参与终端的用户行为、对所述联合模型的贡献度和共识投票结果;所述评分模块802,具体用于将所述各参与终端的用户行为、对所述联合模型的贡献度和共识投票结果输入至所述信誉度评分共识机制模型中;所述评分模块802,具体还用于读取所述信誉度评分共识机制模型输出的所述各参与终端的信誉评分。In some manners, the contribution data includes: user behavior of each participating terminal, contribution to the joint model, and consensus voting results; Behavior, contribution to the joint model and consensus voting results are input into the reputation scoring consensus mechanism model; the scoring module 802 is also specifically used to read the output of the credibility scoring consensus mechanism model The reputation score of each participating terminal.
在一些方式中,所述装置还包括:获取模块805和发送模块806;所述获取模块805,用于获取全局模型的全局参数,其中,所述全局模型为所述联合模型训练至收敛状态时的模型形态;所述发送模块806,用于将所述全局参数分发至所述各参与终端,以使所述各参与终端的联邦模型生成全局参数。In some manners, the device further includes: an acquisition module 805 and a sending module 806; the acquisition module 805 is configured to acquire global parameters of the global model, wherein the global model is when the joint model is trained to a convergence state model form; the sending module 806 is configured to distribute the global parameters to the participating terminals, so that the federated models of the participating terminals generate global parameters.
在一些方式中,所述管理模块803,具体用于将所述各参与终端的信誉评分与预设的评分阈值进行比对;所述管理模块803,具体还用于当任一参与终端的信誉评分小于所述评分阈值时,则禁止所述参与终端参与下一轮的联合训练。In some manners, the management module 803 is specifically configured to compare the reputation score of each participating terminal with a preset scoring threshold; When the score is less than the score threshold, the participating terminals are prohibited from participating in the next round of joint training.
在一些方式中,所述管理模块803,还用于依次读取所述各参与终端的投票结果;所述管理模块803,还用于当任一参与终端放弃投票时,则降低所述参与终端的信誉评分。In some manners, the management module 803 is further configured to sequentially read the voting results of the participating terminals; the management module 803 is further configured to lower the voting results of the participating terminals when any participating terminal gives up voting. reputation score.
一种计算机设备包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行所述联邦学习管理方法:A computer device includes a memory and a processor, wherein computer-readable instructions are stored in the memory, and when the computer-readable instructions are executed by the processor, the processor executes the federated learning management method:
多个参与终端通过预设的联邦模型对各自本地的数据库进行训练,得到每个参与终端对应的一个模型参数;Multiple participating terminals train their respective local databases through the preset federated model, and obtain a model parameter corresponding to each participating terminal;
通过各模型参数对预设的联合模型进行训练,并记录所述各模型参对所述联合模型的贡献数据;Train the preset joint model through each model parameter, and record the contribution data of each model participant to the joint model;
基于所述贡献数据和预设的信誉度评分共识机制模型,对各参与终端进行信誉评分;Perform reputation scoring on each participating terminal based on the contribution data and the preset reputation scoring consensus mechanism model;
根据所述各参与终端的信誉评分,对所述各参与终端进行奖惩管理。According to the reputation score of each participating terminal, reward and punishment management is performed on each participating terminal.
在一些方式中,所述联邦学习管理方法还包括:In some ways, the federated learning management method also includes:
所述多个参与终端中的每个参与终端分别利用所述预设的联邦模型对本地的数据库进行训练,得到每个参与终端对应的模型参数和权重值;Each of the plurality of participating terminals uses the preset federated model to train a local database to obtain model parameters and weight values corresponding to each participating terminal;
所述多个参与终端中的每个参与终端分别将对应的模型参数和权重值上传至区块链。Each of the plurality of participating terminals uploads corresponding model parameters and weight values to the block chain.
在一些方式中,所述联邦学习管理方法还包括:In some ways, the federated learning management method also includes:
将所述多个参与终端的模型参数进行拼接,生成联邦参数;splicing the model parameters of the multiple participating terminals to generate federated parameters;
根据所述联邦参数对所述联合模型的参数进行初始化,并根据预设的训练样本对所述初始化后的联合模型进行训练,生成特征向量;Initializing parameters of the joint model according to the federation parameters, and training the initialized joint model according to preset training samples to generate feature vectors;
基于所述特征向量与预设的标注向量,计算所述联合模型特征差值;calculating the feature difference of the joint model based on the feature vector and a preset label vector;
根据所述特征差值计算所述各模型参数偏差值,并根据所述偏差值生成所述贡献数据。Calculate the deviation value of each model parameter according to the characteristic difference value, and generate the contribution data according to the deviation value.
在一些方式中,所述贡献数据包括:所述各参与终端的用户行为、对所述联合模型的贡献度和共识投票结果;所述联邦学习管理方法还包括:In some manners, the contribution data includes: user behavior of each participating terminal, contribution to the joint model, and consensus voting results; the federated learning management method further includes:
将所述各参与终端的用户行为、对所述联合模型的贡献度和共识投票结果输入至所述信誉度评分共识机制模型中;Input the user behavior of each participating terminal, the contribution to the joint model and the consensus voting result into the reputation scoring consensus mechanism model;
读取所述信誉度评分共识机制模型输出的所述各参与终端的信誉评分。Reading the reputation scores of the participating terminals output by the reputation scoring consensus mechanism model.
在一些方式中,所述联邦学习管理方法还包括:In some ways, the federated learning management method also includes:
获取全局模型的全局参数,其中,所述全局模型为所述联合模型训练至收敛状态时的模型形态;Acquiring global parameters of the global model, wherein the global model is the model form when the joint model is trained to a converged state;
将所述全局参数分发至所述各参与终端,以使所述各参与终端的联邦模型生成全局参数。Distributing the global parameters to the participating terminals, so that the federated models of the participating terminals generate global parameters.
在一些方式中,所述联邦学习管理方法还包括:In some ways, the federated learning management method also includes:
将所述各参与终端的信誉评分与预设的评分阈值进行比对;Comparing the reputation scores of each participating terminal with a preset scoring threshold;
当任一参与终端的信誉评分小于所述评分阈值时,则禁止所述参与终端参与下一轮的联合训练。When the reputation score of any participating terminal is less than the scoring threshold, the participating terminal is prohibited from participating in the next round of joint training.
在一些方式中,所述联邦学习管理方法还包括:In some ways, the federated learning management method also includes:
依次读取所述各参与终端的投票结果;Read the voting results of each participating terminal in sequence;
当任一参与终端放弃投票时,则降低所述参与终端的信誉评分。When any participating terminal abstains from voting, the reputation score of the participating terminal is reduced.
一种存储有计算机可读指令的存储介质,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行所述联邦学习管理方法:A storage medium storing computer-readable instructions, which, when executed by one or more processors, cause one or more processors to execute the federated learning management method:
多个参与终端通过预设的联邦模型对各自本地的数据库进行训练,得到每个参与终端对 应的一个模型参数;Multiple participating terminals train their respective local databases through the preset federation model, and obtain a model parameter corresponding to each participating terminal;
通过各模型参数对预设的联合模型进行训练,并记录所述各模型参对所述联合模型的贡献数据;Train the preset joint model through each model parameter, and record the contribution data of each model participant to the joint model;
基于所述贡献数据和预设的信誉度评分共识机制模型,对各参与终端进行信誉评分;Perform reputation scoring on each participating terminal based on the contribution data and the preset reputation scoring consensus mechanism model;
根据所述各参与终端的信誉评分,对所述各参与终端进行奖惩管理。According to the reputation score of each participating terminal, reward and punishment management is performed on each participating terminal.
在一些方式中,所述联邦学习管理方法还包括:In some ways, the federated learning management method also includes:
所述多个参与终端中的每个参与终端分别利用所述预设的联邦模型对本地的数据库进行训练,得到每个参与终端对应的模型参数和权重值;Each of the plurality of participating terminals uses the preset federated model to train a local database to obtain model parameters and weight values corresponding to each participating terminal;
所述多个参与终端中的每个参与终端分别将对应的模型参数和权重值上传至区块链。Each of the plurality of participating terminals uploads corresponding model parameters and weight values to the block chain.
在一些方式中,所述联邦学习管理方法还包括:In some ways, the federated learning management method also includes:
将所述多个参与终端的模型参数进行拼接,生成联邦参数;splicing the model parameters of the multiple participating terminals to generate federated parameters;
根据所述联邦参数对所述联合模型的参数进行初始化,并根据预设的训练样本对所述初始化后的联合模型进行训练,生成特征向量;Initializing parameters of the joint model according to the federation parameters, and training the initialized joint model according to preset training samples to generate feature vectors;
基于所述特征向量与预设的标注向量,计算所述联合模型特征差值;calculating the feature difference of the joint model based on the feature vector and a preset label vector;
根据所述特征差值计算所述各模型参数偏差值,并根据所述偏差值生成所述贡献数据。Calculate the deviation value of each model parameter according to the characteristic difference value, and generate the contribution data according to the deviation value.
在一些方式中,所述贡献数据包括:所述各参与终端的用户行为、对所述联合模型的贡献度和共识投票结果;所述联邦学习管理方法还包括:In some manners, the contribution data includes: user behavior of each participating terminal, contribution to the joint model, and consensus voting results; the federated learning management method further includes:
将所述各参与终端的用户行为、对所述联合模型的贡献度和共识投票结果输入至所述信誉度评分共识机制模型中;Input the user behavior of each participating terminal, the contribution to the joint model and the consensus voting result into the reputation scoring consensus mechanism model;
读取所述信誉度评分共识机制模型输出的所述各参与终端的信誉评分。Reading the reputation scores of the participating terminals output by the reputation scoring consensus mechanism model.
在一些方式中,所述联邦学习管理方法还包括:In some ways, the federated learning management method also includes:
获取全局模型的全局参数,其中,所述全局模型为所述联合模型训练至收敛状态时的模型形态;Acquiring global parameters of the global model, wherein the global model is the model form when the joint model is trained to a converged state;
将所述全局参数分发至所述各参与终端,以使所述各参与终端的联邦模型生成全局参数。Distributing the global parameters to the participating terminals, so that the federated models of the participating terminals generate global parameters.
在一些方式中,所述联邦学习管理方法还包括:In some ways, the federated learning management method also includes:
将所述各参与终端的信誉评分与预设的评分阈值进行比对;Comparing the reputation scores of each participating terminal with a preset scoring threshold;
当任一参与终端的信誉评分小于所述评分阈值时,则禁止所述参与终端参与下一轮的联合训练。When the reputation score of any participating terminal is less than the scoring threshold, the participating terminal is prohibited from participating in the next round of joint training.
在一些方式中,所述联邦学习管理方法还包括:In some ways, the federated learning management method also includes:
依次读取所述各参与终端的投票结果;Read the voting results of each participating terminal in turn;
当任一参与终端放弃投票时,则降低所述参与终端的信誉评分。When any participating terminal abstains from voting, the reputation score of the participating terminal is reduced.
本申请实施例中的联邦学习管理装置可以是装置,也可以是终端中的部件、集成电路、或芯片。该装置可以是移动电子设备,也可以为非移动电子设备。示例性的,移动电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、可穿戴设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,非移动电子设备可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(personal computer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。The federated learning management device in the embodiment of the present application may be a device, or a component, an integrated circuit, or a chip in a terminal. The device may be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle electronic device, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant). assistant, PDA), etc., non-mobile electronic devices can be servers, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (television, TV), teller machine or self-service machine, etc., this application Examples are not specifically limited.
服务器可以是独立的服务器,也可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(Content Delivery Network,CDN)、以及大数据和人工智能平台等基础云计算服务的云服务器。The server can be an independent server, or it can provide cloud services, cloud database, cloud computing, cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, content delivery network (Content Delivery Network, CDN), and cloud servers for basic cloud computing services such as big data and artificial intelligence platforms.
本申请实施例提供的联邦学习管理装置能够实现图1至图8的方法实施例中联邦学习管理装置实现的各个过程,为避免重复,这里不再赘述。The federated learning management device provided in the embodiment of the present application can implement various processes implemented by the federated learning management device in the method embodiments shown in FIGS. 1 to 8 . To avoid repetition, details are not repeated here.
本实施例中各种实现方式具有的有益效果具体可以参见上述方法实施例中相应实现方式所具有的有益效果,为避免重复,此处不再赘述。For the beneficial effects of the various implementations in this embodiment, refer to the beneficial effects of the corresponding implementations in the foregoing method embodiments. To avoid repetition, details are not repeated here.
本申请实施例提供的联邦学习管理装置,通过预设的联邦模型对多个参与终端各自本地的数据库进行训练,以得到每个参与终端对应的一个模型参数,从而通过各模型参数对预设的联合模型进行训练,并在训练的过程中记录各模型参对联合模型的贡献数据,最终通过预设的信誉度评分共识机制模型对多个参与终端的贡献数据进行分析,以对各参与终端进行信誉评分,从而根据各参与终端的信誉评分,对各参与终端进行奖惩管理。以针对联邦学习依赖中心服务器,可能会出现故障或恶意行为等问题,将各参与终端的模型训练后参数都上传到区块链,通过信誉度评分共识机制根据投票分数结果,对不同贡献度的参与终端进行奖励或者惩罚,可以充分调动了各参与终端的积极性,也能减少存在恶意行为或自私行为的各参与终端存在。The federated learning management device provided in the embodiment of the present application trains the respective local databases of multiple participating terminals through a preset federated model to obtain a model parameter corresponding to each participating terminal, so that the preset The joint model is trained, and the contribution data of each model participating in the joint model is recorded during the training process. Finally, the contribution data of multiple participating terminals is analyzed through the preset reputation scoring consensus mechanism model, so as to analyze the contribution data of each participating terminal. Reputation scoring, so as to carry out reward and punishment management for each participating terminal according to the reputation scoring of each participating terminal. In order to solve problems such as federated learning relying on the central server, there may be failures or malicious behaviors, the model training parameters of each participating terminal are uploaded to the blockchain, and the credibility score consensus mechanism is used according to the results of voting scores. Rewarding or punishing participating terminals can fully mobilize the enthusiasm of participating terminals, and can also reduce the existence of participating terminals that have malicious or selfish behaviors.
为解决上述技术问题,本申请实施例还提供一种计算机设备。具体请参阅图10,图10为本实施例计算机设备基本结构框图。In order to solve the above technical problem, an embodiment of the present application further provides a computer device. Please refer to FIG. 10 for details. FIG. 10 is a block diagram of the basic structure of the computer device in this embodiment.
如图10所示,计算机设备的内部结构示意图。该计算机设备包括通过系统总线连接的处理器、非易失性存储介质、存储器和网络接口。其中,该计算机设备的非易失性存储介质存储有操作系统、数据库和计算机可读指令,数据库中可存储有控件信息序列,该计算机可读指令被处理器执行时,可使得处理器实现一种联邦学习管理方法。该计算机设备的处理器用于提供计算和控制能力,支撑整个计算机设备的运行。该计算机设备的存储器中可存储有计算机可读指令,该计算机可读指令被处理器执行时,可使得处理器执行一种联邦学习管理方 法。该计算机设备的网络接口用于与终端连接通信。本领域技术人员可以理解,图8中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。As shown in FIG. 10 , a schematic diagram of the internal structure of a computer device. The computer device includes a processor, a non-volatile storage medium, a memory and a network interface connected through a system bus. Wherein, the non-volatile storage medium of the computer device stores an operating system, a database, and computer-readable instructions, and the database can store control information sequences, and when the computer-readable instructions are executed by the processor, the processor can realize a A Federated Learning Management Approach. The processor of the computer equipment is used to provide computing and control capabilities and support the operation of the entire computer equipment. Computer-readable instructions may be stored in the memory of the computer device, and when the computer-readable instructions are executed by the processor, the processor may execute a federated learning management method. The network interface of the computer device is used for connecting and communicating with the terminal. Those skilled in the art can understand that the structure shown in FIG. 8 is only a block diagram of a partial structure related to the solution of this application, and does not constitute a limitation on the computer equipment to which the solution of this application is applied. The specific computer equipment can be More or fewer components than shown in the figures may be included, or some components may be combined, or have a different arrangement of components.
本实施方式中处理器用于执行图8中获取模块801、构建模块802和调整模块803的具体功能,存储器存储有执行上述模块所需的程序代码和各类数据。网络接口用于向用户终端或服务器之间的数据传输。本实施方式中的存储器存储有联邦学习管理装置中执行所有子模块所需的程序代码及数据,服务器能够调用服务器的程序代码及数据执行所有子模块的功能。In this embodiment, the processor is used to execute the specific functions of the acquisition module 801 , the construction module 802 and the adjustment module 803 in FIG. 8 , and the memory stores program codes and various data required for executing the above modules. The network interface is used for data transmission between user terminals or servers. The memory in this embodiment stores the program codes and data required to execute all sub-modules in the federated learning management device, and the server can call the program codes and data of the server to execute the functions of all sub-modules.
本实施例提供的计算机设备,通过预设的联邦模型对多个参与终端各自本地的数据库进行训练,以得到每个参与终端对应的一个模型参数,从而通过各模型参数对预设的联合模型进行训练,并在训练的过程中记录各模型参对联合模型的贡献数据,最终通过预设的信誉度评分共识机制模型对多个参与终端的贡献数据进行分析,以对各参与终端进行信誉评分,从而根据各参与终端的信誉评分,对各参与终端进行奖惩管理。以针对联邦学习依赖中心服务器,可能会出现故障或恶意行为等问题,将各参与终端的模型训练后参数都上传到区块链,通过信誉度评分共识机制根据投票分数结果,对不同贡献度的参与终端进行奖励或者惩罚,可以充分调动了各参与终端的积极性,也能减少存在恶意行为或自私行为的各参与终端存在。The computer device provided in this embodiment trains the respective local databases of multiple participating terminals through a preset federated model, so as to obtain a model parameter corresponding to each participating terminal, so that the preset joint model can be performed through each model parameter. Training, and record the contribution data of each model participating in the joint model during the training process, and finally analyze the contribution data of multiple participating terminals through the preset reputation scoring consensus mechanism model, so as to perform reputation scoring on each participating terminal, Therefore, according to the reputation score of each participating terminal, reward and punishment management is performed on each participating terminal. In order to solve problems such as federated learning relying on the central server, there may be failures or malicious behaviors, the model training parameters of each participating terminal are uploaded to the blockchain, and the credibility score consensus mechanism is used according to the results of voting scores. Rewarding or punishing participating terminals can fully mobilize the enthusiasm of participating terminals, and can also reduce the existence of participating terminals that have malicious or selfish behaviors.
本申请可用于众多通用或专用的计算机系统环境或配置中。例如:个人计算机、服务器计算机、手持设备或便携式设备、平板型设备、多处理器系统、基于微处理器的系统、置顶盒、可编程的消费电子设备、网络PC、小型计算机、大型计算机、包括以上任何系统或设备的分布式计算环境等等。本申请可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本申请,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中The application can be used in numerous general purpose or special purpose computer system environments or configurations. Examples: personal computers, server computers, handheld or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, including A distributed computing environment for any of the above systems or devices, etc. This application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including storage devices
本申请还提供一种存储有计算机可读指令的存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行上述任一实施例联邦学习管理方法的步骤。The present application also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the federated learning management method in any of the above embodiments.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,该计算机程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,前述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性存储介质,或随机存储记忆体(Random Access Memory,RAM)等。Those of ordinary skill in the art can understand that realizing all or part of the processes in the methods of the above embodiments can be completed by instructing related hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. During execution, it may include the processes of the embodiments of the above-mentioned methods. Wherein, the aforementioned storage medium may be a nonvolatile storage medium such as a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM).
本申请还提供一种存储有计算机可读指令的存储介质,所述计算机可读指令的存储介质可以是非易失性,也可以是易失性,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行上述任一实施例联邦学习管理方法的步骤。The present application also provides a storage medium storing computer-readable instructions, the storage medium of the computer-readable instructions may be non-volatile or volatile, and the computer-readable instructions are executed by one or more processors When, one or more processors are made to execute the steps of the federated learning management method in any of the above embodiments.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,该计算机程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,前述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性存储介质,或随机存储记忆体(Random Access Memory,RAM)等。Those of ordinary skill in the art can understand that realizing all or part of the processes in the methods of the above embodiments can be completed by instructing related hardware through a computer program, the computer program can be stored in a computer-readable storage medium, and the program is executed , may include the flow of the embodiments of the above-mentioned methods. Wherein, the aforementioned storage medium may be a nonvolatile storage medium such as a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM).
本技术领域技术人员可以理解,本申请中已经讨论过的各种操作、方法、流程中的步骤、措施、方案可以被交替、更改、组合或删除。进一步地,具有本申请中已经讨论过的各种操作、方法、流程中的其他步骤、措施、方案也可以被交替、更改、重排、分解、组合或删除。进一步地,现有技术中的具有与本申请中公开的各种操作、方法、流程中的步骤、措施、方案也可以被交替、更改、重排、分解、组合或删除。Those skilled in the art can understand that the various operations, methods, and steps, measures, and schemes in the processes that have been discussed in this application can be replaced, changed, combined, or deleted. Furthermore, the various operations, methods, and other steps, measures, and schemes in the processes that have been discussed in this application may also be replaced, changed, rearranged, decomposed, combined, or deleted. Further, steps, measures, and schemes in the prior art that have operations, methods, and processes disclosed in the present application may also be alternated, changed, rearranged, decomposed, combined, or deleted.
以上所述仅是本申请的部分实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。The above descriptions are only some implementations of the present application. It should be pointed out that for those of ordinary skill in the art, some improvements and modifications can be made without departing from the principle of the application. These improvements and modifications are also It should be regarded as the protection scope of this application.

Claims (20)

  1. 一种联邦学习管理方法,其中,包括:A method for federated learning management, comprising:
    多个参与终端通过预设的联邦模型对各自本地的数据库进行训练,得到每个参与终端对应的一个模型参数;Multiple participating terminals train their respective local databases through the preset federated model, and obtain a model parameter corresponding to each participating terminal;
    通过各模型参数对预设的联合模型进行训练,并记录所述各模型参对所述联合模型的贡献数据;Train the preset joint model through each model parameter, and record the contribution data of each model participant to the joint model;
    基于所述贡献数据和预设的信誉度评分共识机制模型,对各参与终端进行信誉评分;Perform reputation scoring on each participating terminal based on the contribution data and the preset reputation scoring consensus mechanism model;
    根据所述各参与终端的信誉评分,对所述各参与终端进行奖惩管理。According to the reputation score of each participating terminal, reward and punishment management is performed on each participating terminal.
  2. 根据权利要求1所述的方法,其中,所述多个参与终端通过预设的联邦模型对各自本地的数据库进行训练,得到每个参与终端对应的一个模型参数,包括:The method according to claim 1, wherein the plurality of participating terminals train their respective local databases through a preset federated model to obtain a model parameter corresponding to each participating terminal, including:
    所述多个参与终端中的每个参与终端分别利用所述预设的联邦模型对本地的数据库进行训练,得到每个参与终端对应的模型参数和权重值;Each of the plurality of participating terminals uses the preset federated model to train a local database to obtain model parameters and weight values corresponding to each participating terminal;
    所述多个参与终端中的每个参与终端分别将对应的模型参数和权重值上传至区块链。Each of the plurality of participating terminals uploads corresponding model parameters and weight values to the block chain.
  3. 根据权利要求1所述的方法,其中,通过各模型参数对预设的联合模型进行训练,并记录所述各模型参对所述联合模型的贡献数据,包括:The method according to claim 1, wherein the preset joint model is trained through each model parameter, and the contribution data of each model participating in the joint model is recorded, including:
    将所述多个参与终端的模型参数进行拼接,生成联邦参数;splicing the model parameters of the multiple participating terminals to generate federated parameters;
    根据所述联邦参数对所述联合模型的参数进行初始化,并根据预设的训练样本对所述初始化后的联合模型进行训练,生成特征向量;Initializing parameters of the joint model according to the federation parameters, and training the initialized joint model according to preset training samples to generate feature vectors;
    基于所述特征向量与预设的标注向量,计算所述联合模型特征差值;calculating the feature difference of the joint model based on the feature vector and a preset label vector;
    根据所述特征差值计算所述各模型参数偏差值,并根据所述偏差值生成所述贡献数据。Calculate the deviation value of each model parameter according to the characteristic difference value, and generate the contribution data according to the deviation value.
  4. 根据权利要求1所述的方法,其中,所述贡献数据包括:所述各参与终端的用户行为、对所述联合模型的贡献度和共识投票结果;The method according to claim 1, wherein the contribution data includes: user behavior of each participating terminal, contribution to the joint model, and consensus voting results;
    所述基于所述贡献数据和预设的信誉度评分共识机制模型,对各参与终端进行信誉评分,包括:Based on the contribution data and the preset reputation scoring consensus mechanism model, performing reputation scoring on each participating terminal includes:
    将所述各参与终端的用户行为、对所述联合模型的贡献度和共识投票结果输入至所述信誉度评分共识机制模型中;Input the user behavior of each participating terminal, the contribution to the joint model and the consensus voting result into the reputation scoring consensus mechanism model;
    读取所述信誉度评分共识机制模型输出的所述各参与终端的信誉评分。Reading the reputation scores of the participating terminals output by the reputation scoring consensus mechanism model.
  5. 根据权利要求4所述的方法,其中,所述基于所述贡献数据和预设的信誉度评分共识机制模型,对各参与终端进行信誉评分之前,包括:The method according to claim 4, wherein, before performing reputation scoring on each participating terminal based on the contribution data and the preset reputation scoring consensus mechanism model, it includes:
    获取全局模型的全局参数,其中,所述全局模型为所述联合模型训练至收敛状态时的模型形态;Acquiring global parameters of the global model, wherein the global model is the model form when the joint model is trained to a converged state;
    将所述全局参数分发至所述各参与终端,以使所述各参与终端的联邦模型生成全局参数。Distributing the global parameters to the participating terminals, so that the federated models of the participating terminals generate global parameters.
  6. 根据权利要求1所述的方法,其中,所述根据所述各参与终端的信誉评分,对所述各参与终端进行奖惩管理,包括:The method according to claim 1, wherein said performing reward and punishment management on said participating terminals according to the reputation scores of said participating terminals includes:
    将所述各参与终端的信誉评分与预设的评分阈值进行比对;Comparing the reputation scores of each participating terminal with a preset scoring threshold;
    当任一参与终端的信誉评分小于所述评分阈值时,则禁止所述参与终端参与下一轮的联合训练。When the reputation score of any participating terminal is less than the scoring threshold, the participating terminal is prohibited from participating in the next round of joint training.
  7. 根据权利要求1所述的方法,其中,所述根据所述各参与终端的信誉评分,对所述各参与终端进行奖惩管理之后,包括:The method according to claim 1, wherein, after performing reward and punishment management on each participating terminal according to the reputation score of each participating terminal, comprising:
    依次读取所述各参与终端的投票结果;Read the voting results of each participating terminal in turn;
    当任一参与终端放弃投票时,则降低所述参与终端的信誉评分。When any participating terminal abstains from voting, the reputation score of the participating terminal is reduced.
  8. 一种联邦学习管理装置,其中,包括:A federated learning management device, including:
    训练模块,用于多个参与终端通过预设的联邦模型对各自本地的数据库进行训练,得到每个参与终端对应的一个模型参数;The training module is used for multiple participating terminals to train their respective local databases through a preset federated model to obtain a model parameter corresponding to each participating terminal;
    所述训练模块,还用于通过各模型参数对预设的联合模型进行训练,并记录所述各模型参对所述联合模型的贡献数据;The training module is also used to train the preset joint model through each model parameter, and record the contribution data of each model participating in the joint model;
    评分模块,用于基于所述贡献数据和预设的信誉度评分共识机制模型,对各参与终端进行信誉评分;A scoring module, configured to perform reputation scoring on each participating terminal based on the contribution data and the preset reputation scoring consensus mechanism model;
    管理模块,用于根据所述各参与终端的信誉评分,对所述各参与终端进行奖惩管理。A management module, configured to perform reward and punishment management on each participating terminal according to the reputation score of each participating terminal.
  9. 一种计算机设备,其中,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行所述联邦学习管理方法:A computer device, including a memory and a processor, wherein computer-readable instructions are stored in the memory, and when the computer-readable instructions are executed by the processor, the processor executes the federated learning management method :
    多个参与终端通过预设的联邦模型对各自本地的数据库进行训练,得到每个参与终端对应的一个模型参数;Multiple participating terminals train their respective local databases through the preset federated model, and obtain a model parameter corresponding to each participating terminal;
    通过各模型参数对预设的联合模型进行训练,并记录所述各模型参对所述联合模型的贡献数据;Train the preset joint model through each model parameter, and record the contribution data of each model participant to the joint model;
    基于所述贡献数据和预设的信誉度评分共识机制模型,对各参与终端进行信誉评分;Perform reputation scoring on each participating terminal based on the contribution data and the preset reputation scoring consensus mechanism model;
    根据所述各参与终端的信誉评分,对所述各参与终端进行奖惩管理。According to the reputation score of each participating terminal, reward and punishment management is performed on each participating terminal.
  10. 根据权利要求9所述的计算机设备,其中,所述联邦学习管理方法还包括:The computer device according to claim 9, wherein the federated learning management method further comprises:
    所述多个参与终端中的每个参与终端分别利用所述预设的联邦模型对本地的数据库进行训练,得到每个参与终端对应的模型参数和权重值;Each of the plurality of participating terminals uses the preset federated model to train a local database to obtain model parameters and weight values corresponding to each participating terminal;
    所述多个参与终端中的每个参与终端分别将对应的模型参数和权重值上传至区块链。Each of the plurality of participating terminals uploads corresponding model parameters and weight values to the block chain.
  11. 根据权利要求9所述的计算机设备,其中,所述联邦学习管理方法还包括:The computer device according to claim 9, wherein the federated learning management method further comprises:
    将所述多个参与终端的模型参数进行拼接,生成联邦参数;splicing the model parameters of the multiple participating terminals to generate federated parameters;
    根据所述联邦参数对所述联合模型的参数进行初始化,并根据预设的训练样本对所述初始化后的联合模型进行训练,生成特征向量;Initializing parameters of the joint model according to the federation parameters, and training the initialized joint model according to preset training samples to generate feature vectors;
    基于所述特征向量与预设的标注向量,计算所述联合模型特征差值;calculating the feature difference of the joint model based on the feature vector and a preset label vector;
    根据所述特征差值计算所述各模型参数偏差值,并根据所述偏差值生成所述贡献数据。Calculate the deviation value of each model parameter according to the characteristic difference value, and generate the contribution data according to the deviation value.
  12. 根据权利要求9所述的计算机设备,其中,所述贡献数据包括:所述各参与终端的用户行为、对所述联合模型的贡献度和共识投票结果;所述联邦学习管理方法还包括:The computer device according to claim 9, wherein the contribution data includes: user behavior of each participating terminal, contribution to the joint model, and consensus voting results; the federated learning management method further includes:
    将所述各参与终端的用户行为、对所述联合模型的贡献度和共识投票结果输入至所述信誉度评分共识机制模型中;Input the user behavior of each participating terminal, the contribution to the joint model and the consensus voting result into the reputation scoring consensus mechanism model;
    读取所述信誉度评分共识机制模型输出的所述各参与终端的信誉评分。Reading the reputation scores of the participating terminals output by the reputation scoring consensus mechanism model.
  13. 根据权利要求12所述的计算机设备,其中,所述联邦学习管理方法还包括:The computer device according to claim 12, wherein the federated learning management method further comprises:
    获取全局模型的全局参数,其中,所述全局模型为所述联合模型训练至收敛状态时的模型形态;Acquiring global parameters of the global model, wherein the global model is the model form when the joint model is trained to a converged state;
    将所述全局参数分发至所述各参与终端,以使所述各参与终端的联邦模型生成全局参数。Distributing the global parameters to the participating terminals, so that the federated models of the participating terminals generate global parameters.
  14. 根据权利要求9所述的计算机设备,其中,所述联邦学习管理方法还包括:The computer device according to claim 9, wherein the federated learning management method further comprises:
    将所述各参与终端的信誉评分与预设的评分阈值进行比对;Comparing the reputation scores of each participating terminal with a preset scoring threshold;
    当任一参与终端的信誉评分小于所述评分阈值时,则禁止所述参与终端参与下一轮的联合训练。When the reputation score of any participating terminal is less than the scoring threshold, the participating terminal is prohibited from participating in the next round of joint training.
  15. 根据权利要求9所述的计算机设备,其中,所述联邦学习管理方法还包括:The computer device according to claim 9, wherein the federated learning management method further comprises:
    依次读取所述各参与终端的投票结果;Read the voting results of each participating terminal in sequence;
    当任一参与终端放弃投票时,则降低所述参与终端的信誉评分。When any participating terminal abstains from voting, the reputation score of the participating terminal is reduced.
  16. 一种存储有计算机可读指令的存储介质,其中,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行所述联邦学习管理方法:A storage medium storing computer-readable instructions, wherein, when the computer-readable instructions are executed by one or more processors, one or more processors execute the federated learning management method:
    多个参与终端通过预设的联邦模型对各自本地的数据库进行训练,得到每个参与终端对应的一个模型参数;Multiple participating terminals train their respective local databases through the preset federated model, and obtain a model parameter corresponding to each participating terminal;
    通过各模型参数对预设的联合模型进行训练,并记录所述各模型参对所述联合模型的贡献数据;Train the preset joint model through each model parameter, and record the contribution data of each model participant to the joint model;
    基于所述贡献数据和预设的信誉度评分共识机制模型,对各参与终端进行信誉评分;Perform reputation scoring on each participating terminal based on the contribution data and the preset reputation scoring consensus mechanism model;
    根据所述各参与终端的信誉评分,对所述各参与终端进行奖惩管理。According to the reputation score of each participating terminal, reward and punishment management is performed on each participating terminal.
  17. 根据权利要求16所述的存储介质,其中,所述联邦学习管理方法还包括:The storage medium according to claim 16, wherein the federated learning management method further comprises:
    所述多个参与终端中的每个参与终端分别利用所述预设的联邦模型对本地的数据库进行 训练,得到每个参与终端对应的模型参数和权重值;Each participating terminal in the plurality of participating terminals uses the preset federated model to train the local database respectively, and obtains model parameters and weight values corresponding to each participating terminal;
    所述多个参与终端中的每个参与终端分别将对应的模型参数和权重值上传至区块链。Each of the plurality of participating terminals uploads corresponding model parameters and weight values to the block chain.
  18. 根据权利要求16所述的存储介质,其中,所述联邦学习管理方法还包括:The storage medium according to claim 16, wherein the federated learning management method further comprises:
    将所述多个参与终端的模型参数进行拼接,生成联邦参数;splicing the model parameters of the multiple participating terminals to generate federated parameters;
    根据所述联邦参数对所述联合模型的参数进行初始化,并根据预设的训练样本对所述初始化后的联合模型进行训练,生成特征向量;Initializing parameters of the joint model according to the federation parameters, and training the initialized joint model according to preset training samples to generate feature vectors;
    基于所述特征向量与预设的标注向量,计算所述联合模型特征差值;calculating the feature difference of the joint model based on the feature vector and a preset label vector;
    根据所述特征差值计算所述各模型参数偏差值,并根据所述偏差值生成所述贡献数据。Calculate the deviation value of each model parameter according to the characteristic difference value, and generate the contribution data according to the deviation value.
  19. 根据权利要求16所述的存储介质,其中,所述贡献数据包括:所述各参与终端的用户行为、对所述联合模型的贡献度和共识投票结果;所述联邦学习管理方法还包括:The storage medium according to claim 16, wherein the contribution data includes: user behavior of each participating terminal, contribution to the joint model, and consensus voting results; the federated learning management method further includes:
    将所述各参与终端的用户行为、对所述联合模型的贡献度和共识投票结果输入至所述信誉度评分共识机制模型中;Input the user behavior of each participating terminal, the contribution to the joint model and the consensus voting result into the reputation scoring consensus mechanism model;
    读取所述信誉度评分共识机制模型输出的所述各参与终端的信誉评分。Reading the reputation scores of the participating terminals output by the reputation scoring consensus mechanism model.
  20. 根据权利要求19所述的存储介质,其中,所述联邦学习管理方法还包括:The storage medium according to claim 19, wherein the federated learning management method further comprises:
    获取全局模型的全局参数,其中,所述全局模型为所述联合模型训练至收敛状态时的模型形态;Acquiring global parameters of the global model, wherein the global model is the model form when the joint model is trained to a converged state;
    将所述全局参数分发至所述各参与终端,以使所述各参与终端的联邦模型生成全局参数。Distributing the global parameters to the participating terminals, so that the federated models of the participating terminals generate global parameters.
PCT/CN2022/089694 2021-10-26 2022-04-27 Federated learning management method and apparatus, and computer device and storage medium WO2023071106A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111249348.0 2021-10-26
CN202111249348.0A CN113947215A (en) 2021-10-26 2021-10-26 Federal learning management method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2023071106A1 true WO2023071106A1 (en) 2023-05-04

Family

ID=79332418

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/089694 WO2023071106A1 (en) 2021-10-26 2022-04-27 Federated learning management method and apparatus, and computer device and storage medium

Country Status (2)

Country Link
CN (1) CN113947215A (en)
WO (1) WO2023071106A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116341684A (en) * 2023-05-26 2023-06-27 蓝象智联(杭州)科技有限公司 Regular penalty applying method, device and storage medium for improving model generalization performance
CN116709341A (en) * 2023-07-31 2023-09-05 中国人民解放军军事科学院系统工程研究院 Practical Bayesian-busy fault-tolerant consensus algorithm optimization method and system for unmanned bee colony
CN116738196A (en) * 2023-06-19 2023-09-12 上海零数众合信息科技有限公司 Reputation evaluation method, device, equipment and storage medium
CN116862021A (en) * 2023-07-31 2023-10-10 山东省计算中心(国家超级计算济南中心) anti-Bayesian-busy attack decentralization learning method and system based on reputation evaluation
CN117472866A (en) * 2023-12-27 2024-01-30 齐鲁工业大学(山东省科学院) Federal learning data sharing method under block chain supervision and excitation

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113947215A (en) * 2021-10-26 2022-01-18 平安科技(深圳)有限公司 Federal learning management method and device, computer equipment and storage medium
CN114297722B (en) * 2022-03-09 2022-07-05 广东工业大学 Privacy protection asynchronous federal sharing method and system based on block chain
US11693965B1 (en) * 2022-06-17 2023-07-04 Uab 360 It Malware detection using federated learning
CN115599799B (en) * 2022-11-30 2023-03-10 中南大学 Block chain and federal learning fusion method for medical big data
CN117787817B (en) * 2024-02-28 2024-05-07 西安航科创星电子科技有限公司 Ceramic chip inductance capacitor production and tracing method based on conductive copper paste

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111966698A (en) * 2020-07-03 2020-11-20 华南师范大学 Credible federal learning method, system, device and medium based on block chain
CN112446791A (en) * 2020-12-01 2021-03-05 平安科技(深圳)有限公司 Automobile insurance grading method, device, equipment and storage medium based on federal learning
CN113052334A (en) * 2021-04-14 2021-06-29 中南大学 Method and system for realizing federated learning, terminal equipment and readable storage medium
US20210312334A1 (en) * 2019-03-01 2021-10-07 Webank Co., Ltd Model parameter training method, apparatus, and device based on federation learning, and medium
CN113947215A (en) * 2021-10-26 2022-01-18 平安科技(深圳)有限公司 Federal learning management method and device, computer equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210312334A1 (en) * 2019-03-01 2021-10-07 Webank Co., Ltd Model parameter training method, apparatus, and device based on federation learning, and medium
CN111966698A (en) * 2020-07-03 2020-11-20 华南师范大学 Credible federal learning method, system, device and medium based on block chain
CN112446791A (en) * 2020-12-01 2021-03-05 平安科技(深圳)有限公司 Automobile insurance grading method, device, equipment and storage medium based on federal learning
CN113052334A (en) * 2021-04-14 2021-06-29 中南大学 Method and system for realizing federated learning, terminal equipment and readable storage medium
CN113947215A (en) * 2021-10-26 2022-01-18 平安科技(深圳)有限公司 Federal learning management method and device, computer equipment and storage medium

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116341684A (en) * 2023-05-26 2023-06-27 蓝象智联(杭州)科技有限公司 Regular penalty applying method, device and storage medium for improving model generalization performance
CN116738196A (en) * 2023-06-19 2023-09-12 上海零数众合信息科技有限公司 Reputation evaluation method, device, equipment and storage medium
CN116709341A (en) * 2023-07-31 2023-09-05 中国人民解放军军事科学院系统工程研究院 Practical Bayesian-busy fault-tolerant consensus algorithm optimization method and system for unmanned bee colony
CN116862021A (en) * 2023-07-31 2023-10-10 山东省计算中心(国家超级计算济南中心) anti-Bayesian-busy attack decentralization learning method and system based on reputation evaluation
CN116709341B (en) * 2023-07-31 2024-04-30 中国人民解放军军事科学院系统工程研究院 Practical Bayesian-busy fault-tolerant consensus algorithm optimization method and system for unmanned bee colony
CN116862021B (en) * 2023-07-31 2024-05-03 山东省计算中心(国家超级计算济南中心) Anti-Bayesian-busy attack decentralization learning method and system based on reputation evaluation
CN117472866A (en) * 2023-12-27 2024-01-30 齐鲁工业大学(山东省科学院) Federal learning data sharing method under block chain supervision and excitation
CN117472866B (en) * 2023-12-27 2024-03-19 齐鲁工业大学(山东省科学院) Federal learning data sharing method under block chain supervision and excitation

Also Published As

Publication number Publication date
CN113947215A (en) 2022-01-18

Similar Documents

Publication Publication Date Title
WO2023071106A1 (en) Federated learning management method and apparatus, and computer device and storage medium
Zhao et al. Privacy-preserving collaborative deep learning with unreliable participants
Yao et al. Federated learning with unbiased gradient aggregation and controllable meta updating
CN111612168B (en) Management method and related device for machine learning task
Del Valle et al. Summary results of the 2014-2015 DARPA Chikungunya challenge
KR101300517B1 (en) Optimum Tender Price prediction method and system
Xu et al. BESIFL: Blockchain-empowered secure and incentive federated learning paradigm in IoT
Gao et al. FGFL: A blockchain-based fair incentive governor for Federated Learning
Yang et al. Using reputation management in participatory sensing for data classification
CN111860865B (en) Model construction and analysis method, device, electronic equipment and medium
US10186164B2 (en) Systems and methods for determining mission readiness
US20210209682A1 (en) Artificial Intelligence (AI) Enabled Blockchain Based Trading Partner Onboarding Optimization
Zhang et al. TDTA: A truth detection based task assignment scheme for mobile crowdsourced Industrial Internet of Things
Miao et al. An intelligent and privacy-enhanced data sharing strategy for blockchain-empowered Internet of Things
CN113626866A (en) Localized differential privacy protection method and system for federal learning, computer equipment and storage medium
Chen et al. A blockchain-based creditable and distributed incentive mechanism for participant mobile crowdsensing in edge computing
EP2950258A1 (en) Survey data processing
CN112488163A (en) Abnormal account identification method and device, computer equipment and storage medium
US20230351153A1 (en) Knowledge graph reasoning model, system, and reasoning method based on bayesian few-shot learning
JP2020149656A (en) System having combined learning model for medical research applications, and method
Firdaus et al. A Blockchain-Assisted Distributed Edge Intelligence for Privacy-Preserving Vehicular Networks.
US20210250401A1 (en) System and method of certification for incremental training of machine learning models at edge devices in a peer to peer network
Yu et al. idml: Incentivized decentralized machine learning
CN112035567B (en) Data processing method, device and computer readable storage medium
US20220262499A1 (en) Professional network-based identification of influential thought leaders and measurement of their influence via deep learning

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22885020

Country of ref document: EP

Kind code of ref document: A1