CN111797302A - Model processing method, device, storage medium and electronic device - Google Patents
Model processing method, device, storage medium and electronic device Download PDFInfo
- Publication number
- CN111797302A CN111797302A CN201910282133.5A CN201910282133A CN111797302A CN 111797302 A CN111797302 A CN 111797302A CN 201910282133 A CN201910282133 A CN 201910282133A CN 111797302 A CN111797302 A CN 111797302A
- Authority
- CN
- China
- Prior art keywords
- model
- model parameters
- parameters
- prediction
- information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 36
- 238000003860 storage Methods 0.000 title claims abstract description 12
- 238000012549 training Methods 0.000 claims abstract description 47
- 238000000034 method Methods 0.000 claims description 46
- 238000012545 processing Methods 0.000 claims description 29
- 230000005477 standard model Effects 0.000 claims description 18
- 238000004590 computer program Methods 0.000 claims description 16
- 230000015654 memory Effects 0.000 claims description 16
- 238000004422 calculation algorithm Methods 0.000 description 16
- 230000008447 perception Effects 0.000 description 14
- 238000010586 diagram Methods 0.000 description 12
- 230000007613 environmental effect Effects 0.000 description 11
- 230000006399 behavior Effects 0.000 description 10
- 238000000605 extraction Methods 0.000 description 10
- 230000006870 function Effects 0.000 description 10
- 230000008569 process Effects 0.000 description 9
- 238000013526 transfer learning Methods 0.000 description 8
- 230000010354 integration Effects 0.000 description 7
- 238000012935 Averaging Methods 0.000 description 6
- 230000001133 acceleration Effects 0.000 description 6
- 230000036772 blood pressure Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 3
- 238000004140 cleaning Methods 0.000 description 3
- 230000001351 cycling effect Effects 0.000 description 3
- 238000001914 filtration Methods 0.000 description 3
- 238000011430 maximum method Methods 0.000 description 3
- 230000009471 action Effects 0.000 description 2
- 238000013501 data transformation Methods 0.000 description 2
- 238000013135 deep learning Methods 0.000 description 2
- 230000010365 information processing Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000003909 pattern recognition Methods 0.000 description 2
- 230000009467 reduction Effects 0.000 description 2
- 230000005355 Hall effect Effects 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000003190 augmentative effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000007635 classification algorithm Methods 0.000 description 1
- 238000013527 convolutional neural network Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 238000009826 distribution Methods 0.000 description 1
- 239000011521 glass Substances 0.000 description 1
- 238000003064 k means clustering Methods 0.000 description 1
- 238000013508 migration Methods 0.000 description 1
- 230000005012 migration Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 238000012856 packing Methods 0.000 description 1
- 230000000306 recurrent effect Effects 0.000 description 1
- 230000006403 short-term memory Effects 0.000 description 1
- 238000012706 support-vector machine Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9535—Search customisation based on user profiles and personalisation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V30/00—Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
- G06V30/10—Character recognition
- G06V30/19—Recognition using electronic means
- G06V30/192—Recognition using electronic means using simultaneous comparisons or correlations of the image signals with a plurality of references
- G06V30/194—References adjustable by an adaptive method, e.g. learning
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M2250/00—Details of telephonic subscriber devices
- H04M2250/12—Details of telephonic subscriber devices including a sensor for measuring a physical value, e.g. temperature or motion
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Engineering & Computer Science (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Evolutionary Computation (AREA)
- Evolutionary Biology (AREA)
- Bioinformatics & Computational Biology (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Multimedia (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
本申请实施例提供一种模型处理方法、装置、存储介质及电子设备,模型处理方法包括:获取第一信息,并将所述第一信息作为训练样本输入预测模型进行训练,得到训练后预测模型的模型参数;将所述模型参数发送至服务器;接收所述服务器返回的共用模型参数,所述共用模型参数为所述模型参数与其他用户对应的模型参数计算得到的;根据所述共用模型参数得到第二预测模型。显著提升了预测模型的预测精度和泛化能力,同时能够很好地保护用户的数据隐私。
The embodiment of the present application provides a model processing method, device, storage medium and electronic device, the model processing method includes: obtaining first information, and inputting the first information as a training sample into a prediction model for training, obtaining model parameters of the trained prediction model; sending the model parameters to a server; receiving a common model parameter returned by the server, the common model parameter being calculated from the model parameter and the model parameters corresponding to other users; and obtaining a second prediction model according to the common model parameter. The prediction accuracy and generalization ability of the prediction model are significantly improved, and the user's data privacy can be well protected.
Description
技术领域technical field
本申请涉及电子技术领域,特别涉及一种模型处理方法、装置、存储介质及电子设备。The present application relates to the field of electronic technology, and in particular, to a model processing method, device, storage medium and electronic device.
背景技术Background technique
随着人工智能的发展,诸如智能手机等电子设备的智能化程度越来越高。电子设备可以根据采集的数据为用户提供各种智能化的功能。With the development of artificial intelligence, electronic devices such as smartphones are becoming more and more intelligent. Electronic devices can provide users with various intelligent functions according to the collected data.
相关技术中,电子设备中的预测模型会根据采集到的信息进行预测,进而给用户提供相应的服务。如推荐相应的应用等。但是相关技术中的预测模型因为采集的信息有限,导致学习出的算法精度不够。In the related art, the prediction model in the electronic device will make predictions according to the collected information, and then provide corresponding services to users. Such as recommending corresponding applications, etc. However, due to the limited information collected, the prediction model in the related art results in insufficient accuracy of the learned algorithm.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供一种模型处理方法、装置、存储介质及电子设备,能够提高预测模型的预测精度。Embodiments of the present application provide a model processing method, apparatus, storage medium, and electronic device, which can improve the prediction accuracy of the prediction model.
本申请实施例提供一种模型处理方法,其包括:The embodiment of the present application provides a model processing method, which includes:
获取第一信息,并将所述第一信息作为训练样本输入预测模型进行训练,得到训练后的第一预测模型的目标模型参数;obtaining first information, and inputting the first information as a training sample into a prediction model for training, to obtain target model parameters of the trained first prediction model;
将所述目标模型参数发送至服务器;sending the target model parameters to the server;
接收所述服务器返回的共用模型参数,所述共用模型参数为所述目标模型参数与其他用户对应的模型参数计算得到的;receiving the shared model parameters returned by the server, where the shared model parameters are calculated from the target model parameters and model parameters corresponding to other users;
根据所述共用模型参数得到第二预测模型。A second prediction model is obtained according to the shared model parameters.
本申请实施例还提供一种模型处理方法,其包括:The embodiment of the present application also provides a model processing method, which includes:
根据对应每个用户的预测模型的一组模型参数,得到对应多个用户的多组模型参数;According to a set of model parameters corresponding to the prediction model of each user, multiple sets of model parameters corresponding to multiple users are obtained;
将所述多组模型参数调整为同一标准的多组标准模型参数;Adjusting the multiple sets of model parameters to multiple sets of standard model parameters of the same standard;
将所述多组标准模型参数进行计算,得到一组共用模型参数;The multiple groups of standard model parameters are calculated to obtain a group of shared model parameters;
将所述共用模型参数向对应每个用户的所述预测模型发送,用以将所述共用模型参数作为对应每个用户的所述预测模型的第二模型参数。The shared model parameters are sent to the prediction model corresponding to each user, so as to use the shared model parameters as second model parameters of the prediction model corresponding to each user.
本申请实施例还提供一种模型处理装置,其包括:The embodiment of the present application also provides a model processing device, which includes:
模型参数第一获取模块,用于获取第一信息,并将所述第一信息作为训练样本输入预测模型进行训练,得到训练后的第一预测模型的目标模型参数;a first acquisition module for model parameters, configured to acquire first information, and input the first information as a training sample into a prediction model for training, to obtain target model parameters of the trained first prediction model;
第一发送模块,用于将所述目标模型参数发送至服务器;a first sending module, configured to send the target model parameters to a server;
接收模块,用于接收所述服务器返回的共用模型参数,所述共用模型参数为所述目标模型参数与其他用户对应的模型参数计算得到的;a receiving module, configured to receive the shared model parameters returned by the server, where the shared model parameters are calculated from the target model parameters and model parameters corresponding to other users;
处理模块,用于根据所述共用模型参数得到第二预测模型。A processing module, configured to obtain a second prediction model according to the shared model parameters.
本申请实施例还提供一种模型处理装置,其包括:The embodiment of the present application also provides a model processing device, which includes:
模型参数第二获取模块,用于根据对应每个用户的预测模型的一组模型参数,得到对应多个用户的多组模型参数;a second acquisition module for model parameters, configured to obtain multiple sets of model parameters corresponding to multiple users according to a set of model parameters corresponding to the prediction model of each user;
调整模块,用于将所述多组模型参数调整为同一标准的多组标准模型参数;an adjustment module for adjusting the multiple sets of model parameters to multiple sets of standard model parameters of the same standard;
共用模型参数获取模块,用于将所述多组标准模型参数进行计算,得到一组共用模型参数;a shared model parameter acquisition module for calculating the multiple groups of standard model parameters to obtain a group of shared model parameters;
第二发送模块,用于将所述共用模型参数向对应每个用户的所述预测模型发送,用以将所述共用模型参数作为对应每个用户的所述预测模型的第二模型参数。The second sending module is configured to send the shared model parameter to the prediction model corresponding to each user, so as to use the shared model parameter as the second model parameter of the prediction model corresponding to each user.
本申请实施例还提供一种存储介质,其上存储有计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行上述模型处理方法的步骤。An embodiment of the present application further provides a storage medium, on which a computer program is stored, and when the computer program runs on a computer, the computer is made to execute the steps of the above model processing method.
本申请实施例还提供一种电子设备,所述电子设备包括处理器和存储器,所述存储器中存储有计算机程序,所述处理器通过调用所述存储器中存储的所述计算机程序,用于执行上述模型处理方法的步骤。An embodiment of the present application further provides an electronic device, the electronic device includes a processor and a memory, the memory stores a computer program, and the processor invokes the computer program stored in the memory to execute The steps of the above model processing method.
本申请实施例提供的模型处理方法、装置、存储介质及电子设备,其首先获取第一信息,并将所述第一信息作为训练样本输入预测模型进行训练,得到训练后的第一预测模型的目标模型参数;然后将所述模型参数发送至服务器;接着接收所述服务器返回的共用模型参数,所述共用模型参数为所述目标模型参数与其他用户对应的模型参数计算得到的;最后根据所述共用模型参数得到第二预测模型。通过采用联邦学习思想,实现了在不上传用户数据的前提下能够协同计算其他用户的模型参数,帮助本地终端更好地进行预测,显著提升了模型的预测精度和泛化能力,同时能够很好地保护用户的数据隐私。In the model processing method, device, storage medium, and electronic device provided by the embodiments of the present application, first information is obtained, and the first information is used as a training sample to input into a prediction model for training, and the first prediction model after training is obtained. target model parameters; then send the model parameters to the server; then receive the shared model parameters returned by the server, where the shared model parameters are calculated from the target model parameters and the model parameters corresponding to other users; The shared model parameters are used to obtain a second prediction model. By adopting the idea of federated learning, the model parameters of other users can be collaboratively calculated without uploading user data, which helps the local terminal to make better predictions, significantly improves the prediction accuracy and generalization ability of the model, and at the same time, it can be well protect user data privacy.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍。显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present application more clearly, the following briefly introduces the accompanying drawings that are used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative effort.
图1为本申请实施例提供的模型处理方法的应用场景示意图。FIG. 1 is a schematic diagram of an application scenario of a model processing method provided by an embodiment of the present application.
图2为本申请实施例提供的模型处理方法的第一种流程示意图。FIG. 2 is a first schematic flowchart of a model processing method provided by an embodiment of the present application.
图3为本申请实施例提供的模型处理方法的第二种流程示意图。FIG. 3 is a schematic flowchart of a second model processing method provided by an embodiment of the present application.
图4为本申请实施例提供的模型处理方法的第三种流程示意图。FIG. 4 is a third schematic flowchart of a model processing method provided by an embodiment of the present application.
图5为本申请实施例提供的模型处理方法的另一应用场景示意图。FIG. 5 is a schematic diagram of another application scenario of the model processing method provided by the embodiment of the present application.
图6为本申请实施例提供的信息处理装置的结构示意图。FIG. 6 is a schematic structural diagram of an information processing apparatus provided by an embodiment of the present application.
图7为本申请实施例提供的信息处理装置的另一结构示意图。FIG. 7 is another schematic structural diagram of an information processing apparatus provided by an embodiment of the present application.
图8为本申请实施例提供的电子设备的第一种结构示意图。FIG. 8 is a schematic diagram of a first structure of an electronic device provided by an embodiment of the present application.
图9为本申请实施例提供的电子设备的第二种结构示意图。FIG. 9 is a schematic diagram of a second structure of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域技术人员在没有付出创造性劳动前提下所获得的所有其他实施例,都属于本申请的保护范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of this application.
请参阅图1,图1为本申请实施例提供的模型处理方法的应用场景示意图。模型处理方法应用于电子设备。电子设备中设置有全景感知架构。全景感知架构为电子设备中用于实现模型处理方法的硬件和软件的集成。Please refer to FIG. 1. FIG. 1 is a schematic diagram of an application scenario of the model processing method provided by the embodiment of the present application. The model processing method is applied to electronic devices. A panoramic perception architecture is provided in the electronic device. Panoramic perception architecture is the integration of hardware and software in electronic devices for implementing model processing methods.
其中,全景感知架构包括信息感知层、数据处理层、特征抽取层、情景建模层以及智能服务层。Among them, the panoramic perception architecture includes an information perception layer, a data processing layer, a feature extraction layer, a scenario modeling layer, and an intelligent service layer.
信息感知层用于获取电子设备自身的信息和/或外部环境中的信息。信息感知层可以包括多个传感器。例如,信息感知层包括距离传感器、磁场传感器、光线传感器、加速度传感器、指纹传感器、霍尔传感器、位置传感器、陀螺仪、惯性传感器、姿态感应器、气压计、心率传感器等多个传感器。The information perception layer is used to acquire the information of the electronic device itself and/or the information in the external environment. The information perception layer may include multiple sensors. For example, the information perception layer includes a distance sensor, a magnetic field sensor, a light sensor, an acceleration sensor, a fingerprint sensor, a Hall sensor, a position sensor, a gyroscope, an inertial sensor, an attitude sensor, a barometer, a heart rate sensor, and other sensors.
其中,距离传感器可以用于检测电子设备与外部物体之间的距离。磁场传感器可以用于检测电子设备所处环境的磁场信息。光线传感器可以用于检测电子设备所处环境的光线信息。加速度传感器可以用于检测电子设备的加速度数据。指纹传感器可以用于采集用户的指纹信息。霍尔传感器是根据霍尔效应制作的一种磁场传感器,可以用于实现电子设备的自动控制。位置传感器可以用于检测电子设备当前所处的地理位置。陀螺仪可以用于检测电子设备在各个方向上的角速度。惯性传感器可以用于检测电子设备的运动数据。姿态感应器可以用于感应电子设备的姿态信息。气压计可以用于检测电子设备所处环境的气压。心率传感器可以用于检测用户的心率信息。Among them, the distance sensor can be used to detect the distance between the electronic device and the external object. The magnetic field sensor can be used to detect the magnetic field information of the environment in which the electronic device is located. The light sensor can be used to detect the light information of the environment where the electronic device is located. Acceleration sensors can be used to detect acceleration data of electronic devices. The fingerprint sensor can be used to collect the user's fingerprint information. Hall sensor is a magnetic field sensor made according to the Hall effect, which can be used to realize automatic control of electronic equipment. The location sensor can be used to detect the current geographic location of the electronic device. Gyroscopes can be used to detect the angular velocity of electronic devices in various directions. Inertial sensors can be used to detect motion data of electronic devices. The attitude sensor can be used to sense the attitude information of the electronic device. A barometer can be used to detect the air pressure in the environment in which the electronic device is located. The heart rate sensor may be used to detect the user's heart rate information.
数据处理层用于对信息感知层获取到的数据进行处理。例如,数据处理层可以对信息感知层获取到的数据进行数据清理、数据集成、数据变换、数据归约等处理。The data processing layer is used to process the data obtained by the information perception layer. For example, the data processing layer can perform data cleaning, data integration, data transformation, data reduction and other processing on the data obtained by the information perception layer.
其中,数据清理是指对信息感知层获取到的大量数据进行清理,以剔除无效数据和重复数据。数据集成是指将信息感知层获取到的多个单维度数据集成到一个更高或者更抽象的维度,以对多个单维度的数据进行综合处理。数据变换是指对信息感知层获取到的数据进行数据类型的转换或者格式的转换等,以使变换后的数据满足处理的需求。数据归约是指在尽可能保持数据原貌的前提下,最大限度的精简数据量。Among them, data cleaning refers to cleaning a large amount of data obtained by the information perception layer to eliminate invalid data and duplicate data. Data integration refers to integrating multiple single-dimensional data obtained by the information perception layer into a higher or more abstract dimension to comprehensively process multiple single-dimensional data. Data transformation refers to converting the data type or format of the data obtained by the information perception layer, so that the transformed data can meet the processing requirements. Data reduction refers to reducing the amount of data to the greatest extent possible on the premise of keeping the original data as much as possible.
特征抽取层用于对数据处理层处理后的数据进行特征抽取,以提取数据中包括的特征。提取到的特征可以反映出电子设备自身的状态或者用户的状态或者电子设备所处环境的环境状态等。The feature extraction layer is used to perform feature extraction on the data processed by the data processing layer to extract features included in the data. The extracted features may reflect the state of the electronic device itself, the state of the user, or the environmental state of the environment in which the electronic device is located.
其中,特征抽取层可以通过过滤法、包装法、集成法等方法来提取特征或者对提取到的特征进行处理。Among them, the feature extraction layer can extract features or process the extracted features by filtering method, packaging method, integration method and other methods.
过滤法是指对提取到的特征进行过滤,以删除冗余的特征数据。包装法用于对提取到的特征进行筛选。集成法是指将多种特征提取方法集成到一起,以构建一种更加高效、更加准确的特征提取方法,用于提取特征。The filtering method refers to filtering the extracted features to remove redundant feature data. The packing method is used to filter the extracted features. The integration method refers to the integration of multiple feature extraction methods to construct a more efficient and accurate feature extraction method for feature extraction.
情景建模层用于根据特征抽取层提取到的特征来构建模型,所得到的模型可以用于表示电子设备的状态或者用户的状态或者环境状态等。例如,情景建模层可以根据特征抽取层提取到的特征来构建关键值模型、模式标识模型、图模型、实体联系模型、面向对象模型等。The scenario modeling layer is used to construct a model according to the features extracted by the feature extraction layer, and the obtained model can be used to represent the state of the electronic device, the state of the user, or the environment state, etc. For example, the scenario modeling layer can construct a key value model, a pattern identification model, a graph model, an entity relationship model, an object-oriented model, etc. according to the features extracted by the feature extraction layer.
智能服务层用于根据情景建模层所构建的模型为用户提供智能化的服务。例如,智能服务层可以为用户提供基础应用服务,可以为电子设备进行系统智能优化,还可以为用户提供个性化智能服务。The intelligent service layer is used to provide users with intelligent services according to the model constructed by the scenario modeling layer. For example, the intelligent service layer can provide users with basic application services, can perform system intelligent optimization for electronic devices, and can also provide users with personalized intelligent services.
此外,全景感知架构中还可以包括多种算法,每一种算法都可以用于对数据进行分析处理,多种算法可以构成算法库。例如,算法库中可以包括马尔科夫算法、隐含狄里克雷分布算法、贝叶斯分类算法、支持向量机、K均值聚类算法、K近邻算法、条件随机场、残差网络、长短期记忆网络、卷积神经网络、循环神经网络等算法。In addition, the panoramic perception architecture can also include multiple algorithms, each of which can be used to analyze and process data, and multiple algorithms can form an algorithm library. For example, the algorithm library may include Markov algorithm, latent Dirichlet distribution algorithm, Bayesian classification algorithm, support vector machine, K-means clustering algorithm, K-nearest neighbor algorithm, conditional random field, residual network, long Algorithms such as short-term memory networks, convolutional neural networks, and recurrent neural networks.
本申请实施例提供一种模型处理方法,模型处理方法可以应用于电子设备中。电子设备可以是智能手机、平板电脑、游戏设备、增强现实(Augmented Reality,AR)设备、汽车、数据存储装置、音频播放装置、视频播放装置、笔记本、桌面计算设备、可穿戴设备诸如手表、眼镜、头盔、电子手链、电子项链、电子衣物等设备。The embodiment of the present application provides a model processing method, and the model processing method can be applied to an electronic device. Electronic devices may be smartphones, tablets, gaming devices, Augmented Reality (AR) devices, automobiles, data storage devices, audio playback devices, video playback devices, notebooks, desktop computing devices, wearable devices such as watches, glasses , helmets, electronic bracelets, electronic necklaces, electronic clothing and other equipment.
请参阅图2,图2为本申请实施例提供的模型处理方法的第一种流程示意图。其中,模型处理方法包括以下步骤:Please refer to FIG. 2 , FIG. 2 is a schematic flowchart of a first type of model processing method provided by an embodiment of the present application. The model processing method includes the following steps:
101,获取第一信息,并将第一信息作为训练样本输入预测模型进行训练,得到训练后的第一预测模型的目标模型参数。101. Acquire first information, and input the first information as a training sample into a prediction model for training, to obtain target model parameters of the trained first prediction model.
第一信息可以为关于用户的所有信息。例如可以包括用户所处的环境信息、用户使用的电子设备的运行信息、用户行为信息三大类。其中,环境信息可以包括环境的温度、湿度、位置、亮度等,环境信息还可以包括用户的身体信息,如血压、脉搏、心率等。具体的,环境信息可以通过传感器获取的环境信息。例如,通过距离传感器、磁场传感器、光线传感器、加速度传感器、指纹传感器、霍尔传感器、位置传感器、陀螺仪、惯性传感器、姿态感应器、气压计、血压传感器、脉搏传感器、心率传感器等中的至少一个获取的环境信息。环境信息还可以通过麦克风获取的当前音频信息,还可以通过摄像头模组获取的当前图像信息。The first information may be all information about the user. For example, it may include three categories of information about the environment where the user is located, the operation information of the electronic device used by the user, and the user behavior information. The environmental information may include the temperature, humidity, location, brightness, etc. of the environment, and the environmental information may also include the user's physical information, such as blood pressure, pulse, heart rate, and the like. Specifically, the environmental information may be obtained by the sensor. For example, through at least one of a distance sensor, a magnetic field sensor, a light sensor, an acceleration sensor, a fingerprint sensor, a Hall sensor, a position sensor, a gyroscope, an inertial sensor, an attitude sensor, a barometer, a blood pressure sensor, a pulse sensor, a heart rate sensor, etc. A fetched environment information. The environmental information can also be the current audio information obtained by the microphone, and the current image information obtained by the camera module.
电子设备的运行信息可以包括开机时间、关机时间、待机时间、各个时间点的内存使用率、各个时间点的主芯片使用率、当前运行程序信息、后台运行程序信息、各个程序的运行时长、各个程序的下载量等。The operation information of the electronic device may include the startup time, shutdown time, standby time, memory usage rate at each time point, main chip usage rate at each time point, current running program information, background running program information, running time of each program, each Program downloads, etc.
用户行为信息可以包括用户的行动轨迹信息、浏览信息、支付信息和出行信息等。The user behavior information may include the user's action track information, browsing information, payment information, travel information, and the like.
第一信息还可以包括电子设备的配置信息、电子设备内存储的用户信息等。其中,用户信息包括用户的身份信息、个人爱好、浏览记录、个人收藏等人机交互的信息。The first information may also include configuration information of the electronic device, user information stored in the electronic device, and the like. The user information includes the user's identity information, personal hobbies, browsing records, personal collections and other human-computer interaction information.
需要说明的是,有些第一信息可以同时在环境信息、电子设备运行信息、用户行为信息中的两类或三类中。It should be noted that some of the first information may be in two or three categories of environmental information, electronic device operation information, and user behavior information at the same time.
得到第一信息后,可以将第一信息作为训练样本输入预测模型进行训练,得到训练后的第一预测模型的目标模型参数。After the first information is obtained, the first information may be input into the prediction model as a training sample for training, and target model parameters of the trained first prediction model are obtained.
例如,第一信息包括用户的出行信息,具体可以包括居住位置、在家时间段、出门时间、出行交通工具、使用交通工具时间段、工作位置、停留位置、停留时间段等。在一些实施例中,还可以定义用户出行相关模式,可以定义公交车、地铁、驾驶、骑行、步行、高铁、飞机等7种出行模式。预测模型可以预测用户接下来最有可能使用的出行模式,并根据出行模式设定对应的功能。若接下来最有可能的出行模式时地铁,则可以预先加载在地铁上使用的应用内容,具体可以包括新闻应用的内容、视频内容、应用内容、地铁支付应用等。For example, the first information includes travel information of the user, which may specifically include living location, home time period, going out time, travel vehicle, vehicle use time period, work location, stay location, stay time period, and the like. In some embodiments, user travel related modes can also be defined, and seven travel modes such as bus, subway, driving, cycling, walking, high-speed rail, and airplane can be defined. The prediction model can predict the travel mode that the user is most likely to use next, and set the corresponding function according to the travel mode. If the next most likely travel mode is the subway, the application content used on the subway can be preloaded, which may specifically include the content of the news application, video content, application content, and subway payment application.
其中,每个用户的电子设备本地可以采用深度学习框架建立预测模型,如出行模式识别模型等。Among them, each user's electronic device can locally use a deep learning framework to establish a prediction model, such as a travel pattern recognition model.
102,将目标模型参数发送至服务器。102. Send the target model parameters to the server.
得到训练后的第一预测模型的目标模型参数后,将目标模型参数发送至服务器。服务器可以为预先搭建好的远端服务器,也可以为云服务器。其中,将目标模型参数上传服务器,而非直接上传第一信息,避免了第一信息的泄露,以更好地保护用户隐私和遵守相关的法律条规,如欧盟数据隐私保护条例。After the target model parameters of the trained first prediction model are obtained, the target model parameters are sent to the server. The server can be a pre-built remote server or a cloud server. Among them, uploading the target model parameters to the server instead of directly uploading the first information avoids the leakage of the first information, so as to better protect user privacy and comply with relevant laws and regulations, such as EU data privacy protection regulations.
103,接收服务器返回的共用模型参数,共用模型参数为目标模型参数与其他用户对应的模型参数计算得到的。103. Receive the shared model parameters returned by the server, where the shared model parameters are obtained by calculating the target model parameters and model parameters corresponding to other users.
接收服务器返回的共用模型参数,共用模型参数为目标模型参数与其他用户对应的模型参数计算得到的。其中,服务器接收对应多个用户的模型参数,然后根据多个用户的多个模型参数进行计算得到共用模型参数。The shared model parameters returned by the server are received, and the shared model parameters are calculated from the target model parameters and the model parameters corresponding to other users. The server receives the model parameters corresponding to multiple users, and then calculates the shared model parameters according to the multiple model parameters of the multiple users.
其中,服务器可以采用多种算法将多组标准模型参数进行计算。例如采用平均法、最大值法或中位数法等。平均法为假设每个用户对齐后的参数向量为w_u=(w_u1,w_u2,…,w_un),其中u表示第u个用户,n表示参数的个数,则基于平均法的计算方法取所有用户每个参数维度上的平均值。最大值法与平均法相似,只是选择的是每个参数维度上的最大值。中位数法也与平均法相似,只是选择的是每个参数维度上的中位数。Wherein, the server may use multiple algorithms to calculate multiple sets of standard model parameters. For example, the average method, the maximum value method or the median method is used. The averaging method assumes that the aligned parameter vector of each user is w_u=(w_u1,w_u2,...,w_un), where u represents the uth user and n represents the number of parameters, then the calculation method based on the averaging method takes all users Average over each parameter dimension. The maximum method is similar to the average method, except that the maximum value in each parameter dimension is selected. The median method is also similar to the mean method, except that the median in each parameter dimension is chosen.
104,根据共用模型参数得到第二预测模型。104. Obtain a second prediction model according to the shared model parameters.
预测模型根据服务器返回的共用模型参数得到第二预测模型。使得单个用户的预测模型训练过程很好地计算了其他用户的模型参数,其他用户的模型参数是根据其他用户的电子设备的第一信息得到的,即计算了其他用户数据知识和行为习惯,可以显著提升预测模型的识别精度和泛化能力。The prediction model obtains the second prediction model according to the shared model parameters returned by the server. The training process of the prediction model of a single user can well calculate the model parameters of other users, and the model parameters of other users are obtained according to the first information of other users' electronic devices, that is, the data knowledge and behavior habits of other users are calculated. Significantly improve the recognition accuracy and generalization ability of the prediction model.
相关技术中难以既保护用户数据隐私,又能在不同电子设备之间数据存在差异时做到数据的计算学习和训练,导致预测算法的精度和适配性存在较大的局限性。本实施例基于联邦迁移学习的思想,可以实现更强的泛化能力、更高的精度,又能够保护用户数据隐私。具体而言,通过采用联邦学习思想,实现了在不上传用户第一信息的前提下能够协同计算其他用户的第一信息,帮助本地终端更好地进行预测,显著提升了预测模型的精度和泛化能力,能够很好地保护用户的数据隐私;通过迁移学习,使得在第一信息之间存在差异的前提下,对预测模型的模型参数进行了对齐,保证了预测模型具有更强的鲁棒性,不仅能够处理用户第一信息相同的情况,也能够处理用户第一信息之间存在差异的场景,极大地提升了所构建出的预测模式的应用范围。In related technologies, it is difficult not only to protect the privacy of user data, but also to perform computational learning and training of data when there are differences in data between different electronic devices, resulting in greater limitations in the accuracy and adaptability of prediction algorithms. Based on the idea of federated transfer learning, this embodiment can achieve stronger generalization ability and higher precision, and can protect user data privacy. Specifically, by adopting the federated learning idea, the first information of other users can be collaboratively calculated without uploading the first information of the user, which helps the local terminal to make better predictions, and significantly improves the accuracy and generalization of the prediction model. It can protect the data privacy of users well; through transfer learning, the model parameters of the prediction model are aligned under the premise of the difference between the first information, which ensures that the prediction model has stronger robustness Not only can the user first information be the same, but also the scenarios where the user first information is different can be handled, which greatly improves the application scope of the constructed prediction mode.
请参阅图3,图3为本申请实施例提供的模型处理方法的第一种流程示意图。其中,模型处理方法包括以下步骤:Please refer to FIG. 3 , FIG. 3 is a schematic flowchart of a first type of model processing method provided by an embodiment of the present application. The model processing method includes the following steps:
201,获取第一信息,并将第一信息作为训练样本输入预测模型进行训练,得到训练后的第一预测模型的目标模型参数。201. Acquire first information, and input the first information as a training sample into a prediction model for training, to obtain target model parameters of the trained first prediction model.
第一信息可以为关于用户的所有信息。例如可以包括用户所处的环境信息、用户使用的电子设备的运行信息、用户行为信息三大类。其中,环境信息可以包括环境的温度、湿度、位置、亮度等,环境信息还可以包括用户的身体信息,如血压、脉搏、心率等。具体的,环境信息可以通过传感器获取的环境信息。例如,通过距离传感器、磁场传感器、光线传感器、加速度传感器、指纹传感器、霍尔传感器、位置传感器、陀螺仪、惯性传感器、姿态感应器、气压计、血压传感器、脉搏传感器、心率传感器等中的至少一个获取的环境信息。环境信息还可以通过麦克风获取的当前音频信息,还可以通过摄像头模组获取的当前图像信息。The first information may be all information about the user. For example, it may include three categories of information about the environment where the user is located, the operation information of the electronic device used by the user, and the user behavior information. The environmental information may include the temperature, humidity, location, brightness, etc. of the environment, and the environmental information may also include the user's physical information, such as blood pressure, pulse, heart rate, and the like. Specifically, the environmental information may be obtained by the sensor. For example, through at least one of a distance sensor, a magnetic field sensor, a light sensor, an acceleration sensor, a fingerprint sensor, a Hall sensor, a position sensor, a gyroscope, an inertial sensor, an attitude sensor, a barometer, a blood pressure sensor, a pulse sensor, a heart rate sensor, etc. A fetched environment information. The environmental information can also be the current audio information obtained by the microphone, and the current image information obtained by the camera module.
电子设备的运行信息可以包括开机时间、关机时间、待机时间、各个时间点的内存使用率、各个时间点的主芯片使用率、当前运行程序信息、后台运行程序信息、各个程序的运行时长、各个程序的下载量等。The operation information of the electronic device may include the startup time, shutdown time, standby time, memory usage rate at each time point, main chip usage rate at each time point, current running program information, background running program information, running time of each program, each Program downloads, etc.
用户行为信息可以包括用户的行动轨迹信息、浏览信息、支付信息和出行信息等。The user behavior information may include the user's action track information, browsing information, payment information, travel information, and the like.
第一信息还可以包括电子设备的配置信息、电子设备内存储的用户信息等。其中,用户信息包括用户的身份信息、个人爱好、浏览记录、个人收藏等人机交互的信息。The first information may also include configuration information of the electronic device, user information stored in the electronic device, and the like. The user information includes the user's identity information, personal hobbies, browsing records, personal collections and other human-computer interaction information.
需要说明的是,有些第一信息可以同时在环境信息、电子设备运行信息、用户行为信息中的两类或三类中。It should be noted that some of the first information may be in two or three categories of environmental information, electronic device operation information, and user behavior information at the same time.
得到第一信息后,可以将第一信息作为训练样本输入预测模型进行训练,得到训练后的第一预测模型的目标模型参数。After the first information is obtained, the first information may be input into the prediction model as a training sample for training, and target model parameters of the trained first prediction model are obtained.
例如,第一信息包括用户的出行信息,具体可以包括居住位置、在家时间段、出门时间、出行交通工具、使用交通工具时间段、工作位置、停留位置、停留时间段等。在一些实施例中,还可以定义用户出行相关模式,可以定义公交车、地铁、驾驶、骑行、步行、高铁、飞机等7种出行模式。预测模型可以预测用户接下来最有可能使用的出行模式,并根据出行模式设定对应的功能。若接下来最有可能的出行模式时地铁,则可以预先加载在地铁上使用的应用内容,具体可以包括新闻应用的内容、视频内容、应用内容、地铁支付应用等。For example, the first information includes travel information of the user, which may specifically include living location, home time period, going out time, travel vehicle, vehicle use time period, work location, stay location, stay time period, and the like. In some embodiments, user travel related modes can also be defined, and seven travel modes such as bus, subway, driving, cycling, walking, high-speed rail, and airplane can be defined. The prediction model can predict the travel mode that the user is most likely to use next, and set the corresponding function according to the travel mode. If the next most likely travel mode is the subway, the application content used on the subway can be preloaded, which may specifically include the content of the news application, video content, application content, and subway payment application.
其中,每个用户的电子设备本地可以采用深度学习框架建立预测模型,如出行模式识别模型等。Among them, each user's electronic device can locally use a deep learning framework to establish a prediction model, such as a travel pattern recognition model.
202,将目标模型参数发送至服务器。202. Send the target model parameters to the server.
得到训练后的第一预测模型的目标模型参数后,将目标模型参数发送至服务器。服务器可以为预先搭建好的远端服务器,也可以为云服务器。其中,将目标模型参数上传服务器,而非直接上传第一信息,避免了第一信息的泄露,以更好地保护用户隐私和遵守相关的法律条规,如欧盟数据隐私保护条例。After the target model parameters of the trained first prediction model are obtained, the target model parameters are sent to the server. The server can be a pre-built remote server or a cloud server. Among them, uploading the target model parameters to the server instead of directly uploading the first information avoids the leakage of the first information, so as to better protect user privacy and comply with relevant laws and regulations, such as EU data privacy protection regulations.
203,接收服务器返回的共用模型参数,共用模型参数为目标模型参数与其他用户对应的模型参数计算得到的。203. Receive the shared model parameters returned by the server, where the shared model parameters are calculated from the target model parameters and the model parameters corresponding to other users.
接收服务器返回的共用模型参数,共用模型参数为目标模型参数与其他用户对应的模型参数计算得到的。其中,服务器接收对应多个用户的模型参数,然后根据多个用户的多个模型参数进行计算得到共用模型参数。The shared model parameters returned by the server are received, and the shared model parameters are calculated from the target model parameters and the model parameters corresponding to other users. The server receives the model parameters corresponding to multiple users, and then calculates the shared model parameters according to the multiple model parameters of the multiple users.
其中,服务器可以采用多种算法将多组标准模型参数进行计算。例如采用平均法、最大值法或中位数法等。平均法为假设每个用户对齐后的参数向量为w_u=(w_u1,w_u2,…,w_un),其中u表示第u个用户,n表示参数的个数,则基于平均法的计算方法取所有用户每个参数维度上的平均值。最大值法与平均法相似,只是选择的是每个参数维度上的最大值。中位数法也与平均法相似,只是选择的是每个参数维度上的中位数。Wherein, the server may use multiple algorithms to calculate multiple sets of standard model parameters. For example, the average method, the maximum value method or the median method is used. The averaging method assumes that the aligned parameter vector of each user is w_u=(w_u1,w_u2,...,w_un), where u represents the uth user and n represents the number of parameters, then the calculation method based on the averaging method takes all users Average over each parameter dimension. The maximum method is similar to the average method, except that the maximum value in each parameter dimension is selected. The median method is also similar to the mean method, except that the median in each parameter dimension is chosen.
204,获取目标模型参数和共用模型参数的匹配度。204. Obtain the matching degree between the target model parameter and the shared model parameter.
将目标模型参数和共用模型参数进行匹配度计算,计算两者的匹配度。The matching degree of the target model parameters and the shared model parameters is calculated, and the matching degree of the two is calculated.
205,当匹配度小于预设匹配度时,利用共用模型参数和第一信息重新训练预测模型得到第二预测模型。205. When the matching degree is less than the preset matching degree, retrain the prediction model by using the shared model parameters and the first information to obtain the second prediction model.
当匹配度小于预设匹配度时,说明预测模型训练得到的目标模型参数与服务器返回的共用模型参数差距较大,直接将共用模型参数作为预测模型的第二模型参数可能会有较大的误差,为了预测模型的准确度,可以利用共用模型参数和第一信息重新训练预测模型。例如,使用利用共用模型参数的预测模型重新训练,或者将共用模型参数和目标模型参数进行计算,得到两者的中间值作为预测模式的模型参数进行重新训练。When the matching degree is less than the preset matching degree, it means that the target model parameters obtained by the training of the prediction model are far from the shared model parameters returned by the server, and directly using the shared model parameters as the second model parameters of the prediction model may have a large error , in order to predict the accuracy of the model, the prediction model can be retrained by using the shared model parameters and the first information. For example, retrain the prediction model using the shared model parameters, or calculate the shared model parameters and the target model parameters, and obtain the intermediate value of the two as the model parameters of the prediction mode for retraining.
206,当匹配度大于预设匹配度时,根据共用模型参数得到第二预测模型。206. When the matching degree is greater than the preset matching degree, obtain a second prediction model according to the shared model parameters.
根据预测模型根据服务器返回的共用模型参数得到第二预测模型。使得单个用户的预测模型训练过程很好地计算了其他用户的模型参数,其他用户的模型参数是根据其他用户的电子设备的第一信息得到的,即计算了其他用户数据知识和行为习惯,可以显著提升预测模型的识别精度和泛化能力。According to the prediction model, the second prediction model is obtained according to the shared model parameters returned by the server. The training process of the prediction model of a single user can well calculate the model parameters of other users, and the model parameters of other users are obtained according to the first information of other users' electronic devices, that is, the data knowledge and behavior habits of other users are calculated. Significantly improve the recognition accuracy and generalization ability of the prediction model.
在一些实施例中,根据共用模型参数得到第二预测模型包括:In some embodiments, obtaining the second prediction model according to the shared model parameters includes:
将使用共用模型参数的预测模型作为第二预测模型。The prediction model using the shared model parameters will be used as the second prediction model.
直接将共用模型参数作为预测模型的第二模型参数,也可以理解为使用共用模型参数的预测模型为第二预测模型。Directly using the shared model parameters as the second model parameters of the prediction model can also be understood as the prediction model using the shared model parameters as the second prediction model.
在一些实施例中,根据共用模型参数得到第二预测模型包括:In some embodiments, obtaining the second prediction model according to the shared model parameters includes:
根据目标模型参数调整共用模型参数,得到第二模型参数;Adjust the shared model parameters according to the target model parameters to obtain the second model parameters;
将使用第二模型参数的预测模型作为第二预测模型。The prediction model using the second model parameters will be used as the second prediction model.
直接将共用模型参数作为预测模型的模型参数可能会有偏差,此时,可以根据预测模型之前训练得到的目标模型参数进行调整,得到第二模型参数。Directly using the shared model parameters as the model parameters of the prediction model may have deviations. In this case, the second model parameters can be obtained by adjusting the target model parameters obtained by the previous training of the prediction model.
在一些实施例中,根据共用模型参数得到第二预测模型包括:In some embodiments, obtaining the second prediction model according to the shared model parameters includes:
使用共用模型参数的预测模型根据第一信息进行训练,以调整共用模型参数得到第二模型参数;The prediction model using the shared model parameters is trained according to the first information to adjust the shared model parameters to obtain the second model parameters;
将使用第二模型参数的预测模型作为第二预测模型。The prediction model using the second model parameters will be used as the second prediction model.
直接将共用模型参数作为预测模型的模型参数可能会有偏差,此时,可以使用共用模型参数的预测模型根据第一信息重新进行训练,以调整共用模型参数得到第二模型参数,其中重新训练可以使用较小的样本进行训练,也可以使用全部的样本进行训练;最后将使用第二模型参数的预测模型作为第二预测模型。Directly using the shared model parameters as the model parameters of the prediction model may have deviations. In this case, the prediction model with the shared model parameters can be used to retrain according to the first information to adjust the shared model parameters to obtain the second model parameters. The retraining can A smaller sample is used for training, or all samples can be used for training; finally, the prediction model using the parameters of the second model is used as the second prediction model.
相关技术中难以既保护用户数据隐私,又能在不同电子设备之间数据存在差异时做到数据的计算学习和训练,导致预测算法的精度和适配性存在较大的局限性。本实施例基于联邦迁移学习的思想,可以实现更强的泛化能力、更高的精度,又能够保护用户数据隐私。具体而言,通过采用联邦学习思想,实现了在不上传用户第一信息的前提下能够协同计算其他用户的第一信息,帮助本地终端更好地进行预测,显著提升了预测模型的精度和泛化能力,能够很好地保护用户的数据隐私;通过迁移学习,使得在第一信息之间存在差异的前提下,对预测模型的模型参数进行了对齐,保证了预测模型具有更强的鲁棒性,不仅能够处理用户第一信息相同的情况,也能够处理用户第一信息之间存在差异的场景,极大地提升了所构建出的预测模式的应用范围。In related technologies, it is difficult not only to protect the privacy of user data, but also to perform computational learning and training of data when there are differences in data between different electronic devices, resulting in greater limitations in the accuracy and adaptability of prediction algorithms. Based on the idea of federated transfer learning, this embodiment can achieve stronger generalization ability and higher precision, and can protect user data privacy. Specifically, by adopting the federated learning idea, the first information of other users can be collaboratively calculated without uploading the first information of the user, which helps the local terminal to make better predictions, and significantly improves the accuracy and generalization of the prediction model. It can protect the data privacy of users well; through transfer learning, the model parameters of the prediction model are aligned under the premise of the difference between the first information, which ensures that the prediction model has stronger robustness Not only can the user first information be the same, but also the scenarios where the user first information is different can be handled, which greatly improves the application scope of the constructed prediction mode.
请参阅图4,图4为本申请实施例提供的模型处理方法的第三种流程示意图。其中,模型处理方法包括以下步骤:Please refer to FIG. 4 , which is a schematic flowchart of a third type of model processing method provided by an embodiment of the present application. The model processing method includes the following steps:
301,根据对应每个用户的预测模型的一组模型参数,得到对应多个用户的多组模型参数。301. Obtain multiple sets of model parameters corresponding to multiple users according to a set of model parameters corresponding to the prediction model of each user.
对应每个用户的预测模型先根据对应用户的第一信息进行训练得到训练后的模型以及一组模型参数,对应多个用户则有多组模型参数。The prediction model corresponding to each user is first trained according to the first information of the corresponding user to obtain a trained model and a set of model parameters, and corresponding to multiple users, there are multiple sets of model parameters.
302,将多组模型参数调整为同一标准的多组标准模型参数。302. Adjust the multiple sets of model parameters to multiple sets of standard model parameters of the same standard.
获取到对应多个用户的多组模型参数后,将多组模型参数调整为同一标准的多组标准模型参数。具体的,采用迁移学习的方式,对各个用户上传的模型参数进行对齐,以使得所有用户的参数处于同一个空间。例如,每个用户的预测模型都是出行预测模型,每个出行预测模型都是基于对应电子设备的第一信息进行出行预测。After acquiring multiple sets of model parameters corresponding to multiple users, adjust the multiple sets of model parameters to multiple sets of standard model parameters of the same standard. Specifically, the transfer learning method is used to align the model parameters uploaded by each user, so that the parameters of all users are in the same space. For example, the prediction model of each user is a travel prediction model, and each travel prediction model performs travel prediction based on the first information of the corresponding electronic device.
例如,第一信息包括用户的出行信息,具体可以包括居住位置、在家时间段、出门时间、出行交通工具、使用交通工具时间段、工作位置、停留位置、停留时间段等。在一些实施例中,还可以定义用户出行相关模式,可以定义公交车、地铁、驾驶、骑行、步行、高铁、飞机等7种出行模式。预测模型可以预测用户接下来最有可能使用的出行模式,并根据出行模式设定对应的功能。若接下来最有可能的出行模式时地铁,则可以预先加载在地铁上使用的应用内容,具体可以包括新闻应用的内容、视频内容、应用内容、地铁支付应用等。For example, the first information includes travel information of the user, which may specifically include living location, home time period, going out time, travel vehicle, vehicle use time period, work location, stay location, stay time period, and the like. In some embodiments, user travel related modes can also be defined, and seven travel modes such as bus, subway, driving, cycling, walking, high-speed rail, and airplane can be defined. The prediction model can predict the travel mode that the user is most likely to use next, and set the corresponding function according to the travel mode. If the next most likely travel mode is the subway, the application content used on the subway can be preloaded, which may specifically include the content of the news application, video content, application content, and subway payment application.
如此,对应各个用户的模型参数在同一空间,都是针对同一个标准(如出现)进行识别。In this way, the model parameters corresponding to each user are in the same space, and are all identified for the same standard (if present).
303,将多组标准模型参数进行计算,得到一组共用模型参数。303. Calculate multiple sets of standard model parameters to obtain a set of common model parameters.
可以采用多种算法将多组标准模型参数进行计算。例如采用平均法、最大值法或中位数法等。平均法为假设每个用户对齐后的参数向量为w_u=(w_u1,w_u2,…,w_un),其中u表示第u个用户,n表示参数的个数,则基于平均法的计算方法取所有用户每个参数维度上的平均值。最大值法与平均法相似,只是选择的是每个参数维度上的最大值。中位数法也与平均法相似,只是选择的是每个参数维度上的中位数。Multiple sets of standard model parameters can be calculated using a variety of algorithms. For example, the average method, the maximum value method or the median method is used. The averaging method assumes that the aligned parameter vector of each user is w_u=(w_u1,w_u2,...,w_un), where u represents the uth user and n represents the number of parameters, then the calculation method based on the averaging method takes all users Average over each parameter dimension. The maximum method is similar to the average method, except that the maximum value in each parameter dimension is selected. The median method is also similar to the mean method, except that the median in each parameter dimension is chosen.
304,将共用模型参数向对应每个用户的预测模型发送,用以将共用模型参数作为对应每个用户的预测模型的第二模型参数。304. Send the shared model parameters to the prediction model corresponding to each user, so as to use the shared model parameters as the second model parameters of the prediction model corresponding to each user.
得到共用模型参数后,将其发生给对应每个用户的预测模型,预测模型得到共用模型参数后,根据共用模型参数得到第二模型参数。After the shared model parameters are obtained, they are sent to the prediction model corresponding to each user. After the prediction model obtains the shared model parameters, the second model parameters are obtained according to the shared model parameters.
在一些实施例中,将共用模型参数作为对应每个用户的预测模型的第二模型参数之前,可以先获取模型参数和共用模型参数的匹配度。In some embodiments, before using the common model parameter as the second model parameter of the prediction model corresponding to each user, the matching degree between the model parameter and the common model parameter may be obtained first.
当匹配度小于预设匹配度时,利用共用模型参数和第一信息重新训练预测模型。When the matching degree is less than the preset matching degree, the prediction model is retrained by using the shared model parameters and the first information.
当匹配度大于预设匹配度时,根据共用模型参数得到第二预测模型。When the matching degree is greater than the preset matching degree, a second prediction model is obtained according to the shared model parameters.
当匹配度小于预设匹配度时,说明预测模型训练得到的模型参数与服务器返回的共用模型参数差距较大,直接将共用模型参数作为预测模型的第二模型参数可能会有较大的误差,为了预测模型的准确度,可以利用共用模型参数和第一信息重新训练预测模型。例如,使用利用共用模型参数的预测模型重新训练,或者将共用模型参数和模型参数进行计算,得到两者的中间值作为预测模式的模型参数进行重新训练。When the matching degree is less than the preset matching degree, it means that the model parameters obtained by the training of the prediction model are far from the shared model parameters returned by the server. There may be a large error in directly using the shared model parameters as the second model parameters of the prediction model. In order to predict the accuracy of the model, the prediction model may be retrained using the shared model parameters and the first information. For example, retrain the prediction model using the shared model parameters, or calculate the shared model parameters and the model parameters, and obtain the intermediate value of the two as the model parameters of the prediction mode for retraining.
当匹配度大于预设匹配度时,根据预测模型根据服务器返回的共用模型参数得到第二预测模型。使得单个用户的预测模型训练过程很好地计算了其他用户的模型参数,其他用户的模型参数是根据其他用户的电子设备的第一信息得到的,即计算了其他用户数据知识和行为习惯,可以显著提升预测模型的识别精度和泛化能力。When the matching degree is greater than the preset matching degree, the second prediction model is obtained according to the prediction model according to the shared model parameters returned by the server. The training process of the prediction model of a single user can well calculate the model parameters of other users, and the model parameters of other users are obtained according to the first information of other users' electronic devices, that is, the data knowledge and behavior habits of other users are calculated. Significantly improve the recognition accuracy and generalization ability of the prediction model.
在一些实施例中,根据共用模型参数得到第二预测模型可以包括:In some embodiments, obtaining the second prediction model according to the shared model parameters may include:
将使用共用模型参数的预测模型作为第二预测模型。The prediction model using the shared model parameters will be used as the second prediction model.
直接将共用模型参数作为预测模型的第二模型参数,也可以理解为使用共用模型参数的预测模型为第二预测模型。Directly using the shared model parameters as the second model parameters of the prediction model can also be understood as the prediction model using the shared model parameters as the second prediction model.
在一些实施例中,根据共用模型参数得到第二预测模型可以包括:In some embodiments, obtaining the second prediction model according to the shared model parameters may include:
根据模型参数调整共用模型参数,得到第二模型参数;Adjust the shared model parameters according to the model parameters to obtain the second model parameters;
将使用第二模型参数的预测模型作为第二预测模型。The prediction model using the second model parameters will be used as the second prediction model.
直接将共用模型参数作为预测模型的最终参数可能会有偏差,此时,可以根据预测模型之前训练得到的模型参数进行调整,得到最终的模型参数。Directly using the shared model parameters as the final parameters of the prediction model may have deviations. In this case, you can adjust the model parameters obtained by the previous training of the prediction model to obtain the final model parameters.
在一些实施例中,根据共用模型参数得到第二预测模型包括:In some embodiments, obtaining the second prediction model according to the shared model parameters includes:
使用共用模型参数的预测模型根据第一信息进行训练,以调整共用模型参数得到第二模型参数;The prediction model using the shared model parameters is trained according to the first information to adjust the shared model parameters to obtain the second model parameters;
将使用第二模型参数的预测模型作为第二预测模型。The prediction model using the second model parameters will be used as the second prediction model.
直接将共用模型参数作为预测模型的最终参数可能会有偏差,此时,可以使用共用模型参数的预测模型根据第一信息重新进行训练,以调整共用模型参数得到第二模型参数,其中重新训练可以使用较小的样本进行训练,也可以使用全部的样本进行训练;最后将使用第二模型参数的预测模型作为第二预测模型。Directly using the shared model parameters as the final parameters of the prediction model may be biased. In this case, the prediction model using the shared model parameters can be retrained according to the first information to adjust the shared model parameters to obtain the second model parameters. The retraining can A smaller sample is used for training, or all samples can be used for training; finally, the prediction model using the parameters of the second model is used as the second prediction model.
相关技术中难以既保护用户数据隐私,又能在不同电子设备之间数据存在差异时做到数据的计算学习和训练,导致预测算法的精度和适配性存在较大的局限性。本实施例基于联邦迁移学习的思想,可以实现更强的泛化能力、更高的精度,又能够保护用户数据隐私。具体而言,通过采用联邦学习思想,实现了在不上传用户第一信息的前提下能够协同计算其他用户的第一信息,帮助本地终端更好地进行预测,显著提升了预测模型的精度和泛化能力,能够很好地保护用户的数据隐私;通过迁移学习,使得在第一信息之间存在差异的前提下,对预测模型的模型参数进行了对齐,保证了预测模型具有更强的鲁棒性,不仅能够处理用户第一信息相同的情况,也能够处理用户第一信息之间存在差异的场景,极大地提升了所构建出的预测模式的应用范围。In related technologies, it is difficult not only to protect the privacy of user data, but also to perform computational learning and training of data when there are differences in data between different electronic devices, resulting in greater limitations in the accuracy and adaptability of prediction algorithms. Based on the idea of federated transfer learning, this embodiment can achieve stronger generalization ability and higher precision, and can protect user data privacy. Specifically, by adopting the federated learning idea, the first information of other users can be collaboratively calculated without uploading the first information of the user, which helps the local terminal to make better predictions, and significantly improves the accuracy and generalization of the prediction model. It can protect the data privacy of users well; through transfer learning, the model parameters of the prediction model are aligned under the premise of the difference between the first information, which ensures that the prediction model has stronger robustness Not only can the user first information be the same, but also the scenarios where the user first information is different can be handled, which greatly improves the application scope of the constructed prediction mode.
请参阅图5,图5为本申请实施例提供的模型处理方法的场景示意图。首先获取用户的电子设备的第一信息,然后将获取的第一信息输入预测模型进行训练,得到训练后的第一预测模型以及目标模型参数,接着将目标模型参数上传到服务器,服务器基于迁移学习对上传的目标模型参数和其他用户上传的模型参数进行对齐,避免数据不一致带来的模型参数难以直接融合的问题。接下来将对齐后的模型参数进行计算,得到共用模型参数,再然后将共用模型参数发送到预测模型再次学习,得到第二预测模型。电子设备可以利用第二预测模型进行预测,以及根据预测结果进行功能控制。例如,根据用户的出行信息进行预测,预测结果为将要高铁出行,则可以推荐购票软件、地图软件、租车软件、打车软件、车次查询软件等。Please refer to FIG. 5 , which is a schematic diagram of a scenario of a model processing method provided by an embodiment of the present application. First obtain the first information of the user's electronic device, and then input the obtained first information into the prediction model for training to obtain the trained first prediction model and target model parameters, and then upload the target model parameters to the server, and the server is based on migration learning Align the uploaded target model parameters with the model parameters uploaded by other users to avoid the problem of difficult direct integration of model parameters caused by data inconsistency. Next, the aligned model parameters are calculated to obtain the shared model parameters, and then the shared model parameters are sent to the prediction model to learn again to obtain the second prediction model. The electronic device can perform prediction using the second prediction model, and perform function control according to the prediction result. For example, if the prediction is made based on the user's travel information, and the prediction result is that there will be a high-speed rail trip, ticket purchasing software, map software, car rental software, taxi-hailing software, train number inquiry software, etc. can be recommended.
在一些实施例中,模型处理方法具体可以包括:首先通过信息感知层获取用户的电子设备的信息(具体包括电子设备运行信息、用户行为信息、各个传感器获取的信息、电子设备状态信息、电子设备显示内容信息、电子设备上下载信息等),然后通过数据处理层对电子设备的信息进行处理(如无效数据删除等),接着再通过特征抽取层从数据处理层处理后的信息中提取出需要的第一信息(第一信息具体可参阅上述实施例的说明),再然后将第一信息输入情景建模层,情景建模层包括一预先存储的预测模型,情景建模层的预测模型根据第一信息进行训练,得到训练后的第一预测模型以及目标模型参数,然后通过传输模块(如射频模块)将目标模型参数上传到服务器,服务器基于迁移学习对上传的目标模型参数和其他用户上传的模型参数进行对齐,避免数据不一致带来的模型参数难以直接融合的问题。接下来将对齐后的模型参数进行计算,得到共用模型参数,再然后将共用模型参数发送回电子设备,电子设备接收到共用模型参数后,将共用模型参数输入情景建模层,情景建模层中的预测模型的参数用共用模型参数替换,得到第二预测模型。其中,预测模块可以直接用共用模型参数替代原先的模型参数,也可以用共用模型参数替代原先的模型参数后再进行训练学习得到第二预测模型。最后智能服务层可以利用第二预测模型进行预测,以及根据预测结果进行功能控制。例如,根据用户的出行信息进行预测,预测结果为将要高铁出行,则可以推荐购票软件、地图软件、租车软件、打车软件、车次查询软件等。In some embodiments, the model processing method may specifically include: firstly acquiring information of the user's electronic device through the information perception layer (specifically including electronic device operation information, user behavior information, information acquired by various sensors, electronic device status information, electronic device Display content information, download information on electronic devices, etc.), and then process the information of electronic devices (such as invalid data deletion, etc.) through the data processing layer, and then extract the required information from the information processed by the data processing layer through the feature extraction layer. the first information (for details of the first information, please refer to the description of the above-mentioned embodiment), and then input the first information into the scenario modeling layer. The scenario modeling layer includes a pre-stored prediction model, and the prediction model of the scenario modeling layer is based on The first information is trained to obtain the trained first prediction model and target model parameters, and then the target model parameters are uploaded to the server through a transmission module (such as a radio frequency module), and the server uploads the uploaded target model parameters and other users based on transfer learning. The model parameters are aligned to avoid the problem that the model parameters are difficult to directly integrate due to data inconsistency. Next, the aligned model parameters are calculated to obtain the shared model parameters, and then the shared model parameters are sent back to the electronic device. After the electronic device receives the shared model parameters, the shared model parameters are input into the scenario modeling layer. The parameters of the prediction model in are replaced with the shared model parameters to obtain the second prediction model. The prediction module can directly replace the original model parameters with the shared model parameters, or can also use the shared model parameters to replace the original model parameters and then perform training and learning to obtain the second prediction model. Finally, the intelligent service layer can use the second prediction model to make predictions, and perform function control according to the prediction results. For example, if the prediction is made based on the user's travel information, and the prediction result is that there will be a high-speed rail trip, ticket purchasing software, map software, car rental software, taxi-hailing software, train number inquiry software, etc. can be recommended.
请参阅图6,图6为本申请实施例提供的模型处理装置的结构示意图。模型处理装置400包括模型参数第一获取模块401、第一发送模块402、接收模块403和处理模块404。Please refer to FIG. 6 , which is a schematic structural diagram of a model processing apparatus provided by an embodiment of the present application. The model processing apparatus 400 includes a model parameter first obtaining module 401 , a first sending module 402 , a receiving
模型参数第一获取模块401,用于获取第一信息,并将第一信息作为训练样本输入预测模型进行训练,得到训练后的第一预测模型的目标模型参数。The model parameter first obtaining module 401 is configured to obtain first information, and input the first information as a training sample into a prediction model for training, and obtain target model parameters of the trained first prediction model.
第一发送模块402,用于将目标模型参数发送至服务器。The first sending module 402 is configured to send the target model parameters to the server.
接收模块403,用于接收服务器返回的共用模型参数,共用模型参数为目标模型参数与其他用户对应的模型参数计算得到的。The receiving
处理模块404,用于根据共用模型参数得到第二预测模型。The
本实施例的模型处理装置可以设置在用户使用的电子设备中。The model processing apparatus of this embodiment may be provided in an electronic device used by a user.
在一些实施例中,处理模块404还用于获取目标模型参数和共用模型参数的匹配度;当匹配度小于预设匹配度时,利用共用模型参数和第一信息重新训练预测模型;当匹配度大于预设匹配度时,根据共用模型参数得到第二预测模型。In some embodiments, the
在一些实施例中,处理模块404还用于将使用共用模型参数的预测模型作为第二预测模型。In some embodiments, the
在一些实施例中,处理模块404还用于根据目标模型参数调整共用模型参数,得到第二模型参数;将使用第二模型参数的预测模型作为第二预测模型。In some embodiments, the
在一些实施例中,处理模块404还用于使用共用模型参数的预测模型根据第一信息进行训练,以调整共用模型参数得到第二模型参数;将使用第二模型参数的预测模型作为第二预测模型。In some embodiments, the
请参阅图7,图7为本申请实施例提供的模型处理装置的另一结构示意图。模型处理装置500包括模型参数第二获取模块501、调整模块502、共用模型参数获取模块503和第二发送模块504。Please refer to FIG. 7 , which is another schematic structural diagram of a model processing apparatus provided by an embodiment of the present application. The model processing apparatus 500 includes a second model parameter obtaining module 501 , an
模型参数第二获取模块501,用于根据对应每个用户的预测模型的一组模型参数,得到对应多个用户的多组模型参数;A second model parameter acquisition module 501, configured to obtain multiple sets of model parameters corresponding to multiple users according to a set of model parameters corresponding to the prediction model of each user;
调整模块502,用于将多组模型参数调整为同一标准的多组标准模型参数;an
共用模型参数获取模块503,用于将多组标准模型参数进行计算,得到一组共用模型参数;a shared model
第二发送模块504,用于将共用模型参数向对应每个用户的预测模型发送,用以将共用模型参数作为对应每个用户的预测模型的第二模型参数。The second sending module 504 is configured to send the shared model parameters to the prediction model corresponding to each user, so as to use the shared model parameters as the second model parameters of the prediction model corresponding to each user.
其中,本实施例的各模块可以和上述实施例中的各模块配合使用。例如,模型参数第二获取模块501接收第一发送模块402发送的模型参数。接收模块403接收第二发送模块504发送的共用模型参数等。The modules in this embodiment may be used in cooperation with the modules in the foregoing embodiments. For example, the second model parameter acquisition module 501 receives the model parameters sent by the first sending module 402 . The receiving
本实施例的模型处理装置可以设置在服务器中。The model processing apparatus of this embodiment may be provided in the server.
请参阅图8,图8为本申请实施例提供的电子设备600的第一种结构示意图。其中,电子设备600包括处理器601和存储器602。处理器601与存储器602电性连接。Please refer to FIG. 8 , which is a schematic diagram of a first structure of an
处理器601是电子设备600的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或调用存储在存储器602内的计算机程序,以及调用存储在存储器602内的数据,执行电子设备的各种功能和处理数据,从而对电子设备进行整体监控。The
在本实施例中,电子设备600中的处理器601会按照如下的步骤,将一个或一个以上的计算机程序的进程对应的指令加载到存储器602中,并由处理器601来运行存储在存储器602中的计算机程序,从而实现各种功能:In this embodiment, the
获取第一信息,并将第一信息作为训练样本输入预测模型进行训练,得到训练后的第一预测模型的目标模型参数;acquiring first information, and inputting the first information as a training sample into a prediction model for training, to obtain target model parameters of the trained first prediction model;
将目标模型参数发送至服务器;Send the target model parameters to the server;
接收服务器返回的共用模型参数,共用模型参数为目标模型参数与其他用户对应的模型参数计算得到的;Receive the shared model parameters returned by the server, and the shared model parameters are calculated from the target model parameters and the model parameters corresponding to other users;
根据共用模型参数得到第二预测模型。A second prediction model is obtained according to the shared model parameters.
在一些实施例中,在根据共用模型参数得到第二预测模型时,处理器601执行以下步骤:In some embodiments, when obtaining the second prediction model according to the shared model parameters, the
获取目标模型参数和共用模型参数的匹配度;Obtain the matching degree between the target model parameters and the shared model parameters;
当匹配度小于预设匹配度时,利用共用模型参数和第一信息重新训练预测模型;When the matching degree is less than the preset matching degree, the prediction model is retrained by using the shared model parameters and the first information;
当匹配度大于预设匹配度时,根据共用模型参数得到第二预测模型。When the matching degree is greater than the preset matching degree, a second prediction model is obtained according to the shared model parameters.
在一些实施例中,在根据共用模型参数得到第二预测模型时,处理器601执行以下步骤:In some embodiments, when obtaining the second prediction model according to the shared model parameters, the
将使用共用模型参数的预测模型作为第二预测模型。The prediction model using the shared model parameters will be used as the second prediction model.
在一些实施例中,在根据共用模型参数得到第二预测模型时,处理器601执行以下步骤:In some embodiments, when obtaining the second prediction model according to the shared model parameters, the
根据目标模型参数调整共用模型参数,得到第二模型参数;Adjust the shared model parameters according to the target model parameters to obtain the second model parameters;
将使用第二模型参数的预测模型作为第二预测模型。The prediction model using the second model parameters will be used as the second prediction model.
在一些实施例中,在根据共用模型参数得到第二预测模型时,处理器601执行以下步骤:In some embodiments, when obtaining the second prediction model according to the shared model parameters, the
使用共用模型参数的预测模型根据第一信息进行训练,以调整共用模型参数得到第二模型参数;The prediction model using the shared model parameters is trained according to the first information to adjust the shared model parameters to obtain the second model parameters;
将使用第二模型参数的预测模型作为第二预测模型。The prediction model using the second model parameters will be used as the second prediction model.
在一些实施例中,处理器601执行以下步骤:In some embodiments,
根据对应每个用户的预测模型的一组模型参数,得到对应多个用户的多组模型参数;According to a set of model parameters corresponding to the prediction model of each user, multiple sets of model parameters corresponding to multiple users are obtained;
将多组模型参数调整为同一标准的多组标准模型参数;Adjust multiple sets of model parameters to multiple sets of standard model parameters of the same standard;
将多组标准模型参数进行计算,得到一组共用模型参数;Calculate multiple sets of standard model parameters to obtain a set of common model parameters;
将共用模型参数向对应每个用户的预测模型发送,用以将共用模型参数作为对应每个用户的预测模型的第二模型参数。The shared model parameters are sent to the prediction model corresponding to each user, so as to use the shared model parameters as the second model parameters of the prediction model corresponding to each user.
在一些实施例中,请参阅图9,图9为本申请实施例提供的电子设备600的第二种结构示意图。In some embodiments, please refer to FIG. 9 , which is a schematic diagram of a second structure of an
其中,电子设备600还包括:显示屏603、控制电路604、输入单元605、传感器606以及电源607。其中,处理器601分别与显示屏603、控制电路604、输入单元605、传感器606以及电源607电性连接。The
显示屏603可用于显示由用户输入的信息或提供给用户的信息以及电子设备的各种图形用户接口,这些图形用户接口可以由图像、文本、图标、视频和其任意组合来构成。The
控制电路604与显示屏603电性连接,用于控制显示屏603显示信息。The
输入单元605可用于接收输入的数字、字符信息或用户特征信息(例如指纹),以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。其中,输入单元605可以包括指纹识别模组。The
传感器606用于采集电子设备自身的信息或者用户的信息或者外部环境信息。例如,传感器606可以包括距离传感器、磁场传感器、光线传感器、加速度传感器、指纹传感器、霍尔传感器、位置传感器、陀螺仪、惯性传感器、姿态感应器、气压计、心率传感器等多个传感器。The
电源607用于给电子设备600的各个部件供电。在一些实施例中,电源607可以通过电源管理系统与处理器601逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。
尽管图9中未示出,电子设备600还可以包括摄像头、蓝牙模块等,在此不再赘述。Although not shown in FIG. 9 , the
由上可知,本申请实施例提供了一种电子设备,电子设备中的处理器执行以下步骤:获取第一信息,并将第一信息作为训练样本输入预测模型进行训练,得到训练后预测模型的模型参数;将模型参数发送至服务器;接收服务器返回的共用模型参数,共用模型参数为模型参数与其他用户对应的模型参数计算得到的;根据共用模型参数得到第二预测模型。It can be seen from the above that the embodiment of the present application provides an electronic device, and the processor in the electronic device performs the following steps: acquiring first information, and inputting the first information as a training sample into a prediction model for training, and obtaining the prediction model of the trained prediction model. model parameters; sending the model parameters to the server; receiving the shared model parameters returned by the server, where the shared model parameters are calculated from model parameters corresponding to other users; and obtaining a second prediction model according to the shared model parameters.
本申请实施例还提供一种存储介质,存储介质中存储有计算机程序,当计算机程序在计算机上运行时,计算机执行上述任一实施例所述的模型处理方法。An embodiment of the present application further provides a storage medium, where a computer program is stored in the storage medium, and when the computer program runs on the computer, the computer executes the model processing method described in any of the foregoing embodiments.
例如,在一些实施例中,当所述计算机程序在计算机上运行时,所述计算机执行以下步骤:For example, in some embodiments, when the computer program is run on a computer, the computer performs the following steps:
获取第一信息,并将第一信息作为训练样本输入预测模型进行训练,得到训练后的第一预测模型的目标模型参数;acquiring first information, and inputting the first information as a training sample into a prediction model for training, to obtain target model parameters of the trained first prediction model;
将目标模型参数发送至服务器;Send the target model parameters to the server;
接收服务器返回的共用模型参数,共用模型参数为目标模型参数与其他用户对应的模型参数计算得到的;Receive the shared model parameters returned by the server, and the shared model parameters are calculated from the target model parameters and the model parameters corresponding to other users;
根据共用模型参数得到第二预测模型。A second prediction model is obtained according to the shared model parameters.
需要说明的是,本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过计算机程序来指令相关的硬件来完成,所述计算机程序可以存储于计算机可读存储介质中,所述存储介质可以包括但不限于:只读存储器(ROM,Read OnlyMemory)、随机存取存储器(RAM,Random Access Memory)、磁盘或光盘等。It should be noted that those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium , the storage medium may include, but is not limited to, a read only memory (ROM, Read Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and the like.
以上对本申请实施例所提供的模型处理方法、装置、存储介质及电子设备进行了详细介绍。本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The model processing method, apparatus, storage medium, and electronic device provided by the embodiments of the present application have been described in detail above. The principles and implementations of the present application are described herein using specific examples, and the descriptions of the above embodiments are only used to help understand the methods and core ideas of the present application; meanwhile, for those skilled in the art, according to the Thoughts, there will be changes in specific embodiments and application scopes. To sum up, the contents of this specification should not be construed as limitations on the present application.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910282133.5A CN111797302A (en) | 2019-04-09 | 2019-04-09 | Model processing method, device, storage medium and electronic device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910282133.5A CN111797302A (en) | 2019-04-09 | 2019-04-09 | Model processing method, device, storage medium and electronic device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111797302A true CN111797302A (en) | 2020-10-20 |
Family
ID=72805319
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910282133.5A Pending CN111797302A (en) | 2019-04-09 | 2019-04-09 | Model processing method, device, storage medium and electronic device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111797302A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112232437A (en) * | 2020-11-04 | 2021-01-15 | 深圳技术大学 | Internet of things terminal data analysis method and system |
CN112613686A (en) * | 2020-12-31 | 2021-04-06 | 广州兴森快捷电路科技有限公司 | Process capability prediction method, system, electronic device and storage medium |
CN112926126A (en) * | 2021-03-31 | 2021-06-08 | 南京信息工程大学 | Federal learning method based on Markov random field |
CN114491943A (en) * | 2021-12-23 | 2022-05-13 | 北京达佳互联信息技术有限公司 | Information processing method, temperature prediction model training method, device and electronic equipment |
WO2023169425A1 (en) * | 2022-03-07 | 2023-09-14 | 维沃移动通信有限公司 | Data processing method in communication network, and network-side device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109189825A (en) * | 2018-08-10 | 2019-01-11 | 深圳前海微众银行股份有限公司 | Lateral data cutting federation learning model building method, server and medium |
US20190034658A1 (en) * | 2017-07-28 | 2019-01-31 | Alibaba Group Holding Limited | Data secruity enhancement by model training |
CN109389412A (en) * | 2017-08-02 | 2019-02-26 | 阿里巴巴集团控股有限公司 | A kind of method and device of training pattern |
CN109492420A (en) * | 2018-12-28 | 2019-03-19 | 深圳前海微众银行股份有限公司 | Model parameter training method, terminal, system and medium based on federation's study |
-
2019
- 2019-04-09 CN CN201910282133.5A patent/CN111797302A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20190034658A1 (en) * | 2017-07-28 | 2019-01-31 | Alibaba Group Holding Limited | Data secruity enhancement by model training |
CN109389412A (en) * | 2017-08-02 | 2019-02-26 | 阿里巴巴集团控股有限公司 | A kind of method and device of training pattern |
CN109189825A (en) * | 2018-08-10 | 2019-01-11 | 深圳前海微众银行股份有限公司 | Lateral data cutting federation learning model building method, server and medium |
CN109492420A (en) * | 2018-12-28 | 2019-03-19 | 深圳前海微众银行股份有限公司 | Model parameter training method, terminal, system and medium based on federation's study |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112232437A (en) * | 2020-11-04 | 2021-01-15 | 深圳技术大学 | Internet of things terminal data analysis method and system |
CN112613686A (en) * | 2020-12-31 | 2021-04-06 | 广州兴森快捷电路科技有限公司 | Process capability prediction method, system, electronic device and storage medium |
CN112926126A (en) * | 2021-03-31 | 2021-06-08 | 南京信息工程大学 | Federal learning method based on Markov random field |
CN112926126B (en) * | 2021-03-31 | 2023-04-25 | 南京信息工程大学 | A Federated Learning Method Based on Markov Random Field |
CN114491943A (en) * | 2021-12-23 | 2022-05-13 | 北京达佳互联信息技术有限公司 | Information processing method, temperature prediction model training method, device and electronic equipment |
WO2023169425A1 (en) * | 2022-03-07 | 2023-09-14 | 维沃移动通信有限公司 | Data processing method in communication network, and network-side device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111797302A (en) | Model processing method, device, storage medium and electronic device | |
CN111797288B (en) | Data screening method and device, storage medium and electronic equipment | |
CN112069414A (en) | Recommendation model training method and device, computer equipment and storage medium | |
WO2020001084A1 (en) | Online learning facial recognition method | |
CN111914812A (en) | Image processing model training method, device, equipment and storage medium | |
CN111797861A (en) | Information processing method, information processing apparatus, storage medium, and electronic device | |
CN111798259A (en) | Application recommendation method and device, storage medium and electronic equipment | |
CN111797854B (en) | Scene model building method and device, storage medium and electronic equipment | |
CN111797851A (en) | Feature extraction method and device, storage medium and electronic equipment | |
CN111797867A (en) | System resource optimization method, device, storage medium and electronic device | |
CN111797148A (en) | Data processing method, data processing device, storage medium and electronic equipment | |
CN111796925A (en) | Method and device for screening algorithm model, storage medium and electronic equipment | |
CN111797873A (en) | Scene recognition method, device, storage medium and electronic device | |
CN111798019B (en) | Intention prediction method, intention prediction device, storage medium and electronic equipment | |
WO2020207252A1 (en) | Data storage method and device, storage medium, and electronic apparatus | |
CN111797289A (en) | Model processing method and device, storage medium and electronic equipment | |
CN111797303A (en) | Information processing method, information processing apparatus, storage medium, and electronic device | |
CN111797655A (en) | User activity identification method and device, storage medium and electronic equipment | |
CN111796663B (en) | Scene recognition model updating method and device, storage medium and electronic equipment | |
CN111797874A (en) | Behavior prediction method, behavior prediction device, storage medium and electronic equipment | |
Aravindan et al. | A Smart Assistive System for Visually Impaired to Inform Acquaintance Using Image Processing (ML) Supported by IoT | |
CN111797869A (en) | Model training method and device, storage medium and electronic equipment | |
CN111800538B (en) | Information processing method, device, storage medium and terminal | |
CN111797075B (en) | Data recovery method and device, storage medium and electronic equipment | |
WO2020207294A1 (en) | Service processing method and apparatus, and storage medium and electronic device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |