CN111695674B - Federal learning method, federal learning device, federal learning computer device, and federal learning computer readable storage medium - Google Patents

Federal learning method, federal learning device, federal learning computer device, and federal learning computer readable storage medium Download PDF

Info

Publication number
CN111695674B
CN111695674B CN202010408557.4A CN202010408557A CN111695674B CN 111695674 B CN111695674 B CN 111695674B CN 202010408557 A CN202010408557 A CN 202010408557A CN 111695674 B CN111695674 B CN 111695674B
Authority
CN
China
Prior art keywords
data
federal learning
sample data
vector
learning model
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202010408557.4A
Other languages
Chinese (zh)
Other versions
CN111695674A (en
Inventor
周学立
朱恩东
张茜
刘丽扬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202010408557.4A priority Critical patent/CN111695674B/en
Priority to PCT/CN2020/098890 priority patent/WO2021114618A1/en
Publication of CN111695674A publication Critical patent/CN111695674A/en
Application granted granted Critical
Publication of CN111695674B publication Critical patent/CN111695674B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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

Abstract

The invention relates to artificial intelligence and provides a federal learning method, a federal learning device, computer equipment and a computer readable storage medium. The federal learning method obtains 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 a feature vector of the sample data; transmitting the feature vector and the identification code to a data request terminal, enabling the data request terminal to search a label of the sample data according to the identification code, and training a federal learning model according to the feature vector and the label. The invention improves the safety of data in the federal learning process.

Description

Federal learning method, federal learning device, federal learning computer device, and federal learning computer readable storage medium
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a federal learning method, a federal learning device, computer equipment and a computer readable storage medium.
Background
With the development of artificial intelligence technology, machine learning modeling by combining different participants (or party, also called data owners (data owners), or clients) has become a trend, i.e., federal learning.
In federal learning, how to ensure the safety of data while avoiding data distortion becomes a problem to be solved.
Disclosure of Invention
In view of the foregoing, there is a need for a federal learning method, apparatus, computer device, and computer-readable storage medium that can generate a federal learning model through federal learning.
A first aspect of the present application provides a federal learning method comprising:
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 a feature vector of the sample data;
transmitting the feature vector and the identification code to a data request terminal, enabling the data request terminal to search a label of the sample data according to the identification code, and training a federal learning model according to the feature vector and the label.
In another possible implementation manner, the converting the sample data into a vector includes:
acquiring the data type of the sample data;
judging whether the sample data need to be converted into vectors according to the data type of the sample data;
if the sample data is judged to be converted into a vector according to the data type of the sample data, the sample data is converted into the vector according to a preset conversion method corresponding to the data type of the sample data.
In another possible implementation, the encoding the vector representation includes:
obtaining a sample vector;
training a coding model by a back propagation algorithm according to the sample vector, wherein the coding model is composed of an encoder and a decoder;
the vector representation is encoded with a trained encoder.
In another possible implementation manner, the transmitting the feature vector and the identification code to the data request end includes:
and transmitting the feature vector and the identification code to the data request end through an encryption algorithm.
In another possible implementation manner, the training of the federal learning model according to the feature vector and the tag includes:
the data request end obtains initial parameters of the federal learning model from a preset server end;
the data request end initializes the federal learning model by using the initial parameters;
the data request end carries out local training on the initialized federal learning model according to the feature vector and the label, and updates parameters of the initialized federal learning model to obtain updated parameters;
the data request terminal uploads the updated parameters to the preset service terminal, so that the preset service terminal aggregates the parameters uploaded by each request terminal to obtain aggregated parameters, and when the federal learning model updated by the aggregated parameters is detected to be in a convergence state, the updated federal learning model is issued to the data request terminal;
and the data request terminal receives the federal learning model issued by the preset server terminal.
In another possible implementation manner, the federal learning method further includes:
and optimizing the trained coding model by a sparse coding method.
In another possible implementation manner, the federal learning method further includes:
obtaining a processing result of the data to be processed;
acquiring a preset result of the data to be processed;
and adjusting parameters and/or super parameters of the coding model and/or the federal learning model according to the processing result of the data to be processed and the preset result of the data to be processed.
A second aspect of the present application provides a federal learning apparatus, the federal learning apparatus comprising:
the acquisition module is used for acquiring sample data and identification codes of the sample data;
the conversion module is used for converting the sample data into vectors to obtain vector representations of the sample data;
the encoding module is used for encoding the vector representation to obtain a characteristic vector of the sample data;
and the transmission module is used for transmitting the feature vector and the identification code to a data request terminal, so that the data request terminal searches the label of the sample data according to the identification code, and performs federal learning model training according to the feature vector and the label.
A third aspect of the present application provides a computer device comprising a processor for implementing the federal learning method when executing a computer program stored in a memory.
A fourth aspect of the present application provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements the federal learning method.
In the invention, the coding model is used for carrying out feature learning and feature integration on the vector representation. The data request terminal cannot interpret and obtain the sample data corresponding to the vector representation under the condition that a decoder is not arranged, so that the data security is ensured. The data request end does not directly obtain the data of the data providing end, so that the safety of the data in the federal learning process is improved
Drawings
FIG. 1 is a flow chart of a federal learning method provided by an embodiment of the present invention.
Fig. 2 is a block diagram of a federal learning device according to an embodiment of the present invention.
Fig. 3 is a schematic diagram of a computer device according to an embodiment of the present invention.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will be more clearly understood, a more particular description of the invention will be rendered by reference to specific embodiments thereof which are illustrated in the appended drawings. It should be noted that, in the case of no conflict, the embodiments of the present application and the features in the embodiments may be combined with each other.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, and the described embodiments are merely some, rather than all, embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
Preferably, the federal learning method of the present invention is employed in one or more computer devices. The computer device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and its hardware includes, but is not limited to, a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a programmable gate array (Field-Programmable Gate Array, FPGA), a digital processor (Digital Signal Processor, DSP), an embedded device, and the like.
The computer equipment can be a desktop computer, a notebook computer, a palm computer, a cloud server and other computing equipment. The computer equipment can perform man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch pad or voice control equipment and the like.
Example 1
Fig. 1 is a flowchart of a federal learning method according to an embodiment of the present invention. The federation learning method is applied to a data providing end, wherein the data providing end is computer equipment and is used for generating a federation learning model through federation learning.
As shown in fig. 1, the federal learning method includes:
101, sample data and an identification code of the sample data are acquired.
The identification code is unique identification information of the sample data and is used for identifying the sample data between the data providing end and a third party requesting the data.
The sample data may include different data types such as text-like data, one-hot data, numeric data, and ebadd data.
For example, the data provider may be a finance company, the third party requesting data may be an insurance company, the sample data may be user behavior data of the finance company, and the data type of the sample data may be text-type data. The identification code can be a mobile phone number or an identity card number of the user corresponding to the user behavior data. The insurance company needs to acquire the encoded user behavior data of the finance company, and reliability scoring is carried out on the user according to the acquired encoded user behavior data through an insurance reliability scoring model. That is, the insurance company does not need to directly obtain the user behavior data of the finance company, so that the data security of the finance company is protected. The insurance reliability scoring model may be a specific federal learning model and the federal learning model local to the insurance company may be a deep learning model.
For another example, the data providing end may be an e-commerce company, the third party requesting data may be an advertisement company, the sample data may be commodity click behavior data of the e-commerce company, and the data type of the sample data may be numerical data. The identification code can be a mobile phone number or an identity card number of the user corresponding to the commodity clicking behavior data. The advertisement company needs to acquire the coded commodity clicking behavior data of the electronic commerce company, and recommends commodities to the user according to the acquired coded commodity clicking behavior data through a commodity recommendation model. Namely, the advertisement company does not need to directly acquire commodity clicking behavior data of the electronic commerce company, so that the data security of the electronic commerce company is protected. The commodity recommendation model may be a specific federal learning model and the federal learning model local to the advertising company may be a deep learning model.
And 102, converting the sample data into vectors to obtain vector representations 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 need to be converted into vectors according to the data type of the sample data;
if the sample data is judged to be converted into a vector according to the data type of the sample data, the sample data is converted into the vector according to a preset conversion method corresponding to the data type of the sample data.
For example, if the data type of the sample data is text class data (the preset conversion method corresponding to the text class data is a 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 numerical data (a preset conversion method corresponding to the numerical class data is a standardized method), the sample data is converted into a vector according to the standardized method.
Further, the determining whether the sample data needs to be converted into a vector according to the data type of the sample data includes:
acquiring a data type table 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. The data to be converted is a vector at this time, and conversion is not required.
103, encoding the vector representation to obtain a feature vector of the sample data.
In a specific embodiment, the encoding the vector representation includes:
obtaining a sample vector;
training a coding model by a back propagation algorithm according to the sample vector, wherein the coding model is composed of an encoder and a decoder;
the vector representation is encoded with a trained encoder.
In order to ensure the safety of the sample data, the data providing end cannot directly request the sample data to a third party of the data.
In a specific embodiment, the trained coding model is optimized by a Deep auto-encoder or sparse encoding method.
And optimizing the trained coding model by a sparse coding method according to the difference value between the output and the input of the trained coding model. The sparse coding method is mainly characterized in that the trained coding model is optimized by adding sparsity limiting conditions to nerve units in the trained coding model.
Specifically, the sparsity constraint may include activating a neuron when its output approaches 1 (e.g., greater than 0.9); when the output value of the neuron approaches 0 (e.g., less than or equal to 0.9), the neuron is not activated.
The coding model is used for carrying out feature learning and feature integration on the vector representation. The data request terminal cannot interpret and obtain the sample data corresponding to the vector representation under the condition that a decoder is not arranged, so that the data security is ensured.
104, transmitting the feature vector and the identification code to a data request terminal, so that the data request terminal searches a label of the sample data according to the identification code, and training a federal learning model according to the feature vector and the label.
The federal learning model includes: LR, XGB, DNN, etc. The LR, XGB, DNN and other models are used for machine learning training, so as to achieve the algorithm model for the purpose of service use. The federal learning model may be a specific artificial intelligence model, such as an artificial intelligence classification model, an artificial intelligence recognition model, or the like.
In a specific embodiment, said transmitting said feature vector and said identification code to a data request terminal comprises:
and transmitting the feature vector and the identification code to the data request end through an encryption algorithm.
Encrypting the feature vector and the identification code, for example, by a private key of the data provider; and transmitting the encrypted feature vector and the identification code to the data request terminal, so that the data request terminal decrypts the encrypted feature vector and the identification code through the public key of the data providing terminal.
When the sample data is user behavior data, the labels of the sample data are "risk users", "normal users". When the sample data is commodity clicking behavior data, the labels of the sample data are recommended commodity I, recommended commodity II and the like.
In a specific embodiment, the training of the federal learning model according to the feature vector and the tag includes:
the data request end obtains initial parameters of the federal learning model from a preset server end;
the data request end initializes the federal learning model by using the initial parameters;
the data request end carries out local training on the initialized federal learning model according to the feature vector and the label, and updates parameters of the initialized federal learning model to obtain updated parameters;
the data request terminal uploads the updated parameters to the preset service terminal, so that the preset service terminal aggregates the parameters uploaded by each request terminal to obtain aggregated parameters, and when the federal learning model updated by the aggregated parameters is detected to be in a convergence state, the updated federal learning model is issued to the data request terminal;
and the data request terminal receives the federal learning model issued by the preset server terminal.
In another embodiment, before the updated federal learning model is issued to the data request end, when the preset server end detects that the federal learning model updated by the aggregation parameter is in a non-convergence state, the preset server end returns the aggregation parameter to the data request end, so that the data request end continues to iterate training.
Embodiment one a federal learning model is generated by federal learning. The coding model is used for carrying out feature learning and feature integration on the vector representation, and the data request terminal cannot interpret and obtain sample data corresponding to the vector representation under the condition that a decoder is not arranged, so that the safety of the data is ensured, and the data leakage is prevented. The coding model does not add noise to the vector representation, avoiding additional interference information due to the added noise. The establishment of the federal model has direct feedback on the coding result, thereby being beneficial to optimization and adjustment. The coding model can be used for adjusting the information loss degree and the information safety degree of feature learning and feature integration on the vector representation, finding out benefit points of information safety and information loss, and obtaining more optimized parameters of the whole federal learning model. The data request end does not directly obtain the data of the data providing end, so that the safety of the data in the federal learning process is improved.
In a specific embodiment, the federal learning method further comprises:
adjusting hyper-parameters of the encoder and/or the federal learning model. Super parameters include network structure, number of neural layers, number of neurons per layer, activation function, learning rate, regularization and penalty coefficients, loss function, and the like. In particular, when the loss function float does not converge, the loss function, learning rate, network structure, and/or the like may be adjusted. When a gradient vanishes or a gradient explosion occurs, the activation function is adjusted.
In a specific embodiment, the federal learning method further comprises:
acquiring parameters of the trained federal learning model from the data request terminal;
acquiring data to be processed;
updating a local federal learning model by using the trained federal learning model parameters;
and processing the data to be processed by using the updated local federal learning model.
In a specific embodiment, the federal learning method further comprises:
obtaining a processing result of the data to be processed;
acquiring a preset result of the data to be processed;
and adjusting parameters and/or super parameters of the coding model and/or the federal learning model according to the processing result of the data to be processed and the preset result of the data to be processed.
Specifically, whether the coding model is over-coded or not can be judged according to the processing result of the data to be processed and the preset result of the data to be processed, and the over-coded data can cause the coding model to lose the capability of extracting effective characteristics; and adjusting the coding model according to the judging result so as to improve the characteristic extraction capacity of the coding model and balance the characteristic extraction capacity with the data security achieved by coding.
Example two
Fig. 2 is a block diagram of a federal learning device according to a second embodiment of the present invention. The federal learning means 20 is applied to a data provider, which is a computer device. The federal learning means 20 is adapted to generate a federal learning model by federal learning.
As shown in fig. 2, the federal learning device 20 may include an acquisition module 201, a conversion module 202, an encoding module 203, and a transmission module 204.
An acquisition module 201, configured to acquire sample data and an identification code of the sample data.
The identification code is unique identification information of the sample data and is used for identifying the sample data between the data providing end and a third party requesting the data.
The sample data may include different data types such as text-like data, one-hot data, numeric data, and ebadd data.
For example, the data provider may be a finance company, the third party requesting data may be an insurance company, the sample data may be user behavior data of the finance company, and the data type of the sample data may be text-type data. The identification code can be a mobile phone number or an identity card number of the user corresponding to the user behavior data. The insurance company needs to acquire the encoded user behavior data of the finance company, and reliability scoring is carried out on the user according to the acquired encoded user behavior data through an insurance reliability scoring model. That is, the insurance company does not need to directly obtain the user behavior data of the finance company, so that the data security of the finance company is protected. The insurance reliability scoring model may be a specific federal learning model and the federal learning model local to the insurance company may be a deep learning model.
For another example, the data providing end may be an e-commerce company, the third party requesting data may be an advertisement company, the sample data may be commodity click behavior data of the e-commerce company, and the data type of the sample data may be numerical data. The identification code can be a mobile phone number or an identity card number of the user corresponding to the commodity clicking behavior data. The advertisement company needs to acquire the coded commodity clicking behavior data of the electronic commerce company, and recommends commodities to the user according to the acquired coded commodity clicking behavior data through a commodity recommendation model. Namely, the advertisement company does not need to directly acquire commodity clicking behavior data of the electronic commerce company, so that the data security of the electronic commerce company is protected. The commodity recommendation model may be a specific federal learning model and the federal learning model local to the advertising company may be a deep learning model.
The conversion module 202 is configured to convert the sample data into a vector, and 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 need to be converted into vectors according to the data type of the sample data;
if the sample data is judged to be converted into a vector according to the data type of the sample data, the sample data is converted into the vector according to a preset conversion method corresponding to the data type of the sample data.
For example, if the data type of the sample data is text class data (the preset conversion method corresponding to the text class data is a 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 numerical data (a preset conversion method corresponding to the numerical class data is a standardized method), the sample data is converted into a vector according to the standardized method.
Further, the determining whether the sample data needs to be converted into a vector according to the data type of the sample data includes:
acquiring a data type table 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. The data to be converted is a vector at this time, and conversion is not required.
And the encoding module 203 is configured to encode the vector representation to obtain a feature vector of the sample data.
In a specific embodiment, the encoding the vector representation includes:
obtaining a sample vector;
training a coding model by a back propagation algorithm according to the sample vector, wherein the coding model is composed of an encoder and a decoder;
the vector representation is encoded with a trained encoder.
In order to ensure the safety of the sample data, the data providing end cannot directly request the sample data to a third party of the data.
In another embodiment, the federal learning apparatus 20 further includes an optimization module for optimizing the trained coding model by a Deep auto-encoder (depth coding) or a sparse auto-encoder (sparse coding) method.
And optimizing the trained coding model by a sparse coding method according to the difference value between the output and the input of the trained coding model. The sparse coding method is mainly characterized in that the trained coding model is optimized by adding sparsity limiting conditions to nerve units in the trained coding model.
Specifically, the sparsity constraint may include activating a neuron when its output approaches 1 (e.g., greater than 0.9); when the output value of the neuron approaches 0 (e.g., less than or equal to 0.9), the neuron is not activated.
The coding model is used for carrying out feature learning and feature integration on the vector representation. The data request terminal cannot interpret and obtain the sample data corresponding to the vector representation under the condition that a decoder is not arranged, so that the data security is ensured.
And the transmission module 204 is configured to transmit the feature vector and the identifier code to a data request terminal, so that the data request terminal searches for a tag of the sample data according to the identifier code, and performs federal learning model training according to the feature vector and the tag.
The federal learning model includes: LR, XGB, DNN, etc. The LR, XGB, DNN and other models are used for machine learning training, so as to achieve the algorithm model for the purpose of service use. The federal learning model may be a specific artificial intelligence model, such as an artificial intelligence classification model, an artificial intelligence recognition model, or the like.
In a specific embodiment, said transmitting said feature vector and said identification code to a data request terminal comprises:
and transmitting the feature vector and the identification code to the data request end through an encryption algorithm.
Encrypting the feature vector and the identification code, for example, by a private key of the data provider; and transmitting the encrypted feature vector and the identification code to the data request terminal, so that the data request terminal decrypts the encrypted feature vector and the identification code through the public key of the data providing terminal.
When the sample data is user behavior data, the labels of the sample data are "risk users", "normal users". When the sample data is commodity clicking behavior data, the labels of the sample data are recommended commodity I, recommended commodity II and the like.
In a specific embodiment, the training of the federal learning model according to the feature vector and the tag includes:
the data request end obtains initial parameters of the federal learning model from a preset server end;
the data request end initializes the federal learning model by using the initial parameters;
the data request end carries out local training on the initialized federal learning model according to the feature vector and the label, and updates parameters of the initialized federal learning model to obtain updated parameters;
the data request terminal uploads the updated parameters to the preset service terminal, so that the preset service terminal aggregates the parameters uploaded by each request terminal to obtain aggregated parameters, and when the federal learning model updated by the aggregated parameters is detected to be in a convergence state, the updated federal learning model is issued to the data request terminal;
and the data request terminal receives the federal learning model issued by the preset server terminal.
The federal learning device 20 of the second embodiment generates a federal learning model through federal learning. The coding model is used for carrying out feature learning and feature integration on the vector representation, and the data request terminal cannot interpret and obtain sample data corresponding to the vector representation under the condition that a decoder is not arranged, so that the safety of the data is ensured, and the data leakage is prevented. The coding model does not add noise to the vector representation, avoiding additional interference information due to the added noise. The establishment of the federal model has direct feedback on the coding result, thereby being beneficial to optimization and adjustment. The coding model can be used for adjusting the information loss degree and the information safety degree of feature learning and feature integration on the vector representation, finding out benefit points of information safety and information loss, and obtaining more optimized parameters of the whole federal learning model. The data request end does not directly obtain the data of the data providing end, so that the safety of the data in the federal learning process is improved.
In a specific embodiment, the federal learning device 20 further includes an adjustment module for adjusting the encoder and/or the super-parameters of the federal learning model. Super parameters include network structure, number of neural layers, number of neurons per layer, activation function, learning rate, regularization and penalty coefficients, loss function, and the like. In particular, when the loss function float does not converge, the loss function, learning rate, network structure, and/or the like may be adjusted. When a gradient vanishes or a gradient explosion occurs, the activation function is adjusted.
In a specific embodiment, the federal learning device 20 further includes a processing module, configured to obtain parameters of the trained federal learning model from the data request end; acquiring data to be processed; updating a local federal learning model by using the trained federal learning model parameters; and processing the data to be processed by using the updated local federal learning model.
In a specific embodiment, the adjustment module is further configured to obtain a processing result of the data to be processed; acquiring a preset result of the data to be processed; and adjusting parameters and/or super parameters of the coding model and/or the federal learning model according to the processing result of the data to be processed and the preset result of the data to be processed.
Specifically, whether the coding model is over-coded or not can be judged according to the processing result of the data to be processed and the preset result of the data to be processed, and the over-coded data can cause the coding model to lose the capability of extracting effective characteristics; and adjusting the coding model according to the judging result so as to improve the characteristic extraction capacity of the coding model and balance the characteristic extraction capacity with the data security achieved by coding.
Example III
The present embodiment provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the above-described federal learning method embodiment, for example, steps 101-104 shown in fig. 1:
101, acquiring sample data and an identification code of the sample data;
102, converting the sample data into vectors to obtain vector representations of the sample data;
103, coding the vector representation to obtain a feature vector of the sample data;
104, transmitting the feature vector and the identification code to a data request terminal, so that the data request terminal searches a label of the sample data according to the identification code, and training a federal learning model according to the feature vector and the label.
Alternatively, the computer program, when executed by a processor, performs the functions of the modules in the above apparatus embodiments, for example, the modules 201-204 in fig. 2:
an acquisition module 201, configured to acquire sample data and an identification code of the sample data;
a conversion module 202, configured to convert the sample data into a vector, and obtain a vector representation of the sample data;
an encoding module 203, configured to encode the vector representation to obtain a feature vector of the sample data;
and the transmission module 204 is configured to transmit the feature vector and the identifier code to a data request terminal, so that the data request terminal searches for a tag of the sample data according to the identifier code, and performs federal learning model training according to the feature vector and the tag.
Example IV
Fig. 3 is a schematic diagram of a computer device according to a third embodiment of the present invention. The computer device 30 comprises a memory 301, a processor 302 and a computer program 303, such as a federal learning program, stored in the memory 301 and executable on the processor 302. The processor 302, when executing the computer program 303, implements the steps of the federal learning method embodiment described above, such as 101-104 shown in fig. 1:
101, acquiring sample data and an identification code of the sample data;
102, converting the sample data into vectors to obtain vector representations of the sample data;
103, coding the vector representation to obtain a feature vector of the sample data;
104, transmitting the feature vector and the identification code to a data request terminal, so that the data request terminal searches a label of the sample data according to the identification code, and training a federal learning model according to the feature vector and the label.
Alternatively, the computer program, when executed by a processor, performs the functions of the modules in the above apparatus embodiments, for example, the modules 201-204 in fig. 2:
an acquisition module 201, configured to acquire sample data and an identification code of the sample data;
a conversion module 202, configured to convert the sample data into a vector, and obtain a vector representation of the sample data;
an encoding module 203, configured to encode the vector representation to obtain a feature vector of the sample data;
and the transmission module 204 is configured to transmit the feature vector and the identifier code to a data request terminal, so that the data request terminal searches for a tag of the sample data according to the identifier code, and performs federal learning model training according to the feature vector and the tag.
Illustratively, the computer program 303 may be partitioned into one or more modules, which are stored in the memory 301 and executed by the processor 302 to perform the method. The one or more modules may be a series of computer program instruction segments capable of performing the specified functions, which instruction segments describe the execution of the computer program 303 in the computer device 30. For example, the computer program 303 may be divided into an acquisition module 201, a conversion module 202, an encoding module 203, and a transmission module 204 in fig. 2, where each module has a specific function, see embodiment two.
Those skilled in the art will appreciate that the schematic diagram 3 is merely an example of the computer device 30 and is not meant to be limiting of the computer device 30, and may include more or fewer components than shown, or may combine certain components, or different components, e.g., the computer device 30 may also include input and output devices, network access devices, buses, etc.
The processor 302 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor 302 may be any conventional processor or the like, the processor 302 being the control center of the computer device 30, with various interfaces and lines connecting the various parts of the overall computer device 30.
The memory 301 may be used to store the computer program 303, and the processor 302 may implement various functions of the computer device 30 by running or executing the computer program or module stored in the memory 301 and invoking data stored in the memory 301. The memory 301 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the computer device 30, or the like. In addition, the memory 301 may include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card), at least one disk storage device, a Flash memory device, or other non-volatile solid state storage device.
The modules integrated by the computer device 30 may be stored in a computer readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product. Based on such understanding, the present invention may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM).
In the several embodiments provided in the present invention, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical modules, i.e., may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in each embodiment of the present invention 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 integrated modules may be implemented in hardware or in hardware plus software functional modules.
The integrated modules, which are implemented in the form of software functional modules, may be stored in a computer readable storage medium. The software functional modules described above are stored in a storage medium and include instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or processor (processor) to perform some of the steps of the federal learning method according to various embodiments of the present invention.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned. Furthermore, it is evident that the word "comprising" does not exclude other modules or steps, and that the singular does not exclude a plurality. A plurality of modules or means recited in the system claims can also be implemented by means of one module or means in software or hardware. The terms first, second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (8)

1. A federal learning method, the federal learning method comprising:
acquiring sample data and an identification code of the sample data, wherein the sample data comprises text data, one-hot data, numerical data and ebedding data;
converting the sample data into a vector to obtain a vector representation of the sample data, wherein the converting the sample data into a vector comprises: acquiring the data type of the sample data; judging whether the sample data need to be converted into vectors according to the data type of the sample data; if the sample data is judged to be converted into a vector according to the data type of the sample data, converting the sample data into the vector according to a preset conversion method corresponding to the data type of the sample data;
encoding the vector representation to obtain a feature vector of the sample data;
transmitting the feature vector and the identification code to a data request terminal, enabling the data request terminal to search a label of the sample data according to the identification code, and performing federal learning model training according to the feature vector and the label, wherein the method comprises the following steps: the data request end obtains initial parameters of the federal learning model from a preset server end; the data request end initializes the federal learning model by using the initial parameters; the data request end carries out local training on the initialized federal learning model according to the feature vector and the label, and updates parameters of the initialized federal learning model to obtain updated parameters; the data request terminal uploads the updated parameters to the preset service terminal, so that the preset service terminal aggregates the parameters uploaded by each request terminal to obtain aggregated parameters, and when the federal learning model updated by the aggregated parameters is detected to be in a convergence state, the updated federal learning model is issued to the data request terminal; and the data request terminal receives the federal learning model issued by the preset server terminal.
2. The federal learning method according to claim 1, wherein the encoding the vector representation comprises:
obtaining a sample vector;
training a coding model by a back propagation algorithm according to the sample vector, wherein the coding model is composed of an encoder and a decoder;
the vector representation is encoded with a trained encoder.
3. The federal learning method according to claim 1, wherein the transmitting the feature vector and the identification code to a data requesting terminal comprises:
and transmitting the feature vector and the identification code to the data request end through an encryption algorithm.
4. The federal learning method according to claim 2, wherein the federal learning method further comprises:
and optimizing the trained coding model by a sparse coding method.
5. The federal learning method according to claim 2, wherein the federal learning method further comprises:
obtaining a processing result of data to be processed;
acquiring a preset result of the data to be processed;
and adjusting parameters and/or super parameters of the coding model and/or the federal learning model according to the processing result of the data to be processed and the preset result of the data to be processed.
6. A federal learning apparatus, the federal learning apparatus comprising:
the acquisition module is used for acquiring sample data and identification codes of the sample data, wherein the sample data comprises text data, one-hot data, numerical data and subedding data;
the conversion module is configured to convert the sample data into a vector, and obtain a vector representation of the sample data, where the converting the sample data into the vector includes: acquiring the data type of the sample data; judging whether the sample data need to be converted into vectors according to the data type of the sample data; if the sample data is judged to be converted into a vector according to the data type of the sample data, converting the sample data into the vector according to a preset conversion method corresponding to the data type of the sample data;
the encoding module is used for encoding the vector representation to obtain a characteristic vector of the sample data;
the transmission module is used for transmitting the feature vector and the identification code to a data request terminal, so that the data request terminal searches the label of the sample data according to the identification code, and performs federal learning model training according to the feature vector and the label, and the transmission module comprises: the data request end obtains initial parameters of the federal learning model from a preset server end; the data request end initializes the federal learning model by using the initial parameters; the data request end carries out local training on the initialized federal learning model according to the feature vector and the label, and updates parameters of the initialized federal learning model to obtain updated parameters; the data request terminal uploads the updated parameters to the preset service terminal, so that the preset service terminal aggregates the parameters uploaded by each request terminal to obtain aggregated parameters, and when the federal learning model updated by the aggregated parameters is detected to be in a convergence state, the updated federal learning model is issued to the data request terminal; and the data request terminal receives the federal learning model issued by the preset server terminal.
7. A computer device comprising a processor for executing a computer program stored in a memory to implement the federal learning method of any one of claims 1-5.
8. A computer readable storage medium having a computer program stored thereon, wherein the computer program when executed by a processor implements the federal learning method according to any one of claims 1-5.
CN202010408557.4A 2020-05-14 2020-05-14 Federal learning method, federal learning device, federal learning computer device, and federal learning computer readable storage medium Active CN111695674B (en)

Priority Applications (2)

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

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
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 (2)

Publication Number Publication Date
CN111695674A CN111695674A (en) 2020-09-22
CN111695674B true CN111695674B (en) 2024-04-09

Family

ID=72477764

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010408557.4A Active 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

Country Status (2)

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

Families Citing this family (15)

* 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
CN112396189B (en) * 2020-11-27 2023-09-01 中国银联股份有限公司 Method and device for constructing federal learning model by multiple parties
CN112463161B (en) * 2020-11-27 2023-07-28 平安科技(深圳)有限公司 Code annotation generation method, system and device based on federal learning
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
CN113781397B (en) * 2021-08-11 2023-11-21 中国科学院信息工程研究所 Medical image focus detection modeling method, device and system based on federal learning
CN113722987B (en) * 2021-08-16 2023-11-03 京东科技控股股份有限公司 Training method and device of federal learning model, electronic equipment and storage medium
CN114154392A (en) * 2021-10-15 2022-03-08 海南火链科技有限公司 Model co-construction method, device and equipment based on block chain and federal learning
CN114357521A (en) * 2022-01-12 2022-04-15 平安科技(深圳)有限公司 Data protection method and system
CN114648130B (en) * 2022-02-07 2024-04-16 北京航空航天大学 Longitudinal federal learning method, device, electronic equipment and storage medium
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
CN114996317B (en) * 2022-07-05 2024-02-23 中国电信股份有限公司 Asynchronous optimization method and device based on longitudinal federal learning and storage medium
CN115495541B (en) * 2022-11-18 2023-04-07 深译信息科技(珠海)有限公司 Corpus database, corpus database maintenance method, apparatus, device and medium
CN117424765B (en) * 2023-12-19 2024-03-22 天津医康互联科技有限公司 Distributed single-heat encoding method, device, electronic equipment and computer storage medium

Citations (2)

* 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
CN111027715A (en) * 2019-12-11 2020-04-17 支付宝(杭州)信息技术有限公司 Monte Carlo-based federated learning model training method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9547769B2 (en) * 2012-07-03 2017-01-17 Visa International Service Association Data protection hub
CN110297848B (en) * 2019-07-09 2024-02-23 深圳前海微众银行股份有限公司 Recommendation model training method, terminal and storage medium based on federal learning
CN110807207B (en) * 2019-10-30 2021-10-08 腾讯科技(深圳)有限公司 Data processing method and device, electronic equipment and storage medium

Patent Citations (2)

* 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
CN111027715A (en) * 2019-12-11 2020-04-17 支付宝(杭州)信息技术有限公司 Monte Carlo-based federated learning model training method and device

Also Published As

Publication number Publication date
CN111695674A (en) 2020-09-22
WO2021114618A1 (en) 2021-06-17

Similar Documents

Publication Publication Date Title
CN111695674B (en) Federal learning method, federal learning device, federal learning computer device, and federal learning computer readable storage medium
CN112732911B (en) Semantic recognition-based speaking recommendation method, device, equipment and storage medium
Younus et al. Video steganography using knight tour algorithm and LSB method for encrypted data
CN112035743B (en) Data recommendation method and device, computer equipment and storage medium
US20190354688A1 (en) System and method for machine learning architecture with adversarial attack defence
WO2022105117A1 (en) Method and device for image quality assessment, computer device, and storage medium
CN111651573B (en) Intelligent customer service dialogue reply generation method and device and electronic equipment
CN111949886B (en) Sample data generation method and related device for information recommendation
US20200293775A1 (en) Data labeling for deep-learning models
CN112085565A (en) Deep learning-based information recommendation method, device, equipment and storage medium
CN112580352B (en) Keyword extraction method, device and equipment and computer storage medium
CN116645668B (en) Image generation method, device, equipment and storage medium
CN113408668A (en) Decision tree construction method and device based on federated learning system and electronic equipment
CN113779277A (en) Method and device for generating text
CN113128196A (en) Text information processing method and device, storage medium
US10902215B1 (en) Social hash for language models
JP2023517518A (en) Vector embedding model for relational tables with null or equivalent values
CN116127925B (en) Text data enhancement method and device based on destruction processing of text
CN111723186A (en) Knowledge graph generation method based on artificial intelligence for dialog system and electronic equipment
CN116127049A (en) Model training method, text generation method, terminal device and computer medium
CN111209403A (en) Data processing method, device, medium and electronic equipment
CN115309905A (en) Advertisement text generation method, device, equipment and medium
CN114707633A (en) Feature extraction method, feature extraction device, electronic equipment and storage medium
CN116756676A (en) Abstract generation method and related device
CN113705071A (en) Equipment identification method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant