WO2022116424A1 - 交通流预测模型训练方法、装置、电子设备及存储介质 - Google Patents

交通流预测模型训练方法、装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2022116424A1
WO2022116424A1 PCT/CN2021/083086 CN2021083086W WO2022116424A1 WO 2022116424 A1 WO2022116424 A1 WO 2022116424A1 CN 2021083086 W CN2021083086 W CN 2021083086W WO 2022116424 A1 WO2022116424 A1 WO 2022116424A1
Authority
WO
WIPO (PCT)
Prior art keywords
model
traffic flow
gradient
federated
flow prediction
Prior art date
Application number
PCT/CN2021/083086
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 WO2022116424A1 publication Critical patent/WO2022116424A1/zh

Links

Images

Classifications

    • 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
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • G06N20/20Ensemble learning
    • 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
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/10Services
    • G06Q50/26Government or public services

Definitions

  • the present application relates to the technical field of artificial intelligence, and in particular, to a method, apparatus, electronic device, and computer-readable storage medium for training a traffic flow prediction model based on federated transfer learning.
  • the inventor realizes that with the rise of machine learning and big data, although the existing deep learning-based model sharing methods have achieved success in some public scenarios, such as traffic flow prediction, they are still in the field of privacy protection. There are difficulties. Due to the strictness of the law on the protection of current user privacy, each system can only use the locally stored database to train the model, and cannot give full play to the advantages of big data. Also, in the process of training a high-quality model, the gradient of the model needs to be continuously updated, which adds a lot of computational pressure.
  • a method for training a traffic flow prediction model based on federated transfer learning includes:
  • the pre-created traffic flow prediction model is trained by using the traffic data in the local database of one of the participants participating in the federated transfer learning, until the loss function of the traffic flow prediction model converges, and the local model gradient is obtained;
  • the local model gradient is transmitted to other participants participating in the federated transfer learning through transfer learning to train their respective models;
  • the traffic data transmitted by the user is received, and the standard traffic flow prediction model is used to analyze the traffic data to obtain a traffic flow analysis result.
  • the present application also provides a model training device for federated transfer learning, which includes:
  • the local model training module is used for training the pre-created traffic flow prediction model by using the traffic data in the local database of one of the participants participating in the federated transfer learning, until the loss function of the traffic flow prediction model converges, obtaining local model gradient;
  • a data migration module used for transferring the gradient of the local model to other participants participating in the federated transfer learning to train their respective models through migration learning;
  • the federated learning module is used to send the local model gradient to the cloud for federated learning when the loss functions in the models of all participants participating in the federated transfer learning converge;
  • a model updating module configured to receive the model gradient after federated learning returned from the cloud, and use the model gradient after federated learning to modify the model gradient of the traffic flow prediction model to obtain a standard traffic flow prediction model;
  • the data analysis module is used for receiving the traffic flow data transmitted by the user, and using the standard traffic flow prediction model to analyze the traffic flow data to obtain the traffic flow analysis result.
  • the present application also provides an electronic device, the electronic device comprising:
  • the memory stores computer program instructions executable by the at least one processor, the computer program instructions being executed by the at least one processor to enable the at least one processor to perform federation-based migration as described below
  • the learned traffic flow prediction model training method :
  • the pre-created traffic flow prediction model is trained by using the traffic data in the local database of one of the participants participating in the federated transfer learning, until the loss function of the traffic flow prediction model converges, and the local model gradient is obtained;
  • the local model gradient is transmitted to other participants participating in the federated transfer learning through transfer learning to train their respective models;
  • the traffic data transmitted by the user is received, and the standard traffic flow prediction model is used to analyze the traffic data to obtain a traffic flow analysis result.
  • the present application also provides a computer-readable storage medium, including a storage data area and a storage program area, the storage data area stores created data, and the storage program area stores a computer program; wherein, the computer program is implemented as follows when executed by a processor
  • the pre-created traffic flow prediction model is trained by using the traffic data in the local database of one of the participants participating in the federated transfer learning, until the loss function of the traffic flow prediction model converges, and the local model gradient is obtained;
  • the local model gradient is transmitted to other participants participating in the federated transfer learning through transfer learning to train their respective models;
  • the traffic data transmitted by the user is received, and the standard traffic flow prediction model is used to analyze the traffic data to obtain a traffic flow analysis result.
  • FIG. 1 is a schematic flowchart of a method for training a traffic flow prediction model based on federated transfer learning provided by an embodiment of the present application
  • FIG. 2 is a schematic block diagram of an apparatus for training a traffic flow prediction model based on federated transfer learning according to an embodiment of the present application
  • FIG. 3 is a schematic diagram of the internal structure of an electronic device for implementing a method for training a traffic flow prediction model based on federated transfer learning according to an embodiment of the present application;
  • the embodiment of the present application provides a method for training a traffic flow prediction model based on federated transfer learning.
  • the executive body of the federated learning-based model training method includes, but is not limited to, at least one of electronic devices that can be configured to execute the method provided by the embodiments of the present application, such as a server and a terminal.
  • the training method for the traffic flow prediction model based on federated transfer learning can be executed by software or hardware installed in a terminal device or a server device, and the software can be a blockchain platform.
  • the server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
  • FIG. 1 a schematic flowchart of a method for training a traffic flow prediction model based on federated transfer learning provided by an embodiment of the present application.
  • the method for training a traffic flow prediction model based on federated transfer learning includes:
  • the data in the local database may be traffic data.
  • a data collection device may be used to acquire the traffic data from each traffic scene.
  • the traffic data includes vehicle information, personnel information, violation record information, etc.
  • the data collection device includes various camera devices, various sensors, etc.
  • the traffic scene includes highways, rural roads, morning and evening peaks. Scenes such as roads and bus stops.
  • the S1 includes:
  • a trained traffic flow prediction model is obtained and gradient parameters of the trained traffic flow prediction model are obtained to obtain a local model gradient.
  • the traffic flow prediction model may be created by a convolutional neural network, and includes a convolutional layer, a pooling layer, a fully connected layer, and the like.
  • the convolution layer uses a pre-built function to perform feature extraction on the data;
  • the pooling layer compresses the extracted feature data to extract the main feature data and simplifies the computational complexity;
  • the fully connected layer To connect all feature data and output data.
  • the training of the pre-created traffic flow prediction model is to adjust the parameters of the algorithm in the traffic flow prediction model through the traffic data in the local database, so that the traffic flow prediction model after training is the entire local database.
  • the traffic data in is better mapped or reflected.
  • MSE mean difference method
  • f(x i ) represents the model output result
  • yi represents the preset standard result
  • MSE represents the model loss function value
  • n represents the number of computations.
  • the model gradient of the traffic flow prediction model at this time is obtained as the local model gradient .
  • the loss function value when the loss function value is greater than a preset threshold, the loss function value has not tended to converge, and the model gradient of the traffic flow prediction model needs to be further updated.
  • the model gradient of the traffic flow prediction model is updated by using the following formula:
  • ⁇ j represents the gradient of the updated model
  • ⁇ j-1 represents the gradient of the model before the update
  • ⁇ 0 and ⁇ 1 represent the preset initial values of the functions in the model
  • represents the step size of the gradient descent
  • Transfer Learning is a machine learning method, which is to transfer knowledge from one domain (ie, the source domain) to another domain (ie, the target domain), so that the target domain can achieve better learning effects.
  • the transfer learning is to choose not to segment the data when there is little overlap between the data of the model and the data features, and to use transfer learning to overcome the lack of data or labels.
  • there are two different institutions one is a bank in China and the other is an e-commerce company in the United States. Due to geographical restrictions, the user groups of the two institutions have very little intersection.
  • the data characteristics of the two institutions only overlap in a small part. In this case, in order to carry out effective federated learning, transfer learning must be introduced to solve the problems of small unilateral data scale and few labeled samples, thereby improving the effect of the model.
  • the transfer of the local model gradient through transfer learning to other participants participating in the federated transfer learning to train their respective models includes:
  • the local model gradient is transmitted to other participants participating in the federated transfer learning to train their respective models through transfer learning, which can save the model iteration times of other participants in the federated transfer learning, thereby saving training time and improving Model training effect.
  • the federated learning includes: performing gradient aggregation operation on the local model gradients of each participant participating in the federated transfer learning to obtain a joint model gradient, and sending the joint model gradient to each participant participating in the federated transfer learning. participants.
  • the gradient aggregation is an operation to calculate a single value from a set of values. For example, calculating the daily average temperature value from the daily temperature accumulated for a month is an aggregation operation.
  • the joint model gradient may be obtained by performing a weighted average of the local gradient models of each participant participating in the federated transfer learning.
  • the updating the traffic flow prediction model using the model gradient after federated learning includes: loading the federated model gradient into the traffic flow prediction model, and modifying the traffic flow prediction according to the federated model gradient variables in the model to obtain the standard traffic flow prediction model.
  • S5. Receive the traffic data transmitted by the user, and use the standard traffic flow prediction model to analyze the traffic data to obtain a traffic flow analysis result.
  • the traffic flow data can be analyzed according to the standard traffic flow prediction model to predict the road traffic situation.
  • the gradient of the model in a converged state completed by local training is transmitted to other participants for training through transfer learning, so that other participants can reduce the number of model iterations.
  • the terminal uses the model gradient completed by the local data training to update the model gradient, which realizes the effect of expanding the training data and improves the effect of the model. Therefore, the embodiments of the present application achieve improved model accuracy and reduced model calculation pressure under the condition of protecting user data privacy by means of federated transfer learning.
  • FIG. 3 it is a schematic block diagram of the apparatus for training a traffic flow prediction model based on federated transfer learning of the present application.
  • the apparatus 100 for training a traffic flow prediction model based on federated transfer learning described in this application may be installed in an electronic device.
  • the apparatus for training a traffic flow prediction model based on federated transfer learning may include a local model training module 101 , a data transfer module 102 , a federated learning module 103 , a model update module 104 and a data analysis module 105 .
  • the modules described in this application may also be referred to as units, which refer to a series of computer program segments that can be executed by the processor of an electronic device and can perform fixed functions, and are stored in the memory of the electronic device.
  • each module/unit is as follows:
  • the local model training module 101 is configured to use the traffic data in the local database of one of the participants participating in the federated transfer learning to train a pre-created traffic flow prediction model until the loss function of the traffic flow prediction model Convergence and get the local model gradient.
  • the data migration module 102 is configured to transmit the gradient of the local model to other participants participating in the federated migration learning through migration learning to train their respective models,
  • the federated learning module 103 is configured to send the local model gradient to the cloud for federated learning when the loss functions in the models of all participants participating in the federated transfer learning converge;
  • the model updating module 104 is configured to receive the model gradient after federated learning returned from the cloud, and use the model gradient after federated learning to modify the model gradient of the traffic flow prediction model to obtain a standard traffic flow prediction model ;
  • the data analysis module 105 is configured to receive the traffic data transmitted by the user, and use the standard traffic flow prediction model to analyze the traffic data to obtain a traffic flow analysis result.
  • each module in the apparatus 100 for training a traffic flow prediction model based on federated transfer learning can execute a method for training a traffic flow prediction model based on federated transfer learning including the following steps:
  • Step 1 The local model training module 101 in one of the participants participating in the federated transfer learning uses the traffic data in the local database to train the pre-created traffic flow prediction model until the loss function of the traffic flow prediction model converges , get the local model gradient.
  • the data in the local database may be traffic data.
  • the local model training module 101 described in this embodiment of the present application may acquire the traffic data from each traffic scene by using a data acquisition device.
  • the traffic data includes vehicle information, personnel information, violation record information, etc.
  • the data collection device includes various camera devices, various sensors, etc.
  • the traffic scene includes highways, rural roads, morning and evening peaks. Scenes such as roads and bus stops.
  • the local model training module 101 is specifically used for: creating a traffic flow prediction model; using the data in the local database to train the traffic flow prediction model to obtain the output result of the traffic flow prediction model; using The preset loss function calculates the loss function value between the output result and the preset standard result; when the loss function value tends to converge, the trained traffic flow prediction model is obtained and the trained traffic flow prediction model is obtained.
  • the gradient parameters of the flow prediction model are obtained to obtain the local model gradient.
  • the traffic flow prediction model may be created by a convolutional neural network, and includes a convolutional layer, a pooling layer, a fully connected layer, and the like.
  • the convolution layer uses a pre-built function to perform feature extraction on the data;
  • the pooling layer compresses the extracted feature data to extract the main feature data and simplifies the computational complexity;
  • the fully connected layer To connect all feature data and output data.
  • the local model training module 101 trains the pre-created traffic flow prediction model by adjusting the parameters of the algorithm in the traffic flow prediction model through the traffic data in the local database, so that the trained traffic flow prediction model is Traffic data throughout the local database is preferably mapped or reflected.
  • the local model training module 101 in this embodiment of the present application may use the following mean difference method (MSE) to calculate the loss function value between the output result and the preset standard result;
  • MSE mean difference method
  • f(x i ) represents the model output result
  • yi represents the preset standard result
  • MSE represents the model loss function value
  • n represents the number of computations.
  • the local model training module 101 judges that the loss function value tends to converge, and obtains the traffic flow prediction model at this time.
  • Model gradients as local model gradients.
  • the local model training module 101 determines that the loss function value has not tended to converge, and it is necessary to further analyze the model of the traffic flow prediction model.
  • the gradient is updated.
  • the local model training module 101 uses the following formula to update the model gradient of the traffic flow prediction model:
  • ⁇ j represents the gradient of the updated model
  • ⁇ j-1 represents the gradient of the model before the update
  • ⁇ 0 and ⁇ 1 represent the preset initial values of the functions in the model
  • represents the step size of the gradient descent
  • Step 2 The data migration module 102 transmits the local model gradient to other participants participating in the federated migration learning through migration learning to train their respective models.
  • Transfer Learning is a machine learning method, which is to transfer knowledge from one domain (ie, the source domain) to another domain (ie, the target domain), so that the target domain can achieve better learning effects.
  • the transfer learning is to choose not to segment the data when there is little overlap between the data of the model and the data features, and to use transfer learning to overcome the lack of data or labels.
  • there are two different institutions one is a bank in China and the other is an e-commerce company in the United States. Due to geographical restrictions, the user groups of the two institutions have very little intersection.
  • the data characteristics of the two institutions only overlap in a small part. In this case, in order to carry out effective federated learning, transfer learning must be introduced to solve the problems of small unilateral data scale and few labeled samples, thereby improving the effect of the model.
  • the data migration module 102 described in this embodiment of the present application transmits the gradient of the local model to other participants participating in the federated migration learning to train their respective models through migration learning, which can save the number of model iterations of the other participants in the federated migration learning, thereby Save training time and improve model training results.
  • Step 3 When the loss functions in the models of all the participants participating in the federated transfer learning converge, the federated learning module 103 sends the local model gradient to the cloud for federated learning.
  • the federated learning includes: performing gradient aggregation operation on the local model gradients of each participant participating in the federated transfer learning to obtain a joint model gradient, and sending the joint model gradient to each participant participating in the federated transfer learning. participants.
  • the gradient aggregation is an operation to calculate a single value from a set of values. For example, calculating the daily average temperature value from the daily temperature accumulated over a month is an aggregation operation.
  • the joint model gradient may be obtained by performing a weighted average of the local gradient models of each participant participating in the federated transfer learning.
  • Step 4 The model updating module 104 receives the model gradient after federated learning returned from the cloud, and uses the model gradient after federated learning to modify the model gradient of the traffic flow prediction model to obtain a standard traffic flow prediction model.
  • the model updating module 104 updates the traffic flow prediction model using the model gradient after federated learning, including: loading the federated model gradient into the traffic flow prediction model, and modifying the traffic flow prediction model according to the federated model gradient The variables in the traffic flow prediction model are obtained to obtain the standard traffic flow prediction model.
  • Step 5 The data analysis module 105 receives the traffic flow data transmitted by the user, and uses the standard traffic flow prediction model to analyze the traffic flow data to obtain a traffic flow analysis result.
  • the road traffic situation can be predicted.
  • FIG. 3 it is a schematic structural diagram of an electronic device implementing a method for training a traffic flow prediction model based on federated transfer learning in the present application.
  • the electronic device 1 may include a processor 10, a memory 11 and a bus, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a traffic flow prediction model based on federated transfer learning Training program 12.
  • the memory 11 includes at least one type of readable storage medium, and the readable storage medium may be volatile or non-volatile.
  • the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (eg, SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like.
  • the memory 11 may be an internal storage unit of the electronic device 1 , such as a mobile hard disk of the electronic device 1 .
  • the memory 11 may also be an external storage device of the electronic device 1, such as a pluggable mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) equipped on the electronic device 1. card, flash memory card (FlashCard) and so on. Further, the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device.
  • the memory 11 can not only be used to store the application software and various data installed in the electronic device 1, such as the code of the traffic flow prediction model training program 12 based on federated transfer learning, etc., but also can be used to temporarily store the data that has been output or will be stored. output data.
  • the processor 10 may be composed of integrated circuits, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits packaged with the same function or different functions, including one or more integrated circuits.
  • Central processing unit Central Processing unit, CPU
  • microprocessor digital processing chip
  • graphics processor and combination of various control chips, etc.
  • the processor 10 is the control core (ControlUnit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and by running or executing the program or module stored in the memory 11 (for example, executing a A traffic flow prediction model training program for federated transfer learning, etc.), and calling the data stored in the memory 11 to perform various functions of the electronic device 1 and process the data.
  • ControlUnit ControlUnit
  • the bus may be a peripheral component interconnect (PCI for short) bus or an extended industry standard architecture (extended industry standard architecture, EISA for short) bus or the like.
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus and so on.
  • the bus is configured to implement connection communication between the memory 11 and at least one processor 10 and the like.
  • FIG. 3 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 3 does not constitute a limitation on the electronic device 1, and may include fewer or more components than those shown in the figure. components, or a combination of certain components, or a different arrangement of components.
  • the electronic device 1 may also include a power supply (such as a battery) for powering the various components, preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that the power management
  • the device implements functions such as charge management, discharge management, and power consumption management.
  • the power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and any other components.
  • the electronic device 1 may further include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
  • the electronic device 1 may also include a network interface, optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
  • a network interface optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
  • the electronic device 1 may further include a user interface, and the user interface may be a display (Display), an input unit (eg, a keyboard (Keyboard)), optionally, the user interface may also be a standard wired interface or a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, and the like.
  • the display may also be appropriately called a display screen or a display unit, which is used for displaying information processed in the electronic device 1 and for displaying a visualized user interface.
  • the traffic flow prediction model training program 12 based on federated transfer learning stored in the memory 11 of the electronic device 1 is a combination of multiple computer programs, and when running in the processor 10, can realize:
  • the pre-created traffic flow prediction model is trained by using the traffic data in the local database of one of the participants participating in the federated transfer learning, until the loss function of the traffic flow prediction model converges, and the local model gradient is obtained;
  • the local model gradient is transmitted to other participants participating in the federated transfer learning through transfer learning to train their respective models;
  • the local model gradient is sent to the cloud for federated learning
  • the traffic data transmitted by the user is received, and the standard traffic flow prediction model is used to analyze the traffic data to obtain a traffic flow analysis result.
  • the modules/units integrated in the electronic device 1 may be stored in a computer-readable storage medium.
  • the computer-readable storage medium may be volatile or non-volatile.
  • the computer-readable storage 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, Read Only Memory) -Only Memory).
  • the computer usable storage medium may mainly include a stored program area and a stored data area, wherein the stored program area may store an operating system, an application program required for at least one function, and the like; using the created data, etc.
  • modules described as separate components may or may not be physically separated, and components shown as modules may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional module in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of hardware plus software function modules.
  • the blockchain referred to in this application is a new application mode of computer technologies 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 to verify its Validity of information (anti-counterfeiting) and 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.

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Tourism & Hospitality (AREA)
  • Strategic Management (AREA)
  • Human Resources & Organizations (AREA)
  • Economics (AREA)
  • Physics & Mathematics (AREA)
  • Development Economics (AREA)
  • Software Systems (AREA)
  • General Business, Economics & Management (AREA)
  • Marketing (AREA)
  • Evolutionary Computation (AREA)
  • Quality & Reliability (AREA)
  • General Engineering & Computer Science (AREA)
  • Game Theory and Decision Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Computing Systems (AREA)
  • Operations Research (AREA)
  • Medical Informatics (AREA)
  • Artificial Intelligence (AREA)
  • Mathematical Physics (AREA)
  • Educational Administration (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Primary Health Care (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

一种基于联邦迁移学习的交通流预测模型训练方法、装置、设备及存储介质,涉及人工智能技术,方法包括:利用本地数据库进行交通流预测模型的训练,在损失函数收敛时,得到本地模型梯度(S1);通过迁移学习将所述本地模型梯度传输给参与联邦迁移学习的其他参与方进行各自模型的训练(S2);当所有参与方的模型中的损失函数都收敛时,将所述本地模型梯度发送给云端(S3);根据所述云端返回来的联邦学习之后的模型梯度,得到标准交通流预测模型(S4);利用所述标准交通流预测模型对交通数据进行分析,得到交通流分析结果(S5)。实现了在保护用户数据隐私的条件下,提高模型精确性及降低模型计算压力。

Description

交通流预测模型训练方法、装置、电子设备及存储介质
本申请要求于2020年12月01日提交中国专利局、申请号为202011381851.7,发明名称为“交通流预测模型训练方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及人工智能技术领域,尤其涉及一种基于联邦迁移学习的交通流预测模型训练方法、装置、电子设备及计算机可读存储介质。
背景技术
发明人意识到,随着机器学习和大数据的兴起,现有的基于深度学习的模型共享方法虽然在一些公共场景下,如交通流预测,取得了成功,但是在涉及到隐私保护的领域还是存在困难。由于法律对当前用户隐私保护的严格性,会导致各个系统只能够利用本地存储的数据库来训练模型,无法充分发挥大数据的优势。同样的,在训练一个优质的模型过程中需要不断地更新模型的梯度,这一过程增加了大量计算压力。
发明内容
本申请提供的一种基于联邦迁移学习的交通流预测模型训练方法,包括:
利用所述参与联邦迁移学习的其中一个参与方的本地数据库中的交通数据对预先创建的交通流预测模型进行训练,直到所述交通流预测模型的损失函数收敛,得到本地模型梯度;
通过迁移学习将所述本地模型梯度传输给参与联邦迁移学习的其他参与方进行各自模型的训练;
当所有参与联邦迁移学习的参与方的模型中的损失函数都收敛时,将所述本地模型梯度发送给云端进行联邦学习;
接收所述云端返回来的联邦学习之后的模型梯度,并利用所述联邦学习之后的模型梯度修改所述交通流预测模型的模型梯度,得到标准交通流预测模型;
接收用户传送的交通数据,并利用所述标准交通流预测模型对所述交通数据进行分析,得到交通流分析结果。
本申请还提供一种联邦迁移学习的模型训练装置,该装置包括:
本地模型训练模块,用于利用所述参与联邦迁移学习的其中一个参与方的本地数据库中的交通数据对预先创建的交通流预测模型进行训练,直到所述交通流预测模型的损失函数收敛,得到本地模型梯度;
数据迁移模块,用于通过迁移学习将所述本地模型梯度传输给参与联邦迁移学习的其他参与方进行各自模型的训练;
联邦学习模块,用于当所有参与联邦迁移学习的参与方的模型中的损失函数都收敛时,将所述本地模型梯度发送给云端进行联邦学习;
模型更新模块,用于接收所述云端返回来的联邦学习之后的模型梯度,并利用所述联邦学习之后的模型梯度修改所述交通流预测模型的模型梯度,得到标准交通流预测模型;
数据分析模块,用于接收用户传送的交通流数据,并利用所述标准交通流预测模型对所述交通流数据进行分析,得到交通流分析结果。
本申请还提供一种电子设备,所述电子设备包括:
至少一个处理器;以及,
与所述至少一个处理器通信连接的存储器;其中,
所述存储器存储有可被所述至少一个处理器执行的计算机程序指令,所述计算机程序指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如下所述的基于联邦迁移学习的交通流预测模型训练方法:
利用所述参与联邦迁移学习的其中一个参与方的本地数据库中的交通数据对预先创建的交通流预测模型进行训练,直到所述交通流预测模型的损失函数收敛,得到本地模型梯度;
通过迁移学习将所述本地模型梯度传输给参与联邦迁移学习的其他参与方进行各自模型的训练;
当所有参与联邦迁移学习的参与方的模型中的损失函数都收敛时,将所述本地模型梯度发送给云端进行联邦学习;
接收所述云端返回来的联邦学习之后的模型梯度,并利用所述联邦学习之后的模型梯度修改所述交通流预测模型的模型梯度,得到标准交通流预测模型;
接收用户传送的交通数据,并利用所述标准交通流预测模型对所述交通数据进行分析,得到交通流分析结果。
本申请还提供一种计算机可读存储介质,包括存储数据区和存储程序区,存储数据区存储创建的数据,存储程序区存储有计算机程序;其中,所述计算机程序被处理器执行时实现如下所述的基于联邦迁移学习的交通流预测模型训练方法:
利用所述参与联邦迁移学习的其中一个参与方的本地数据库中的交通数据对预先创建的交通流预测模型进行训练,直到所述交通流预测模型的损失函数收敛,得到本地模型梯度;
通过迁移学习将所述本地模型梯度传输给参与联邦迁移学习的其他参与方进行各自模型的训练;
当所有参与联邦迁移学习的参与方的模型中的损失函数都收敛时,将所述本地模型梯度发送给云端进行联邦学习;
接收所述云端返回来的联邦学习之后的模型梯度,并利用所述联邦学习之后的模型梯度修改所述交通流预测模型的模型梯度,得到标准交通流预测模型;
接收用户传送的交通数据,并利用所述标准交通流预测模型对所述交通数据进行分析,得到交通流分析结果。
附图说明
图1为本申请一实施例提供的基于联邦迁移学习的交通流预测模型训练方法的流程示意图;
图2为本申请一实施例提供的基于联邦迁移学习的交通流预测模型训练装置的模块示意图;
图3为本申请一实施例提供的实现基于联邦迁移学习的交通流预测模型训练方法的电子设备的内部结构示意图;
本申请目的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请实施例提供一种基于联邦迁移学习的交通流预测模型训练方法。所述基于联邦学习的模型训练方法的执行主体包括但不限于服务端、终端等能够被配置为执行本申请实施例提供的该方法的电子设备中的至少一种。换言之,所述基于联邦迁移学习的交通流预 测模型训练方法可以由安装在终端设备或服务端设备的软件或硬件来执行,所述软件可以是区块链平台。所述服务端包括但不限于:单台服务器、服务器集群、云端服务器或云端服务器集群等。
参照图1所示,为本申请一实施例提供的基于联邦迁移学习的交通流预测模型训练方法的流程示意图。在本申请实施例中,所述基于联邦迁移学习的交通流预测模型训练方法包括:
S1、利用所述参与联邦迁移学习的其中一个参与方的本地数据库中的交通数据对预先创建的交通流预测模型进行训练,直到所述交通流预测模型的损失函数收敛,得到本地模型梯度。
本申请实施例中,所述本地数据库中的数据可以为交通数据。本申请实施例可以利用数据采集设备从各个交通场景中获取所述交通数据。
详细地,所述交通数据包括车辆信息、人员信息、违章记录信息等,所述数据采集设备包括各种摄像设备、各种传感器等,及所述交通场景包括高速公路、乡村小路、早晚高峰的马路、公交站等场景。
详细地,所述S1包括:
创建交通流预测模型;
利用所述本地数据库中的交通数据对所述交通流预测模型进行训练,得到所述交通流预测模型的输出结果;
利用预设的损失函数计算所述输出结果与预设的标准结果之间的损失函数值;
当所述损失函数值趋于收敛时,得到训练完成的交通流预测模型并获取所述训练完成的交通流预测模型的梯度参数,得到本地模型梯度。
详细地,本申请实施例中,所述交通流预测模型可以通过卷积神经网络创建,并包括卷积层、池化层、全连接层等。其中,所述卷积层为利用预构建的函数对数据进行特征提取;所述池化层对所述提取的特征数据进行压缩,以提取主要特征数据,简化计算复杂度;所述全连接层为连接所有特征数据,并进行数据输出。
详细地,所述对预先创建的交通流预测模型进行训练是通过所述本地数据库中的交通数据调节所述交通流预测模型中算法的参数,使得训练后交通流预测模型是整个所述本地数据库中的交通数据较佳地映射或反射。
本申请实施例可以利用下述均值差方法(MSE)计算所述输出结果与预设的标准结果之间的损失函数值;
Figure PCTCN2021083086-appb-000001
其中,f(x i)表示模型输出结果,y i表示预设的标准结果,MSE表示模型损失函数值,n表示计算次数。
本申请其中一个实施例中,当所述损失函数值小于或者等于预设的阈值时,判断所述损失函数值趋于收敛,并获取此时的交通流预测模型的模型梯度,作为本地模型梯度。
本申请另一个实施例中,当所述损失函数值大于预设的阈值时,所述损失函数值尚未趋于收敛,需要进一步对所述交通流预测模型的模型梯度进行更新。
在本申请实施例中,利用如下公式对所述交通流预测模型的模型梯度进行更新:
Figure PCTCN2021083086-appb-000002
θ j表示更新后的模型梯度,θ j-1表示更新前的模型梯度,θ 0、θ 1表示模型中函数预设的初始值,α表示梯度下降的步伐大小,
Figure PCTCN2021083086-appb-000003
表示梯度下降的方向。
S2、通过迁移学习将所述本地模型梯度传输给参与联邦迁移学习的其他参与方进行各自模型的训练。
所述迁移学习(TransferLearning)是一种机器学习方法,是把一个领域(即源领域)的知识,迁移到另外一个领域(即目标领域),使得目标领域能够取得更好的学习效果。
详细地,所述迁移学习是在模型的数据与数据特征重叠都较少的情况下,选择不对数据进行切分,而利用迁移学习来克服数据或标签不足的情况。例如有两个不同机构,一家是位于中国的银行,另一家是位于美国的电商。由于受地域限制,这两家机构的用户群体交集很小,同时,由于机构类型的不同,二者的数据特征也只有小部分重合。在这种情况下,要想进行有效的联邦学习,就必须引入迁移学习,来解决单边数据规模小和标签样本少的问题,从而提升模型的效果
本申请实施例中,所述通过迁移学习将所述本地模型梯度传输给参与联邦迁移学习的其他参与方进行各自模型的训练,包括:
判断本地模型D s=k i{x i,y i}和参与联邦迁移学习的其他参与方中的模型D t=k j{x j,y j}中的数据类型以及用户范围是否相同;
在所述数据类型以及用户范围均相同时,将用本地模型梯度k i传输给参与联邦迁移学习的其他参与方,以进行所述其他参与方中的模型D t=k j{x j,y j}。
本申请实施例通过迁移学习将所述本地模型梯度传输给参与联邦迁移学习的其他参与方进行各自模型的训练,可以节省联邦迁移学习的其他参与方的模型迭代次数,从而节省训练时间,并提高模型训练效果。
S3、当所有参与联邦迁移学习的参与方的模型中的损失函数都收敛时,将所述本地模型梯度发送给云端进行联邦学习。
本申请实施例中,所述联邦学习包括;将各个参与联邦迁移学习的参与方的本地模型梯度进行梯度聚合运算,得到联合模型梯度,并将所述联合模型梯度发送给各个参与联邦迁移学习的参与方。
本申请实施例中,所述梯度聚合是从值的集合中计算出单个值得运算。例如,从一个月累计的每日温度计算出日平均温度值就是一个聚合运算。本申请其中一个实施例可以通过将各个参与联邦迁移学习的参与方的本地梯度模型进行加权平均得到所述联合模型梯度。
S4、接收所述云端返回来的联邦学习之后的模型梯度,并利用所述联邦学习之后的模型梯度修改所述交通流预测模型的模型梯度,得到标准交通流预测模型。
详细地,所述利用所述联邦学习之后的模型梯度更新交通流预测模型,包括:将所述联邦模型梯度载入所述交通流预测模型,并根据所述联邦模型梯度修改所述交通流预测模型中的变量,得到所述标准交通流预测模型。
S5、接收用户传送的交通数据,并利用所述标准交通流预测模型对所述交通数据进行分析,得到交通流分析结果。
本申请实施例中根据所述标准交通流预测模型对所述交通流数据进行分析可以对道路交通情况进行预测。本申请实施例通过迁移学习将本地训练完成的处于收敛状态的模型梯度传输给其他参与方进行训练,使得其他参与方可以减少模型迭代的次数,此外,通过服务器进行联邦学习的方式根据多个客户端利用本地数据训练完成的模型梯度进行模型梯度的更新,实现了扩大训练数据的效果,提高了模型的效果。因此,本申请实施例通过联邦迁移学习的方式实现了在保护用户数据隐私的条件下,提高模型精确性及降低模型计算压力。
如图3所示,是本申请基于联邦迁移学习的交通流预测模型训练装置的模块示意图。
本申请所述基于联邦迁移学习的交通流预测模型训练装置100可以安装于电子设备中。根据实现的功能,所述基于联邦迁移学习的交通流预测模型训练装置可以包括本地模型训练模块101、数据迁移模块102、联邦学习模块103、模型更新模块104及数据分析模块105。本申请所述模块也可以称之为单元,是指一种能够被电子设备处理器所执行,并且能够完成固定功能的一系列计算机程序段,其存储在电子设备的存储器中。
在本实施例中,关于各模块/单元的功能如下:
所述本地模型训练模块101,用于利用所述参与联邦迁移学习的其中一个参与方的本地数据库中的交通数据对预先创建的交通流预测模型进行训练,直到所述交通流预测模型的损失函数收敛,得到本地模型梯度。
所述数据迁移模块102,用于通过迁移学习将所述本地模型梯度传输给参与联邦迁移学习的其他参与方进行各自模型的训练,
所述联邦学习模块103,用于当所有参与联邦迁移学习的参与方的模型中的损失函数都收敛时,将所述本地模型梯度发送给云端进行联邦学习;
所述模型更新模块104,用于接收所述云端返回来的联邦学习之后的模型梯度,并利用所述联邦学习之后的模型梯度修改所述交通流预测模型的模型梯度,得到标准交通流预测模型;
所述数据分析模块105,用于接收用户传送的交通数据,并利用所述标准交通流预测模型对所述交通数据进行分析,得到交通流分析结果。
详细地,所述基于联邦迁移学习的交通流预测模型训练装置100中的各模块在运行时可以执行包括下述步骤的基于联邦迁移学习的交通流预测模型训练方法:
步骤一、所述参与联邦迁移学习的其中一个参与方中的本地模型训练模块101利用本地数据库中的交通数据对预先创建的交通流预测模型进行训练,直到所述交通流预测模型的损失函数收敛,得到本地模型梯度。
本申请实施例中,所述本地数据库中的数据可以为交通数据。本申请实施例所述本地模型训练模块101可以利用数据采集设备从各个交通场景中获取所述交通数据。
详细地,所述交通数据包括车辆信息、人员信息、违章记录信息等,所述数据采集设备包括各种摄像设备、各种传感器等,及所述交通场景包括高速公路、乡村小路、早晚高峰的马路、公交站等场景。
详细地,所述本地模型训练模块101具体用于:创建交通流预测模型;利用所述本地数据库中的数据对所述交通流预测模型进行训练,得到所述交通流预测模型的输出结果;利用预设的损失函数计算所述输出结果与预设的标准结果之间的损失函数值;当所述损失函数值趋于收敛时,得到训练完成的交通流预测模型并获取所述训练完成的交通流预测模型的梯度参数,得到本地模型梯度。
详细地,本申请实施例中,所述交通流预测模型可以通过卷积神经网络创建,并包括卷积层、池化层、全连接层等。其中,所述卷积层为利用预构建的函数对数据进行特征提取;所述池化层对所述提取的特征数据进行压缩,以提取主要特征数据,简化计算复杂度;所述全连接层为连接所有特征数据,并进行数据输出。
详细地,所述本地模型训练模块101对预先创建的交通流预测模型进行训练是通过所述本地数据库中的交通数据调节所述交通流预测模型中算法的参数,使得训练后交通流预测模型是整个所述本地数据库中的交通数据较佳地映射或反射。
本申请实施例所述本地模型训练模块101可以利用下述均值差方法(MSE)计算所述输出结果与预设的标准结果之间的损失函数值;
Figure PCTCN2021083086-appb-000004
其中,f(x i)表示模型输出结果,y i表示预设的标准结果,MSE表示模型损失函数值,n表示计算次数。
本申请其中一个实施例中,当所述损失函数值小于或者等于预设的阈值时,所述本地模型训练模块101判断所述损失函数值趋于收敛,并获取此时的交通流预测模型的模型梯度,作为本地模型梯度。
本申请另一个实施例中,当所述损失函数值大于预设的阈值时,所述本地模型训练模块101判断所述损失函数值尚未趋于收敛,需要进一步对所述交通流预测模型的模型梯度进行更新。
在本申请实施例中,所述本地模型训练模块101利用如下公式对所述交通流预测模型的模型梯度进行更新:
Figure PCTCN2021083086-appb-000005
θ j表示更新后的模型梯度,θ j-1表示更新前的模型梯度,θ 0、θ 1表示模型中函数预设的初始值,α表示梯度下降的步伐大小,
Figure PCTCN2021083086-appb-000006
表示梯度下降的方向。
步骤二、数据迁移模块102通过迁移学习将所述本地模型梯度传输给参与联邦迁移学习的其他参与方进行各自模型的训练。
所述迁移学习(TransferLearning)是一种机器学习方法,是把一个领域(即源领域)的知识,迁移到另外一个领域(即目标领域),使得目标领域能够取得更好的学习效果。
详细地,所述迁移学习是在模型的数据与数据特征重叠都较少的情况下,选择不对数据进行切分,而利用迁移学习来克服数据或标签不足的情况。例如有两个不同机构,一家是位于中国的银行,另一家是位于美国的电商。由于受地域限制,这两家机构的用户群体交集很小,同时,由于机构类型的不同,二者的数据特征也只有小部分重合。在这种情况下,要想进行有效的联邦学习,就必须引入迁移学习,来解决单边数据规模小和标签样本少的问题,从而提升模型的效果
本申请实施例中,所述数据迁移模块102在将所述本地模型梯度传输给参与联邦迁移学习的其他参与方进行各自模型的训练时,执行:
判断本地模型D s=k i{x i,y i}和参与联邦迁移学习的其他参与方中的模型D t=k j{x j,y j}中的数据类型以及用户范围是否相同;
在所述数据类型以及用户范围均相同时,将用本地模型梯度k i传输给参与联邦迁移学习的其他参与方,以进行所述其他参与方中的模型D t=k j{x j,y j}。
本申请实施例所述数据迁移模块102通过迁移学习将所述本地模型梯度传输给参与联邦迁移学习的其他参与方进行各自模型的训练,可以节省联邦迁移学习的其他参与方的模型迭代次数,从而节省训练时间,并提高模型训练效果。
步骤三、当所有参与联邦迁移学习的参与方的模型中的损失函数都收敛时,联邦学习模块103将所述本地模型梯度发送给云端进行联邦学习。
本申请实施例中,所述联邦学习包括:将各个参与联邦迁移学习的参与方的本地模型梯度进行梯度聚合运算,得到联合模型梯度,并将所述联合模型梯度发送给各个参与联邦迁移学习的参与方。
本申请实施例中,所述梯度聚合是从值的集合中计算出单个值得运算。例如,从一个 月累计的每日温度计算出日平均温度值就是一个聚合运算。本申请其中一个实施例可以通过将各个参与联邦迁移学习的参与方的本地梯度模型进行加权平均得到所述联合模型梯度。
步骤四、模型更新模块104接收所述云端返回来的联邦学习之后的模型梯度,并利用所述联邦学习之后的模型梯度修改所述交通流预测模型的模型梯度,得到标准交通流预测模型。
详细地,所述模型更新模块104利用所述联邦学习之后的模型梯度更新交通流预测模型,包括:将所述联邦模型梯度载入所述交通流预测模型,并根据所述联邦模型梯度修改所述交通流预测模型中的变量,得到所述标准交通流预测模型。
步骤五、数据分析模块105接收用户传送的交通流数据,并利用所述标准交通流预测模型对所述交通流数据进行分析,得到交通流分析结果。
本申请实施例根据所述标准交通流预测模型对所述交通流数据进行分析可以对道路交通情况进行预测。
如图3所示,是本申请实现基于联邦迁移学习的交通流预测模型训练方法的电子设备的结构示意图。
所述电子设备1可以包括处理器10、存储器11和总线,还可以包括存储在所述存储器11中并可在所述处理器10上运行的计算机程序,如基于联邦迁移学习的交通流预测模型训练程序12。
其中,所述存储器11至少包括一种类型的可读存储介质,所述可读存储介质可以是易失性的,也可以是非易失性的。具体的,所述可读存储介质包括闪存、移动硬盘、多媒体卡、卡型存储器(例如:SD或DX存储器等)、磁性存储器、磁盘、光盘等。所述存储器11在一些实施例中可以是电子设备1的内部存储单元,例如该电子设备1的移动硬盘。所述存储器11在另一些实施例中也可以是电子设备1的外部存储设备,例如电子设备1上配备的插接式移动硬盘、智能存储卡(SmartMediaCard,SMC)、安全数字(SecureDigital,SD)卡、闪存卡(FlashCard)等。进一步地,所述存储器11还可以既包括电子设备1的内部存储单元也包括外部存储设备。所述存储器11不仅可以用于存储安装于电子设备1的应用软件及各类数据,例如基于联邦迁移学习的交通流预测模型训练程序12的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。
所述处理器10在一些实施例中可以由集成电路组成,例如可以由单个封装的集成电路所组成,也可以是由多个相同功能或不同功能封装的集成电路所组成,包括一个或者多个中央处理器(CentralProcessingunit,CPU)、微处理器、数字处理芯片、图形处理器及各种控制芯片的组合等。所述处理器10是所述电子设备的控制核心(ControlUnit),利用各种接口和线路连接整个电子设备的各个部件,通过运行或执行存储在所述存储器11内的程序或者模块(例如执行基于联邦迁移学习的交通流预测模型训练程序等),以及调用存储在所述存储器11内的数据,以执行电子设备1的各种功能和处理数据。
所述总线可以是外设部件互连标准(peripheralcomponentinterconnect,简称PCI)总线或扩展工业标准结构(extendedindustrystandardarchitecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。所述总线被设置为实现所述存储器11以及至少一个处理器10等之间的连接通信。
图3仅示出了具有部件的电子设备,本领域技术人员可以理解的是,图3示出的结构并不构成对所述电子设备1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。
例如,尽管未示出,所述电子设备1还可以包括给各个部件供电的电源(比如电池),优选地,电源可以通过电源管理装置与所述至少一个处理器10逻辑相连,从而通过电源 管理装置实现充电管理、放电管理、以及功耗管理等功能。电源还可以包括一个或一个以上的直流或交流电源、再充电装置、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。所述电子设备1还可以包括多种传感器、蓝牙模块、Wi-Fi模块等,在此不再赘述。
进一步地,所述电子设备1还可以包括网络接口,可选地,所述网络接口可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该电子设备1与其他电子设备之间建立通信连接。
可选地,该电子设备1还可以包括用户接口,用户接口可以是显示器(Display)、输入单元(比如键盘(Keyboard)),可选地,用户接口还可以是标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(OrganicLight-EmittingDiode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在电子设备1中处理的信息以及用于显示可视化的用户界面。
应该了解,所述实施例仅为说明之用,在专利申请范围上并不受此结构的限制。
所述电子设备1中的所述存储器11存储的基于联邦迁移学习的交通流预测模型训练程序12是多个计算机程序的组合,在所述处理器10中运行时,可以实现:
利用所述参与联邦迁移学习的其中一个参与方的本地数据库中的交通数据对预先创建的交通流预测模型进行训练,直到所述交通流预测模型的损失函数收敛,得到本地模型梯度;
通过迁移学习将所述本地模型梯度传输给参与联邦迁移学习的其他参与方进行各自模型的训练;
当所有参与联邦迁移学习的参与方的模型中的损失函数都收敛时,将所述本地模型梯度发送给云端进行联邦学习;
接收所述云端返回来的联邦学习之后的模型梯度,并利用所述联邦学习之后的模型梯度修改所述交通流预测模型的模型梯度,得到标准交通流预测模型;
接收用户传送的交通数据,并利用所述标准交通流预测模型对所述交通数据进行分析,得到交通流分析结果。
进一步地,所述电子设备1集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。所述计算机可读存储介质可以是易失性的,也可以是非易失性的。具体的,所述计算机可读存储介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-OnlyMemory)。
进一步地,所述计算机可用存储介质可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等;存储数据区可存储根据区块链节点的使用所创建的数据等。
在本申请所提供的几个实施例中,应该理解到,所揭露的设备,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。
因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附关联图表记视为限制所涉及的权利要求。
本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。
此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。系统权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第二等词语用来表示名称,而并不表示任何特定的顺序。
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。

Claims (20)

  1. 一种基于联邦迁移学习的交通流预测模型训练方法,其中,所述方法应用于参与联邦迁移学习的其中一个参与方,包括:
    利用所述参与联邦迁移学习的其中一个参与方的本地数据库中的交通数据对预先创建的交通流预测模型进行训练,直到所述交通流预测模型的损失函数收敛,得到本地模型梯度;
    通过迁移学习将所述本地模型梯度传输给参与联邦迁移学习的其他参与方进行各自模型的训练;
    当所有参与联邦迁移学习的参与方的模型中的损失函数都收敛时,将所述本地模型梯度发送给云端进行联邦学习;
    接收所述云端返回来的联邦学习之后的模型梯度,并利用所述联邦学习之后的模型梯度修改所述交通流预测模型的模型梯度,得到标准交通流预测模型;
    接收用户传送的交通流数据,并利用所述标准交通流预测模型对所述交通数据进行分析,得到交通流分析结果。
  2. 如权利要求1所述的基于联邦迁移学习的交通流预测模型训练方法,其中,所述利用所述参与联邦迁移学习的其中一个参与方的本地数据库中的交通数据对预先创建的交通流预测模型进行训练,直到所述交通流预测模型的损失函数收敛,得到本地模型梯度,包括:
    创建交通流预测模型;
    利用所述本地数据库中的交通数据对所述交通流预测模型进行训练,得到所述交通流预测模型的输出结果;
    利用预设的损失函数计算所述输出结果与预设的标准结果之间的损失函数值;
    当所述损失函数值趋于收敛时,得到训练完成的交通流预测模型并获取所述训练完成的交通流预测模型的梯度参数,得到本地模型梯度。
  3. 如权利要求2所述的基于联邦迁移学习的交通流预测模型训练方法,其中,所述利用预设的损失函数计算所述输出结果与预设的标准结果之间的损失函数值,包括:
    利用如下公式计算所述损失函数值:
    Figure PCTCN2021083086-appb-100001
    其中,f(x i)表示模型输出结果,y i表示预设的标准结果,MSE表示模型损失函数值,n表示计算次数。
  4. 如权利要求3所述的基于联邦迁移学习的交通流预测模型训练方法,其中,所述利用预设的损失函数计算所述输出结果与预设的标准结果之间的损失函数值之后,还包括:
    当所述损失函数值尚未趋于收敛,利用下述公式对所述交通流预测模型的模型梯度进行更新:
    Figure PCTCN2021083086-appb-100002
    θ j表示更新后的模型梯度,θ j-1表示更新前的模型梯度,θ 0、θ 1是预设的模型梯度初始值,α表示梯度下降的步伐大小,
    Figure PCTCN2021083086-appb-100003
    表示梯度下降的方向。
  5. 如权利要求1所述的基于联邦迁移学习的交通流预测模型训练方法,其中,所述通过迁移学习将所述本地模型梯度传输给参与联邦学习的其他参与方进行各自的模型训练,包括:
    判断本地模型D s=k i{x i,y i}和参与联邦迁移学习的其他参与方中的模型D t= k j{x j,y j}中的数据类型以及用户范围是否相同;
    在所述数据类型以及用户范围均相同时,将用本地模型梯度k i传输给参与联邦迁移学习的其他参与方,以进行所述其他参与方中的模型D t=k j{x j,y j}。
  6. 如权利要求1所述的基于联邦迁移学习的交通流预测模型训练方法,其中,所述将所述本地模型梯度发送给云端进行联邦学习,包括:
    将各个参与联邦迁移学习的参与方的本地模型梯度进行梯度聚合运算得到联合模型梯度;
    将所述联合模型梯度发送给各个参与联邦迁移学习的参与方。
  7. 如权利要求6所述的基于联邦迁移学习的交通流预测模型训练方法,其中,所述将所述联合模型梯度发送给各个参与联邦迁移学习的参与方之后还包括:
    将所述联邦模型梯度载入所述交通流预测模型;
    根据所述联邦模型梯度修改所述交通流预测模型中的变量,得到所述标准交通流预测模型。
  8. 一种基于联邦迁移学习的交通流预测模型训练装置,其中,所述装置包括:
    本地模型训练模块,用于利用所述参与联邦迁移学习的其中一个参与方的本地数据库中的交通数据对预先创建的交通流预测模型进行训练,直到所述交通流预测模型的损失函数收敛,得到本地模型梯度;
    数据迁移模块,用于通过迁移学习将所述本地模型梯度传输给参与联邦迁移学习的其他参与方进行各自模型的训练;
    联邦学习模块,用于当所有参与联邦迁移学习的参与方的模型中的损失函数都收敛时,将所述本地模型梯度发送给云端进行联邦学习;
    模型更新模块,用于接收所述云端返回来的联邦学习之后的模型梯度,并利用所述联邦学习之后的模型梯度修改所述交通流预测模型的模型梯度,得到标准交通流预测模型;
    数据分析模块,用于接收用户传送的交通数据,并利用所述标准交通流预测模型对所述交通数据进行分析,得到交通流分析结果。
  9. 一种电子设备,其中,所述电子设备包括:
    至少一个处理器;以及,
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的计算机程序指令,所述计算机程序指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如下所述的基于联邦迁移学习的交通流预测模型训练方法:
    利用所述参与联邦迁移学习的其中一个参与方的本地数据库中的交通数据对预先创建的交通流预测模型进行训练,直到所述交通流预测模型的损失函数收敛,得到本地模型梯度;
    通过迁移学习将所述本地模型梯度传输给参与联邦迁移学习的其他参与方进行各自模型的训练;
    当所有参与联邦迁移学习的参与方的模型中的损失函数都收敛时,将所述本地模型梯度发送给云端进行联邦学习;
    接收所述云端返回来的联邦学习之后的模型梯度,并利用所述联邦学习之后的模型梯度修改所述交通流预测模型的模型梯度,得到标准交通流预测模型;
    接收用户传送的交通流数据,并利用所述标准交通流预测模型对所述交通数据进行分析,得到交通流分析结果。
  10. 如权利要求9所述的电子设备,其中,所述利用所述参与联邦迁移学习的其中一个参与方的本地数据库中的交通数据对预先创建的交通流预测模型进行训练,直到所述交通流预测模型的损失函数收敛,得到本地模型梯度,包括:
    创建交通流预测模型;
    利用所述本地数据库中的交通数据对所述交通流预测模型进行训练,得到所述交通流预测模型的输出结果;
    利用预设的损失函数计算所述输出结果与预设的标准结果之间的损失函数值;
    当所述损失函数值趋于收敛时,得到训练完成的交通流预测模型并获取所述训练完成的交通流预测模型的梯度参数,得到本地模型梯度。
  11. 如权利要求10所述的电子设备,其中,所述利用预设的损失函数计算所述输出结果与预设的标准结果之间的损失函数值,包括:
    利用如下公式计算所述损失函数值:
    Figure PCTCN2021083086-appb-100004
    其中,f(x i)表示模型输出结果,y i表示预设的标准结果,MSE表示模型损失函数值,n表示计算次数。
  12. 如权利要求11所述的电子设备,其中,所述利用预设的损失函数计算所述输出结果与预设的标准结果之间的损失函数值之后,还包括:
    当所述损失函数值尚未趋于收敛,利用下述公式对所述交通流预测模型的模型梯度进行更新:
    Figure PCTCN2021083086-appb-100005
    θ j表示更新后的模型梯度,θ j-1表示更新前的模型梯度,θ 0、θ 1是预设的模型梯度初始值,α表示梯度下降的步伐大小,
    Figure PCTCN2021083086-appb-100006
    表示梯度下降的方向。
  13. 如权利要求9所述的电子设备,其中,所述通过迁移学习将所述本地模型梯度传输给参与联邦学习的其他参与方进行各自的模型训练,包括:
    判断本地模型D s=k i{x i,y i}和参与联邦迁移学习的其他参与方中的模型D t=k j{x j,y j}中的数据类型以及用户范围是否相同;
    在所述数据类型以及用户范围均相同时,将用本地模型梯度k i传输给参与联邦迁移学习的其他参与方,以进行所述其他参与方中的模型D t=k j{x j,y j}。
  14. 如权利要求9所述的电子设备,其中,所述将所述本地模型梯度发送给云端进行联邦学习,包括:
    将各个参与联邦迁移学习的参与方的本地模型梯度进行梯度聚合运算得到联合模型梯度;
    将所述联合模型梯度发送给各个参与联邦迁移学习的参与方。
  15. 一种计算机可读存储介质,包括存储数据区和存储程序区,存储数据区存储创建的数据,存储程序区存储有计算机程序,其中,所述计算机程序被处理器执行时实现如下所述的基于联邦迁移学习的交通流预测模型训练方法:
    利用所述参与联邦迁移学习的其中一个参与方的本地数据库中的交通数据对预先创建的交通流预测模型进行训练,直到所述交通流预测模型的损失函数收敛,得到本地模型梯度;
    通过迁移学习将所述本地模型梯度传输给参与联邦迁移学习的其他参与方进行各自模型的训练;
    当所有参与联邦迁移学习的参与方的模型中的损失函数都收敛时,将所述本地模型梯度发送给云端进行联邦学习;
    接收所述云端返回来的联邦学习之后的模型梯度,并利用所述联邦学习之后的模型梯度修改所述交通流预测模型的模型梯度,得到标准交通流预测模型;
    接收用户传送的交通流数据,并利用所述标准交通流预测模型对所述交通数据进行分析,得到交通流分析结果。
  16. 如权利要求15所述的计算机可读存储介质,其中,所述利用所述参与联邦迁移学习的其中一个参与方的本地数据库中的交通数据对预先创建的交通流预测模型进行训练,直到所述交通流预测模型的损失函数收敛,得到本地模型梯度,包括:
    创建交通流预测模型;
    利用所述本地数据库中的交通数据对所述交通流预测模型进行训练,得到所述交通流预测模型的输出结果;
    利用预设的损失函数计算所述输出结果与预设的标准结果之间的损失函数值;
    当所述损失函数值趋于收敛时,得到训练完成的交通流预测模型并获取所述训练完成的交通流预测模型的梯度参数,得到本地模型梯度。
  17. 如权利要求16所述的计算机可读存储介质,其中,所述利用预设的损失函数计算所述输出结果与预设的标准结果之间的损失函数值,包括:
    利用如下公式计算所述损失函数值:
    Figure PCTCN2021083086-appb-100007
    其中,f(x i)表示模型输出结果,y i表示预设的标准结果,MSE表示模型损失函数值,n表示计算次数。
  18. 如权利要求17所述的计算机可读存储介质,其中,所述利用预设的损失函数计算所述输出结果与预设的标准结果之间的损失函数值之后,还包括:
    当所述损失函数值尚未趋于收敛,利用下述公式对所述交通流预测模型的模型梯度进行更新:
    Figure PCTCN2021083086-appb-100008
    θ j表示更新后的模型梯度,θ j-1表示更新前的模型梯度,θ 0、θ 1是预设的模型梯度初始值,α表示梯度下降的步伐大小,
    Figure PCTCN2021083086-appb-100009
    表示梯度下降的方向。
  19. 如权利要求15所述的计算机可读存储介质,其中,所述通过迁移学习将所述本地模型梯度传输给参与联邦学习的其他参与方进行各自的模型训练,包括:
    判断本地模型D s=k i{x i,y i}和参与联邦迁移学习的其他参与方中的模型D t=k j{x j,y j}中的数据类型以及用户范围是否相同;
    在所述数据类型以及用户范围均相同时,将用本地模型梯度k i传输给参与联邦迁移学习的其他参与方,以进行所述其他参与方中的模型D t=k j{x j,y j}。
  20. 如权利要求15所述的计算机可读存储介质,其中,所述将所述本地模型梯度发送给云端进行联邦学习,包括:
    将各个参与联邦迁移学习的参与方的本地模型梯度进行梯度聚合运算得到联合模型梯度;
    将所述联合模型梯度发送给各个参与联邦迁移学习的参与方。
PCT/CN2021/083086 2020-12-01 2021-03-25 交通流预测模型训练方法、装置、电子设备及存储介质 WO2022116424A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011381851.7 2020-12-01
CN202011381851.7A CN112446544A (zh) 2020-12-01 2020-12-01 交通流预测模型训练方法、装置、电子设备及存储介质

Publications (1)

Publication Number Publication Date
WO2022116424A1 true WO2022116424A1 (zh) 2022-06-09

Family

ID=74739191

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/083086 WO2022116424A1 (zh) 2020-12-01 2021-03-25 交通流预测模型训练方法、装置、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN112446544A (zh)
WO (1) WO2022116424A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115311860A (zh) * 2022-08-09 2022-11-08 中国科学院计算技术研究所 一种交通流量预测模型的在线联邦学习方法
CN116148193A (zh) * 2023-04-18 2023-05-23 天津中科谱光信息技术有限公司 水质监测方法、装置、设备及存储介质

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112446544A (zh) * 2020-12-01 2021-03-05 平安科技(深圳)有限公司 交通流预测模型训练方法、装置、电子设备及存储介质
CN113177595B (zh) * 2021-04-29 2022-07-12 北京明朝万达科技股份有限公司 文档分类模型构建、训练、测试方法及模型构建系统
CN113190872A (zh) * 2021-05-28 2021-07-30 脸萌有限公司 数据保护方法、网络结构训练方法、装置、介质及设备
CN113313264B (zh) * 2021-06-02 2022-08-12 河南大学 车联网场景下的高效联邦学习方法
CN117744826A (zh) * 2022-09-14 2024-03-22 抖音视界有限公司 模型训练方法、装置以及系统和存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160299256A1 (en) * 2015-04-10 2016-10-13 Google Inc. Monitoring external vibration sources for data collection
CN111241580A (zh) * 2020-01-09 2020-06-05 广州大学 一种基于可信执行环境的联邦学习方法
CN111611610A (zh) * 2020-04-12 2020-09-01 西安电子科技大学 联邦学习信息处理方法、系统、存储介质、程序、终端
CN111899076A (zh) * 2020-08-12 2020-11-06 科技谷(厦门)信息技术有限公司 一种基于联邦学习技术平台的航空服务定制化系统及方法
CN111935156A (zh) * 2020-08-12 2020-11-13 科技谷(厦门)信息技术有限公司 一种联邦学习的数据隐私保护方法
CN112446544A (zh) * 2020-12-01 2021-03-05 平安科技(深圳)有限公司 交通流预测模型训练方法、装置、电子设备及存储介质

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109189825B (zh) * 2018-08-10 2022-03-15 深圳前海微众银行股份有限公司 横向数据切分联邦学习建模方法、服务器及介质
CN111739285A (zh) * 2020-05-14 2020-10-02 南方科技大学 交通流量的预测方法、装置、设备及计算机存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160299256A1 (en) * 2015-04-10 2016-10-13 Google Inc. Monitoring external vibration sources for data collection
CN111241580A (zh) * 2020-01-09 2020-06-05 广州大学 一种基于可信执行环境的联邦学习方法
CN111611610A (zh) * 2020-04-12 2020-09-01 西安电子科技大学 联邦学习信息处理方法、系统、存储介质、程序、终端
CN111899076A (zh) * 2020-08-12 2020-11-06 科技谷(厦门)信息技术有限公司 一种基于联邦学习技术平台的航空服务定制化系统及方法
CN111935156A (zh) * 2020-08-12 2020-11-13 科技谷(厦门)信息技术有限公司 一种联邦学习的数据隐私保护方法
CN112446544A (zh) * 2020-12-01 2021-03-05 平安科技(深圳)有限公司 交通流预测模型训练方法、装置、电子设备及存储介质

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115311860A (zh) * 2022-08-09 2022-11-08 中国科学院计算技术研究所 一种交通流量预测模型的在线联邦学习方法
CN116148193A (zh) * 2023-04-18 2023-05-23 天津中科谱光信息技术有限公司 水质监测方法、装置、设备及存储介质
CN116148193B (zh) * 2023-04-18 2023-07-18 天津中科谱光信息技术有限公司 水质监测方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN112446544A (zh) 2021-03-05

Similar Documents

Publication Publication Date Title
WO2022116424A1 (zh) 交通流预测模型训练方法、装置、电子设备及存储介质
WO2021189906A1 (zh) 基于联邦学习的目标检测方法、装置、设备及存储介质
WO2021238281A1 (zh) 一种神经网络的训练方法、图像分类系统及相关设备
WO2021151345A1 (zh) 识别模型的参数获取方法、装置、电子设备及存储介质
WO2021189901A1 (zh) 图像分割方法、装置、电子设备及计算机可读存储介质
WO2021151338A1 (zh) 医学影像图片分析方法、装置、电子设备及可读存储介质
WO2022121156A1 (zh) 图像中目标物检测方法、装置、电子设备及可读存储介质
WO2022105179A1 (zh) 生物特征图像识别方法、装置、电子设备及可读存储介质
WO2022048209A1 (zh) 车牌识别方法、装置、电子设备及存储介质
CN112801718B (zh) 用户行为预测方法、装置、设备及介质
WO2022141858A1 (zh) 行人检测方法、装置、电子设备及存储介质
WO2021189827A1 (zh) 识别模糊图像的方法、装置、设备及计算机可读存储介质
US10732694B2 (en) Power state control of a mobile device
CN104112084B (zh) 用于基于执行的许可发现和优化的方法和系统
WO2023159755A1 (zh) 虚假新闻检测方法、装置、设备及存储介质
WO2022160442A1 (zh) 答案生成方法、装置、电子设备及可读存储介质
WO2022227192A1 (zh) 图像分类方法、装置、电子设备及介质
CN113157739B (zh) 跨模态检索方法、装置、电子设备及存储介质
CN112269875B (zh) 文本分类方法、装置、电子设备及存储介质
CN116569194A (zh) 联合学习
CN112651782A (zh) 基于缩放点积注意力的行为预测方法、装置、设备及介质
WO2023178979A1 (zh) 问题标注方法、装置、电子设备及存储介质
WO2022223052A1 (zh) 加速器、计算机系统和方法
WO2022227191A1 (zh) 非主动活体检测方法、装置、电子设备及存储介质
WO2022222228A1 (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: 21899468

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

Country of ref document: EP

Kind code of ref document: A1