The present disclosure claims a priority of the Chinese patent application No. 202310506727.6 filed in China on May 6, 2023, which is incorporated herein by reference in its entirety.
The present disclosure relates to the field of data processing technology, in particular to the technical fields of deep learning, smart cities, and urban governance. Specifically, the present disclosure relates to a data updating method, a model training method, apparatus, electronic device and medium.
With the continuous acceleration of the global urbanization process, the scale of cities continues to grow. In order to achieve long-term development of cities, smart cities gradually emerge. Urban intelligent computing is of great significance for improving the level of urban governance, improving the quality of public services, and developing the digital economy. In urban intelligent computing, relevant technologies propose that cities can be modeled and various urban entities (such as regions, points of interest, roads, etc.) can be represented and transformed into computable vector representations. In this way, the computation process of urban intelligent computing can be simplified.
The present disclosure provides a data updating method, model training method, apparatus, electronic device, and medium.
According to a first aspect of the present disclosure, a data updating method is provided, including:
According to a second aspect of the present disclosure, a model training method is provided, including:
According to a third aspect of the present disclosure, a data updating apparatus is provided, including:
According to a fourth aspect of the present disclosure, a model training apparatus is provided, including:
According to a fifth aspect of the present disclosure, an electronic device is provided, including:
According to a sixth aspect of the present disclosure, a non-transitory computer readable storage medium storing therein a computer instruction is provided, wherein the computer instruction is configured to be executed by a computer, to implement the method according to the foregoing first aspect or second aspect.
According to a seventh aspect of the present disclosure, a computer program product is provided, including a computer program, wherein the computer program is configured to be executed by a processor, to implement the method according to the foregoing first aspect or second aspect.
In embodiments of the present disclosure, a target region is partitioned into at least two sub-regions and regional features for each of the sub-regions are generated based on node features. Then relation information between different sub-regions is generated based on the regional features of the sub-regions and the node features of the central node are updated based on the relation information and the regional features of the sub-regions to obtain target feature data. In this way, on the one hand, the problem of poor quality of the generated target feature data due to spatial heterophily in urban graph data during the process of updating the node features of the central node can be alleviated. On the other hand, the present disclosure aggregates the features of nodes at different spatial positions separately, thereby ensuring that spatial information of urban entities is fully considered in the process of generating the target feature data, so as to mine the semantic differences brought by different spatial relations under the same topological structure, and thereby improving the quality of the generated target feature data.
The drawings are used for better understanding the present solution and do not constitute a limitation of the present disclosure. In the drawings:
In the following description, numerous details of the embodiments of the present disclosure, which should be deemed merely as exemplary, are set forth with reference to accompanying drawings to provide a thorough understanding of the embodiments of the present disclosure. Therefore, those skilled in the art will appreciate that modifications or replacements may be made in the described embodiments without departing from the scope and spirit of the present disclosure. Further, for clarity and conciseness, descriptions of known functions and structures are omitted.
Referring to
Step S101: partitioning a target region into at least two sub-regions to obtain a region partition set, where the target region corresponds to a neighborhood of a central node, the neighborhood includes other nodes possessing a connecting edge to the central node, and preset urban entities corresponding to the nodes in the neighborhood are located within the target region.
Step S102: generating regional features for each of the sub-regions based on node features of the nodes in the neighborhood.
Step S103: generating a relation set based on the regional features of the sub-regions in the region partition set, where the relation set includes at least two pieces of relation information corresponding with the at least two sub-regions in a one-to-one manner, and the relation information is used to represent relation information between the corresponding sub-region and other sub-regions.
Step S104: updating the node features of the central node based on the relation set and the regional features of the sub-regions in the region partition set to obtain target feature data.
A city is an extremely complex system, in which various urban entities are interconnected in various ways (for example, human flow between regions, road connecting relation, etc.), and considering these relations plays an important role in learning the representation of urban entities. Therefore, a city can be modeled as an urban graph, where nodes on the graph represent certain urban entities, edges on the graph represent some kind of association between entities, and graph neural networks (GNNs) are used to learn from the urban graph and capture relations between urban entities to learn more effective representations of urban entities.
However, unlike general graphs, urban graphs usually have spatial heterophily, which greatly limits the performance of general graph neural networks. Heterophily and homophily of graphs are two relative concepts. General GNN models assume that graph data has good homophily, that is, nodes with similar features or the same category are connected together, and good homophily is considered to be the performance guarantee of GNN models. However, due to the complex associations between urban entities with different functions, urban graphs often have heterophily, that is, connected nodes may be dissimilar. For example, considering the population mobility graph between regions, there is often a human flow relation between residential regions and workplaces, but obviously there are huge differences between these two types of regions. For graphs with heterophily, general GNN models smooth the representation of dissimilar nodes, making it impossible to correctly distinguish them.
Further, the neighbor heterophily of urban graphs often presents a certain spatial diversity, which can be specifically referred to as spatial heterophily. Specifically, in an urban graph, there is dissimilarity between the central node and its neighbor nodes, and the dissimilarity distribution between neighbor nodes at different geographical locations and the central node is different and not uniform, that is, there is spatial diversity in the dissimilarity.
Based on this, the present disclosure proposes that in the representation learning of urban graphs, the neighbor nodes of the central node can be grouped (i.e., partitioned into different sub-regions) according to the spatial position, which makes the neighbors within the group have similar dissimilarity distribution with the central node. In this way, the diversity of neighbor heterophily within the group can be alleviated, and then a heterophily graph learning algorithm can be designed to deal with each group separately, and solve the spatial heterophily of urban graphs by dividing and conquering. At the same time, by obtaining the relation set, and updating the node features of the central node based on the relation set, the relation information in the relation set can better learn distinguishable representations for related but dissimilar urban entities. Then, the problem of poor quality of the target feature data generated in the process of updating the node features of the central node due to the spatial heterophily of urban graph data can be further alleviated.
It can be understood that before the foregoing step of partitioning the target region into at least two sub-regions to obtain the region partition set, the data updating method may further include the following steps:
obtaining urban graph data in the preset region, the urban graph data including a node set, an edge set and a feature set, the node set including central nodes corresponding to preset urban entities in the preset region, the edge set including neighborhoods corresponding to the central nodes, the neighborhoods including other nodes in the node set possessing connecting edges with the central nodes, the neighborhoods corresponding to a target region in the preset region, and preset urban entities corresponding to the nodes in the neighborhood being located within the target region, and the feature set including node features of the nodes in the node set.
Specifically, the foregoing preset region can be a large spatial range, wherein various urban entities exist in the preset region. Specific urban entities in the preset region can be selected according to the specific scenario to construct the foregoing node set, and then the edge set is constructed according to the relations of the nodes in the node set, and the feature set is constructed by obtaining the relevant features of the urban entities corresponding to each node. For example, in the prosperity prediction scenario, when a prediction model for urban prosperity needs to be trained, different nodes in the node set corresponding to preset urban entities can be different regions within the preset region, and then different nodes can be connected by connecting edges according to human flow to generate the edge set. Specifically, when the number of floating population between two nodes exceeds a preset value, a connecting edge is established between the two nodes. Correspondingly, when the number of floating population between two nodes does not exceed the preset value, no connecting edge is established between the two nodes. Then, each node is taken as a central node, and other nodes possessing connecting edges with the central node are determined to generate a neighborhood corresponding to each central node. It can be understood that each node in the node set can be a central node or another node connected to other central nodes. In this way, the edge set is generated, which includes a neighborhood corresponding to each node in the node set. Finally, relevant features of each node are analyzed separately to obtain node features of each node, thereby generating the feature set. Specifically, the node features can include features that reflect urban prosperity, such as the number of entertainment venues, malls, hospitals and universities in the urban region corresponding to the node. After obtaining the foregoing features of each node, the feature set can be obtained.
For example, when it is necessary to predict the human flow relation between regions, the foregoing urban graph data can be population mobility graph data. Specifically, regions can be taken as nodes, i.e., the preset urban entities corresponding to the nodes are regions, and connecting edges according to the human flow relation between regions are established, and the node features can be regional features of different regions. Accordingly, when it is necessary to identify dangerous road sections, the urban graph data can be road network graph data, in which case intersections can be taken as nodes, connecting edges can be established according to the connecting relation of roads, and the node features can be road section features of different road sections in the road network, such as road section length, real-time vehicle traffic data, etc.
The following further explains the data updating method with reference to the foregoing prosperity prediction scenario. Specifically, the node features of each node in the urban graph data can be updated based on the method of embodiments of the present disclosure, and the urban graph data with updated node features can be used to train a pre-constructed model, so as to train a model that can predict urban prosperity based on the urban graph data. That is, the foregoing data updating method can be used to generate training data for the prosperity prediction model.
Specifically, the preset region can be partitioned into multiple small regions according to the partition method of administrative regions in the related technology, and each small region can be used as a node in the prosperity prediction scenario to obtain the node set. The foregoing central node is any one of the nodes in the node set. The present disclosure takes updating the node features of a central node based on the data updating method as an example, and explains the specific implementation process of the data updating method. G=(V, E, X) can be used to represent the foregoing urban graph data. V={v1, v2, . . . , vN} represents the node set composed of preset urban entities within the preset region, E represents the edge set defined by some relation between urban entities (for example, the relation can be based on the number of floating population between the nodes), (vi)={vj|(vi, vj)ϵE} represents the neighborhood of node vi. XϵRN×d represents the node feature matrix, wherein the i-th row represents the d-dimensional feature vector of node vi, that is, the i-th row is the node feature of node vi, and the d-dimensional vector can be constructed based on features that can reflect urban prosperity, such as the number of entertainment venues, malls, hospitals and universities in the region corresponding to node vi. It can be understood that in different tasks, the node set V and edge set E can represent different urban entities and relations.
Since the foregoing node set includes a large number of nodes, and other nodes possessing a connecting edge with the foregoing central node may only be part of the nodes in the node set. And different nodes in the neighborhood corresponding to the central node are distributed in different locations in the preset region, therefore, a target region can be determined according to the location of the central node and the locations of the nodes in the neighborhood corresponding to the central node, wherein the central node and the nodes in the neighborhood are both located within the target region. It can be understood that the target region is a part of the preset region.
The foregoing partitioning the target region into at least two sub-regions can be specifically performed according to a direction-aware partition method for the target region. Specifically, for a certain central node vi, the target region centered on vi can be equally partitioned into a series of sectors ={sk|k=0, 1, . . . , ns−1}, wherein ns represents the number of sectors obtained by the partition. Correspondingly, the neighbor nodes in the neighborhood (vi) can be assigned to different sectors, and the neighbor nodes distributed in different sectors can be redefined as different direction-aware neighborhoods {(vi)|k=0, 1, . . . , ns−1}, and satisfy
Under such a partition, different direction-aware neighborhoods (sectors) can be regarded as different sub-regions, representing different relative spatial relation between the neighbor nodes and the central node.
In addition, since the relative position relation between urban entities not only includes different directions, but also different distances. Therefore, in another embodiment of the present disclosure, the target region can also be partitioned according to a distance-aware partitioning method. Specifically, as shown in
Since after performing region partitioning, the node features of the nodes in each sub-region are aggregated separately, thus, at least two regional features corresponding one-to-one with the at least two sub-regions can be obtained, and different regional features in the at least two regional features represent the features of the neighbor nodes at different distances from the central node. Therefore, compared with directly aggregating the node features of all nodes in the neighborhood corresponding to the central node, the present disclosure uses the regional features of the sub-regions in the region partition set to update the node features of the central node to obtain target feature data, which retain the distance features of each neighbor node in the neighborhood and is conductive to mine the semantic differences brought by different spatial relations under the same topology structure, and thereby improving the quality of the generated target feature data.
The foregoing generating the regional features for each of the sub-regions based on the node features of the nodes in the neighborhood can specifically refer to: generating the regional features of each sub-region based on the node features of the nodes within each sub-region, and the specific generation process can adopt the feature fusion method in the related technology to generate the regional features based on the node features.
The foregoing generating the relation set based on the regional features of the sub-regions in the region partition set can specifically refer to: determining the feature relation information between the regional features of each sub-region and other sub-regions respectively to obtain the relation information corresponding to each sub-region, wherein, the feature relation information can refer to the similarity degree or difference degree between features and other relation information.
The foregoing updating the node features of the central node based on the relation set and the regional features of the sub-regions in the region partition set can specifically refer to: fusing the regional features of the sub-regions in the region partition set with the node features of the central node, and incorporating the relation information between different sub-regions in the fusion process, to obtain the target feature data.
In this embodiment, a target region is partitioned into at least two sub-regions and regional features for each of the sub-regions are generated based on node features. Then relation information between different sub-regions is generated based on the regional features of the sub-regions and the node features of the central node are updated based on the relation information and the regional features of the sub-regions to obtain target feature data. In this way, on the one hand, the problem of poor quality of the generated target feature data due to spatial heterophily in urban graph data during the process of updating the node features of the central node can be alleviated. On the other hand, the present disclosure aggregates the features of nodes at different spatial positions separately, thereby ensuring that spatial information of urban entities is fully considered in the process of generating the target feature data, so as to mine the semantic differences brought by different spatial relations under the same topological structure, and thereby improving the quality of the generated target feature data.
Optionally, the relation information includes common information and difference information, the common information is used to represent the shared information between the corresponding sub-region and other sub-regions, and the difference information is used to represent the difference information between the corresponding sub-region and other sub-regions.
When performing region partitioning centered on the central node, the central node is usually not in any one of the at least two sub-regions, in this case, the central node can be separately regarded as a central sub-region, and the region partition set includes the central sub-region. In this way, when calculating the relation information, not only can the relation information between different sub-regions (spatial group-spatial group) be calculated, but also the relation information between each sub-region and the central sub-region (central node-spatial group) can be calculated.
The foregoing common information can specifically refer to the common knowledge or similar characteristics between the regional features of different sub-regions, which can be used to enhance the representation of each sub-region (including the central node). Correspondingly, in addition to the common knowledge, modeling the difference information of the neighboring nodes is crucial for urban graphs with heterophily. Therefore, in embodiments of the present disclosure, the relation information also includes difference information, wherein the difference information refers to the differences or dissimilarities between different sub-regions. In this way, it is conductive to improve the relation expression effect of the relation information between different sub-regions.
Specifically, when generating the common information, the similarity between the regional features of each sub-region and the regional features of other sub-regions can be calculated respectively, and then the common information corresponding to each sub-region can be determined based on the feature similarity between each sub-region and other sub-regions. Correspondingly, when generating the difference information, the difference degree between the regional features of each sub-region and the regional features of other sub-regions can be calculated respectively, and then the difference information corresponding to each sub-region can be determined based on the feature difference degree between each sub-region and other sub-regions.
In this embodiment, compared with the general graph neural network (homophily graph neural network), the method according to the present disclosure can consider both the commonality and the difference of the urban entities associated on the urban graph, and use the difference information to better learn distinguishable representations for the associated but dissimilar urban entities.
Optionally, the updating the node features of the central node based on the relation set and the regional features of the sub-regions in the region partition set to obtain the target feature data includes:
Specifically, since the relation information corresponding to each sub-region can also be regarded as another view of regional features of the sub-region, therefore, after generating regional features of the sub-region based on node features of nodes in each sub-region, the regional features of the sub-region can be further fused with the relation information corresponding to the sub-region to obtain target regional features of that sub-region.
In this embodiment, since the target regional features not only fuse node features of nodes within the sub-region, but also fuse relation information with other sub-regions, therefore, it is conductive to improve the feature expression effect of the sub-region, and thereby being conductive to improve the quality of target feature data generated based on target regional features.
Optionally, the partitioning the target region into at least two sub-regions to obtain the region partition set includes:
The foregoing partitioning lines are boundary lines between adjacent sub-regions, that is, the partitioning lines are partitioning lines that separate adjacent sub-regions.
Specifically, considering some special cases: some neighbor nodes in the foregoing neighborhood are distributed on the boundary of two sub-regions and cannot be determined to belong to which sub-region; for example, for the sector partition in
wherein m=1, 2, . . . , Ms, Ms represents the number of partitions, that is, Ms-fold partitions are performed.
It can be understood that the foregoing
includes Ms-fold partition results and all sub-regions obtained by Ms-fold partitions can be regarded as sub-regions in the region partition set. In this way, node features can be aggregated once based on each fold partition result respectively, and then regional features of sub-regions in each fold partition result in Ms-fold partition results can be obtained, and node features of the central node can be updated based on regional features of sub-regions in each fold partition result in Ms-fold partition results.
Similarly, in distance view, as shown in
wherein m=1, 2, . . . , Mr. In this way, different groups of spatial partitions can complementarily represent geographic location distribution of neighbors and solve the problems that single partition is not comprehensive or accurate enough. In spatial partitioning, since central node vi itself does not belong to any sector or ring, therefore vi can be regarded as an additional spatial grouping, i.e.,
In this embodiment, by performing an M-fold region partition on the target region based on a target partition method to obtain a region partition set, it makes different partitions complement each other, thereby improving effect of region partition.
Optionally, the target partition method includes a first sub-partition method and a second sub-partition method, and performing an i-th fold partition in the M-fold region partition on the target region based on the target partition method includes:
Specifically, the first sub-partition method can be the foregoing direction-aware partition method. The second sub-partition method can be the foregoing distance-aware partition method.
The position parameters of the first sub-partition method are different in the different fold partitions, which can specifically refer to: each time re-partitioning, taking the central node as a rotation center, rotating a preset angle for each partitioning line of previous partitioning, wherein the preset angle can be 5°, 10° or other angles.
The distance parameters of the second sub-partition method are different in the different fold partitions, which can specifically refer to: in different fold partitions, distances between each partitioning line and central node are different.
The foregoing first region group can be a set of sub-regions obtained by performing a one-time partitioning on the target region based on the first sub-partition method. Correspondingly, the second region group can be a set of sub-regions obtained by performing a one-time partitioning on the target region based on the second sub-partition method.
It can be understood that since the target partition method includes the first sub-partition method and the second sub-partition method, that is, each fold partition includes these two kinds of partition methods, and each fold partition includes two partition results. It can be understood that after performing the foregoing M-fold region partitioning, M first region groups and M second region groups can be obtained. Each region partition subset includes a first region group and a second region group. The region partition set includes M first region groups and M second region groups. In one embodiment of the present disclosure, the region partition set can include the foregoing
and
={rkm|k=0, 1, . . . , nr−1}, at this time, the foregoing Ms=Mr=M.
In this embodiment, since each fold partition includes a partition result obtained based on the first sub-partition method and a partition result obtained based on the second sub-partition method, thus further enriching ways of partitioning the target region, and thereby further enriching contents in the region partition set, so that it is conductive to improve the effect of partitioning the target area.
Optionally, the updating the node features of the central node based on the target regional features of the sub-regions in the region partition set to obtain the target feature data includes:
It can be understood that after the foregoing partitioning process of the target region, the region partition set can include M first region groups and M second region groups. Then, for each sub-region in each region group (first region group and second region group) in the region partition set, respectively aggregating the node features corresponding to all nodes located within the same sub-region to obtain the regional features of each sub-region.
Specifically, since a first region group includes at least two sub-regions obtained by a one-time partition, and the at least two sub-regions jointly form the foregoing target region, after obtaining the regional features of each sub-region in the first region group based on the feature aggregation process, the regional features of all sub-regions in the first region group can be further fused to obtain a first feature data that can represent the node features of different spatial positions in the neighborhood.
Correspondingly, since a second region group includes at least two sub-regions obtained by a one-time partition, and the at least two sub-regions jointly form the foregoing target region, after obtaining the regional features of each sub-region in the second region group based on the feature aggregation process, the regional features of all sub-regions in the second region group can be further fused to obtain a second feature data that can represent the node features of different spatial positions in the neighborhood.
The fusion of the foregoing regional features can be performed by using common fusion methods in related technologies, for example, concatenating the regional features of different sub-regions, or constructing a feature matrix based on the regional features of different sub-regions. For example, as shown in
(including the central node itself) under the M-th fold partition, graph convolution can be used to perform feature aggregation for each neighborhood
where the graph convolution can include multiple network sides, and multiple network layers are connected in sequence, and the input of each network layer is the output of the previous network side, and the input of the first network side is the direction-aware neighborhood
represents the information aggregated from sector sk by the (l+1)-th layer network, and takes it as the representation vector of sector sk under the m-th fold partition; hj(l) represents the feature of neighbor vj output by the l-th layer network
is a trainable transformation matrix, which is used to extract useful information from the neighbor node features. Similarly, as shown in
wherein
is the representation vector of the annulus rk under the m-th partition, and
is another transformation matrix used to learn the node features of the neighbors at different distances.
In this embodiment, the node features of the central node are updated based on the M first feature data and the M second feature data, thus, since the partition results of the M-fold region partition are fused in the process of updating the node features of the central node, and the results of different fold region partitions can complement each other, therefore, it is conductive to better mine the semantic differences brought by different spatial relations under the same topological structure, and thereby improving the quality of the generated target feature data.
Optionally, the fusing the target regional features of the sub-regions in each first sub-region group respectively to obtain M first feature data includes:
Specifically, for the representation of each sector/annular region under the m-th fold partition, the embodiment of the present disclosure is different from the conventional graph neural network that uses summation or averaging to fuse neighborhood representations (because using this method would mix the features of neighboring nodes with different spatial distributions), and instead uses concatenation to perform the fusion. In this way, the features at different concatenation positions of the first feature data obtained after concatenation represent the features corresponding to different spatial positions, thereby avoiding mixing the features of neighboring nodes with different spatial distributions in the first feature data obtained after the fusion.
As shown in
wherein
is a conventional fusion method, representing the representation of the neighborhood in the direction view under the m-th fold partition, that is,
represents a vector representation after a first sub-region group is fused.
In this embodiment, the regional features of the sub-regions within each first sub-region group are concatenated respectively to obtain the M first feature data, thereby avoiding mixing the features of neighboring nodes with different spatial distributions in the first feature data obtained after the fusion.
Optionally, the fusing the target regional features of the sub-regions in each second sub-region group respectively to obtain M second feature data includes:
As shown in
wherein
represents the representation of the neighborhood in the distance view under the m-th fold partition, that is,
represents a vector representation after a second sub-region group is fused.
In this embodiment, the regional features of the sub-regions within each second sub-region group are concatenated respectively to obtain the M second feature data, thereby avoiding mixing the features of neighboring nodes with different spatial distributions in the second feature data obtained after the fusion.
Optionally, the updating the node features of the central node based on the M first feature data and the M second feature data to obtain the target feature data includes:
As shown in
where zi,s(l+1) represents the first updating feature, that is, concatenating the M first feature data obtained by M-fold partitioning in sequence, and the zi,s(l+1) represents the vector representation after fusing the M first sub-region groups4.
At the same time, the foregoing process of concatenating the M second feature data to obtain the second updating feature can be implemented by the following formula:
where zi,r(l+1) represents the second updating feature, that is, concatenating the M second feature data obtained by M-fold partitioning in sequence, and the zi,r(l+1) represents the vector representation after fusing the M second sub-region groups.
The process of performing weighted summation of the first updating feature and the second updating feature to obtain the target feature data can be implemented by the following formula:
where hi(l+1) represents the representation vector of the central node vi output by the (l+1)-th layer network (that is, the target feature data). Wf,s(l+1) and Wf,r(l+1) are two learnable transformation matrices that map the representation vectors in two spatial views to the same space. γϵ(0,1) is also a trainable parameter that learns how to allocate the importance of two spatial views according to the target task.
In this embodiment, the M first feature data are concatenated to obtain the first updated feature, and the M second feature data are concatenated to obtain the second updated feature. In this way, the foregoing aggregation process does not mix the features of neighboring nodes in different spatial groups, and can retain the spatial information of different neighboring nodes in the representation of the central node.
Optionally, the generating the relation set based on the regional features of the sub-regions in the region partition set includes:
Specifically, after calculating the regional features of each sub-region based on the foregoing embodiment, a commonality kernel function can be further designed to capture the common information between spatial groups.
Where
represents the information aggregated from the sector sk by the (l+1)-th layer network, that is, the regional feature of the sector sk is
Correspondingly, the foregoing
is the representation vector of the ring rk in the m-th fold partition, that is, the regional feature of ring rk is
and the superscript l represents the output of the l-th layer network. In the present embodiment, the method provided by the present embodiment will be used in each network layer l and each fold spatial partition m. For convenience of expression, the present embodiment omits superscripts l and m, that is, zi,s
and zi,r
In one embodiment of the present disclosure, taking the directional view as an example, based on the representation {zi,s
where ⋅,⋅ represents the inner product of two representation vectors, WCs is a learnable transformation matrix, which is used to extract common features between sectors. The larger the value output by the commonality kernel function, the higher the similarity between the two sectors, that is, the sp represents the target sub-region, the sq is any one of the sector-shaped sub-regions in the region partition set, and the (zi,s
where in the present embodiment, the rp represents the target sub-region in the distance partition scenario; the rq represents any one of the annular sub-regions in the region partition set; (zi,r
In the present embodiment, by calculating the similarity between the regional features of the target sub-region and the regional features of each sub-region in the region partition set, the common information corresponding to the target sub-region is obtained, thereby realizing the process of generating the common information corresponding to each sub-region.
Optionally, the generating the relation set based on the regional features of the sub-regions in the region partition set includes:
Embodiments of the present disclosure further design another discrepancy kernel function to capture the dissimilarity between the central node and the sub-regions, as well as between different sub-regions. Taking the partition in the direction view as an example for illustration. Specifically, taking the sector representations {zi,s
where WDs,a and WDs,b are two learnable transformations for extracting the difference of sector sq relative to sp, that is, (zi,s
In the same way, the present disclosure also defines a discrepancy kernel function (⋅,⋅) for the ring representation learning in the distance view, which uses WDr,a and WDr,b to extract the difference information between rings and generate enhanced ring representations zi,r
where (zi,r
In this embodiment, by calculating the difference degree between the regional features of the target sub-region and the regional features of each of the sub-regions in the region partition set, the difference information corresponding to the target sub-region is obtained, thereby realizing the generation process of the difference information.
Optionally, the updating the regional features of each of the sub-regions based on the relation set to obtain the target regional features of each of the sub-regions includes:
The foregoing updating the regional features of each of the sub-regions based on the common information in the relation set to obtain the first feature of each of the sub-regions specifically means: updating the regional features of the sub-region itself based on the common information corresponding to each of the sub-region respectively to obtain the first feature of each of the sub-regions. Correspondingly, the updating the regional features of each of the sub-regions based on the difference information in the relation set to obtain the second feature of each of the sub-regions specifically means: updating the regional features of the sub-region itself based on the difference information corresponding to each of the sub-region respectively to obtain the second feature of each of the sub-regions. The first feature and the second feature are both updated regional features for the sub-regions.
For ease of understanding, the following takes the example of updating the regional features of the foregoing target sub-regions to obtain the first and the second features corresponding to the target sub-regions, and explains the process of updating the regional features in the present disclosure:
When the target sub-region is a sector-shaped sub-region sp, updating the regional features of the target sub-region based on the common information corresponding to the target sub-region to obtain the first feature of the target sub-region can be specifically implemented by the following formula:
where the coefficient αpqC,s is used to represent the similarity degree between sectors, the zi,r
Correspondingly, updating the regional features of the target sub-regions based on the difference information corresponding to the target sub-regions to obtain the second feature of the target sub-regions can be specifically implemented by the following formula:
wherein zi,s
When the target sub-region is the annular sub-region rp, updating the regional features of the target sub-region based on the common information corresponding to the target sub-region to obtain the first feature of the target sub-region can be specifically implemented by the following formula:
where in the present embodiment, the rp represents the target sub-region in the distance partition scenario; rq represents any one of the annular sub-regions in the foregoing region partition set; (zi,r
Correspondingly, updating the regional features of the target sub-region based on the difference information corresponding to the target sub-region to obtain the second feature of the target sub-region can be specifically implemented by the following formula:
where (zi,r
Specifically, through these two kernel functions, the representation learning on urban graphs can be enhanced by using the common information and the difference information between spatial groups. However, in various application scenarios, different urban entities on urban graphs may have different degrees of spatial heterophily. Embodiments of the present disclosure design an attentive gate mechanism that adaptively learns the importance of the common information and the difference information for node representation learning in specific tasks through an end-to-end manner.
Specifically, taking the direction view as an example, for the central node vi, the present disclosure integrates the representations of each sector and the central node itself by concatenation, and then uses this as input to generate a control coefficients through a learnable transformation:
where Wts represents the transformation matrix for generating the control coefficient, and σ represents the Sigmoid function, which limits the range of the output coefficients to (0, 1). The coefficient controls the proportion of common information and difference information, and combines the two kinds of information according to their importance to update the sector representation vector:
where hi,s
Similarly, in the distance view, another control coefficient βir can also be learned to control the proportion of two kinds of information in the ring representation vector, which can be expressed by the following formula:
where hi,s
In this embodiment, by updating the regional features of each of the sub-regions based on the common information in the relation set to obtain a first feature of each of the sub-regions; and updating the regional features of each of the sub-regions based on the difference information in the relation set to obtain a second feature of each of the sub-regions; then, performing weighted summation of the first feature and the second feature for each of the sub-regions to obtain the target regional features of each of the sub-regions, thus ensuring that the obtained target regional features can contain the common information within the neighborhood and the diverse difference information between sub-regions.
Optionally, the updating the node features of the central node based on the M first feature data and the M second feature data to obtain the target feature data includes:
After the interaction process between the foregoing sub-regions, each sub-region can contain the common information in the neighborhood and the diverse difference information between the sub-regions, which is very important for learning heterophily urban graphs. Then, the representations of each of the sub-regions are fused and an overall description of the neighborhood information is obtained. First, for the m-th fold partition in the direction view/distance view, the representation vectors of the sub-regions (sectors/rings) in each region group can be concatenated to obtain the neighborhood representation under this partition. Here, unlike general GNN models that use summation or averaging for fusion, the present disclosure uses concatenation to ensure that different spatial groups can still be distinguished in the neighborhood representation, avoiding mixing difference distributions with spatial diversity. Then, the neighborhood representations under Ms-fold partition in the direction view and Mr-fold partition in the distance view respectively are concatenated to obtain the overall neighborhood representations in two views. The foregoing two consecutive concatenation operations can be uniformly expressed as:
Finally, through a learnable weighted summation, the neighborhood representations obtained in the direction view and distance view are fused, and the representation of the central node is updated:
wherein Wfs and Wfr are two learnable transformation matrices that map the representation vectors in two spatial views to the same space. hi is the target feature data corresponding to the foregoing central node. γϵ(0,1) is also a trainable parameter that learns how to allocate the importance of two spatial views according to the target task.
Optionally, the generating the regional features of each of the sub-regions based on the feature set includes:
The aggregating the node features corresponding to all nodes located within the same sub-region can be specifically: according to the feature aggregation method in the related technology, aggregating the node features of the nodes located within the same sub-region, and taking the aggregation result as the regional feature of that sub-region.
In this embodiment, by partitioning the target region into at least two sub-regions, and aggregating the node features corresponding to all nodes located within the same sub-region to obtain the regional features of each sub-region, it is possible to achieve separate aggregation of features for nodes at different spatial positions. Thus, it ensures that spatial information of urban entities can be fully considered in the process of generating the target feature data, to mine the semantic differences brought by different spatial relations under the same topological structure, and thereby improving the quality of the generated target feature data.
Referring to
The foregoing preset urban indices can be various types of urban indices common in related technologies, such as an urban prosperity index, an urban population mobility, and an urban crime rate index. When the preset urban index is an urban prosperity index, the initial urban index generation model can be the prosperity prediction model in the foregoing embodiments. Then, urban graph data can be constructed based on the method in the foregoing embodiments and the node features of each central node in the feature set can be updated based on the data updating method in the foregoing embodiments to obtain the target feature set. Then, a pre-constructed initial urban index generation model is trained based on the node set, the edge set, and the target feature set to obtain the target model. At this time, the score value is urban prosperity, that is, the trained target model can represent the urban prosperity based on the urban graph data.
Accordingly, when the preset urban index is urban population mobility, a urban graph data can be constructed based on the method in the foregoing embodiments, and the node feature updating and the model training process can be repeated to obtain a target model that can predict urban population mobility.
The foregoing initial urban index generation model can include the graph neural networks (GNNs) and a classifier in the foregoing embodiments. The classifier can be a scene classifier in the neural network model in related technologies. The urban graph data can be input into the initial urban index generation model, and the graph neural networks (GNNs) generates a target feature set based on the urban graph data. Then, the classifier predicts according to the target feature set, the node set, and the edge set to obtain corresponding score values. In the training process, the graph neural network can optimize the foregoing trainable parameters to improve the quality of the target feature data output by the graph neural network.
In specific training process, different losses can be used to optimize the network for different downstream tasks. For example, for node regression tasks (such as regional prosperity prediction), minimum mean squared error (MAE) can be used as a loss function to optimize the network. For node classification tasks (such as dangerous road section identification), cross entropy loss function can be used to train the model.
In one embodiment of the present disclosure, the foregoing target model is a prosperity prediction model. The updating the node features of each of the central nodes in the feature set based on the data updating method according to the foregoing embodiments to obtain the target feature set includes:
Training the pre-constructed initial urban index generation model based on the node set, the edge set, and the target feature set to obtain the target model, includes:
In embodiments of the present disclosure, a spatial heterophily graph neural network (SHGNN) can model and solve the spatial heterophily problem of urban graphs, and improve the representation ability for urban entities. Specifically, firstly, compared with general graph neural networks (homophily graph neural networks), for the problem of heterophily of urban graphs, the model of the present disclosure can consider both the commonality and difference of urban entities associated on urban graphs, and use the difference information to better learn distinguishable representations for associated but dissimilar urban entities. Secondly, compared with existing heterophily graph neural networks, the present disclosure can better solve the unique spatial heterophily problem on urban graphs. Thirdly, the model proposed by the present disclosure can identify the spatial positions of different neighbors in the neighborhood aggregation and message passing process, and then model the diversity of neighbor difference distribution under different spatial relations on urban graphs, that is, the spatial diversity of neighbor heterophily. Fourthly, existing heterophily graph neural networks merely consider limited neighbor differences and cannot model diverse difference distributions. The scheme of the present disclosure utilizes the characteristic that spatially close urban entities on urban graphs have high similarity, and reduces the diversity of difference distribution within groups by grouping neighbors spatially, and achieves a strategy of solving the problem of the spatial diversity of neighbor heterophily by dividing and conquering.
Referring to
Optionally, the relation information includes common information and difference information, the common information is used to represent shared information between the corresponding sub-region and other sub-regions, and the difference information is used to represent the difference information between the corresponding sub-region and other sub-regions.
Optionally, the second generation module 503 is specifically configured to calculate the similarity between the regional features of a target sub-region and the regional features of each of the sub-regions in the region partition set to obtain the common information, wherein the common information includes at least two pieces of similarity information corresponding one-to-one with the at least two sub-regions, and the target sub-region is any one of the sub-regions in the region partition set.
Optionally, the second generation module 503 is specifically configured to calculate the difference degree between the regional features of the target sub-region and the regional features of each of the sub-regions in the region partition set to obtain the difference information, wherein the difference information includes at least two pieces of difference degree information corresponding one-to-one with the at least two sub-regions, and the target sub-region is any one of the sub-regions in the region partition set.
Optionally, the first updating module 504 is specifically configured to update the regional features of each of the sub-regions based on the relation set to obtain target regional features of each of the sub-regions;
Optionally, the first updating module 504 is specifically configured to update the regional features of each of the sub-regions based on the common information in the relation set to obtain a first feature of each of the sub-regions;
Optionally, the partition module 501 is configured to perform an M-fold region partition on the target region based on a target partition method to obtain the region partition set, the region partition set includes M region partition subsets corresponding one-to-one with the M-fold region partition, each of the region partition subsets includes at least two sub-regions, different fold partitions in the M-fold region partition corresponding to different partition parameters, the M is an integer greater than 1, and the partition parameters includes at least one of the following: position parameters of partitioning lines in the target region and distance parameters between the different partitioning lines.
Optionally, the target partition method includes a first sub-partition method and a second sub-partition method, and performing an i-th fold partition in the M-fold region partition on the target region based on the target partition method includes:
Optionally, the first updating module includes:
Optionally, the fusion submodule 5041 is further specifically configured to concatenate the target regional features of the sub-regions within the each first sub-region group respectively to obtain the M first feature data.
Optionally, the fusion submodule 5041 is further specifically configured to concatenate the target regional features of the sub-regions within the each first sub-region group respectively to obtain the M first feature data.
Optionally, the updating submodule 5042 includes:
Optionally, the first generation module 502 is specifically configured to aggregate the node features corresponding to all nodes located within the same sub-region to obtain the regional features of each of the sub-regions.
It should be noted that the data updating apparatus 500 provided by the present embodiment can implement all the technical solutions of the foregoing data updating method embodiments, and thus can at least achieve all the foregoing technical effects. Details are not repeated here.
Referring to
an obtaining module 801 configured to obtain urban graph data, the urban graph data including a node set, an edge set, and a feature set, the node set including central nodes corresponding to preset urban entities in the preset region, the edge set including neighborhoods corresponding to the central nodes, the neighborhoods including other nodes in the node set possessing connecting edges with the central nodes, the feature set including node features of the central nodes, the neighborhoods corresponding to a target region in the preset region, and the preset urban entities corresponding to the nodes in the neighborhood are located within the target region;
It should be noted that the model training apparatus 800 provided by the present embodiment can implement all the technical solutions of the foregoing data updating method embodiments, and thus can at least achieve all the foregoing technical effects. Details are not repeated here.
In the technical solutions of the present disclosure, the obtaining, storage and application of user personal information involved are in compliance with the relevant laws and regulations, and do not violate public order and good morals.
According to embodiments of the present disclosure, an electronic device, a readable storage medium and a computer program product are further provided.
As shown in
Multiple components in the device 900 are connected to the I/O interface 905. The multiple components include: an input unit 906, e.g., a keyboard, a mouse and the like; an output unit 907, e.g., a variety of displays, loudspeakers, and the like; a storage unit 908, e.g., a magnetic disk, an optic disc and the like; and a communication unit 909, e.g., a network card, a modem, a wireless transceiver, and the like. The communication unit 909 allows the device 900 to exchange information/data with other devices through a computer network and/or other telecommunication networks, such as the Internet.
The computing unit 901 may be any general purpose and/or special purpose processing components having a processing and computing capability. Some examples of the computing unit 901 include, but are not limited to: a central processing unit (CPU), a graphic processing unit (GPU), various special purpose artificial intelligence (AI) computing chips, various computing units running a machine learning model algorithm, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 901 carries out the aforementioned methods and processes, e.g., the data updating method or model training method. For example, in some embodiments, the data updating method or model training method may be implemented as a computer software program tangibly embodied in a machine readable medium such as the storage unit 908. In some embodiments, all or a part of the computer program may be loaded and/or installed on the device 900 through the ROM 902 and/or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the foregoing data updating method or model training method may be implemented. Optionally, in other embodiments, the computing unit 801 may be configured in any other suitable manner (e.g., by means of a firmware) to implement the data updating method or model training method.
Various implementations of the aforementioned systems and techniques may be implemented in a digital electronic circuit system, an integrated circuit system, a field-programmable gate array (FPGA), an application specific integrated circuit (ASIC), an application specific standard product (ASSP), a system on a chip (SOC), a complex programmable logic device (CPLD), a computer hardware, a firmware, a software, and/or a combination thereof. The various implementations may include an implementation in form of one or more computer programs. The one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor. The programmable processor may be a special purpose or general purpose programmable processor, may receive data and instructions from a storage system, at least one input device and at least one output device, and may transmit data and instructions to the storage system, the at least one input device and the at least one output device.
Program codes for implementing the methods of the present disclosure may be written in one programming language or any combination of multiple programming languages. These program codes may be provided to a processor or controller of a general purpose computer, a special purpose computer, or other programmable data processing device, such that the functions/operations specified in the flow diagram and/or block diagram are implemented when the program codes are executed by the processor or controller. The program codes may be run entirely on a machine, run partially on the machine, run partially on the machine and partially on a remote machine as a standalone software package, or run entirely on the remote machine or server.
In the context of the present disclosure, the machine readable medium may be a tangible medium, and may include or store a program used by an instruction execution system, device or apparatus, or a program used in conjunction with the instruction execution system, device or apparatus. The machine readable medium may be a machine readable signal medium or a machine readable storage medium. The machine readable medium includes, but is not limited to: an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any suitable combination thereof. A more specific example of the machine readable storage medium includes: an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read only memory (ROM), an erasable programmable read only memory (EPROM or flash memory), an optic fiber, a portable compact disc read only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
To facilitate user interaction, the system and technique described herein may be implemented on a computer. The computer is provided with a display device (for example, a cathode ray tube (CRT) or liquid crystal display (LCD) monitor) for displaying information to a user, a keyboard and a pointing device (for example, a mouse or a track ball). The user may provide an input to the computer through the keyboard and the pointing device. Other kinds of devices may be provided for user interaction, for example, a feedback provided to the user may be any manner of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received by any means (including sound input, voice input, or tactile input).
The system and technique described herein may be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middle-ware component (e.g., an application server), or that includes a front-end component (e.g., a client computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the system and technique), 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 a local area network (LAN), a wide area network (WAN) and the Internet.
The computer system can include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The relation of client and server arises by virtue of computer programs running on respective computers and having a client-server relation to each other.
It is appreciated, all forms of processes shown above may be used, and steps thereof may be reordered, added or deleted. For example, as long as expected results of the technical solutions of the present disclosure can be achieved, steps set forth in the present disclosure may be performed in parallel, performed sequentially, or performed in a different order, and there is no limitation in this regard.
The foregoing specific implementations constitute no limitation on the scope of the present disclosure. It is appreciated by those skilled in the art, various modifications, combinations, sub-combinations and replacements may be made according to design requirements and other factors. Any modifications, equivalent replacements and improvements made without deviating from the spirit and principle of the present disclosure shall be deemed as falling within the scope of the present disclosure.
Number | Date | Country | Kind |
---|---|---|---|
202310506727.6 | May 2023 | CN | national |