WO2021114618A1 - Federated learning method and apparatus, computer device, and readable storage medium - Google Patents

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

Info

Publication number
WO2021114618A1
WO2021114618A1 PCT/CN2020/098890 CN2020098890W WO2021114618A1 WO 2021114618 A1 WO2021114618 A1 WO 2021114618A1 CN 2020098890 W CN2020098890 W CN 2020098890W WO 2021114618 A1 WO2021114618 A1 WO 2021114618A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
sample data
vector
federated learning
learning model
Prior art date
Application number
PCT/CN2020/098890
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 WO2021114618A1 publication Critical patent/WO2021114618A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • 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
    • G06N3/084Backpropagation, e.g. using gradient descent
    • 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

  • This application relates to the field of artificial intelligence technology, in particular to a federated learning method, device, computer equipment, and computer-readable storage medium.
  • the first aspect of this application provides a federated learning method, and the federated learning method includes:
  • the feature vector and the identification code are transmitted to the data requesting terminal, so that the data requesting terminal searches for the label of the sample data according to the identification code, and performs federated learning model training according to the feature vector and the label.
  • a second aspect of the present application provides a federated learning device, the federated learning device includes:
  • An obtaining module used to obtain sample data and an identification code of the sample data
  • a conversion module configured to convert the sample data into a vector to obtain a vector representation of the sample data
  • An encoding module configured to encode the vector representation to obtain the feature vector of the sample data
  • the transmission module is configured to transmit the feature vector and the identification code to the data requesting terminal, so that the data requesting terminal searches for the label of the sample data according to the identification code, and performs processing according to the feature vector and the label Federation learning model training.
  • a third aspect of the present application provides a computer device that includes a processor, and the processor is configured to execute computer-readable instructions stored in a memory to implement the following steps:
  • the feature vector and the identification code are transmitted to the data requesting terminal, so that the data requesting terminal searches for the label of the sample data according to the identification code, and performs federated learning model training according to the feature vector and the label.
  • a fourth aspect of the present application provides a computer-readable storage medium having computer-readable instructions stored on the computer-readable storage medium, and when the computer-readable instructions are executed by a processor, the following steps are implemented:
  • the feature vector and the identification code are transmitted to the data requesting terminal, so that the data requesting terminal searches for the label of the sample data according to the identification code, and performs federated learning model training according to the feature vector and the label.
  • This application uses the coding model to perform feature learning and feature integration on the vector representation. Without a decoder, the data requesting end cannot interpret and obtain the sample data corresponding to the vector representation, which ensures the security of the data. The data requesting end does not directly obtain the data of the data providing end, which improves the security of the data in the federated learning process.
  • Fig. 1 is a flowchart of a federated learning method provided by an embodiment of the application.
  • Figure 2 is a structural diagram of a federated learning device provided by an embodiment of the present application.
  • Fig. 3 is a schematic diagram of a computer device provided by an embodiment of the present application.
  • the federated learning method of this application is applied to one or more computer devices.
  • the computer device is a device that can automatically perform numerical calculation and/or information processing in accordance with pre-set or stored instructions.
  • Its hardware includes, but is not limited to, a microprocessor and an application specific integrated circuit (ASIC) , Programmable Gate Array (Field-Programmable Gate Array, FPGA), Digital Processor (Digital Signal Processor, DSP), embedded equipment, etc.
  • ASIC application specific integrated circuit
  • FPGA Field-Programmable Gate Array
  • DSP Digital Processor
  • embedded equipment etc.
  • This application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, small computers, large computers, including Distributed computing environment for any of the above systems or equipment, etc.
  • This application may be described in the general context of computer-executable instructions executed by a computer, such as a program module.
  • program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.
  • This application can also be practiced in distributed computing environments. In these distributed computing environments, tasks are performed by remote processing devices connected through a communication network.
  • program modules can be located in local and remote computer storage media including storage devices.
  • the computer device may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the computer device can interact with the user through a keyboard, a mouse, a remote control, a touch panel, or a voice control device.
  • Fig. 1 is a flow chart of the federated learning method provided in Embodiment 1 of the present application.
  • the federated learning method is applied to a data provider, and the data provider is a computer device for generating a federated learning model through federated learning.
  • the federated learning method specifically includes the following steps. According to different needs, the order of the steps in the flowchart can be changed, and some can be omitted.
  • the identification code is the unique identification information of the sample data, and is used to identify the sample data between the data provider and the third party requesting the data.
  • the sample data may include different data types such as text data, one-hot data, numerical data, and embedding data.
  • the data provider may be a financial company
  • the third party requesting the data may be an insurance company
  • the sample data may be user behavior data of the financial company
  • the data type of the sample data may be text data.
  • the identification code may be the user's mobile phone number or ID number corresponding to the user behavior data.
  • the insurance company needs to obtain the coded user behavior data of the financial company, and use the insurance reliability scoring model to score the reliability of the user based on the obtained coded user behavior data. That is, insurance companies do not need to directly obtain user behavior data of financial companies, which protects the data security of financial companies.
  • the insurance reliability scoring model can be a specific federated learning model, and the local federated learning model of an insurance company can be a deep learning model.
  • the data provider may be an e-commerce company
  • the third party requesting the data may be an advertising company
  • the sample data may be product click behavior data of the e-commerce company
  • the data type of the sample data may be numeric data .
  • the identification code may be the user's mobile phone number or ID number corresponding to the commodity click behavior data.
  • the advertising company needs to obtain the coded product click behavior data of the e-commerce company, and recommend products to users according to the obtained coded product click behavior data through the product recommendation model. That is, the advertising company does not need to directly obtain the product click behavior data of the e-commerce company, which protects the data security of the e-commerce company.
  • the product recommendation model can be a specific federated learning model, and the local federated learning model of the advertising company can be a deep learning model.
  • the converting the sample data into a vector includes:
  • the sample data is converted into a vector according to a preset conversion method corresponding to the data type of the sample data.
  • the sample data is converted into a vector according to the word2vec method.
  • the data type of the sample data is numeric data (the preset conversion method corresponding to the numeric data is a standardization method)
  • the sample data is converted into a vector according to the standardization method.
  • the judging whether the sample data needs to be converted into a vector according to the data type of the sample data includes:
  • the sample data needs to be converted into a vector
  • the sample data does not need to be converted into a vector.
  • the data to be converted is a vector, and no conversion is required.
  • the encoding the vector representation includes:
  • the encoding model consisting of an encoder and a decoder
  • the vector representation is encoded with the trained encoder.
  • the data provider In order to ensure the security of the sample data, the data provider cannot directly request the sample data from a third party.
  • the trained encoding model is optimized through the Deep auto-encoder (deep encoding) or sparse auto-encoder (sparse encoding) method.
  • the trained coding model may be optimized by a sparse coding method according to the difference between the output of the trained coding model and the input.
  • the sparse coding method mainly optimizes the trained coding model by adding sparsity restriction conditions to the neural units in the trained coding model.
  • the sparsity restriction condition may include, when the output value of the neuron is close to 1 (for example, greater than 0.9), the neuron is activated; when the output value of the neuron is close to 0 (for example, less than or equal to 0.9), the neuron is not activated.
  • the coding model is used to perform feature learning and feature integration on the vector representation. Without a decoder, the data requesting end cannot interpret and obtain the sample data corresponding to the vector representation, which ensures the security of the data.
  • the federated learning model includes: LR, XGB, DNN, etc. LR, XGB, DNN and other models are used for machine learning training and algorithm models for business use purposes.
  • the federated learning model may be a specific artificial intelligence model, such as an artificial intelligence classification model, an artificial intelligence recognition model, and the like.
  • the transmitting the feature vector and the identification code to the data requesting terminal includes:
  • the feature vector and the identification code are transmitted to the data requesting end through an encryption algorithm.
  • the feature vector and the identification code are encrypted by the private key of the data provider; the encrypted feature vector and the identification code are transmitted to the data requesting terminal, so that the data requesting terminal passes through the data provider's
  • the public key decrypts the encrypted feature vector and identification code.
  • the labels of the sample data are "risk user” and "normal user”.
  • the labels of the sample data are "recommended product one”, “recommended product two”, and so on.
  • the training of the federated learning model according to the feature vector and the label includes:
  • the data requesting terminal obtains the initial parameters of the federated learning model from a preset server;
  • the data requesting terminal initializes the federated learning model with the initial parameters
  • the data requesting terminal locally trains the initialized federated learning model according to the feature vector and the label, updates the parameters of the initialized federated learning model, and obtains the updated parameters;
  • the data requesting end uploads the updated parameters to the preset server, so that the preset server performs aggregation processing on the parameters uploaded by each requesting end to obtain aggregation parameters, and when it is detected that the aggregation is used
  • the preset server performs aggregation processing on the parameters uploaded by each requesting end to obtain aggregation parameters, and when it is detected that the aggregation is used
  • deliver the updated federated learning model to the data requester
  • the data requesting terminal receives the federated learning model issued by the preset server.
  • the preset server before sending the updated federated learning model to the data requester, when the preset server detects that the federated learning model updated with the aggregation parameters is in a non-convergent state When the time, the preset server returns the aggregation parameter to the data requesting terminal, so that the data requesting terminal continues iterative training.
  • the federated learning method of the first embodiment generates a federated learning model through federated learning.
  • the coding model is used to perform feature learning and feature integration on the vector representation, and the data requester cannot interpret and obtain sample data corresponding to the vector representation without a decoder, which ensures the security of the data To prevent data leakage.
  • the coding model does not need to add noise to the vector representation, and avoids the generation of additional interference information due to the addition of noise.
  • the establishment of the federation model has direct feedback on the coding results, which is beneficial to optimization and adjustment.
  • the coding model can adjust the information loss degree and the information security degree of the feature learning and feature integration of the vector representation, find the compromise point of information security and information loss, and obtain more optimized parameters of the entire federated learning model.
  • the data requesting end does not directly obtain the data of the data providing end, which improves the security of the data in the federated learning process.
  • the federated learning method further includes:
  • Hyperparameters include network structure, number of neural layers, number of neurons in each layer, activation function, learning rate, regularization and penalty coefficients, loss function, and so on. Specifically, when the loss function floats and does not converge, the loss function, learning rate, and/or network structure can be adjusted. When the gradient disappears or the gradient explodes, adjust the activation function.
  • the federated learning method further includes:
  • the updated local federated learning model is used to process the to-be-processed data.
  • the federated learning method further includes:
  • the parameters and/or hyperparameters of the coding model and/or the federated learning model are adjusted according to the processing result of the to-be-processed data and the preset result of the to-be-processed data.
  • the coding model can be determined whether the coding model over-encodes data according to the processing result of the data to be processed and the preset result of the data to be processed.
  • Over-encoding data may cause the encoding model to lose its ability to extract effective features;
  • the judgment result adjusts the coding model to improve the feature extraction capability of the coding model and balance the feature extraction capability with the data security achieved through coding.
  • Fig. 2 is a structural diagram of a federated learning device provided in the second embodiment of the present application.
  • the federated learning device 20 is applied to a data provider, and the data provider is a computer device.
  • the federated learning device 20 is used to generate federated learning models through federated learning.
  • the federated learning device 20 may include an acquisition module 201, a conversion module 202, an encoding module 203, and a transmission module 204.
  • the obtaining module 201 is used to obtain sample data and an identification code of the sample data.
  • the identification code is the unique identification information of the sample data, and is used to identify the sample data between the data provider and the third party requesting the data.
  • the sample data may include different data types such as text data, one-hot data, numerical data, and embedding data.
  • the data provider may be a financial company
  • the third party requesting the data may be an insurance company
  • the sample data may be user behavior data of the financial company
  • the data type of the sample data may be text data.
  • the identification code may be the user's mobile phone number or ID number corresponding to the user behavior data.
  • the insurance company needs to obtain the coded user behavior data of the financial company, and use the insurance reliability scoring model to score the reliability of the user based on the obtained coded user behavior data. That is, insurance companies do not need to directly obtain user behavior data of financial companies, which protects the data security of financial companies.
  • the insurance reliability scoring model can be a specific federated learning model, and the local federated learning model of an insurance company can be a deep learning model.
  • the data provider may be an e-commerce company
  • the third party requesting the data may be an advertising company
  • the sample data may be product click behavior data of the e-commerce company
  • the data type of the sample data may be numeric data .
  • the identification code may be the user's mobile phone number or ID number corresponding to the commodity click behavior data.
  • the advertising company needs to obtain the coded product click behavior data of the e-commerce company, and recommend products to users according to the obtained coded product click behavior data through the product recommendation model. That is, the advertising company does not need to directly obtain the product click behavior data of the e-commerce company, which protects the data security of the e-commerce company.
  • the product recommendation model can be a specific federated learning model, and the local federated learning model of the advertising company can be a deep learning model.
  • the conversion module 202 is configured to convert the sample data into a vector to obtain a vector representation of the sample data.
  • the converting the sample data into a vector includes:
  • the sample data is converted into a vector according to a preset conversion method corresponding to the data type of the sample data.
  • the sample data is converted into a vector according to the word2vec method.
  • the data type of the sample data is numeric data (the preset conversion method corresponding to the numeric data is a standardization method)
  • the sample data is converted into a vector according to the standardization method.
  • the judging whether the sample data needs to be converted into a vector according to the data type of the sample data includes:
  • the sample data needs to be converted into a vector
  • the sample data does not need to be converted into a vector.
  • the data to be converted is a vector, and no conversion is required.
  • the encoding module 203 is configured to encode the vector representation to obtain the feature vector of the sample data.
  • the encoding the vector representation includes:
  • the encoding model consisting of an encoder and a decoder
  • the vector representation is encoded with the trained encoder.
  • the data provider In order to ensure the security of the sample data, the data provider cannot directly request the sample data from a third party.
  • the federated learning device 20 further includes an optimization module for optimizing the trained encoding model through a Deep auto-encoder (deep encoding) or sparse auto-encoder (sparse encoding) method.
  • the trained coding model may be optimized by a sparse coding method according to the difference between the output of the trained coding model and the input.
  • the sparse coding method mainly optimizes the trained coding model by adding sparsity restriction conditions to the neural units in the trained coding model.
  • the sparsity restriction condition may include, when the output value of the neuron is close to 1 (for example, greater than 0.9), the neuron is activated; when the output value of the neuron is close to 0 (for example, less than or equal to 0.9), the neuron is not activated.
  • the coding model is used to perform feature learning and feature integration on the vector representation. Without a decoder, the data requesting end cannot interpret and obtain the sample data corresponding to the vector representation, which ensures the security of the data.
  • the transmission module 204 is configured to transmit the feature vector and the identification code to the data requesting terminal, so that the data requesting terminal searches for the label of the sample data according to the identification code, and according to the feature vector and the label Perform federated learning model training.
  • the federated learning model includes: LR, XGB, DNN, etc. LR, XGB, DNN and other models are used for machine learning training and algorithm models for business use purposes.
  • the federated learning model may be a specific artificial intelligence model, such as an artificial intelligence classification model, an artificial intelligence recognition model, and the like.
  • the transmitting the feature vector and the identification code to the data requesting terminal includes:
  • the feature vector and the identification code are transmitted to the data requesting end through an encryption algorithm.
  • the feature vector and the identification code are encrypted by the private key of the data provider; the encrypted feature vector and the identification code are transmitted to the data requesting terminal, so that the data requesting terminal passes through the data provider's
  • the public key decrypts the encrypted feature vector and identification code.
  • the labels of the sample data are "risk user” and "normal user”.
  • the labels of the sample data are "recommended product one”, “recommended product two”, and so on.
  • the training of the federated learning model according to the feature vector and the label includes:
  • the data requesting terminal obtains the initial parameters of the federated learning model from a preset server;
  • the data requesting terminal initializes the federated learning model with the initial parameters
  • the data requesting terminal locally trains the initialized federated learning model according to the feature vector and the label, updates the parameters of the initialized federated learning model, and obtains the updated parameters;
  • the data requesting end uploads the updated parameters to the preset server, so that the preset server performs aggregation processing on the parameters uploaded by each requesting end to obtain aggregation parameters, and when it is detected that the aggregation is used
  • the preset server performs aggregation processing on the parameters uploaded by each requesting end to obtain aggregation parameters, and when it is detected that the aggregation is used
  • deliver the updated federated learning model to the data requester
  • the data requesting terminal receives the federated learning model issued by the preset server.
  • the federated learning device 20 of the second embodiment generates a federated learning model through federated learning.
  • the coding model is used to perform feature learning and feature integration on the vector representation, and the data requester cannot interpret and obtain sample data corresponding to the vector representation without a decoder, which ensures the security of the data To prevent data leakage.
  • the coding model does not need to add noise to the vector representation, and avoids the generation of additional interference information due to the addition of noise.
  • the establishment of the federation model has direct feedback on the coding results, which is beneficial to optimization and adjustment.
  • the coding model can adjust the information loss degree and the information security degree of the feature learning and feature integration of the vector representation, find the compromise point of information security and information loss, and obtain more optimized parameters of the entire federated learning model.
  • the data requesting end does not directly obtain the data of the data providing end, which improves the security of the data in the federated learning process.
  • the federated learning device 20 further includes an adjustment module for adjusting the hyperparameters of the encoder and/or the federated learning model.
  • Hyperparameters include network structure, number of neural layers, number of neurons in each layer, activation function, learning rate, regularization and penalty coefficients, loss function, and so on. Specifically, when the loss function floats and does not converge, the loss function, learning rate, and/or network structure can be adjusted. When the gradient disappears or the gradient explodes, adjust the activation function.
  • the federated learning device 20 further includes a processing module for obtaining the parameters of the trained federated learning model from the data requesting terminal; acquiring the data to be processed; using the trained federated learning model Update the local federated learning model with the parameters of, and process the data to be processed with the updated local federated learning model.
  • the adjustment module is further configured to obtain the processing result of the to-be-processed data; obtain the preset result of the to-be-processed data; according to the processing result of the to-be-processed data and the to-be-processed data The preset result of adjusting the parameters and/or hyperparameters of the coding model and/or the federated learning model.
  • the coding model can be determined whether the coding model over-encodes data according to the processing result of the data to be processed and the preset result of the data to be processed.
  • Over-encoding data may cause the encoding model to lose its ability to extract effective features;
  • the judgment result adjusts the coding model to improve the feature extraction capability of the coding model and balance the feature extraction capability with the data security achieved through coding.
  • This embodiment provides a computer-readable storage medium having computer-readable instructions stored thereon.
  • the computer-readable storage medium may be non-volatile or volatile.
  • the steps in the above-mentioned federated learning method embodiment are implemented, for example, steps 101-104 shown in Fig. 1:
  • each module in the above-mentioned device embodiment is realized, for example, the modules 201-204 in Fig. 2:
  • the obtaining module 201 is used to obtain sample data and an identification code of the sample data
  • the conversion module 202 is configured to convert the sample data into a vector to obtain a vector representation of the sample data
  • the encoding module 203 is configured to encode the vector representation to obtain the feature vector of the sample data
  • the transmission module 204 is configured to transmit the feature vector and the identification code to the data requesting terminal, so that the data requesting terminal searches for the label of the sample data according to the identification code, and according to the feature vector and the label Perform federated learning model training.
  • FIG. 3 is a schematic diagram of the computer equipment provided in the fourth embodiment of the application.
  • the computer device 30 includes a memory 301, a processor 302, and computer-readable instructions 303 stored in the memory 301 and running on the processor 302, such as a federated learning program.
  • the processor 302 implements the steps in the embodiment of the federated learning method when the computer readable instruction 303 is executed, for example, steps 101-104 shown in FIG. 1:
  • each module in the above-mentioned device embodiment is realized, for example, the modules 201-204 in FIG. 2:
  • the obtaining module 201 is used to obtain sample data and an identification code of the sample data
  • the conversion module 202 is configured to convert the sample data into a vector to obtain a vector representation of the sample data
  • the encoding module 203 is configured to encode the vector representation to obtain the feature vector of the sample data
  • the transmission module 204 is configured to transmit the feature vector and the identification code to the data requesting terminal, so that the data requesting terminal searches for the label of the sample data according to the identification code, and according to the feature vector and the label Perform federated learning model training.
  • the computer-readable instruction 303 may be divided into one or more modules, and the one or more modules are stored in the memory 301 and executed by the processor 302 to complete the method.
  • the one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer readable instruction 303 in the computer device 30.
  • the computer-readable instruction 303 can be divided into the acquisition module 201, the conversion module 202, the encoding module 203, and the transmission module 204 in FIG. 2.
  • the specific functions of each module refer to the second embodiment.
  • the computer device 30 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the schematic diagram 3 is only an example of the computer device 30, and does not constitute a limitation on the computer device 30. It may include more or less components than those shown in the figure, or combine certain components, or different components.
  • the computer device 30 may also include input and output devices, network access devices, buses, and so on.
  • the so-called processor 302 may be a central processing unit (Central Processing Unit, CPU), other general processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor can be a microprocessor or the processor 302 can also be any conventional processor, etc.
  • the processor 302 is the control center of the computer device 30, which uses various interfaces and lines to connect the entire computer device 30. Various parts.
  • the memory 301 may be used to store the computer-readable instructions 303, and the processor 302 executes or executes the computer-readable instructions or modules stored in the memory 301 and calls the data stored in the memory 301 to implement Various functions of the computer device 30.
  • the memory 301 may mainly include a storage program area and a storage data area, where the storage program area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.); the storage data area may Data and the like created in accordance with the use of the computer device 30 are stored.
  • the memory 301 may include a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a Secure Digital (SD) card, a flash memory card (Flash Card), at least one disk storage device, flash memory Devices, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), or other non-volatile/volatile storage devices.
  • the integrated module of the computer device 30 may be stored in a computer-readable storage medium.
  • the computer-readable storage medium may be non-volatile or volatile. Based on this understanding, this application implements all or part of the processes in the above-mentioned embodiments and methods, and can also be completed by instructing relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium.
  • the computer-readable instruction when executed by the processor, it can implement the steps of the foregoing method embodiments.
  • the computer-readable instructions may be in the form of source code, object code, executable file, or some intermediate forms, etc.
  • the computer-readable storage medium may include: any entity or device capable of carrying the computer-readable instructions, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, read only memory (ROM), random access memory ( RAM).
  • modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional modules in the various embodiments of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware, or in the form of hardware plus software functional modules.
  • the above-mentioned integrated modules implemented in the form of software functional modules may be stored in a computer-readable storage medium.
  • the above-mentioned software function module is stored in a storage medium and includes several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor execute the federated learning described in each embodiment of this application. Part of the method.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Business, Economics & Management (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Finance (AREA)
  • Biophysics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Molecular Biology (AREA)
  • Computational Linguistics (AREA)
  • Biomedical Technology (AREA)
  • Accounting & Taxation (AREA)
  • Computer Hardware Design (AREA)
  • Medical Informatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computer Security & Cryptography (AREA)
  • Bioethics (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Image Analysis (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

Provided are a federated learning method and apparatus, a computer device, and a readable storage medium. The federated learning method comprises: acquiring sample data and an identification code of the sample data; converting the sample data into a vector to obtain a vector representation of the sample data; encoding the vector representation to obtain an eigenvector of the sample data; and transmitting the eigenvector and the identification code to a data requesting end, such that the data requesting end looks up a label of the sample data on the basis of the identification code and implements federated learning model training on the basis of the eigenvector and the label. The present method increases the security of data during the process of federated learning.

Description

联邦学习方法、装置、计算机设备及可读存储介质Federal learning method, device, computer equipment and readable storage medium
本申请要求于2020年05月14日提交中国专利局,申请号为202010408557.4申请名称为“联邦学习方法、装置、计算机设备及可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims to be submitted to the Chinese Patent Office on May 14, 2020. The application number is 202010408557.4. The application titled "Federal learning methods, devices, computer equipment and readable storage media" is the priority of the Chinese patent application, the entire content of which is incorporated by reference Incorporated in this application.
技术领域Technical field
本申请涉及人工智能技术领域,具体涉及一种联邦学习方法、装置、计算机设备及计算机可读存储介质。This application relates to the field of artificial intelligence technology, in particular to a federated learning method, device, computer equipment, and computer-readable storage medium.
背景技术Background technique
随着人工智能技术的发展,通过联合不同的参与者(participant,或者party,也称为数据拥有者(data owner)、或者客户(client))进行机器学习建模成为发展趋势,即联邦学习。With the development of artificial intelligence technology, machine learning modeling by uniting different participants (participants, or parties, also known as data owners or clients) has become a development trend, that is, federated learning.
在联邦学习中,发明人意识到如何在避免数据失真的同时,保证数据的安全性,成为待解决的问题。In federated learning, the inventor realized how to ensure data security while avoiding data distortion has become a problem to be solved.
发明内容Summary of the invention
鉴于以上内容,有必要提出一种联邦学习方法、装置、计算机设备及计算机可读存储介质,其可以提高训练联邦学习模型的效率。In view of the above content, it is necessary to propose a federated learning method, device, computer equipment, and computer-readable storage medium, which can improve the efficiency of training federated learning models.
本申请的第一方面提供一种联邦学习方法,所述联邦学习方法包括:The first aspect of this application provides a federated learning method, and the federated learning method includes:
获取样本数据和所述样本数据的标识码;Acquiring sample data and an identification code of the sample data;
将所述样本数据转化为向量,得到所述样本数据的向量表示;Converting the sample data into a vector to obtain a vector representation of the sample data;
对所述向量表示进行编码,得到所述样本数据的特征向量;Encoding the vector representation to obtain the feature vector of the sample data;
将所述特征向量和所述标识码传输给数据请求端,使所述数据请求端根据所述标识码查找所述样本数据的标签,根据所述特征向量和所述标签进行联邦学习模型训练。The feature vector and the identification code are transmitted to the data requesting terminal, so that the data requesting terminal searches for the label of the sample data according to the identification code, and performs federated learning model training according to the feature vector and the label.
本申请的第二方面提供一种联邦学习装置,所述联邦学习装置包括:A second aspect of the present application provides a federated learning device, the federated learning device includes:
获取模块,用于获取样本数据和所述样本数据的标识码;An obtaining module, used to obtain sample data and an identification code of the sample data;
转化模块,用于将所述样本数据转化为向量,得到所述样本数据的向量表示;A conversion module, configured to convert the sample data into a vector to obtain a vector representation of the sample data;
编码模块,用于对所述向量表示进行编码,得到所述样本数据的特征向量;An encoding module, configured to encode the vector representation to obtain the feature vector of the sample data;
传输模块,用于将所述特征向量和所述标识码传输给数据请求端,使所述数据请求端根据所述标识码查找所述样本数据的标签,根据所述特征向量和所述标签进行联邦学习模型训练。The transmission module is configured to transmit the feature vector and the identification code to the data requesting terminal, so that the data requesting terminal searches for the label of the sample data according to the identification code, and performs processing according to the feature vector and the label Federation learning model training.
本申请的第三方面提供一种计算机设备,所述计算机设备包括处理器,所述处理器用于执行存储器中存储的计算机可读指令以实现以下步骤:A third aspect of the present application provides a computer device that includes a processor, and the processor is configured to execute computer-readable instructions stored in a memory to implement the following steps:
获取样本数据和所述样本数据的标识码;Acquiring sample data and an identification code of the sample data;
将所述样本数据转化为向量,得到所述样本数据的向量表示;Converting the sample data into a vector to obtain a vector representation of the sample data;
对所述向量表示进行编码,得到所述样本数据的特征向量;Encoding the vector representation to obtain the feature vector of the sample data;
将所述特征向量和所述标识码传输给数据请求端,使所述数据请求端根据所述标识码查找所述样本数据的标签,根据所述特征向量和所述标签进行联邦学习模型训练。The feature vector and the identification code are transmitted to the data requesting terminal, so that the data requesting terminal searches for the label of the sample data according to the identification code, and performs federated learning model training according to the feature vector and the label.
本申请的第四方面提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机可读指令,所述计算机可读指令被处理器执行时实现以下步骤:A fourth aspect of the present application provides a computer-readable storage medium having computer-readable instructions stored on the computer-readable storage medium, and when the computer-readable instructions are executed by a processor, the following steps are implemented:
获取样本数据和所述样本数据的标识码;Acquiring sample data and an identification code of the sample data;
将所述样本数据转化为向量,得到所述样本数据的向量表示;Converting the sample data into a vector to obtain a vector representation of the sample data;
对所述向量表示进行编码,得到所述样本数据的特征向量;Encoding the vector representation to obtain the feature vector of the sample data;
将所述特征向量和所述标识码传输给数据请求端,使所述数据请求端根据所述标识码查找所述样本数据的标签,根据所述特征向量和所述标签进行联邦学习模型训练。The feature vector and the identification code are transmitted to the data requesting terminal, so that the data requesting terminal searches for the label of the sample data according to the identification code, and performs federated learning model training according to the feature vector and the label.
本申请将所述编码模型用于对所述向量表示进行特征学习、特征整合。所述数据请求端在没有解码器的情况下,无法解释并获得所述向量表示对应的样本数据,保障了数据的安全性。所述数据请求端没有直接得到所述数据提供端的数据,提升了联邦学习过程中的数据的安全性。This application uses the coding model to perform feature learning and feature integration on the vector representation. Without a decoder, the data requesting end cannot interpret and obtain the sample data corresponding to the vector representation, which ensures the security of the data. The data requesting end does not directly obtain the data of the data providing end, which improves the security of the data in the federated learning process.
附图说明Description of the drawings
图1是本申请实施例提供的联邦学习方法的流程图。Fig. 1 is a flowchart of a federated learning method provided by an embodiment of the application.
图2是本申请实施例提供的联邦学习装置的结构图。Figure 2 is a structural diagram of a federated learning device provided by an embodiment of the present application.
图3是本申请实施例提供的计算机设备的示意图。Fig. 3 is a schematic diagram of a computer device provided by an embodiment of the present application.
具体实施方式Detailed ways
为了能够更清楚地理解本申请的上述目的、特征和优点,下面结合附图和具体实施例对本申请进行详细描述。需要说明的是,在不冲突的情况下,本申请的实施例及实施例中的特征可以相互组合。In order to be able to understand the above objectives, features and advantages of the application more clearly, the application will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments of the application and the features in the embodiments can be combined with each other if there is no conflict.
在下面的描述中阐述了很多具体细节以便于充分理解本申请,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In the following description, many specific details are set forth in order to fully understand the present application. The described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this application.
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本文中在本申请的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本申请。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field of this application. The terms used in the specification of the application herein are only for the purpose of describing specific embodiments, and are not intended to limit the application.
优选地,本申请的联邦学习方法应用在一个或者多个计算机设备中。所述计算机设备是一种能够按照事先设定或存储的指令,自动进行数值计算和/或信息处理的设备,其硬件包括但不限于微处理器、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程门阵列(Field-Programmable Gate Array,FPGA)、数字处理器(Digital Signal Processor,DSP)、嵌入式设备等。Preferably, the federated learning method of this application is applied to one or more computer devices. The computer device is a device that can automatically perform numerical calculation and/or information processing in accordance with pre-set or stored instructions. Its hardware includes, but is not limited to, a microprocessor and an application specific integrated circuit (ASIC) , Programmable Gate Array (Field-Programmable Gate Array, FPGA), Digital Processor (Digital Signal Processor, DSP), embedded equipment, etc.
本申请可用于众多通用或专用的计算机系统环境或配置中。例如:个人计算机、服务器计算机、手持设备或便携式设备、平板型设备、多处理器系统、基于微处理器的系统、置顶盒、可编程的消费电子设备、网络PC、小型计算机、大型计算机、包括以上任何系统或设备的分布式计算环境等等。本申请可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本申请,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。This application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, small computers, large computers, including Distributed computing environment for any of the above systems or equipment, etc. This application may be described in the general context of computer-executable instructions executed by a computer, such as a program module. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments. In these distributed computing environments, tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
所述计算机设备可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述计算机设备可以与用户通过键盘、鼠标、遥控器、触摸板或声控设备等方式进行人机交互。The computer device may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server. The computer device can interact with the user through a keyboard, a mouse, a remote control, a touch panel, or a voice control device.
实施例一Example one
图1是本申请实施例一提供的联邦学习方法的流程图。所述联邦学习方法应用于数据提供端,所述数据提供端为计算机设备,用于通过联邦学习生成联邦学习模型。Fig. 1 is a flow chart of the federated learning method provided in Embodiment 1 of the present application. The federated learning method is applied to a data provider, and the data provider is a computer device for generating a federated learning model through federated learning.
所述联邦学习方法具体包括以下步骤,根据不同的需求,该流程图中步骤的顺序可 以改变,某些可以省略。The federated learning method specifically includes the following steps. According to different needs, the order of the steps in the flowchart can be changed, and some can be omitted.
101,获取样本数据和所述样本数据的标识码。101. Acquire sample data and an identification code of the sample data.
所述标识码是所述样本数据的唯一标识信息,用于所述数据提供端和请求数据的第三方之间识别所述样本数据。The identification code is the unique identification information of the sample data, and is used to identify the sample data between the data provider and the third party requesting the data.
所述样本数据可以包括文本类数据、one-hot数据、数值数据、embedding数据等不同的数据类型。The sample data may include different data types such as text data, one-hot data, numerical data, and embedding data.
例如,所述数据提供端可以是金融公司,请求数据的第三方可以是保险公司,所述样本数据可以是金融公司的用户行为数据,所述样本数据的数据类型可以为文本类数据。所述标识码可以是用户行为数据对应的用户的手机号或身份证号。保险公司需要获取金融公司的编码后的用户行为数据,通过保险可靠性评分模型根据获取的编码后的用户行为数据对用户进行可靠性评分。即保险公司不用直接获取金融公司的用户行为数据,保护了金融公司的数据安全。保险可靠性评分模型可以是一个具体的联邦学习模型,保险公司本地的联邦学习模型可以是深度学习模型。For example, the data provider may be a financial company, the third party requesting the data may be an insurance company, the sample data may be user behavior data of the financial company, and the data type of the sample data may be text data. The identification code may be the user's mobile phone number or ID number corresponding to the user behavior data. The insurance company needs to obtain the coded user behavior data of the financial company, and use the insurance reliability scoring model to score the reliability of the user based on the obtained coded user behavior data. That is, insurance companies do not need to directly obtain user behavior data of financial companies, which protects the data security of financial companies. The insurance reliability scoring model can be a specific federated learning model, and the local federated learning model of an insurance company can be a deep learning model.
再如,所述数据提供端可以是电商公司,请求数据的第三方可以是广告公司,所述样本数据可以是电商公司的商品点击行为数据,所述样本数据的数据类型可以为数值数据。所述标识码可以是商品点击行为数据对应的用户的手机号或身份证号。广告公司需要获取电商公司的编码后的商品点击行为数据,通过商品推荐模型根据获取的编码后的商品点击行为数据给用户推荐商品。即广告公司不用直接获取电商公司的商品点击行为数据,保护了电商公司的数据安全。商品推荐模型可以是一个具体的联邦学习模型,广告公司本地的联邦学习模型可以是深度学习模型。For another example, the data provider may be an e-commerce company, the third party requesting the data may be an advertising company, the sample data may be product click behavior data of the e-commerce company, and the data type of the sample data may be numeric data . The identification code may be the user's mobile phone number or ID number corresponding to the commodity click behavior data. The advertising company needs to obtain the coded product click behavior data of the e-commerce company, and recommend products to users according to the obtained coded product click behavior data through the product recommendation model. That is, the advertising company does not need to directly obtain the product click behavior data of the e-commerce company, which protects the data security of the e-commerce company. The product recommendation model can be a specific federated learning model, and the local federated learning model of the advertising company can be a deep learning model.
102,将所述样本数据转化为向量,得到所述样本数据的向量表示。102. Convert the sample data into a vector to obtain a vector representation of the sample data.
在一具体实施例中,所述将所述样本数据转化为向量包括:In a specific embodiment, the converting the sample data into a vector includes:
获取所述样本数据的数据类型;Acquiring the data type of the sample data;
根据所述样本数据的数据类型判断所述样本数据是否需要转化为向量;Judging whether the sample data needs to be converted into a vector according to the data type of the sample data;
如果根据所述样本数据的数据类型判断所述样本数据需要转化为向量,根据所述样本数据的数据类型对应的预设转化方法将所述样本数据转化为向量。If it is determined according to the data type of the sample data that the sample data needs to be converted into a vector, the sample data is converted into a vector according to a preset conversion method corresponding to the data type of the sample data.
例如,如果所述样本数据的数据类型为文本类数据(文本类数据对应的预设转化方法为word2vec方法),根据word2vec方法将所述样本数据转化为向量。再如,如果所述样本数据的数据类型为数值数据(数值类数据对应的预设转化方法为标准化方法),根据标准化方法将所述样本数据转化为向量。For example, if the data type of the sample data is text data (the preset conversion method corresponding to the text data is the word2vec method), the sample data is converted into a vector according to the word2vec method. For another example, if the data type of the sample data is numeric data (the preset conversion method corresponding to the numeric data is a standardization method), the sample data is converted into a vector according to the standardization method.
进一步地,所述根据所述样本数据的数据类型判断所述样本数据是否需要转化为向量包括:Further, the judging whether the sample data needs to be converted into a vector according to the data type of the sample data includes:
获取待转化数据类型表;Obtain a table of data types to be converted;
如果所述待转化数据类型表中存在所述样本数据的数据类型,所述样本数据需要转化为向量;If the data type of the sample data exists in the data type table to be converted, the sample data needs to be converted into a vector;
如果所述待转化数据类型表中不存在所述样本数据的数据类型,所述样本数据不需要转化为向量。此时所述待转化数据是向量,不需要转化。If the data type of the sample data does not exist in the data type table to be converted, the sample data does not need to be converted into a vector. At this time, the data to be converted is a vector, and no conversion is required.
103,对所述向量表示进行编码,得到所述样本数据的特征向量。103. Encode the vector representation to obtain a feature vector of the sample data.
在一具体实施例中,所述对所述向量表示进行编码包括:In a specific embodiment, the encoding the vector representation includes:
获取样本向量;Get sample vector;
根据所述样本向量通过反向传播算法训练编码模型,所述编码模型由编码器和解码器构成;Training an encoding model through a backpropagation algorithm according to the sample vector, the encoding model consisting of an encoder and a decoder;
用训练后的编码器对所述向量表示进行编码。The vector representation is encoded with the trained encoder.
数据提供端为了保证所述样本数据的安全性,不能够直接的将所述样本数据请求数据的第三方。In order to ensure the security of the sample data, the data provider cannot directly request the sample data from a third party.
在一具体实施例中,通过Deep auto-encoder(深度编码)或sparse auto-encoder(稀 疏编码)方法对所述训练后的编码模型进行优化。In a specific embodiment, the trained encoding model is optimized through the Deep auto-encoder (deep encoding) or sparse auto-encoder (sparse encoding) method.
可以根据所述训练后的编码模型的输出与输入的差值通过稀疏编码方法对所述训练后的编码模型进行优化。稀疏编码方法主要是通过对所述训练后的编码模型中的神经单元增加稀疏性限制条件对所述训练后的编码模型进行优化。The trained coding model may be optimized by a sparse coding method according to the difference between the output of the trained coding model and the input. The sparse coding method mainly optimizes the trained coding model by adding sparsity restriction conditions to the neural units in the trained coding model.
具体地,稀疏性限制条件可以包括,当神经元的输出接近1时(如大于0.9),激活神经元;当神经元的输出值接近0时(如小于或等于0.9),不激活神经元。Specifically, the sparsity restriction condition may include, when the output value of the neuron is close to 1 (for example, greater than 0.9), the neuron is activated; when the output value of the neuron is close to 0 (for example, less than or equal to 0.9), the neuron is not activated.
所述编码模型用于对所述向量表示进行特征学习、特征整合。所述数据请求端在没有解码器的情况下,无法解释并获得所述向量表示对应的样本数据,保障了数据的安全性。The coding model is used to perform feature learning and feature integration on the vector representation. Without a decoder, the data requesting end cannot interpret and obtain the sample data corresponding to the vector representation, which ensures the security of the data.
104,将所述特征向量和所述标识码传输给数据请求端,使所述数据请求端根据所述标识码查找所述样本数据的标签,根据所述特征向量和所述标签进行联邦学习模型训练。104. Transmit the feature vector and the identification code to the data requesting terminal, so that the data requesting terminal searches for the label of the sample data according to the identification code, and performs a federated learning model based on the feature vector and the label training.
所述联邦学习模型包括:LR,XGB,DNN等。LR,XGB,DNN等模型用来进行机器学习训练,达到业务使用目的的算法模型。所述联邦学习模型可以是具体的人工智能模型,如人工智能分类模型、人工智能识别模型等。The federated learning model includes: LR, XGB, DNN, etc. LR, XGB, DNN and other models are used for machine learning training and algorithm models for business use purposes. The federated learning model may be a specific artificial intelligence model, such as an artificial intelligence classification model, an artificial intelligence recognition model, and the like.
在一具体实施例中,所述将所述特征向量和所述标识码传输给数据请求端包括:In a specific embodiment, the transmitting the feature vector and the identification code to the data requesting terminal includes:
通过加密算法将所述特征向量和所述标识码传输给所述数据请求端。The feature vector and the identification code are transmitted to the data requesting end through an encryption algorithm.
例如,通过所述数据提供端的私钥加密所述特征向量和所述标识码;将加密后的特征向量和标识码传输给所述数据请求端,使所述数据请求端通过所述数据提供端的公钥对加密后的特征向量和标识码进行解密。For example, the feature vector and the identification code are encrypted by the private key of the data provider; the encrypted feature vector and the identification code are transmitted to the data requesting terminal, so that the data requesting terminal passes through the data provider's The public key decrypts the encrypted feature vector and identification code.
当所述样本数据为用户行为数据时,所述样本数据的标签为“风险用户”、“正常用户”。当所述样本数据为商品点击行为数据,所述样本数据的标签为“推荐商品一”、“推荐商品二”等。When the sample data is user behavior data, the labels of the sample data are "risk user" and "normal user". When the sample data is product click behavior data, the labels of the sample data are "recommended product one", "recommended product two", and so on.
在一具体实施例中,所述根据所述特征向量和所述标签进行联邦学习模型训练包括:In a specific embodiment, the training of the federated learning model according to the feature vector and the label includes:
所述数据请求端从预设服务端获取所述联邦学习模型的初始参数;The data requesting terminal obtains the initial parameters of the federated learning model from a preset server;
所述数据请求端用所述初始参数初始化所述联邦学习模型;The data requesting terminal initializes the federated learning model with the initial parameters;
所述数据请求端根据所述特征向量和所述标签对初始化的联邦学习模型进行本地训练,更新所述初始化的联邦学习模型的参数,得到更新后的参数;The data requesting terminal locally trains the initialized federated learning model according to the feature vector and the label, updates the parameters of the initialized federated learning model, and obtains the updated parameters;
所述数据请求端将所述更新后的参数上传至所述预设服务端,使所述预设服务端对各个请求端上传的参数进行聚合处理,得到聚合参数,当检测到用所述聚合参数更新的联邦学习模型为收敛状态时,将更新后的联邦学习模型下发给所述数据请求端;The data requesting end uploads the updated parameters to the preset server, so that the preset server performs aggregation processing on the parameters uploaded by each requesting end to obtain aggregation parameters, and when it is detected that the aggregation is used When the parameter-updated federated learning model is in a convergent state, deliver the updated federated learning model to the data requester;
所述数据请求端接收所述预设服务端下发的联邦学习模型。The data requesting terminal receives the federated learning model issued by the preset server.
在另一实施例中,在所述将更新后的联邦学习模型下发给所述数据请求端之前,当所述预设服务端检测到用所述聚合参数更新的联邦学习模型为不收敛状态时,所述预设服务端将所述聚合参数返回给所述数据请求端,使所述数据请求端继续迭代训练。In another embodiment, before sending the updated federated learning model to the data requester, when the preset server detects that the federated learning model updated with the aggregation parameters is in a non-convergent state When the time, the preset server returns the aggregation parameter to the data requesting terminal, so that the data requesting terminal continues iterative training.
实施例一的联邦学习方法通过联邦学习生成联邦学习模型。所述编码模型用于对所述向量表示进行特征学习、特征整合,所述数据请求端在没有解码器的情况下,无法解释并获得所述向量表示对应的样本数据,保障了数据的安全性,防止数据泄露。所述编码模型不用对所述向量表示添加噪音,避免因添加噪音而产生额外的干扰信息。联邦模型的建立对编码结果有直接反馈,从而利于优化调整。通过所述编码模型可以调节对所述向量表示进行特征学习、特征整合的信息损失程度和信息安全程度,找到信息安全和信息损失的利益折中点,得到整个联邦学习模型的更优化的参数。所述数据请求端没有直接得到所述数据提供端的数据,提升了联邦学习过程中的数据的安全性。The federated learning method of the first embodiment generates a federated learning model through federated learning. The coding model is used to perform feature learning and feature integration on the vector representation, and the data requester cannot interpret and obtain sample data corresponding to the vector representation without a decoder, which ensures the security of the data To prevent data leakage. The coding model does not need to add noise to the vector representation, and avoids the generation of additional interference information due to the addition of noise. The establishment of the federation model has direct feedback on the coding results, which is beneficial to optimization and adjustment. The coding model can adjust the information loss degree and the information security degree of the feature learning and feature integration of the vector representation, find the compromise point of information security and information loss, and obtain more optimized parameters of the entire federated learning model. The data requesting end does not directly obtain the data of the data providing end, which improves the security of the data in the federated learning process.
在一具体实施例中,所述联邦学习方法还包括:In a specific embodiment, the federated learning method further includes:
调整所述编码器和/或所述联邦学习模型的超参数。超参数包括网络结构、神经层数、每层的神经元个数、激活函数、学习率、正则和惩罚系数、损失函数等等。具体地,当损失函数浮动不收敛时,可以调整损失函数、学习率和/或网络结构等。当出现梯度消失或 梯度爆炸时,调整激活函数。Adjust the hyperparameters of the encoder and/or the federated learning model. Hyperparameters include network structure, number of neural layers, number of neurons in each layer, activation function, learning rate, regularization and penalty coefficients, loss function, and so on. Specifically, when the loss function floats and does not converge, the loss function, learning rate, and/or network structure can be adjusted. When the gradient disappears or the gradient explodes, adjust the activation function.
在一具体实施例中,所述联邦学习方法还包括:In a specific embodiment, the federated learning method further includes:
从所述数据请求端获取训练后的联邦学习模型的参数;Acquiring the parameters of the trained federated learning model from the data requesting terminal;
获取待处理数据;Obtain the data to be processed;
用所述训练后的联邦学习模型的参数更新本地联邦学习模型;Update the local federated learning model with the parameters of the trained federated learning model;
用更新后的本地联邦学习模型处理所述待处理数据。The updated local federated learning model is used to process the to-be-processed data.
在一具体实施例中,所述联邦学习方法还包括:In a specific embodiment, the federated learning method further includes:
获取所述待处理数据的处理结果;Acquiring the processing result of the to-be-processed data;
获取所述待处理数据的预设结果;Obtaining the preset result of the to-be-processed data;
根据所述待处理数据的处理结果和所述待处理数据的预设结果调整所述编码模型和/或所述联邦学习模型的参数和/或超参数。The parameters and/or hyperparameters of the coding model and/or the federated learning model are adjusted according to the processing result of the to-be-processed data and the preset result of the to-be-processed data.
具体的,可以根据所述待处理数据的处理结果和所述待处理数据的预设结果判断所述编码模型是否过度编码数据,过度编码数据可以导致所述编码模型失去提取有效特征的能力;根据判断结果对所述编码模型进行调整,以提升所述编码模型的特征提取能力,使特征提取能力和通过编码达到的数据安全相平衡。Specifically, it can be determined whether the coding model over-encodes data according to the processing result of the data to be processed and the preset result of the data to be processed. Over-encoding data may cause the encoding model to lose its ability to extract effective features; The judgment result adjusts the coding model to improve the feature extraction capability of the coding model and balance the feature extraction capability with the data security achieved through coding.
实施例二Example two
图2是本申请实施例二提供的联邦学习装置的结构图。所述联邦学习装置20应用于数据提供端,所述数据提供端为计算机设备。所述联邦学习装置20用于通过联邦学习生成联邦学习模型。Fig. 2 is a structural diagram of a federated learning device provided in the second embodiment of the present application. The federated learning device 20 is applied to a data provider, and the data provider is a computer device. The federated learning device 20 is used to generate federated learning models through federated learning.
如图2所示,所述联邦学习装置20可以包括获取模块201、转化模块202、编码模块203、传输模块204。As shown in FIG. 2, the federated learning device 20 may include an acquisition module 201, a conversion module 202, an encoding module 203, and a transmission module 204.
获取模块201,用于获取样本数据和所述样本数据的标识码。The obtaining module 201 is used to obtain sample data and an identification code of the sample data.
所述标识码是所述样本数据的唯一标识信息,用于所述数据提供端和请求数据的第三方之间识别所述样本数据。The identification code is the unique identification information of the sample data, and is used to identify the sample data between the data provider and the third party requesting the data.
所述样本数据可以包括文本类数据、one-hot数据、数值数据、embedding数据等不同的数据类型。The sample data may include different data types such as text data, one-hot data, numerical data, and embedding data.
例如,所述数据提供端可以是金融公司,请求数据的第三方可以是保险公司,所述样本数据可以是金融公司的用户行为数据,所述样本数据的数据类型可以为文本类数据。所述标识码可以是用户行为数据对应的用户的手机号或身份证号。保险公司需要获取金融公司的编码后的用户行为数据,通过保险可靠性评分模型根据获取的编码后的用户行为数据对用户进行可靠性评分。即保险公司不用直接获取金融公司的用户行为数据,保护了金融公司的数据安全。保险可靠性评分模型可以是一个具体的联邦学习模型,保险公司本地的联邦学习模型可以是深度学习模型。For example, the data provider may be a financial company, the third party requesting the data may be an insurance company, the sample data may be user behavior data of the financial company, and the data type of the sample data may be text data. The identification code may be the user's mobile phone number or ID number corresponding to the user behavior data. The insurance company needs to obtain the coded user behavior data of the financial company, and use the insurance reliability scoring model to score the reliability of the user based on the obtained coded user behavior data. That is, insurance companies do not need to directly obtain user behavior data of financial companies, which protects the data security of financial companies. The insurance reliability scoring model can be a specific federated learning model, and the local federated learning model of an insurance company can be a deep learning model.
再如,所述数据提供端可以是电商公司,请求数据的第三方可以是广告公司,所述样本数据可以是电商公司的商品点击行为数据,所述样本数据的数据类型可以为数值数据。所述标识码可以是商品点击行为数据对应的用户的手机号或身份证号。广告公司需要获取电商公司的编码后的商品点击行为数据,通过商品推荐模型根据获取的编码后的商品点击行为数据给用户推荐商品。即广告公司不用直接获取电商公司的商品点击行为数据,保护了电商公司的数据安全。商品推荐模型可以是一个具体的联邦学习模型,广告公司本地的联邦学习模型可以是深度学习模型。For another example, the data provider may be an e-commerce company, the third party requesting the data may be an advertising company, the sample data may be product click behavior data of the e-commerce company, and the data type of the sample data may be numeric data . The identification code may be the user's mobile phone number or ID number corresponding to the commodity click behavior data. The advertising company needs to obtain the coded product click behavior data of the e-commerce company, and recommend products to users according to the obtained coded product click behavior data through the product recommendation model. That is, the advertising company does not need to directly obtain the product click behavior data of the e-commerce company, which protects the data security of the e-commerce company. The product recommendation model can be a specific federated learning model, and the local federated learning model of the advertising company can be a deep learning model.
转化模块202,用于将所述样本数据转化为向量,得到所述样本数据的向量表示。The conversion module 202 is configured to convert the sample data into a vector to obtain a vector representation of the sample data.
在一具体实施例中,所述将所述样本数据转化为向量包括:In a specific embodiment, the converting the sample data into a vector includes:
获取所述样本数据的数据类型;Acquiring the data type of the sample data;
根据所述样本数据的数据类型判断所述样本数据是否需要转化为向量;Judging whether the sample data needs to be converted into a vector according to the data type of the sample data;
如果根据所述样本数据的数据类型判断所述样本数据需要转化为向量,根据所述样 本数据的数据类型对应的预设转化方法将所述样本数据转化为向量。If it is determined according to the data type of the sample data that the sample data needs to be converted into a vector, the sample data is converted into a vector according to a preset conversion method corresponding to the data type of the sample data.
例如,如果所述样本数据的数据类型为文本类数据(文本类数据对应的预设转化方法为word2vec方法),根据word2vec方法将所述样本数据转化为向量。再如,如果所述样本数据的数据类型为数值数据(数值类数据对应的预设转化方法为标准化方法),根据标准化方法将所述样本数据转化为向量。For example, if the data type of the sample data is text data (the preset conversion method corresponding to the text data is the word2vec method), the sample data is converted into a vector according to the word2vec method. For another example, if the data type of the sample data is numeric data (the preset conversion method corresponding to the numeric data is a standardization method), the sample data is converted into a vector according to the standardization method.
进一步地,所述根据所述样本数据的数据类型判断所述样本数据是否需要转化为向量包括:Further, the judging whether the sample data needs to be converted into a vector according to the data type of the sample data includes:
获取待转化数据类型表;Obtain a table of data types to be converted;
如果所述待转化数据类型表中存在所述样本数据的数据类型,所述样本数据需要转化为向量;If the data type of the sample data exists in the data type table to be converted, the sample data needs to be converted into a vector;
如果所述待转化数据类型表中不存在所述样本数据的数据类型,所述样本数据不需要转化为向量。此时所述待转化数据是向量,不需要转化。If the data type of the sample data does not exist in the data type table to be converted, the sample data does not need to be converted into a vector. At this time, the data to be converted is a vector, and no conversion is required.
编码模块203,用于对所述向量表示进行编码,得到所述样本数据的特征向量。The encoding module 203 is configured to encode the vector representation to obtain the feature vector of the sample data.
在一具体实施例中,所述对所述向量表示进行编码包括:In a specific embodiment, the encoding the vector representation includes:
获取样本向量;Get sample vector;
根据所述样本向量通过反向传播算法训练编码模型,所述编码模型由编码器和解码器构成;Training an encoding model through a backpropagation algorithm according to the sample vector, the encoding model consisting of an encoder and a decoder;
用训练后的编码器对所述向量表示进行编码。The vector representation is encoded with the trained encoder.
数据提供端为了保证所述样本数据的安全性,不能够直接的将所述样本数据请求数据的第三方。In order to ensure the security of the sample data, the data provider cannot directly request the sample data from a third party.
在另一实施例中,所述联邦学习装置20还包括优化模块,用于通过Deep auto-encoder(深度编码)或sparse auto-encoder(稀疏编码)方法对所述训练后的编码模型进行优化。In another embodiment, the federated learning device 20 further includes an optimization module for optimizing the trained encoding model through a Deep auto-encoder (deep encoding) or sparse auto-encoder (sparse encoding) method.
可以根据所述训练后的编码模型的输出与输入的差值通过稀疏编码方法对所述训练后的编码模型进行优化。稀疏编码方法主要是通过对所述训练后的编码模型中的神经单元增加稀疏性限制条件对所述训练后的编码模型进行优化。The trained coding model may be optimized by a sparse coding method according to the difference between the output of the trained coding model and the input. The sparse coding method mainly optimizes the trained coding model by adding sparsity restriction conditions to the neural units in the trained coding model.
具体地,稀疏性限制条件可以包括,当神经元的输出接近1时(如大于0.9),激活神经元;当神经元的输出值接近0时(如小于或等于0.9),不激活神经元。Specifically, the sparsity restriction condition may include, when the output value of the neuron is close to 1 (for example, greater than 0.9), the neuron is activated; when the output value of the neuron is close to 0 (for example, less than or equal to 0.9), the neuron is not activated.
所述编码模型用于对所述向量表示进行特征学习、特征整合。所述数据请求端在没有解码器的情况下,无法解释并获得所述向量表示对应的样本数据,保障了数据的安全性。The coding model is used to perform feature learning and feature integration on the vector representation. Without a decoder, the data requesting end cannot interpret and obtain the sample data corresponding to the vector representation, which ensures the security of the data.
传输模块204,用于将所述特征向量和所述标识码传输给数据请求端,使所述数据请求端根据所述标识码查找所述样本数据的标签,根据所述特征向量和所述标签进行联邦学习模型训练。The transmission module 204 is configured to transmit the feature vector and the identification code to the data requesting terminal, so that the data requesting terminal searches for the label of the sample data according to the identification code, and according to the feature vector and the label Perform federated learning model training.
所述联邦学习模型包括:LR,XGB,DNN等。LR,XGB,DNN等模型用来进行机器学习训练,达到业务使用目的的算法模型。所述联邦学习模型可以是具体的人工智能模型,如人工智能分类模型、人工智能识别模型等。The federated learning model includes: LR, XGB, DNN, etc. LR, XGB, DNN and other models are used for machine learning training and algorithm models for business use purposes. The federated learning model may be a specific artificial intelligence model, such as an artificial intelligence classification model, an artificial intelligence recognition model, and the like.
在一具体实施例中,所述将所述特征向量和所述标识码传输给数据请求端包括:In a specific embodiment, the transmitting the feature vector and the identification code to the data requesting terminal includes:
通过加密算法将所述特征向量和所述标识码传输给所述数据请求端。The feature vector and the identification code are transmitted to the data requesting end through an encryption algorithm.
例如,通过所述数据提供端的私钥加密所述特征向量和所述标识码;将加密后的特征向量和标识码传输给所述数据请求端,使所述数据请求端通过所述数据提供端的公钥对加密后的特征向量和标识码进行解密。For example, the feature vector and the identification code are encrypted by the private key of the data provider; the encrypted feature vector and the identification code are transmitted to the data requesting terminal, so that the data requesting terminal passes through the data provider's The public key decrypts the encrypted feature vector and identification code.
当所述样本数据为用户行为数据时,所述样本数据的标签为“风险用户”、“正常用户”。当所述样本数据为商品点击行为数据,所述样本数据的标签为“推荐商品一”、“推荐商品二”等。When the sample data is user behavior data, the labels of the sample data are "risk user" and "normal user". When the sample data is product click behavior data, the labels of the sample data are "recommended product one", "recommended product two", and so on.
在一具体实施例中,所述根据所述特征向量和所述标签进行联邦学习模型训练包括:In a specific embodiment, the training of the federated learning model according to the feature vector and the label includes:
所述数据请求端从预设服务端获取所述联邦学习模型的初始参数;The data requesting terminal obtains the initial parameters of the federated learning model from a preset server;
所述数据请求端用所述初始参数初始化所述联邦学习模型;The data requesting terminal initializes the federated learning model with the initial parameters;
所述数据请求端根据所述特征向量和所述标签对初始化的联邦学习模型进行本地训练,更新所述初始化的联邦学习模型的参数,得到更新后的参数;The data requesting terminal locally trains the initialized federated learning model according to the feature vector and the label, updates the parameters of the initialized federated learning model, and obtains the updated parameters;
所述数据请求端将所述更新后的参数上传至所述预设服务端,使所述预设服务端对各个请求端上传的参数进行聚合处理,得到聚合参数,当检测到用所述聚合参数更新的联邦学习模型为收敛状态时,将更新后的联邦学习模型下发给所述数据请求端;The data requesting end uploads the updated parameters to the preset server, so that the preset server performs aggregation processing on the parameters uploaded by each requesting end to obtain aggregation parameters, and when it is detected that the aggregation is used When the parameter-updated federated learning model is in a convergent state, deliver the updated federated learning model to the data requester;
所述数据请求端接收所述预设服务端下发的联邦学习模型。The data requesting terminal receives the federated learning model issued by the preset server.
实施例二的联邦学习装置20通过联邦学习生成联邦学习模型。所述编码模型用于对所述向量表示进行特征学习、特征整合,所述数据请求端在没有解码器的情况下,无法解释并获得所述向量表示对应的样本数据,保障了数据的安全性,防止数据泄露。所述编码模型不用对所述向量表示添加噪音,避免因添加噪音而产生额外的干扰信息。联邦模型的建立对编码结果有直接反馈,从而利于优化调整。通过所述编码模型可以调节对所述向量表示进行特征学习、特征整合的信息损失程度和信息安全程度,找到信息安全和信息损失的利益折中点,得到整个联邦学习模型的更优化的参数。所述数据请求端没有直接得到所述数据提供端的数据,提升了联邦学习过程中的数据的安全性。The federated learning device 20 of the second embodiment generates a federated learning model through federated learning. The coding model is used to perform feature learning and feature integration on the vector representation, and the data requester cannot interpret and obtain sample data corresponding to the vector representation without a decoder, which ensures the security of the data To prevent data leakage. The coding model does not need to add noise to the vector representation, and avoids the generation of additional interference information due to the addition of noise. The establishment of the federation model has direct feedback on the coding results, which is beneficial to optimization and adjustment. The coding model can adjust the information loss degree and the information security degree of the feature learning and feature integration of the vector representation, find the compromise point of information security and information loss, and obtain more optimized parameters of the entire federated learning model. The data requesting end does not directly obtain the data of the data providing end, which improves the security of the data in the federated learning process.
在一具体实施例中,所述联邦学习装置20还包括调整模块,用于调整所述编码器和/或所述联邦学习模型的超参数。超参数包括网络结构、神经层数、每层的神经元个数、激活函数、学习率、正则和惩罚系数、损失函数等等。具体地,当损失函数浮动不收敛时,可以调整损失函数、学习率和/或网络结构等。当出现梯度消失或梯度爆炸时,调整激活函数。In a specific embodiment, the federated learning device 20 further includes an adjustment module for adjusting the hyperparameters of the encoder and/or the federated learning model. Hyperparameters include network structure, number of neural layers, number of neurons in each layer, activation function, learning rate, regularization and penalty coefficients, loss function, and so on. Specifically, when the loss function floats and does not converge, the loss function, learning rate, and/or network structure can be adjusted. When the gradient disappears or the gradient explodes, adjust the activation function.
在一具体实施例中,所述联邦学习装置20还包括处理模块,用于从所述数据请求端获取训练后的联邦学习模型的参数;获取待处理数据;用所述训练后的联邦学习模型的参数更新本地联邦学习模型;用更新后的本地联邦学习模型处理所述待处理数据。In a specific embodiment, the federated learning device 20 further includes a processing module for obtaining the parameters of the trained federated learning model from the data requesting terminal; acquiring the data to be processed; using the trained federated learning model Update the local federated learning model with the parameters of, and process the data to be processed with the updated local federated learning model.
在一具体实施例中,所述调整模块还用于获取所述待处理数据的处理结果;获取所述待处理数据的预设结果;根据所述待处理数据的处理结果和所述待处理数据的预设结果调整所述编码模型和/或所述联邦学习模型的参数和/或超参数。In a specific embodiment, the adjustment module is further configured to obtain the processing result of the to-be-processed data; obtain the preset result of the to-be-processed data; according to the processing result of the to-be-processed data and the to-be-processed data The preset result of adjusting the parameters and/or hyperparameters of the coding model and/or the federated learning model.
具体的,可以根据所述待处理数据的处理结果和所述待处理数据的预设结果判断所述编码模型是否过度编码数据,过度编码数据可以导致所述编码模型失去提取有效特征的能力;根据判断结果对所述编码模型进行调整,以提升所述编码模型的特征提取能力,使特征提取能力和通过编码达到的数据安全相平衡。Specifically, it can be determined whether the coding model over-encodes data according to the processing result of the data to be processed and the preset result of the data to be processed. Over-encoding data may cause the encoding model to lose its ability to extract effective features; The judgment result adjusts the coding model to improve the feature extraction capability of the coding model and balance the feature extraction capability with the data security achieved through coding.
实施例三Example three
本实施例提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机可读指令,所述计算机可读存储介质可以是非易失性,也可以是易失性。该计算机可读指令被处理器执行时实现上述联邦学习方法实施例中的步骤,例如图1所示的步骤101-104:This embodiment provides a computer-readable storage medium having computer-readable instructions stored thereon. The computer-readable storage medium may be non-volatile or volatile. When the computer-readable instruction is executed by the processor, the steps in the above-mentioned federated learning method embodiment are implemented, for example, steps 101-104 shown in Fig. 1:
101,获取样本数据和所述样本数据的标识码;101. Obtain sample data and an identification code of the sample data;
102,将所述样本数据转化为向量,得到所述样本数据的向量表示;102. Convert the sample data into a vector to obtain a vector representation of the sample data.
103,对所述向量表示进行编码,得到所述样本数据的特征向量;103. Encode the vector representation to obtain a feature vector of the sample data.
104,将所述特征向量和所述标识码传输给数据请求端,使所述数据请求端根据所述标识码查找所述样本数据的标签,根据所述特征向量和所述标签进行联邦学习模型训练。104. Transmit the feature vector and the identification code to the data requesting terminal, so that the data requesting terminal searches for the label of the sample data according to the identification code, and performs a federated learning model based on the feature vector and the label training.
或者,该计算机可读指令被处理器执行时实现上述装置实施例中各模块的功能,例如图2中的模块201-204:Or, when the computer-readable instruction is executed by the processor, the function of each module in the above-mentioned device embodiment is realized, for example, the modules 201-204 in Fig. 2:
获取模块201,用于获取样本数据和所述样本数据的标识码;The obtaining module 201 is used to obtain sample data and an identification code of the sample data;
转化模块202,用于将所述样本数据转化为向量,得到所述样本数据的向量表示;The conversion module 202 is configured to convert the sample data into a vector to obtain a vector representation of the sample data;
编码模块203,用于对所述向量表示进行编码,得到所述样本数据的特征向量;The encoding module 203 is configured to encode the vector representation to obtain the feature vector of the sample data;
传输模块204,用于将所述特征向量和所述标识码传输给数据请求端,使所述数据请求端根据所述标识码查找所述样本数据的标签,根据所述特征向量和所述标签进行联邦学习模型训练。The transmission module 204 is configured to transmit the feature vector and the identification code to the data requesting terminal, so that the data requesting terminal searches for the label of the sample data according to the identification code, and according to the feature vector and the label Perform federated learning model training.
实施例四Example four
图3为本申请实施例四提供的计算机设备的示意图。所述计算机设备30包括存储器301、处理器302以及存储在所述存储器301中并可在所述处理器302上运行的计算机可读指令303,例如联邦学习程序。所述处理器302执行所述计算机可读指令303时实现上述联邦学习方法实施例中的步骤,例如图1所示的步骤101-104:FIG. 3 is a schematic diagram of the computer equipment provided in the fourth embodiment of the application. The computer device 30 includes a memory 301, a processor 302, and computer-readable instructions 303 stored in the memory 301 and running on the processor 302, such as a federated learning program. The processor 302 implements the steps in the embodiment of the federated learning method when the computer readable instruction 303 is executed, for example, steps 101-104 shown in FIG. 1:
101,获取样本数据和所述样本数据的标识码;101. Obtain sample data and an identification code of the sample data;
102,将所述样本数据转化为向量,得到所述样本数据的向量表示;102. Convert the sample data into a vector to obtain a vector representation of the sample data.
103,对所述向量表示进行编码,得到所述样本数据的特征向量;103. Encode the vector representation to obtain a feature vector of the sample data.
104,将所述特征向量和所述标识码传输给数据请求端,使所述数据请求端根据所述标识码查找所述样本数据的标签,根据所述特征向量和所述标签进行联邦学习模型训练。104. Transmit the feature vector and the identification code to the data requesting terminal, so that the data requesting terminal searches for the label of the sample data according to the identification code, and performs a federated learning model based on the feature vector and the label training.
或者,该计算机可读指令被处理器执行时实现上述装置实施例中各模块的功能,例如图2中的模块201-204:Or, when the computer-readable instruction is executed by the processor, the function of each module in the above-mentioned device embodiment is realized, for example, the modules 201-204 in FIG. 2:
获取模块201,用于获取样本数据和所述样本数据的标识码;The obtaining module 201 is used to obtain sample data and an identification code of the sample data;
转化模块202,用于将所述样本数据转化为向量,得到所述样本数据的向量表示;The conversion module 202 is configured to convert the sample data into a vector to obtain a vector representation of the sample data;
编码模块203,用于对所述向量表示进行编码,得到所述样本数据的特征向量;The encoding module 203 is configured to encode the vector representation to obtain the feature vector of the sample data;
传输模块204,用于将所述特征向量和所述标识码传输给数据请求端,使所述数据请求端根据所述标识码查找所述样本数据的标签,根据所述特征向量和所述标签进行联邦学习模型训练。The transmission module 204 is configured to transmit the feature vector and the identification code to the data requesting terminal, so that the data requesting terminal searches for the label of the sample data according to the identification code, and according to the feature vector and the label Perform federated learning model training.
示例性的,所述计算机可读指令303可以被分割成一个或多个模块,所述一个或者多个模块被存储在所述存储器301中,并由所述处理器302执行,以完成本方法。所述一个或多个模块可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述所述计算机可读指令303在所述计算机设备30中的执行过程。例如,所述计算机可读指令303可以被分割成图2中的获取模块201、转化模块202、编码模块203、传输模块204,各模块具体功能参见实施例二。Exemplarily, the computer-readable instruction 303 may be divided into one or more modules, and the one or more modules are stored in the memory 301 and executed by the processor 302 to complete the method. . The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer readable instruction 303 in the computer device 30. For example, the computer-readable instruction 303 can be divided into the acquisition module 201, the conversion module 202, the encoding module 203, and the transmission module 204 in FIG. 2. For the specific functions of each module, refer to the second embodiment.
所述计算机设备30可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。本领域技术人员可以理解,所述示意图3仅仅是计算机设备30的示例,并不构成对计算机设备30的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述计算机设备30还可以包括输入输出设备、网络接入设备、总线等。The computer device 30 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server. Those skilled in the art can understand that the schematic diagram 3 is only an example of the computer device 30, and does not constitute a limitation on the computer device 30. It may include more or less components than those shown in the figure, or combine certain components, or different components. For example, the computer device 30 may also include input and output devices, network access devices, buses, and so on.
所称处理器302可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器302也可以是任何常规的处理器等,所述处理器302是所述计算机设备30的控制中心,利用各种接口和线路连接整个计算机设备30的各个部分。The so-called processor 302 may be a central processing unit (Central Processing Unit, CPU), other general processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor 302 can also be any conventional processor, etc. The processor 302 is the control center of the computer device 30, which uses various interfaces and lines to connect the entire computer device 30. Various parts.
所述存储器301可用于存储所述计算机可读指令303,所述处理器302通过运行或执行存储在所述存储器301内的计算机可读指令或模块,以及调用存储在存储器301内的数据,实现所述计算机设备30的各种功能。所述存储器301可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据计算机设备30的使用所创建的数据等。此外,存储器301可以包括硬盘、内存、插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)、至少一个 磁盘存储器件、闪存器件、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)或其他非易失性/易失性存储器件。The memory 301 may be used to store the computer-readable instructions 303, and the processor 302 executes or executes the computer-readable instructions or modules stored in the memory 301 and calls the data stored in the memory 301 to implement Various functions of the computer device 30. The memory 301 may mainly include a storage program area and a storage data area, where the storage program area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.); the storage data area may Data and the like created in accordance with the use of the computer device 30 are stored. In addition, the memory 301 may include a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a Secure Digital (SD) card, a flash memory card (Flash Card), at least one disk storage device, flash memory Devices, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), or other non-volatile/volatile storage devices.
所述计算机设备30集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读存储介质中。所述计算机可读存储介质可以是非易失性,也可以是易失性。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一计算机可读存储介质中,该计算机可读指令在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机可读指令可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读存储介质可以包括:能够携带所述计算机可读指令的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、只读存储器(ROM)、随机存取存储器(RAM)。If the integrated module of the computer device 30 is implemented in the form of a software function module and sold or used as an independent product, it may be stored in a computer-readable storage medium. The computer-readable storage medium may be non-volatile or volatile. Based on this understanding, this application implements all or part of the processes in the above-mentioned embodiments and methods, and can also be completed by instructing relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. Here, when the computer-readable instruction is executed by the processor, it can implement the steps of the foregoing method embodiments. Wherein, the computer-readable instructions may be in the form of source code, object code, executable file, or some intermediate forms, etc. The computer-readable storage medium may include: any entity or device capable of carrying the computer-readable instructions, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, read only memory (ROM), random access memory ( RAM).
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the several embodiments provided in this application, it should be understood that the disclosed system, device, and method can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。In addition, the functional modules in the various embodiments of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware, or in the form of hardware plus software functional modules.
上述以软件功能模块的形式实现的集成的模块,可以存储在一个计算机可读存储介质中。上述软件功能模块存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施例所述联邦学习方法的部分步骤。The above-mentioned integrated modules implemented in the form of software functional modules may be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium and includes several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor execute the federated learning described in each embodiment of this application. Part of the method.
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附关联图标记视为限制所涉及的权利要求。此外,显然“包括”一词不排除其他模块或步骤,单数不排除复数。系统权利要求中陈述的多个模块或装置也可以由一个模块或装置通过软件或者硬件来实现。第一,第二等词语用来表示名称,而并不表示任何特定的顺序。For those skilled in the art, it is obvious that the present application is not limited to the details of the foregoing exemplary embodiments, and the present application can be implemented in other specific forms without departing from the spirit or basic characteristics of the application. Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-limiting. The scope of this application is defined by the appended claims rather than the above description, and therefore it is intended to fall into the claims. All changes in the meaning and scope of the equivalent elements of are included in this application. Any associated diagram marks in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "including" does not exclude other modules or steps, and the singular does not exclude the plural. Multiple modules or devices stated in the system claims can also be implemented by one module or device through software or hardware. Words such as first and second are used to denote names, but do not denote any specific order.
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the application and not to limit them. Although the application has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the application can be Make modifications or equivalent replacements without departing from the spirit and scope of the technical solution of the present application.

Claims (20)

  1. 一种联邦学习方法,所述联邦学习方法包括:A federated learning method, the federated learning method includes:
    获取样本数据和所述样本数据的标识码;Acquiring sample data and an identification code of the sample data;
    将所述样本数据转化为向量,得到所述样本数据的向量表示;Converting the sample data into a vector to obtain a vector representation of the sample data;
    对所述向量表示进行编码,得到所述样本数据的特征向量;Encoding the vector representation to obtain the feature vector of the sample data;
    将所述特征向量和所述标识码传输给数据请求端,使所述数据请求端根据所述标识码查找所述样本数据的标签,根据所述特征向量和所述标签进行联邦学习模型训练。The feature vector and the identification code are transmitted to the data requesting terminal, so that the data requesting terminal searches for the label of the sample data according to the identification code, and performs federated learning model training according to the feature vector and the label.
  2. 如权利要求1所述的联邦学习方法,其中,所述将所述样本数据转化为向量包括:The federated learning method according to claim 1, wherein said converting said sample data into a vector comprises:
    获取所述样本数据的数据类型;Acquiring the data type of the sample data;
    根据所述样本数据的数据类型判断所述样本数据是否需要转化为向量;Judging whether the sample data needs to be converted into a vector according to the data type of the sample data;
    如果根据所述样本数据的数据类型判断所述样本数据需要转化为向量,根据所述样本数据的数据类型对应的预设转化方法将所述样本数据转化为向量。If it is determined according to the data type of the sample data that the sample data needs to be converted into a vector, the sample data is converted into a vector according to a preset conversion method corresponding to the data type of the sample data.
  3. 如权利要求1所述的联邦学习方法,其中,所述对所述向量表示进行编码包括:5. The federated learning method according to claim 1, wherein said encoding said vector representation comprises:
    获取样本向量;Get sample vector;
    根据所述样本向量通过反向传播算法训练编码模型,所述编码模型由编码器和解码器构成;Training an encoding model through a backpropagation algorithm according to the sample vector, the encoding model consisting of an encoder and a decoder;
    用训练后的编码器对所述向量表示进行编码。The vector representation is encoded with the trained encoder.
  4. 如权利要求1所述的联邦学习方法,其中,所述将所述特征向量和所述标识码传输给数据请求端包括:The federated learning method according to claim 1, wherein said transmitting said feature vector and said identification code to a data requesting terminal comprises:
    通过加密算法将所述特征向量和所述标识码传输给所述数据请求端。The feature vector and the identification code are transmitted to the data requesting end through an encryption algorithm.
  5. 如权利要求1所述的联邦学习方法,其中,所述根据所述特征向量和所述标签进行联邦学习模型训练包括:The federated learning method according to claim 1, wherein the training of the federated learning model according to the feature vector and the label comprises:
    所述数据请求端从预设服务端获取所述联邦学习模型的初始参数;The data requesting terminal obtains the initial parameters of the federated learning model from a preset server;
    所述数据请求端用所述初始参数初始化所述联邦学习模型;The data requesting terminal initializes the federated learning model with the initial parameters;
    所述数据请求端根据所述特征向量和所述标签对初始化的联邦学习模型进行本地训练,更新所述初始化的联邦学习模型的参数,得到更新后的参数;The data requesting terminal locally trains the initialized federated learning model according to the feature vector and the label, updates the parameters of the initialized federated learning model, and obtains the updated parameters;
    所述数据请求端将所述更新后的参数上传至所述预设服务端,使所述预设服务端对各个请求端上传的参数进行聚合处理,得到聚合参数,当检测到用所述聚合参数更新的联邦学习模型为收敛状态时,将更新后的联邦学习模型下发给所述数据请求端;The data requesting end uploads the updated parameters to the preset server, so that the preset server performs aggregation processing on the parameters uploaded by each requesting end to obtain aggregation parameters, and when it is detected that the aggregation is used When the parameter-updated federated learning model is in a convergent state, deliver the updated federated learning model to the data requester;
    所述数据请求端接收所述预设服务端下发的联邦学习模型。The data requesting terminal receives the federated learning model issued by the preset server.
  6. 如权利要求1-5中任一项所述联邦学习方法,其中,所述联邦学习方法还包括:5. The federated learning method according to any one of claims 1 to 5, wherein the federated learning method further comprises:
    通过稀疏编码方法对所述训练后的编码模型进行优化。The sparse coding method is used to optimize the trained coding model.
  7. 如权利要求1-5中任一项所述联邦学习方法,其中,所述联邦学习方法还包括:5. The federated learning method according to any one of claims 1 to 5, wherein the federated learning method further comprises:
    获取所述待处理数据的处理结果;Acquiring the processing result of the to-be-processed data;
    获取所述待处理数据的预设结果;Obtaining the preset result of the to-be-processed data;
    根据所述待处理数据的处理结果和所述待处理数据的预设结果调整所述编码模型和/或所述联邦学习模型的参数和/或超参数。The parameters and/or hyperparameters of the coding model and/or the federated learning model are adjusted according to the processing result of the to-be-processed data and the preset result of the to-be-processed data.
  8. 一种联邦学习装置,其中,所述联邦学习装置包括:A federated learning device, wherein the federated learning device includes:
    获取模块,用于获取样本数据和所述样本数据的标识码;An obtaining module, used to obtain sample data and an identification code of the sample data;
    转化模块,用于将所述样本数据转化为向量,得到所述样本数据的向量表示;A conversion module, configured to convert the sample data into a vector to obtain a vector representation of the sample data;
    编码模块,用于对所述向量表示进行编码,得到所述样本数据的特征向量;An encoding module, configured to encode the vector representation to obtain the feature vector of the sample data;
    传输模块,用于将所述特征向量和所述标识码传输给数据请求端,使所述数据请求端根据所述标识码查找所述样本数据的标签,根据所述特征向量和所述标签进行联邦学 习模型训练。The transmission module is configured to transmit the feature vector and the identification code to the data requesting terminal, so that the data requesting terminal searches for the label of the sample data according to the identification code, and performs processing according to the feature vector and the label Federation learning model training.
  9. 一种计算机设备,其中,所述计算机设备包括处理器,所述处理器用于执行存储器中存储的计算机可读指令以实现以下步骤:A computer device, wherein the computer device includes a processor, and the processor is configured to execute computer-readable instructions stored in a memory to implement the following steps:
    获取样本数据和所述样本数据的标识码;Acquiring sample data and an identification code of the sample data;
    将所述样本数据转化为向量,得到所述样本数据的向量表示;Converting the sample data into a vector to obtain a vector representation of the sample data;
    对所述向量表示进行编码,得到所述样本数据的特征向量;Encoding the vector representation to obtain the feature vector of the sample data;
    将所述特征向量和所述标识码传输给数据请求端,使所述数据请求端根据所述标识码查找所述样本数据的标签,根据所述特征向量和所述标签进行联邦学习模型训练。The feature vector and the identification code are transmitted to the data requesting terminal, so that the data requesting terminal searches for the label of the sample data according to the identification code, and performs federated learning model training according to the feature vector and the label.
  10. 如权利要求9所述的计算机设备,其中,所述处理器执行所述存储器中存储的计算机可读指令以实现所述将所述样本数据转化为向量时,包括:9. The computer device according to claim 9, wherein when the processor executes the computer-readable instructions stored in the memory to implement the conversion of the sample data into a vector, the method comprises:
    获取所述样本数据的数据类型;Acquiring the data type of the sample data;
    根据所述样本数据的数据类型判断所述样本数据是否需要转化为向量;Judging whether the sample data needs to be converted into a vector according to the data type of the sample data;
    如果根据所述样本数据的数据类型判断所述样本数据需要转化为向量,根据所述样本数据的数据类型对应的预设转化方法将所述样本数据转化为向量。If it is determined according to the data type of the sample data that the sample data needs to be converted into a vector, the sample data is converted into a vector according to a preset conversion method corresponding to the data type of the sample data.
  11. 如权利要求9所述的计算机设备,其中,所述处理器执行所述存储器中存储的计算机可读指令以实现所述对所述向量表示进行编码时,包括:9. The computer device according to claim 9, wherein, when the processor executes the computer-readable instructions stored in the memory to implement the encoding of the vector representation, it comprises:
    获取样本向量;Get sample vector;
    根据所述样本向量通过反向传播算法训练编码模型,所述编码模型由编码器和解码器构成;Training an encoding model through a backpropagation algorithm according to the sample vector, the encoding model consisting of an encoder and a decoder;
    用训练后的编码器对所述向量表示进行编码。The vector representation is encoded with the trained encoder.
  12. 如权利要求9所述的计算机设备,其中,所述处理器执行所述存储器中存储的计算机可读指令以实现所述将所述特征向量和所述标识码传输给数据请求端时,包括:9. The computer device according to claim 9, wherein, when the processor executes the computer-readable instructions stored in the memory to implement the transmission of the feature vector and the identification code to the data requesting terminal, comprising:
    通过加密算法将所述特征向量和所述标识码传输给所述数据请求端。The feature vector and the identification code are transmitted to the data requesting end through an encryption algorithm.
  13. 如权利要求9所述的计算机设备,其中,所述处理器执行所述存储器中存储的计算机可读指令以实现所述根据所述特征向量和所述标签进行联邦学习模型训练时,包括:9. The computer device according to claim 9, wherein when the processor executes the computer-readable instructions stored in the memory to implement the training of the federated learning model according to the feature vector and the label, it comprises:
    所述数据请求端从预设服务端获取所述联邦学习模型的初始参数;The data requesting terminal obtains the initial parameters of the federated learning model from a preset server;
    所述数据请求端用所述初始参数初始化所述联邦学习模型;The data requesting terminal initializes the federated learning model with the initial parameters;
    所述数据请求端根据所述特征向量和所述标签对初始化的联邦学习模型进行本地训练,更新所述初始化的联邦学习模型的参数,得到更新后的参数;The data requesting terminal locally trains the initialized federated learning model according to the feature vector and the label, updates the parameters of the initialized federated learning model, and obtains the updated parameters;
    所述数据请求端将所述更新后的参数上传至所述预设服务端,使所述预设服务端对各个请求端上传的参数进行聚合处理,得到聚合参数,当检测到用所述聚合参数更新的联邦学习模型为收敛状态时,将更新后的联邦学习模型下发给所述数据请求端;The data requesting end uploads the updated parameters to the preset server, so that the preset server performs aggregation processing on the parameters uploaded by each requesting end to obtain aggregation parameters, and when it is detected that the aggregation is used When the parameter-updated federated learning model is in a convergent state, deliver the updated federated learning model to the data requester;
    所述数据请求端接收所述预设服务端下发的联邦学习模型。The data requesting terminal receives the federated learning model issued by the preset server.
  14. 如权利要求9-13中任一项所述的计算机设备,其中,所述处理器执行所述存储器中存储的计算机可读指令还用以实现以下步骤:The computer device according to any one of claims 9-13, wherein the processor executing the computer-readable instructions stored in the memory is further configured to implement the following steps:
    通过稀疏编码方法对所述训练后的编码模型进行优化。The sparse coding method is used to optimize the trained coding model.
  15. 如权利要求9-13中任一项所述的计算机设备,其中,所述处理器执行所述存储器中存储的计算机可读指令还用以实现以下步骤:The computer device according to any one of claims 9-13, wherein the processor executing the computer-readable instructions stored in the memory is further configured to implement the following steps:
    获取所述待处理数据的处理结果;Acquiring the processing result of the to-be-processed data;
    获取所述待处理数据的预设结果;Obtaining the preset result of the to-be-processed data;
    根据所述待处理数据的处理结果和所述待处理数据的预设结果调整所述编码模型和/或所述联邦学习模型的参数和/或超参数。The parameters and/or hyperparameters of the coding model and/or the federated learning model are adjusted according to the processing result of the to-be-processed data and the preset result of the to-be-processed data.
  16. 一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机可读指令,其中,所述计算机可读指令被处理器执行时实现以下步骤:A computer-readable storage medium having computer-readable instructions stored thereon, wherein the computer-readable instructions implement the following steps when executed by a processor:
    获取样本数据和所述样本数据的标识码;Acquiring sample data and an identification code of the sample data;
    将所述样本数据转化为向量,得到所述样本数据的向量表示;Converting the sample data into a vector to obtain a vector representation of the sample data;
    对所述向量表示进行编码,得到所述样本数据的特征向量;Encoding the vector representation to obtain the feature vector of the sample data;
    将所述特征向量和所述标识码传输给数据请求端,使所述数据请求端根据所述标识码查找所述样本数据的标签,根据所述特征向量和所述标签进行联邦学习模型训练。The feature vector and the identification code are transmitted to the data requesting terminal, so that the data requesting terminal searches for the label of the sample data according to the identification code, and performs federated learning model training according to the feature vector and the label.
  17. 如权利要求16所述的存储介质,其中,所述计算机可读指令被所述处理器执行以实现所述将所述样本数据转化为向量时,包括:The storage medium according to claim 16, wherein, when the computer-readable instructions are executed by the processor to implement the conversion of the sample data into a vector, it comprises:
    获取所述样本数据的数据类型;Acquiring the data type of the sample data;
    根据所述样本数据的数据类型判断所述样本数据是否需要转化为向量;Judging whether the sample data needs to be converted into a vector according to the data type of the sample data;
    如果根据所述样本数据的数据类型判断所述样本数据需要转化为向量,根据所述样本数据的数据类型对应的预设转化方法将所述样本数据转化为向量。If it is determined according to the data type of the sample data that the sample data needs to be converted into a vector, the sample data is converted into a vector according to a preset conversion method corresponding to the data type of the sample data.
  18. 如权利要求16所述的存储介质,其中,所述计算机可读指令被所述处理器执行以实现所述对所述向量表示进行编码时,包括:15. The storage medium of claim 16, wherein, when the computer-readable instructions are executed by the processor to implement the encoding of the vector representation, the instructions include:
    获取样本向量;Get sample vector;
    根据所述样本向量通过反向传播算法训练编码模型,所述编码模型由编码器和解码器构成;Training an encoding model through a backpropagation algorithm according to the sample vector, the encoding model consisting of an encoder and a decoder;
    用训练后的编码器对所述向量表示进行编码。The vector representation is encoded with the trained encoder.
  19. 如权利要求16所述的存储介质,其中,所述计算机可读指令被所述处理器执行以实现所述将所述特征向量和所述标识码传输给数据请求端时,包括:15. The storage medium according to claim 16, wherein, when the computer-readable instructions are executed by the processor to implement the transmission of the feature vector and the identification code to the data requesting terminal, comprising:
    通过加密算法将所述特征向量和所述标识码传输给所述数据请求端。The feature vector and the identification code are transmitted to the data requesting end through an encryption algorithm.
  20. 如权利要求16所述的存储介质,其中,所述计算机可读指令被所述处理器执行以实现所述根据所述特征向量和所述标签进行联邦学习模型训练时,包括:15. The storage medium of claim 16, wherein, when the computer-readable instructions are executed by the processor to implement the training of the federated learning model according to the feature vector and the label, it comprises:
    所述数据请求端从预设服务端获取所述联邦学习模型的初始参数;The data requesting terminal obtains the initial parameters of the federated learning model from a preset server;
    所述数据请求端用所述初始参数初始化所述联邦学习模型;The data requesting terminal initializes the federated learning model with the initial parameters;
    所述数据请求端根据所述特征向量和所述标签对初始化的联邦学习模型进行本地训练,更新所述初始化的联邦学习模型的参数,得到更新后的参数;The data requesting terminal locally trains the initialized federated learning model according to the feature vector and the label, updates the parameters of the initialized federated learning model, and obtains the updated parameters;
    所述数据请求端将所述更新后的参数上传至所述预设服务端,使所述预设服务端对各个请求端上传的参数进行聚合处理,得到聚合参数,当检测到用所述聚合参数更新的联邦学习模型为收敛状态时,将更新后的联邦学习模型下发给所述数据请求端;The data requesting end uploads the updated parameters to the preset server, so that the preset server performs aggregation processing on the parameters uploaded by each requesting end to obtain aggregation parameters, and when it is detected that the aggregation is used When the parameter-updated federated learning model is in a convergent state, deliver the updated federated learning model to the data requester;
    所述数据请求端接收所述预设服务端下发的联邦学习模型。The data requesting terminal receives the federated learning model issued by the preset server.
PCT/CN2020/098890 2020-05-14 2020-06-29 Federated learning method and apparatus, computer device, and readable storage medium WO2021114618A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010408557.4 2020-05-14
CN202010408557.4A CN111695674B (en) 2020-05-14 2020-05-14 Federal learning method, federal learning device, federal learning computer device, and federal learning computer readable storage medium

Publications (1)

Publication Number Publication Date
WO2021114618A1 true WO2021114618A1 (en) 2021-06-17

Family

ID=72477764

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/098890 WO2021114618A1 (en) 2020-05-14 2020-06-29 Federated learning method and apparatus, computer device, and readable storage medium

Country Status (2)

Country Link
CN (1) CN111695674B (en)
WO (1) WO2021114618A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113781397A (en) * 2021-08-11 2021-12-10 中国科学院信息工程研究所 Medical image lesion detection modeling method, device and system based on federal learning
CN114154392A (en) * 2021-10-15 2022-03-08 海南火链科技有限公司 Model co-construction method, device and equipment based on block chain and federal learning
CN114648130A (en) * 2022-02-07 2022-06-21 北京航空航天大学 Longitudinal federal learning method and device, electronic equipment and storage medium
CN114996317A (en) * 2022-07-05 2022-09-02 中国电信股份有限公司 Asynchronous optimization method and device based on longitudinal federal learning and storage medium
CN117424765A (en) * 2023-12-19 2024-01-19 天津医康互联科技有限公司 Distributed single-heat encoding method, device, electronic equipment and computer storage medium

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112364919A (en) * 2020-11-11 2021-02-12 深圳前海微众银行股份有限公司 Data processing method, device, equipment and storage medium
CN112463161B (en) * 2020-11-27 2023-07-28 平安科技(深圳)有限公司 Code annotation generation method, system and device based on federal learning
CN112396189B (en) * 2020-11-27 2023-09-01 中国银联股份有限公司 Method and device for constructing federal learning model by multiple parties
CN113239351B (en) * 2020-12-08 2022-05-13 武汉大学 Novel data pollution attack defense method for Internet of things system
CN113283185B (en) * 2021-07-23 2021-11-12 平安科技(深圳)有限公司 Federal model training and client imaging method, device, equipment and medium
CN113722987B (en) * 2021-08-16 2023-11-03 京东科技控股股份有限公司 Training method and device of federal learning model, electronic equipment and storage medium
CN114357521A (en) * 2022-01-12 2022-04-15 平安科技(深圳)有限公司 Data protection method and system
CN114710415B (en) * 2022-05-23 2022-08-12 北京理工大学 Redundant coded passive message reliable transmission and processing system
CN115034816A (en) * 2022-06-07 2022-09-09 青岛文达通科技股份有限公司 Demand prediction method and system based on unsupervised and federal learning
CN115495541B (en) * 2022-11-18 2023-04-07 深译信息科技(珠海)有限公司 Corpus database, corpus database maintenance method, apparatus, device and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110297848A (en) * 2019-07-09 2019-10-01 深圳前海微众银行股份有限公司 Recommended models training method, terminal and storage medium based on federation's study
CN110738323A (en) * 2018-07-03 2020-01-31 百度在线网络技术(北京)有限公司 Method and device for establishing machine learning model based on data sharing
CN110807207A (en) * 2019-10-30 2020-02-18 腾讯科技(深圳)有限公司 Data processing method and device, electronic equipment and storage medium
CN111027715A (en) * 2019-12-11 2020-04-17 支付宝(杭州)信息技术有限公司 Monte Carlo-based federated learning model training method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014008403A1 (en) * 2012-07-03 2014-01-09 Visa International Service Association Data protection hub

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110738323A (en) * 2018-07-03 2020-01-31 百度在线网络技术(北京)有限公司 Method and device for establishing machine learning model based on data sharing
CN110297848A (en) * 2019-07-09 2019-10-01 深圳前海微众银行股份有限公司 Recommended models training method, terminal and storage medium based on federation's study
CN110807207A (en) * 2019-10-30 2020-02-18 腾讯科技(深圳)有限公司 Data processing method and device, electronic equipment and storage medium
CN111027715A (en) * 2019-12-11 2020-04-17 支付宝(杭州)信息技术有限公司 Monte Carlo-based federated learning model training method and device

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113781397A (en) * 2021-08-11 2021-12-10 中国科学院信息工程研究所 Medical image lesion detection modeling method, device and system based on federal learning
CN113781397B (en) * 2021-08-11 2023-11-21 中国科学院信息工程研究所 Medical image focus detection modeling method, device and system based on federal learning
CN114154392A (en) * 2021-10-15 2022-03-08 海南火链科技有限公司 Model co-construction method, device and equipment based on block chain and federal learning
CN114648130A (en) * 2022-02-07 2022-06-21 北京航空航天大学 Longitudinal federal learning method and device, electronic equipment and storage medium
CN114648130B (en) * 2022-02-07 2024-04-16 北京航空航天大学 Longitudinal federal learning method, device, electronic equipment and storage medium
CN114996317A (en) * 2022-07-05 2022-09-02 中国电信股份有限公司 Asynchronous optimization method and device based on longitudinal federal learning and storage medium
CN114996317B (en) * 2022-07-05 2024-02-23 中国电信股份有限公司 Asynchronous optimization method and device based on longitudinal federal learning and storage medium
CN117424765A (en) * 2023-12-19 2024-01-19 天津医康互联科技有限公司 Distributed single-heat encoding method, device, electronic equipment and computer storage medium
CN117424765B (en) * 2023-12-19 2024-03-22 天津医康互联科技有限公司 Distributed single-heat encoding method, device, electronic equipment and computer storage medium

Also Published As

Publication number Publication date
CN111695674B (en) 2024-04-09
CN111695674A (en) 2020-09-22

Similar Documents

Publication Publication Date Title
WO2021114618A1 (en) Federated learning method and apparatus, computer device, and readable storage medium
He et al. Neural factorization machines for sparse predictive analytics
WO2022089256A1 (en) Method, apparatus and device for training federated neural network model, and computer program product and computer-readable storage medium
Younus et al. Video steganography using knight tour algorithm and LSB method for encrypted data
WO2021114616A1 (en) Federated learning model training method and related device
CA3059610A1 (en) Secure multi-party computation with no trusted initializer
US8918382B1 (en) Learning common spelling errors through content matching
WO2021218069A1 (en) Dynamic scenario configuration-based interactive processing method and apparatus, and computer device
CN113535825A (en) Cloud computing intelligence-based data information wind control processing method and system
WO2021196474A1 (en) User interest profiling method and related device
Aparna et al. A blind medical image watermarking for secure E-healthcare application using crypto-watermarking system
CN116645668B (en) Image generation method, device, equipment and storage medium
JP2024028960A (en) Interpretable tabular data learning using sequential sparse attention
WO2022076826A1 (en) Privacy preserving machine learning via gradient boosting
US10902215B1 (en) Social hash for language models
US20200320343A1 (en) Method for automatically identifying signals or patterns in time series data by treating series as image
CN116127049A (en) Model training method, text generation method, terminal device and computer medium
US20230186353A1 (en) System for intelligent assessment models for non-fungible electronic resources
KR102254097B1 (en) Intelligent network arranging system and method for providing a legal content
US11954676B1 (en) Apparatus and method for minting NFTs from user-specific events
US20230334161A1 (en) System and method for providing complex data encryption
US11526550B2 (en) System for building data communications using data extracted via frequency-based data extraction technique
US20240054141A1 (en) Authoritative Factual Service for Blockchain Smart Contracts
US20230316592A1 (en) Method and system for automated generation of representative icons from images
CN116975435A (en) Method, device, computer equipment and storage medium for media delivery

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: 20898489

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20898489

Country of ref document: EP

Kind code of ref document: A1