SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Table 5: Statistics of five USTP datasets in NYC and CHI.
Dataset	Taxi	Bike	NYC Mobility	Crime	311 service	Taxi	Bike	CHI Mobility	Crime	311 service
# of records	1,118,584	383,919	1,052,232	389,551	3,141,153	3,826,868	1,085,690	939,543	202,291	1,821,949
# of vertices	260	2,500	1,600	260	260	77	1,500	1,000	77	77
Time span	04/01/2020-06/31/2020	01/01/2021-31/12/2021	04/01/2019-06/31/2019	01/01/2021-31/12/2021
Time interval	30 minutes	120 minutes	30 minutes	120 minutes
The embedding dimension is set to  $d = 32$  for all methods. The result in Table 4 indicates that almost all non-Euclidean (i.e., hyperbolic and spherical space) embedding methods outperform Euclidean embedding methods, aligning with their capability to explicitly represent hierarchical and cyclic structures in urban knowledge graphs. Moreover, models that derive a product space (i.e., combination of hyperbolic space and spherical space) to simultaneously capture hierarchies and cycles obtain the dominant performance. This can be attributed to the fact that UrbanKGs often exhibit both high-order hierarchies and cycles, making them suitable for simultaneous modeling in hyperbolic space and spherical space. We report detailed results, analysis and implement details in Appendix A.2.
4 Knowledge-enhanced Urban SpatioTemporal Prediction
In this section, we first give a formal problem statement of USTP, then introduce how to incorporate UrbanKG to enhance five USTP tasks. Finally, we extensively discuss the experimental results.
Let  $G = (V, E, A)$  denote a spatial network (e.g., road network, sensor network, grid etc.), where  $V$  and  $E$  denote the set of vertices and edges. We use  $A$  to denote the adjacency matrix of the spatial network  $G$ . We further define the graph signal matrix  $X_G^{(t)} \in \mathbb{R}^{N \times C}$  for  $G$ , where  $C$  denotes the dimension of feature,  $N = |V|$  is the number of vertices, and  $X_G^{(t)}$  represents the observations of spatio network  $G$  at time step  $t$ . In general, the knowledge-enhanced urban spatiotemporal task aims to learn a multi-step prediction function  $f$  based on past observations and the UrbanKG  $\mathcal{G}$ ,
$$
\left(X _ {G} ^ {(t)}, X _ {G} ^ {(t + 1)}, \dots , X _ {G} ^ {t + \tau}\right) = f \left(\left(X _ {G} ^ {(t - T)}, X _ {G} ^ {(t - T + 1)}, \dots , X _ {G} ^ {t - 1}\right)\right), \mathcal {G}) \tag {1}
$$
where  $\mathcal{G}$  is the UrbanKG we constructed,  $T$  is the input length of past observations,  $\tau$  is the future steps we aim to predict.
4.2 Incorporating UrbanKG Embedding
We demonstrate the effectiveness of UrbanKG by directly concatenating the learned UrbanKG embeddings with the graph signal matrix. In this work, we consider the following five USTP tasks.
Taxi Service Prediction. Taxi service prediction aims to predict future taxi inflow and outflow based on the historical taxi service. Following existing studies [38], we split the city into  $N$  disjoint areas, and connect the spatial network  $G$  based on area adjacency. Let  $C_{taxi}$  denote the two-dimensional feature vector (inflow and outflow). We incorporate the UrbanKG by concatenating the area embeddings with the taxi flow features,  $X_G^{(t)} \in \mathbb{R}^{N \times C_{taxi'}}$ , where  $C_{taxi'} = e_{Area} || C_{taxi}$  and  $||$  denotes the concatenation operation.
**Bike Trip Prediction.** Bike trip prediction aims to predict future inflow and outflow based on the historical bike trip. We sample  $N$  roads and connect the spatial network  $G$  based on road adjacency [13]. Let  $C_{bike}$  represent the two-dimensional feature vector (inflow and outflow). The road embedding  $e_{Road}$  is concatenated with it for UrbanKG fusion,  $X_G^{(t)} \in \mathbb{R}^{N \times C_{bike}}$ , where  $C_{bike'} = e_{Road}||C_{bike}$ .
Human Mobility Prediction. Human mobility prediction aims to predict future human inflow and outflow based on historical human mobility. Following existing studies [39], We choose  $N$  POIs and obtain the spatial network  $G$  based on their adjacency. Let  $C_{human}$  denote the two-dimensional feature vector (inflow and outflow). We integrate the UrbanKG by concatenating human mobility flow features with POI embedding,  $X_G^{(t)} \in \mathbb{R}^{N \times C_{human'}}$ , where  $C_{human'} = e_{POI} \parallel C_{human}$ .
Crime Prediction. Crime prediction is a binary prediction task based on the observation of historical crime events. Following existing studies [40], we split the city into  $N$  disjoint areas and connect the spatial network  $G$  according to area adjacency. Let  $C_{crime}$  denote the label of whether the crime occurs. We concatenate the Area embedding  $e_{Area}$  with crime feature,  $X_G^{(t)} \in \mathbb{R}^{N \times C_{crime'}}$ , where  $C_{crime'} = e_{Area} \parallel C_{crime}$ .
311 Service Prediction. 311 service prediction [41] is also a binary prediction task based on the observation of historical 311 complaint events. We obtain the spatial network  $G$  in the same way as crime prediction. Let  $C_{service}$  denote the label of the 311 complaint occurrence. We concatenate the Area embedding  $e_{Area}$  with its feature,  $X_G^{(t)} \in \mathbb{R}^{N \times C_{service'}}$ , where  $C_{service'} = e_{Area} \parallel C_{service}$ .
The result in Table 4 indicates that structure-aware non-Euclidean space embedding models can generate a better urban knowledge representation compared with Euclidean methods. To further verify modeling those high-order structures in Section 2.3 could enhance USTP tasks, we compare performance gaps for USTP tasks across different prediction time steps (3, 6, and 9) when using embeddings derived from different spaces. Next, we inject the embeddings from the space that yielded the greatest improvement into all downstream tasks and USTP models to confirm their benefits.
Data Description. The data statistics of five datasets are summarized in Table 5, and we provide the details of each dataset in Appendix A.3.
Evaluation Metrics. We utilize MAE and RMSE for regression tasks for evaluation [42] and use Micro-F1 and Macro-F1 [43] for classification tasks for evaluation.
Methods. We compare our approach with the following 9 methods: (1) Gate Recurrent Units (GRU) [44]; (2) Auto-Encoder (AE) [45]; (3) Long Short-Term Memory (LSTM) [46]; (4) SpatioTemporal Graph Convolution Network (STGCN) [47]; (5) Attention Based Spatial-Temporal Graph Convolutional Networks (ASTGCN) [48]; (6) Temporal Graph Convolutional Network (TGCN) [49]; (7) Multivariate Time Graph Neural Networks (MTGNN) [50]; (8) Adaptive Graph Convolutional Recurrent Network (AGCRN) [51]; (9) Hierarchical Graph Convolution Networks (HGCN) [52]. We incorporate UrbanKG embeddings from different spaces with USTP models as our approach, such as ASTGCN w/P and P denotes embedding from product space.
Implement Details. We split data with a ratio of 7:1:2 into training sets, validation sets and test sets. We use historical 12 time steps to predict the future 1 to 12 time steps. We provide implement details and more detailed results in Appendix A.4.
Comparison of UrbanKG Embedding Space Variants. As depicted in Figure 4, we observe that the UrbanKG embeddings could enhance USTP tasks regardless of which spaces they come from.
Additionally, hyperbolic and spherical space embeddings demonstrate greater performance improvements compared to Euclidean methods (i.e., Euclidean and complex space). Notably, the embedding derived from the product space yields the most substantial benefit for both urban flow forecasting and urban event prediction. Such result is consistent with their state-of-art performance in link prediction task. It indicates that explicitly representing urban structures is helpful for urban knowledge extraction and can be further explored to develop downstream tasks performances.
Comparison of USTP Task Variants. Table 6 shows the results of forecasting urban flow (i.e., taxi service, bike trip and mobility prediction) for future period of 30 mins and predicting urban events (i.e., urban crime and 311 service prediction) for future period of 120 mins. As can be seen, integrating product space UrbanKG embeddings consistently improves the accuracy
Figure 4: USTP performance comparison when incorporating embeddings derived by the best method of each space. (a) Performance on NYC Taxi. (b) Performance on NYC Crime.
of five tasks. The urban knowledge graph shows great potential (2%-10% improvement) in spatiotemporal flow prediction tasks, and it can also enhance (1%-5% improvement) urban event prediction. It is worth mentioning that the embeddings derived from UrbanKG are task-agnostic, where the downstream task is completely unknown. Such results indicate the UrbanKG embedding successfully captures general urban knowledge which is transferable among different USTP tasks.
Comparison of USTP Model Variants. It can be observed that integrating UrbanKG embeddings consistently improves the accuracy of six existing USTP models. The above results demonstrate well-extracted urban knowledge can still enhance existing USTP models (e.g., ASTGCN and HGCN) from the feature representation scenario although they may already have sufficiently complex modules.
We provide implement details in Appendix A.4 and report more detailed results in Appendix A.5.
Domain Knowledge Graph Construction. Knowledge graph has been widely studied in both academia and industry. In recent years, many open-source knowledge graphs have been released to
improve applications in various domains. For example, CKGG [53], OpenBG [54], BioKG [55] and recent proposed ProteinKG25 [56] are used for education, business, biomedical and protein research field respectively. However, there is still no open-source knowledge graph for urban spatiotemporal prediction tasks in the urban computing field.
Knowledge Graph Embedding. Knowledge graph embedding aims to project entities and relations into low-dimensional vectors, which has been widely used for various KG-based applications. Overall, the knowledge graph embedding method can be categorized into two classes, the Euclidean embedding method and the non-Euclidean embedding method. The Euclidean embedding method derives KG embeddings in the Euclidean space. For example, TransE [30], TransH [57], TransR [58], RESCAL [59], DistMult [32], TuckER [35] and ConvE [60] utilize translation, matrix decomposition, or neural network to model entities and relations and derive embeddings. The non-Euclidean embedding method aims to capture more complicated structures in the latent space. For example, MuRP [16], AttH [17], ConE [18] and UltraE [61] model hierarchies in the hyperbolic or ultrahyperbolic space. Recently, several mixed curvature embedding methods [26, 37, 62] have been proposed to simultaneously encode diverse structures (e.g., hierarchies and cycles) in a product space (i.e., products of constant-curvature spaces). The above structure-aware non-Euclidean methods show great potential for modeling various high-order structures in UrbanKG.
Knowledge-enhanced Urban Spatiotemporal Prediction. Knowledge graph has been proven useful in various urban tasks, such as traffic flow prediction [63, 64, 65, 66], mobility prediction [7, 67, 68], site selection [69], city profiling [70, 71, 72, 73] and so on [74]. Their common approach involves manually constructing a UrbanKG, and then obtaining embeddings using classical methods like TransE [30] or TuckER [35]. Although some very recent methods [70, 71, 72] design task-relevant module to capture more granular urban knowledge, their UrbanKGs are still designed for specific tasks and are publicly not available, which discourages researchers from adopting it for their own work as building an UrbanKG from scratch is time-consuming and labor-intensive. In fact, several recent works [75, 8] are striving towards this problem. However, they only describe a UrbanKG construction scheme or system but do not offer an open-source UrbanKG.
In this work, we proposed UUKG, a unified dataset for knowledge-enhanced urban spatiotemporal prediction. To the best of our knowledge, UUKG is the first open-source urban knowledge graph dataset compatible with various aligned USTP tasks in the urban computing field. Extensive experimental results demonstrate the universal advancement of UUKG in improving diverse USTP tasks. Additionally, we also prove the benefits of adopting state-of-art structure-aware UrbanKG embedding methods to further leverage rich high-order structures in UUKG.
Our work provides a unified UrbanKG construction framework but it has limitations in terms of the dataset generalizability, as all experiments were conducted in two US metropolises. In addition, we only consider concatenation operation for embedding fusion. It will be an interesting topic that how to suitably incorporate the learned embeddings to further enhance the performance of the urban spatiotemporal prediction. Despite the above limitations, we hope the constructed dataset can foster more extensive urban knowledge graph research and broad smart city application.
7 Maintenance Plan and Future Work
To ensure ease of access and future maintenance, the dataset and models evaluated in our paper are hosted on websites and cloud-based storage platforms. Specifically, we have created the UUKG homepage including detailed dataset descriptions and the evaluation code. The full dataset is available at Google Drive.
As an emerging building block, urban knowledge graph provides critical knowledge for urban spatiotemporal prediction models. Inevitably, more dataset, benchmarks and tools will be needed to facilitate its potential achievement. Therefore, we plan to continuously update UUKG by adding new urban entities derived from different data sources, new downstream tasks, and more friendly data usage toolkits and model interfaces. UUKG currently only contains the urban structural dataset for five types of USTP tasks. In the future, we will derive extra multi-modal data (e.g., images, reviews) to enrich the UrbanKG and introduce more USTP tasks (e.g., trajectory prediction and site selection).
This research was supported in part by the National Natural Science Foundation of China under Grant No.62102110, the Alibaba Innovative Research Program (AIR). We appreciate the guidance provided by the team of Mr. Wang Qing, who is the Regional General Manager of Alibaba Cloud, in the Chongqing City Brain project.
[68] Haoran Xin, Xinjiang Lu, Tong Xu, Hao Liu, Jingjing Gu, Dejing Dou, and Hui Xiong. Out-of-town recommendation with travel intention modeling. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 4529-4536, 2021.
[69] Yu Liu, Jingtao Ding, and Yong Li. Knowledge-driven site selection via urban knowledge graph. arXiv preprint arXiv:2111.00787, 2021.
[70] Zhilun Zhou, Yu Liu, Jingtao Ding, Depeng Jin, and Yong Li. Hierarchical knowledge graph learning enabled socioeconomic indicator prediction in location-based social network. In Proceedings of the ACM Web Conference, pages 122-132, 2023.
[71] Yu Liu, Zhilun Zhou, Yong Li, and Depeng Jin. Urban knowledge graph aided mobile user profiling. ACM Trans. Knowl. Discov. Data, 1(1), 2023.
[72] Yu Liu, Xin Zhang, Jingtao Ding, Yanxin Xi, and Yong Li. Knowledge-infused contrastive learning for urban imagery-based socioeconomic prediction. In Proceedings of the ACM Web Conference, pages 4150-4160, 2023.
[73] Weijia Zhang, Hao Liu, Lijun Zha, Hengshu Zhu, Ji Liu, Dejing Dou, and Hui Xiong. Mugrep: A multi-task hierarchical graph representation learning framework for real estate appraisal. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, pages 3937-3947, 2021.
[74] Qingyan Zhu, Yize Chen, Hao Wang, Zhenyu Zeng, and Hao Liu. A knowledge-enhanced framework for imitative transportation trajectory generation. In 2022 IEEE International Conference on Data Mining (ICDM), pages 823-832. IEEE, 2022.
[75] Yu Liu, Jingtao Ding, Yanjie Fu, and Yong Li. Urban knowledge graph system. ACM Transactions on Intelligent Systems and Technology, 14(4):1-25, 2023.
[76] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.