CN115935189A - Method, device, system and equipment for training trans-city federal migration model - Google Patents
Method, device, system and equipment for training trans-city federal migration model Download PDFInfo
- Publication number
- CN115935189A CN115935189A CN202211677031.1A CN202211677031A CN115935189A CN 115935189 A CN115935189 A CN 115935189A CN 202211677031 A CN202211677031 A CN 202211677031A CN 115935189 A CN115935189 A CN 115935189A
- Authority
- CN
- China
- Prior art keywords
- city
- index data
- cross
- target
- model
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000013508 migration Methods 0.000 title claims abstract description 341
- 230000005012 migration Effects 0.000 title claims abstract description 341
- 238000012549 training Methods 0.000 title claims abstract description 242
- 238000000034 method Methods 0.000 title claims abstract description 92
- 230000006870 function Effects 0.000 claims description 95
- 230000002776 aggregation Effects 0.000 claims description 26
- 238000004220 aggregation Methods 0.000 claims description 26
- 230000008569 process Effects 0.000 claims description 23
- 238000012360 testing method Methods 0.000 claims description 19
- 238000004590 computer program Methods 0.000 claims description 15
- 238000013499 data model Methods 0.000 claims description 11
- 230000004044 response Effects 0.000 claims description 10
- 238000010586 diagram Methods 0.000 description 13
- 238000011161 development Methods 0.000 description 9
- 238000012545 processing Methods 0.000 description 9
- 238000004891 communication Methods 0.000 description 8
- 238000012544 monitoring process Methods 0.000 description 4
- 238000009472 formulation Methods 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 238000007726 management method Methods 0.000 description 3
- 239000000203 mixture Substances 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000012935 Averaging Methods 0.000 description 2
- 230000008901 benefit Effects 0.000 description 2
- 230000002950 deficient Effects 0.000 description 2
- 230000007613 environmental effect Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000003062 neural network model Methods 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 239000011521 glass Substances 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Landscapes
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses a method, a device, a system and equipment for training a trans-city federal migration model, which relate to the technical field of intelligent cities, and the method comprises the following steps: determining prediction index data and prediction city labels based on an initial cross-city federal migration model and training index data in an obtained training index data set; adjusting model parameters of the initial cross-city federal migration model based on standard index data corresponding to the prediction index data and standard city labels corresponding to the prediction city labels to obtain a trained target cross-city federal migration model; and sending the model parameters of the target cross-city federal migration model to the target city client, so that the target city client builds a standard cross-city federal migration model based on the received model parameters, and determines a target city label based on the standard cross-city federal migration model. The embodiment of the invention solves the problem that the target city cannot finish the city portrait task due to the missing of index data.
Description
Technical Field
The embodiment of the invention relates to the technical field of intelligent cities, in particular to a method, a device, a system and equipment for training a trans-city federal migration model.
Background
The combination of big data and city development is an important development direction of a future city, and the city portrait task is to predict city labels (such as business popularity indexes and consumption indexes) capable of describing city operation states based on index data (such as population data and traffic data) generated in the city development process so as to guide the future development direction of the city.
The training neural network model is used as an effective method for predicting the city label, but because the development levels and the development directions of different cities are different, the data volume of index data of some cities is possibly small, so that the cities do not have the condition for training the neural network model. In order to solve the problem, the existing trans-city migration method is to obtain a trans-city federal migration model through training a source city with rich data resources, and migrate the trans-city federal migration model to a target city with deficient data resources so as to assist the target city to complete a city portrait task.
In the process of implementing the invention, at least the following technical problems are found in the prior art:
in an actual city scene, not only the target city may have a missing city tag, but also some type of index data may be missing. Therefore, the cross-city federal migration model that migrates into a target city cannot complete city portrayal tasks without simultaneous loss of city labels and loss of index data.
Disclosure of Invention
The embodiment of the invention provides a method, a device, a system and equipment for training a cross-city federal migration model, which are used for solving the problem that a target city cannot complete a city portrait task due to the fact that index data are lost, and widening the application scene of a cross-city migration method.
According to one embodiment of the invention, a training method of a cross-city federal migration model is provided, which is applied to a source city client and comprises the following steps:
in response to the acquisition of a training index data set, determining prediction index data and prediction city labels based on an initial cross-city federal migration model and the training index data in the training index data set;
adjusting model parameters of the initial cross-city federal migration model based on standard index data corresponding to the prediction index data and standard city labels corresponding to the prediction city labels to obtain a trained target cross-city federal migration model;
sending the model parameters of the target cross-city federal migration model to a target city client, so that the target city client builds a standard cross-city federal migration model based on the received model parameters, and determines a target city label based on the standard cross-city federal migration model.
According to another embodiment of the invention, a training method of a cross-city federal migration model is provided, which is applied to a target city client, and comprises the following steps:
receiving model parameters of a trained target cross-city federal migration model sent by a source city client, and constructing a standard cross-city federal migration model based on the model parameters;
inputting test index data into the standard trans-city federal migration model to obtain an output target city label;
the target cross-city federal migration model is obtained by the source city client determining prediction index data and prediction city labels based on an initial cross-city federal migration model and training index data in a training index data set, and executing training operation on the initial cross-city federal migration model based on standard index data corresponding to the prediction index data and standard city labels corresponding to the prediction city labels.
According to another embodiment of the present invention, a training apparatus for a cross-city federal migration model is provided, which is applied to a source city client, and the apparatus includes:
the prediction city label determining module is used for responding to the obtained training index data set, and determining prediction index data and prediction city labels based on an initial trans-city federal migration model and the training index data in the training index data set;
a target cross-city federal migration model determination module, configured to adjust model parameters of the initial cross-city federal migration model based on standard index data corresponding to the prediction index data and standard city labels corresponding to the prediction city labels, so as to obtain a trained target cross-city federal migration model;
and the model parameter sending module is used for sending the model parameters of the target cross-city federal migration model to the target city client, so that the target city client builds a standard cross-city federal migration model based on the received model parameters, and determines a target city label based on the standard cross-city federal migration model.
According to another embodiment of the present invention, a training apparatus for a cross-city federal migration model is provided, which is applied to a target city client, and the apparatus includes:
the standard cross-city federal migration model building module is used for receiving model parameters of a trained target cross-city federal migration model sent by a source city client, and building a standard cross-city federal migration model based on the model parameters;
the target city label determining module is used for inputting the test index data into the standard trans-city federal migration model to obtain an output target city label;
the target cross-city federal migration model is obtained by the source city client determining prediction index data and prediction city labels based on an initial cross-city federal migration model and training index data in a training index data set, and executing training operation on the initial cross-city federal migration model based on standard index data corresponding to the prediction index data and standard city labels corresponding to the prediction city labels.
According to another embodiment of the invention, a training system for a cross-city federal migration model is provided, which comprises: a source city client and a target city client;
the source city client is used for responding to the obtained training index data set, determining prediction index data and prediction city labels based on an initial cross-city federal migration model and training index data in the training index data set, adjusting model parameters of the initial cross-city federal migration model based on standard index data corresponding to the prediction index data and standard city labels corresponding to the prediction city labels to obtain a trained target cross-city federal migration model, and sending the model parameters of the target cross-city federal migration model to a target city client;
the target city client is used for constructing a standard cross-city federal migration model based on the received model parameters and determining a target city label based on the standard cross-city federal migration model.
According to another embodiment of the present invention, there is provided a terminal device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform a method of training a cross-city federal migration model in accordance with any of the embodiments of the present invention.
According to another embodiment of the present invention, a computer-readable storage medium is provided, which stores computer instructions for causing a processor to implement a method for training a cross-city federal migration model according to any one of the embodiments of the present invention when executed.
According to the technical scheme, the prediction index data and the prediction city label are determined based on the initial cross-city federal migration model and the training index data in the training index data set in response to the obtained training index data set, model parameters of the initial cross-city federal migration model are adjusted based on the standard index data corresponding to the prediction index data and the standard city label corresponding to the prediction city label, and the trained target cross-city federal migration model is obtained, so that the trained target cross-city federal migration model has the capabilities of predicting index data and predicting city label at the same time, the problem that a target city cannot complete a city portrait task due to the fact that the target city lacks the index data is solved, and the application scene of the cross-city migration method is widened.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flowchart of a method for training a cross-city federated migration model according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a relationship between different index data for different cities, according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating an exemplary method for training a cross-city federated migration model according to an embodiment of the present invention;
FIG. 4 is a flowchart of another method for training a cross-city federated migration model according to an embodiment of the present invention;
FIG. 5 is a flowchart of a method for training a cross-city federated migration model according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a training apparatus for a cross-city federal migration model according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a training apparatus for a cross-city federal migration model according to an embodiment of the present invention;
FIG. 8 is a schematic structural diagram of a training system of a cross-city federal migration model according to an embodiment of the present invention;
FIG. 9 is a system diagram illustrating a training system for a cross-city federal migration model according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Fig. 1 is a flowchart of a method for training a cross-city federal migration model according to an embodiment of the present invention, where the embodiment is applicable to a case where a city portrait task is executed on a target city lacking index data, the method may be executed by a training apparatus of the cross-city federal migration model, the training apparatus of the cross-city federal migration model may be implemented in hardware and/or software, and the training apparatus of the cross-city federal migration model may be configured in a source city client. The source city client can represent the client corresponding to the city with rich index data resources. As shown in fig. 1, the method includes:
s110, in response to the training index data set, determining prediction index data and prediction city labels based on the initial cross-city federal migration model and the training index data in the training index data set.
For example, the training index data may be used to characterize data generated in the developing process of the source city, for example, the training index data may be population data, traffic data, tax data, and the like.
The predicted city label may be, for example, a consumption index, a traffic convenience degree, an air quality index, and the like. The consumption index can provide a reference basis for subsequent business district planning, the traffic convenience degree can provide a reference basis for subsequent traffic scheduling, and the air quality index can provide a reference basis for the formulation and implementation of subsequent environmental management schemes.
In one embodiment, the training index data includes point-of-interest area data, road network data, and population data, wherein the point-of-interest area data includes at least one of a number of points of interest, a total number of points of interest, and an interest entropy corresponding to at least one type of point of interest, the road network data includes a number of roads corresponding to at least one type of roads, the population data includes a working population number and/or a residential population number, and accordingly, the prediction index data is a consumption population number, and the prediction city label is a category of business popularity.
Specifically, the Point of Interest area data may be used to describe functions or attributes of different areas in the city, and in particular, the number and type of points of Interest (POIs) may reflect popularity of an area. Exemplary types of points of interest include, but are not limited to, catering services, scenic spots, public facilities, shopping, transportation services, financial insurance services, science and education services, business housing, living services, sports services, healthcare services, government agencies and social groups, lodging services, green parks, and the like, and are not limited thereto.
In one embodiment, the interest point region data includes the number d of interest points corresponding to each interest point type pf Total number of points of interest d pn And point of interest entropy d pe Wherein the entropy value d of the point of interest pe Satisfies the formula:
wherein,and representing the number of interest points corresponding to the interest point type in the ith. Wherein, the entropy value d of the interest point pe The functional diversity of a region can be reflected.
Specifically, the road network data may reflect the degree of convenience of traffic in the city. Wherein, for example, the road types include but are not limited to expressways, living streets, forestry roads, competition roads, etc., and the number of roads corresponding to each of at least one road type can be d rf And (4) showing.
In particular, the population data may reflect the distribution of different population types in different areas of a city, such as, but not limited to, working population, residential population, and consumer population. In one embodiment, the demographic data includes, in particular, the number of working population d wp And number of inhabited population d rp 。
In one embodiment, specifically, determining the forecast indicator data and the forecast city label based on the initial cross-city federal migration model and the training indicator data in the training indicator data set includes: respectively inputting training index data in a training index data set into an initial data generation module and an initial label generation module in an initial cross-city federal migration model; outputting prediction index data based on input training index data through an initial data generation module; and outputting the predicted city label based on the input training index data and the prediction index data output by the initial data generation module through the initial label generation module.
Fig. 2 is a diagram illustrating a relationship between different index data of different cities according to an embodiment of the present invention. Specifically, fig. 2 reflects the relationship between the normalized POI entropy and the normalized number of consumption population for 4 different cities (city a, city B, city C, and city D, respectively). From fig. 2, it can be derived: knowledge of the relationships between different index data has similarities between different cities. Due to the different development levels or development directions of different cities, the same type of index data generated by different cities usually has relatively large difference. However, there is similarity in the relationship knowledge between different types of index data of different cities (as shown in fig. 2), so that the initial data generation module in the initial cross-city federal migration model is trained based on the training index data of the source city, so that the initial data generation module can learn the relationship knowledge between different index data, and the trainability of the initial data generation module and the accuracy of the output prediction index data can be further ensured.
In one embodiment, the initial data generation module includes a feature extractor, a data regressor and a domain classifier, and accordingly, based on the input training index data, outputs prediction index data, including: inputting the training index data into a feature extractor to obtain an output training index feature; and outputting prediction index data based on the training index features output by the feature extractor through a data regressor, and outputting a prediction city classification result based on the training index features output by the feature extractor through a domain classifier.
Specifically, the feature extractor may learn and extract a relationship feature between the training index data and the prediction index data. Illustratively, the feature extractor may comprise two fully connected layers. The network architecture of the feature extractor is not limited herein.
In one embodiment, the prediction index data is, in particular, a consumption population number. Specifically, the prediction index data output by the data regressor data is the predicted number of the consumption population. Illustratively, the data regressor may comprise two fully connected layers and one regression layer. The network architecture of the feature extractor is not limited herein.
Specifically, there may be a domain shift problem only using the feature extractor and the data regressor, and to solve the problem, the initial data generation module in this embodiment includes a domain classifier. Illustratively, the domain classifier may include two fully connected layers and one classification layer, among others. The network architecture of the domain classifier is not limited herein.
Specifically, the prediction city classification result may be used to characterize from which source city client the training feature data comes.
In particular, accurate category prediction of business popularity can provide powerful data support for the formulation and implementation of business circle planning schemes. For example, the category of business popularity may correspond to a tag count of 5, very high, medium, low, and very low, respectively.
And S120, adjusting model parameters of the initial cross-city federal migration model based on standard index data corresponding to the prediction index data and standard city labels corresponding to the prediction city labels to obtain a trained target cross-city federal migration model.
In this embodiment, specifically, the training index data set includes training index data corresponding to at least two source city clients, and accordingly, based on standard index data corresponding to the prediction index data and standard city labels corresponding to the prediction city labels, model parameters of the initial cross-city federal migration model are adjusted to obtain a trained target cross-city federal migration model, which includes: determining a target loss function based on standard index data corresponding to the prediction index data and standard city labels corresponding to the prediction city labels aiming at each iteration process of the initial cross-city federal migration model; and determining current model parameters corresponding to the initial cross-city federal migration model of the current iteration based on the target loss function, and taking the initial cross-city federal migration model of the current iteration as a trained target cross-city federal migration model until the target loss function is converged.
Specifically, training index data corresponding to at least two source city clients are obtained, the at least two training index data are input into an initial cross-city federal migration model respectively, output prediction index data and prediction city labels are obtained, a target loss function is determined based on standard index data corresponding to the prediction index data and standard city labels corresponding to the prediction city labels, current model parameters corresponding to the initial cross-city federal migration model of current iteration are determined based on the target loss function, and the initial cross-city federal migration model of the current iteration is used as a target cross-city federal migration model after training is completed until the target loss function is converged. The at least two source city clients comprise current source city clients.
It should be noted that, the acquisition, storage, application, and the like of the training index data of the source city according to the embodiment of the present invention all conform to the regulations of the relevant laws and regulations.
S130, sending model parameters of the target cross-city federal migration model to the target city client, so that the target city client builds a standard cross-city federal migration model based on the received model parameters, and determines a target city label based on the standard cross-city federal migration model.
Specifically, the target city client may construct a standard cross-city federal migration model based on the received model parameters and a model architecture of an initial cross-city federal migration model, input test index data corresponding to training index data into the standard cross-city federal migration model, output missing index data based on the input test index data by a standard data generation module in the standard cross-city federal migration model, and output a target city label based on the input test index data and the missing index data output by a standard data generation module in the standard cross-city federal migration model. The test index data may be existing data in the target city, which has the same index type as the training index data, for example, the test index data includes interest point area data, road network data, and population data of the target city.
Fig. 3 is a flowchart of a specific example of a method for training a cross-city federal migration model according to an embodiment of the present invention. In particular, a plurality of source cities (city a and city B in fig. 3) contain abundant index data resources, e.g., index data resources may be used to characterize index data of different regions in a city. Training an initial cross-city federal migration model based on training index data of a plurality of source cities, wherein the training index data can be tax data, monitoring data and track data. Specifically, the initial cross-city federal migration model comprises an initial data generation module and an initial label generation module, wherein the initial data generation module can be used for learning the relationship knowledge among the index data and generating the prediction index data based on the learned relationship knowledge, and the initial label generation module generates the prediction city label based on the training index data and the prediction index data. For example, the predictive index data may be human mouth data and the predictive city label may be a category of business popularity, specifically, the predictive city label is very high, medium, low, or very low. After the trained target cross-city federal migration model is obtained, the target cross-city federal migration model is migrated to a target city (city C in FIG. 3), and a standard cross-city federal migration model is obtained. The method comprises the steps that the city C inputs tax data, monitoring data and track data of the city C into a standard cross-city federal migration model, a standard data generation module in the standard cross-city federal migration model outputs predicted population data based on the input tax data, the monitoring data and the track data, and a standard label generation module in the standard cross-city federal migration model outputs the category of the business popularity of the city C based on the input tax data, the monitoring data, the track data and the predicted population data.
Specifically, the standard data generation module in the standard cross-city federal migration model comprises a trained feature extractor and a trained data regressor.
According to the technical scheme, the prediction index data and the prediction city label are determined based on the initial cross-city federal migration model and the training index data in the training index data set in response to the obtained training index data set, model parameters of the initial cross-city federal migration model are adjusted based on the standard index data corresponding to the prediction index data and the standard city label corresponding to the prediction city label, the trained target cross-city federal migration model is obtained, the trained target cross-city federal migration model has the capabilities of predicting index data and predicting city label at the same time, the problem that a target city cannot complete a city portrait task due to the fact that the target city lacks the index data is solved, and the application scene of the cross-city migration method is widened.
Fig. 4 is a flowchart of another method for training a cross-city federal migration model according to an embodiment of the present invention, where technical features of "adjusting model parameters of an initial cross-city federal migration model based on standard index data corresponding to predicted index data and standard city labels corresponding to predicted city labels to obtain a trained target cross-city federal migration model" in the above embodiment are further refined. As shown in fig. 4, the method includes:
s210, in response to the training index data set, determining prediction index data and prediction city labels based on the initial cross-city federal migration model and the training index data in the training index data set.
In this embodiment, the training index data set includes training index data corresponding to the current source city client.
S220, aiming at each iteration process of the initial cross-city federal migration model, determining a target loss function based on standard index data corresponding to the prediction index data and standard city labels corresponding to the prediction city labels.
In one embodiment, specifically, the objective loss function includes a first objective loss function corresponding to the initial data generating module and a second objective loss function corresponding to the initial label generating module, and accordingly, the determining the objective loss function based on the standard index data corresponding to the predicted index data and the standard city label corresponding to the predicted city label includes: constructing a first loss function based on the prediction index data and the standard index data, and constructing a second loss function based on the prediction city classification result and the standard city classification result; determining a first target loss function corresponding to the initial data generation module based on the first loss function and the second loss function; and constructing a second target loss function corresponding to the initial label generation module based on the predicted city label and the standard city label.
For example, a least square error algorithm may be used to construct a first loss function based on the prediction index data and the standard index data, and specifically, the first loss function L may be constructed DR Satisfies the formula:
wherein, a i Indicating standard index data corresponding to the ith training index data,prediction index data corresponding to the ith training index data, and N represents the training sample size of the training index data.
For example, a minimum cross entropy algorithm may be used to construct the second loss function, specifically, the second loss function L, based on the predicted city classification result and the standard city classification result DC Satisfies the formula:
wherein d is ij Represents the jth source cityThe standard city classification result to which the ith training index data corresponding to the city client belongs,and | C | represents the number of the source city clients.
On the basis of the foregoing embodiment, specifically, the initial data generation module further includes a gradient inversion layer, the gradient inversion layer is disposed between the feature extractor and the domain classifier, the gradient inversion layer is configured to multiply a function gradient of the second loss function input into the gradient inversion layer by a preset negative number in a back propagation process of the initial data generation module, and accordingly, a coefficient of the second loss function in the first target loss function is the preset negative number.
Wherein, in particular, the first objective loss function L 1 Satisfies the formula:
L 1 =L DR -λL DC
this has the advantage that, due to the large difference between the training index features corresponding to the training index data of different cities, the feature extractor should learn a common feature representation rather than a distinct feature representation between the training index data of different cities, for which purpose the training of the feature extractor should maximize the second loss function L DC . The purpose of the feature reversal layer (GRL) is that the training index features are not affected in the forward propagation process of the initial data generation module, but the feature reversal layer multiplies the function gradient of the second loss function by a preset negative number in the backward propagation process.
For example, a minimum cross entropy algorithm may be used to determine the second objective loss function, specifically, the second objective loss function L, based on the predicted city label and the standard city label 2 Satisfies the formula:
wherein, y ij The standard city label corresponding to the ith training index data corresponding to the jth predicted city label is shown,and | K | represents the number of labels corresponding to the predicted city labels.
And S230, determining current model parameters corresponding to the initial cross-city federal migration model of the current iteration based on the target loss function, and sending the current model parameters to the central server, so that the central server determines aggregation model parameters based on the received current model parameters respectively sent by the at least two source city clients, and sends the aggregation model parameters to the source city clients respectively.
In this embodiment, the at least two source city clients comprise a current source city client.
Specifically, each source city client trains an initial cross-city federal migration model based on local training index data, and sends current model parameters updated in each iteration to a central processing unit.
For example, the central processor may determine the aggregate model parameter based on at least two current model parameters using an averaging or weighted average aggregation algorithm.
S240, taking the received aggregation model parameters sent by the central server as model parameters of the initial cross-city federal migration model of the current iteration until the target loss function is converged, and taking the initial cross-city federal migration model of the current iteration as a trained target cross-city federal migration model.
And S250, sending the model parameters of the target cross-city federal migration model to the target city client, so that the target city client builds a standard cross-city federal migration model based on the received model parameters, and determines a target city label based on the standard cross-city federal migration model.
In one embodiment, specifically, the model parameters of the target cross-city federal migration model are sent to the central server, so that the central server determines the target model parameters based on the received model parameters of the target cross-city federal migration model sent by the at least two source city clients respectively, and sends the target model parameters to the target city client.
For example, the central processor may determine the target model parameter based on the model parameters of the target cross-city federal migration model respectively sent by the at least two source city clients by using an averaging or weighted average aggregation algorithm.
Due to legal or practical constraints, the training index data corresponding to each source city client may relate to the problem of privacy protection and cannot be disclosed to the outside. Thus, there may be situations where training an initial cross-city federal migration model using centralized modeling cannot be achieved. According to the technical scheme, a plurality of source city clients are adopted to train respective initial trans-city federal migration models respectively and simultaneously, for each source city client, in each iteration process of the initial trans-city federal migration model in the current source city client, a target loss function is determined based on standard index data corresponding to the predicted index data and standard city labels corresponding to the predicted city labels, current model parameters corresponding to the initial trans-city federal migration model of the current iteration are determined based on the target loss function, the current model parameters are sent to a central server, aggregation model parameters sent by the central server after aggregation operation is carried out on the current model parameters are received, the aggregation model parameters are used as model parameters of the initial trans-city migration model of the current iteration, when the target loss function is converged, the initial trans-city federal migration model of the current iteration is used as a trained target trans-city migration model, the problem of protection existing when the training index data interaction is carried out by the plurality of source city clients is solved, and the requirement of privacy protection on data in the trans-city migration process is met.
Fig. 5 is a flowchart of a method for training a cross-city federal migration model according to an embodiment of the present invention, where the method is applicable to a case where a city portrait task is executed on a target city lacking index data, and the method may be executed by a training apparatus of the cross-city federal migration model, where the training apparatus of the cross-city federal migration model may be implemented in hardware and/or software, and the training apparatus of the cross-city federal migration model may be configured in a target city client. The target city client can represent the client corresponding to the city with deficient index data resources. As shown in fig. 5, the method includes:
s310, receiving model parameters of the target cross-city federal migration model after training sent by the source city client, and constructing a standard cross-city federal migration model based on the model parameters.
In this embodiment, the target cross-city federal migration model is obtained by determining, by the source city client, prediction index data and prediction city labels based on the initial cross-city federal migration model and training index data in the training index data set, and executing a training operation on the initial cross-city federal migration model based on standard index data corresponding to the prediction index data and standard city labels corresponding to the prediction city labels.
For example, the training index data may be used to characterize data generated in the developing process of the source city, for example, the training index data may be population data, traffic data, tax data, and the like.
In one embodiment, the training index data includes point of interest area data, road network data, and population data, wherein the point of interest area data includes at least one of a number of points of interest, a total number of points of interest, and an entropy of the points of interest corresponding to at least one type of the points of interest, the road network data includes a number of roads corresponding to at least one type of the roads, the population data includes a number of working populations and/or a number of residential populations, and accordingly, the prediction index data is the number of consuming populations, and the prediction city label is a category of business popularity.
In one embodiment, the initial cross-city federal migration model specifically includes an initial data generation module and an initial label generation module, where the initial data generation module is configured to output predicted index data based on training index data in an input training index data set, and the initial label generation module is configured to output a predicted city label based on training index data in the input training index data set and predicted index data output by the initial data generation module.
In one embodiment, specifically, the model parameters include data model parameters corresponding to a target data generation module and tag model parameters corresponding to a target tag generation module in the target cross-city federal migration model, and accordingly, the standard cross-city federal migration model is constructed based on the model parameters, including: constructing a standard data generation module in a standard trans-city federal migration model based on data model parameters, and inputting reference index data into the standard data generation module to obtain output missing index data; and constructing a reference label generation module based on the label model parameters, and training the reference label generation module based on the reference index data and the missing index data to obtain a standard label generation module in the standard trans-city federal migration model.
In one embodiment, it is specifically assumed that the training index data includes the number d of points of interest corresponding to each type of point of interest of the source city client pf Total number of points of interest d pn Entropy of interest points d pe The number of roads d corresponding to each road type rf Number of working population d wp And number of inhabited population d rp Correspondingly, the reference index data includes the quantity b of the interest points respectively corresponding to each interest point type of the target city client pf Total number of points of interest b pn Entropy of interest b pe The number b of roads corresponding to each road type rf Number of working population b wp And the number of residential population b rp Reference index data X t Inputting the data into a standard data generation module in a standard cross-city federal migration modelObtaining the output missing index dataWherein the absence of index data>The following relationship is satisfied:
wherein, theta RK Representing data model parameters.
Specifically, index data X will be referred to t And missing index dataInputting the predicted city label into a constructed reference label generation module to obtain the output predicted city label->And training the reference label generation module based on the predicted city label of the target city and the standard city label of the target city to obtain a standard label generation module in the standard trans-city federal migration model. Wherein the predicted city tag ^ of the target city>The following relationship is satisfied:
wherein, theta task Representing the label model parameters.
For example, a minimum cross entropy algorithm may be used to construct a loss function corresponding to the reference tag generation module, and specifically, the loss function L is constructed t Satisfies the formula:
wherein,represents the standard city label corresponding to the ith reference index data corresponding to the jth predicted city label, and/or the standard city label>The predicted city label corresponding to the ith reference index data corresponding to the jth predicted city label is represented, | K | represents the number of labels corresponding to the predicted city label, and M represents the data amount of the reference index data.
The advantage of this is that in a cross-city migration scenario, the target city lacks the index data, and the city labels still differ from city to city. Therefore, the standard data generation module constructed by the data model parameters can be directly frozen in the target city to generate the missing index data of the target city. And then, performing fine tuning training on a reference label generation module constructed based on the label model parameters based on a small amount of standard label data in the target city to obtain the standard label generation module of the target city. Therefore, the accuracy of the target city label output by the standard trans-city federal migration model corresponding to the target city is further improved.
And S320, inputting the test index data into a standard trans-city federal migration model to obtain an output target city label.
The method comprises the steps that test index data corresponding to training index data are input into a standard cross-city federal migration model, a standard data generation module in the standard cross-city federal migration model outputs missing index data based on the input test index data, and a standard label module in the standard cross-city federal migration model outputs a target city label based on the input test index data and the missing index data output by a standard data generation module. The test index data may be existing data in the target city, which has the same index type as the training index data, for example, the test index data includes interest point area data, road network data, and population data of the target city.
According to the technical scheme, a standard trans-city federal migration model is constructed by receiving model parameters of a trained target trans-city federal migration model sent by a source city client side and based on the model parameters; the method comprises the steps of inputting test index data into a standard cross-city federal migration model to obtain an output target city label, wherein the target cross-city federal migration model is obtained by a source city client side based on an initial cross-city federal migration model and training index data in a training index data set, determining predicted index data and a predicted city label, and executing training operation on the initial cross-city federal migration model based on standard index data corresponding to the predicted index data and the standard city label corresponding to the predicted city label.
Fig. 6 is a schematic structural diagram of a training apparatus for a cross-city federal migration model according to an embodiment of the present invention, which can be configured in a source city client. As shown in fig. 6, the apparatus includes: a predicted city label determination module 410, a target cross-city federal migration model determination module 420 and a model parameter transmission module 430.
The predicted city label determining module 410 is configured to determine, in response to obtaining the training index data set, prediction index data and predicted city labels based on the initial cross-city federal migration model and the training index data in the training index data set;
a target cross-city federal migration model determination module 420, configured to adjust model parameters of the initial cross-city federal migration model based on standard index data corresponding to the prediction index data and standard city labels corresponding to the prediction city labels, so as to obtain a trained target cross-city federal migration model;
and the model parameter sending module 430 is configured to send the model parameters of the target cross-city federal migration model to the target city client, so that the target city client constructs a standard cross-city federal migration model based on the received model parameters, and determines a target city label based on the standard cross-city federal migration model.
According to the technical scheme, the prediction index data and the prediction city label are determined based on the initial cross-city federal migration model and the training index data in the training index data set in response to the obtained training index data set, model parameters of the initial cross-city federal migration model are adjusted based on the standard index data corresponding to the prediction index data and the standard city label corresponding to the prediction city label, the trained target cross-city federal migration model is obtained, the trained target cross-city federal migration model has the capabilities of predicting index data and predicting city label at the same time, the problem that a target city cannot complete a city portrait task due to the fact that the target city lacks the index data is solved, and the application scene of the cross-city migration method is widened.
Based on the foregoing embodiment, specifically, the predicted city tag determining module 410 includes:
the training index data input unit is used for respectively inputting the training index data in the training index data set into an initial data generation module and an initial label generation module in an initial cross-city federal migration model;
the prediction index data output unit is used for outputting prediction index data based on input training index data through the initial data generation module;
and the predicted city label output unit is used for outputting the predicted city label based on the input training index data and the predicted index data output by the initial data generation module through the initial label generation module.
On the basis of the foregoing embodiment, specifically, the initial data generation module includes a feature extractor, a data regressor, and a domain classifier, and the prediction index data output unit is specifically configured to:
inputting the training index data into a feature extractor to obtain output training index features;
and outputting prediction index data based on the training index features output by the feature extractor through a data regressor, and outputting a prediction city classification result based on the training index features output by the feature extractor through a domain classifier.
On the basis of the foregoing embodiment, specifically, the training index data set includes training index data corresponding to the current source city client, and the target cross-city federal migration model determining module 420 includes:
the target loss function determining unit is used for determining a target loss function based on standard index data corresponding to the prediction index data and a standard city label corresponding to the prediction city label aiming at each iteration process of the initial cross-city federal migration model;
the current model parameter sending unit is used for determining current model parameters corresponding to the initial trans-city federal migration model of the current iteration based on a target loss function, and sending the current model parameters to the central server, so that the central server determines aggregation model parameters based on the received current model parameters respectively sent by the at least two source city clients, and sends the aggregation model parameters to the source city clients respectively; the at least two source city clients comprise current source city clients;
and the first target cross-city federal migration model determining unit is used for taking the received aggregation model parameters sent by the central server as model parameters of the current iterative initial cross-city federal migration model until the target loss function is converged, and taking the current iterative initial cross-city federal migration model as the trained target cross-city federal migration model.
On the basis of the foregoing embodiment, specifically, the model parameter sending module 430 is specifically configured to:
and sending the model parameters of the target cross-city federal migration model to a central server, so that the central server determines the target model parameters based on the received model parameters of the target cross-city federal migration model respectively sent by at least two source city clients, and sends the target model parameters to the target city client.
On the basis of the foregoing embodiment, specifically, the training index data set includes training index data respectively corresponding to at least two source city clients, and the target cross-city federal migration model determining module 420 includes:
the target loss function determining unit is used for determining a target loss function based on standard index data corresponding to the prediction index data and a standard city label corresponding to the prediction city label aiming at each iteration process of the initial cross-city federal migration model;
and the second target cross-city federal migration model determining unit is used for determining current model parameters corresponding to the initial cross-city federal migration model of the current iteration based on the target loss function, and taking the initial cross-city federal migration model of the current iteration as a trained target cross-city federal migration model until the target loss function is converged.
On the basis of the foregoing embodiment, specifically, the target loss function includes a first target loss function corresponding to the initial data generating module and a second target loss function corresponding to the initial tag generating module, and the target loss function determining unit is specifically configured to:
constructing a first loss function based on the prediction index data and the standard index data, and constructing a second loss function based on the prediction city classification result and the standard city classification result;
determining a first target loss function corresponding to the initial data generation module based on the first loss function and the second loss function;
and constructing a second target loss function corresponding to the initial label generation module based on the predicted city label and the standard city label.
On the basis of the foregoing embodiment, specifically, the initial data generation module further includes a gradient inversion layer, the gradient inversion layer is disposed between the feature extractor and the domain classifier, the gradient inversion layer is configured to multiply a function gradient of the second loss function input into the gradient inversion layer by a preset negative number in a back propagation process of the initial data generation module, and accordingly, a coefficient of the second loss function in the first target loss function is the preset negative number.
On the basis of the foregoing embodiment, specifically, the training index data includes point of interest area data, road network data, and population data, where the point of interest area data includes at least one of a number of points of interest, a total number of points of interest, and an entropy of the points of interest, which correspond to at least one type of point of interest, the road network data includes a number of roads, which correspond to at least one type of roads, the population data includes a number of working populations and/or a number of residential populations, and accordingly, the prediction index data is a number of consumption populations, and the prediction city label is a category of business popularity.
Fig. 7 is a schematic structural diagram of a training apparatus for a cross-city federal migration model according to an embodiment of the present invention, which may be configured in a target city client. As shown in fig. 7, the apparatus includes: a standard cross-city federal migration model building module 510 and a target city label determination module 520.
The standard cross-city federal migration model building module 510 is used for receiving model parameters of a trained target cross-city federal migration model sent by a source city client, and building a standard cross-city federal migration model based on the model parameters;
a target city label determining module 520, configured to input the test index data into a standard cross-city federal migration model, so as to obtain an output target city label;
the target cross-city federal migration model is obtained by determining prediction index data and prediction city labels by a source city client based on an initial cross-city federal migration model and training index data in a training index data set, and executing training operation on the initial cross-city federal migration model based on standard index data corresponding to the prediction index data and standard city labels corresponding to the prediction city labels.
According to the technical scheme, a standard trans-city federal migration model is constructed by receiving model parameters of a trained target trans-city federal migration model sent by a source city client side and based on the model parameters; the method comprises the steps of inputting test index data into a standard cross-city federal migration model to obtain an output target city label, wherein the target cross-city federal migration model is obtained by a source city client side based on an initial cross-city federal migration model and training index data in a training index data set, determining predicted index data and a predicted city label, and executing training operation on the initial cross-city federal migration model based on standard index data corresponding to the predicted index data and the standard city label corresponding to the predicted city label.
On the basis of the foregoing embodiment, specifically, the model parameters include data model parameters corresponding to a target data generation module and tag model parameters corresponding to a target tag generation module in the target cross-city federal migration model, and the standard cross-city federal migration model building module 510 is specifically configured to:
constructing a standard data generation module in a standard trans-city federal migration model based on data model parameters, and inputting reference index data into the standard data generation module to obtain output missing index data;
and constructing a reference label generation module based on the label model parameters, and training the reference label generation module based on the reference index data and the missing index data to obtain a standard label generation module in the standard trans-city federal migration model.
The training device of the cross-city federal migration model provided by the embodiment of the invention can execute the training method of the cross-city federal migration model provided by the embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Fig. 8 is a schematic structural diagram of a training system of a cross-city federal migration model according to an embodiment of the present invention, where the training system of the cross-city federal migration model can provide services for the training method of the cross-city federal migration model in the above embodiment.
As shown in fig. 8, the training system 600 for the cross-city federal migration model includes: source city client 610 and target city client 620; the source city client 610 is configured to determine, in response to the obtained training index data set, prediction index data and prediction city labels based on the initial cross-city federal migration model and the training index data in the training index data set, adjust model parameters of the initial cross-city federal migration model based on standard index data corresponding to the prediction index data and standard city labels corresponding to the prediction city labels, obtain a trained target cross-city federal migration model, and send the model parameters of the target cross-city federal migration model to the target city client 620; and the target city client 620 is used for constructing a standard cross-city federal migration model based on the received model parameters and determining a target city label based on the standard cross-city federal migration model.
For example, the training index data may be used to characterize data generated by the source city during development, such as population data, traffic data, tax data, and so on.
The predicted city label may be, for example, a consumption index, a traffic convenience degree, an air quality index, and the like. The consumption index can provide a reference basis for subsequent business district planning, the traffic convenience degree can provide a reference basis for subsequent traffic scheduling, and the air quality index can provide a reference basis for the formulation and implementation of subsequent environmental management schemes.
In one embodiment, specifically, the source city client 610 is specifically configured to input training index data in a training index data set into an initial data generation module and an initial label generation module in an initial cross-city federal migration model, respectively; outputting prediction index data based on input training index data through an initial data generation module; and outputting the predicted city label based on the input training index data and the prediction index data output by the initial data generation module through the initial label generation module.
In one embodiment, specifically, the source city client 610 is specifically configured to: respectively inputting training index data in a training index data set into an initial data generation module and an initial label generation module in an initial cross-city federal migration model; outputting prediction index data based on input training index data through an initial data generation module; and outputting the predicted city label based on the input training index data and the prediction index data output by the initial data generation module through the initial label generation module.
In an embodiment, specifically, the training index data set includes training index data corresponding to the current source city client 610, and correspondingly, the source city client 610 is specifically configured to: determining a target loss function based on standard index data corresponding to the prediction index data and standard city labels corresponding to the prediction city labels aiming at each iteration process of the initial trans-city federal migration model; determining current model parameters corresponding to the initial cross-city federal migration model of the current iteration based on a target loss function, and sending the current model parameters to a central server, so that the central server determines aggregation model parameters based on the received current model parameters respectively sent by at least two source city clients 610, and sends the aggregation model parameters to each source city client 610; wherein, at least two source city clients 610 comprise a current source city client 610; and taking the received aggregation model parameters sent by the central server as model parameters of the initial cross-city federal migration model of the current iteration until the target loss function is converged, and taking the initial cross-city federal migration model of the current iteration as a trained target cross-city federal migration model.
In another embodiment, specifically, the number of the source city clients 610 is at least two, and the corresponding training system 600 for the cross-city federal migration model further includes a central server, where the central server is configured to determine aggregation model parameters based on the received current model parameters respectively sent by the at least two source city clients 610, and send the aggregation model parameters to each source city client 610; source city client 610 is specifically configured to: aiming at each iteration process of the initial cross-city federal migration model, determining a target loss function based on standard index data corresponding to the predicted index data and a standard city label corresponding to the predicted city label, determining current model parameters corresponding to the current iterative initial cross-city federal migration model based on the target loss function, and sending the current model parameters to a central server; and taking the received aggregation model parameters as model parameters of the initial cross-city federal migration model of the current iteration until the target loss function is converged, and taking the initial cross-city federal migration model of the current iteration as a trained target cross-city federal migration model.
In an embodiment, specifically, the model parameters include data model parameters corresponding to a target data generation module and tag model parameters corresponding to a target tag generation module in the target cross-city federal migration model, and the target city client 620 is specifically configured to: constructing a standard data generation module in a standard trans-city federal migration model based on data model parameters, and inputting reference index data into the standard data generation module to obtain output missing index data; and constructing a reference label generation module based on the label model parameters, and training the reference label generation module based on the reference index data and the missing index data to obtain a standard label generation module in the standard trans-city federal migration model.
Fig. 9 is a system schematic diagram of a training system of a cross-city federal migration model according to an embodiment of the present invention. Specifically, the central processing unit sends the model architecture of the initial cross-city federal migration model to the source city-1 client, the source city-2 client \8230andthe source city-J client respectively, and initializes the model parameters of the initial cross-city federal migration model in each source city client 610. The source city-1 client and the source city-2 client \8230, and the source city-J client locally trains the initial trans-city federal migration model in the source city client 610 based on local training index data. For each source city client 610, in the process of each iteration of the initial cross-city federal migration model, current model parameters of the initial cross-city federal migration model are determined based on standard index data corresponding to the prediction index data and standard city labels corresponding to the prediction city labels, the current model parameters are sent to a central processing unit, the central processing unit performs aggregation operation on the current model parameters sent by each source city client 610 to obtain a global model, and the aggregation model parameters in the global model are sent to a source city-1 client and a source city-2 client 823030, and the source city-J client respectively, so that each source city client 610 continues training based on the received aggregation model parameters.
The initial cross-city federal migration model comprises an initial data generation module and an initial label generation module, wherein the initial data generation module comprises a feature extractor, a data regressor, a domain classifier and a feature inversion layer, and a first loss function L corresponding to the data regressor is based on DR Second loss function L corresponding to domain classifier DC And adjusting the model parameters of the initial data generation module. Through an initial label generation module, a predicted city label is output based on training index data and predicted index data output by the initial data generation module, and a second target loss function L constructed based on the predicted city label and a standard city label 2 And adjusting the model parameters of the initial label generation module.
Specifically, the central server determines target model parameters based on the received model parameters of the target cross-city federal migration model respectively sent by the at least two source city clients 610, and sends the target model parameters to the target city client 620. The target city client 620 freezes the standard data generation module constructed based on the data model parameters, and performs fine tuning training on the reference label generation module constructed based on the label model parameters by using the corresponding standard city label based on the reference index data to obtain the standard label generation module.
According to the technical scheme of the embodiment, the source city client side in the training system of the cross-city federal migration model responds to the fact that the training index data set is obtained, the prediction index data and the prediction city label are determined based on the initial cross-city federal migration model and the training index data in the training index data set, model parameters of the initial cross-city federal migration model are adjusted based on the standard index data corresponding to the prediction index data and the standard city label corresponding to the prediction city label, the trained target cross-city federal migration model is obtained, the trained target cross-city federal migration model has the capability of predicting the index data and predicting the city label at the same time, the problem that a target city cannot complete a city portrait task due to the fact that the target city lacks the index data is solved, and the application scene of the cross-city migration method is widened.
Fig. 10 is a schematic structural diagram of a terminal device according to an embodiment of the present invention. Terminal device 10 is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The terminal device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
In this embodiment, the terminal device 10 is a source city client or a target city client.
As shown in fig. 10, the terminal device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, and the like, where the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from a storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the terminal device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to the bus 14.
A plurality of components in the terminal device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the terminal device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. Processor 11 performs the various methods and processes described above, such as a training method for a cross-city federal migration model.
In some embodiments, the training method of the cross-city federal migration model can be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed on the terminal device 10 via the ROM 12 and/or the communication unit 19. When loaded into RAM 13 and executed by processor 11, the computer program may perform one or more of the steps of the method of training across the city federal migration model described above. Alternatively, in other embodiments, the processor 11 may be configured by any other suitable means (e.g., by means of firmware) to perform a training method across the city federal migration model.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
The computer program for implementing the training method of the cross-city federal migration model of the present invention can be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
An embodiment of the present invention further provides a computer-readable storage medium storing computer instructions for causing a processor to execute a method for training a cross-city federal migration model, the method comprising:
in response to the training index data set being obtained, determining prediction index data and prediction city labels based on the initial cross-city federal migration model and the training index data in the training index data set;
adjusting model parameters of the initial cross-city federal migration model based on standard index data corresponding to the prediction index data and standard city labels corresponding to the prediction city labels to obtain a trained target cross-city federal migration model;
and sending the model parameters of the target cross-city federal migration model to the target city client, so that the target city client builds a standard cross-city federal migration model based on the received model parameters, and determines a target city label based on the standard cross-city federal migration model.
Alternatively, the computer instructions are for causing the processor to perform another method of training across a city federal migration model, the method comprising:
receiving model parameters of a trained target cross-city federal migration model sent by a source city client, and constructing a standard cross-city federal migration model based on the model parameters;
inputting the test index data into a standard trans-city federal migration model to obtain an output target city label;
the target cross-city federal migration model is obtained by determining prediction index data and prediction city labels by a source city client based on an initial cross-city federal migration model and training index data in a training index data set, and executing training operation on the initial cross-city federal migration model based on standard index data corresponding to the prediction index data and standard city labels corresponding to the prediction city labels.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here may be implemented on a terminal device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the terminal device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired result of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (17)
1. A training method of a cross-city federal migration model is applied to a source city client and comprises the following steps:
in response to the acquisition of a training index data set, determining prediction index data and prediction city labels based on an initial cross-city federal migration model and the training index data in the training index data set;
adjusting model parameters of the initial cross-city federal migration model based on standard index data corresponding to the prediction index data and standard city labels corresponding to the prediction city labels to obtain a trained target cross-city federal migration model;
and sending the model parameters of the target cross-city federal migration model to a target city client, so that the target city client builds a standard cross-city federal migration model based on the received model parameters, and determines a target city label based on the standard cross-city federal migration model.
2. The method of claim 1, wherein determining predictive index data and predictive city labels based on an initial cross-city federated migration model and training index data in the training index dataset comprises:
respectively inputting the training index data in the training index data set into an initial data generation module and an initial label generation module in an initial cross-city federal migration model;
outputting, by the initial data generation module, prediction index data based on the input training index data;
and outputting a predicted city label based on the input training index data and the predicted index data output by the initial data generation module through the initial label generation module.
3. The method of claim 2, wherein the initial data generation module comprises a feature extractor, a data regressor and a domain classifier, and wherein outputting prediction index data based on the input training index data comprises:
inputting the training index data into the feature extractor to obtain an output training index feature;
outputting, by the data regressor, predictive index data based on the training index features output by the feature extractor, and outputting, by the domain classifier, a predictive city classification result based on the training index features output by the feature extractor.
4. The method according to claim 3, wherein the training index dataset includes training index data corresponding to a current source city client, and accordingly, the adjusting the model parameters of the initial cross-city federation migration model based on standard index data corresponding to the prediction index data and standard city labels corresponding to the prediction city labels to obtain a trained target cross-city federation migration model includes:
determining a target loss function based on standard index data corresponding to the prediction index data and a standard city label corresponding to the prediction city label for each iteration process of the initial cross-city federal migration model;
determining current model parameters corresponding to an initial cross-city federal migration model of current iteration based on the target loss function, and sending the current model parameters to a central server, so that the central server determines aggregation model parameters based on the received current model parameters respectively sent by at least two source city clients, and sends the aggregation model parameters to each source city client; wherein the at least two source city clients comprise the current source city client;
and taking the received aggregation model parameters sent by the central server as model parameters of the initial cross-city federal migration model of the current iteration until the target loss function is converged, and taking the initial cross-city federal migration model of the current iteration as a trained target cross-city federal migration model.
5. The method of claim 4, wherein sending model parameters of the target cross-city federated migration model to a target city client comprises:
sending the model parameters of the target cross-city federal migration model to the central server, so that the central server determines target model parameters based on the received model parameters of the target cross-city federal migration model, which are sent by the at least two source city clients respectively, and sends the target model parameters to the target city clients.
6. The method according to claim 3, wherein the training index dataset includes training index data corresponding to at least two source city clients, and accordingly, the adjusting the model parameters of the initial cross-city federal migration model based on the standard index data corresponding to the prediction index data and the standard city labels corresponding to the prediction city labels to obtain a trained target cross-city federal migration model includes:
determining a target loss function based on standard index data corresponding to the prediction index data and a standard city label corresponding to the prediction city label for each iteration process of the initial cross-city federal migration model;
and determining current model parameters corresponding to the initial cross-city federal migration model of the current iteration based on the target loss function, and taking the initial cross-city federal migration model of the current iteration as a trained target cross-city federal migration model until the target loss function is converged.
7. The method according to claim 4 or 6, wherein the objective loss function comprises a first objective loss function corresponding to the initial data generation module and a second objective loss function corresponding to the initial label generation module, and wherein determining the objective loss function based on the standard index data corresponding to the prediction index data and the standard city label corresponding to the prediction city label comprises:
constructing a first loss function based on the prediction index data and the standard index data, and constructing a second loss function based on the prediction city classification result and the standard city classification result;
determining a first target loss function corresponding to the initial data generation module based on the first loss function and the second loss function;
and constructing a second target loss function corresponding to the initial label generation module based on the predicted city label and the standard city label.
8. The method according to claim 7, wherein the initial data generation module further comprises a gradient inversion layer disposed between the feature extractor and the domain classifier, the gradient inversion layer is configured to multiply a function gradient of the second loss function input into the gradient inversion layer by a preset negative number during back propagation of the initial data generation module, and accordingly, a coefficient of the second loss function in the first target loss function is the preset negative number.
9. The method of claim 1, wherein the training index data comprises point of interest area data, road network data and population data, wherein the point of interest area data comprises at least one of a number of points of interest, a total number of points of interest and a point of interest entropy value corresponding to at least one type of point of interest, wherein the road network data comprises a number of roads corresponding to at least one type of roads, wherein the population data comprises a number of working populations and/or a number of residential populations, and wherein the prediction index data is a number of consuming populations and wherein the prediction city label is a category of business popularity.
10. A training method of a cross-city federal migration model is applied to a target city client, and comprises the following steps:
receiving model parameters of a trained target cross-city federal migration model sent by a source city client, and constructing a standard cross-city federal migration model based on the model parameters;
inputting the test index data into the standard trans-city federal migration model to obtain an output target city label;
the target cross-city federal migration model is obtained by the source city client determining prediction index data and prediction city labels based on an initial cross-city federal migration model and training index data in a training index data set, and executing training operation on the initial cross-city federal migration model based on standard index data corresponding to the prediction index data and standard city labels corresponding to the prediction city labels.
11. The method according to claim 10, wherein the model parameters include data model parameters corresponding to a target data generation module and tag model parameters corresponding to a target tag generation module in the target cross-city federal migration model, and accordingly, the constructing a standard cross-city federal migration model based on the model parameters includes:
constructing a standard data generation module in a standard cross-city federal migration model based on the data model parameters, and inputting reference index data into the standard data generation module to obtain output missing index data;
and constructing a reference label generation module based on the label model parameters, and training the reference label generation module based on the reference index data and the missing index data to obtain a standard label generation module in a standard trans-city federal migration model.
12. A training device of a cross-city federal migration model is applied to a source city client, and comprises:
the prediction city label determining module is used for responding to the obtained training index data set, and determining prediction index data and prediction city labels based on an initial trans-city federal migration model and the training index data in the training index data set;
a target cross-city federal migration model determination module, configured to adjust model parameters of the initial cross-city federal migration model based on standard index data corresponding to the prediction index data and standard city labels corresponding to the prediction city labels, so as to obtain a trained target cross-city federal migration model;
and the model parameter sending module is used for sending the model parameters of the target cross-city federal migration model to the target city client, so that the target city client builds a standard cross-city federal migration model based on the received model parameters, and determines a target city label based on the standard cross-city federal migration model.
13. The utility model provides a training device of cross city federal migration model which is characterized in that, is applied to target city client, includes:
the standard trans-city federal migration model building module is used for receiving model parameters of a trained target trans-city federal migration model sent by a source city client, and building a standard trans-city federal migration model based on the model parameters;
the target city label determining module is used for inputting the test index data into the standard trans-city federal migration model to obtain an output target city label;
the target cross-city federal migration model is obtained by the source city client determining prediction index data and prediction city labels based on an initial cross-city federal migration model and training index data in a training index data set, and executing training operation on the initial cross-city federal migration model based on standard index data corresponding to the prediction index data and standard city labels corresponding to the prediction city labels.
14. A training system for a cross-city federal migration model, comprising: a source city client and a target city client;
the source city client is used for responding to the obtained training index data set, determining prediction index data and prediction city labels based on an initial cross-city federal migration model and training index data in the training index data set, adjusting model parameters of the initial cross-city federal migration model based on standard index data corresponding to the prediction index data and standard city labels corresponding to the prediction city labels to obtain a trained target cross-city federal migration model, and sending the model parameters of the target cross-city federal migration model to a target city client;
the target city client is used for constructing a standard cross-city federal migration model based on the received model parameters and determining a target city label based on the standard cross-city federal migration model.
15. The system according to claim 14, wherein the number of the source city clients is at least two, and accordingly, the system further comprises a central server, and the central server is configured to determine an aggregation model parameter based on the received current model parameters respectively sent by the at least two source city clients, and send the aggregation model parameter to each of the source city clients;
the source city client is specifically configured to: aiming at each iteration process of the initial cross-city federal migration model, determining a target loss function based on standard index data corresponding to the prediction index data and a standard city label corresponding to the prediction city label, determining current model parameters corresponding to the initial cross-city federal migration model of the current iteration based on the target loss function, and sending the current model parameters to a central server;
and taking the received aggregation model parameters as model parameters of the initial cross-city federal migration model of the current iteration until the target loss function is converged, and taking the initial cross-city federal migration model of the current iteration as a trained target cross-city federal migration model.
16. A terminal device, characterized in that the terminal device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of training a cross-city federal migration model as defined in any of claims 1-9 or the method of training a cross-city federal migration model as defined in any of claims 10-11.
17. A computer-readable storage medium storing computer instructions for causing a processor to implement the method for training across-city federal migration model of any of claims 1-9 or the method for training across-city federal migration model of any of claims 10-11 when executed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211677031.1A CN115935189A (en) | 2022-12-26 | 2022-12-26 | Method, device, system and equipment for training trans-city federal migration model |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211677031.1A CN115935189A (en) | 2022-12-26 | 2022-12-26 | Method, device, system and equipment for training trans-city federal migration model |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115935189A true CN115935189A (en) | 2023-04-07 |
Family
ID=86555473
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211677031.1A Pending CN115935189A (en) | 2022-12-26 | 2022-12-26 | Method, device, system and equipment for training trans-city federal migration model |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115935189A (en) |
-
2022
- 2022-12-26 CN CN202211677031.1A patent/CN115935189A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112561191B (en) | Prediction model training method, prediction device, prediction apparatus, prediction program, and program | |
EP3822876A2 (en) | Method and apparatus for predicting destination, electronic device and storage medium | |
CN114648676B (en) | Training method of point cloud processing model and point cloud instance segmentation method and device | |
CN115879535A (en) | Training method, device, equipment and medium for automatic driving perception model | |
US20230243661A1 (en) | Navigation path planning method and apparatus, device, and storage medium | |
CN112580733B (en) | Classification model training method, device, equipment and storage medium | |
CN114462577A (en) | Federated learning system, method, computer equipment and storage medium | |
CN112269930A (en) | Method and device for establishing regional heat prediction model and regional heat prediction | |
EP4040421A2 (en) | Method and apparatus for predicting traffic data and electronic device | |
CN111047107B (en) | Road traffic time prediction method, device, electronic equipment and storage medium | |
CN114037052A (en) | Training method and device for detection model, electronic equipment and storage medium | |
CN116662815B (en) | Training method of time prediction model and related equipment | |
CN117671364A (en) | Model processing method and device for image recognition, electronic equipment and storage medium | |
CN113723607A (en) | Training method, device and equipment of space-time data processing model and storage medium | |
CN116884211A (en) | Traffic sequence prediction method and device, electronic equipment and storage medium | |
Hu et al. | An attention-mechanism-based traffic flow prediction scheme for smart city | |
US20220164723A1 (en) | Method for determining boarding information, electronic device, and storage medium | |
CN113723712B (en) | Wind power prediction method, system, equipment and medium | |
CN115935189A (en) | Method, device, system and equipment for training trans-city federal migration model | |
CN115359322A (en) | Target detection model training method, device, equipment and storage medium | |
CN114611609A (en) | Graph network model node classification method, device, equipment and storage medium | |
CN113379464A (en) | Block chain-based site selection method, device, equipment and storage medium | |
CN117540843A (en) | Parking space prediction method and device, electronic equipment and storage medium | |
CN116935689A (en) | Travel time prediction method, travel time prediction model training method, apparatus and medium | |
CN115640408A (en) | Data-based relation extraction method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |