WO2021204040A1 - 联邦学习数据处理方法、装置、设备及存储介质 - Google Patents

联邦学习数据处理方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2021204040A1
WO2021204040A1 PCT/CN2021/084269 CN2021084269W WO2021204040A1 WO 2021204040 A1 WO2021204040 A1 WO 2021204040A1 CN 2021084269 W CN2021084269 W CN 2021084269W WO 2021204040 A1 WO2021204040 A1 WO 2021204040A1
Authority
WO
WIPO (PCT)
Prior art keywords
gradient
value
model parameters
data
multiple terminals
Prior art date
Application number
PCT/CN2021/084269
Other languages
English (en)
French (fr)
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 WO2021204040A1 publication Critical patent/WO2021204040A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • 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
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes

Definitions

  • This application relates to the field of artificial intelligence, and in particular to a method, device, equipment and storage medium for processing federated learning data.
  • Data is the core driving force of deep learning technology, but data acquisition usually faces privacy protection issues, especially In data-sensitive industry applications such as finance, insurance, and banking.
  • Federated learning technology is a multi-terminal collaborative distributed encryption machine learning technology. There is often a service center and multiple terminals in federated learning. The inventor realized that with the increasing number of parameters of the current deep learning model, even after the compression of the neural network model compression technology, the number of parameters is far greater than that of the traditional machine learning model, which is required in different terminal devices.
  • gradient synchronization if one end of the training gradient obtained from the local private data needs to be synchronized to the central end, it will face problems such as too long transmission time and too large network delay.
  • This application proposes a federated learning data processing method, device, computer equipment, and storage medium, which are used to solve the problem of long time and large delay in synchronous gradient data transmission of different devices in the machine learning process of federated learning in the prior art.
  • the first aspect of the present application provides a method for processing federated learning data, including: controlling multiple terminals to perform federated learning training through local data and model parameters to obtain multiple gradient values, where the unit of the gradient value is a first data amount Unit; performing three-value quantization gradient calculation on the multiple gradient values to obtain multiple three-value gradients, the unit of the three-value gradient is a second data volume unit, the second data volume unit is smaller than the first data Quantity unit; sending the multiple three-valued gradients to the central end; controlling the central end to randomly select multiple terminals to receive the corresponding three-valued gradients; fuse the three-valued gradients corresponding to the multiple terminals to update the model parameters , And transmit the updated model parameters back to the multiple terminals; control the multiple terminals to obtain a product recommendation model according to the updated model parameters, and input the local user data received by the multiple terminals to The product recommendation model is processed to obtain target product recommendation data, and the target product recommendation data is transmitted back to the multiple terminals.
  • the second aspect of the application provides a federated learning data processing device, including: a training module for controlling multiple terminals to perform federated learning training through local data and model parameters to obtain multiple gradient values; an optimization module for Perform three-value quantization gradient calculation on the multiple gradient values to obtain n three-value gradients; a sending module, used to send the multiple three-value gradients to the central end; a receiving module, used to control the central end to randomly select multiple The terminal receives the corresponding ternary gradient; an update module for fusing the ternary gradients corresponding to the multiple terminals to update the model parameters, and transmits the updated model parameters back to the multiple terminals; processing module , Used to control multiple terminals to obtain a product recommendation model according to the updated model parameters, and input the local user data received by multiple terminals into the product recommendation model for processing to obtain target product recommendation data, and set the target product The recommended data is transmitted back to the multiple terminals.
  • a third aspect of the present application provides a federated learning data processing device, including: a memory and at least one processor, the memory stores instructions; the at least one processor calls the instructions in the memory to make The federated learning data processing device executes the steps of the federated learning data processing method described below:
  • the fourth aspect of the present application provides a computer-readable storage medium having instructions stored in the computer-readable storage medium, which when run on a computer, cause the computer to execute the following federated learning data processing method:
  • the federated learning data processing method, device, computer equipment and storage medium provided in this application reduce the size of the gradient that needs to be transmitted by using three-valued quantization of the gradient when different terminal devices perform gradient synchronization.
  • the time required for gradient transmission is greatly reduced, and the training data processing of the model can be quickly realized under the premise of better protection of user privacy.
  • Fig. 1 is a schematic diagram of an application environment of an embodiment of the application
  • FIG. 2 is a schematic flowchart of a method for processing federated learning data according to Embodiment 1 of this application;
  • FIG. 3 is a schematic diagram of the flow of controlling multiple terminals in FIG. 2 to perform federated learning training through local data and model parameters to obtain multiple gradient values;
  • FIG. 4 is a schematic diagram of the flow of fusing the three-value gradients corresponding to the multiple terminals in FIG. 2 to update the model parameters, and transmitting the updated model parameters back to the multiple terminals;
  • FIG. 5 is a schematic diagram of the structure of the federated learning data processing device in the third embodiment of the computer equipment of this application;
  • FIG. 1 shows a schematic diagram of the implementation environment of the embodiment of the present application.
  • the implementation environment includes: terminal 1, 2...n and central terminal.
  • a terminal is an electronic device with a network access function, and the device can be a smart phone, a tablet computer, or a personal computer.
  • the terminal is installed with a program 11 that can access the center. After the program 11 logs in to the center with an account and password, the user can perform specific operations and input on the center.
  • the central end is a server, a server cluster composed of several servers, or a cloud computing center.
  • Program 13 is stored in the center.
  • Program 13 includes a front-end module and a back-end module.
  • the front-end module and back-end module can call each other through the interface.
  • the user logs in through the account and password in the program 11 or logs in through the account and password to access the program 13 of the center. After that, you can perform specific operations and inputs on program 13.
  • a database and a data table are stored in the center. Different databases can obtain the data in the database through the trigger instruction of the user 10.
  • the database may also be stored in different servers in the central end cluster, or in different network nodes connected through the network, or stored locally in the user segment 10.
  • the terminal and the central terminal are connected through a network, and the network may include network nodes, and the network may be the Internet, a local area network or a blockchain network.
  • the federated learning data processing method of the embodiment of the present application can be applied to the program 11 or the program 13 alone, can also be applied to the program 11 and the program 13 in a distributed manner, or stored in a node of the network in the form of a blockchain.
  • the training data processing method of federated learning in this embodiment can be applied to the following scenarios.
  • Bank 1, Bank 2...Bank n has relatively homogeneous services, but each bank has its own user, and one user may also be in Multiple banks open accounts, so there may be overlaps and unique parts between users of different banks.
  • terminal 1 corresponds to bank 1, bank 2... bank n.
  • the encrypted user ID alignment technology is first used to confirm the common users of different banks, and each bank will not expose its own data. During the entity alignment process, the system will not disclose users who do not overlap with each other.
  • the method for processing federated learning data in this embodiment reduces the size of the gradient that needs to be transmitted and greatly reduces the time required for gradient transmission by using three-value quantization on the gradient when different terminal devices perform gradient synchronization. Under the premise of protecting user privacy, the training data processing of the model can be quickly realized.
  • a method for processing federated learning data in this embodiment includes the following steps:
  • Step S100 controlling multiple terminals to perform federated learning training respectively through local data and model parameters to obtain multiple gradient values, where the unit of the gradient value is the first data volume unit;
  • n terminals to perform federated learning training through local data and model parameters to obtain n gradient values
  • the terminal is a mobile phone
  • a wifi, idle, and power-connected terminal can be selected as the training terminal to avoid affecting the user's use of the client.
  • step 100 controlling multiple terminals to perform federated learning training through local data and model parameters to obtain multiple gradient values, it also includes:
  • the n terminals are controlled to collect the local data dr and request the initial model parameter W 0 from the central terminal, and the initial model parameter acquired by the terminal at this time is Where r is the rth terminal among the n terminals.
  • the common local user data is collected through terminal 1, terminal 2...terminal n.
  • the data may correspond to pictures of local user data, such as avatars, texts, or processed structured data, such as records of purchasing wealth management products.
  • the model of the terminal is initialized and expressed as m r , where the central terminal and the terminal adopt the same initialization model parameters
  • the central end is mainly to merge the gradient of each terminal.
  • the federated learning network organization performs distributed machine learning through multi-terminal collaboration, that is, multiple terminals can jointly train a large number of users in the federated learning network organization for a certain type of business Machine learning model. Therefore, before each terminal starts training data, each terminal requests the central server to initialize the model parameters. Each terminal obtains local data because each terminal corresponds to a different user, and each terminal has corresponding local data. Therefore, each terminal in the federated learning network organization will obtain the corresponding local data and initialize the model parameters for training. To meet the actual application requirements of each terminal for the model.
  • Step S100 includes:
  • Step S110 Control each terminal to pass the initial model parameters through the gradient descent method After performing t rounds of federated learning training iterations on the local data, the model parameters are obtained
  • each terminal is controlled to perform t rounds of federated learning training iterations through the gradient descent algorithm at the learning rate ⁇ to obtain the model parameters
  • Step S120 Perform a Hamiltonian operation on the local data through the model parameters to obtain a gradient value corresponding to each terminal.
  • C the gradient of C terminals is obtained for each gradient fusion
  • B the batch size of each input of the model on the terminal
  • E each gradient fusion, the number of rounds of each terminal training
  • the learning rate ⁇ of the center end the learning rate ⁇ of the terminal.
  • data and parameters control the training terminal to start training, according to the gradient descent algorithm, training with the learning rate ⁇ to get Then get the gradient value of the model.
  • the gradient value of the model of each terminal is calculated by the following formula 1, where Indicates the weight parameter of the model, and the subscript t represents the iteration in the tth round of the training process.
  • Step S200 Perform a three-value quantized gradient calculation on the multiple gradient values to obtain multiple three-value gradients, where the unit of the three-value gradient is a second data volume unit, and the second data volume unit is smaller than the first data volume unit.
  • n gradient values n three-value gradients.
  • lighter gradient information that is, optimized gradient information
  • optimized gradient information is obtained, and the optimized gradient information is pushed to the central end.
  • the three-value quantized gradient operator module is mainly applied to the terminal (referred to as the client) that joins the federated learning network organization.
  • the weight of the model and the gradient of the backpropagation are both represented by 32-bit floating point numbers.
  • step S200 includes:
  • the corresponding three-value gradient is assigned the value -1.
  • the Bernoulli probability distribution is also called the 0-1 distribution, which refers to a random experiment with only two results. That is, the value of a random variable is only 0 and 1.
  • the Bernoulli probability distribution is denoted as 0-1 distribution or B(1,p), where p represents the probability that the result of a Bernoulli experiment is positive or 1, and k represents the probability of occurrence k times.
  • the optimized gradient information after tri-value can be calculated through the above formula.
  • Step S300 sending the multiple three-value gradients to the center end
  • Step S400 the control center randomly selects multiple terminals to receive the corresponding three-value gradient
  • the n three-valued gradients are sent to the center end, and the control center end randomly selects c terminals to receive the corresponding three-valued gradients, where c is less than or equal to n;
  • c terminals are randomly selected to receive the corresponding ternary gradient, and c is less than n at this time.
  • step S400 includes:
  • Step S410 merging the ternary gradients corresponding to the multiple terminals to obtain the fused ternary gradient g t+1 ;
  • Step S420 updating the model parameter w t according to the fused three-value gradient and the center-end learning rate to obtain an updated model parameter w t+1 ;
  • the central end first randomly selects C terminals ⁇ 1,...,C ⁇ from joining the federated network to obtain the gradient, and after the central end obtains the gradient pushed by the C terminals, it obtains the parameters according to the above formula in turn.
  • step S500 the three-value gradients corresponding to the multiple terminals are merged to update the model parameters, and the updated model parameters are transmitted back to the multiple terminals.
  • the ternary gradients corresponding to the c terminals are merged to update the initial model parameters, and the updated model parameters are transmitted back to the n terminals.
  • the model parameters are pushed back to the terminal again to complete a training iteration.
  • the federated learning network organization is distributed machine learning through multi-end collaboration. After the central end merges the obtained ternary gradients of multiple terminals, the updated model parameters of the central end are obtained through the merged ternary gradients, which is equivalent to The central end integrates the model parameters of multiple terminals, which helps the central end to integrate and optimize the training of the model.
  • step S500 after fusing the three-value gradients corresponding to the multiple terminals to update the model parameters, and transmitting the updated model parameters back to the multiple terminals, the method further includes:
  • the terminal performs a new federated learning training through the model parameters to obtain a new gradient, and iterates through the above steps. After a preset number of iterations, the loss function of the model converges, and the processing of the training data is stopped.
  • Step S600 Control the multiple terminals to obtain a product recommendation model according to the updated model parameters, and input the local user data received by the multiple terminals into the product recommendation model for processing to obtain target product recommendation data, and The target product recommendation data is transmitted back to the multiple terminals.
  • it further includes the step of encrypting the gradient information and the gradient corresponding to the c terminals, and the step of decrypting the gradient information and the gradient corresponding to the c terminals.
  • homomorphic encryption the data and model themselves will not be transmitted, nor can they be inferred based on the data of the other party. Therefore, the possibility of leakage at the original data level is very small. Encryption and decryption can improve the security of data processing and further prevent the leakage of private data in the terminal.
  • step S500 the method further includes:
  • the model parameters obtain corresponding summary information.
  • the summary information is obtained by hashing the model parameters, for example, obtained by using the sha256s algorithm.
  • Uploading summary information to the blockchain can ensure its security and fairness and transparency to users.
  • the user equipment can download the summary information from the blockchain to verify whether the model parameters have been tampered with.
  • the blockchain referred to in this example is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information for verification. The validity of the information (anti-counterfeiting) and the generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
  • the federated learning data processing method, device, computer equipment, and storage medium provided by the embodiments of the application.
  • the computer-readable storage medium may also be a volatile computer-readable storage medium, which includes multiple storage media.
  • Three-value quantization means that 32-bit floating point numbers are expressed as three values ⁇ -1, 0, 1 ⁇ , so that only 2 bits can achieve the purpose of gradient transmission, greatly reducing the time required for gradient transmission, quickly implementing model training under the premise of better protecting user privacy, and accelerating artificial intelligence in data-sensitive industries such as finance, insurance, and banking Landing and application.
  • the federated learning data processing device 20 may include or be divided into one or program modules, and the one or program modules are stored in a storage medium and executed by an OR processor to complete the application, and Realize the above-mentioned federated learning data processing method.
  • the program module referred to in the embodiments of the present application refers to a series of computer program instruction segments capable of completing specific functions, and is more suitable for describing the execution process of the federated learning data processing device 20 in the storage medium than the program itself. The following description will specifically introduce the functions of each program module in this embodiment:
  • the training module 201 is configured to control multiple terminals to perform federated learning training respectively through local data and model parameters to obtain multiple gradient values, and the unit of the gradient value is the first data volume unit;
  • the optimization module 202 is configured to perform three-value quantization gradient calculation on the multiple gradient values to obtain multiple three-value gradients, the unit of the three-value gradient is a second data volume unit, and the second data volume unit is smaller than the Said the first data volume unit;
  • the sending module 203 is configured to send the multiple three-value gradients to the central end;
  • the receiving module 204 is configured to control the central terminal to randomly select multiple terminals to receive corresponding three-value gradients
  • the update module 205 is configured to fuse the three-value gradients corresponding to the multiple terminals to update the model parameters, and transmit the updated model parameters back to the multiple terminals;
  • the processing module 206 is configured to control the multiple terminals to obtain a product recommendation model according to the updated model parameters, and input the local user data received by the multiple terminals into the product recommendation model for processing to obtain target product recommendation data, The target product recommendation data is transmitted back to the multiple terminals.
  • the computer device 2 is a device that can automatically perform numerical calculation and/or information processing according to pre-set or stored instructions.
  • the computer device 2 may be a rack server, a blade server, a tower server, or a cabinet server (including an independent server or a server cluster composed of servers).
  • the computer device 2 includes at least, but is not limited to, a memory 21, a processor 22, a network interface 23, and a federated learning data processing device 20 that can be connected to each other in communication via a system bus. in:
  • the memory 21 includes at least one type of computer-readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory ( RAM), static random access memory (SRAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), programmable read only memory (PROM), magnetic memory, magnetic disks, optical disks, etc.
  • the memory 21 may be an internal storage unit of the computer device 2, for example, a hard disk or a memory of the computer device 2.
  • the memory 21 may also be an external storage device of the computer device 2, such as a plug-in hard disk, a smart media card (SMC), and a secure digital (Secure Digital, SMC) equipped on the computer device 2. SD) card, flash card (Flash Card), etc.
  • the memory 21 may also include both the internal storage unit of the computer device 2 and its external storage device.
  • the memory 21 is generally used to store an operating system and various application software installed in the computer device 2, for example, the program code of the federated learning data processing device 20 described in the foregoing embodiment.
  • the memory 21 can also be used to temporarily store various types of data that have been output or will be output.
  • the processor 22 may be a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor, or other data processing chips.
  • the processor 22 is generally used to control the overall operation of the computer device 2.
  • the processor 22 is used to run the program code or process data stored in the memory 21, for example, to run the federated learning data processing device 20 to implement the federated learning data processing method of the foregoing embodiment.
  • the network interface 23 may include a wireless network interface or a wired network interface, and the network interface 23 is generally used to establish a communication connection between the computer device 2 and other electronic devices.
  • the network interface 23 is used to connect the computer device 2 with an external terminal through a network, and establish a data transmission channel and a communication connection between the computer device 2 and the external terminal.
  • the network may be Intranet, Internet, Global System of Mobile Communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G Network, Bluetooth (Bluetooth), Wi-Fi and other wireless or wired networks.
  • FIG. 6 only shows the computer device 2 with components 20-23, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.
  • the federated learning data processing device 20 stored in the memory 21 can also be divided into one or program modules.
  • the one or program modules are stored in the memory 21 and are operated by one or processor (this embodiment)
  • the example is executed by the processor 22) to complete the application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Computer Security & Cryptography (AREA)
  • Medical Informatics (AREA)
  • Computer Hardware Design (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Computation (AREA)
  • Mathematical Physics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

一种联邦学习数据处理方法、装置、设备及存储介质,所述方法包括控制多个终端通过本地数据和模型参数分别执行联邦学习训练得到多个梯度值,梯度值的单位为第一数据量单位(S100);对多个梯度值进行三值量化梯度计算得到多个三值梯度,三值梯度的单位为第二数据量单位,第二数据量单位小于第一数据量单位(S200);将多个三值梯度发送至中心端(S300);控制中心端随机选择多个终端接收对应的三值梯度(S400);融合多个终端对应的三值梯度以更新模型参数,将更新后的模型参数传回多个终端(S500)。所述方法通过在不同的终端设备进行梯度同步时,通过对梯度采用三值量化,减少需要传输的梯度大小,减少梯度传输所需要的时间,在更好的保护用户隐私的前提下快速实现模型的训练数据处理。

Description

联邦学习数据处理方法、装置、设备及存储介质
本申请要求于2020年10月29日提交中国专利局、申请号为202011183893.X、申请名称为“联邦学习数据处理方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在申请中。
技术领域
本申请涉及人工智能领域,尤其涉及一种联邦学习数据处理方法、装置、设备及存储介质。
背景技术
人工智能由于深度学习技术的突破得到了快速的发展,深度学习技术能快速发展的一大主要的原因就是数据,数据是深度学习技术的核心驱动力,但是获取数据通常面临隐私保护问题,尤其是在金融、保险、银行等数据敏感行业应用中。
联邦学习技术的出现解决了数据隐私保护的问题,即在不批露底层数据的情况下实现人工智能模型的协同训练。联邦学习技术是一种多端协同的分布式加密机器学习技术,联邦学习中往往存在一个服务中心端和多个终端。发明人意识到,随着目前深度学习模型的参数量越来越大,即使经过神经网络模型压缩技术压缩后的参数量也远远大于传统的机器学习模型的参数量,在不同的终端设备需要进行梯度同步的时候,如果一端在本地隐私数据得到的训练梯度需要同步到中心端,而且会面临传输时长过久,网络延迟太大等问题。
发明内容
本申请提出一种联邦学习数据处理方法、装置、计算机设备及存储介质,用于解决现有技术中联邦学习的机器学习过程中,不同设备同步梯度数据传输时长久,延迟大的问题。
本申请第一方面提供了一种联邦学习数据处理方法,包括:控制多个终端通过本地数据和模型参数分别执行联邦学习训练以得到多个梯度值,所述梯度值的单位为第一数据量单位;对所述多个梯度值进行三值量化梯度计算以得到多个三值梯度,所述三值梯度的单位为第二数据量单位,所述第二数据量单位小于所述第一数据量单位;将所述多个三值梯度发送至中心端;控制所述中心端随机选择多个终端接收对应的三值梯度;融合所述多个终端对应的三值梯度以更新所述模型参数,并将更新后的所述模型参数传回所述多个终端;控制所述多个终端根据更新后的所述模型参数得到产品推荐模型,并将多个终端接收到的本地用户数据输入至产品推荐模型中处理以得到目标产品推荐数据,将所述目标产品推荐数据传回所述多个终端。
本申请第二方面提供了一种联邦学习数据处理装置,包括:训练模块,用于控制多个终端通过本地数据和模型参数分别执行联邦学习训练以得到多个梯度值;优化模块,用于对所述多个梯度值进行三值量化梯度计算以得到n个三值梯度;发送模块,用于将所述多个三值梯度发送至中心端;接收模块,用于控制中心端随机选择多个终端接收对应的三值梯度;更新模块,用于融合所述多个终端对应的三值梯度以更新所述模型参数,并将更新后的所述模型参数传回所述多个终端;处理模块,用于控制多个终端根据更新后的所述模型参数得到产品推荐模型,并将多个终端接收到的本地用户数据输入至产品推荐模型中处理以得到目标产品推荐数据,将所述目标产品推荐数据传回所述多个终端。
本申请第三方面提供了一种联邦学习数据处理设备,包括:存储器和至少一个处理器,所述存储器中存储有指令;所述至少一个处理器调用所述存储器中的所述指令,以使得所述联邦学习数据处理设备执行以下所述的联邦学习数据处理方法的步骤:
控制多个终端通过本地数据和模型参数分别执行联邦学习训练以得到多个梯度值,所 述梯度值的单位为第一数据量单位;对所述多个梯度值进行三值量化梯度计算以得到多个三值梯度,所述三值梯度的单位为第二数据量单位,所述第二数据量单位小于所述第一数据量单位;将所述多个三值梯度发送至中心端;控制所述中心端随机选择多个终端接收对应的三值梯度;融合所述多个终端对应的三值梯度以更新所述模型参数,并将更新后的所述模型参数传回所述多个终端;
控制所述多个终端根据更新后的所述模型参数得到产品推荐模型,并将多个终端接收到的本地用户数据输入至产品推荐模型中处理以得到目标产品推荐数据,将所述目标产品推荐数据传回所述多个终端。
本申请的第四方面提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行以下所述的联邦学习数据处理方法:
控制多个终端通过本地数据和模型参数分别执行联邦学习训练以得到多个梯度值,所述梯度值的单位为第一数据量单位;对所述多个梯度值进行三值量化梯度计算以得到多个三值梯度,所述三值梯度的单位为第二数据量单位,所述第二数据量单位小于所述第一数据量单位;将所述多个三值梯度发送至中心端;控制所述中心端随机选择多个终端接收对应的三值梯度;融合所述多个终端对应的三值梯度以更新所述模型参数,并将更新后的所述模型参数传回所述多个终端;
控制所述多个终端根据更新后的所述模型参数得到产品推荐模型,并将多个终端接收到的本地用户数据输入至产品推荐模型中处理以得到目标产品推荐数据,将所述目标产品推荐数据传回所述多个终端。
相较于传统技术,本申请提供的联邦学习数据处理方法、装置、计算机设备及存储介质,通过在不同的终端设备进行梯度同步时,通过对梯度采用三值量化,减少需要传输的梯度大小,大大减少梯度传输所需要的时间,在更好的保护用户隐私的前提下快速实现模型的训练数据处理。
附图说明
图1为本申请实施例的应用环境示意图;
图2为本申请实施例一的联邦学习数据处理方法的流程示意图;
图3为图2中控制多个终端通过本地数据和模型参数分别执行联邦学习训练以得到多个梯度值的流程示意图;
图4为图2中融合所述多个终端对应的三值梯度以更新所述模型参数,并将更新后的所述模型参数传回所述多个终端的流程示意图;
图5为本申请计算机设备之实施例三的联邦学习数据处理装置结构示意图;
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
需要说明的是,在本申请中涉及“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本申请要求的保护范围之内。
为便于理解,下面对本申请实施例的具体流程进行描述,请参阅图1,示出了本申请实施例的实施环境示意图。该实施环境包括:终端1,2…n和中心端。
终端是具有网络访问功能的电子设备,该设备可以是智能手机、平板电脑或者个人计算机等。
其中,终端安装有可以访问中心端的程序11,用户在程序11通过账号和密码登录访问中心端后,即可对中心端执行特定操作和输入。
中心端是一台服务器、若干服务器构称的服务器集群或者云计算中心。中心端中存储了程序13,程序13包括前端模块和后端模块,前端模块和后端模块可通过接口互相调用,用户在程序11通过账号和密码登录或者通过账号和密码登录访问中心端的程序13后,即可对程序13执行特定操作和输入。
在本实施例中,中心端中存储有数据库和数据表。不同的数据库可以通过用户10的触发指令获取数据库中的数据。
在其他实施例中,数据库也可以存储在中心端集群中的不同服务器,或者通过网络连接的不同网络节点中,或者存储在用户段10本地。
终端和中心端通过网络连接,网络中可包括网络节点,网络可以是互联网,局域网或者区块链网络。
本申请实施例的联邦学习数据处理方法可单独应用于程序11或程序13中,也可以分布式的同时应用于程序11和程序13中,或者以区块链形式存储于网络的节点中。
其中,每次终端传递的是梯度g,中心端传回的是模型参数w。
本实施例一种联邦学习的训练数据处理方法,可以应用于以下场景中,银行1,银行2…银行n由于其业务比较同质化,但是每个银行具有各自的用户,一个用户也可能在多个银行开户,所以不同银行之间的用户可能存在重叠部分和独有部分。
由于银行的业务类型比较同质化,所以不同银行可以联合训练一个大量用户的针对银行某业务类型的机器学习模型,以获得对于业务的机器学习特征,但是由于数据隐私,商业秘密等考虑,每个银行之间不能直接交换各自的本地用户数据。
为了确保训练过程中数据的保密性,因此引入了第三方合作者,即对应上图中的中心端,终端1,终端2…终端n对应银行1,银行2…银行n。
由于不同银行的用户不同,首先使用加密的用户ID对齐技术,来确认不同银行的共同用户,而每个银行都不会暴露各自的数据。在实体对齐过程中,系统不会公开彼此不重叠的用户。
在确定了公共实体之后,我们可以使用这些重叠的数据来训练机器学习模型来得到对应样本特征。
本实施例的一种联邦学习数据处理方法,通过在不同的终端设备进行梯度同步时,通过对梯度采用三值量化,减少需要传输的梯度大小,大大减少梯度传输所需要的时间,在更好的保护用户隐私的前提下快速实现模型的训练数据处理。
请参考图2,本实施例的一种联邦学习数据处理方法,包括以下步骤:
步骤S100,控制多个终端通过本地数据和模型参数分别执行联邦学习训练以得到多个梯度值,所述梯度值的单位为第一数据量单位;
具体的,控制n个终端通过本地数据和模型参数分别执行联邦学习训练以得到n个梯度值;
首先选择符合预设条件的终端为执行初始联邦学习的训练终端;
例如,如果终端是手机,可以选择有wifi、空闲和连接了电源的终端作为训练终端,以避免影响用户对客户端的使用。
其中,步骤100:控制多个终端通过本地数据和模型参数分别执行联邦学习训练以得到 多个梯度值之前还包括:
控制所述多个终端收集所述本地数据,然后向所述中心端请求初始模型参数W 0
具体的,控制所述n个终端收集所述本地数据dr以及向所述中心端请求所述初始模型参数W 0,此时终端获取到的初始模型参数为
Figure PCTCN2021084269-appb-000001
其中r为所述n个终端中的第r个终端。
首先通过终端1、终端2…终端n收集得到共同本地用户数据。这里的数据可以本地用户数据对应是图片,例如头像,文本或者已处理好的结构化数据,例如购买理财产品记录等。
初始化终端的模型且表示为m r,其中,中心端和终端采用相同的初始化模型参数
Figure PCTCN2021084269-appb-000002
中心端主要是融合各个终端的梯度。
多个终端和中心端组成联邦学习网络组织,联邦学习网络组织是通过多端协同进行分布式机器学习的,即多个终端可以在联邦学习网络组织中联合训练一个大量用户的针对某个业务类型的机器学习模型。因此,在每个终端开始训练数据之前,每个终端向中心服务端请求初始化模型参数。每个终端获取本地数据是因为每个终端对应的用户不同,每个终端具有对应的本地数据,因此,每个终端在联邦学习网络组织中均会获取对应的本地数据结合初始化模型参数进行训练,以满足每个终端对于模型的实际应用需求。
具体的,请参考图3,步骤S100包括:
步骤S110:控制每个终端通过梯度下降法通过所述初始模型参数
Figure PCTCN2021084269-appb-000003
对所述本地数据执行t轮联邦学习训练迭代后得到模型参数
Figure PCTCN2021084269-appb-000004
具体的,控制每个终端通过梯度下降算法以学习率β执行t轮联邦学习训练迭代后得到模型参数
Figure PCTCN2021084269-appb-000005
步骤S120:通过所述模型参数对所述本地数据执行哈密顿算子运算得到每个终端对应的梯度值。
具体的,通过公式
Figure PCTCN2021084269-appb-000006
计算得到每个终端对应的梯度值g t
具体的,输入三个超参数:C(每次梯度融合获取C个终端的梯度)、B(终端上模型每次输入的批量大小)、E(每次梯度融合,每次终端训练的轮次数),中心端的学习率α,终端的学习率β。
根据设置好的模型、数据和参数(参数E和B),控制训练终端开始训练,按照梯度下降算法,以学习率β训练得到
Figure PCTCN2021084269-appb-000007
继而得到模型的梯度值。
具体的,通过以下公式1计算得到每个终端的模型的梯度值,其中
Figure PCTCN2021084269-appb-000008
表示模型的权重参数,下标t表示在训练过程的第t轮迭代。
公式1:
Figure PCTCN2021084269-appb-000009
步骤S200,对所述多个梯度值进行三值量化梯度计算以得到多个三值梯度,所述三值梯度的单位为第二数据量单位,所述第二数据量单位小于所述第一数据量单位;
具体的,对所述n个梯度值进行三值量化梯度计算以得到n个三值梯度。
具体的,通过三值量化算子模块,得到更轻量的梯度信息,即优化的梯度信息,推送该优化的梯度信息到中心端。
其中,三值量化梯度算子模块主要应用在加入联邦学习网络组织的终端(简称客户端)。在深度学习模型中,为了保证模型能够收敛和最终模型效果,模型的权重和反向传播的梯度均采用32位浮点数表示。每个加入联邦学习网络的终端在完成模型的前向传播、得到梯度后,需要通过深度学习框架的通信技术或者Http(HyperText Transfer Protocol,超文本传输协议)实现通信。
具体的,步骤S200包括:
对所述多个梯度值中的每个梯度值进行三值转换;
当所述梯度值等于0时,将对应的三值梯度赋值为数值0;
当所述梯度值大于0时,将对应的三值梯度赋值为数值1;
当所述梯度值小于0时,将对应的三值梯度赋值为数值-1。
具体的,三值量化算子计算方法如下公式2所示:
公式2:
Figure PCTCN2021084269-appb-000010
通过公式2计算得到每个终端对应的三值梯度
Figure PCTCN2021084269-appb-000011
其中,当g t>0时,sign(g t)=1,当g t=0时,sign(g t)=0,当g t<0时,sign(g t)=-1,max(abc(g t)为张量,a t为伯努利概率分布的采样数据,°为哈达玛乘积。
其中,a t的每个元素通过以下公式3采样得到,采用的分布是伯努利概率分布。
公式3:
Figure PCTCN2021084269-appb-000012
伯努利概率分布又叫做0-1分布,指一次随机试验,结果只有两种。也就是一个随机变量的取值只有0和1。
伯努利概率分布记为0-1分布或B(1,p),其中p表示一次伯努利实验中结果为正或为1的概率,其中k表示发生k次的概率。
综上,经过以上公式可以计算得到三值化后的优化的梯度信息。
步骤S300,将所述多个三值梯度发送至中心端;
步骤S400,控制中心端随机选择多个终端接收对应的三值梯度;
具体的,将所述n个三值梯度发送至中心端,控制中心端随机选择c个终端接收对应的三值梯度,其中c小于等于n;
当网络中的终端数量有限,此时中心端需要获取每个终端的梯度,此时c=n,当网络中的终端数量很多,此时中心端不需要获取每个终端的梯度,为了提高效率和进一步节约网络传输时间,则随机选择c个终端接收对应的三值梯度,此时c小于n。
具体的,请参考图4,步骤S400,包括:
步骤S410,融合所述多个终端对应的三值梯度以得到融合后的三值梯度g t+1
具体的,通过公式
Figure PCTCN2021084269-appb-000013
融合所述c个终端对应的三值梯度以得到融合后的三值梯度g t+1
步骤S420,根据融合后的三值梯度和中心端学习率更新所述模型参数w t得到更新后的模型参数w t+1
具体的,通过公式w t+1=w t-αg t+1得到更新后的所述初始模型参数w t+1,其中α为中心端学习率,w t为中心端的模型参数。
具体的,中心端首先从加入联邦网络中随机选择C个终端{1,…,C}进行梯度的获取,中心端得到C个终端推送的梯度后,依次按照以上公式得到参数。
步骤S500,融合所述多个终端对应的三值梯度以更新所述模型参数,并将更新后的所述模型参数传回所述多个终端。
具体的,融合所述c个终端对应的三值梯度以更新所述初模型参数,并将更新后的所述模型参数传回所述n个终端。
中心端完成梯度的聚合和模型参数的更新后,将模型参数重新推送回终端,完成一次训练的迭代。
联邦学习网络组织是通过多端协同进行分布式机器学习的,中心端将获取到的多个终端的三值梯度融合后,再通过融合后的三值梯度得到中心端的更新后的模型参数,相当于 中心端融合了多个终端的模型参数,有助于中心端对模型的整合与优化训练。
在本实施例中,步骤S500,融合所述多个终端对应的三值梯度以更新所述模型参数,并将更新后的所述模型参数传回所述多个终端之后还包括:
控制所述多个终端通过所述更新后的模型参数w t+1执行新的联邦学习训练,并在所述更新后的模型参数w t+1更新预设次数后停止训练。
终端通过所述模型参数执行新的联邦学习训练得到新的梯度,通过上述步骤进行迭代,迭代预设次数后,模型的损失函数收敛,停止训练数据的处理。
步骤S600,控制所述多个终端根据更新后的所述模型参数得到产品推荐模型,并将多个终端接收到的本地用户数据输入至产品推荐模型中处理以得到目标产品推荐数据,将所述目标产品推荐数据传回所述多个终端。
在本申请另外的实施例中,还包括加密所述梯度信息和所述c个终端对应的梯度的步骤,以及解密所述梯度信息和所述c个终端对应的梯度的步骤。
具体的,通过同态加密的方法,通过加密机制下的参数交换来保护本地用户数据隐私。同态加密时,数据和模型本身不会被传输,也不能通过另一方的数据对其进行推测。因此,原始数据级别的泄漏可能性很小。通过加密解密可以提高数据处理时的安全性,进一步防止终端中的隐私数据被泄露。
在本实施例中,步骤S500之后还包括:
将根据所述模型参数w t+1上传至区块链中。
所述模型参数得到对应的摘要信息,具体来说,摘要信息由模型参数进行散列处理得到,比如利用sha256s算法处理得到。将摘要信息上传至区块链可保证其安全性和对用户的公正透明性。用户设备可以从区块链中下载得该摘要信息,以便查证模型参数是否被篡改。本示例所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。
本申请实施例提供的联邦学习数据处理方法、装置、计算机设备及存储介质,该计算机可读存储介质也可以为易失性计算机可读存储介质其包括多个存储介质,通过在不同的终端设备进行梯度同步时,通过对梯度采用三值量化,减少需要传输的梯度大小,大大减少梯度传输所需要的时间,在更好的保护用户隐私的前提下快速实现模型的训练数据处理。其中,现有方法直接使用浮点数的32比特进行梯度的通信,在现实落地的场景往往无法得到很好的效果。为了解决这一问题,本提案通过对梯度采用三值量化的技术减少需要传输的梯度大小,三值量化即将32位浮点数表示为{-1,0,1}三个值,这样便只用2个bit便可以实现梯度的传输的目的,大大减少梯度传输所需要的时间,在更好的保护用户隐私的前提下快速实现模型的训练,加快人工智能在金融、保险、银行等数据敏感行业的落地和应用。
请继续参阅图5,示出了本申请知识图谱的推荐装置的程序模块示意图。在本实施例中,联邦学习数据处理装置20可以包括或被分割成一个或程序模块,一个或者程序模块被存储于存储介质中,并由一个或处理器所执行,以完成本申请,并可实现上述联邦学习数据处理方法。本申请实施例所称的程序模块是指能够完成特定功能的一系列计算机程序指令段,比程序本身更适合于描述联邦学习数据处理装置20在存储介质中的执行过程。以下描述将具体介绍本实施例各程序模块的功能:
训练模块201,用于控制多个终端通过本地数据和模型参数分别执行联邦学习训练以得到 多个梯度值,所述梯度值的单位为第一数据量单位;
优化模块202,用于对所述多个梯度值进行三值量化梯度计算以得到多个三值梯度,所述三值梯度的单位为第二数据量单位,所述第二数据量单位小于所述第一数据量单位;
发送模块203,用于将所述多个三值梯度发送至中心端;
接收模块204,用于控制所述中心端随机选择多个终端接收对应的三值梯度;
更新模块205,用于融合所述多个终端对应的三值梯度以更新所述模型参数,并将更新后的所述模型参数传回所述多个终端;
处理模块206,用于控制所述多个终端根据更新后的所述模型参数得到产品推荐模型,并将多个终端接收到的本地用户数据输入至产品推荐模型中处理以得到目标产品推荐数据,将所述目标产品推荐数据传回所述多个终端。
参阅图6,是本申请实施例三之计算机设备的硬件架构示意图。本实施例中,所述计算机设备2是一种能够按照事先设定或者存储的指令,自动进行数值计算和/或信息处理的设备。该计算机设备2可以是机架式服务器、刀片式服务器、塔式服务器或机柜式服务器(包括独立的服务器,或者服务器所组成的服务器集群)等。如图6所示,所述计算机设备2至少包括,但不限于,可通过系统总线相互通信连接存储器21、处理器22、网络接口23、以及联邦学习数据处理装置20。其中:
本实施例中,存储器21至少包括一种类型的计算机可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,存储器21可以是计算机设备2的内部存储单元,例如该计算机设备2的硬盘或内存。在另一些实施例中,存储器21也可以是计算机设备2的外部存储设备,例如该计算机设备2上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。当然,存储器21还可以既包括计算机设备2的内部存储单元也包括其外部存储设备。
本实施例中,存储器21通常用于存储安装于计算机设备2的操作系统和各类应用软件,例如上述实施例所述的联邦学习数据处理装置20的程序代码等。此外,存储器21还可以用于暂时地存储已经输出或者将要输出的各类数据。
处理器22在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器22通常用于控制计算机设备2的总体操作。本实施例中,处理器22用于运行存储器21中存储的程序代码或者处理数据,例如运行联邦学习数据处理装置20,以实现上述实施例的联邦学习数据处理方法。
所述网络接口23可包括无线网络接口或有线网络接口,该网络接口23通常用于在所述计算机设备2与其他电子装置之间建立通信连接。例如,所述网络接口23用于通过网络将所述计算机设备2与外部终端相连,在所述计算机设备2与外部终端之间的建立数据传输通道和通信连接等。所述网络可以是企业内部网(Intranet)、互联网(Internet)、全球移动通讯系统(Global System of Mobile communication,GSM)、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)、4G网络、5G网络、蓝牙(Bluetooth)、Wi-Fi等无线或有线网络。
需要指出的是,图6仅示出了具有部件20-23的计算机设备2,但是应理解的是,并不要求实施所有示出的部件,可以替代的实施更多或者更少的部件。
在本实施例中,存储于存储器21中的联邦学习数据处理装置20还可以被分割为一个或者程序模块,所述一个或者程序模块被存储于存储器21中,并由一个或处理器(本实施 例为处理器22)所执行,以完成本申请。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种联邦学习数据处理方法,其中,所述方法包括:
    控制多个终端通过本地数据和模型参数分别执行联邦学习训练以得到多个梯度值,所述梯度值的单位为第一数据量单位;
    对所述多个梯度值进行三值量化梯度计算以得到多个三值梯度,所述三值梯度的单位为第二数据量单位,所述第二数据量单位小于所述第一数据量单位;
    将所述多个三值梯度发送至中心端;
    控制所述中心端随机选择多个终端接收对应的三值梯度;
    融合所述多个终端对应的三值梯度以更新所述模型参数,并将更新后的所述模型参数传回所述多个终端;
    控制所述多个终端根据更新后的所述模型参数得到产品推荐模型,并将多个终端接收到的本地用户数据输入至产品推荐模型中处理以得到目标产品推荐数据,将所述目标产品推荐数据传回所述多个终端。
  2. 如权利要求1所述的联邦学习数据处理方法,其中,所述本地数据为结构化数据,所述结构化数据包括文字或图片,所述控制多个终端通过本地数据和模型参数分别执行联邦学习训练以得到多个梯度值之前还包括:
    控制所述多个终端收集所述本地数据;
    向所述中心端请求初始模型参数。
  3. 如权利要求2所述的联邦学习数据处理方法,其中,所述控制多个终端通过本地数据和模型参数分别执行联邦学习训练以得到多个梯度值包括:
    控制每个终端通过梯度下降法通过所述初始模型参数对所述本地数据执行t轮联邦学习训练迭代后得到模型参数;
    通过所述模型参数对所述本地数据执行哈密顿算子运算得到每个终端对应的梯度值。
  4. 如权利要求3所述的联邦学习数据处理方法,其中,所述对所述多个梯度值进行三值量化梯度计算以得到多个三值梯度包括:
    对所述多个梯度值中的每个梯度值进行三值转换;
    当所述梯度值等于0时,将对应的三值梯度赋值为数值0;
    当所述梯度值大于0时,将对应的三值梯度赋值为数值1;
    当所述梯度值小于0时,将对应的三值梯度赋值为数值-1。
  5. 如权利要求4所述的联邦学习数据处理方法,其中,所述融合所述多个终端对应的三值梯度以更新所述模型参数,并将更新后的所述模型参数传回所述多个终端包括:
    融合所述多个终端对应的三值梯度以得到融合后的三值梯度;根据融合后的三值梯度和中心端学习率更新所述模型参数得到更新后的模型参数。
  6. 如权利要求5所述的联邦学习数据处理方法,其中,所述融合所述多个终端对应的三值梯度以更新所述模型参数,并将更新后的所述模型参数传回所述多个终端之后包括:
    控制所述多个终端通过所述模型参数执行新的联邦学习训练,并在所述模型参数更新预设次数后停止训练。
  7. 如权利要求6所述的联邦学习数据处理方法,其中,所述控制所述多个终端通过所述模型参数执行新的联邦学习训练,并在所述模型参数更新预设次数后停止训练之后还包括:
    将所述模型参数上传至区块链中。
  8. 一种联邦学习数据处理装置,其中,所述装置包括:
    训练模块,用于控制多个终端通过本地数据和模型参数分别执行联邦学习训练以得到多个梯度值;
    优化模块,用于对所述多个梯度值进行三值量化梯度计算以得到n个三值梯度;
    发送模块,用于将所述多个三值梯度发送至中心端;
    接收模块,用于控制中心端随机选择多个终端接收对应的三值梯度;
    更新模块,用于融合所述多个终端对应的三值梯度以更新所述模型参数,并将更新后的所述模型参数传回所述多个终端;
    处理模块,用于控制多个终端根据更新后的所述模型参数得到产品推荐模型,并将多个终端接收到的本地用户数据输入至产品推荐模型中处理以得到目标产品推荐数据,将所述目标产品推荐数据传回所述多个终端。
  9. 一种计算机设备,包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时执行如下所述的联邦学习数据处理方法的步骤:
    控制多个终端通过本地数据和模型参数分别执行联邦学习训练以得到多个梯度值,所述梯度值的单位为第一数据量单位;
    对所述多个梯度值进行三值量化梯度计算以得到多个三值梯度,所述三值梯度的单位为第二数据量单位,所述第二数据量单位小于所述第一数据量单位;
    将所述多个三值梯度发送至中心端;
    控制所述中心端随机选择多个终端接收对应的三值梯度;
    融合所述多个终端对应的三值梯度以更新所述模型参数,并将更新后的所述模型参数传回所述多个终端;
    控制所述多个终端根据更新后的所述模型参数得到产品推荐模型,并将多个终端接收到的本地用户数据输入至产品推荐模型中处理以得到目标产品推荐数据,将所述目标产品推荐数据传回所述多个终端。
  10. 根据权利要求9所述的计算机设备,其中,所述计算机设备被所述处理器执行所述控制多个终端通过本地数据和模型参数分别执行联邦学习训练以得到多个梯度值的步骤之前,还包括:
    控制所述多个终端收集所述本地数据;
    向所述中心端请求初始模型参数。
  11. 根据权利要求10所述的计算机设备,其中,所述计算机设备被所述处理器执行所述控制多个终端通过本地数据和模型参数分别执行联邦学习训练以得到多个梯度值的步骤时,包括:
    控制每个终端通过梯度下降法通过所述初始模型参数对所述本地数据执行t轮联邦学习训练迭代后得到模型参数;
    通过所述模型参数对所述本地数据执行哈密顿算子运算得到每个终端对应的梯度值。
  12. 根据权利要求11所述的计算机设备,其中,所述计算机设备被所述处理器执行对所述多个梯度值进行三值量化梯度计算以得到多个三值梯度的步骤时,包括:;
    对所述多个梯度值中的每个梯度值进行三值转换;
    当所述梯度值等于0时,将对应的三值梯度赋值为数值0;
    当所述梯度值大于0时,将对应的三值梯度赋值为数值1;
    当所述梯度值小于0时,将对应的三值梯度赋值为数值-1。
  13. 根据权利要求12所述的计算机设备,其中,所述计算机设备被所述处理器执行所述融合所述多个终端对应的三值梯度以更新所述模型参数,并将更新后的所述模型参数传回所述多个终端的步骤时,包括:
    融合所述多个终端对应的三值梯度以得到融合后的三值梯度;根据融合后的三值梯度和中心端学习率更新所述模型参数得到更新后的模型参数。
  14. 根据权利要求13所述的计算机设备,其中,所述计算机设备被所述处理器执行融合所述多个终端对应的三值梯度以更新所述模型参数,并将更新后的所述模型参数传回所述多个终端的步骤之后,还包括:
    控制所述多个终端通过所述模型参数执行新的联邦学习训练,并在所述模型参数更新预设次数后停止训练。
  15. 根据权利要求14所述的计算机设备,其中,所述计算机设备被所述处理器执行控制所述多个终端通过所述模型参数执行新的联邦学习训练,并在所述模型参数更新预设次数后停止训练的步骤之后,还包括:
    将所述模型参数上传至区块链中。
  16. 一种计算机可读存储介质,其上存储有计算机程序,其中,所述计算机程序被处理器执行时实现如下所述的联邦学习数据处理方法的步骤:
    控制多个终端通过本地数据和模型参数分别执行联邦学习训练以得到多个梯度值,所述梯度值的单位为第一数据量单位;
    对所述多个梯度值进行三值量化梯度计算以得到多个三值梯度,所述三值梯度的单位为第二数据量单位,所述第二数据量单位小于所述第一数据量单位;
    将所述多个三值梯度发送至中心端;
    控制所述中心端随机选择多个终端接收对应的三值梯度;
    融合所述多个终端对应的三值梯度以更新所述模型参数,并将更新后的所述模型参数传回所述多个终端;
    控制所述多个终端根据更新后的所述模型参数得到产品推荐模型,并将多个终端接收到的本地用户数据输入至产品推荐模型中处理以得到目标产品推荐数据,将所述目标产品推荐数据传回所述多个终端。
  17. 根据权利要求16所述的计算机可读存储介质,其中,所述联邦学习数据处理的计算机程序被所述处理器执行所述控制多个终端通过本地数据和模型参数分别执行联邦学习训练以得到多个梯度值的步骤之前,还包括:
    控制所述多个终端收集所述本地数据;
    向所述中心端请求初始模型参数。
  18. 根据权利要求17所述的计算机可读存储介质,其中,所述联邦学习数据处理的计算机程序被所述处理器执行所述控制多个终端通过本地数据和模型参数分别执行联邦学习训练以得到多个梯度值的步骤时,包括:
    控制每个终端通过梯度下降法通过所述初始模型参数对所述本地数据执行t轮联邦学习训练迭代后得到模型参数;
    通过所述模型参数对所述本地数据执行哈密顿算子运算得到每个终端对应的梯度值。
  19. 根据权利要求18所述的计算机可读存储介质,其中,所述联邦学习数据处理的计算机程序被所述处理器执行对所述多个梯度值进行三值量化梯度计算以得到多个三值梯度的步骤时,包括:;
    对所述多个梯度值中的每个梯度值进行三值转换;
    当所述梯度值等于0时,将对应的三值梯度赋值为数值0;
    当所述梯度值大于0时,将对应的三值梯度赋值为数值1;
    当所述梯度值小于0时,将对应的三值梯度赋值为数值-1。
  20. 根据权利要求19所述的计算机可读存储介质,其中,所述联邦学习数据处理的计算机程序被所述处理器执行所述融合所述多个终端对应的三值梯度以更新所述模型参数,并将更新后的所述模型参数传回所述多个终端的步骤时,包括:
    融合所述多个终端对应的三值梯度以得到融合后的三值梯度;根据融合后的三值梯度 和中心端学习率更新所述模型参数得到更新后的模型参数。
PCT/CN2021/084269 2020-10-29 2021-03-31 联邦学习数据处理方法、装置、设备及存储介质 WO2021204040A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011183893.XA CN112288097B (zh) 2020-10-29 2020-10-29 联邦学习数据处理方法、装置、计算机设备及存储介质
CN202011183893.X 2020-10-29

Publications (1)

Publication Number Publication Date
WO2021204040A1 true WO2021204040A1 (zh) 2021-10-14

Family

ID=74352534

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/084269 WO2021204040A1 (zh) 2020-10-29 2021-03-31 联邦学习数据处理方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN112288097B (zh)
WO (1) WO2021204040A1 (zh)

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114125070A (zh) * 2021-11-10 2022-03-01 深圳大学 一种量化压缩的通信方法、系统、电子装置及存储介质
CN114169412A (zh) * 2021-11-23 2022-03-11 北京邮电大学 面向大规模产业链隐私计算的联邦学习模型训练方法
CN114330673A (zh) * 2022-03-15 2022-04-12 支付宝(杭州)信息技术有限公司 一种对业务预测模型进行多方联合训练的方法及装置
CN114339252A (zh) * 2021-12-31 2022-04-12 深圳大学 一种数据压缩方法及装置
CN114580087A (zh) * 2022-05-06 2022-06-03 山东大学 一种船载设备的联邦剩余使用寿命预测方法、装置及系统
CN114627648A (zh) * 2022-03-16 2022-06-14 中山大学·深圳 一种基于联邦学习的城市交通流诱导方法及系统
CN114626615A (zh) * 2022-03-21 2022-06-14 江苏仪化信息技术有限公司 一种生产过程监控管理方法及系统
CN114707430A (zh) * 2022-06-02 2022-07-05 青岛鑫晟汇科技有限公司 一种基于多用户加密的联邦学习可视化系统与方法
CN115150288A (zh) * 2022-05-17 2022-10-04 浙江大学 一种分布式通信系统和方法
CN115391734A (zh) * 2022-10-11 2022-11-25 广州天维信息技术股份有限公司 一种基于联邦学习的客户满意度分析系统
CN115660114A (zh) * 2022-11-11 2023-01-31 湖北文理学院 基于区块链的异步联邦学习架构系统及方法
CN116032663A (zh) * 2023-03-27 2023-04-28 湖南红普创新科技发展有限公司 基于边缘设备的隐私数据处理系统、方法、设备及介质
CN116109608A (zh) * 2023-02-23 2023-05-12 智慧眼科技股份有限公司 一种肿瘤分割方法、装置、设备及存储介质
CN116542342A (zh) * 2023-05-16 2023-08-04 江南大学 一种可防御拜占庭攻击的异步联邦优化方法
CN116578674A (zh) * 2023-07-07 2023-08-11 北京邮电大学 联邦变分自编码主题模型训练方法、主题预测方法及装置
WO2023185541A1 (zh) * 2022-03-26 2023-10-05 华为技术有限公司 一种模型训练方法及其相关设备
CN117575291A (zh) * 2024-01-15 2024-02-20 湖南科技大学 基于边缘参数熵的联邦学习的数据协同管理方法
CN117791877A (zh) * 2024-02-23 2024-03-29 北京智芯微电子科技有限公司 配电物联网控制方法、装置、设备及介质
CN117808125A (zh) * 2024-02-29 2024-04-02 浪潮电子信息产业股份有限公司 模型聚合方法、装置、设备、联邦学习系统及存储介质
WO2024094094A1 (zh) * 2022-11-02 2024-05-10 华为技术有限公司 一种模型训练方法及装置
CN118368053A (zh) * 2024-06-17 2024-07-19 山东大学 一种基于分片区块链的链上链下协同安全计算方法及系统

Families Citing this family (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112288097B (zh) * 2020-10-29 2024-04-02 平安科技(深圳)有限公司 联邦学习数据处理方法、装置、计算机设备及存储介质
CN112817940B (zh) * 2021-02-07 2022-03-04 上海嗨普智能信息科技股份有限公司 基于梯度压缩的联邦学习数据处理系统
CN113065143A (zh) * 2021-03-17 2021-07-02 四川大学 基于区块链的工业数据安全共享
CN113077366A (zh) * 2021-04-06 2021-07-06 上海网梯数码科技有限公司 一种基于区块链的学分管理方法
CN112799708B (zh) * 2021-04-07 2021-07-13 支付宝(杭州)信息技术有限公司 联合更新业务模型的方法及系统
CN113052329B (zh) * 2021-04-12 2022-05-27 支付宝(杭州)信息技术有限公司 联合更新业务模型的方法及装置
CN113052334B (zh) * 2021-04-14 2023-09-29 中南大学 一种联邦学习实现方法、系统、终端设备及可读存储介质
CN113095510B (zh) * 2021-04-14 2024-03-01 深圳前海微众银行股份有限公司 一种基于区块链的联邦学习方法及装置
CN113178191B (zh) * 2021-04-25 2024-07-12 平安科技(深圳)有限公司 基于联邦学习的语音表征模型训练方法、装置、设备及介质
CN113467928A (zh) * 2021-05-20 2021-10-01 杭州趣链科技有限公司 基于区块链去中心化的联邦学习成员推理攻击防御方法和装置
CN113377830A (zh) * 2021-05-21 2021-09-10 北京沃东天骏信息技术有限公司 确定超参的方法、训练联邦学习模型的方法及电子设备
CN113762328B (zh) * 2021-06-16 2023-09-26 京东科技控股股份有限公司 基于联邦学习的模型训练方法、装置、设备以及存储介质
CN113971090B (zh) * 2021-10-21 2022-09-13 中国人民解放军国防科技大学 分布式深度神经网络的分层联邦学习方法及装置
CN114584436B (zh) * 2022-05-06 2022-07-01 北京理工大学 一种单次握手的并发通信网络中的消息聚合系统及方法
CN114741611B (zh) * 2022-06-08 2022-10-14 杭州金智塔科技有限公司 联邦推荐模型训练方法以及系统
CN115278709B (zh) * 2022-07-29 2024-04-26 南京理工大学 一种基于联邦学习的通信优化方法
CN116070719B (zh) * 2023-03-20 2023-07-14 鹏城实验室 一种跨计算节点分布式训练高效通信方法及系统
CN117371027A (zh) * 2023-09-21 2024-01-09 北京大学深圳研究生院 数据处理方法和相关装置
CN117788983B (zh) * 2024-02-28 2024-05-24 青岛海尔科技有限公司 基于大模型的图像数据处理方法及装置、存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110069715A (zh) * 2019-04-29 2019-07-30 腾讯科技(深圳)有限公司 一种信息推荐模型训练的方法、信息推荐的方法及装置
CN111046433A (zh) * 2019-12-13 2020-04-21 支付宝(杭州)信息技术有限公司 一种基于联邦学习的模型训练方法
US20200271720A1 (en) * 2020-05-09 2020-08-27 Hefei University Of Technology Method for diagnosing analog circuit fault based on vector-valued regularized kernel function approximation
CN111814985A (zh) * 2020-06-30 2020-10-23 平安科技(深圳)有限公司 联邦学习网络下的模型训练方法及其相关设备
CN112288097A (zh) * 2020-10-29 2021-01-29 平安科技(深圳)有限公司 联邦学习数据处理方法、装置、计算机设备及存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020059446A1 (ja) * 2018-09-20 2020-03-26 富士フイルム株式会社 学習装置及び学習方法
US10776721B1 (en) * 2019-07-25 2020-09-15 Sas Institute Inc. Accelerating configuration of machine-learning models
CN111582505A (zh) * 2020-05-14 2020-08-25 深圳前海微众银行股份有限公司 联邦建模方法、装置、设备及计算机可读存储介质
CN111582504B (zh) * 2020-05-14 2024-07-23 深圳前海微众银行股份有限公司 基于联邦建模的数据防泄漏方法、装置、设备及计算机可读存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110069715A (zh) * 2019-04-29 2019-07-30 腾讯科技(深圳)有限公司 一种信息推荐模型训练的方法、信息推荐的方法及装置
CN111046433A (zh) * 2019-12-13 2020-04-21 支付宝(杭州)信息技术有限公司 一种基于联邦学习的模型训练方法
US20200271720A1 (en) * 2020-05-09 2020-08-27 Hefei University Of Technology Method for diagnosing analog circuit fault based on vector-valued regularized kernel function approximation
CN111814985A (zh) * 2020-06-30 2020-10-23 平安科技(深圳)有限公司 联邦学习网络下的模型训练方法及其相关设备
CN112288097A (zh) * 2020-10-29 2021-01-29 平安科技(深圳)有限公司 联邦学习数据处理方法、装置、计算机设备及存储介质

Cited By (29)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114125070A (zh) * 2021-11-10 2022-03-01 深圳大学 一种量化压缩的通信方法、系统、电子装置及存储介质
CN114169412A (zh) * 2021-11-23 2022-03-11 北京邮电大学 面向大规模产业链隐私计算的联邦学习模型训练方法
CN114339252A (zh) * 2021-12-31 2022-04-12 深圳大学 一种数据压缩方法及装置
CN114339252B (zh) * 2021-12-31 2023-10-31 深圳大学 一种数据压缩方法及装置
CN114330673A (zh) * 2022-03-15 2022-04-12 支付宝(杭州)信息技术有限公司 一种对业务预测模型进行多方联合训练的方法及装置
CN114627648A (zh) * 2022-03-16 2022-06-14 中山大学·深圳 一种基于联邦学习的城市交通流诱导方法及系统
CN114626615B (zh) * 2022-03-21 2023-02-03 江苏仪化信息技术有限公司 一种生产过程监控管理方法及系统
CN114626615A (zh) * 2022-03-21 2022-06-14 江苏仪化信息技术有限公司 一种生产过程监控管理方法及系统
WO2023185541A1 (zh) * 2022-03-26 2023-10-05 华为技术有限公司 一种模型训练方法及其相关设备
CN114580087A (zh) * 2022-05-06 2022-06-03 山东大学 一种船载设备的联邦剩余使用寿命预测方法、装置及系统
CN115150288A (zh) * 2022-05-17 2022-10-04 浙江大学 一种分布式通信系统和方法
CN115150288B (zh) * 2022-05-17 2023-08-04 浙江大学 一种分布式通信系统和方法
CN114707430A (zh) * 2022-06-02 2022-07-05 青岛鑫晟汇科技有限公司 一种基于多用户加密的联邦学习可视化系统与方法
CN115391734A (zh) * 2022-10-11 2022-11-25 广州天维信息技术股份有限公司 一种基于联邦学习的客户满意度分析系统
WO2024094094A1 (zh) * 2022-11-02 2024-05-10 华为技术有限公司 一种模型训练方法及装置
CN115660114A (zh) * 2022-11-11 2023-01-31 湖北文理学院 基于区块链的异步联邦学习架构系统及方法
CN116109608A (zh) * 2023-02-23 2023-05-12 智慧眼科技股份有限公司 一种肿瘤分割方法、装置、设备及存储介质
CN116032663B (zh) * 2023-03-27 2023-06-02 湖南红普创新科技发展有限公司 基于边缘设备的隐私数据处理系统、方法、设备及介质
CN116032663A (zh) * 2023-03-27 2023-04-28 湖南红普创新科技发展有限公司 基于边缘设备的隐私数据处理系统、方法、设备及介质
CN116542342A (zh) * 2023-05-16 2023-08-04 江南大学 一种可防御拜占庭攻击的异步联邦优化方法
CN116578674A (zh) * 2023-07-07 2023-08-11 北京邮电大学 联邦变分自编码主题模型训练方法、主题预测方法及装置
CN116578674B (zh) * 2023-07-07 2023-10-31 北京邮电大学 联邦变分自编码主题模型训练方法、主题预测方法及装置
CN117575291A (zh) * 2024-01-15 2024-02-20 湖南科技大学 基于边缘参数熵的联邦学习的数据协同管理方法
CN117575291B (zh) * 2024-01-15 2024-05-10 湖南科技大学 基于边缘参数熵的联邦学习的数据协同管理方法
CN117791877A (zh) * 2024-02-23 2024-03-29 北京智芯微电子科技有限公司 配电物联网控制方法、装置、设备及介质
CN117791877B (zh) * 2024-02-23 2024-05-24 北京智芯微电子科技有限公司 配电物联网控制方法、装置、设备及介质
CN117808125A (zh) * 2024-02-29 2024-04-02 浪潮电子信息产业股份有限公司 模型聚合方法、装置、设备、联邦学习系统及存储介质
CN117808125B (zh) * 2024-02-29 2024-05-24 浪潮电子信息产业股份有限公司 模型聚合方法、装置、设备、联邦学习系统及存储介质
CN118368053A (zh) * 2024-06-17 2024-07-19 山东大学 一种基于分片区块链的链上链下协同安全计算方法及系统

Also Published As

Publication number Publication date
CN112288097A (zh) 2021-01-29
CN112288097B (zh) 2024-04-02

Similar Documents

Publication Publication Date Title
WO2021204040A1 (zh) 联邦学习数据处理方法、装置、设备及存储介质
EP3520047B1 (en) Immutable cryptographically secured ledger-backed databases
WO2021120676A1 (zh) 联邦学习网络下的模型训练方法及其相关设备
CN110147994B (zh) 一种基于同态加密的区块链的即时执行方法
KR101727525B1 (ko) 블록체인 기반 분산 저장 방법 및 이를 이용한 장치
WO2021068444A1 (zh) 数据处理方法、装置、计算机设备和存储介质
EP3933642B1 (en) Managing transactions in multiple blockchain networks
US11917088B2 (en) Integrating device identity into a permissioning framework of a blockchain
WO2020173228A1 (zh) 机器学习模型的联合训练方法、装置、设备及存储介质
US11372848B2 (en) Managing transactions in multiple blockchain networks
US20210042740A1 (en) Value transfer method, apparatus, and system
US20180337904A1 (en) System, methods and software application for sending secured messages on decentralized networks
WO2021174778A1 (zh) 区块链安全交易方法、计算机设备及可读存储介质
CN112988674B (zh) 大数据文件的处理方法、装置、计算机设备及存储介质
WO2022068236A1 (zh) 基于信息的特征进行信息处理的方法、装置、设备及介质
CN110149323B (zh) 一种具有千万级tps合约处理能力的处理装置
CN111291394B (zh) 一种虚假信息管理方法、装置和存储介质
US11403632B2 (en) Managing transactions in multiple blockchain networks
CN113129149A (zh) 基于区块链和安全多方计算的交易风险识别方法和装置
US11470065B2 (en) Protection of private data using an enclave cluster
WO2022156594A1 (zh) 联邦模型训练方法、装置、电子设备、计算机程序产品及计算机可读存储介质
CN112818369A (zh) 一种联合建模方法及装置
CN116743377B (zh) 基于区块链密钥的数据处理方法、装置、设备及存储介质
CN114626100B (zh) 用于分布式账本技术的共识算法
TW202022743A (zh) 使用區塊鏈技術之代幣交易系統及其方法

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

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

Country of ref document: EP

Kind code of ref document: A1